app.7cf24e91.js.map 441 KB

1
  1. {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/App.vue?9b05","webpack:///./src/utils/ofd/pipeline.js","webpack:///./src/App.vue?e61b","webpack:///./src/components/ofd.vue?5fa9","webpack:///src/components/ofd.vue","webpack:///./src/components/ofd.vue?f0ed","webpack:///./src/components/ofd.vue","webpack:///src/App.vue","webpack:///./src/App.vue?a7d1","webpack:///./src/App.vue","webpack:///./src/main.js","webpack:///./src/utils/ofd/ofd_parser.js","webpack:///./src/utils/ofd/ofd_util.js","webpack:///./src/utils/jbig2/util.js","webpack:///./src/utils/jbig2/core_utils.js","webpack:///./src/utils/jbig2/arithmetic_decoder.js","webpack:///./src/utils/jbig2/ccitt.js","webpack:///./src/utils/jbig2/jbig2.js","webpack:///./src/utils/ofd/ofd_render.js","webpack:///./src/utils/jbig2/compatibility.js","webpack:///./src/utils/ofd/ofd.js","webpack:///./src/utils/ofd/sm3.js","webpack:///./src/utils/ofd/verify_signature_util.js","webpack:///./src/utils/ofd/ses_signature_parser.js","webpack:///./src/utils/jbig2/is_node.js","webpack:///./src/components/ofd.vue?844b"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","Array","pipeline","callback","this","TypeError","index","_pipeline","funcs","a","b","_vm","_h","$createElement","_c","_self","attrs","staticRenderFns","staticStyle","staticClass","on","print","_v","downPdf","_e","plus","minus","firstPage","prePage","_s","pageIndex","pageCount","nextPage","lastPage","directives","rawName","expression","ref","scrool","dragseal","docleft","leftMenu_width","pdfFile","ofdBase64","loading","scale","title","dialogFormVisible","ofdObj","screenWidth","document","body","clientWidth","created","file","mounted","$refs","contentDiv","addEventListener","onresize","openFile","methods","progressVisible","list","mywindow","open","documentBody","console","log","focus","close","printSecret","top","Math","abs","scrolled","showMore","getElementById","id","innerText","displayOfdDiv","divs","ele","childElementCount","getQueryString","reg","RegExp","location","search","substr","match","unescape","ofdFile","getOfdDocumentObj","ofd","success","res","t1","that","pages","t2","t3","fail","innerHTML","component","components","HelloWorld","Vue","$axios","axios","library","add","fas","config","productionTip","FontAwesomeIcon","use","ElementUI","render","h","App","$mount","parser","require","unzipOfd","Promise","resolve","reject","JsZip","loadAsync","then","zip","e","getDocRoots","getJsonFromXmlContent","docbodys","array","concat","parseSingleDoc","docs","docbody","doGetDocRoot","getDocument","getDocumentRes","getPublicRes","getTemplatePage","getPage","docRoot","replaceFirstSlash","doc","split","signatures","getSignature","stampAnnot","stampAnnotArray","stamp","sealObj","keys","type","getSealDocumentObj","stampObjs","stampObj","boundary","parseStBox","pageRef","obj","img","btoa","String","fromCharCode","ofdArray","stampArray","annot","pageId","documentObj","annotations","indexOf","annoBase","substring","files","getAnnotations","annotationObjs","anno","fileLoc","visible","appearance","appearanceObj","Document","documentResPath","fontResObj","drawParamResObj","multiMediaResObj","compositeGraphicUnits","documentResObj","getFont","getDrawParam","getMultiMediaRes","getCompositeObject","publicResPath","publicResObj","fontObj","assign","drawParamObj","multiMediaObj","templatePages","tpls","templatePage","parsePage","pageObj","page","currentPageStamp","annotationObj","annotation","fonts","fontArray","font","drawParams","item","multiMedias","toLowerCase","format","ext","getExtensionByPath","parseJbig2ImageFromZip","jbig2","parseOtherImageFromZip","compositeGraphicUnitsArray","pagePath","signature","signatureArray","sign","signatureLoc","signatureID","getSignatureData","getFileData","async","signedValue","toString","replace","lastIndexOf","parseSesSignature","checkMethod","global","toBeChecked","Map","arr","forEach","reference","hashed","fileData","set","verifyRet","catch","xmlName","content","ops","attributeNamePrefix","ignoreAttributes","parseNodeValue","trimValues","jsonObj","parse","bytes","Jbig2Image","width","height","convertPathAbbreviatedDatatoPoint","abbreviatedData","pointList","point","parseFloat","calPathPoint","abbreviatedPoint","x","y","converterDpi","x1","y1","x2","y2","x3","y3","realPoint","rx","ry","rotation","arc","sweep","millimetersToPixel","mm","dpi","MaxScale","Scale","setMaxPageScal","setPageScal","getPageScal","deltaFormatter","delta","floatList","f","gFlag","gProcessing","gItemCount","trim","parseInt","calTextPoint","textCodes","textCodePointList","textCode","isNaN","deltaXList","deltaYList","textStr","decodeHtml","text","textCodePoint","str","path","REGX_HTML_DECODE","HTML_DECODE","undefined","$0","$1","FONT_FAMILY","getFontFamily","w","parseCtm","ctm","parseColor","color","converterBox","box","Uint8ArrayToHexString","words","hexChars","bite","join","VerbosityLevel","ERRORS","WARNINGS","INFOS","verbosity","info","msg","unreachable","Error","shadow","prop","configurable","writable","BaseException","message","constructor","digits","log2","ceil","readInt8","offset","readUint16","readUint32","QeTable","qe","nmps","nlps","switchFlag","ArithmeticDecoder","start","end","bp","dataEnd","chigh","clow","byteIn","ct","contexts","pos","cx_index","cx_mps","qeTableIcx","qeIcx","CCITTFaxDecoder","ccittEOL","ccittEOF","twoDimPass","twoDimHoriz","twoDimVert0","twoDimVertR1","twoDimVertL1","twoDimVertR2","twoDimVertL2","twoDimVertR3","twoDimVertL3","twoDimTable","whiteTable1","whiteTable2","blackTable1","blackTable2","blackTable3","source","options","next","eof","encoding","K","eoline","EndOfLine","byteAlign","EncodedByteAlign","columns","Columns","rows","Rows","code1","eoblock","EndOfBlock","black","BlackIs1","codingLine","Uint32Array","refLine","codingPos","row","nextLine2D","inputBits","inputBuf","outputBits","rowsDone","_lookBits","_eatBits","readNextChar","refPos","blackPixels","bits","code2","code3","err","_getTwoDimCode","_addPixels","_getBlackCode","_getWhiteCode","_addPixelsNeg","gotEOL","a1","_findTableCode","table","limit","limitValue","code","Jbig2Error","ContextCache","DecodingContext","decodeInteger","contextCache","procedure","decoder","getContexts","prev","readBits","v","bit","readBit","decodeIAID","codeLength","Int8Array","cache","SegmentTypes","CodingTemplates","RefinementTemplates","coding","ReusedContexts","RefinementReusedContexts","decodeBitmapTemplate0","decodingContext","contextLabel","pixel","row1","row2","bitmap","OLD_PIXEL_MASK","Uint8Array","decodeBitmap","mmr","templateIndex","prediction","skip","at","input","Reader","decodeMMRBitmap","useskip","template","sort","k","templateLength","templateX","templateY","changingTemplateEntries","reuseMask","minX","maxX","minY","min","max","changingEntriesLength","changingTemplateX","changingTemplateY","changingTemplateBit","Uint16Array","i0","j0","sbb_left","sbb_top","sbb_right","pseudoPixelContext","ltp","sltp","decodeRefinement","referenceBitmap","offsetX","offsetY","codingTemplate","codingTemplateLength","codingTemplateX","Int32Array","codingTemplateY","referenceTemplate","referenceTemplateLength","referenceTemplateX","referenceTemplateY","referenceWidth","referenceHeight","decodeSymbolDictionary","huffman","refinement","symbols","numberOfNewSymbols","numberOfExportedSymbols","huffmanTables","refinementTemplateIndex","refinementAt","huffmanInput","tableB1","symbolWidths","newSymbols","currentHeight","symbolCodeLength","getStandardTable","deltaHeight","tableDeltaHeight","decode","currentWidth","totalWidth","firstSymbol","deltaWidth","tableDeltaWidth","numberOfInstances","decodeTextRegion","symbolId","rdx","rdy","symbol","bitmapSize","tableBitmapSize","collectiveBitmap","readUncompressedBitmap","originalEnd","bitmapEnd","position","numberOfSymbolsDecoded","xMin","xMax","bitmapWidth","symbolBitmap","subarray","exportedSymbols","flags","currentFlag","totalSymbolsLength","runLength","ii","defaultPixelValue","numberOfSymbolInstances","stripSize","inputSymbols","transposed","dsOffset","referenceCorner","combinationOperator","logStripSize","stripT","tableDeltaT","firstS","deltaT","deltaFirstS","tableFirstS","currentS","currentT","symbolIDTable","applyRefinement","symbolWidth","symbolHeight","rdw","rdh","s2","symbolRow","offsetT","offsetS","maxWidth","deltaS","tableDeltaS","decodePatternDictionary","patternWidth","patternHeight","maxPatternIndex","collectiveWidth","patterns","patternBitmap","decodeHalftoneRegion","regionWidth","regionHeight","enableSkip","gridWidth","gridHeight","gridOffsetX","gridOffsetY","gridVectorX","gridVectorY","regionBitmap","numberOfPatterns","pattern0","bitsPerValue","mmrInput","mg","ng","patternIndex","patternRow","regionRow","grayScaleBitPlanes","regionX","regionY","readSegmentHeader","segmentHeader","number","segmentType","typeName","deferredNonRetain","pageAssociationFieldSize","referredFlags","referredToCount","retainBits","referredToSegmentNumberSize","referredTo","pageAssociation","genericRegionInfo","readRegionSegmentInformation","genericRegionSegmentFlags","RegionSegmentInformationFieldLength","genericRegionMmr","searchPatternLength","searchPattern","headerEnd","readSegments","header","segments","segment","randomAccess","processSegment","visitor","args","atLength","dictionary","dictionaryFlags","huffmanDHSelector","huffmanDWSelector","bitmapSizeSelector","aggregationInstancesSelector","bitmapCodingContextUsed","bitmapCodingContextRetained","refinementTemplate","textRegion","textRegionSegmentFlags","textRegionHuffmanFlags","huffmanFS","huffmanDS","huffmanDT","huffmanRefinementDW","huffmanRefinementDH","huffmanRefinementDX","huffmanRefinementDY","huffmanRefinementSizeSelector","patternDictionary","patternDictionaryFlags","halftoneRegion","halftoneRegionFlags","genericRegion","pageInfo","resolutionX","resolutionY","pageSegmentFlags","lossless","requiresBuffer","combinationOperatorOverride","callbackName","processSegments","parseJbig2Chunks","chunks","SimpleSegmentVisitor","chunk","buffer","parseJbig2","numberOfPages","currentPageInfo","bitPacked","imgData","Uint8ClampedArray","q","mask","HuffmanLine","lineData","isOOB","rangeLow","prefixLength","rangeLength","prefixCode","isLowerRange","HuffmanTreeNode","line","children","isLeaf","HuffmanTable","lines","prefixCodesDone","assignPrefixCodes","rootNode","buildTree","decodeTablesSegment","lowestValue","highestValue","reader","prefixSizeBits","rangeSizeBits","currentRangeLow","onPageInformation","rowSize","drawBitmap","regionInfo","mask0","offset0","onImmediateGenericRegion","region","onImmediateLosslessGenericRegion","arguments","onSymbolDictionary","currentSegment","referredSegments","getSymbolDictionaryHuffmanTables","customTables","referredSymbols","onImmediateTextRegion","getTextRegionHuffmanTables","onImmediateLosslessTextRegion","onPatternDictionary","onImmediateHalftoneRegion","onImmediateLosslessHalftoneRegion","onTables","node","decodeNode","htOffset","linesLength","prefixLengthMax","histogram","currentCode","currentTemp","currentLength","firstCode","standardTablesCache","currentByte","getCustomHuffmanTable","currentIndex","numberOfSymbols","codes","runCodesTable","repeatedLength","numberOfRepeats","customIndex","tableAggregateInstances","endOfBlock","params","lookForEOFLimit","numBits","parseChunks","calPageBox","area","physicalBox","applicationBox","contentBox","documentArea","toFixed","calPageBoxScale","renderPage","pageDiv","layers","layer","renderLayer","contentLayers","contentLayer","fixIndex","json","pfIndex","renderSealPage","SES_Signature","signedInfo","sealBoundary","oid","isArray","element","renderImageOnDiv","style","clip","appendChild","renderAnnotation","div","createElement","setAttribute","divBoundary","isStampAnnot","stampAnnotBoundary","JSON","stringify","compositeObjectAlpha","compositeObjectBoundary","compositeObjectCTM","fillColor","strokeColor","lineWith","drawParam","imageObjects","imageObjectArray","imageObject","renderImageObject","pathObjects","pathObjectArray","pathObject","svg","renderPathObject","textObjects","textObjectArray","textObject","renderTextObject","compositeObjects","compositeObjectArray","compositeObject","compositeGraphicUnit","currentCompositeObjectAlpha","currentCompositeObjectBoundary","currentCompositeObjectCTM","pageBlocks","pageBlockArray","pageBlock","pageWidth","pageHeight","resId","renderImageOnCanvas","imgWidth","imgHeight","imageData","ImageData","canvas","context","getContext","putImageData","imgSrc","src","ctms","removeAttribute","pw","ph","defaultFillColor","defaultStrokeColor","defaultFillOpacity","hScale","weight","size","createElementNS","isAxialShd","alpha","AxialShd","linearGradient","stop","left","defaultLineWith","lineWidth","points","LineWidth","dash","dashs","comSvg","PDFJSDev","test","globalThis","_pdfjsCompatibilityChecked","isNodeJS","chars","Buffer","from","atob","startsWith","endsWith","includes","fromEntries","Number","isInteger","allSettled","URL","isReadableStreamSupported","ReadableStream","controller","entries","Set","WeakMap","WeakSet","codePointAt","fromCodePoint","padStart","padEnd","values","JSZipUtils","createStandardXHR","XMLHttpRequest","createActiveXHR","ActiveXObject","_getBinaryFromXHR","xhr","response","responseText","createXHR","getBinaryContent","promise","_resolve","_reject","responseType","overrideMimeType","onreadystatechange","event","readyState","status","statusText","progress","onprogress","originalEvent","percent","loaded","total","withCredentials","send","parseOfdDocument","File","ArrayBuffer","doParseOFD","xmlParseFlag","renderOfd","divArray","renderOfdByScale","setPageScale","getPageScale","leftPad","num","binary2hex","binary","binaryLength","hex","hex2binary","hexLength","rol","binaryCal","method","prevResult","xor","and","or","carry","not","calMulti","reduce","curr","P0","X","P1","FF","Y","Z","GG","T","CF","V","Bi","wordLength","W","M","wordRegister","SS1","SS2","TT1","TT2","A","B","C","D","E","F","G","H","sm3","hexstr","len","digestByteArray","hashedBase64","hashedHex","Base64","md5","sha1","SES_Signature_Verify","signAlg","realVersion","toSign","signatureAlgorithm","signatureAlgID","toSignDer","sigValueHex","cert","publicKey","subjectPublicKeyInfo","subjectPublicKey","sm2","doVerifySignature","der","hash","userId","sig","rsa","KJUR","crypto","Signature","init","updateHex","verify","reHex","decodeText","digestCheckProcess","ret","val","Hex","unarmor","decodeSES_Signature","eseal","esealInfo","picture","byte","decodeUTCTime","asn1","ASN1","createDate","sub","stream","parseTime","validStart","validEnd","timeInfo","asn1CertList","certList","asn1Cert","parseOctetString","asn1ExtDatas","extDatas","asn1ExtData","parseOID","parseInteger","enc","parseStringUTF","decodeCert","hexDump","certListType","Uint8ArrayToString","asn1Subject","subject","asn1PublicKeyInfo","dataString","process","versions","nw","electron"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANVC,EAAWH,EAAK,GAChBI,EAAcJ,EAAK,GACnBK,EAAiBL,EAAK,GAIHM,EAAI,EAAGC,EAAW,GACpCD,EAAIH,EAASK,OAAQF,IACzBJ,EAAUC,EAASG,GAChBG,OAAOC,UAAUC,eAAeC,KAAKC,EAAiBX,IAAYW,EAAgBX,IACpFK,EAASO,KAAKD,EAAgBX,GAAS,IAExCW,EAAgBX,GAAW,EAE5B,IAAID,KAAYG,EACZK,OAAOC,UAAUC,eAAeC,KA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,EAAKN,MAGrB,IAAM4kC,EAAoB1B,EAAKG,IAAI,GAAGA,IAAI,GAAGA,IAAI,GACjD,MAAO,CACHsB,UACA,WAAaA,EAAQ/kC,IAAI,WACzB,qBAAuB,CACnB,oBAAYglC,EAAkBvB,IAAI,UAAlC,aAAY,EAA0BC,OAAOY,SAASU,EAAkBvB,IAAI,GAAGC,OAAOhrB,IAAIssB,EAAkBvB,IAAI,GAAGhZ,OAAOua,EAAkBvB,IAAI,GAAGC,OAAOhrB,IAAIssB,EAAkBvB,IAAI,GAAGhZ,OAAOua,EAAkBvB,IAAI,GAAG1lC,QACvN,2BAAmBinC,EAAkBvB,IAAI,UAAzC,aAAmB,EAA0BC,OAAOiB,QAAQK,EAAkBvB,IAAI,GAAGC,OAAOhrB,IAAIssB,EAAkBvB,IAAI,GAAGhZ,OAAOua,EAAkBvB,IAAI,GAAGC,OAAOhrB,IAAIssB,EAAkBvB,IAAI,GAAGhZ,OAAOua,EAAkBvB,IAAI,GAAG1lC,UAEvO,MAAOwL,GAEL,OADAjE,QAAQC,IAAIgE,GACL,KAITs7B,EAAqB,SAAUj0B,GAEjC,IADA,IAAIq0B,EAAa,GACRpnC,EAAI,EAAGA,EAAI+S,EAAS7S,OAAQF,IACjConC,GAAct5B,OAAOC,aAAagF,EAAS/S,IAE/C,OAAOonC,I,iGChPLzL,EACe,YAAnB,qBAAO0L,EAAP,2BAAOA,KACPA,EAAU,KAAO,qBAChBA,EAAQC,SAASC,MAChBF,EAAQC,SAASE,UAAYH,EAAQj6B,MAAyB,YAAjBi6B,EAAQj6B,Q,wDCxBzD","file":"js/app.7cf24e91.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t\"app\": 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([0,\"chunk-vendors\"]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","export * from \"-!../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=style&index=0&lang=css&\"","\n'use strict';\nArray.prototype.pipeline = async function(callback){\n if (null === this || 'undefined' === typeof this) {\n // At the moment all modern browsers, that support strict mode, have\n // native implementation of Array.prototype.reduce. For instance, IE8\n // does not support strict mode, so this check is actually useless.\n throw new TypeError(\n 'Array.prototype.pipeline called on null or undefined');\n }\n if ('function' !== typeof callback) {\n throw new TypeError(callback + ' is not a function');\n }\n var index, value,\n length = this.length >>> 0;\n for (index = 0; length > index; ++index) {\n value = await callback(value, this[index], index, this);\n }\n return value;\n};\n\nlet _pipeline = function(...funcs){\n return funcs.pipeline((a, b) => b.call(this, a));\n}\n\nexport const pipeline = _pipeline;\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{attrs:{\"id\":\"app\"}},[_c('HelloWorld')],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-container',{staticStyle:{\"width\":\"100vw\",\"height\":\"100vh\"}},[_c('el-header',{staticStyle:{\"background\":\"#F5F5F5\",\"display\":\"flex\",\"height\":\"40px\",\"border\":\"1px solid #e8e8e8\",\"align-items\":\"center\"}},[_c('div',{staticClass:\"upload-icon\",on:{\"click\":_vm.print}},[_c('font-awesome-icon',{attrs:{\"icon\":\"print\"}}),_c('div',{staticClass:\"upload-icon\"},[_vm._v(\"打印\")])],1),(_vm.ofdObj)?_c('div',{staticStyle:{\"display\":\"flex\",\"align-items\":\"center\"}},[(_vm.ofdBase64)?_c('div',{staticClass:\"upload-icon\",staticStyle:{\"margin-left\":\"10px\"},on:{\"click\":_vm.downPdf}},[_vm._v(\" 下载PDF \"),_c('font-awesome-icon',{attrs:{\"icon\":\"download\"}})],1):_vm._e(),_c('div',{staticClass:\"scale-icon\",staticStyle:{\"margin-left\":\"10px\"},on:{\"click\":_vm.plus}},[_c('font-awesome-icon',{attrs:{\"icon\":\"search-plus\"}})],1),_c('div',{staticClass:\"scale-icon\",on:{\"click\":_vm.minus}},[_c('font-awesome-icon',{attrs:{\"icon\":\"search-minus\"}})],1),_c('div',{staticClass:\"scale-icon\"},[_c('font-awesome-icon',{attrs:{\"icon\":\"step-backward\"},on:{\"click\":_vm.firstPage}})],1),_c('div',{staticClass:\"scale-icon\",staticStyle:{\"font-size\":\"18px\"},on:{\"click\":_vm.prePage}},[_c('font-awesome-icon',{attrs:{\"icon\":\"caret-left\"}})],1),_c('div',{staticClass:\"scale-icon\"},[_vm._v(\" \"+_vm._s(_vm.pageIndex)+\"/\"+_vm._s(_vm.pageCount)+\" \")]),_c('div',{staticClass:\"scale-icon\",staticStyle:{\"font-size\":\"18px\"},on:{\"click\":_vm.nextPage}},[_c('font-awesome-icon',{attrs:{\"icon\":\"caret-right\"}})],1),_c('div',{staticClass:\"scale-icon\",on:{\"click\":_vm.lastPage}},[_c('font-awesome-icon',{attrs:{\"icon\":\"step-forward\"}})],1)]):_vm._e()]),_c('el-main',{directives:[{name:\"loading\",rawName:\"v-loading\",value:(_vm.loading),expression:\"loading\"}],staticStyle:{\"height\":\"auto\",\"background\":\"#808080\",\"padding\":\"0\"},attrs:{\"id\":\"main\"}},[_c('div',{ref:\"contentDiv\",staticClass:\"main-section\",attrs:{\"id\":\"content\"},on:{\"mousewheel\":_vm.scrool}})])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<template>\n <el-container style=\"width:100vw; height: 100vh;\">\n <el-header style=\"background:#F5F5F5;display: flex; height: 40px; border: 1px solid #e8e8e8; align-items: center;\">\n\n <div class=\"upload-icon\" @click=\"print\">\n <font-awesome-icon icon=\"print\"/>\n <div class=\"upload-icon\">打印</div>\n </div>\n<!-- <div class=\"upload-icon\" @click=\"printSecret\">-->\n<!-- <font-awesome-icon icon=\"print\"/>-->\n<!-- <div class=\"upload-icon\">脱密打印</div>-->\n<!-- </div>-->\n <div style=\"display: flex;align-items: center\" v-if=\"ofdObj\">\n <div class=\"upload-icon\" style=\"margin-left: 10px\" @click=\"downPdf\" v-if=\"ofdBase64\">\n 下载PDF\n <font-awesome-icon icon=\"download\"/>\n </div>\n\n <div class=\"scale-icon\" style=\"margin-left: 10px\" @click=\"plus\">\n <font-awesome-icon icon=\"search-plus\"/>\n </div>\n <div class=\"scale-icon\" @click=\"minus\">\n <font-awesome-icon icon=\"search-minus\"/>\n </div>\n <div class=\"scale-icon\">\n <font-awesome-icon icon=\"step-backward\" @click=\"firstPage\"/>\n </div>\n\n <div class=\"scale-icon\" style=\"font-size: 18px\" @click=\"prePage\">\n <font-awesome-icon icon=\"caret-left\"/>\n </div>\n\n <div class=\"scale-icon\">\n {{ pageIndex }}/{{ pageCount }}\n </div>\n\n <div class=\"scale-icon\" style=\"font-size: 18px\" @click=\"nextPage\">\n <font-awesome-icon icon=\"caret-right\"/>\n </div>\n\n <div class=\"scale-icon\" @click=\"lastPage\">\n <font-awesome-icon icon=\"step-forward\"/>\n </div>\n </div>\n </el-header>\n <el-main style=\"height: auto;background: #808080;;padding: 0\" v-loading=\"loading\" id=\"main\">\n <div class=\"main-section\"\n id=\"content\" ref=\"contentDiv\" @mousewheel=\"scrool\">\n </div>\n </el-main>\n </el-container>\n</template>\n\n<script>\n\nimport {parseOfdDocument, renderOfd, renderOfdByScale, getPageScale, setPageScale} from \"@/utils/ofd/ofd\";\n// import * as JSZipUtils from \"jszip-utils\";\n\nexport default {\n name: 'ofd',\n data() {\n return {\n dragseal: false,//是否显示公章图片位置\n docleft: 0,//公章距离左侧文档边缘的距离\n leftMenu_width: 0,//左侧菜单宽度\n pdfFile: null,\n ofdBase64: null,\n loading: false,\n pageIndex: 1,\n pageCount: 0,\n scale: 0,\n title: null,\n value: null,\n dialogFormVisible: false,\n ofdObj: null,\n screenWidth: document.body.clientWidth,\n }\n },\n\n created() {\n this.pdfFile = null;\n this.file = null;\n },\n\n mounted() {\n\n this.screenWidth = document.body.clientWidth;\n let that = this;\n this.$refs.contentDiv.addEventListener('scroll', this.scrool);\n window.onresize = () => {\n return (() => {that.screenWidth = (document.body.clientWidth - 88);\n const divs = renderOfd(that.screenWidth, that.ofdObj);\n that.displayOfdDiv(divs);\n\n // let content = document.getElementById(\"content\");\n // let nowleft = content.childNodes[0].offsetLeft;\n\n })()\n }\n this.openFile();\n },\n\n methods: {\n print() {\n let dom = this.$refs[\"contentDiv\"];\n let childs = dom.children;\n this.loading = true;\n this.progressVisible = true;\n let list = [];\n let i = 0;\n for (let ele of childs) {\n list.push(ele.cloneNode(true));\n this.percentage = i / childs.length;\n }\n if (list.length > 0) {\n var mywindow = window.open(\"打印窗口\", \"_blank\");\n //给新打开的标签页添加画布内容(这里指的是id=div2img元素的内容)\n var documentBody = mywindow.document.body;\n console.log(list.length)\n for (let canvas of list) {\n documentBody.appendChild(canvas);\n }\n this.progressVisible = false;\n this.loading = false;\n //焦点移到新打开的标签页\n mywindow.focus();\n //执行打印的方法(注意打印方法是打印的当前窗口内的元素,所以前面才新建一个窗口:print()--打印当前窗口的内容。)\n mywindow.print();\n //操作完成之后关闭当前标签页(点击确定或者取消都会关闭)\n mywindow.close();\n }\n\n\n },\n printSecret() {\n let sealdivs = document.getElementsByTagName('img')\n //公章图片\n for (let ele of sealdivs) {\n ele.style.filter = \"grayscale(100%)\";\n }\n this.print();\n for (let ele of sealdivs) {\n ele.style.filter = \"\";\n }\n },\n scrool() {\n let scrolled = this.$refs.contentDiv.firstElementChild?.getBoundingClientRect()?.top - 60;\n let top = 0\n let index = 0;\n for (let i = 0; i < this.$refs.contentDiv.childElementCount; i++) {\n top += (Math.abs(this.$refs.contentDiv.children.item(i)?.style.height.replace('px', '')) + Math.abs(this.$refs.contentDiv.children.item(i)?.style.marginBottom.replace('px', '')));\n if (Math.abs(scrolled) < top) {\n index = i;\n break;\n }\n }\n this.pageIndex = index + 1;\n },\n\n showMore(title, id) {\n this.dialogFormVisible = true;\n this.value = document.getElementById(id).innerText;\n this.title = title;\n },\n plus() {\n setPageScale(++this.scale);\n const divs = renderOfdByScale(this.ofdObj);\n this.displayOfdDiv(divs);\n },\n\n minus() {\n setPageScale(--this.scale);\n const divs = renderOfdByScale(this.ofdObj);\n this.displayOfdDiv(divs);\n },\n\n prePage() {\n let contentDiv = document.getElementById('content');\n let ele = contentDiv.children.item(this.pageIndex - 2);\n ele?.scrollIntoView(true);\n ele ? this.pageIndex = this.pageIndex - 1 : '';\n },\n\n firstPage() {\n let contentDiv = document.getElementById('content');\n let ele = contentDiv.firstElementChild;\n ele?.scrollIntoView(true);\n ele ? this.pageIndex = 1 : '';\n },\n\n nextPage() {\n let contentDiv = document.getElementById('content');\n let ele = contentDiv.children.item(this.pageIndex);\n ele?.scrollIntoView(true);\n ele ? ++this.pageIndex : '';\n },\n\n lastPage() {\n let contentDiv = document.getElementById('content');\n let ele = contentDiv.lastElementChild;\n ele?.scrollIntoView(true);\n ele ? this.pageIndex = contentDiv.childElementCount : '';\n },\n getQueryString(name){\n var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');\n var r = window.location.search.substr(1).match(reg);\n if (r != null) {\n return unescape(r[2]);\n }\n return null;\n },\n openFile() {\n let ofdFile = null;\n let that = this;\n console.log(this.getQueryString(\"file\"))\n ofdFile = this.getQueryString(\"file\");\n // JSZipUtils.getBinaryContent(ofdFile, function (err, data) {\n // if (err) {\n // console.log(err)\n // } else {\n // let base64String = btoa(String.fromCharCode.apply(null, new Uint8Array(data)));\n // that.ofdBase64 = base64String;\n // }\n // });\n this.getOfdDocumentObj(ofdFile, this.screenWidth);\n\n },\n getOfdDocumentObj(file, screenWidth) {\n let that = this;\n let t = new Date().getTime();\n this.loading = true;\n parseOfdDocument({\n ofd: file,\n success(res) {\n console.log(res)\n let t1 = new Date().getTime();\n console.log('解析ofd', t1 - t);\n that.ofdObj = res[0];\n that.pageCount = res[0].pages.length;\n const divs = renderOfd(screenWidth, res[0]);\n let t2 = new Date().getTime();\n console.log('xml转svg', t2 - t1)\n that.displayOfdDiv(divs);\n //创建拖拽签章容器\n //that.createSealImg();\n let t3 = new Date().getTime();\n console.log('svg渲染到页面', t3 - t2);\n that.loading = false;\n },\n fail(error) {\n console.log('OFD打开失败'+ error);\n // that.loading = false;\n // that.$alert('OFD打开失败', error, {\n // confirmButtonText: '确定',\n // callback: action => {\n // this.$message({\n // type: 'info',\n // message: `action: ${action}`\n // });\n // }\n // });\n }\n });\n },\n\n displayOfdDiv(divs) {\n this.scale = getPageScale();\n let contentDiv = document.getElementById('content');\n contentDiv.innerHTML = '';\n for (const div of divs) {\n contentDiv.appendChild(div)\n }\n\n }\n }\n}\n</script>\n<!-- Add \"scoped\" attribute to limit CSS to this component only -->\n<style scoped>\n.upload-icon {\n display: flex;\n cursor: pointer;\n justify-content: center;\n align-items: center;\n height: 28px;\n padding-left: 10px;\n padding-right: 10px;\n background-color: rgb(59, 95, 232);\n border-radius: 1px;\n border-color: #5867dd;\n font-weight: 500;\n font-size: 12px;\n color: white;\n margin: 1px;\n}\n\n.scale-icon {\n display: flex;\n cursor: pointer;\n justify-content: center;\n align-items: center;\n width: 33px;\n height: 28px;\n background-color: #F5F5F5;;\n border-radius: 1px;\n font-weight: 500;\n font-size: 12px;\n color: #333333;\n text-align: center;\n padding: 2px;\n\n}\n\n.scale-icon :active {\n color: rgb(59, 95, 232);\n}\n\n.scale-icon :hover {\n color: rgb(59, 95, 232);\n}\n\n.text-icon {\n display: flex;\n cursor: pointer;\n justify-content: center;\n align-items: center;\n height: 28px;\n width: 90%;\n background-color: rgb(59, 95, 232);\n border-radius: 1px;\n border-color: #5867dd;\n font-weight: 500;\n font-size: 10px;\n color: white;\n margin-top: 20px;\n\n}\n\n.hidden {\n display: none !important;\n}\n\n.SealContainer {\n z-index: 99999;\n position: fixed;\n left: 0;\n top: 0;\n width: 100vw;\n height: 100vh;\n}\n\n.SealContainer .mask {\n background: #000000;\n opacity: 0.3;\n}\n\n.content-title {\n font-size: 16px;\n text-align: center;\n border-bottom: 1px solid rgb(59, 95, 232);\n color: rgb(59, 95, 232);\n margin-top: 10px;\n}\n\n\n.SealContainer-content {\n position: relative;\n width: 100%;\n height: 100%;\n overflow-y: auto;\n background: white;\n display: flex;\n flex-direction: column;\n padding: 10px;\n align-items: center;\n}\n\n.SealContainer-layout {\n position: relative;\n width: 60%;\n height: 80vh;\n overflow-y: auto;\n background: white;\n z-index: 100;\n display: flex;\n flex-direction: column;\n padding: 10px;\n align-items: center;\n}\n\n.subcontent {\n width: 80%;\n display: flex;\n flex-direction: column;\n text-align: left;\n margin-bottom: 10px;\n font-family: simsun;\n}\n\n.subcontent .title {\n font-weight: 600;\n}\n\n.subcontent .value {\n font-weight: 400;\n -webkit-line-clamp: 1;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n overflow: hidden;\n}\n\n.left-section {\n position: fixed;\n width: 88px;\n height: 100%;\n background: #F5F5F5;\n border: 1px solid #e8e8e8;\n align-items: center;\n display: flex;\n flex-direction: column\n}\n\n.main-section {\n padding-top: 20px;\n margin-left: 88px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background: #808080;\n overflow: hidden;\n position: relative\n}\n\n@media (max-width: 767px) {\n .SealContainer-layout {\n position: relative;\n width: 90%;\n height: 90vh;\n overflow-y: auto;\n background: white;\n z-index: 100;\n display: flex;\n flex-direction: column;\n padding: 10px;\n align-items: center;\n }\n\n .subcontent {\n width: 95%;\n display: flex;\n flex-direction: column;\n text-align: left;\n margin-bottom: 10px;\n font-family: simsun;\n }\n\n .left-section {\n position: fixed;\n width: 0px;\n height: 100%;\n background: #F5F5F5;\n border: 1px solid #e8e8e8;\n align-items: center;\n display: none;\n flex-direction: column;\n }\n\n .main-section {\n padding-top: 20px;\n margin-left: 0px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background: #808080;\n overflow: hidden\n }\n}\n</style>\n","import mod from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ofd.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../node_modules/thread-loader/dist/cjs.js!../../node_modules/babel-loader/lib/index.js!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ofd.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./ofd.vue?vue&type=template&id=df08fc1e&scoped=true&\"\nimport script from \"./ofd.vue?vue&type=script&lang=js&\"\nexport * from \"./ofd.vue?vue&type=script&lang=js&\"\nimport style0 from \"./ofd.vue?vue&type=style&index=0&id=df08fc1e&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"df08fc1e\",\n null\n \n)\n\nexport default component.exports","<template>\n <div id=\"app\">\n <HelloWorld/>\n </div>\n</template>\n\n<script>\nimport HelloWorld from './components/ofd.vue'\n\nexport default {\n name: 'App',\n components: {\n HelloWorld\n }\n}\n</script>\n\n<style>\n#app {\n font-family: \"Helvetica Neue\",Helvetica,\"PingFang SC\",\"Hiragino Sans GB\",\"Microsoft YaHei\",\"微软雅黑\",Arial,sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: center;\n color: #2c3e50;\n\n}\n</style>\n","import mod from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../node_modules/cache-loader/dist/cjs.js??ref--12-0!../node_modules/thread-loader/dist/cjs.js!../node_modules/babel-loader/lib/index.js!../node_modules/cache-loader/dist/cjs.js??ref--0-0!../node_modules/vue-loader/lib/index.js??vue-loader-options!./App.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./App.vue?vue&type=template&id=0bee5246&\"\nimport script from \"./App.vue?vue&type=script&lang=js&\"\nexport * from \"./App.vue?vue&type=script&lang=js&\"\nimport style0 from \"./App.vue?vue&type=style&index=0&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import Vue from 'vue'\nimport App from './App.vue'\nimport './styles/index.css'\nimport ElementUI from 'element-ui';\nimport 'element-ui/lib/theme-chalk/index.css';\nimport { library } from '@fortawesome/fontawesome-svg-core'\nimport { fas } from '@fortawesome/free-solid-svg-icons'\nimport { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'\nimport axios from 'axios';\n\nVue.prototype.$axios = axios\nlibrary.add(fas)\nVue.config.productionTip = false\nVue.component('font-awesome-icon', FontAwesomeIcon)\nVue.use(ElementUI);\n\nnew Vue({\n render: h => h(App),\n}).$mount('#app')\n","/*\n * ofd.js - A Javascript class for reading and rendering ofd files\n * <https://github.com/DLTech21/ofd.js>\n *\n * Copyright (c) 2020. DLTech21 All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * You may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport {pipeline} from \"@/utils/ofd/pipeline\";\nimport JsZip from \"jszip\";\nimport {parseStBox, getExtensionByPath, replaceFirstSlash} from \"@/utils/ofd/ofd_util\";\nlet parser = require('ofd-xml-parser');\nimport {Jbig2Image} from '../jbig2/jbig2';\nimport {parseSesSignature} from \"@/utils/ofd/ses_signature_parser\";\n\nexport const unzipOfd = function (file) {\n return new Promise((resolve, reject) => {\n JsZip.loadAsync(file)\n .then(function (zip) {\n resolve(zip);\n }, function (e) {\n reject(e);\n });\n });\n}\n\nexport const getDocRoots = async function (zip) {\n const data = await getJsonFromXmlContent(zip, 'OFD.xml');\n const docbodys = data['json']['ofd:OFD']['ofd:DocBody'];\n let array = [];\n array = array.concat(docbodys);\n return [zip, array]\n}\n\nexport const parseSingleDoc = async function ([zip, array]) {\n let docs = [];\n for (let docbody of array) {\n if (docbody) {\n let res = await doGetDocRoot(zip, docbody);\n res = await getDocument(res);\n res = await getDocumentRes(res);\n res = await getPublicRes(res);\n res = await getTemplatePage(res);\n res = await getPage(res);\n docs.push(res);\n }\n }\n return docs;\n}\n\nexport const doGetDocRoot = async function (zip, docbody) {\n let docRoot = docbody['ofd:DocRoot'];\n docRoot = replaceFirstSlash(docRoot);\n const doc = docRoot.split('/')[0];\n const signatures = docbody['ofd:Signatures'];\n const stampAnnot = await getSignature(zip, signatures, doc);\n let stampAnnotArray = {};\n for (const stamp of stampAnnot) {\n if (stamp.sealObj && Object.keys(stamp.sealObj).length > 0) {\n if (stamp.sealObj.type === 'ofd') {\n const stampObjs = await getSealDocumentObj(stamp);\n for (let stampObj of stampObjs) {\n stamp.stampAnnot.boundary = parseStBox(stamp.stampAnnot['@_Boundary']);\n //console.log(stamp.stampAnnot.boundary)\n stamp.stampAnnot.pageRef = stamp.stampAnnot['@_PageRef'];\n if (!stampAnnotArray[stamp.stampAnnot['@_PageRef']]) {\n stampAnnotArray[stamp.stampAnnot['@_PageRef']] = [];\n }\n stampAnnotArray[stamp.stampAnnot['@_PageRef']].push({type: 'ofd', obj: stampObj, stamp});\n }\n } else if (stamp.sealObj.type === 'png') {\n let img = 'data:image/png;base64,' + btoa(String.fromCharCode.apply(null, stamp.sealObj.ofdArray));\n let stampArray = [];\n stampArray = stampArray.concat(stamp.stampAnnot);\n for (const annot of stampArray) {\n if (annot) {\n const stampObj = {img, pageId: annot['@_PageRef'], 'boundary': parseStBox(annot['@_Boundary']), 'clip': parseStBox(annot['@_Clip'])};\n if (!stampAnnotArray[annot['@_PageRef']]) {\n stampAnnotArray[annot['@_PageRef']] = [];\n }\n stampAnnotArray[annot['@_PageRef']].push({type: 'png', obj: stampObj, stamp});\n }\n }\n }\n }\n }\n return [zip, doc, docRoot, stampAnnotArray];\n}\n\nexport const getDocument = async function ([zip, doc, docRoot, stampAnnot]) {\n const data = await getJsonFromXmlContent(zip, docRoot);\n const documentObj = data['json']['ofd:Document'];\n let annotations = documentObj['ofd:Annotations'];\n let array = [];\n let annoBase;\n if (annotations) {\n if (annotations.indexOf('/') !== -1) {\n annoBase = annotations.substring(0, annotations.indexOf('/'));\n }\n if (annotations.indexOf(doc) === -1) {\n annotations = `${doc}/${annotations}`;\n }\n if (zip.files[annotations]) {\n annotations = await getJsonFromXmlContent(zip, annotations);\n array = array.concat(annotations['json']['ofd:Annotations']['ofd:Page']);\n }\n }\n const annotationObjs = await getAnnotations(annoBase, array, doc, zip)\n return [zip, doc, documentObj, stampAnnot, annotationObjs];\n}\n\nconst getAnnotations = async function (annoBase, annotations, doc, zip) {\n let annotationObjs = {};\n for (let anno of annotations) {\n if (!anno) {\n continue\n }\n const pageId = anno['@_PageID'];\n let fileLoc = anno['ofd:FileLoc'];\n fileLoc = replaceFirstSlash(fileLoc);\n if (annoBase && fileLoc.indexOf(annoBase) === -1) {\n fileLoc = `${annoBase}/${fileLoc}`;\n }\n if (fileLoc.indexOf(doc) === -1) {\n fileLoc = `${doc}/${fileLoc}`;\n }\n\n if (zip.files[fileLoc]) {\n const data = await getJsonFromXmlContent(zip, fileLoc);\n\n let array = [];\n array = array.concat(data['json']['ofd:PageAnnot']['ofd:Annot']);\n if (!annotationObjs[pageId]) {\n annotationObjs[pageId] = [];\n }\n for (let annot of array) {\n if (!annot) {\n continue\n }\n const type = annot['@_Type'];\n const visible = annot['@_Visible'] ? annot['@_Visible']:true;\n const appearance = annot['ofd:Appearance'];\n let appearanceObj = {type, appearance, visible};\n annotationObjs[pageId].push(appearanceObj);\n }\n }\n }\n return annotationObjs;\n}\n\nexport const getDocumentRes = async function ([zip, doc, Document, stampAnnot, annotationObjs]) {\n let documentResPath = Document['ofd:CommonData']['ofd:DocumentRes'];\n let fontResObj = {};\n let drawParamResObj = {};\n let multiMediaResObj = {};\n let compositeGraphicUnits = [];\n if (documentResPath) {\n if (documentResPath.indexOf(doc) == -1) {\n documentResPath = `${doc}/${documentResPath}`;\n }\n if (zip.files[documentResPath]) {\n const data = await getJsonFromXmlContent(zip, documentResPath);\n const documentResObj = data['json']['ofd:Res'];\n fontResObj = await getFont(documentResObj);\n drawParamResObj = await getDrawParam(documentResObj);\n multiMediaResObj = await getMultiMediaRes(zip, documentResObj, doc);\n compositeGraphicUnits = getCompositeObject(documentResObj);\n }\n }\n return [zip, doc, Document, stampAnnot, annotationObjs, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits];\n}\n\nexport const getPublicRes = async function ([zip, doc, Document, stampAnnot, annotationObjs, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits]) {\n let publicResPath = Document['ofd:CommonData']['ofd:PublicRes'];\n if (publicResPath) {\n if (publicResPath.indexOf(doc) == -1) {\n publicResPath = `${doc}/${publicResPath}`;\n }\n if (zip.files[publicResPath]) {\n const data = await getJsonFromXmlContent(zip, publicResPath);\n const publicResObj = data['json']['ofd:Res'];\n let fontObj = await getFont(publicResObj);\n fontResObj = Object.assign(fontResObj, fontObj);\n let drawParamObj = await getDrawParam(publicResObj);\n drawParamResObj = Object.assign(drawParamResObj, drawParamObj);\n let multiMediaObj = await getMultiMediaRes(zip, publicResObj, doc);\n multiMediaResObj = Object.assign(multiMediaResObj, multiMediaObj);\n compositeGraphicUnits = compositeGraphicUnits.concat(getCompositeObject(publicResObj))\n }\n }\n return [zip, doc, Document, stampAnnot, annotationObjs, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits];\n}\n\nexport const getTemplatePage = async function ([zip, doc, Document, stampAnnot, annotationObjs, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits]) {\n let templatePages = Document['ofd:CommonData']['ofd:TemplatePage'];\n let array = [];\n array = array.concat(templatePages);\n let tpls = {};\n for (const templatePage of array) {\n if (templatePage) {\n let pageObj = await parsePage(zip, templatePage, doc);\n tpls[Object.keys(pageObj)[0]] = pageObj[Object.keys(pageObj)[0]];\n }\n }\n return [zip, doc, Document, stampAnnot, annotationObjs, tpls, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits];\n}\n\nexport const getPage = async function ([zip, doc, Document, stampAnnot, annotationObjs, tpls, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits]) {\n let pages = Document['ofd:Pages']['ofd:Page'];\n let array = [];\n array = array.concat(pages);\n let res = [];\n for (const page of array) {\n if (page) {\n let pageObj = await parsePage(zip, page, doc);\n const pageId = Object.keys(pageObj)[0];\n const currentPageStamp = stampAnnot[pageId];\n if (currentPageStamp) {\n pageObj[pageId].stamp = currentPageStamp;\n }\n const annotationObj = annotationObjs[pageId];\n if (annotationObj) {\n pageObj[pageId].annotation = annotationObj;\n }\n res.push(pageObj);\n }\n }\n return {\n 'doc': doc,\n 'document': Document,\n 'pages': res,\n 'tpls': tpls,\n 'stampAnnot': stampAnnot,\n fontResObj,\n drawParamResObj,\n multiMediaResObj,\n compositeGraphicUnits\n };\n}\n\nconst getFont = async function (res) {\n const fonts = res['ofd:Fonts'];\n let fontResObj = {};\n if (fonts) {\n let fontArray = [];\n fontArray = fontArray.concat(fonts['ofd:Font']);\n for (const font of fontArray) {\n if (font) {\n if (font['@_FamilyName']) {\n fontResObj[font['@_ID']] = font['@_FamilyName'];\n } else {\n fontResObj[font['@_ID']] = font['@_FontName'];\n }\n }\n }\n }\n return fontResObj;\n}\n\nconst getDrawParam = async function (res) {\n const drawParams = res['ofd:DrawParams'];\n let drawParamResObj = {};\n if (drawParams) {\n let array = [];\n array = array.concat(drawParams['ofd:DrawParam']);\n for (const item of array) {\n if (item) {\n drawParamResObj[item['@_ID']] = {\n 'LineWidth': item['@_LineWidth'],\n 'FillColor': item['ofd:FillColor'] ? item['ofd:FillColor']['@_Value'] : '',\n 'StrokeColor': item['ofd:StrokeColor'] ? item['ofd:StrokeColor']['@_Value'] : \"\",\n 'relative': item['@_Relative'],\n };\n }\n }\n }\n return drawParamResObj;\n}\n\nconst getMultiMediaRes = async function (zip, res, doc) {\n const multiMedias = res['ofd:MultiMedias'];\n let multiMediaResObj = {};\n if (multiMedias) {\n let array = [];\n array = array.concat(multiMedias['ofd:MultiMedia']);\n for (const item of array) {\n if (item) {\n let file = item['ofd:MediaFile'];\n if (res['@_BaseLoc']) {\n if (file.indexOf(res['@_BaseLoc']) === -1) {\n file = `${res['@_BaseLoc']}/${file}`\n }\n }\n if (file.indexOf(doc) === -1) {\n file = `${doc}/${file}`\n }\n if (item['@_Type'].toLowerCase() === 'image') {\n const format = item['@_Format'];\n const ext = getExtensionByPath(file);\n if ((format && (format.toLowerCase() === 'gbig2' || format.toLowerCase() === 'jb2')) || ext && (ext.toLowerCase() === 'jb2' || ext.toLowerCase() === 'gbig2')) {\n const jbig2 = await parseJbig2ImageFromZip(zip, file);\n multiMediaResObj[item['@_ID']] = jbig2;\n } else {\n const img = await parseOtherImageFromZip(zip, file);\n multiMediaResObj[item['@_ID']] = {img, 'format': 'png'};\n }\n } else {\n multiMediaResObj[item['@_ID']] = file;\n }\n }\n }\n }\n return multiMediaResObj;\n}\n\nconst getCompositeObject = function (res) {\n const compositeGraphicUnits = res['ofd:CompositeGraphicUnits'];\n let compositeGraphicUnitsArray = [];\n if (compositeGraphicUnits) {\n let array = [];\n array = array.concat(compositeGraphicUnits['ofd:CompositeGraphicUnit']);\n for (const item of array) {\n if (item) {\n compositeGraphicUnitsArray.push(item);\n }\n }\n }\n return compositeGraphicUnitsArray;\n}\n\nconst parsePage = async function (zip, obj, doc) {\n let pagePath = obj['@_BaseLoc'];\n if (pagePath.indexOf(doc) == -1) {\n pagePath = `${doc}/${pagePath}`;\n }\n const data = await getJsonFromXmlContent(zip, pagePath);\n let pageObj = {};\n pageObj[obj['@_ID']] = {'json': data['json']['ofd:Page'], 'xml': data['xml']};\n return pageObj;\n}\n\nconst getSignature = async function (zip, signatures, doc) {\n let stampAnnot = [];\n if (signatures) {\n signatures = replaceFirstSlash(signatures);\n if (signatures.indexOf(doc) === -1) {\n signatures = `${doc}/${signatures}`\n }\n if (zip.files[signatures]) {\n let data = await getJsonFromXmlContent(zip, signatures);\n let signature = data['json']['ofd:Signatures']['ofd:Signature'];\n let signatureArray = [];\n signatureArray = signatureArray.concat(signature);\n for (const sign of signatureArray) {\n if (sign) {\n let signatureLoc = sign['@_BaseLoc'];\n let signatureID = sign['@_ID'];\n signatureLoc = replaceFirstSlash(signatureLoc);\n if (signatureLoc.indexOf('Signs') === -1) {\n signatureLoc = `Signs/${signatureLoc}`\n }\n if (signatureLoc.indexOf(doc) === -1) {\n signatureLoc = `${doc}/${signatureLoc}`\n }\n stampAnnot.push(await getSignatureData(zip, signatureLoc, signatureID));\n }\n }\n }\n }\n return stampAnnot;\n}\n\nconst getFileData = async function (zip, name){\n return zip.files[name].async('uint8array');\n}\n\nconst getSignatureData = async function (zip, signature, signatureID) {\n const data = await getJsonFromXmlContent(zip, signature);\n let signedValue = (data['json']['ofd:Signature']['ofd:SignedValue'])\n signedValue = signedValue.toString().replace('/', '');\n if (!zip.files[signedValue]) {\n signedValue = `${signature.substring(0, signature.lastIndexOf('/'))}/${signedValue}`\n }\n let sealObj = await parseSesSignature(zip, signedValue);\n const checkMethod = data['json']['ofd:Signature']['ofd:SignedInfo']['ofd:References']['@_CheckMethod'];\n global.toBeChecked = new Map();\n let arr = new Array();\n data['json']['ofd:Signature']['ofd:SignedInfo']['ofd:References']['ofd:Reference'].forEach(async reference=>{\n if(Object.keys(reference).length==0 || Object.keys(reference['@_FileRef']).length==0){\n return true;\n }\n const hashed = reference['ofd:CheckValue'];\n const key = reference['@_FileRef'].replace('/','');\n let fileData = await getFileData(zip, key);\n arr.push({fileData,hashed,checkMethod});\n });\n global.toBeChecked.set(signatureID, arr);\n return {\n 'stampAnnot': data['json']['ofd:Signature']['ofd:SignedInfo']['ofd:StampAnnot'],\n 'sealObj': sealObj,\n 'signedInfo':{\n 'signatureID': signatureID,\n 'VerifyRet':sealObj.verifyRet,\n 'Provider':data['json']['ofd:Signature']['ofd:SignedInfo']['ofd:Provider'],\n 'SignatureMethod':data['json']['ofd:Signature']['ofd:SignedInfo']['ofd:SignatureMethod'],\n 'SignatureDateTime':data['json']['ofd:Signature']['ofd:SignedInfo']['ofd:SignatureDateTime'],\n },\n };\n}\n\nconst getSealDocumentObj = function (stampAnnot) {\n return new Promise((resolve, reject) => {\n pipeline.call(this, async () => await unzipOfd(stampAnnot.sealObj.ofdArray), getDocRoots, parseSingleDoc)\n .then(res => {\n resolve(res)\n })\n .catch(res => {\n reject(res);\n });\n });\n}\n\nconst getJsonFromXmlContent = async function (zip, xmlName) {\n return new Promise((resolve, reject) => {\n zip.files[xmlName].async('string').then(function (content) {\n let ops = {\n attributeNamePrefix: \"@_\",\n ignoreAttributes: false,\n parseNodeValue: false,\n trimValues: false\n };\n let jsonObj = parser.parse(content, ops);\n let result = {'xml': content, 'json': jsonObj};\n resolve(result);\n }, function error(e) {\n reject(e);\n })\n });\n}\n\nconst parseJbig2ImageFromZip = async function (zip, name) {\n return new Promise((resolve, reject) => {\n zip.files[name].async('uint8array').then(function (bytes) {\n let jbig2 = new Jbig2Image();\n const img = jbig2.parse(bytes);\n resolve({img, width: jbig2.width, height: jbig2.height, format: 'gbig2'});\n }, function error(e) {\n reject(e);\n })\n });\n}\n\nconst parseOtherImageFromZip = async function (zip, name) {\n return new Promise((resolve, reject) => {\n zip.files[name].async('base64').then(function (bytes) {\n const img = 'data:image/png;base64,' + bytes;\n resolve(img);\n }, function error(e) {\n reject(e);\n })\n });\n}\n\n\n","/*\n * ofd.js - A Javascript class for reading and rendering ofd files\n * <https://github.com/DLTech21/ofd.js>\n *\n * Copyright (c) 2020. DLTech21 All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * You may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\n\nexport const convertPathAbbreviatedDatatoPoint = abbreviatedData => {\n let array = abbreviatedData.split(' ');\n let pointList = [];\n let i = 0;\n while (i < array.length) {\n if (array[i] === 'M'|| array[i] === 'S') {\n let point = {\n 'type': 'M',\n 'x': parseFloat(array[i + 1]),\n 'y': parseFloat(array[i + 2])\n }\n i = i + 3;\n pointList.push(point);\n }\n if (array[i] === 'L') {\n let point = {\n 'type': 'L',\n 'x': parseFloat(array[i + 1]),\n 'y': parseFloat(array[i + 2])\n }\n i = i + 3;\n pointList.push(point);\n } else if (array[i] === 'C') {\n let point = {\n 'type': 'C',\n 'x': 0,\n 'y': 0\n }\n pointList.push(point)\n i++;\n } else if (array[i] === 'B') {\n let point = {\n 'type': 'B',\n 'x1': parseFloat(array[i + 1]),\n 'y1': parseFloat(array[i + 2]),\n 'x2': parseFloat(array[i + 3]),\n 'y2': parseFloat(array[i + 4]),\n 'x3': parseFloat(array[i + 5]),\n 'y3': parseFloat(array[i + 6])\n }\n i = i + 7;\n pointList.push(point);\n } else if (array[i] === 'Q') {\n let point = {\n 'type': 'Q',\n 'x1': parseFloat(array[i + 1]),\n 'y1': parseFloat(array[i + 2]),\n 'x2': parseFloat(array[i + 3]),\n 'y2': parseFloat(array[i + 4]),\n }\n i = i + 5;\n pointList.push(point);\n } else if (array[i] === 'A') {\n let point = {\n 'type': 'A',\n 'rx': parseFloat(array[i + 1]),\n 'ry': parseFloat(array[i + 2]),\n 'rotation': parseFloat(array[i + 3]),\n 'arc': parseFloat(array[i + 4]),\n 'sweep': parseFloat(array[i + 5]),\n 'x': parseFloat(array[i + 6]),\n 'y': parseFloat(array[i + 7]),\n }\n i = i + 8;\n pointList.push(point);\n } else {\n i++;\n }\n }\n return pointList;\n}\n\nexport const calPathPoint = function (abbreviatedPoint) {\n let pointList = [];\n\n for (let i = 0; i < abbreviatedPoint.length; i++) {\n let point = abbreviatedPoint[i];\n if (point.type === 'M' || point.type === 'L' || point.type === 'C') {\n let x = 0, y = 0;\n x = point.x;\n y = point.y;\n point.x = converterDpi(x);\n point.y = converterDpi(y);\n pointList.push(point);\n } else if (point.type === 'B') {\n let x1 = point.x1, y1 = point.y1;\n let x2 = point.x2, y2 = point.y2;\n let x3 = point.x3, y3 = point.y3;\n let realPoint = {\n 'type': 'B', 'x1': converterDpi(x1), 'y1': converterDpi(y1),\n 'x2': converterDpi(x2), 'y2': converterDpi(y2),\n 'x3': converterDpi(x3), 'y3': converterDpi(y3)\n }\n pointList.push(realPoint);\n } else if (point.type === 'Q') {\n let x1 = point.x1, y1 = point.y1;\n let x2 = point.x2, y2 = point.y2;\n let realPoint = {\n 'type': 'Q', 'x1': converterDpi(x1), 'y1': converterDpi(y1),\n 'x2': converterDpi(x2), 'y2': converterDpi(y2)\n }\n pointList.push(realPoint);\n } else if (point.type === 'A') {\n let rx = point.rx, ry = point.ry;\n let rotation = point.rotation;\n let arc = point.arc;\n let sweep = point.sweep;\n let x = point.x;\n let y = point.y;\n let realPoint = {\n 'type': 'A', 'rx': converterDpi(rx), 'ry': converterDpi(ry),\n 'rotation': rotation, 'arc': arc,\n 'sweep': sweep, 'x': converterDpi(x), 'y': converterDpi(y)\n }\n pointList.push(realPoint);\n }\n }\n return pointList;\n}\n\nconst millimetersToPixel = function (mm, dpi) {\n //毫米转像素:mm * dpi / 25.4\n return ((mm * dpi / 25.4));\n}\n\nlet MaxScale = 10;\n\nlet Scale = MaxScale ;\n\nexport const setMaxPageScal = function (scale) {\n MaxScale = scale > 5 ? 5 : scale;\n}\n\nexport const setPageScal = function (scale) {\n // scale = Math.ceil(scale);\n Scale = scale > 1 ? scale: 1;\n Scale = Scale > MaxScale ? MaxScale: Scale;\n}\n\nexport const getPageScal = function () {\n return Scale;\n}\n\nexport const converterDpi = function (width) {\n return millimetersToPixel(width, Scale*25.4);\n}\n\nexport const deltaFormatter = function (delta) {\n if(delta.indexOf(\"g\") === -1) {\n let floatList = [];\n for (let f of delta.split(' ')) {\n floatList.push(parseFloat(f));\n }\n return floatList;\n } else {\n const array = delta.split(' ');\n let gFlag = false;\n let gProcessing = false;\n let gItemCount = 0;\n let floatList = [];\n for (const s of array) {\n if ('g' === s) {\n gFlag = true;\n } else {\n if (!s || s.trim().length == 0) {\n continue;\n }\n if (gFlag) {\n gItemCount = parseInt(s);\n gProcessing = true;\n gFlag = false;\n } else if (gProcessing) {\n for (let j = 0; j < gItemCount; j++) {\n floatList.push(parseFloat(s));\n }\n gProcessing = false;\n } else {\n floatList.push(parseFloat(s));\n }\n }\n }\n return floatList;\n }\n}\n\nexport const calTextPoint = function (textCodes) {\n let x = 0;\n let y = 0;\n let textCodePointList = [];\n if (!textCodes) {\n return textCodePointList;\n }\n for (let textCode of textCodes) {\n if (!textCode) {\n continue\n }\n x = parseFloat(textCode['@_X']);\n y = parseFloat(textCode['@_Y']);\n\n if (isNaN(x)) {\n x = 0;\n }\n if (isNaN(y)) {\n y = 0;\n }\n\n let deltaXList = [];\n let deltaYList = [];\n if (textCode['@_DeltaX'] && textCode['@_DeltaX'].length > 0) {\n deltaXList = deltaFormatter(textCode['@_DeltaX']);\n }\n if (textCode['@_DeltaY'] && textCode['@_DeltaY'].length > 0) {\n deltaYList = deltaFormatter(textCode['@_DeltaY']);\n }\n let textStr = textCode['#text'];\n if (textStr) {\n textStr += '';\n textStr = decodeHtml(textStr);\n textStr = textStr.replace(/&#x20;/g, ' ');\n for (let i = 0; i < textStr.length; i++) {\n if (i > 0 && deltaXList.length > 0) {\n x += deltaXList[(i - 1)];\n }\n if (i > 0 && deltaYList.length > 0) {\n y += deltaYList[(i - 1)];\n }\n let text = textStr.substring(i, i + 1);\n let textCodePoint = {'x': converterDpi(x), 'y': converterDpi(y), 'text': text};\n textCodePointList.push(textCodePoint);\n }\n }\n }\n return textCodePointList;\n}\n\nexport const replaceFirstSlash = function (str) {\n if (str) {\n if (str.indexOf('/') === 0) {\n str = str.replace('/', '');\n }\n }\n return str;\n}\n\nexport const getExtensionByPath = function (path) {\n if (!path && typeof path !== \"string\") return \"\";\n return path.substring(path.lastIndexOf('.') + 1);\n}\n\n\nlet REGX_HTML_DECODE = /&\\w+;|&#(\\d+);/g;\n\nlet HTML_DECODE = {\n \"&lt;\" : \"<\",\n \"&gt;\" : \">\",\n \"&amp;\" : \"&\",\n \"&nbsp;\": \" \",\n \"&quot;\": \"\\\"\",\n \"&copy;\": \"\",\n \"&apos;\": \"'\",\n // Add more\n};\n\nexport const decodeHtml = function(s){\n s = (s != undefined) ? s : this.toString();\n return (typeof s != \"string\") ? s :\n s.replace(REGX_HTML_DECODE,\n function($0, $1){\n var c = HTML_DECODE[$0];\n if(c == undefined){\n // Maybe is Entity Number\n if(!isNaN($1)){\n c = String.fromCharCode(($1 == 160) ? 32:$1);\n }else{\n c = $0;\n }\n }\n return c;\n });\n};\n\nlet FONT_FAMILY = {\n '楷体': '楷体, KaiTi, Kai, simkai',\n 'kaiti': '楷体, KaiTi, Kai, simkai',\n 'Kai': '楷体, KaiTi, Kai',\n 'simsun': 'SimSun, simsun, Songti SC',\n '宋体': 'SimSun, simsun, Songti SC',\n '黑体': 'SimHei, STHeiti, simhei',\n '仿宋': 'FangSong, STFangsong, simfang',\n '小标宋体': 'sSun',\n '方正小标宋_gbk': 'sSun',\n '仿宋_gb2312': 'FangSong, STFangsong, simfang',\n '楷体_gb2312': '楷体, KaiTi, Kai, simkai',\n 'couriernew': 'Courier New',\n 'courier new': 'Courier New',\n};\n\nexport const getFontFamily = function (font) {\n if (FONT_FAMILY[font.toLowerCase()]) {\n font = FONT_FAMILY[font.toLowerCase()];\n }\n for (let key of Object.keys(FONT_FAMILY)) {\n if (font.toLowerCase().indexOf(key.toLowerCase()) != -1) {\n return FONT_FAMILY[key]\n }\n }\n return font;\n}\n\nexport const parseStBox = function (obj) {\n if (obj) {\n let array = obj.split(' ');\n return {\n x: (parseFloat(array[0])), y: (parseFloat(array[1])),\n w: (parseFloat(array[2])), h: (parseFloat(array[3]))\n };\n } else {\n return null;\n }\n}\n\nexport const parseCtm = function (ctm) {\n let array = ctm.split(' ');\n return array;\n}\n\nexport const parseColor = function (color) {\n if (color) {\n if (color.indexOf('#') !== -1) {\n color = color.replace(/#/g, '');\n color = color.replace(/ /g, '');\n color = '#' + color.toString();\n return color;\n }\n let array = color.split(' ');\n return `rgb(${array[0]}, ${array[1]}, ${array[2]})`\n } else {\n return `rgb(0, 0, 0)`\n }\n}\n\nexport const converterBox = function (box) {\n return {\n x: converterDpi(box.x), y: converterDpi(box.y),\n w: converterDpi(box.w), h: converterDpi(box.h)\n };\n}\n\nexport const Uint8ArrayToHexString = function (arr) {\n let words = [];\n let j = 0;\n for (let i = 0; i < arr.length * 2; i += 2) {\n words[i >>> 3] |= parseInt(arr[j], 10) << (24 - (i % 8) * 4);\n j++;\n }\n\n // 转换到16进制\n let hexChars = [];\n for (let i = 0; i < arr.length; i++) {\n let bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n hexChars.push((bite >>> 4).toString(16));\n hexChars.push((bite & 0x0f).toString(16));\n }\n\n return hexChars.join('');\n}\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint no-var: error */\n\nimport \"./compatibility.js\";\n\nconst IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];\nconst FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\n\n// Permission flags from Table 22, Section 7.6.3.2 of the PDF specification.\nconst PermissionFlag = {\n PRINT: 0x04,\n MODIFY_CONTENTS: 0x08,\n COPY: 0x10,\n MODIFY_ANNOTATIONS: 0x20,\n FILL_INTERACTIVE_FORMS: 0x100,\n COPY_FOR_ACCESSIBILITY: 0x200,\n ASSEMBLE: 0x400,\n PRINT_HIGH_QUALITY: 0x800,\n};\n\nconst TextRenderingMode = {\n FILL: 0,\n STROKE: 1,\n FILL_STROKE: 2,\n INVISIBLE: 3,\n FILL_ADD_TO_PATH: 4,\n STROKE_ADD_TO_PATH: 5,\n FILL_STROKE_ADD_TO_PATH: 6,\n ADD_TO_PATH: 7,\n FILL_STROKE_MASK: 3,\n ADD_TO_PATH_FLAG: 4,\n};\n\nconst ImageKind = {\n GRAYSCALE_1BPP: 1,\n RGB_24BPP: 2,\n RGBA_32BPP: 3,\n};\n\nconst AnnotationType = {\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n REDACT: 26,\n};\n\nconst AnnotationStateModelType = {\n MARKED: \"Marked\",\n REVIEW: \"Review\",\n};\n\nconst AnnotationMarkedState = {\n MARKED: \"Marked\",\n UNMARKED: \"Unmarked\",\n};\n\nconst AnnotationReviewState = {\n ACCEPTED: \"Accepted\",\n REJECTED: \"Rejected\",\n CANCELLED: \"Cancelled\",\n COMPLETED: \"Completed\",\n NONE: \"None\",\n};\n\nconst AnnotationReplyType = {\n GROUP: \"Group\",\n REPLY: \"R\",\n};\n\nconst AnnotationFlag = {\n INVISIBLE: 0x01,\n HIDDEN: 0x02,\n PRINT: 0x04,\n NOZOOM: 0x08,\n NOROTATE: 0x10,\n NOVIEW: 0x20,\n READONLY: 0x40,\n LOCKED: 0x80,\n TOGGLENOVIEW: 0x100,\n LOCKEDCONTENTS: 0x200,\n};\n\nconst AnnotationFieldFlag = {\n READONLY: 0x0000001,\n REQUIRED: 0x0000002,\n NOEXPORT: 0x0000004,\n MULTILINE: 0x0001000,\n PASSWORD: 0x0002000,\n NOTOGGLETOOFF: 0x0004000,\n RADIO: 0x0008000,\n PUSHBUTTON: 0x0010000,\n COMBO: 0x0020000,\n EDIT: 0x0040000,\n SORT: 0x0080000,\n FILESELECT: 0x0100000,\n MULTISELECT: 0x0200000,\n DONOTSPELLCHECK: 0x0400000,\n DONOTSCROLL: 0x0800000,\n COMB: 0x1000000,\n RICHTEXT: 0x2000000,\n RADIOSINUNISON: 0x2000000,\n COMMITONSELCHANGE: 0x4000000,\n};\n\nconst AnnotationBorderStyleType = {\n SOLID: 1,\n DASHED: 2,\n BEVELED: 3,\n INSET: 4,\n UNDERLINE: 5,\n};\n\nconst StreamType = {\n UNKNOWN: \"UNKNOWN\",\n FLATE: \"FLATE\",\n LZW: \"LZW\",\n DCT: \"DCT\",\n JPX: \"JPX\",\n JBIG: \"JBIG\",\n A85: \"A85\",\n AHX: \"AHX\",\n CCF: \"CCF\",\n RLX: \"RLX\", // PDF short name is 'RL', but telemetry requires three chars.\n};\n\nconst FontType = {\n UNKNOWN: \"UNKNOWN\",\n TYPE1: \"TYPE1\",\n TYPE1C: \"TYPE1C\",\n CIDFONTTYPE0: \"CIDFONTTYPE0\",\n CIDFONTTYPE0C: \"CIDFONTTYPE0C\",\n TRUETYPE: \"TRUETYPE\",\n CIDFONTTYPE2: \"CIDFONTTYPE2\",\n TYPE3: \"TYPE3\",\n OPENTYPE: \"OPENTYPE\",\n TYPE0: \"TYPE0\",\n MMTYPE1: \"MMTYPE1\",\n};\n\nconst VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5,\n};\n\nconst CMapCompressionType = {\n NONE: 0,\n BINARY: 1,\n STREAM: 2,\n};\n\n// All the possible operations for an operator list.\nconst OPS = {\n // Intentionally start from 1 so it is easy to spot bad operators that will be\n // 0's.\n dependency: 1,\n setLineWidth: 2,\n setLineCap: 3,\n setLineJoin: 4,\n setMiterLimit: 5,\n setDash: 6,\n setRenderingIntent: 7,\n setFlatness: 8,\n setGState: 9,\n save: 10,\n restore: 11,\n transform: 12,\n moveTo: 13,\n lineTo: 14,\n curveTo: 15,\n curveTo2: 16,\n curveTo3: 17,\n closePath: 18,\n rectangle: 19,\n stroke: 20,\n closeStroke: 21,\n fill: 22,\n eoFill: 23,\n fillStroke: 24,\n eoFillStroke: 25,\n closeFillStroke: 26,\n closeEOFillStroke: 27,\n endPath: 28,\n clip: 29,\n eoClip: 30,\n beginText: 31,\n endText: 32,\n setCharSpacing: 33,\n setWordSpacing: 34,\n setHScale: 35,\n setLeading: 36,\n setFont: 37,\n setTextRenderingMode: 38,\n setTextRise: 39,\n moveText: 40,\n setLeadingMoveText: 41,\n setTextMatrix: 42,\n nextLine: 43,\n showText: 44,\n showSpacedText: 45,\n nextLineShowText: 46,\n nextLineSetSpacingShowText: 47,\n setCharWidth: 48,\n setCharWidthAndBounds: 49,\n setStrokeColorSpace: 50,\n setFillColorSpace: 51,\n setStrokeColor: 52,\n setStrokeColorN: 53,\n setFillColor: 54,\n setFillColorN: 55,\n setStrokeGray: 56,\n setFillGray: 57,\n setStrokeRGBColor: 58,\n setFillRGBColor: 59,\n setStrokeCMYKColor: 60,\n setFillCMYKColor: 61,\n shadingFill: 62,\n beginInlineImage: 63,\n beginImageData: 64,\n endInlineImage: 65,\n paintXObject: 66,\n markPoint: 67,\n markPointProps: 68,\n beginMarkedContent: 69,\n beginMarkedContentProps: 70,\n endMarkedContent: 71,\n beginCompat: 72,\n endCompat: 73,\n paintFormXObjectBegin: 74,\n paintFormXObjectEnd: 75,\n beginGroup: 76,\n endGroup: 77,\n beginAnnotations: 78,\n endAnnotations: 79,\n beginAnnotation: 80,\n endAnnotation: 81,\n paintJpegXObject: 82,\n paintImageMaskXObject: 83,\n paintImageMaskXObjectGroup: 84,\n paintImageXObject: 85,\n paintInlineImageXObject: 86,\n paintInlineImageXObjectGroup: 87,\n paintImageXObjectRepeat: 88,\n paintImageMaskXObjectRepeat: 89,\n paintSolidColorImageMask: 90,\n constructPath: 91,\n};\n\nconst UNSUPPORTED_FEATURES = {\n /** @deprecated unused */\n unknown: \"unknown\",\n forms: \"forms\",\n javaScript: \"javaScript\",\n smask: \"smask\",\n shadingPattern: \"shadingPattern\",\n /** @deprecated unused */\n font: \"font\",\n errorTilingPattern: \"errorTilingPattern\",\n errorExtGState: \"errorExtGState\",\n errorXObject: \"errorXObject\",\n errorFontLoadType3: \"errorFontLoadType3\",\n errorFontState: \"errorFontState\",\n errorFontMissing: \"errorFontMissing\",\n errorFontTranslate: \"errorFontTranslate\",\n errorColorSpace: \"errorColorSpace\",\n errorOperatorList: \"errorOperatorList\",\n errorFontToUnicode: \"errorFontToUnicode\",\n errorFontLoadNative: \"errorFontLoadNative\",\n errorFontGetPath: \"errorFontGetPath\",\n errorMarkedContent: \"errorMarkedContent\",\n};\n\nconst PasswordResponses = {\n NEED_PASSWORD: 1,\n INCORRECT_PASSWORD: 2,\n};\n\nlet verbosity = VerbosityLevel.WARNINGS;\n\nfunction setVerbosityLevel(level) {\n if (Number.isInteger(level)) {\n verbosity = level;\n }\n}\n\nfunction getVerbosityLevel() {\n return verbosity;\n}\n\n// A notice for devs. These are good for things that are helpful to devs, such\n// as warning that Workers were disabled, which is important to devs but not\n// end users.\nfunction info(msg) {\n if (verbosity >= VerbosityLevel.INFOS) {\n console.log(`Info: ${msg}`);\n }\n}\n\n// Non-fatal warnings.\nfunction warn(msg) {\n if (verbosity >= VerbosityLevel.WARNINGS) {\n console.log(`Warning: ${msg}`);\n }\n}\n\nfunction unreachable(msg) {\n throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n if (!cond) {\n unreachable(msg);\n }\n}\n\n// Checks if URLs have the same origin. For non-HTTP based URLs, returns false.\nfunction isSameOrigin(baseUrl, otherUrl) {\n let base;\n try {\n base = new URL(baseUrl);\n if (!base.origin || base.origin === \"null\") {\n return false; // non-HTTP url\n }\n } catch (e) {\n return false;\n }\n\n const other = new URL(otherUrl, base);\n return base.origin === other.origin;\n}\n\n// Checks if URLs use one of the allowed protocols, e.g. to avoid XSS.\nfunction _isValidProtocol(url) {\n if (!url) {\n return false;\n }\n switch (url.protocol) {\n case \"http:\":\n case \"https:\":\n case \"ftp:\":\n case \"mailto:\":\n case \"tel:\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Attempts to create a valid absolute URL.\n *\n * @param {URL|string} url - An absolute, or relative, URL.\n * @param {URL|string} baseUrl - An absolute URL.\n * @returns Either a valid {URL}, or `null` otherwise.\n */\nfunction createValidAbsoluteUrl(url, baseUrl) {\n if (!url) {\n return null;\n }\n try {\n const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);\n if (_isValidProtocol(absoluteUrl)) {\n return absoluteUrl;\n }\n } catch (ex) {\n /* `new URL()` will throw on incorrect data. */\n }\n return null;\n}\n\nfunction shadow(obj, prop, value) {\n Object.defineProperty(obj, prop, {\n value,\n enumerable: true,\n configurable: true,\n writable: false,\n });\n return value;\n}\n\n/**\n * @type {any}\n */\nconst BaseException = (function BaseExceptionClosure() {\n // eslint-disable-next-line no-shadow\n function BaseException(message) {\n if (this.constructor === BaseException) {\n unreachable(\"Cannot initialize BaseException.\");\n }\n this.message = message;\n this.name = this.constructor.name;\n }\n BaseException.prototype = new Error();\n BaseException.constructor = BaseException;\n\n return BaseException;\n})();\n\nclass PasswordException extends BaseException {\n constructor(msg, code) {\n super(msg);\n this.code = code;\n }\n}\n\nclass UnknownErrorException extends BaseException {\n constructor(msg, details) {\n super(msg);\n this.details = details;\n }\n}\n\nclass InvalidPDFException extends BaseException {}\n\nclass MissingPDFException extends BaseException {}\n\nclass UnexpectedResponseException extends BaseException {\n constructor(msg, status) {\n super(msg);\n this.status = status;\n }\n}\n\n/**\n * Error caused during parsing PDF data.\n */\nclass FormatError extends BaseException {}\n\n/**\n * Error used to indicate task cancellation.\n */\nclass AbortException extends BaseException {}\n\nconst NullCharactersRegExp = /\\x00/g;\n\n/**\n * @param {string} str\n */\nfunction removeNullCharacters(str) {\n if (typeof str !== \"string\") {\n warn(\"The argument for removeNullCharacters must be a string.\");\n return str;\n }\n return str.replace(NullCharactersRegExp, \"\");\n}\n\nfunction bytesToString(bytes) {\n assert(\n bytes !== null && typeof bytes === \"object\" && bytes.length !== undefined,\n \"Invalid argument for bytesToString\"\n );\n const length = bytes.length;\n const MAX_ARGUMENT_COUNT = 8192;\n if (length < MAX_ARGUMENT_COUNT) {\n return String.fromCharCode.apply(null, bytes);\n }\n const strBuf = [];\n for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n const chunk = bytes.subarray(i, chunkEnd);\n strBuf.push(String.fromCharCode.apply(null, chunk));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToBytes(str) {\n assert(typeof str === \"string\", \"Invalid argument for stringToBytes\");\n const length = str.length;\n const bytes = new Uint8Array(length);\n for (let i = 0; i < length; ++i) {\n bytes[i] = str.charCodeAt(i) & 0xff;\n }\n return bytes;\n}\n\n/**\n * Gets length of the array (Array, Uint8Array, or string) in bytes.\n * @param {Array<any>|Uint8Array|string} arr\n * @returns {number}\n */\nfunction arrayByteLength(arr) {\n if (arr.length !== undefined) {\n return arr.length;\n }\n assert(arr.byteLength !== undefined, \"arrayByteLength - invalid argument.\");\n return arr.byteLength;\n}\n\n/**\n * Combines array items (arrays) into single Uint8Array object.\n * @param {Array<Array<any>|Uint8Array|string>} arr - the array of the arrays\n * (Array, Uint8Array, or string).\n * @returns {Uint8Array}\n */\nfunction arraysToBytes(arr) {\n const length = arr.length;\n // Shortcut: if first and only item is Uint8Array, return it.\n if (length === 1 && arr[0] instanceof Uint8Array) {\n return arr[0];\n }\n let resultLength = 0;\n for (let i = 0; i < length; i++) {\n resultLength += arrayByteLength(arr[i]);\n }\n let pos = 0;\n const data = new Uint8Array(resultLength);\n for (let i = 0; i < length; i++) {\n let item = arr[i];\n if (!(item instanceof Uint8Array)) {\n if (typeof item === \"string\") {\n item = stringToBytes(item);\n } else {\n item = new Uint8Array(item);\n }\n }\n const itemLength = item.byteLength;\n data.set(item, pos);\n pos += itemLength;\n }\n return data;\n}\n\nfunction string32(value) {\n return String.fromCharCode(\n (value >> 24) & 0xff,\n (value >> 16) & 0xff,\n (value >> 8) & 0xff,\n value & 0xff\n );\n}\n\n// Checks the endianness of the platform.\nfunction isLittleEndian() {\n const buffer8 = new Uint8Array(4);\n buffer8[0] = 1;\n const view32 = new Uint32Array(buffer8.buffer, 0, 1);\n return view32[0] === 1;\n}\nconst IsLittleEndianCached = {\n get value() {\n return shadow(this, \"value\", isLittleEndian());\n },\n};\n\n// Checks if it's possible to eval JS expressions.\nfunction isEvalSupported() {\n try {\n new Function(\"\"); // eslint-disable-line no-new, no-new-func\n return true;\n } catch (e) {\n return false;\n }\n}\nconst IsEvalSupportedCached = {\n get value() {\n return shadow(this, \"value\", isEvalSupported());\n },\n};\n\nconst rgbBuf = [\"rgb(\", 0, \",\", 0, \",\", 0, \")\"];\n\nclass Util {\n // makeCssRgb() can be called thousands of times. Using ´rgbBuf` avoids\n // creating many intermediate strings.\n static makeCssRgb(r, g, b) {\n rgbBuf[1] = r;\n rgbBuf[3] = g;\n rgbBuf[5] = b;\n return rgbBuf.join(\"\");\n }\n\n // Concatenates two transformation matrices together and returns the result.\n static transform(m1, m2) {\n return [\n m1[0] * m2[0] + m1[2] * m2[1],\n m1[1] * m2[0] + m1[3] * m2[1],\n m1[0] * m2[2] + m1[2] * m2[3],\n m1[1] * m2[2] + m1[3] * m2[3],\n m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n m1[1] * m2[4] + m1[3] * m2[5] + m1[5],\n ];\n }\n\n // For 2d affine transforms\n static applyTransform(p, m) {\n const xt = p[0] * m[0] + p[1] * m[2] + m[4];\n const yt = p[0] * m[1] + p[1] * m[3] + m[5];\n return [xt, yt];\n }\n\n static applyInverseTransform(p, m) {\n const d = m[0] * m[3] - m[1] * m[2];\n const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n return [xt, yt];\n }\n\n // Applies the transform to the rectangle and finds the minimum axially\n // aligned bounding box.\n static getAxialAlignedBoundingBox(r, m) {\n const p1 = Util.applyTransform(r, m);\n const p2 = Util.applyTransform(r.slice(2, 4), m);\n const p3 = Util.applyTransform([r[0], r[3]], m);\n const p4 = Util.applyTransform([r[2], r[1]], m);\n return [\n Math.min(p1[0], p2[0], p3[0], p4[0]),\n Math.min(p1[1], p2[1], p3[1], p4[1]),\n Math.max(p1[0], p2[0], p3[0], p4[0]),\n Math.max(p1[1], p2[1], p3[1], p4[1]),\n ];\n }\n\n static inverseTransform(m) {\n const d = m[0] * m[3] - m[1] * m[2];\n return [\n m[3] / d,\n -m[1] / d,\n -m[2] / d,\n m[0] / d,\n (m[2] * m[5] - m[4] * m[3]) / d,\n (m[4] * m[1] - m[5] * m[0]) / d,\n ];\n }\n\n // Apply a generic 3d matrix M on a 3-vector v:\n // | a b c | | X |\n // | d e f | x | Y |\n // | g h i | | Z |\n // M is assumed to be serialized as [a,b,c,d,e,f,g,h,i],\n // with v as [X,Y,Z]\n static apply3dTransform(m, v) {\n return [\n m[0] * v[0] + m[1] * v[1] + m[2] * v[2],\n m[3] * v[0] + m[4] * v[1] + m[5] * v[2],\n m[6] * v[0] + m[7] * v[1] + m[8] * v[2],\n ];\n }\n\n // This calculation uses Singular Value Decomposition.\n // The SVD can be represented with formula A = USV. We are interested in the\n // matrix S here because it represents the scale values.\n static singularValueDecompose2dScale(m) {\n const transpose = [m[0], m[2], m[1], m[3]];\n\n // Multiply matrix m with its transpose.\n const a = m[0] * transpose[0] + m[1] * transpose[2];\n const b = m[0] * transpose[1] + m[1] * transpose[3];\n const c = m[2] * transpose[0] + m[3] * transpose[2];\n const d = m[2] * transpose[1] + m[3] * transpose[3];\n\n // Solve the second degree polynomial to get roots.\n const first = (a + d) / 2;\n const second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2;\n const sx = first + second || 1;\n const sy = first - second || 1;\n\n // Scale values are the square roots of the eigenvalues.\n return [Math.sqrt(sx), Math.sqrt(sy)];\n }\n\n // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2)\n // For coordinate systems whose origin lies in the bottom-left, this\n // means normalization to (BL,TR) ordering. For systems with origin in the\n // top-left, this means (TL,BR) ordering.\n static normalizeRect(rect) {\n const r = rect.slice(0); // clone rect\n if (rect[0] > rect[2]) {\n r[0] = rect[2];\n r[2] = rect[0];\n }\n if (rect[1] > rect[3]) {\n r[1] = rect[3];\n r[3] = rect[1];\n }\n return r;\n }\n\n // Returns a rectangle [x1, y1, x2, y2] corresponding to the\n // intersection of rect1 and rect2. If no intersection, returns 'false'\n // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2]\n static intersect(rect1, rect2) {\n function compare(a, b) {\n return a - b;\n }\n\n // Order points along the axes\n const orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare);\n const orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare);\n const result = [];\n\n rect1 = Util.normalizeRect(rect1);\n rect2 = Util.normalizeRect(rect2);\n\n // X: first and second points belong to different rectangles?\n if (\n (orderedX[0] === rect1[0] && orderedX[1] === rect2[0]) ||\n (orderedX[0] === rect2[0] && orderedX[1] === rect1[0])\n ) {\n // Intersection must be between second and third points\n result[0] = orderedX[1];\n result[2] = orderedX[2];\n } else {\n return null;\n }\n\n // Y: first and second points belong to different rectangles?\n if (\n (orderedY[0] === rect1[1] && orderedY[1] === rect2[1]) ||\n (orderedY[0] === rect2[1] && orderedY[1] === rect1[1])\n ) {\n // Intersection must be between second and third points\n result[1] = orderedY[1];\n result[3] = orderedY[2];\n } else {\n return null;\n }\n\n return result;\n }\n}\n\n// prettier-ignore\nconst PDFStringTranslateTable = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0,\n 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,\n 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,\n 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,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014,\n 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C,\n 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160,\n 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC\n];\n\nfunction stringToPDFString(str) {\n const length = str.length,\n strBuf = [];\n if (str[0] === \"\\xFE\" && str[1] === \"\\xFF\") {\n // UTF16BE BOM\n for (let i = 2; i < length; i += 2) {\n strBuf.push(\n String.fromCharCode((str.charCodeAt(i) << 8) | str.charCodeAt(i + 1))\n );\n }\n } else if (str[0] === \"\\xFF\" && str[1] === \"\\xFE\") {\n // UTF16LE BOM\n for (let i = 2; i < length; i += 2) {\n strBuf.push(\n String.fromCharCode((str.charCodeAt(i + 1) << 8) | str.charCodeAt(i))\n );\n }\n } else {\n for (let i = 0; i < length; ++i) {\n const code = PDFStringTranslateTable[str.charCodeAt(i)];\n strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n }\n }\n return strBuf.join(\"\");\n}\n\nfunction escapeString(str) {\n // replace \"(\", \")\" and \"\\\" by \"\\(\", \"\\)\" and \"\\\\\"\n // in order to write it in a PDF file.\n return str.replace(/([\\(\\)\\\\])/g, \"\\\\$1\");\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isBool(v) {\n return typeof v === \"boolean\";\n}\n\nfunction isNum(v) {\n return typeof v === \"number\";\n}\n\nfunction isString(v) {\n return typeof v === \"string\";\n}\n\nfunction isArrayBuffer(v) {\n return typeof v === \"object\" && v !== null && v.byteLength !== undefined;\n}\n\nfunction isArrayEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n return arr1.every(function (element, index) {\n return element === arr2[index];\n });\n}\n\nfunction getModificationDate(date = new Date(Date.now())) {\n const buffer = [\n date.getUTCFullYear().toString(),\n (date.getUTCMonth() + 1).toString().padStart(2, \"0\"),\n (date.getUTCDate() + 1).toString().padStart(2, \"0\"),\n date.getUTCHours().toString().padStart(2, \"0\"),\n date.getUTCMinutes().toString().padStart(2, \"0\"),\n date.getUTCSeconds().toString().padStart(2, \"0\"),\n ];\n\n return buffer.join(\"\");\n}\n\n/**\n * Promise Capability object.\n *\n * @typedef {Object} PromiseCapability\n * @property {Promise<any>} promise - A Promise object.\n * @property {boolean} settled - If the Promise has been fulfilled/rejected.\n * @property {function} resolve - Fulfills the Promise.\n * @property {function} reject - Rejects the Promise.\n */\n\n/**\n * Creates a promise capability object.\n * @alias createPromiseCapability\n *\n * @returns {PromiseCapability}\n */\nfunction createPromiseCapability() {\n const capability = Object.create(null);\n let isSettled = false;\n\n Object.defineProperty(capability, \"settled\", {\n get() {\n return isSettled;\n },\n });\n capability.promise = new Promise(function (resolve, reject) {\n capability.resolve = function (data) {\n isSettled = true;\n resolve(data);\n };\n capability.reject = function (reason) {\n isSettled = true;\n reject(reason);\n };\n });\n return capability;\n}\n\nconst createObjectURL = (function createObjectURLClosure() {\n // Blob/createObjectURL is not available, falling back to data schema.\n const digits =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\n // eslint-disable-next-line no-shadow\n return function createObjectURL(data, contentType, forceDataSchema = false) {\n if (!forceDataSchema && URL.createObjectURL) {\n const blob = new Blob([data], { type: contentType });\n return URL.createObjectURL(blob);\n }\n\n let buffer = `data:${contentType};base64,`;\n for (let i = 0, ii = data.length; i < ii; i += 3) {\n const b1 = data[i] & 0xff;\n const b2 = data[i + 1] & 0xff;\n const b3 = data[i + 2] & 0xff;\n const d1 = b1 >> 2,\n d2 = ((b1 & 3) << 4) | (b2 >> 4);\n const d3 = i + 1 < ii ? ((b2 & 0xf) << 2) | (b3 >> 6) : 64;\n const d4 = i + 2 < ii ? b3 & 0x3f : 64;\n buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4];\n }\n return buffer;\n };\n})();\n\nexport {\n BaseException,\n FONT_IDENTITY_MATRIX,\n IDENTITY_MATRIX,\n OPS,\n VerbosityLevel,\n UNSUPPORTED_FEATURES,\n AnnotationBorderStyleType,\n AnnotationFieldFlag,\n AnnotationFlag,\n AnnotationMarkedState,\n AnnotationReplyType,\n AnnotationReviewState,\n AnnotationStateModelType,\n AnnotationType,\n FontType,\n ImageKind,\n CMapCompressionType,\n AbortException,\n InvalidPDFException,\n MissingPDFException,\n PasswordException,\n PasswordResponses,\n PermissionFlag,\n StreamType,\n TextRenderingMode,\n UnexpectedResponseException,\n UnknownErrorException,\n Util,\n FormatError,\n arrayByteLength,\n arraysToBytes,\n assert,\n bytesToString,\n createPromiseCapability,\n createObjectURL,\n escapeString,\n getModificationDate,\n getVerbosityLevel,\n info,\n isArrayBuffer,\n isArrayEqual,\n isBool,\n isNum,\n isString,\n isSameOrigin,\n createValidAbsoluteUrl,\n IsLittleEndianCached,\n IsEvalSupportedCached,\n removeNullCharacters,\n setVerbosityLevel,\n shadow,\n string32,\n stringToBytes,\n stringToPDFString,\n stringToUTF8String,\n utf8StringToString,\n warn,\n unreachable,\n};\n","/* Copyright 2019 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint no-var: error */\n\nimport { assert, BaseException, warn } from \"./util.js\";\n\nfunction getLookupTableFactory(initializer) {\n let lookup;\n return function () {\n if (initializer) {\n lookup = Object.create(null);\n initializer(lookup);\n initializer = null;\n }\n return lookup;\n };\n}\n\nclass MissingDataException extends BaseException {\n constructor(begin, end) {\n super(`Missing data [${begin}, ${end})`);\n this.begin = begin;\n this.end = end;\n }\n}\n\nclass XRefEntryException extends BaseException {}\n\nclass XRefParseException extends BaseException {}\n\n/**\n * Get the value of an inheritable property.\n *\n * If the PDF specification explicitly lists a property in a dictionary as\n * inheritable, then the value of the property may be present in the dictionary\n * itself or in one or more parents of the dictionary.\n *\n * If the key is not found in the tree, `undefined` is returned. Otherwise,\n * the value for the key is returned or, if `stopWhenFound` is `false`, a list\n * of values is returned. To avoid infinite loops, the traversal is stopped when\n * the loop limit is reached.\n *\n * @param {Dict} dict - Dictionary from where to start the traversal.\n * @param {string} key - The key of the property to find the value for.\n * @param {boolean} getArray - Whether or not the value should be fetched as an\n * array. The default value is `false`.\n * @param {boolean} stopWhenFound - Whether or not to stop the traversal when\n * the key is found. If set to `false`, we always walk up the entire parent\n * chain, for example to be able to find `\\Resources` placed on multiple\n * levels of the tree. The default value is `true`.\n */\nfunction getInheritableProperty({\n dict,\n key,\n getArray = false,\n stopWhenFound = true,\n}) {\n const LOOP_LIMIT = 100;\n let loopCount = 0;\n let values;\n\n while (dict) {\n const value = getArray ? dict.getArray(key) : dict.get(key);\n if (value !== undefined) {\n if (stopWhenFound) {\n return value;\n }\n if (!values) {\n values = [];\n }\n values.push(value);\n }\n if (++loopCount > LOOP_LIMIT) {\n warn(`getInheritableProperty: maximum loop count exceeded for \"${key}\"`);\n break;\n }\n dict = dict.get(\"Parent\");\n }\n return values;\n}\n\n// prettier-ignore\nconst ROMAN_NUMBER_MAP = [\n \"\", \"C\", \"CC\", \"CCC\", \"CD\", \"D\", \"DC\", \"DCC\", \"DCCC\", \"CM\",\n \"\", \"X\", \"XX\", \"XXX\", \"XL\", \"L\", \"LX\", \"LXX\", \"LXXX\", \"XC\",\n \"\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\", \"VIII\", \"IX\"\n];\n\n/**\n * Converts positive integers to (upper case) Roman numerals.\n * @param {number} number - The number that should be converted.\n * @param {boolean} lowerCase - Indicates if the result should be converted\n * to lower case letters. The default value is `false`.\n * @returns {string} The resulting Roman number.\n */\nfunction toRomanNumerals(number, lowerCase = false) {\n assert(\n Number.isInteger(number) && number > 0,\n \"The number should be a positive integer.\"\n );\n const romanBuf = [];\n let pos;\n // Thousands\n while (number >= 1000) {\n number -= 1000;\n romanBuf.push(\"M\");\n }\n // Hundreds\n pos = (number / 100) | 0;\n number %= 100;\n romanBuf.push(ROMAN_NUMBER_MAP[pos]);\n // Tens\n pos = (number / 10) | 0;\n number %= 10;\n romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]);\n // Ones\n romanBuf.push(ROMAN_NUMBER_MAP[20 + number]);\n\n const romanStr = romanBuf.join(\"\");\n return lowerCase ? romanStr.toLowerCase() : romanStr;\n}\n\n// Calculate the base 2 logarithm of the number `x`. This differs from the\n// native function in the sense that it returns the ceiling value and that it\n// returns 0 instead of `Infinity`/`NaN` for `x` values smaller than/equal to 0.\nfunction log2(x) {\n if (x <= 0) {\n return 0;\n }\n return Math.ceil(Math.log2(x));\n}\n\nfunction readInt8(data, offset) {\n return (data[offset] << 24) >> 24;\n}\n\nfunction readUint16(data, offset) {\n return (data[offset] << 8) | data[offset + 1];\n}\n\nfunction readUint32(data, offset) {\n return (\n ((data[offset] << 24) |\n (data[offset + 1] << 16) |\n (data[offset + 2] << 8) |\n data[offset + 3]) >>>\n 0\n );\n}\n\n// Checks if ch is one of the following characters: SPACE, TAB, CR or LF.\nfunction isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a;\n}\n\nexport {\n getLookupTableFactory,\n MissingDataException,\n XRefEntryException,\n XRefParseException,\n getInheritableProperty,\n toRomanNumerals,\n log2,\n readInt8,\n readUint16,\n readUint32,\n isWhiteSpace,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint no-var: error */\n\n// Table C-2\nconst QeTable = [\n { qe: 0x5601, nmps: 1, nlps: 1, switchFlag: 1 },\n { qe: 0x3401, nmps: 2, nlps: 6, switchFlag: 0 },\n { qe: 0x1801, nmps: 3, nlps: 9, switchFlag: 0 },\n { qe: 0x0ac1, nmps: 4, nlps: 12, switchFlag: 0 },\n { qe: 0x0521, nmps: 5, nlps: 29, switchFlag: 0 },\n { qe: 0x0221, nmps: 38, nlps: 33, switchFlag: 0 },\n { qe: 0x5601, nmps: 7, nlps: 6, switchFlag: 1 },\n { qe: 0x5401, nmps: 8, nlps: 14, switchFlag: 0 },\n { qe: 0x4801, nmps: 9, nlps: 14, switchFlag: 0 },\n { qe: 0x3801, nmps: 10, nlps: 14, switchFlag: 0 },\n { qe: 0x3001, nmps: 11, nlps: 17, switchFlag: 0 },\n { qe: 0x2401, nmps: 12, nlps: 18, switchFlag: 0 },\n { qe: 0x1c01, nmps: 13, nlps: 20, switchFlag: 0 },\n { qe: 0x1601, nmps: 29, nlps: 21, switchFlag: 0 },\n { qe: 0x5601, nmps: 15, nlps: 14, switchFlag: 1 },\n { qe: 0x5401, nmps: 16, nlps: 14, switchFlag: 0 },\n { qe: 0x5101, nmps: 17, nlps: 15, switchFlag: 0 },\n { qe: 0x4801, nmps: 18, nlps: 16, switchFlag: 0 },\n { qe: 0x3801, nmps: 19, nlps: 17, switchFlag: 0 },\n { qe: 0x3401, nmps: 20, nlps: 18, switchFlag: 0 },\n { qe: 0x3001, nmps: 21, nlps: 19, switchFlag: 0 },\n { qe: 0x2801, nmps: 22, nlps: 19, switchFlag: 0 },\n { qe: 0x2401, nmps: 23, nlps: 20, switchFlag: 0 },\n { qe: 0x2201, nmps: 24, nlps: 21, switchFlag: 0 },\n { qe: 0x1c01, nmps: 25, nlps: 22, switchFlag: 0 },\n { qe: 0x1801, nmps: 26, nlps: 23, switchFlag: 0 },\n { qe: 0x1601, nmps: 27, nlps: 24, switchFlag: 0 },\n { qe: 0x1401, nmps: 28, nlps: 25, switchFlag: 0 },\n { qe: 0x1201, nmps: 29, nlps: 26, switchFlag: 0 },\n { qe: 0x1101, nmps: 30, nlps: 27, switchFlag: 0 },\n { qe: 0x0ac1, nmps: 31, nlps: 28, switchFlag: 0 },\n { qe: 0x09c1, nmps: 32, nlps: 29, switchFlag: 0 },\n { qe: 0x08a1, nmps: 33, nlps: 30, switchFlag: 0 },\n { qe: 0x0521, nmps: 34, nlps: 31, switchFlag: 0 },\n { qe: 0x0441, nmps: 35, nlps: 32, switchFlag: 0 },\n { qe: 0x02a1, nmps: 36, nlps: 33, switchFlag: 0 },\n { qe: 0x0221, nmps: 37, nlps: 34, switchFlag: 0 },\n { qe: 0x0141, nmps: 38, nlps: 35, switchFlag: 0 },\n { qe: 0x0111, nmps: 39, nlps: 36, switchFlag: 0 },\n { qe: 0x0085, nmps: 40, nlps: 37, switchFlag: 0 },\n { qe: 0x0049, nmps: 41, nlps: 38, switchFlag: 0 },\n { qe: 0x0025, nmps: 42, nlps: 39, switchFlag: 0 },\n { qe: 0x0015, nmps: 43, nlps: 40, switchFlag: 0 },\n { qe: 0x0009, nmps: 44, nlps: 41, switchFlag: 0 },\n { qe: 0x0005, nmps: 45, nlps: 42, switchFlag: 0 },\n { qe: 0x0001, nmps: 45, nlps: 43, switchFlag: 0 },\n { qe: 0x5601, nmps: 46, nlps: 46, switchFlag: 0 },\n];\n\n/**\n * This class implements the QM Coder decoding as defined in\n * JPEG 2000 Part I Final Committee Draft Version 1.0\n * Annex C.3 Arithmetic decoding procedure\n * available at http://www.jpeg.org/public/fcd15444-1.pdf\n *\n * The arithmetic decoder is used in conjunction with context models to decode\n * JPEG2000 and JBIG2 streams.\n */\nclass ArithmeticDecoder {\n // C.3.5 Initialisation of the decoder (INITDEC)\n constructor(data, start, end) {\n this.data = data;\n this.bp = start;\n this.dataEnd = end;\n\n this.chigh = data[start];\n this.clow = 0;\n\n this.byteIn();\n\n this.chigh = ((this.chigh << 7) & 0xffff) | ((this.clow >> 9) & 0x7f);\n this.clow = (this.clow << 7) & 0xffff;\n this.ct -= 7;\n this.a = 0x8000;\n }\n\n // C.3.4 Compressed data input (BYTEIN)\n byteIn() {\n const data = this.data;\n let bp = this.bp;\n\n if (data[bp] === 0xff) {\n if (data[bp + 1] > 0x8f) {\n this.clow += 0xff00;\n this.ct = 8;\n } else {\n bp++;\n this.clow += data[bp] << 9;\n this.ct = 7;\n this.bp = bp;\n }\n } else {\n bp++;\n this.clow += bp < this.dataEnd ? data[bp] << 8 : 0xff00;\n this.ct = 8;\n this.bp = bp;\n }\n if (this.clow > 0xffff) {\n this.chigh += this.clow >> 16;\n this.clow &= 0xffff;\n }\n }\n\n // C.3.2 Decoding a decision (DECODE)\n readBit(contexts, pos) {\n // Contexts are packed into 1 byte:\n // highest 7 bits carry cx.index, lowest bit carries cx.mps\n let cx_index = contexts[pos] >> 1,\n cx_mps = contexts[pos] & 1;\n const qeTableIcx = QeTable[cx_index];\n const qeIcx = qeTableIcx.qe;\n let d;\n let a = this.a - qeIcx;\n\n if (this.chigh < qeIcx) {\n // exchangeLps\n if (a < qeIcx) {\n a = qeIcx;\n d = cx_mps;\n cx_index = qeTableIcx.nmps;\n } else {\n a = qeIcx;\n d = 1 ^ cx_mps;\n if (qeTableIcx.switchFlag === 1) {\n cx_mps = d;\n }\n cx_index = qeTableIcx.nlps;\n }\n } else {\n this.chigh -= qeIcx;\n if ((a & 0x8000) !== 0) {\n this.a = a;\n return cx_mps;\n }\n // exchangeMps\n if (a < qeIcx) {\n d = 1 ^ cx_mps;\n if (qeTableIcx.switchFlag === 1) {\n cx_mps = d;\n }\n cx_index = qeTableIcx.nlps;\n } else {\n d = cx_mps;\n cx_index = qeTableIcx.nmps;\n }\n }\n // C.3.3 renormD;\n do {\n if (this.ct === 0) {\n this.byteIn();\n }\n\n a <<= 1;\n this.chigh = ((this.chigh << 1) & 0xffff) | ((this.clow >> 15) & 1);\n this.clow = (this.clow << 1) & 0xffff;\n this.ct--;\n } while ((a & 0x8000) === 0);\n this.a = a;\n\n contexts[pos] = (cx_index << 1) | cx_mps;\n return d;\n }\n}\n\nexport { ArithmeticDecoder };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* Copyright 1996-2003 Glyph & Cog, LLC\n *\n * The CCITT stream implementation contained in this file is a JavaScript port\n * of XPDF's implementation, made available under the Apache 2.0 open source\n * license.\n */\n\n/**\n * @typedef {Object} CCITTFaxDecoderSource\n * @property {function} next - Method that return one byte of data for decoding,\n * or -1 when EOF is reached.\n */\n\nimport { info } from \"./util.js\";\n\nconst CCITTFaxDecoder = (function CCITTFaxDecoder() {\n const ccittEOL = -2;\n const ccittEOF = -1;\n const twoDimPass = 0;\n const twoDimHoriz = 1;\n const twoDimVert0 = 2;\n const twoDimVertR1 = 3;\n const twoDimVertL1 = 4;\n const twoDimVertR2 = 5;\n const twoDimVertL2 = 6;\n const twoDimVertR3 = 7;\n const twoDimVertL3 = 8;\n\n // prettier-ignore\n const twoDimTable = [\n [-1, -1], [-1, -1], // 000000x\n [7, twoDimVertL3], // 0000010\n [7, twoDimVertR3], // 0000011\n [6, twoDimVertL2], [6, twoDimVertL2], // 000010x\n [6, twoDimVertR2], [6, twoDimVertR2], // 000011x\n [4, twoDimPass], [4, twoDimPass], // 0001xxx\n [4, twoDimPass], [4, twoDimPass],\n [4, twoDimPass], [4, twoDimPass],\n [4, twoDimPass], [4, twoDimPass],\n [3, twoDimHoriz], [3, twoDimHoriz], // 001xxxx\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimVertL1], [3, twoDimVertL1], // 010xxxx\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertR1], [3, twoDimVertR1], // 011xxxx\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [1, twoDimVert0], [1, twoDimVert0], // 1xxxxxx\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0]\n ];\n\n // prettier-ignore\n const whiteTable1 = [\n [-1, -1], // 00000\n [12, ccittEOL], // 00001\n [-1, -1], [-1, -1], // 0001x\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 001xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 010xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 011xx\n [11, 1792], [11, 1792], // 1000x\n [12, 1984], // 10010\n [12, 2048], // 10011\n [12, 2112], // 10100\n [12, 2176], // 10101\n [12, 2240], // 10110\n [12, 2304], // 10111\n [11, 1856], [11, 1856], // 1100x\n [11, 1920], [11, 1920], // 1101x\n [12, 2368], // 11100\n [12, 2432], // 11101\n [12, 2496], // 11110\n [12, 2560] // 11111\n ];\n\n // prettier-ignore\n const whiteTable2 = [\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000000xx\n [8, 29], [8, 29], // 00000010x\n [8, 30], [8, 30], // 00000011x\n [8, 45], [8, 45], // 00000100x\n [8, 46], [8, 46], // 00000101x\n [7, 22], [7, 22], [7, 22], [7, 22], // 0000011xx\n [7, 23], [7, 23], [7, 23], [7, 23], // 0000100xx\n [8, 47], [8, 47], // 00001010x\n [8, 48], [8, 48], // 00001011x\n [6, 13], [6, 13], [6, 13], [6, 13], // 000011xxx\n [6, 13], [6, 13], [6, 13], [6, 13],\n [7, 20], [7, 20], [7, 20], [7, 20], // 0001000xx\n [8, 33], [8, 33], // 00010010x\n [8, 34], [8, 34], // 00010011x\n [8, 35], [8, 35], // 00010100x\n [8, 36], [8, 36], // 00010101x\n [8, 37], [8, 37], // 00010110x\n [8, 38], [8, 38], // 00010111x\n [7, 19], [7, 19], [7, 19], [7, 19], // 0001100xx\n [8, 31], [8, 31], // 00011010x\n [8, 32], [8, 32], // 00011011x\n [6, 1], [6, 1], [6, 1], [6, 1], // 000111xxx\n [6, 1], [6, 1], [6, 1], [6, 1],\n [6, 12], [6, 12], [6, 12], [6, 12], // 001000xxx\n [6, 12], [6, 12], [6, 12], [6, 12],\n [8, 53], [8, 53], // 00100100x\n [8, 54], [8, 54], // 00100101x\n [7, 26], [7, 26], [7, 26], [7, 26], // 0010011xx\n [8, 39], [8, 39], // 00101000x\n [8, 40], [8, 40], // 00101001x\n [8, 41], [8, 41], // 00101010x\n [8, 42], [8, 42], // 00101011x\n [8, 43], [8, 43], // 00101100x\n [8, 44], [8, 44], // 00101101x\n [7, 21], [7, 21], [7, 21], [7, 21], // 0010111xx\n [7, 28], [7, 28], [7, 28], [7, 28], // 0011000xx\n [8, 61], [8, 61], // 00110010x\n [8, 62], [8, 62], // 00110011x\n [8, 63], [8, 63], // 00110100x\n [8, 0], [8, 0], // 00110101x\n [8, 320], [8, 320], // 00110110x\n [8, 384], [8, 384], // 00110111x\n [5, 10], [5, 10], [5, 10], [5, 10], // 00111xxxx\n [5, 10], [5, 10], [5, 10], [5, 10],\n [5, 10], [5, 10], [5, 10], [5, 10],\n [5, 10], [5, 10], [5, 10], [5, 10],\n [5, 11], [5, 11], [5, 11], [5, 11], // 01000xxxx\n [5, 11], [5, 11], [5, 11], [5, 11],\n [5, 11], [5, 11], [5, 11], [5, 11],\n [5, 11], [5, 11], [5, 11], [5, 11],\n [7, 27], [7, 27], [7, 27], [7, 27], // 0100100xx\n [8, 59], [8, 59], // 01001010x\n [8, 60], [8, 60], // 01001011x\n [9, 1472], // 010011000\n [9, 1536], // 010011001\n [9, 1600], // 010011010\n [9, 1728], // 010011011\n [7, 18], [7, 18], [7, 18], [7, 18], // 0100111xx\n [7, 24], [7, 24], [7, 24], [7, 24], // 0101000xx\n [8, 49], [8, 49], // 01010010x\n [8, 50], [8, 50], // 01010011x\n [8, 51], [8, 51], // 01010100x\n [8, 52], [8, 52], // 01010101x\n [7, 25], [7, 25], [7, 25], [7, 25], // 0101011xx\n [8, 55], [8, 55], // 01011000x\n [8, 56], [8, 56], // 01011001x\n [8, 57], [8, 57], // 01011010x\n [8, 58], [8, 58], // 01011011x\n [6, 192], [6, 192], [6, 192], [6, 192], // 010111xxx\n [6, 192], [6, 192], [6, 192], [6, 192],\n [6, 1664], [6, 1664], [6, 1664], [6, 1664], // 011000xxx\n [6, 1664], [6, 1664], [6, 1664], [6, 1664],\n [8, 448], [8, 448], // 01100100x\n [8, 512], [8, 512], // 01100101x\n [9, 704], // 011001100\n [9, 768], // 011001101\n [8, 640], [8, 640], // 01100111x\n [8, 576], [8, 576], // 01101000x\n [9, 832], // 011010010\n [9, 896], // 011010011\n [9, 960], // 011010100\n [9, 1024], // 011010101\n [9, 1088], // 011010110\n [9, 1152], // 011010111\n [9, 1216], // 011011000\n [9, 1280], // 011011001\n [9, 1344], // 011011010\n [9, 1408], // 011011011\n [7, 256], [7, 256], [7, 256], [7, 256], // 0110111xx\n [4, 2], [4, 2], [4, 2], [4, 2], // 0111xxxxx\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 3], [4, 3], [4, 3], [4, 3], // 1000xxxxx\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [5, 128], [5, 128], [5, 128], [5, 128], // 10010xxxx\n [5, 128], [5, 128], [5, 128], [5, 128],\n [5, 128], [5, 128], [5, 128], [5, 128],\n [5, 128], [5, 128], [5, 128], [5, 128],\n [5, 8], [5, 8], [5, 8], [5, 8], // 10011xxxx\n [5, 8], [5, 8], [5, 8], [5, 8],\n [5, 8], [5, 8], [5, 8], [5, 8],\n [5, 8], [5, 8], [5, 8], [5, 8],\n [5, 9], [5, 9], [5, 9], [5, 9], // 10100xxxx\n [5, 9], [5, 9], [5, 9], [5, 9],\n [5, 9], [5, 9], [5, 9], [5, 9],\n [5, 9], [5, 9], [5, 9], [5, 9],\n [6, 16], [6, 16], [6, 16], [6, 16], // 101010xxx\n [6, 16], [6, 16], [6, 16], [6, 16],\n [6, 17], [6, 17], [6, 17], [6, 17], // 101011xxx\n [6, 17], [6, 17], [6, 17], [6, 17],\n [4, 4], [4, 4], [4, 4], [4, 4], // 1011xxxxx\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 5], [4, 5], [4, 5], [4, 5], // 1100xxxxx\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [6, 14], [6, 14], [6, 14], [6, 14], // 110100xxx\n [6, 14], [6, 14], [6, 14], [6, 14],\n [6, 15], [6, 15], [6, 15], [6, 15], // 110101xxx\n [6, 15], [6, 15], [6, 15], [6, 15],\n [5, 64], [5, 64], [5, 64], [5, 64], // 11011xxxx\n [5, 64], [5, 64], [5, 64], [5, 64],\n [5, 64], [5, 64], [5, 64], [5, 64],\n [5, 64], [5, 64], [5, 64], [5, 64],\n [4, 6], [4, 6], [4, 6], [4, 6], // 1110xxxxx\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 7], [4, 7], [4, 7], [4, 7], // 1111xxxxx\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7]\n ];\n\n // prettier-ignore\n const blackTable1 = [\n [-1, -1], [-1, -1], // 000000000000x\n [12, ccittEOL], [12, ccittEOL], // 000000000001x\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000001xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000010xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000011xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000100xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000101xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000110xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000111xx\n [11, 1792], [11, 1792], [11, 1792], [11, 1792], // 00000001000xx\n [12, 1984], [12, 1984], // 000000010010x\n [12, 2048], [12, 2048], // 000000010011x\n [12, 2112], [12, 2112], // 000000010100x\n [12, 2176], [12, 2176], // 000000010101x\n [12, 2240], [12, 2240], // 000000010110x\n [12, 2304], [12, 2304], // 000000010111x\n [11, 1856], [11, 1856], [11, 1856], [11, 1856], // 00000001100xx\n [11, 1920], [11, 1920], [11, 1920], [11, 1920], // 00000001101xx\n [12, 2368], [12, 2368], // 000000011100x\n [12, 2432], [12, 2432], // 000000011101x\n [12, 2496], [12, 2496], // 000000011110x\n [12, 2560], [12, 2560], // 000000011111x\n [10, 18], [10, 18], [10, 18], [10, 18], // 0000001000xxx\n [10, 18], [10, 18], [10, 18], [10, 18],\n [12, 52], [12, 52], // 000000100100x\n [13, 640], // 0000001001010\n [13, 704], // 0000001001011\n [13, 768], // 0000001001100\n [13, 832], // 0000001001101\n [12, 55], [12, 55], // 000000100111x\n [12, 56], [12, 56], // 000000101000x\n [13, 1280], // 0000001010010\n [13, 1344], // 0000001010011\n [13, 1408], // 0000001010100\n [13, 1472], // 0000001010101\n [12, 59], [12, 59], // 000000101011x\n [12, 60], [12, 60], // 000000101100x\n [13, 1536], // 0000001011010\n [13, 1600], // 0000001011011\n [11, 24], [11, 24], [11, 24], [11, 24], // 00000010111xx\n [11, 25], [11, 25], [11, 25], [11, 25], // 00000011000xx\n [13, 1664], // 0000001100100\n [13, 1728], // 0000001100101\n [12, 320], [12, 320], // 000000110011x\n [12, 384], [12, 384], // 000000110100x\n [12, 448], [12, 448], // 000000110101x\n [13, 512], // 0000001101100\n [13, 576], // 0000001101101\n [12, 53], [12, 53], // 000000110111x\n [12, 54], [12, 54], // 000000111000x\n [13, 896], // 0000001110010\n [13, 960], // 0000001110011\n [13, 1024], // 0000001110100\n [13, 1088], // 0000001110101\n [13, 1152], // 0000001110110\n [13, 1216], // 0000001110111\n [10, 64], [10, 64], [10, 64], [10, 64], // 0000001111xxx\n [10, 64], [10, 64], [10, 64], [10, 64]\n ];\n\n // prettier-ignore\n const blackTable2 = [\n [8, 13], [8, 13], [8, 13], [8, 13], // 00000100xxxx\n [8, 13], [8, 13], [8, 13], [8, 13],\n [8, 13], [8, 13], [8, 13], [8, 13],\n [8, 13], [8, 13], [8, 13], [8, 13],\n [11, 23], [11, 23], // 00000101000x\n [12, 50], // 000001010010\n [12, 51], // 000001010011\n [12, 44], // 000001010100\n [12, 45], // 000001010101\n [12, 46], // 000001010110\n [12, 47], // 000001010111\n [12, 57], // 000001011000\n [12, 58], // 000001011001\n [12, 61], // 000001011010\n [12, 256], // 000001011011\n [10, 16], [10, 16], [10, 16], [10, 16], // 0000010111xx\n [10, 17], [10, 17], [10, 17], [10, 17], // 0000011000xx\n [12, 48], // 000001100100\n [12, 49], // 000001100101\n [12, 62], // 000001100110\n [12, 63], // 000001100111\n [12, 30], // 000001101000\n [12, 31], // 000001101001\n [12, 32], // 000001101010\n [12, 33], // 000001101011\n [12, 40], // 000001101100\n [12, 41], // 000001101101\n [11, 22], [11, 22], // 00000110111x\n [8, 14], [8, 14], [8, 14], [8, 14], // 00000111xxxx\n [8, 14], [8, 14], [8, 14], [8, 14],\n [8, 14], [8, 14], [8, 14], [8, 14],\n [8, 14], [8, 14], [8, 14], [8, 14],\n [7, 10], [7, 10], [7, 10], [7, 10], // 0000100xxxxx\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 11], [7, 11], [7, 11], [7, 11], // 0000101xxxxx\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [9, 15], [9, 15], [9, 15], [9, 15], // 000011000xxx\n [9, 15], [9, 15], [9, 15], [9, 15],\n [12, 128], // 000011001000\n [12, 192], // 000011001001\n [12, 26], // 000011001010\n [12, 27], // 000011001011\n [12, 28], // 000011001100\n [12, 29], // 000011001101\n [11, 19], [11, 19], // 00001100111x\n [11, 20], [11, 20], // 00001101000x\n [12, 34], // 000011010010\n [12, 35], // 000011010011\n [12, 36], // 000011010100\n [12, 37], // 000011010101\n [12, 38], // 000011010110\n [12, 39], // 000011010111\n [11, 21], [11, 21], // 00001101100x\n [12, 42], // 000011011010\n [12, 43], // 000011011011\n [10, 0], [10, 0], [10, 0], [10, 0], // 0000110111xx\n [7, 12], [7, 12], [7, 12], [7, 12], // 0000111xxxxx\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12]\n ];\n\n // prettier-ignore\n const blackTable3 = [\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000xx\n [6, 9], // 000100\n [6, 8], // 000101\n [5, 7], [5, 7], // 00011x\n [4, 6], [4, 6], [4, 6], [4, 6], // 0010xx\n [4, 5], [4, 5], [4, 5], [4, 5], // 0011xx\n [3, 1], [3, 1], [3, 1], [3, 1], // 010xxx\n [3, 1], [3, 1], [3, 1], [3, 1],\n [3, 4], [3, 4], [3, 4], [3, 4], // 011xxx\n [3, 4], [3, 4], [3, 4], [3, 4],\n [2, 3], [2, 3], [2, 3], [2, 3], // 10xxxx\n [2, 3], [2, 3], [2, 3], [2, 3],\n [2, 3], [2, 3], [2, 3], [2, 3],\n [2, 3], [2, 3], [2, 3], [2, 3],\n [2, 2], [2, 2], [2, 2], [2, 2], // 11xxxx\n [2, 2], [2, 2], [2, 2], [2, 2],\n [2, 2], [2, 2], [2, 2], [2, 2],\n [2, 2], [2, 2], [2, 2], [2, 2]\n ];\n\n /**\n * @param {CCITTFaxDecoderSource} source - The data which should be decoded.\n * @param {Object} [options] - Decoding options.\n */\n // eslint-disable-next-line no-shadow\n function CCITTFaxDecoder(source, options = {}) {\n if (!source || typeof source.next !== \"function\") {\n throw new Error('CCITTFaxDecoder - invalid \"source\" parameter.');\n }\n this.source = source;\n this.eof = false;\n\n this.encoding = options.K || 0;\n this.eoline = options.EndOfLine || false;\n this.byteAlign = options.EncodedByteAlign || false;\n this.columns = options.Columns || 1728;\n this.rows = options.Rows || 0;\n let eoblock = options.EndOfBlock;\n if (eoblock === null || eoblock === undefined) {\n eoblock = true;\n }\n this.eoblock = eoblock;\n this.black = options.BlackIs1 || false;\n\n this.codingLine = new Uint32Array(this.columns + 1);\n this.refLine = new Uint32Array(this.columns + 2);\n\n this.codingLine[0] = this.columns;\n this.codingPos = 0;\n\n this.row = 0;\n this.nextLine2D = this.encoding < 0;\n this.inputBits = 0;\n this.inputBuf = 0;\n this.outputBits = 0;\n this.rowsDone = false;\n\n let code1;\n while ((code1 = this._lookBits(12)) === 0) {\n this._eatBits(1);\n }\n if (code1 === 1) {\n this._eatBits(12);\n }\n if (this.encoding > 0) {\n this.nextLine2D = !this._lookBits(1);\n this._eatBits(1);\n }\n }\n\n CCITTFaxDecoder.prototype = {\n readNextChar() {\n if (this.eof) {\n return -1;\n }\n const refLine = this.refLine;\n const codingLine = this.codingLine;\n const columns = this.columns;\n\n let refPos, blackPixels, bits, i;\n\n if (this.outputBits === 0) {\n if (this.rowsDone) {\n this.eof = true;\n }\n if (this.eof) {\n return -1;\n }\n this.err = false;\n\n let code1, code2, code3;\n if (this.nextLine2D) {\n for (i = 0; codingLine[i] < columns; ++i) {\n refLine[i] = codingLine[i];\n }\n refLine[i++] = columns;\n refLine[i] = columns;\n codingLine[0] = 0;\n this.codingPos = 0;\n refPos = 0;\n blackPixels = 0;\n\n while (codingLine[this.codingPos] < columns) {\n code1 = this._getTwoDimCode();\n switch (code1) {\n case twoDimPass:\n this._addPixels(refLine[refPos + 1], blackPixels);\n if (refLine[refPos + 1] < columns) {\n refPos += 2;\n }\n break;\n case twoDimHoriz:\n code1 = code2 = 0;\n if (blackPixels) {\n do {\n code1 += code3 = this._getBlackCode();\n } while (code3 >= 64);\n do {\n code2 += code3 = this._getWhiteCode();\n } while (code3 >= 64);\n } else {\n do {\n code1 += code3 = this._getWhiteCode();\n } while (code3 >= 64);\n do {\n code2 += code3 = this._getBlackCode();\n } while (code3 >= 64);\n }\n this._addPixels(\n codingLine[this.codingPos] + code1,\n blackPixels\n );\n if (codingLine[this.codingPos] < columns) {\n this._addPixels(\n codingLine[this.codingPos] + code2,\n blackPixels ^ 1\n );\n }\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n break;\n case twoDimVertR3:\n this._addPixels(refLine[refPos] + 3, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n ++refPos;\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertR2:\n this._addPixels(refLine[refPos] + 2, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n ++refPos;\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertR1:\n this._addPixels(refLine[refPos] + 1, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n ++refPos;\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case twoDimVert0:\n this._addPixels(refLine[refPos], blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n ++refPos;\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertL3:\n this._addPixelsNeg(refLine[refPos] - 3, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n if (refPos > 0) {\n --refPos;\n } else {\n ++refPos;\n }\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertL2:\n this._addPixelsNeg(refLine[refPos] - 2, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n if (refPos > 0) {\n --refPos;\n } else {\n ++refPos;\n }\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertL1:\n this._addPixelsNeg(refLine[refPos] - 1, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n if (refPos > 0) {\n --refPos;\n } else {\n ++refPos;\n }\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case ccittEOF:\n this._addPixels(columns, 0);\n this.eof = true;\n break;\n default:\n info(\"bad 2d code\");\n this._addPixels(columns, 0);\n this.err = true;\n }\n }\n } else {\n codingLine[0] = 0;\n this.codingPos = 0;\n blackPixels = 0;\n while (codingLine[this.codingPos] < columns) {\n code1 = 0;\n if (blackPixels) {\n do {\n code1 += code3 = this._getBlackCode();\n } while (code3 >= 64);\n } else {\n do {\n code1 += code3 = this._getWhiteCode();\n } while (code3 >= 64);\n }\n this._addPixels(codingLine[this.codingPos] + code1, blackPixels);\n blackPixels ^= 1;\n }\n }\n\n let gotEOL = false;\n\n if (this.byteAlign) {\n this.inputBits &= ~7;\n }\n\n if (!this.eoblock && this.row === this.rows - 1) {\n this.rowsDone = true;\n } else {\n code1 = this._lookBits(12);\n if (this.eoline) {\n while (code1 !== ccittEOF && code1 !== 1) {\n this._eatBits(1);\n code1 = this._lookBits(12);\n }\n } else {\n while (code1 === 0) {\n this._eatBits(1);\n code1 = this._lookBits(12);\n }\n }\n if (code1 === 1) {\n this._eatBits(12);\n gotEOL = true;\n } else if (code1 === ccittEOF) {\n this.eof = true;\n }\n }\n\n if (!this.eof && this.encoding > 0 && !this.rowsDone) {\n this.nextLine2D = !this._lookBits(1);\n this._eatBits(1);\n }\n\n if (this.eoblock && gotEOL && this.byteAlign) {\n code1 = this._lookBits(12);\n if (code1 === 1) {\n this._eatBits(12);\n if (this.encoding > 0) {\n this._lookBits(1);\n this._eatBits(1);\n }\n if (this.encoding >= 0) {\n for (i = 0; i < 4; ++i) {\n code1 = this._lookBits(12);\n if (code1 !== 1) {\n info(\"bad rtc code: \" + code1);\n }\n this._eatBits(12);\n if (this.encoding > 0) {\n this._lookBits(1);\n this._eatBits(1);\n }\n }\n }\n this.eof = true;\n }\n } else if (this.err && this.eoline) {\n while (true) {\n code1 = this._lookBits(13);\n if (code1 === ccittEOF) {\n this.eof = true;\n return -1;\n }\n if (code1 >> 1 === 1) {\n break;\n }\n this._eatBits(1);\n }\n this._eatBits(12);\n if (this.encoding > 0) {\n this._eatBits(1);\n this.nextLine2D = !(code1 & 1);\n }\n }\n\n if (codingLine[0] > 0) {\n this.outputBits = codingLine[(this.codingPos = 0)];\n } else {\n this.outputBits = codingLine[(this.codingPos = 1)];\n }\n this.row++;\n }\n\n let c;\n if (this.outputBits >= 8) {\n c = this.codingPos & 1 ? 0 : 0xff;\n this.outputBits -= 8;\n if (this.outputBits === 0 && codingLine[this.codingPos] < columns) {\n this.codingPos++;\n this.outputBits =\n codingLine[this.codingPos] - codingLine[this.codingPos - 1];\n }\n } else {\n bits = 8;\n c = 0;\n do {\n if (this.outputBits > bits) {\n c <<= bits;\n if (!(this.codingPos & 1)) {\n c |= 0xff >> (8 - bits);\n }\n this.outputBits -= bits;\n bits = 0;\n } else {\n c <<= this.outputBits;\n if (!(this.codingPos & 1)) {\n c |= 0xff >> (8 - this.outputBits);\n }\n bits -= this.outputBits;\n this.outputBits = 0;\n if (codingLine[this.codingPos] < columns) {\n this.codingPos++;\n this.outputBits =\n codingLine[this.codingPos] - codingLine[this.codingPos - 1];\n } else if (bits > 0) {\n c <<= bits;\n bits = 0;\n }\n }\n } while (bits);\n }\n if (this.black) {\n c ^= 0xff;\n }\n return c;\n },\n\n /**\n * @private\n */\n _addPixels(a1, blackPixels) {\n const codingLine = this.codingLine;\n let codingPos = this.codingPos;\n\n if (a1 > codingLine[codingPos]) {\n if (a1 > this.columns) {\n info(\"row is wrong length\");\n this.err = true;\n a1 = this.columns;\n }\n if ((codingPos & 1) ^ blackPixels) {\n ++codingPos;\n }\n\n codingLine[codingPos] = a1;\n }\n this.codingPos = codingPos;\n },\n\n /**\n * @private\n */\n _addPixelsNeg(a1, blackPixels) {\n const codingLine = this.codingLine;\n let codingPos = this.codingPos;\n\n if (a1 > codingLine[codingPos]) {\n if (a1 > this.columns) {\n info(\"row is wrong length\");\n this.err = true;\n a1 = this.columns;\n }\n if ((codingPos & 1) ^ blackPixels) {\n ++codingPos;\n }\n\n codingLine[codingPos] = a1;\n } else if (a1 < codingLine[codingPos]) {\n if (a1 < 0) {\n info(\"invalid code\");\n this.err = true;\n a1 = 0;\n }\n while (codingPos > 0 && a1 < codingLine[codingPos - 1]) {\n --codingPos;\n }\n codingLine[codingPos] = a1;\n }\n\n this.codingPos = codingPos;\n },\n\n /**\n * This function returns the code found from the table.\n * The start and end parameters set the boundaries for searching the table.\n * The limit parameter is optional. Function returns an array with three\n * values. The first array element indicates whether a valid code is being\n * returned. The second array element is the actual code. The third array\n * element indicates whether EOF was reached.\n * @private\n */\n _findTableCode(start, end, table, limit) {\n const limitValue = limit || 0;\n for (let i = start; i <= end; ++i) {\n let code = this._lookBits(i);\n if (code === ccittEOF) {\n return [true, 1, false];\n }\n if (i < end) {\n code <<= end - i;\n }\n if (!limitValue || code >= limitValue) {\n const p = table[code - limitValue];\n if (p[0] === i) {\n this._eatBits(i);\n return [true, p[1], true];\n }\n }\n }\n return [false, 0, false];\n },\n\n /**\n * @private\n */\n _getTwoDimCode() {\n let code = 0;\n let p;\n if (this.eoblock) {\n code = this._lookBits(7);\n p = twoDimTable[code];\n if (p && p[0] > 0) {\n this._eatBits(p[0]);\n return p[1];\n }\n } else {\n const result = this._findTableCode(1, 7, twoDimTable);\n if (result[0] && result[2]) {\n return result[1];\n }\n }\n info(\"Bad two dim code\");\n return ccittEOF;\n },\n\n /**\n * @private\n */\n _getWhiteCode() {\n let code = 0;\n let p;\n if (this.eoblock) {\n code = this._lookBits(12);\n if (code === ccittEOF) {\n return 1;\n }\n\n if (code >> 5 === 0) {\n p = whiteTable1[code];\n } else {\n p = whiteTable2[code >> 3];\n }\n\n if (p[0] > 0) {\n this._eatBits(p[0]);\n return p[1];\n }\n } else {\n let result = this._findTableCode(1, 9, whiteTable2);\n if (result[0]) {\n return result[1];\n }\n\n result = this._findTableCode(11, 12, whiteTable1);\n if (result[0]) {\n return result[1];\n }\n }\n info(\"bad white code\");\n this._eatBits(1);\n return 1;\n },\n\n /**\n * @private\n */\n _getBlackCode() {\n let code, p;\n if (this.eoblock) {\n code = this._lookBits(13);\n if (code === ccittEOF) {\n return 1;\n }\n if (code >> 7 === 0) {\n p = blackTable1[code];\n } else if (code >> 9 === 0 && code >> 7 !== 0) {\n p = blackTable2[(code >> 1) - 64];\n } else {\n p = blackTable3[code >> 7];\n }\n\n if (p[0] > 0) {\n this._eatBits(p[0]);\n return p[1];\n }\n } else {\n let result = this._findTableCode(2, 6, blackTable3);\n if (result[0]) {\n return result[1];\n }\n\n result = this._findTableCode(7, 12, blackTable2, 64);\n if (result[0]) {\n return result[1];\n }\n\n result = this._findTableCode(10, 13, blackTable1);\n if (result[0]) {\n return result[1];\n }\n }\n info(\"bad black code\");\n this._eatBits(1);\n return 1;\n },\n\n /**\n * @private\n */\n _lookBits(n) {\n let c;\n while (this.inputBits < n) {\n if ((c = this.source.next()) === -1) {\n if (this.inputBits === 0) {\n return ccittEOF;\n }\n return (this.inputBuf << (n - this.inputBits)) & (0xffff >> (16 - n));\n }\n this.inputBuf = (this.inputBuf << 8) | c;\n this.inputBits += 8;\n }\n return (this.inputBuf >> (this.inputBits - n)) & (0xffff >> (16 - n));\n },\n\n /**\n * @private\n */\n _eatBits(n) {\n if ((this.inputBits -= n) < 0) {\n this.inputBits = 0;\n }\n },\n };\n\n return CCITTFaxDecoder;\n})();\n\nexport { CCITTFaxDecoder };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BaseException, shadow } from \"./util.js\";\nimport { log2, readInt8, readUint16, readUint32 } from \"./core_utils.js\";\nimport { ArithmeticDecoder } from \"./arithmetic_decoder.js\";\nimport { CCITTFaxDecoder } from \"./ccitt.js\";\n\nclass Jbig2Error extends BaseException {\n constructor(msg) {\n super(`JBIG2 error: ${msg}`);\n }\n}\n\nvar Jbig2Image = (function Jbig2ImageClosure() {\n // Utility data structures\n function ContextCache() {}\n\n ContextCache.prototype = {\n getContexts(id) {\n if (id in this) {\n return this[id];\n }\n return (this[id] = new Int8Array(1 << 16));\n },\n };\n\n function DecodingContext(data, start, end) {\n this.data = data;\n this.start = start;\n this.end = end;\n }\n\n DecodingContext.prototype = {\n get decoder() {\n var decoder = new ArithmeticDecoder(this.data, this.start, this.end);\n return shadow(this, \"decoder\", decoder);\n },\n get contextCache() {\n var cache = new ContextCache();\n return shadow(this, \"contextCache\", cache);\n },\n };\n\n // Annex A. Arithmetic Integer Decoding Procedure\n // A.2 Procedure for decoding values\n function decodeInteger(contextCache, procedure, decoder) {\n var contexts = contextCache.getContexts(procedure);\n var prev = 1;\n\n function readBits(length) {\n var v = 0;\n for (var i = 0; i < length; i++) {\n var bit = decoder.readBit(contexts, prev);\n prev =\n prev < 256 ? (prev << 1) | bit : (((prev << 1) | bit) & 511) | 256;\n v = (v << 1) | bit;\n }\n return v >>> 0;\n }\n\n var sign = readBits(1);\n // prettier-ignore\n /* eslint-disable no-nested-ternary */\n var value = readBits(1) ?\n (readBits(1) ?\n (readBits(1) ?\n (readBits(1) ?\n (readBits(1) ?\n (readBits(32) + 4436) :\n readBits(12) + 340) :\n readBits(8) + 84) :\n readBits(6) + 20) :\n readBits(4) + 4) :\n readBits(2);\n /* eslint-enable no-nested-ternary */\n if (sign === 0) {\n return value;\n } else if (value > 0) {\n return -value;\n }\n return null;\n }\n\n // A.3 The IAID decoding procedure\n function decodeIAID(contextCache, decoder, codeLength) {\n var contexts = contextCache.getContexts(\"IAID\");\n\n var prev = 1;\n for (var i = 0; i < codeLength; i++) {\n var bit = decoder.readBit(contexts, prev);\n prev = (prev << 1) | bit;\n }\n if (codeLength < 31) {\n return prev & ((1 << codeLength) - 1);\n }\n return prev & 0x7fffffff;\n }\n\n // 7.3 Segment types\n var SegmentTypes = [\n \"SymbolDictionary\",\n null,\n null,\n null,\n \"IntermediateTextRegion\",\n null,\n \"ImmediateTextRegion\",\n \"ImmediateLosslessTextRegion\",\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n \"PatternDictionary\",\n null,\n null,\n null,\n \"IntermediateHalftoneRegion\",\n null,\n \"ImmediateHalftoneRegion\",\n \"ImmediateLosslessHalftoneRegion\",\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n \"IntermediateGenericRegion\",\n null,\n \"ImmediateGenericRegion\",\n \"ImmediateLosslessGenericRegion\",\n \"IntermediateGenericRefinementRegion\",\n null,\n \"ImmediateGenericRefinementRegion\",\n \"ImmediateLosslessGenericRefinementRegion\",\n null,\n null,\n null,\n null,\n \"PageInformation\",\n \"EndOfPage\",\n \"EndOfStripe\",\n \"EndOfFile\",\n \"Profiles\",\n \"Tables\",\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n \"Extension\",\n ];\n\n var CodingTemplates = [\n [\n { x: -1, y: -2 },\n { x: 0, y: -2 },\n { x: 1, y: -2 },\n { x: -2, y: -1 },\n { x: -1, y: -1 },\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: 2, y: -1 },\n { x: -4, y: 0 },\n { x: -3, y: 0 },\n { x: -2, y: 0 },\n { x: -1, y: 0 },\n ],\n [\n { x: -1, y: -2 },\n { x: 0, y: -2 },\n { x: 1, y: -2 },\n { x: 2, y: -2 },\n { x: -2, y: -1 },\n { x: -1, y: -1 },\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: 2, y: -1 },\n { x: -3, y: 0 },\n { x: -2, y: 0 },\n { x: -1, y: 0 },\n ],\n [\n { x: -1, y: -2 },\n { x: 0, y: -2 },\n { x: 1, y: -2 },\n { x: -2, y: -1 },\n { x: -1, y: -1 },\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: -2, y: 0 },\n { x: -1, y: 0 },\n ],\n [\n { x: -3, y: -1 },\n { x: -2, y: -1 },\n { x: -1, y: -1 },\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: -4, y: 0 },\n { x: -3, y: 0 },\n { x: -2, y: 0 },\n { x: -1, y: 0 },\n ],\n ];\n\n var RefinementTemplates = [\n {\n coding: [\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: -1, y: 0 },\n ],\n reference: [\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: -1, y: 0 },\n { x: 0, y: 0 },\n { x: 1, y: 0 },\n { x: -1, y: 1 },\n { x: 0, y: 1 },\n { x: 1, y: 1 },\n ],\n },\n {\n coding: [\n { x: -1, y: -1 },\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: -1, y: 0 },\n ],\n reference: [\n { x: 0, y: -1 },\n { x: -1, y: 0 },\n { x: 0, y: 0 },\n { x: 1, y: 0 },\n { x: 0, y: 1 },\n { x: 1, y: 1 },\n ],\n },\n ];\n\n // See 6.2.5.7 Decoding the bitmap.\n var ReusedContexts = [\n 0x9b25, // 10011 0110010 0101\n 0x0795, // 0011 110010 101\n 0x00e5, // 001 11001 01\n 0x0195, // 011001 0101\n ];\n\n var RefinementReusedContexts = [\n 0x0020, // '000' + '0' (coding) + '00010000' + '0' (reference)\n 0x0008, // '0000' + '001000'\n ];\n\n function decodeBitmapTemplate0(width, height, decodingContext) {\n var decoder = decodingContext.decoder;\n var contexts = decodingContext.contextCache.getContexts(\"GB\");\n var contextLabel,\n i,\n j,\n pixel,\n row,\n row1,\n row2,\n bitmap = [];\n\n // ...ooooo....\n // ..ooooooo... Context template for current pixel (X)\n // .ooooX...... (concatenate values of 'o'-pixels to get contextLabel)\n var OLD_PIXEL_MASK = 0x7bf7; // 01111 0111111 0111\n\n for (i = 0; i < height; i++) {\n row = bitmap[i] = new Uint8Array(width);\n row1 = i < 1 ? row : bitmap[i - 1];\n row2 = i < 2 ? row : bitmap[i - 2];\n\n // At the beginning of each row:\n // Fill contextLabel with pixels that are above/right of (X)\n contextLabel =\n (row2[0] << 13) |\n (row2[1] << 12) |\n (row2[2] << 11) |\n (row1[0] << 7) |\n (row1[1] << 6) |\n (row1[2] << 5) |\n (row1[3] << 4);\n\n for (j = 0; j < width; j++) {\n row[j] = pixel = decoder.readBit(contexts, contextLabel);\n\n // At each pixel: Clear contextLabel pixels that are shifted\n // out of the context, then add new ones.\n contextLabel =\n ((contextLabel & OLD_PIXEL_MASK) << 1) |\n (j + 3 < width ? row2[j + 3] << 11 : 0) |\n (j + 4 < width ? row1[j + 4] << 4 : 0) |\n pixel;\n }\n }\n\n return bitmap;\n }\n\n // 6.2 Generic Region Decoding Procedure\n function decodeBitmap(\n mmr,\n width,\n height,\n templateIndex,\n prediction,\n skip,\n at,\n decodingContext\n ) {\n if (mmr) {\n const input = new Reader(\n decodingContext.data,\n decodingContext.start,\n decodingContext.end\n );\n return decodeMMRBitmap(input, width, height, false);\n }\n\n // Use optimized version for the most common case\n if (\n templateIndex === 0 &&\n !skip &&\n !prediction &&\n at.length === 4 &&\n at[0].x === 3 &&\n at[0].y === -1 &&\n at[1].x === -3 &&\n at[1].y === -1 &&\n at[2].x === 2 &&\n at[2].y === -2 &&\n at[3].x === -2 &&\n at[3].y === -2\n ) {\n return decodeBitmapTemplate0(width, height, decodingContext);\n }\n\n var useskip = !!skip;\n var template = CodingTemplates[templateIndex].concat(at);\n\n // Sorting is non-standard, and it is not required. But sorting increases\n // the number of template bits that can be reused from the previous\n // contextLabel in the main loop.\n template.sort(function (a, b) {\n return a.y - b.y || a.x - b.x;\n });\n\n var templateLength = template.length;\n var templateX = new Int8Array(templateLength);\n var templateY = new Int8Array(templateLength);\n var changingTemplateEntries = [];\n var reuseMask = 0,\n minX = 0,\n maxX = 0,\n minY = 0;\n var c, k;\n\n for (k = 0; k < templateLength; k++) {\n templateX[k] = template[k].x;\n templateY[k] = template[k].y;\n minX = Math.min(minX, template[k].x);\n maxX = Math.max(maxX, template[k].x);\n minY = Math.min(minY, template[k].y);\n // Check if the template pixel appears in two consecutive context labels,\n // so it can be reused. Otherwise, we add it to the list of changing\n // template entries.\n if (\n k < templateLength - 1 &&\n template[k].y === template[k + 1].y &&\n template[k].x === template[k + 1].x - 1\n ) {\n reuseMask |= 1 << (templateLength - 1 - k);\n } else {\n changingTemplateEntries.push(k);\n }\n }\n var changingEntriesLength = changingTemplateEntries.length;\n\n var changingTemplateX = new Int8Array(changingEntriesLength);\n var changingTemplateY = new Int8Array(changingEntriesLength);\n var changingTemplateBit = new Uint16Array(changingEntriesLength);\n for (c = 0; c < changingEntriesLength; c++) {\n k = changingTemplateEntries[c];\n changingTemplateX[c] = template[k].x;\n changingTemplateY[c] = template[k].y;\n changingTemplateBit[c] = 1 << (templateLength - 1 - k);\n }\n\n // Get the safe bounding box edges from the width, height, minX, maxX, minY\n var sbb_left = -minX;\n var sbb_top = -minY;\n var sbb_right = width - maxX;\n\n var pseudoPixelContext = ReusedContexts[templateIndex];\n var row = new Uint8Array(width);\n var bitmap = [];\n\n var decoder = decodingContext.decoder;\n var contexts = decodingContext.contextCache.getContexts(\"GB\");\n\n var ltp = 0,\n j,\n i0,\n j0,\n contextLabel = 0,\n bit,\n shift;\n for (var i = 0; i < height; i++) {\n if (prediction) {\n var sltp = decoder.readBit(contexts, pseudoPixelContext);\n ltp ^= sltp;\n if (ltp) {\n bitmap.push(row); // duplicate previous row\n continue;\n }\n }\n row = new Uint8Array(row);\n bitmap.push(row);\n for (j = 0; j < width; j++) {\n if (useskip && skip[i][j]) {\n row[j] = 0;\n continue;\n }\n // Are we in the middle of a scanline, so we can reuse contextLabel\n // bits?\n if (j >= sbb_left && j < sbb_right && i >= sbb_top) {\n // If yes, we can just shift the bits that are reusable and only\n // fetch the remaining ones.\n contextLabel = (contextLabel << 1) & reuseMask;\n for (k = 0; k < changingEntriesLength; k++) {\n i0 = i + changingTemplateY[k];\n j0 = j + changingTemplateX[k];\n bit = bitmap[i0][j0];\n if (bit) {\n bit = changingTemplateBit[k];\n contextLabel |= bit;\n }\n }\n } else {\n // compute the contextLabel from scratch\n contextLabel = 0;\n shift = templateLength - 1;\n for (k = 0; k < templateLength; k++, shift--) {\n j0 = j + templateX[k];\n if (j0 >= 0 && j0 < width) {\n i0 = i + templateY[k];\n if (i0 >= 0) {\n bit = bitmap[i0][j0];\n if (bit) {\n contextLabel |= bit << shift;\n }\n }\n }\n }\n }\n var pixel = decoder.readBit(contexts, contextLabel);\n row[j] = pixel;\n }\n }\n return bitmap;\n }\n\n // 6.3.2 Generic Refinement Region Decoding Procedure\n function decodeRefinement(\n width,\n height,\n templateIndex,\n referenceBitmap,\n offsetX,\n offsetY,\n prediction,\n at,\n decodingContext\n ) {\n var codingTemplate = RefinementTemplates[templateIndex].coding;\n if (templateIndex === 0) {\n codingTemplate = codingTemplate.concat([at[0]]);\n }\n var codingTemplateLength = codingTemplate.length;\n var codingTemplateX = new Int32Array(codingTemplateLength);\n var codingTemplateY = new Int32Array(codingTemplateLength);\n var k;\n for (k = 0; k < codingTemplateLength; k++) {\n codingTemplateX[k] = codingTemplate[k].x;\n codingTemplateY[k] = codingTemplate[k].y;\n }\n\n var referenceTemplate = RefinementTemplates[templateIndex].reference;\n if (templateIndex === 0) {\n referenceTemplate = referenceTemplate.concat([at[1]]);\n }\n var referenceTemplateLength = referenceTemplate.length;\n var referenceTemplateX = new Int32Array(referenceTemplateLength);\n var referenceTemplateY = new Int32Array(referenceTemplateLength);\n for (k = 0; k < referenceTemplateLength; k++) {\n referenceTemplateX[k] = referenceTemplate[k].x;\n referenceTemplateY[k] = referenceTemplate[k].y;\n }\n var referenceWidth = referenceBitmap[0].length;\n var referenceHeight = referenceBitmap.length;\n\n var pseudoPixelContext = RefinementReusedContexts[templateIndex];\n var bitmap = [];\n\n var decoder = decodingContext.decoder;\n var contexts = decodingContext.contextCache.getContexts(\"GR\");\n\n var ltp = 0;\n for (var i = 0; i < height; i++) {\n if (prediction) {\n var sltp = decoder.readBit(contexts, pseudoPixelContext);\n ltp ^= sltp;\n if (ltp) {\n throw new Jbig2Error(\"prediction is not supported\");\n }\n }\n var row = new Uint8Array(width);\n bitmap.push(row);\n for (var j = 0; j < width; j++) {\n var i0, j0;\n var contextLabel = 0;\n for (k = 0; k < codingTemplateLength; k++) {\n i0 = i + codingTemplateY[k];\n j0 = j + codingTemplateX[k];\n if (i0 < 0 || j0 < 0 || j0 >= width) {\n contextLabel <<= 1; // out of bound pixel\n } else {\n contextLabel = (contextLabel << 1) | bitmap[i0][j0];\n }\n }\n for (k = 0; k < referenceTemplateLength; k++) {\n i0 = i + referenceTemplateY[k] - offsetY;\n j0 = j + referenceTemplateX[k] - offsetX;\n if (\n i0 < 0 ||\n i0 >= referenceHeight ||\n j0 < 0 ||\n j0 >= referenceWidth\n ) {\n contextLabel <<= 1; // out of bound pixel\n } else {\n contextLabel = (contextLabel << 1) | referenceBitmap[i0][j0];\n }\n }\n var pixel = decoder.readBit(contexts, contextLabel);\n row[j] = pixel;\n }\n }\n\n return bitmap;\n }\n\n // 6.5.5 Decoding the symbol dictionary\n function decodeSymbolDictionary(\n huffman,\n refinement,\n symbols,\n numberOfNewSymbols,\n numberOfExportedSymbols,\n huffmanTables,\n templateIndex,\n at,\n refinementTemplateIndex,\n refinementAt,\n decodingContext,\n huffmanInput\n ) {\n if (huffman && refinement) {\n throw new Jbig2Error(\"symbol refinement with Huffman is not supported\");\n }\n\n var newSymbols = [];\n var currentHeight = 0;\n var symbolCodeLength = log2(symbols.length + numberOfNewSymbols);\n\n var decoder = decodingContext.decoder;\n var contextCache = decodingContext.contextCache;\n let tableB1, symbolWidths;\n if (huffman) {\n tableB1 = getStandardTable(1); // standard table B.1\n symbolWidths = [];\n symbolCodeLength = Math.max(symbolCodeLength, 1); // 6.5.8.2.3\n }\n\n while (newSymbols.length < numberOfNewSymbols) {\n var deltaHeight = huffman\n ? huffmanTables.tableDeltaHeight.decode(huffmanInput)\n : decodeInteger(contextCache, \"IADH\", decoder); // 6.5.6\n currentHeight += deltaHeight;\n let currentWidth = 0,\n totalWidth = 0;\n const firstSymbol = huffman ? symbolWidths.length : 0;\n while (true) {\n var deltaWidth = huffman\n ? huffmanTables.tableDeltaWidth.decode(huffmanInput)\n : decodeInteger(contextCache, \"IADW\", decoder); // 6.5.7\n if (deltaWidth === null) {\n break; // OOB\n }\n currentWidth += deltaWidth;\n totalWidth += currentWidth;\n var bitmap;\n if (refinement) {\n // 6.5.8.2 Refinement/aggregate-coded symbol bitmap\n var numberOfInstances = decodeInteger(contextCache, \"IAAI\", decoder);\n if (numberOfInstances > 1) {\n bitmap = decodeTextRegion(\n huffman,\n refinement,\n currentWidth,\n currentHeight,\n 0,\n numberOfInstances,\n 1, // strip size\n symbols.concat(newSymbols),\n symbolCodeLength,\n 0, // transposed\n 0, // ds offset\n 1, // top left 7.4.3.1.1\n 0, // OR operator\n huffmanTables,\n refinementTemplateIndex,\n refinementAt,\n decodingContext,\n 0,\n huffmanInput\n );\n } else {\n var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength);\n var rdx = decodeInteger(contextCache, \"IARDX\", decoder); // 6.4.11.3\n var rdy = decodeInteger(contextCache, \"IARDY\", decoder); // 6.4.11.4\n var symbol =\n symbolId < symbols.length\n ? symbols[symbolId]\n : newSymbols[symbolId - symbols.length];\n bitmap = decodeRefinement(\n currentWidth,\n currentHeight,\n refinementTemplateIndex,\n symbol,\n rdx,\n rdy,\n false,\n refinementAt,\n decodingContext\n );\n }\n newSymbols.push(bitmap);\n } else if (huffman) {\n // Store only symbol width and decode a collective bitmap when the\n // height class is done.\n symbolWidths.push(currentWidth);\n } else {\n // 6.5.8.1 Direct-coded symbol bitmap\n bitmap = decodeBitmap(\n false,\n currentWidth,\n currentHeight,\n templateIndex,\n false,\n null,\n at,\n decodingContext\n );\n newSymbols.push(bitmap);\n }\n }\n if (huffman && !refinement) {\n // 6.5.9 Height class collective bitmap\n const bitmapSize = huffmanTables.tableBitmapSize.decode(huffmanInput);\n huffmanInput.byteAlign();\n let collectiveBitmap;\n if (bitmapSize === 0) {\n // Uncompressed collective bitmap\n collectiveBitmap = readUncompressedBitmap(\n huffmanInput,\n totalWidth,\n currentHeight\n );\n } else {\n // MMR collective bitmap\n const originalEnd = huffmanInput.end;\n const bitmapEnd = huffmanInput.position + bitmapSize;\n huffmanInput.end = bitmapEnd;\n collectiveBitmap = decodeMMRBitmap(\n huffmanInput,\n totalWidth,\n currentHeight,\n false\n );\n huffmanInput.end = originalEnd;\n huffmanInput.position = bitmapEnd;\n }\n const numberOfSymbolsDecoded = symbolWidths.length;\n if (firstSymbol === numberOfSymbolsDecoded - 1) {\n // collectiveBitmap is a single symbol.\n newSymbols.push(collectiveBitmap);\n } else {\n // Divide collectiveBitmap into symbols.\n let i,\n y,\n xMin = 0,\n xMax,\n bitmapWidth,\n symbolBitmap;\n for (i = firstSymbol; i < numberOfSymbolsDecoded; i++) {\n bitmapWidth = symbolWidths[i];\n xMax = xMin + bitmapWidth;\n symbolBitmap = [];\n for (y = 0; y < currentHeight; y++) {\n symbolBitmap.push(collectiveBitmap[y].subarray(xMin, xMax));\n }\n newSymbols.push(symbolBitmap);\n xMin = xMax;\n }\n }\n }\n }\n\n // 6.5.10 Exported symbols\n var exportedSymbols = [];\n var flags = [],\n currentFlag = false;\n var totalSymbolsLength = symbols.length + numberOfNewSymbols;\n while (flags.length < totalSymbolsLength) {\n var runLength = huffman\n ? tableB1.decode(huffmanInput)\n : decodeInteger(contextCache, \"IAEX\", decoder);\n while (runLength--) {\n flags.push(currentFlag);\n }\n currentFlag = !currentFlag;\n }\n for (var i = 0, ii = symbols.length; i < ii; i++) {\n if (flags[i]) {\n exportedSymbols.push(symbols[i]);\n }\n }\n for (var j = 0; j < numberOfNewSymbols; i++, j++) {\n if (flags[i]) {\n exportedSymbols.push(newSymbols[j]);\n }\n }\n return exportedSymbols;\n }\n\n function decodeTextRegion(\n huffman,\n refinement,\n width,\n height,\n defaultPixelValue,\n numberOfSymbolInstances,\n stripSize,\n inputSymbols,\n symbolCodeLength,\n transposed,\n dsOffset,\n referenceCorner,\n combinationOperator,\n huffmanTables,\n refinementTemplateIndex,\n refinementAt,\n decodingContext,\n logStripSize,\n huffmanInput\n ) {\n if (huffman && refinement) {\n throw new Jbig2Error(\"refinement with Huffman is not supported\");\n }\n\n // Prepare bitmap\n var bitmap = [];\n var i, row;\n for (i = 0; i < height; i++) {\n row = new Uint8Array(width);\n if (defaultPixelValue) {\n for (var j = 0; j < width; j++) {\n row[j] = defaultPixelValue;\n }\n }\n bitmap.push(row);\n }\n\n var decoder = decodingContext.decoder;\n var contextCache = decodingContext.contextCache;\n\n var stripT = huffman\n ? -huffmanTables.tableDeltaT.decode(huffmanInput)\n : -decodeInteger(contextCache, \"IADT\", decoder); // 6.4.6\n var firstS = 0;\n i = 0;\n while (i < numberOfSymbolInstances) {\n var deltaT = huffman\n ? huffmanTables.tableDeltaT.decode(huffmanInput)\n : decodeInteger(contextCache, \"IADT\", decoder); // 6.4.6\n stripT += deltaT;\n\n var deltaFirstS = huffman\n ? huffmanTables.tableFirstS.decode(huffmanInput)\n : decodeInteger(contextCache, \"IAFS\", decoder); // 6.4.7\n firstS += deltaFirstS;\n var currentS = firstS;\n do {\n let currentT = 0; // 6.4.9\n if (stripSize > 1) {\n currentT = huffman\n ? huffmanInput.readBits(logStripSize)\n : decodeInteger(contextCache, \"IAIT\", decoder);\n }\n var t = stripSize * stripT + currentT;\n var symbolId = huffman\n ? huffmanTables.symbolIDTable.decode(huffmanInput)\n : decodeIAID(contextCache, decoder, symbolCodeLength);\n var applyRefinement =\n refinement &&\n (huffman\n ? huffmanInput.readBit()\n : decodeInteger(contextCache, \"IARI\", decoder));\n var symbolBitmap = inputSymbols[symbolId];\n var symbolWidth = symbolBitmap[0].length;\n var symbolHeight = symbolBitmap.length;\n if (applyRefinement) {\n var rdw = decodeInteger(contextCache, \"IARDW\", decoder); // 6.4.11.1\n var rdh = decodeInteger(contextCache, \"IARDH\", decoder); // 6.4.11.2\n var rdx = decodeInteger(contextCache, \"IARDX\", decoder); // 6.4.11.3\n var rdy = decodeInteger(contextCache, \"IARDY\", decoder); // 6.4.11.4\n symbolWidth += rdw;\n symbolHeight += rdh;\n symbolBitmap = decodeRefinement(\n symbolWidth,\n symbolHeight,\n refinementTemplateIndex,\n symbolBitmap,\n (rdw >> 1) + rdx,\n (rdh >> 1) + rdy,\n false,\n refinementAt,\n decodingContext\n );\n }\n var offsetT = t - (referenceCorner & 1 ? 0 : symbolHeight - 1);\n var offsetS = currentS - (referenceCorner & 2 ? symbolWidth - 1 : 0);\n var s2, t2, symbolRow;\n if (transposed) {\n // Place Symbol Bitmap from T1,S1\n for (s2 = 0; s2 < symbolHeight; s2++) {\n row = bitmap[offsetS + s2];\n if (!row) {\n continue;\n }\n symbolRow = symbolBitmap[s2];\n // To ignore Parts of Symbol bitmap which goes\n // outside bitmap region\n var maxWidth = Math.min(width - offsetT, symbolWidth);\n switch (combinationOperator) {\n case 0: // OR\n for (t2 = 0; t2 < maxWidth; t2++) {\n row[offsetT + t2] |= symbolRow[t2];\n }\n break;\n case 2: // XOR\n for (t2 = 0; t2 < maxWidth; t2++) {\n row[offsetT + t2] ^= symbolRow[t2];\n }\n break;\n default:\n throw new Jbig2Error(\n `operator ${combinationOperator} is not supported`\n );\n }\n }\n currentS += symbolHeight - 1;\n } else {\n for (t2 = 0; t2 < symbolHeight; t2++) {\n row = bitmap[offsetT + t2];\n if (!row) {\n continue;\n }\n symbolRow = symbolBitmap[t2];\n switch (combinationOperator) {\n case 0: // OR\n for (s2 = 0; s2 < symbolWidth; s2++) {\n row[offsetS + s2] |= symbolRow[s2];\n }\n break;\n case 2: // XOR\n for (s2 = 0; s2 < symbolWidth; s2++) {\n row[offsetS + s2] ^= symbolRow[s2];\n }\n break;\n default:\n throw new Jbig2Error(\n `operator ${combinationOperator} is not supported`\n );\n }\n }\n currentS += symbolWidth - 1;\n }\n i++;\n var deltaS = huffman\n ? huffmanTables.tableDeltaS.decode(huffmanInput)\n : decodeInteger(contextCache, \"IADS\", decoder); // 6.4.8\n if (deltaS === null) {\n break; // OOB\n }\n currentS += deltaS + dsOffset;\n } while (true);\n }\n return bitmap;\n }\n\n function decodePatternDictionary(\n mmr,\n patternWidth,\n patternHeight,\n maxPatternIndex,\n template,\n decodingContext\n ) {\n const at = [];\n if (!mmr) {\n at.push({\n x: -patternWidth,\n y: 0,\n });\n if (template === 0) {\n at.push({\n x: -3,\n y: -1,\n });\n at.push({\n x: 2,\n y: -2,\n });\n at.push({\n x: -2,\n y: -2,\n });\n }\n }\n const collectiveWidth = (maxPatternIndex + 1) * patternWidth;\n const collectiveBitmap = decodeBitmap(\n mmr,\n collectiveWidth,\n patternHeight,\n template,\n false,\n null,\n at,\n decodingContext\n );\n // Divide collective bitmap into patterns.\n const patterns = [];\n for (let i = 0; i <= maxPatternIndex; i++) {\n const patternBitmap = [];\n const xMin = patternWidth * i;\n const xMax = xMin + patternWidth;\n for (let y = 0; y < patternHeight; y++) {\n patternBitmap.push(collectiveBitmap[y].subarray(xMin, xMax));\n }\n patterns.push(patternBitmap);\n }\n return patterns;\n }\n\n function decodeHalftoneRegion(\n mmr,\n patterns,\n template,\n regionWidth,\n regionHeight,\n defaultPixelValue,\n enableSkip,\n combinationOperator,\n gridWidth,\n gridHeight,\n gridOffsetX,\n gridOffsetY,\n gridVectorX,\n gridVectorY,\n decodingContext\n ) {\n const skip = null;\n if (enableSkip) {\n throw new Jbig2Error(\"skip is not supported\");\n }\n if (combinationOperator !== 0) {\n throw new Jbig2Error(\n \"operator \" +\n combinationOperator +\n \" is not supported in halftone region\"\n );\n }\n\n // Prepare bitmap.\n const regionBitmap = [];\n let i, j, row;\n for (i = 0; i < regionHeight; i++) {\n row = new Uint8Array(regionWidth);\n if (defaultPixelValue) {\n for (j = 0; j < regionWidth; j++) {\n row[j] = defaultPixelValue;\n }\n }\n regionBitmap.push(row);\n }\n\n const numberOfPatterns = patterns.length;\n const pattern0 = patterns[0];\n const patternWidth = pattern0[0].length,\n patternHeight = pattern0.length;\n const bitsPerValue = log2(numberOfPatterns);\n const at = [];\n if (!mmr) {\n at.push({\n x: template <= 1 ? 3 : 2,\n y: -1,\n });\n if (template === 0) {\n at.push({\n x: -3,\n y: -1,\n });\n at.push({\n x: 2,\n y: -2,\n });\n at.push({\n x: -2,\n y: -2,\n });\n }\n }\n // Annex C. Gray-scale Image Decoding Procedure.\n const grayScaleBitPlanes = [];\n let mmrInput, bitmap;\n if (mmr) {\n // MMR bit planes are in one continuous stream. Only EOFB codes indicate\n // the end of each bitmap, so EOFBs must be decoded.\n mmrInput = new Reader(\n decodingContext.data,\n decodingContext.start,\n decodingContext.end\n );\n }\n for (i = bitsPerValue - 1; i >= 0; i--) {\n if (mmr) {\n bitmap = decodeMMRBitmap(mmrInput, gridWidth, gridHeight, true);\n } else {\n bitmap = decodeBitmap(\n false,\n gridWidth,\n gridHeight,\n template,\n false,\n skip,\n at,\n decodingContext\n );\n }\n grayScaleBitPlanes[i] = bitmap;\n }\n // 6.6.5.2 Rendering the patterns.\n let mg, ng, bit, patternIndex, patternBitmap, x, y, patternRow, regionRow;\n for (mg = 0; mg < gridHeight; mg++) {\n for (ng = 0; ng < gridWidth; ng++) {\n bit = 0;\n patternIndex = 0;\n for (j = bitsPerValue - 1; j >= 0; j--) {\n bit = grayScaleBitPlanes[j][mg][ng] ^ bit; // Gray decoding\n patternIndex |= bit << j;\n }\n patternBitmap = patterns[patternIndex];\n x = (gridOffsetX + mg * gridVectorY + ng * gridVectorX) >> 8;\n y = (gridOffsetY + mg * gridVectorX - ng * gridVectorY) >> 8;\n // Draw patternBitmap at (x, y).\n if (\n x >= 0 &&\n x + patternWidth <= regionWidth &&\n y >= 0 &&\n y + patternHeight <= regionHeight\n ) {\n for (i = 0; i < patternHeight; i++) {\n regionRow = regionBitmap[y + i];\n patternRow = patternBitmap[i];\n for (j = 0; j < patternWidth; j++) {\n regionRow[x + j] |= patternRow[j];\n }\n }\n } else {\n let regionX, regionY;\n for (i = 0; i < patternHeight; i++) {\n regionY = y + i;\n if (regionY < 0 || regionY >= regionHeight) {\n continue;\n }\n regionRow = regionBitmap[regionY];\n patternRow = patternBitmap[i];\n for (j = 0; j < patternWidth; j++) {\n regionX = x + j;\n if (regionX >= 0 && regionX < regionWidth) {\n regionRow[regionX] |= patternRow[j];\n }\n }\n }\n }\n }\n }\n return regionBitmap;\n }\n\n function readSegmentHeader(data, start) {\n var segmentHeader = {};\n segmentHeader.number = readUint32(data, start);\n var flags = data[start + 4];\n var segmentType = flags & 0x3f;\n if (!SegmentTypes[segmentType]) {\n throw new Jbig2Error(\"invalid segment type: \" + segmentType);\n }\n segmentHeader.type = segmentType;\n segmentHeader.typeName = SegmentTypes[segmentType];\n segmentHeader.deferredNonRetain = !!(flags & 0x80);\n\n var pageAssociationFieldSize = !!(flags & 0x40);\n var referredFlags = data[start + 5];\n var referredToCount = (referredFlags >> 5) & 7;\n var retainBits = [referredFlags & 31];\n var position = start + 6;\n if (referredFlags === 7) {\n referredToCount = readUint32(data, position - 1) & 0x1fffffff;\n position += 3;\n var bytes = (referredToCount + 7) >> 3;\n retainBits[0] = data[position++];\n while (--bytes > 0) {\n retainBits.push(data[position++]);\n }\n } else if (referredFlags === 5 || referredFlags === 6) {\n throw new Jbig2Error(\"invalid referred-to flags\");\n }\n\n segmentHeader.retainBits = retainBits;\n\n let referredToSegmentNumberSize = 4;\n if (segmentHeader.number <= 256) {\n referredToSegmentNumberSize = 1;\n } else if (segmentHeader.number <= 65536) {\n referredToSegmentNumberSize = 2;\n }\n var referredTo = [];\n var i, ii;\n for (i = 0; i < referredToCount; i++) {\n let number;\n if (referredToSegmentNumberSize === 1) {\n number = data[position];\n } else if (referredToSegmentNumberSize === 2) {\n number = readUint16(data, position);\n } else {\n number = readUint32(data, position);\n }\n referredTo.push(number);\n position += referredToSegmentNumberSize;\n }\n segmentHeader.referredTo = referredTo;\n if (!pageAssociationFieldSize) {\n segmentHeader.pageAssociation = data[position++];\n } else {\n segmentHeader.pageAssociation = readUint32(data, position);\n position += 4;\n }\n segmentHeader.length = readUint32(data, position);\n position += 4;\n\n if (segmentHeader.length === 0xffffffff) {\n // 7.2.7 Segment data length, unknown segment length\n if (segmentType === 38) {\n // ImmediateGenericRegion\n var genericRegionInfo = readRegionSegmentInformation(data, position);\n var genericRegionSegmentFlags =\n data[position + RegionSegmentInformationFieldLength];\n var genericRegionMmr = !!(genericRegionSegmentFlags & 1);\n // searching for the segment end\n var searchPatternLength = 6;\n var searchPattern = new Uint8Array(searchPatternLength);\n if (!genericRegionMmr) {\n searchPattern[0] = 0xff;\n searchPattern[1] = 0xac;\n }\n searchPattern[2] = (genericRegionInfo.height >>> 24) & 0xff;\n searchPattern[3] = (genericRegionInfo.height >> 16) & 0xff;\n searchPattern[4] = (genericRegionInfo.height >> 8) & 0xff;\n searchPattern[5] = genericRegionInfo.height & 0xff;\n for (i = position, ii = data.length; i < ii; i++) {\n var j = 0;\n while (j < searchPatternLength && searchPattern[j] === data[i + j]) {\n j++;\n }\n if (j === searchPatternLength) {\n segmentHeader.length = i + searchPatternLength;\n break;\n }\n }\n if (segmentHeader.length === 0xffffffff) {\n throw new Jbig2Error(\"segment end was not found\");\n }\n } else {\n throw new Jbig2Error(\"invalid unknown segment length\");\n }\n }\n segmentHeader.headerEnd = position;\n return segmentHeader;\n }\n\n function readSegments(header, data, start, end) {\n var segments = [];\n var position = start;\n while (position < end) {\n var segmentHeader = readSegmentHeader(data, position);\n position = segmentHeader.headerEnd;\n var segment = {\n header: segmentHeader,\n data,\n };\n if (!header.randomAccess) {\n segment.start = position;\n position += segmentHeader.length;\n segment.end = position;\n }\n segments.push(segment);\n if (segmentHeader.type === 51) {\n break; // end of file is found\n }\n }\n if (header.randomAccess) {\n for (var i = 0, ii = segments.length; i < ii; i++) {\n segments[i].start = position;\n position += segments[i].header.length;\n segments[i].end = position;\n }\n }\n return segments;\n }\n\n // 7.4.1 Region segment information field\n function readRegionSegmentInformation(data, start) {\n return {\n width: readUint32(data, start),\n height: readUint32(data, start + 4),\n x: readUint32(data, start + 8),\n y: readUint32(data, start + 12),\n combinationOperator: data[start + 16] & 7,\n };\n }\n var RegionSegmentInformationFieldLength = 17;\n\n function processSegment(segment, visitor) {\n var header = segment.header;\n\n var data = segment.data,\n position = segment.start,\n end = segment.end;\n var args, at, i, atLength;\n switch (header.type) {\n case 0: // SymbolDictionary\n // 7.4.2 Symbol dictionary segment syntax\n var dictionary = {};\n var dictionaryFlags = readUint16(data, position); // 7.4.2.1.1\n dictionary.huffman = !!(dictionaryFlags & 1);\n dictionary.refinement = !!(dictionaryFlags & 2);\n dictionary.huffmanDHSelector = (dictionaryFlags >> 2) & 3;\n dictionary.huffmanDWSelector = (dictionaryFlags >> 4) & 3;\n dictionary.bitmapSizeSelector = (dictionaryFlags >> 6) & 1;\n dictionary.aggregationInstancesSelector = (dictionaryFlags >> 7) & 1;\n dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256);\n dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512);\n dictionary.template = (dictionaryFlags >> 10) & 3;\n dictionary.refinementTemplate = (dictionaryFlags >> 12) & 1;\n position += 2;\n if (!dictionary.huffman) {\n atLength = dictionary.template === 0 ? 4 : 1;\n at = [];\n for (i = 0; i < atLength; i++) {\n at.push({\n x: readInt8(data, position),\n y: readInt8(data, position + 1),\n });\n position += 2;\n }\n dictionary.at = at;\n }\n if (dictionary.refinement && !dictionary.refinementTemplate) {\n at = [];\n for (i = 0; i < 2; i++) {\n at.push({\n x: readInt8(data, position),\n y: readInt8(data, position + 1),\n });\n position += 2;\n }\n dictionary.refinementAt = at;\n }\n dictionary.numberOfExportedSymbols = readUint32(data, position);\n position += 4;\n dictionary.numberOfNewSymbols = readUint32(data, position);\n position += 4;\n args = [\n dictionary,\n header.number,\n header.referredTo,\n data,\n position,\n end,\n ];\n break;\n case 6: // ImmediateTextRegion\n case 7: // ImmediateLosslessTextRegion\n var textRegion = {};\n textRegion.info = readRegionSegmentInformation(data, position);\n position += RegionSegmentInformationFieldLength;\n var textRegionSegmentFlags = readUint16(data, position);\n position += 2;\n textRegion.huffman = !!(textRegionSegmentFlags & 1);\n textRegion.refinement = !!(textRegionSegmentFlags & 2);\n textRegion.logStripSize = (textRegionSegmentFlags >> 2) & 3;\n textRegion.stripSize = 1 << textRegion.logStripSize;\n textRegion.referenceCorner = (textRegionSegmentFlags >> 4) & 3;\n textRegion.transposed = !!(textRegionSegmentFlags & 64);\n textRegion.combinationOperator = (textRegionSegmentFlags >> 7) & 3;\n textRegion.defaultPixelValue = (textRegionSegmentFlags >> 9) & 1;\n textRegion.dsOffset = (textRegionSegmentFlags << 17) >> 27;\n textRegion.refinementTemplate = (textRegionSegmentFlags >> 15) & 1;\n if (textRegion.huffman) {\n var textRegionHuffmanFlags = readUint16(data, position);\n position += 2;\n textRegion.huffmanFS = textRegionHuffmanFlags & 3;\n textRegion.huffmanDS = (textRegionHuffmanFlags >> 2) & 3;\n textRegion.huffmanDT = (textRegionHuffmanFlags >> 4) & 3;\n textRegion.huffmanRefinementDW = (textRegionHuffmanFlags >> 6) & 3;\n textRegion.huffmanRefinementDH = (textRegionHuffmanFlags >> 8) & 3;\n textRegion.huffmanRefinementDX = (textRegionHuffmanFlags >> 10) & 3;\n textRegion.huffmanRefinementDY = (textRegionHuffmanFlags >> 12) & 3;\n textRegion.huffmanRefinementSizeSelector = !!(\n textRegionHuffmanFlags & 0x4000\n );\n }\n if (textRegion.refinement && !textRegion.refinementTemplate) {\n at = [];\n for (i = 0; i < 2; i++) {\n at.push({\n x: readInt8(data, position),\n y: readInt8(data, position + 1),\n });\n position += 2;\n }\n textRegion.refinementAt = at;\n }\n textRegion.numberOfSymbolInstances = readUint32(data, position);\n position += 4;\n args = [textRegion, header.referredTo, data, position, end];\n break;\n case 16: // PatternDictionary\n // 7.4.4. Pattern dictionary segment syntax\n const patternDictionary = {};\n const patternDictionaryFlags = data[position++];\n patternDictionary.mmr = !!(patternDictionaryFlags & 1);\n patternDictionary.template = (patternDictionaryFlags >> 1) & 3;\n patternDictionary.patternWidth = data[position++];\n patternDictionary.patternHeight = data[position++];\n patternDictionary.maxPatternIndex = readUint32(data, position);\n position += 4;\n args = [patternDictionary, header.number, data, position, end];\n break;\n case 22: // ImmediateHalftoneRegion\n case 23: // ImmediateLosslessHalftoneRegion\n // 7.4.5 Halftone region segment syntax\n const halftoneRegion = {};\n halftoneRegion.info = readRegionSegmentInformation(data, position);\n position += RegionSegmentInformationFieldLength;\n const halftoneRegionFlags = data[position++];\n halftoneRegion.mmr = !!(halftoneRegionFlags & 1);\n halftoneRegion.template = (halftoneRegionFlags >> 1) & 3;\n halftoneRegion.enableSkip = !!(halftoneRegionFlags & 8);\n halftoneRegion.combinationOperator = (halftoneRegionFlags >> 4) & 7;\n halftoneRegion.defaultPixelValue = (halftoneRegionFlags >> 7) & 1;\n halftoneRegion.gridWidth = readUint32(data, position);\n position += 4;\n halftoneRegion.gridHeight = readUint32(data, position);\n position += 4;\n halftoneRegion.gridOffsetX = readUint32(data, position) & 0xffffffff;\n position += 4;\n halftoneRegion.gridOffsetY = readUint32(data, position) & 0xffffffff;\n position += 4;\n halftoneRegion.gridVectorX = readUint16(data, position);\n position += 2;\n halftoneRegion.gridVectorY = readUint16(data, position);\n position += 2;\n args = [halftoneRegion, header.referredTo, data, position, end];\n break;\n case 38: // ImmediateGenericRegion\n case 39: // ImmediateLosslessGenericRegion\n var genericRegion = {};\n genericRegion.info = readRegionSegmentInformation(data, position);\n position += RegionSegmentInformationFieldLength;\n var genericRegionSegmentFlags = data[position++];\n genericRegion.mmr = !!(genericRegionSegmentFlags & 1);\n genericRegion.template = (genericRegionSegmentFlags >> 1) & 3;\n genericRegion.prediction = !!(genericRegionSegmentFlags & 8);\n if (!genericRegion.mmr) {\n atLength = genericRegion.template === 0 ? 4 : 1;\n at = [];\n for (i = 0; i < atLength; i++) {\n at.push({\n x: readInt8(data, position),\n y: readInt8(data, position + 1),\n });\n position += 2;\n }\n genericRegion.at = at;\n }\n args = [genericRegion, data, position, end];\n break;\n case 48: // PageInformation\n var pageInfo = {\n width: readUint32(data, position),\n height: readUint32(data, position + 4),\n resolutionX: readUint32(data, position + 8),\n resolutionY: readUint32(data, position + 12),\n };\n if (pageInfo.height === 0xffffffff) {\n delete pageInfo.height;\n }\n var pageSegmentFlags = data[position + 16];\n readUint16(data, position + 17); // pageStripingInformation\n pageInfo.lossless = !!(pageSegmentFlags & 1);\n pageInfo.refinement = !!(pageSegmentFlags & 2);\n pageInfo.defaultPixelValue = (pageSegmentFlags >> 2) & 1;\n pageInfo.combinationOperator = (pageSegmentFlags >> 3) & 3;\n pageInfo.requiresBuffer = !!(pageSegmentFlags & 32);\n pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64);\n args = [pageInfo];\n break;\n case 49: // EndOfPage\n break;\n case 50: // EndOfStripe\n break;\n case 51: // EndOfFile\n break;\n case 53: // Tables\n args = [header.number, data, position, end];\n break;\n case 62: // 7.4.15 defines 2 extension types which\n // are comments and can be ignored.\n break;\n default:\n throw new Jbig2Error(\n `segment type ${header.typeName}(${header.type})` +\n \" is not implemented\"\n );\n }\n var callbackName = \"on\" + header.typeName;\n if (callbackName in visitor) {\n visitor[callbackName].apply(visitor, args);\n }\n }\n\n function processSegments(segments, visitor) {\n for (var i = 0, ii = segments.length; i < ii; i++) {\n processSegment(segments[i], visitor);\n }\n }\n\n function parseJbig2Chunks(chunks) {\n var visitor = new SimpleSegmentVisitor();\n for (var i = 0, ii = chunks.length; i < ii; i++) {\n var chunk = chunks[i];\n var segments = readSegments({}, chunk.data, chunk.start, chunk.end);\n processSegments(segments, visitor);\n }\n return visitor.buffer;\n }\n\n function parseJbig2(data) {\n const end = data.length;\n let position = 0;\n\n if (\n data[position] !== 0x97 ||\n data[position + 1] !== 0x4a ||\n data[position + 2] !== 0x42 ||\n data[position + 3] !== 0x32 ||\n data[position + 4] !== 0x0d ||\n data[position + 5] !== 0x0a ||\n data[position + 6] !== 0x1a ||\n data[position + 7] !== 0x0a\n ) {\n throw new Jbig2Error(\"parseJbig2 - invalid header.\");\n }\n\n const header = Object.create(null);\n position += 8;\n const flags = data[position++];\n header.randomAccess = !(flags & 1);\n if (!(flags & 2)) {\n header.numberOfPages = readUint32(data, position);\n position += 4;\n }\n\n const segments = readSegments(header, data, position, end);\n const visitor = new SimpleSegmentVisitor();\n processSegments(segments, visitor);\n\n const { width, height } = visitor.currentPageInfo;\n const bitPacked = visitor.buffer;\n const imgData = new Uint8ClampedArray(width * height);\n let q = 0,\n k = 0;\n for (let i = 0; i < height; i++) {\n let mask = 0,\n buffer;\n for (let j = 0; j < width; j++) {\n if (!mask) {\n mask = 128;\n buffer = bitPacked[k++];\n }\n imgData[q++] = buffer & mask ? 0 : 255;\n mask >>= 1;\n }\n }\n\n return { imgData, width, height };\n }\n\n function SimpleSegmentVisitor() {}\n\n SimpleSegmentVisitor.prototype = {\n onPageInformation: function SimpleSegmentVisitor_onPageInformation(info) {\n this.currentPageInfo = info;\n var rowSize = (info.width + 7) >> 3;\n var buffer = new Uint8ClampedArray(rowSize * info.height);\n // The contents of ArrayBuffers are initialized to 0.\n // Fill the buffer with 0xFF only if info.defaultPixelValue is set\n if (info.defaultPixelValue) {\n for (var i = 0, ii = buffer.length; i < ii; i++) {\n buffer[i] = 0xff;\n }\n }\n this.buffer = buffer;\n },\n drawBitmap: function SimpleSegmentVisitor_drawBitmap(regionInfo, bitmap) {\n var pageInfo = this.currentPageInfo;\n var width = regionInfo.width,\n height = regionInfo.height;\n var rowSize = (pageInfo.width + 7) >> 3;\n var combinationOperator = pageInfo.combinationOperatorOverride\n ? regionInfo.combinationOperator\n : pageInfo.combinationOperator;\n var buffer = this.buffer;\n var mask0 = 128 >> (regionInfo.x & 7);\n var offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3);\n var i, j, mask, offset;\n switch (combinationOperator) {\n case 0: // OR\n for (i = 0; i < height; i++) {\n mask = mask0;\n offset = offset0;\n for (j = 0; j < width; j++) {\n if (bitmap[i][j]) {\n buffer[offset] |= mask;\n }\n mask >>= 1;\n if (!mask) {\n mask = 128;\n offset++;\n }\n }\n offset0 += rowSize;\n }\n break;\n case 2: // XOR\n for (i = 0; i < height; i++) {\n mask = mask0;\n offset = offset0;\n for (j = 0; j < width; j++) {\n if (bitmap[i][j]) {\n buffer[offset] ^= mask;\n }\n mask >>= 1;\n if (!mask) {\n mask = 128;\n offset++;\n }\n }\n offset0 += rowSize;\n }\n break;\n default:\n throw new Jbig2Error(\n `operator ${combinationOperator} is not supported`\n );\n }\n },\n onImmediateGenericRegion: function SimpleSegmentVisitor_onImmediateGenericRegion(\n region,\n data,\n start,\n end\n ) {\n var regionInfo = region.info;\n var decodingContext = new DecodingContext(data, start, end);\n var bitmap = decodeBitmap(\n region.mmr,\n regionInfo.width,\n regionInfo.height,\n region.template,\n region.prediction,\n null,\n region.at,\n decodingContext\n );\n this.drawBitmap(regionInfo, bitmap);\n },\n onImmediateLosslessGenericRegion: function SimpleSegmentVisitor_onImmediateLosslessGenericRegion() {\n this.onImmediateGenericRegion.apply(this, arguments);\n },\n onSymbolDictionary: function SimpleSegmentVisitor_onSymbolDictionary(\n dictionary,\n currentSegment,\n referredSegments,\n data,\n start,\n end\n ) {\n let huffmanTables, huffmanInput;\n if (dictionary.huffman) {\n huffmanTables = getSymbolDictionaryHuffmanTables(\n dictionary,\n referredSegments,\n this.customTables\n );\n huffmanInput = new Reader(data, start, end);\n }\n\n // Combines exported symbols from all referred segments\n var symbols = this.symbols;\n if (!symbols) {\n this.symbols = symbols = {};\n }\n\n var inputSymbols = [];\n for (var i = 0, ii = referredSegments.length; i < ii; i++) {\n const referredSymbols = symbols[referredSegments[i]];\n // referredSymbols is undefined when we have a reference to a Tables\n // segment instead of a SymbolDictionary.\n if (referredSymbols) {\n inputSymbols = inputSymbols.concat(referredSymbols);\n }\n }\n\n var decodingContext = new DecodingContext(data, start, end);\n symbols[currentSegment] = decodeSymbolDictionary(\n dictionary.huffman,\n dictionary.refinement,\n inputSymbols,\n dictionary.numberOfNewSymbols,\n dictionary.numberOfExportedSymbols,\n huffmanTables,\n dictionary.template,\n dictionary.at,\n dictionary.refinementTemplate,\n dictionary.refinementAt,\n decodingContext,\n huffmanInput\n );\n },\n onImmediateTextRegion: function SimpleSegmentVisitor_onImmediateTextRegion(\n region,\n referredSegments,\n data,\n start,\n end\n ) {\n var regionInfo = region.info;\n let huffmanTables, huffmanInput;\n\n // Combines exported symbols from all referred segments\n var symbols = this.symbols;\n var inputSymbols = [];\n for (var i = 0, ii = referredSegments.length; i < ii; i++) {\n const referredSymbols = symbols[referredSegments[i]];\n // referredSymbols is undefined when we have a reference to a Tables\n // segment instead of a SymbolDictionary.\n if (referredSymbols) {\n inputSymbols = inputSymbols.concat(referredSymbols);\n }\n }\n var symbolCodeLength = log2(inputSymbols.length);\n if (region.huffman) {\n huffmanInput = new Reader(data, start, end);\n huffmanTables = getTextRegionHuffmanTables(\n region,\n referredSegments,\n this.customTables,\n inputSymbols.length,\n huffmanInput\n );\n }\n\n var decodingContext = new DecodingContext(data, start, end);\n var bitmap = decodeTextRegion(\n region.huffman,\n region.refinement,\n regionInfo.width,\n regionInfo.height,\n region.defaultPixelValue,\n region.numberOfSymbolInstances,\n region.stripSize,\n inputSymbols,\n symbolCodeLength,\n region.transposed,\n region.dsOffset,\n region.referenceCorner,\n region.combinationOperator,\n huffmanTables,\n region.refinementTemplate,\n region.refinementAt,\n decodingContext,\n region.logStripSize,\n huffmanInput\n );\n this.drawBitmap(regionInfo, bitmap);\n },\n onImmediateLosslessTextRegion: function SimpleSegmentVisitor_onImmediateLosslessTextRegion() {\n this.onImmediateTextRegion.apply(this, arguments);\n },\n onPatternDictionary(dictionary, currentSegment, data, start, end) {\n let patterns = this.patterns;\n if (!patterns) {\n this.patterns = patterns = {};\n }\n const decodingContext = new DecodingContext(data, start, end);\n patterns[currentSegment] = decodePatternDictionary(\n dictionary.mmr,\n dictionary.patternWidth,\n dictionary.patternHeight,\n dictionary.maxPatternIndex,\n dictionary.template,\n decodingContext\n );\n },\n onImmediateHalftoneRegion(region, referredSegments, data, start, end) {\n // HalftoneRegion refers to exactly one PatternDictionary.\n const patterns = this.patterns[referredSegments[0]];\n const regionInfo = region.info;\n const decodingContext = new DecodingContext(data, start, end);\n const bitmap = decodeHalftoneRegion(\n region.mmr,\n patterns,\n region.template,\n regionInfo.width,\n regionInfo.height,\n region.defaultPixelValue,\n region.enableSkip,\n region.combinationOperator,\n region.gridWidth,\n region.gridHeight,\n region.gridOffsetX,\n region.gridOffsetY,\n region.gridVectorX,\n region.gridVectorY,\n decodingContext\n );\n this.drawBitmap(regionInfo, bitmap);\n },\n onImmediateLosslessHalftoneRegion() {\n this.onImmediateHalftoneRegion.apply(this, arguments);\n },\n onTables(currentSegment, data, start, end) {\n let customTables = this.customTables;\n if (!customTables) {\n this.customTables = customTables = {};\n }\n customTables[currentSegment] = decodeTablesSegment(data, start, end);\n },\n };\n\n function HuffmanLine(lineData) {\n if (lineData.length === 2) {\n // OOB line.\n this.isOOB = true;\n this.rangeLow = 0;\n this.prefixLength = lineData[0];\n this.rangeLength = 0;\n this.prefixCode = lineData[1];\n this.isLowerRange = false;\n } else {\n // Normal, upper range or lower range line.\n // Upper range lines are processed like normal lines.\n this.isOOB = false;\n this.rangeLow = lineData[0];\n this.prefixLength = lineData[1];\n this.rangeLength = lineData[2];\n this.prefixCode = lineData[3];\n this.isLowerRange = lineData[4] === \"lower\";\n }\n }\n\n function HuffmanTreeNode(line) {\n this.children = [];\n if (line) {\n // Leaf node\n this.isLeaf = true;\n this.rangeLength = line.rangeLength;\n this.rangeLow = line.rangeLow;\n this.isLowerRange = line.isLowerRange;\n this.isOOB = line.isOOB;\n } else {\n // Intermediate or root node\n this.isLeaf = false;\n }\n }\n\n HuffmanTreeNode.prototype = {\n buildTree(line, shift) {\n const bit = (line.prefixCode >> shift) & 1;\n if (shift <= 0) {\n // Create a leaf node.\n this.children[bit] = new HuffmanTreeNode(line);\n } else {\n // Create an intermediate node and continue recursively.\n let node = this.children[bit];\n if (!node) {\n this.children[bit] = node = new HuffmanTreeNode(null);\n }\n node.buildTree(line, shift - 1);\n }\n },\n decodeNode(reader) {\n if (this.isLeaf) {\n if (this.isOOB) {\n return null;\n }\n const htOffset = reader.readBits(this.rangeLength);\n return this.rangeLow + (this.isLowerRange ? -htOffset : htOffset);\n }\n const node = this.children[reader.readBit()];\n if (!node) {\n throw new Jbig2Error(\"invalid Huffman data\");\n }\n return node.decodeNode(reader);\n },\n };\n\n function HuffmanTable(lines, prefixCodesDone) {\n if (!prefixCodesDone) {\n this.assignPrefixCodes(lines);\n }\n // Create Huffman tree.\n this.rootNode = new HuffmanTreeNode(null);\n for (let i = 0, ii = lines.length; i < ii; i++) {\n const line = lines[i];\n if (line.prefixLength > 0) {\n this.rootNode.buildTree(line, line.prefixLength - 1);\n }\n }\n }\n\n HuffmanTable.prototype = {\n decode(reader) {\n return this.rootNode.decodeNode(reader);\n },\n assignPrefixCodes(lines) {\n // Annex B.3 Assigning the prefix codes.\n const linesLength = lines.length;\n let prefixLengthMax = 0;\n for (let i = 0; i < linesLength; i++) {\n prefixLengthMax = Math.max(prefixLengthMax, lines[i].prefixLength);\n }\n\n const histogram = new Uint32Array(prefixLengthMax + 1);\n for (let i = 0; i < linesLength; i++) {\n histogram[lines[i].prefixLength]++;\n }\n let currentLength = 1,\n firstCode = 0,\n currentCode,\n currentTemp,\n line;\n histogram[0] = 0;\n\n while (currentLength <= prefixLengthMax) {\n firstCode = (firstCode + histogram[currentLength - 1]) << 1;\n currentCode = firstCode;\n currentTemp = 0;\n while (currentTemp < linesLength) {\n line = lines[currentTemp];\n if (line.prefixLength === currentLength) {\n line.prefixCode = currentCode;\n currentCode++;\n }\n currentTemp++;\n }\n currentLength++;\n }\n },\n };\n\n function decodeTablesSegment(data, start, end) {\n // Decodes a Tables segment, i.e., a custom Huffman table.\n // Annex B.2 Code table structure.\n const flags = data[start];\n const lowestValue = readUint32(data, start + 1) & 0xffffffff;\n const highestValue = readUint32(data, start + 5) & 0xffffffff;\n const reader = new Reader(data, start + 9, end);\n\n const prefixSizeBits = ((flags >> 1) & 7) + 1;\n const rangeSizeBits = ((flags >> 4) & 7) + 1;\n const lines = [];\n let prefixLength,\n rangeLength,\n currentRangeLow = lowestValue;\n\n // Normal table lines\n do {\n prefixLength = reader.readBits(prefixSizeBits);\n rangeLength = reader.readBits(rangeSizeBits);\n lines.push(\n new HuffmanLine([currentRangeLow, prefixLength, rangeLength, 0])\n );\n currentRangeLow += 1 << rangeLength;\n } while (currentRangeLow < highestValue);\n\n // Lower range table line\n prefixLength = reader.readBits(prefixSizeBits);\n lines.push(\n new HuffmanLine([lowestValue - 1, prefixLength, 32, 0, \"lower\"])\n );\n\n // Upper range table line\n prefixLength = reader.readBits(prefixSizeBits);\n lines.push(new HuffmanLine([highestValue, prefixLength, 32, 0]));\n\n if (flags & 1) {\n // Out-of-band table line\n prefixLength = reader.readBits(prefixSizeBits);\n lines.push(new HuffmanLine([prefixLength, 0]));\n }\n\n return new HuffmanTable(lines, false);\n }\n\n const standardTablesCache = {};\n\n function getStandardTable(number) {\n // Annex B.5 Standard Huffman tables.\n let table = standardTablesCache[number];\n if (table) {\n return table;\n }\n let lines;\n switch (number) {\n case 1:\n lines = [\n [0, 1, 4, 0x0],\n [16, 2, 8, 0x2],\n [272, 3, 16, 0x6],\n [65808, 3, 32, 0x7], // upper\n ];\n break;\n case 2:\n lines = [\n [0, 1, 0, 0x0],\n [1, 2, 0, 0x2],\n [2, 3, 0, 0x6],\n [3, 4, 3, 0xe],\n [11, 5, 6, 0x1e],\n [75, 6, 32, 0x3e], // upper\n [6, 0x3f], // OOB\n ];\n break;\n case 3:\n lines = [\n [-256, 8, 8, 0xfe],\n [0, 1, 0, 0x0],\n [1, 2, 0, 0x2],\n [2, 3, 0, 0x6],\n [3, 4, 3, 0xe],\n [11, 5, 6, 0x1e],\n [-257, 8, 32, 0xff, \"lower\"],\n [75, 7, 32, 0x7e], // upper\n [6, 0x3e], // OOB\n ];\n break;\n case 4:\n lines = [\n [1, 1, 0, 0x0],\n [2, 2, 0, 0x2],\n [3, 3, 0, 0x6],\n [4, 4, 3, 0xe],\n [12, 5, 6, 0x1e],\n [76, 5, 32, 0x1f], // upper\n ];\n break;\n case 5:\n lines = [\n [-255, 7, 8, 0x7e],\n [1, 1, 0, 0x0],\n [2, 2, 0, 0x2],\n [3, 3, 0, 0x6],\n [4, 4, 3, 0xe],\n [12, 5, 6, 0x1e],\n [-256, 7, 32, 0x7f, \"lower\"],\n [76, 6, 32, 0x3e], // upper\n ];\n break;\n case 6:\n lines = [\n [-2048, 5, 10, 0x1c],\n [-1024, 4, 9, 0x8],\n [-512, 4, 8, 0x9],\n [-256, 4, 7, 0xa],\n [-128, 5, 6, 0x1d],\n [-64, 5, 5, 0x1e],\n [-32, 4, 5, 0xb],\n [0, 2, 7, 0x0],\n [128, 3, 7, 0x2],\n [256, 3, 8, 0x3],\n [512, 4, 9, 0xc],\n [1024, 4, 10, 0xd],\n [-2049, 6, 32, 0x3e, \"lower\"],\n [2048, 6, 32, 0x3f], // upper\n ];\n break;\n case 7:\n lines = [\n [-1024, 4, 9, 0x8],\n [-512, 3, 8, 0x0],\n [-256, 4, 7, 0x9],\n [-128, 5, 6, 0x1a],\n [-64, 5, 5, 0x1b],\n [-32, 4, 5, 0xa],\n [0, 4, 5, 0xb],\n [32, 5, 5, 0x1c],\n [64, 5, 6, 0x1d],\n [128, 4, 7, 0xc],\n [256, 3, 8, 0x1],\n [512, 3, 9, 0x2],\n [1024, 3, 10, 0x3],\n [-1025, 5, 32, 0x1e, \"lower\"],\n [2048, 5, 32, 0x1f], // upper\n ];\n break;\n case 8:\n lines = [\n [-15, 8, 3, 0xfc],\n [-7, 9, 1, 0x1fc],\n [-5, 8, 1, 0xfd],\n [-3, 9, 0, 0x1fd],\n [-2, 7, 0, 0x7c],\n [-1, 4, 0, 0xa],\n [0, 2, 1, 0x0],\n [2, 5, 0, 0x1a],\n [3, 6, 0, 0x3a],\n [4, 3, 4, 0x4],\n [20, 6, 1, 0x3b],\n [22, 4, 4, 0xb],\n [38, 4, 5, 0xc],\n [70, 5, 6, 0x1b],\n [134, 5, 7, 0x1c],\n [262, 6, 7, 0x3c],\n [390, 7, 8, 0x7d],\n [646, 6, 10, 0x3d],\n [-16, 9, 32, 0x1fe, \"lower\"],\n [1670, 9, 32, 0x1ff], // upper\n [2, 0x1], // OOB\n ];\n break;\n case 9:\n lines = [\n [-31, 8, 4, 0xfc],\n [-15, 9, 2, 0x1fc],\n [-11, 8, 2, 0xfd],\n [-7, 9, 1, 0x1fd],\n [-5, 7, 1, 0x7c],\n [-3, 4, 1, 0xa],\n [-1, 3, 1, 0x2],\n [1, 3, 1, 0x3],\n [3, 5, 1, 0x1a],\n [5, 6, 1, 0x3a],\n [7, 3, 5, 0x4],\n [39, 6, 2, 0x3b],\n [43, 4, 5, 0xb],\n [75, 4, 6, 0xc],\n [139, 5, 7, 0x1b],\n [267, 5, 8, 0x1c],\n [523, 6, 8, 0x3c],\n [779, 7, 9, 0x7d],\n [1291, 6, 11, 0x3d],\n [-32, 9, 32, 0x1fe, \"lower\"],\n [3339, 9, 32, 0x1ff], // upper\n [2, 0x0], // OOB\n ];\n break;\n case 10:\n lines = [\n [-21, 7, 4, 0x7a],\n [-5, 8, 0, 0xfc],\n [-4, 7, 0, 0x7b],\n [-3, 5, 0, 0x18],\n [-2, 2, 2, 0x0],\n [2, 5, 0, 0x19],\n [3, 6, 0, 0x36],\n [4, 7, 0, 0x7c],\n [5, 8, 0, 0xfd],\n [6, 2, 6, 0x1],\n [70, 5, 5, 0x1a],\n [102, 6, 5, 0x37],\n [134, 6, 6, 0x38],\n [198, 6, 7, 0x39],\n [326, 6, 8, 0x3a],\n [582, 6, 9, 0x3b],\n [1094, 6, 10, 0x3c],\n [2118, 7, 11, 0x7d],\n [-22, 8, 32, 0xfe, \"lower\"],\n [4166, 8, 32, 0xff], // upper\n [2, 0x2], // OOB\n ];\n break;\n case 11:\n lines = [\n [1, 1, 0, 0x0],\n [2, 2, 1, 0x2],\n [4, 4, 0, 0xc],\n [5, 4, 1, 0xd],\n [7, 5, 1, 0x1c],\n [9, 5, 2, 0x1d],\n [13, 6, 2, 0x3c],\n [17, 7, 2, 0x7a],\n [21, 7, 3, 0x7b],\n [29, 7, 4, 0x7c],\n [45, 7, 5, 0x7d],\n [77, 7, 6, 0x7e],\n [141, 7, 32, 0x7f], // upper\n ];\n break;\n case 12:\n lines = [\n [1, 1, 0, 0x0],\n [2, 2, 0, 0x2],\n [3, 3, 1, 0x6],\n [5, 5, 0, 0x1c],\n [6, 5, 1, 0x1d],\n [8, 6, 1, 0x3c],\n [10, 7, 0, 0x7a],\n [11, 7, 1, 0x7b],\n [13, 7, 2, 0x7c],\n [17, 7, 3, 0x7d],\n [25, 7, 4, 0x7e],\n [41, 8, 5, 0xfe],\n [73, 8, 32, 0xff], // upper\n ];\n break;\n case 13:\n lines = [\n [1, 1, 0, 0x0],\n [2, 3, 0, 0x4],\n [3, 4, 0, 0xc],\n [4, 5, 0, 0x1c],\n [5, 4, 1, 0xd],\n [7, 3, 3, 0x5],\n [15, 6, 1, 0x3a],\n [17, 6, 2, 0x3b],\n [21, 6, 3, 0x3c],\n [29, 6, 4, 0x3d],\n [45, 6, 5, 0x3e],\n [77, 7, 6, 0x7e],\n [141, 7, 32, 0x7f], // upper\n ];\n break;\n case 14:\n lines = [\n [-2, 3, 0, 0x4],\n [-1, 3, 0, 0x5],\n [0, 1, 0, 0x0],\n [1, 3, 0, 0x6],\n [2, 3, 0, 0x7],\n ];\n break;\n case 15:\n lines = [\n [-24, 7, 4, 0x7c],\n [-8, 6, 2, 0x3c],\n [-4, 5, 1, 0x1c],\n [-2, 4, 0, 0xc],\n [-1, 3, 0, 0x4],\n [0, 1, 0, 0x0],\n [1, 3, 0, 0x5],\n [2, 4, 0, 0xd],\n [3, 5, 1, 0x1d],\n [5, 6, 2, 0x3d],\n [9, 7, 4, 0x7d],\n [-25, 7, 32, 0x7e, \"lower\"],\n [25, 7, 32, 0x7f], // upper\n ];\n break;\n default:\n throw new Jbig2Error(`standard table B.${number} does not exist`);\n }\n\n for (let i = 0, ii = lines.length; i < ii; i++) {\n lines[i] = new HuffmanLine(lines[i]);\n }\n table = new HuffmanTable(lines, true);\n standardTablesCache[number] = table;\n return table;\n }\n\n function Reader(data, start, end) {\n this.data = data;\n this.start = start;\n this.end = end;\n this.position = start;\n this.shift = -1;\n this.currentByte = 0;\n }\n\n Reader.prototype = {\n readBit() {\n if (this.shift < 0) {\n if (this.position >= this.end) {\n throw new Jbig2Error(\"end of data while reading bit\");\n }\n this.currentByte = this.data[this.position++];\n this.shift = 7;\n }\n const bit = (this.currentByte >> this.shift) & 1;\n this.shift--;\n return bit;\n },\n\n readBits(numBits) {\n let result = 0,\n i;\n for (i = numBits - 1; i >= 0; i--) {\n result |= this.readBit() << i;\n }\n return result;\n },\n\n byteAlign() {\n this.shift = -1;\n },\n\n next() {\n if (this.position >= this.end) {\n return -1;\n }\n return this.data[this.position++];\n },\n };\n\n function getCustomHuffmanTable(index, referredTo, customTables) {\n // Returns a Tables segment that has been earlier decoded.\n // See 7.4.2.1.6 (symbol dictionary) or 7.4.3.1.6 (text region).\n let currentIndex = 0;\n for (let i = 0, ii = referredTo.length; i < ii; i++) {\n const table = customTables[referredTo[i]];\n if (table) {\n if (index === currentIndex) {\n return table;\n }\n currentIndex++;\n }\n }\n throw new Jbig2Error(\"can't find custom Huffman table\");\n }\n\n function getTextRegionHuffmanTables(\n textRegion,\n referredTo,\n customTables,\n numberOfSymbols,\n reader\n ) {\n // 7.4.3.1.7 Symbol ID Huffman table decoding\n\n // Read code lengths for RUNCODEs 0...34.\n const codes = [];\n for (let i = 0; i <= 34; i++) {\n const codeLength = reader.readBits(4);\n codes.push(new HuffmanLine([i, codeLength, 0, 0]));\n }\n // Assign Huffman codes for RUNCODEs.\n const runCodesTable = new HuffmanTable(codes, false);\n\n // Read a Huffman code using the assignment above.\n // Interpret the RUNCODE codes and the additional bits (if any).\n codes.length = 0;\n for (let i = 0; i < numberOfSymbols; ) {\n const codeLength = runCodesTable.decode(reader);\n if (codeLength >= 32) {\n let repeatedLength, numberOfRepeats, j;\n switch (codeLength) {\n case 32:\n if (i === 0) {\n throw new Jbig2Error(\"no previous value in symbol ID table\");\n }\n numberOfRepeats = reader.readBits(2) + 3;\n repeatedLength = codes[i - 1].prefixLength;\n break;\n case 33:\n numberOfRepeats = reader.readBits(3) + 3;\n repeatedLength = 0;\n break;\n case 34:\n numberOfRepeats = reader.readBits(7) + 11;\n repeatedLength = 0;\n break;\n default:\n throw new Jbig2Error(\"invalid code length in symbol ID table\");\n }\n for (j = 0; j < numberOfRepeats; j++) {\n codes.push(new HuffmanLine([i, repeatedLength, 0, 0]));\n i++;\n }\n } else {\n codes.push(new HuffmanLine([i, codeLength, 0, 0]));\n i++;\n }\n }\n reader.byteAlign();\n const symbolIDTable = new HuffmanTable(codes, false);\n\n // 7.4.3.1.6 Text region segment Huffman table selection\n\n let customIndex = 0,\n tableFirstS,\n tableDeltaS,\n tableDeltaT;\n\n switch (textRegion.huffmanFS) {\n case 0:\n case 1:\n tableFirstS = getStandardTable(textRegion.huffmanFS + 6);\n break;\n case 3:\n tableFirstS = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n customIndex++;\n break;\n default:\n throw new Jbig2Error(\"invalid Huffman FS selector\");\n }\n\n switch (textRegion.huffmanDS) {\n case 0:\n case 1:\n case 2:\n tableDeltaS = getStandardTable(textRegion.huffmanDS + 8);\n break;\n case 3:\n tableDeltaS = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n customIndex++;\n break;\n default:\n throw new Jbig2Error(\"invalid Huffman DS selector\");\n }\n\n switch (textRegion.huffmanDT) {\n case 0:\n case 1:\n case 2:\n tableDeltaT = getStandardTable(textRegion.huffmanDT + 11);\n break;\n case 3:\n tableDeltaT = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n customIndex++;\n break;\n default:\n throw new Jbig2Error(\"invalid Huffman DT selector\");\n }\n\n if (textRegion.refinement) {\n // Load tables RDW, RDH, RDX and RDY.\n throw new Jbig2Error(\"refinement with Huffman is not supported\");\n }\n\n return {\n symbolIDTable,\n tableFirstS,\n tableDeltaS,\n tableDeltaT,\n };\n }\n\n function getSymbolDictionaryHuffmanTables(\n dictionary,\n referredTo,\n customTables\n ) {\n // 7.4.2.1.6 Symbol dictionary segment Huffman table selection\n\n let customIndex = 0,\n tableDeltaHeight,\n tableDeltaWidth;\n switch (dictionary.huffmanDHSelector) {\n case 0:\n case 1:\n tableDeltaHeight = getStandardTable(dictionary.huffmanDHSelector + 4);\n break;\n case 3:\n tableDeltaHeight = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n customIndex++;\n break;\n default:\n throw new Jbig2Error(\"invalid Huffman DH selector\");\n }\n\n switch (dictionary.huffmanDWSelector) {\n case 0:\n case 1:\n tableDeltaWidth = getStandardTable(dictionary.huffmanDWSelector + 2);\n break;\n case 3:\n tableDeltaWidth = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n customIndex++;\n break;\n default:\n throw new Jbig2Error(\"invalid Huffman DW selector\");\n }\n\n let tableBitmapSize, tableAggregateInstances;\n if (dictionary.bitmapSizeSelector) {\n tableBitmapSize = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n customIndex++;\n } else {\n tableBitmapSize = getStandardTable(1);\n }\n\n if (dictionary.aggregationInstancesSelector) {\n tableAggregateInstances = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n } else {\n tableAggregateInstances = getStandardTable(1);\n }\n\n return {\n tableDeltaHeight,\n tableDeltaWidth,\n tableBitmapSize,\n tableAggregateInstances,\n };\n }\n\n function readUncompressedBitmap(reader, width, height) {\n const bitmap = [];\n for (let y = 0; y < height; y++) {\n const row = new Uint8Array(width);\n bitmap.push(row);\n for (let x = 0; x < width; x++) {\n row[x] = reader.readBit();\n }\n reader.byteAlign();\n }\n return bitmap;\n }\n\n function decodeMMRBitmap(input, width, height, endOfBlock) {\n // MMR is the same compression algorithm as the PDF filter\n // CCITTFaxDecode with /K -1.\n const params = {\n K: -1,\n Columns: width,\n Rows: height,\n BlackIs1: true,\n EndOfBlock: endOfBlock,\n };\n const decoder = new CCITTFaxDecoder(input, params);\n const bitmap = [];\n let currentByte,\n eof = false;\n\n for (let y = 0; y < height; y++) {\n const row = new Uint8Array(width);\n bitmap.push(row);\n let shift = -1;\n for (let x = 0; x < width; x++) {\n if (shift < 0) {\n currentByte = decoder.readNextChar();\n if (currentByte === -1) {\n // Set the rest of the bits to zero.\n currentByte = 0;\n eof = true;\n }\n shift = 7;\n }\n row[x] = (currentByte >> shift) & 1;\n shift--;\n }\n }\n\n if (endOfBlock && !eof) {\n // Read until EOFB has been consumed.\n const lookForEOFLimit = 5;\n for (let i = 0; i < lookForEOFLimit; i++) {\n if (decoder.readNextChar() === -1) {\n break;\n }\n }\n }\n\n return bitmap;\n }\n\n // eslint-disable-next-line no-shadow\n function Jbig2Image() {}\n\n Jbig2Image.prototype = {\n parseChunks(chunks) {\n return parseJbig2Chunks(chunks);\n },\n\n parse(data) {\n const { imgData, width, height } = parseJbig2(data);\n this.width = width;\n this.height = height;\n return imgData;\n },\n };\n\n return Jbig2Image;\n})();\n\nexport { Jbig2Image };\n","/*\n * ofd.js - A Javascript class for reading and rendering ofd files\n * <https://github.com/DLTech21/ofd.js>\n *\n * Copyright (c) 2020. DLTech21 All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * You may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport {\n calPathPoint,\n calTextPoint,\n converterDpi, convertPathAbbreviatedDatatoPoint,\n getFontFamily,\n parseColor,\n parseCtm,\n parseStBox,\n setPageScal,\n converterBox, setMaxPageScal,\n} from \"@/utils/ofd/ofd_util\";\n\nexport const renderPageBox = function (screenWidth, pages, document) {\n let pageBoxs = [];\n for (const page of pages) {\n let boxObj = {};\n boxObj['id'] = Object.keys(page)[0];\n boxObj['box'] = calPageBox(screenWidth, document, page);\n pageBoxs.push(boxObj);\n }\n return pageBoxs;\n}\n\nexport const calPageBox = function (screenWidth, document, page) {\n const area = page[Object.keys(page)[0]]['json']['ofd:Area'];\n let box;\n if (area) {\n const physicalBox = area['ofd:PhysicalBox']\n if (physicalBox) {\n box = (physicalBox);\n } else {\n const applicationBox = area['ofd:ApplicationBox']\n if (applicationBox) {\n box = (applicationBox);\n } else {\n const contentBox = area['ofd:ContentBox']\n if (contentBox) {\n box = (contentBox);\n }\n }\n }\n } else {\n let documentArea = document['ofd:CommonData']['ofd:PageArea']\n const physicalBox = documentArea['ofd:PhysicalBox']\n if (physicalBox) {\n box = (physicalBox);\n } else {\n const applicationBox = documentArea['ofd:ApplicationBox']\n if (applicationBox) {\n box = (applicationBox);\n } else {\n const contentBox = documentArea['ofd:ContentBox']\n if (contentBox) {\n box = (contentBox);\n }\n }\n }\n }\n let array = box.split(' ');\n const scale = ((screenWidth - 10) / parseFloat(array[2])).toFixed(1);\n setMaxPageScal(scale);\n setPageScal(scale);\n box = parseStBox(box);\n box = converterBox(box)\n return box;\n}\n\nexport const calPageBoxScale = function (document, page) {\n const area = page[Object.keys(page)[0]]['json']['ofd:Area'];\n let box;\n if (area) {\n const physicalBox = area['ofd:PhysicalBox']\n if (physicalBox) {\n box = (physicalBox);\n } else {\n const applicationBox = area['ofd:ApplicationBox']\n if (applicationBox) {\n box = (applicationBox);\n } else {\n const contentBox = area['ofd:ContentBox']\n if (contentBox) {\n box = (contentBox);\n }\n }\n }\n } else {\n let documentArea = document['ofd:CommonData']['ofd:PageArea']\n const physicalBox = documentArea['ofd:PhysicalBox']\n if (physicalBox) {\n box = (physicalBox);\n } else {\n const applicationBox = documentArea['ofd:ApplicationBox']\n if (applicationBox) {\n box = (applicationBox);\n } else {\n const contentBox = documentArea['ofd:ContentBox']\n if (contentBox) {\n box = (contentBox);\n }\n }\n }\n }\n box = parseStBox(box);\n box = converterBox(box)\n return box;\n}\n\n\nexport const renderPage = function (pageDiv, page, tpls, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits) {\n const pageId = Object.keys(page)[0];\n const template = page[pageId]['json']['ofd:Template'];\n if (template) {\n let array = [];\n const layers = tpls[template['@_TemplateID']]['json']['ofd:Content']['ofd:Layer'];\n array = array.concat(layers);\n for (let layer of array) {\n if (layer) {\n renderLayer(pageDiv, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits, layer, false);\n }\n }\n }\n const contentLayers = page[pageId]['json']['ofd:Content']['ofd:Layer'];\n let array = [];\n array = array.concat(contentLayers);\n for (let contentLayer of array) {\n if (contentLayer) {\n renderLayer(pageDiv, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits, contentLayer, false);\n }\n }\n if (page[pageId].stamp) {\n const fixIndex = page[pageId].json.pfIndex;\n for (const stamp of page[pageId].stamp) {\n if (stamp.type === 'ofd') {\n renderSealPage(pageDiv, stamp.obj.pages, stamp.obj.tpls, true, stamp.stamp.stampAnnot, stamp.obj.fontResObj, stamp.obj.drawParamResObj, stamp.obj.multiMediaResObj, compositeGraphicUnits, stamp.stamp.sealObj.SES_Signature, stamp.stamp.signedInfo, fixIndex);\n } else if (stamp.type === 'png') {\n let sealBoundary = converterBox(stamp.obj.boundary);\n const oid = (Array.isArray(stamp.stamp.stampAnnot) ? stamp.stamp.stampAnnot[0]['@_ID'] : stamp.stamp.stampAnnot['@_ID']) + fixIndex;\n let element = renderImageOnDiv(pageDiv.style.width, pageDiv.style.height, stamp.obj.img, sealBoundary, stamp.obj.clip, true, stamp.stamp.sealObj.SES_Signature, stamp.stamp.signedInfo, oid);\n pageDiv.appendChild(element);\n }\n }\n }\n if (page[pageId].annotation) {\n const fixIndex = page[pageId].json.pfIndex;\n for (const annotation of page[pageId].annotation) {\n renderAnnotation(pageDiv, annotation, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits, fixIndex);\n }\n }\n}\n\nconst renderAnnotation = function (pageDiv, annotation, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits, fixIndex) {\n let div = document.createElement('div');\n div.setAttribute('style', `overflow: hidden;z-index:${annotation['@_ID'] + fixIndex};position:relative;`)\n let boundary = annotation['appearance']['@_Boundary'];\n if (boundary) {\n let divBoundary = converterBox(parseStBox(boundary));\n div.setAttribute('style', `overflow: hidden;z-index:${annotation['@_ID'] + fixIndex};position:absolute; left: ${divBoundary.x}px; top: ${divBoundary.y}px; width: ${divBoundary.w}px; height: ${divBoundary.h}px`)\n }\n const contentLayer = annotation['appearance'];\n renderLayer(div, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits, contentLayer, false);\n pageDiv.appendChild(div);\n\n}\n\nconst renderSealPage = function (pageDiv, pages, tpls, isStampAnnot, stampAnnot, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits, SES_Signature, signedInfo, fixIndex) {\n for (const page of pages) {\n const pageId = Object.keys(page)[0];\n let stampAnnotBoundary = {x: 0, y: 0, w: 0, h: 0};\n if (isStampAnnot && stampAnnot) {\n stampAnnotBoundary = stampAnnot.boundary;\n }\n let divBoundary = converterBox(stampAnnotBoundary);\n let div = document.createElement('div');\n div.setAttribute(\"name\", \"seal_img_div\");\n div.setAttribute('style', `z-index:${fixIndex + 10000};cursor: pointer; position:relative; left: ${divBoundary.x}px; top: ${divBoundary.y}px; width: ${divBoundary.w}px; height: ${divBoundary.h}px`)\n div.setAttribute('data-ses-signature', `${JSON.stringify(SES_Signature)}`);\n div.setAttribute('data-signed-info', `${JSON.stringify(signedInfo)}`);\n const template = page[pageId]['json']['ofd:Template'];\n if (template) {\n const layers = tpls[template['@_TemplateID']]['json']['ofd:Content']['ofd:Layer'];\n let array = [];\n array = array.concat(layers);\n for (let layer of array) {\n if (layer) {\n renderLayer(div, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits, layer, isStampAnnot);\n }\n }\n }\n const contentLayers = page[pageId]['json']['ofd:Content']['ofd:Layer'];\n let array = [];\n array = array.concat(contentLayers);\n for (let contentLayer of array) {\n if (contentLayer) {\n renderLayer(div, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits, contentLayer, isStampAnnot);\n }\n }\n pageDiv.appendChild(div);\n }\n}\n\nconst renderLayer = function (pageDiv, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits, layer, isStampAnnot, compositeObjectAlpha, compositeObjectBoundary, compositeObjectCTM) {\n let fillColor = null;\n let strokeColor = null;\n let lineWith = converterDpi(0.353);\n let drawParam = layer['@_DrawParam'];\n if (drawParam && Object.keys(drawParamResObj).length > 0 && drawParamResObj[drawParam]) {\n if (drawParamResObj[drawParam]['relative']) {\n drawParam = drawParamResObj[drawParam]['relative'];\n if (drawParamResObj[drawParam]['FillColor']) {\n fillColor = parseColor(drawParamResObj[drawParam]['FillColor']);\n }\n if (drawParamResObj[drawParam]['StrokeColor']) {\n strokeColor = parseColor(drawParamResObj[drawParam]['StrokeColor']);\n }\n if (drawParamResObj[drawParam]['LineWidth']) {\n lineWith = converterDpi(drawParamResObj[drawParam]['LineWidth']);\n }\n }\n if (drawParamResObj[drawParam]['FillColor']) {\n fillColor = parseColor(drawParamResObj[drawParam]['FillColor']);\n }\n if (drawParamResObj[drawParam]['StrokeColor']) {\n strokeColor = parseColor(drawParamResObj[drawParam]['StrokeColor']);\n }\n if (drawParamResObj[drawParam]['LineWidth']) {\n lineWith = converterDpi(drawParamResObj[drawParam]['LineWidth']);\n }\n }\n const imageObjects = layer['ofd:ImageObject'];\n let imageObjectArray = [];\n imageObjectArray = imageObjectArray.concat(imageObjects);\n for (const imageObject of imageObjectArray) {\n if (imageObject) {\n let element = renderImageObject(pageDiv.style.width, pageDiv.style.height, multiMediaResObj, imageObject, isStampAnnot, compositeObjectBoundary)\n pageDiv.appendChild(element);\n }\n }\n const pathObjects = layer['ofd:PathObject'];\n let pathObjectArray = [];\n pathObjectArray = pathObjectArray.concat(pathObjects);\n for (const pathObject of pathObjectArray) {\n if (pathObject) {\n let svg = renderPathObject(drawParamResObj, pathObject, fillColor, strokeColor, lineWith, isStampAnnot, compositeObjectAlpha, compositeObjectBoundary, compositeObjectCTM)\n pageDiv.appendChild(svg);\n }\n }\n const textObjects = layer['ofd:TextObject'];\n let textObjectArray = [];\n textObjectArray = textObjectArray.concat(textObjects);\n for (const textObject of textObjectArray) {\n if (textObject) {\n let svg = renderTextObject(fontResObj, textObject, fillColor, strokeColor);\n pageDiv.appendChild(svg);\n }\n }\n const compositeObjects = layer['ofd:CompositeObject'];\n let compositeObjectArray = [];\n compositeObjectArray = compositeObjectArray.concat(compositeObjects);\n for (const compositeObject of compositeObjectArray) {\n if (compositeObject) {\n for (const compositeGraphicUnit of compositeGraphicUnits) {\n if (compositeGraphicUnit['@_ID'] === compositeObject['@_ResourceID']) {\n const currentCompositeObjectAlpha = compositeObject['@_Alpha'];\n const currentCompositeObjectBoundary = compositeObject['@_Boundary'];\n const currentCompositeObjectCTM = compositeObject['@_CTM'];\n renderLayer(pageDiv, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits, compositeGraphicUnit['ofd:Content'], false, currentCompositeObjectAlpha, currentCompositeObjectBoundary, currentCompositeObjectCTM);\n break;\n }\n }\n }\n }\n const pageBlocks = layer['ofd:PageBlock'];\n let pageBlockArray = [];\n pageBlockArray = pageBlockArray.concat(pageBlocks);\n for (const pageBlock of pageBlockArray) {\n if (pageBlock) {\n renderLayer(pageDiv, fontResObj, drawParamResObj, multiMediaResObj, compositeGraphicUnits, pageBlock, isStampAnnot);\n }\n }\n}\n\nexport const renderImageObject = function (pageWidth, pageHeight, multiMediaResObj, imageObject, isStampAnnot, compositeObjectBoundary) {\n let boundary = parseStBox(imageObject['@_Boundary']);\n boundary = converterBox(boundary);\n const resId = imageObject['@_ResourceID'];\n if (multiMediaResObj[resId].format === 'gbig2') {\n const img = multiMediaResObj[resId].img;\n const width = multiMediaResObj[resId].width;\n const height = multiMediaResObj[resId].height;\n return renderImageOnCanvas(img, width, height, boundary, imageObject['@_ID']);\n } else {\n const ctm = imageObject['@_CTM'];\n return renderImageOnDiv(pageWidth, pageHeight, multiMediaResObj[resId].img, boundary, false, isStampAnnot, null, null, imageObject['@_ID'], ctm, compositeObjectBoundary);\n }\n}\n\nconst renderImageOnCanvas = function (img, imgWidth, imgHeight, boundary, oid) {\n const arr = new Uint8ClampedArray(4 * imgWidth * imgHeight);\n for (var i = 0; i < img.length; i++) {\n arr[4 * i] = img[i];\n arr[4 * i + 1] = img[i];\n arr[4 * i + 2] = img[i];\n arr[4 * i + 3] = 255;\n }\n let imageData = new ImageData(arr, imgWidth, imgHeight);\n let canvas = document.createElement('canvas');\n canvas.width = imgWidth;\n canvas.height = imgHeight;\n let context = canvas.getContext('2d');\n context.putImageData(imageData, 0, 0);\n canvas.setAttribute('style', `left: ${boundary.x}px; top: ${boundary.y}px; width: ${boundary.w}px; height: ${boundary.h}px;z-index: ${oid}`)\n canvas.style.position = 'absolute';\n return canvas;\n}\n\nexport const renderImageOnDiv = function (pageWidth, pageHeight, imgSrc, boundary, clip, isStampAnnot, SES_Signature, signedInfo, oid, ctm, compositeObjectBoundary) {\n let div = document.createElement('div');\n if (isStampAnnot) {\n div.setAttribute(\"name\", \"seal_img_div\");\n div.setAttribute('data-ses-signature', `${JSON.stringify(SES_Signature)}`);\n div.setAttribute('data-signed-info', `${JSON.stringify(signedInfo)}`);\n }\n let img = document.createElement('img');\n img.src = imgSrc;\n if (isStampAnnot) {\n img.setAttribute('width', '100%');\n img.setAttribute('height', '100%');\n }\n if (ctm) {\n const ctms = parseCtm(ctm);\n img.setAttribute('width', `${converterDpi(ctms[0])}px`);\n img.setAttribute('height', `${converterDpi(ctms[3])}px`);\n img.setAttribute('transform', `matrix(${ctms[0]} ${ctms[1]} ${ctms[2]} ${ctms[3]} ${converterDpi(ctms[4])} ${converterDpi(ctms[5])})`)\n }\n if (compositeObjectBoundary) {\n img.setAttribute('width', '100%');\n img.setAttribute('height', '100%');\n img.removeAttribute('transform');\n }\n div.appendChild(img);\n const pw = parseFloat(pageWidth.replace('px', ''));\n const ph = parseFloat(pageHeight.replace('px', ''));\n const w = boundary.w > pw ? pw : boundary.w;\n const h = boundary.h > ph ? ph : boundary.h;\n let c = '';\n if (clip) {\n clip = converterBox(clip);\n c = `clip: rect(${clip.y}px, ${clip.w + clip.x}px, ${clip.h + clip.y}px, ${clip.x}px)`\n }\n div.setAttribute('style', `cursor: pointer; overflow: hidden; position: absolute; left: ${c ? boundary.x : boundary.x < 0 ? 0 : boundary.x}px; top: ${c ? boundary.y : boundary.y < 0 ? 0 : boundary.y}px; width: ${w}px; height: ${h}px; ${c};z-index: ${oid}`)\n return div;\n}\n\nexport const renderTextObject = function (fontResObj, textObject, defaultFillColor, defaultStrokeColor) {\n let defaultFillOpacity = 1;\n let boundary = parseStBox(textObject['@_Boundary']);\n boundary = converterBox(boundary);\n const ctm = textObject['@_CTM'];\n const hScale = textObject['@_HScale'];\n const font = textObject['@_Font'];\n const weight = textObject['@_Weight'];\n const size = converterDpi(parseFloat(textObject['@_Size']));\n let array = [];\n array = array.concat(textObject['ofd:TextCode']);\n const textCodePointList = calTextPoint(array);\n let svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('version', '1.1');\n const fillColor = textObject['ofd:FillColor'];\n let isAxialShd = false;\n if (fillColor) {\n if (fillColor['@_Value']) {\n defaultFillColor = parseColor(fillColor['@_Value']);\n }\n let alpha = fillColor['@_Alpha'];\n if (alpha) {\n defaultFillOpacity = alpha > 1 ? alpha / 255 : alpha;\n }\n const AxialShd = fillColor['ofd:AxialShd'];\n if (AxialShd) {\n isAxialShd = true;\n let linearGradient = document.createElement('linearGradient');\n linearGradient.setAttribute('id', `${textObject['@_ID']}`);\n linearGradient.setAttribute('x1', '0%');\n linearGradient.setAttribute('y1', '0%');\n linearGradient.setAttribute('x2', '100%');\n linearGradient.setAttribute('y2', '100%');\n for (const segment of AxialShd['ofd:Segment']) {\n if (segment) {\n let stop = document.createElement('stop');\n stop.setAttribute('offset', `${segment['@_Position']*100}%`);\n stop.setAttribute('style', `stop-color:${parseColor(segment['ofd:Color']['@_Value'])};stop-opacity:1`);\n linearGradient.appendChild(stop);\n defaultFillColor = parseColor(segment['ofd:Color']['@_Value']);\n }\n }\n svg.appendChild(linearGradient);\n\n }\n }\n for (const textCodePoint of textCodePointList) {\n if (textCodePoint && !isNaN(textCodePoint.x)) {\n let text = document.createElementNS('http://www.w3.org/2000/svg', 'text');\n text.setAttribute('x', textCodePoint.x);\n text.setAttribute('y', textCodePoint.y);\n text.innerHTML = textCodePoint.text;\n if (ctm) {\n const ctms = parseCtm(ctm);\n text.setAttribute('transform', `matrix(${ctms[0]} ${ctms[1]} ${ctms[2]} ${ctms[3]} ${converterDpi(ctms[4])} ${converterDpi(ctms[5])})`)\n }\n if (hScale) {\n text.setAttribute('transform', `matrix(${hScale}, 0, 0, 1, ${(1 - hScale) * textCodePoint.x}, 0)`)\n // text.setAttribute('transform-origin', `${textCodePoint.x}`);\n }\n if (isAxialShd) {\n text.setAttribute('fill', defaultFillColor);\n } else {\n text.setAttribute('fill', defaultStrokeColor);\n text.setAttribute('fill', defaultFillColor);\n text.setAttribute('fill-opacity', defaultFillOpacity);\n }\n text.setAttribute('style', `font-weight: ${weight};font-size:${size}px;font-family: ${getFontFamily(fontResObj[font])};`)\n svg.appendChild(text);\n }\n\n }\n let width = boundary.w;\n let height = boundary.h;\n let left = boundary.x;\n let top = boundary.y;\n svg.setAttribute('style', `overflow:visible;position:absolute;width:${width}px;height:${height}px;left:${left}px;top:${top}px;z-index:${textObject['@_ID']}`);\n return svg;\n}\n\nexport const renderPathObject = function (drawParamResObj, pathObject, defaultFillColor, defaultStrokeColor, defaultLineWith, isStampAnnot, compositeObjectAlpha, compositeObjectBoundary, compositeObjectCTM) {\n let svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n svg.setAttribute('version', '1.1');\n let boundary = parseStBox(pathObject['@_Boundary']);\n if (!boundary)\n return svg;\n boundary = converterBox(boundary);\n let lineWidth = pathObject['@_LineWidth'];\n const abbreviatedData = pathObject['ofd:AbbreviatedData'];\n const points = calPathPoint(convertPathAbbreviatedDatatoPoint(abbreviatedData));\n const ctm = pathObject['@_CTM'];\n let path = document.createElementNS('http://www.w3.org/2000/svg', 'path');\n if (lineWidth) {\n defaultLineWith = converterDpi(lineWidth);\n }\n const drawParam = pathObject['@_DrawParam'];\n if (drawParam) {\n lineWidth = drawParamResObj[drawParam].LineWidth;\n if (lineWidth) {\n defaultLineWith = converterDpi(lineWidth);\n }\n }\n if (ctm) {\n const ctms = parseCtm(ctm);\n path.setAttribute('transform', `matrix(${ctms[0]} ${ctms[1]} ${ctms[2]} ${ctms[3]} ${converterDpi(ctms[4])} ${converterDpi(ctms[5])})`)\n }\n const strokeColor = pathObject['ofd:StrokeColor'];\n let isStrokeAxialShd = false;\n if (strokeColor) {\n if (strokeColor['@_Value']) {\n defaultStrokeColor = parseColor(strokeColor['@_Value'])\n }\n const AxialShd = strokeColor['ofd:AxialShd'];\n if (AxialShd) {\n isStrokeAxialShd = true;\n let linearGradient = document.createElement('linearGradient');\n linearGradient.setAttribute('id', `${pathObject['@_ID']}`);\n linearGradient.setAttribute('x1', '0%');\n linearGradient.setAttribute('y1', '0%');\n linearGradient.setAttribute('x2', '100%');\n linearGradient.setAttribute('y2', '100%');\n for (const segment of AxialShd['ofd:Segment']) {\n if (segment) {\n let stop = document.createElement('stop');\n stop.setAttribute('offset', `${segment['@_Position']*100}%`);\n stop.setAttribute('style', `stop-color:${parseColor(segment['ofd:Color']['@_Value'])};stop-opacity:1`);\n linearGradient.appendChild(stop);\n defaultStrokeColor = parseColor(segment['ofd:Color']['@_Value']);\n }\n }\n svg.appendChild(linearGradient);\n }\n }\n const fillColor = pathObject['ofd:FillColor'];\n let isFillAxialShd = false;\n if (fillColor) {\n if (fillColor['@_Value']) {\n defaultFillColor = parseColor(fillColor['@_Value'])\n }\n const AxialShd = fillColor['ofd:AxialShd'];\n if (AxialShd) {\n isFillAxialShd = true;\n let linearGradient = document.createElement('linearGradient');\n linearGradient.setAttribute('id', `${pathObject['@_ID']}`);\n linearGradient.setAttribute('x1', '0%');\n linearGradient.setAttribute('y1', '0%');\n linearGradient.setAttribute('x2', '100%');\n linearGradient.setAttribute('y2', '100%');\n for (const segment of AxialShd['ofd:Segment']) {\n if (segment) {\n let stop = document.createElement('stop');\n stop.setAttribute('offset', `${segment['@_Position']*100}%`);\n stop.setAttribute('style', `stop-color:${parseColor(segment['ofd:Color']['@_Value'])};stop-opacity:1`);\n linearGradient.appendChild(stop);\n defaultFillColor = parseColor(segment['ofd:Color']['@_Value']);\n }\n }\n svg.appendChild(linearGradient);\n }\n }\n if (defaultLineWith > 0 && !defaultStrokeColor) {\n defaultStrokeColor = defaultFillColor;\n if (!defaultStrokeColor) {\n defaultStrokeColor = 'rgb(0, 0, 0)';\n }\n }\n if (compositeObjectAlpha) {\n path.setAttribute('fill-opacity', `${compositeObjectAlpha / 255}`);\n }\n if (pathObject['@_Stroke'] != 'false') {\n path.setAttribute('stroke', `${defaultStrokeColor}`);\n path.setAttribute('stroke-width', `${defaultLineWith}px`);\n // if (isStrokeAxialShd) {\n // path.setAttribute('stroke', `url(#${pathObject['@_ID']})`);\n // }\n }\n if (pathObject['@_Fill'] != 'false') {\n path.setAttribute('fill', `${isStampAnnot ? 'none' : defaultFillColor ? defaultFillColor : 'none'}`);\n // if (isFillAxialShd) {\n // path.setAttribute('fill', `url(#${pathObject['@_ID']})`);\n // }\n }\n if (pathObject['@_Join']) {\n path.setAttribute('stroke-linejoin', `${pathObject['@_Join']}`);\n }\n if (pathObject['@_Cap']) {\n path.setAttribute('stroke-linecap', `${pathObject['@_Cap']}`);\n }\n if (pathObject['@_DashPattern']) {\n let dash = pathObject['@_DashPattern'];\n const dashs = parseCtm(dash);\n let offset = 0;\n if (pathObject['@_DashOffset']) {\n offset = pathObject['@_DashOffset'];\n }\n path.setAttribute('stroke-dasharray', `${converterDpi(dashs[0])},${converterDpi(dashs[1])}`);\n path.setAttribute('stroke-dashoffset', `${converterDpi(offset)}px`);\n }\n let d = '';\n for (const point of points) {\n if (point.type === 'M') {\n d += `M${point.x} ${point.y} `;\n } else if (point.type === 'L') {\n d += `L${point.x} ${point.y} `;\n } else if (point.type === 'B') {\n d += `C${point.x1} ${point.y1} ${point.x2} ${point.y2} ${point.x3} ${point.y3} `;\n } else if (point.type === 'Q') {\n d += `Q${point.x1} ${point.y1} ${point.x2} ${point.y2} `;\n } else if (point.type === 'A') {\n d += `A${point.rx},${point.ry} ${point.rotation} ${point.arc},${point.sweep} ${point.x},${point.y}`;\n } else if (point.type === 'C') {\n d += `Z`;\n }\n }\n path.setAttribute('d', d);\n svg.appendChild(path);\n let width = isStampAnnot ? boundary.w : Math.ceil(boundary.w);\n let height = isStampAnnot ? boundary.h : Math.ceil(boundary.h);\n let left = boundary.x;\n let top = boundary.y;\n svg.setAttribute('style', `overflow:visible;position:absolute;width:${width}px;height:${height}px;left:${left}px;top:${top}px;z-index:${pathObject['@_ID']}`);\n if (compositeObjectBoundary) {\n let comSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');\n comSvg.setAttribute('version', '1.1');\n let boundary = parseStBox(compositeObjectBoundary);\n boundary = converterBox(boundary);\n let width = Math.ceil(boundary.w);\n let height = Math.ceil(boundary.h);\n let left = boundary.x;\n let top = boundary.y;\n comSvg.setAttribute('style', `overflow:hidden;position:absolute;width:${width}px;height:${height}px;left:${left}px;top:${top}px;z-index:${pathObject['@_ID']}`);\n if (compositeObjectCTM) {\n const ctms = parseCtm(compositeObjectCTM);\n svg.setAttribute('transform', `matrix(${ctms[0]} ${ctms[1]} ${ctms[2]} ${ctms[3]} ${converterDpi(ctms[4])} ${converterDpi(ctms[5])})`)\n }\n comSvg.appendChild(svg);\n return comSvg;\n }\n return svg;\n}\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* eslint no-var: error */\n\nimport { isNodeJS } from \"./is_node.js\";\n\n// Skip compatibility checks for modern builds and if we already ran the module.\nif (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"SKIP_BABEL\")) &&\n (typeof globalThis === \"undefined\" || !globalThis._pdfjsCompatibilityChecked)\n) {\n // Provides support for globalThis in legacy browsers.\n // Support: IE11/Edge, Opera\n if (typeof globalThis === \"undefined\" || globalThis.Math !== Math) {\n // eslint-disable-next-line no-global-assign\n globalThis = require(\"core-js/es/global-this\");\n }\n globalThis._pdfjsCompatibilityChecked = true;\n\n // Support: Node.js\n (function checkNodeBtoa() {\n if (globalThis.btoa || !isNodeJS) {\n return;\n }\n globalThis.btoa = function (chars) {\n // eslint-disable-next-line no-undef\n return Buffer.from(chars, \"binary\").toString(\"base64\");\n };\n })();\n\n // Support: Node.js\n (function checkNodeAtob() {\n if (globalThis.atob || !isNodeJS) {\n return;\n }\n globalThis.atob = function (input) {\n // eslint-disable-next-line no-undef\n return Buffer.from(input, \"base64\").toString(\"binary\");\n };\n })();\n\n // Provides support for String.prototype.startsWith in legacy browsers.\n // Support: IE, Chrome<41\n (function checkStringStartsWith() {\n if (String.prototype.startsWith) {\n return;\n }\n require(\"core-js/es/string/starts-with.js\");\n })();\n\n // Provides support for String.prototype.endsWith in legacy browsers.\n // Support: IE, Chrome<41\n (function checkStringEndsWith() {\n if (String.prototype.endsWith) {\n return;\n }\n require(\"core-js/es/string/ends-with.js\");\n })();\n\n // Provides support for String.prototype.includes in legacy browsers.\n // Support: IE, Chrome<41\n (function checkStringIncludes() {\n if (String.prototype.includes) {\n return;\n }\n require(\"core-js/es/string/includes.js\");\n })();\n\n // Provides support for Array.prototype.includes in legacy browsers.\n // Support: IE, Chrome<47\n (function checkArrayIncludes() {\n if (Array.prototype.includes) {\n return;\n }\n require(\"core-js/es/array/includes.js\");\n })();\n\n // Provides support for Array.from in legacy browsers.\n // Support: IE\n (function checkArrayFrom() {\n if (Array.from) {\n return;\n }\n require(\"core-js/es/array/from.js\");\n })();\n\n // Provides support for Object.assign in legacy browsers.\n // Support: IE\n (function checkObjectAssign() {\n if (Object.assign) {\n return;\n }\n require(\"core-js/es/object/assign.js\");\n })();\n\n // Provides support for Object.fromEntries in legacy browsers.\n // Support: IE, Chrome<73\n (function checkObjectFromEntries() {\n if (Object.fromEntries) {\n return;\n }\n require(\"core-js/es/object/from-entries.js\");\n })();\n\n // Provides support for Math.log2 in legacy browsers.\n // Support: IE, Chrome<38\n (function checkMathLog2() {\n if (Math.log2) {\n return;\n }\n Math.log2 = require(\"core-js/es/math/log2.js\");\n })();\n\n // Provides support for Number.isNaN in legacy browsers.\n // Support: IE.\n (function checkNumberIsNaN() {\n if (Number.isNaN) {\n return;\n }\n Number.isNaN = require(\"core-js/es/number/is-nan.js\");\n })();\n\n // Provides support for Number.isInteger in legacy browsers.\n // Support: IE, Chrome<34\n (function checkNumberIsInteger() {\n if (Number.isInteger) {\n return;\n }\n Number.isInteger = require(\"core-js/es/number/is-integer.js\");\n })();\n\n // Provides support for TypedArray.prototype.slice in legacy browsers.\n // Support: IE\n (function checkTypedArraySlice() {\n if (Uint8Array.prototype.slice) {\n return;\n }\n require(\"core-js/es/typed-array/slice\");\n })();\n\n // Provides support for *recent* additions to the Promise specification,\n // however basic Promise support is assumed to be available natively.\n // Support: Firefox<71, Safari<13, Chrome<76\n (function checkPromise() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"IMAGE_DECODERS\")) {\n // The current image decoders are synchronous, hence `Promise` shouldn't\n // need to be polyfilled for the IMAGE_DECODERS build target.\n return;\n }\n if (globalThis.Promise.allSettled) {\n return;\n }\n globalThis.Promise = require(\"core-js/es/promise/index.js\");\n })();\n\n // Support: IE\n (function checkURL() {\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"PRODUCTION\")) {\n // Prevent \"require is not a function\" errors in development mode,\n // since the `URL` constructor should be available in modern browers.\n return;\n } else if (!PDFJSDev.test(\"GENERIC\")) {\n // The `URL` constructor is assumed to be available in the extension\n // builds.\n return;\n } else if (PDFJSDev.test(\"IMAGE_DECODERS\")) {\n // The current image decoders don't use the `URL` constructor, so it\n // doesn't need to be polyfilled for the IMAGE_DECODERS build target.\n return;\n }\n globalThis.URL = require(\"core-js/web/url.js\");\n })();\n\n // Support: IE, Node.js\n (function checkReadableStream() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"IMAGE_DECODERS\")) {\n // The current image decoders are synchronous, hence `ReadableStream`\n // shouldn't need to be polyfilled for the IMAGE_DECODERS build target.\n return;\n }\n let isReadableStreamSupported = false;\n\n if (typeof ReadableStream !== \"undefined\") {\n // MS Edge may say it has ReadableStream but they are not up to spec yet.\n try {\n // eslint-disable-next-line no-new\n new ReadableStream({\n start(controller) {\n controller.close();\n },\n });\n isReadableStreamSupported = true;\n } catch (e) {\n // The ReadableStream constructor cannot be used.\n }\n }\n if (isReadableStreamSupported) {\n return;\n }\n globalThis.ReadableStream = require(\"web-streams-polyfill/dist/ponyfill.js\").ReadableStream;\n })();\n\n // We want to support Map iteration, but it doesn't seem possible to easily\n // test for that specifically; hence using a similarly unsupported property.\n // Support: IE11\n (function checkMapEntries() {\n if (globalThis.Map && globalThis.Map.prototype.entries) {\n return;\n }\n globalThis.Map = require(\"core-js/es/map/index.js\");\n })();\n\n // We want to support Set iteration, but it doesn't seem possible to easily\n // test for that specifically; hence using a similarly unsupported property.\n // Support: IE11\n (function checkSetEntries() {\n if (globalThis.Set && globalThis.Set.prototype.entries) {\n return;\n }\n globalThis.Set = require(\"core-js/es/set/index.js\");\n })();\n\n // Support: IE<11, Safari<8, Chrome<36\n (function checkWeakMap() {\n if (globalThis.WeakMap) {\n return;\n }\n globalThis.WeakMap = require(\"core-js/es/weak-map/index.js\");\n })();\n\n // Support: IE11\n (function checkWeakSet() {\n if (globalThis.WeakSet) {\n return;\n }\n globalThis.WeakSet = require(\"core-js/es/weak-set/index.js\");\n })();\n\n // Provides support for String.codePointAt in legacy browsers.\n // Support: IE11.\n (function checkStringCodePointAt() {\n if (String.prototype.codePointAt) {\n return;\n }\n require(\"core-js/es/string/code-point-at.js\");\n })();\n\n // Provides support for String.fromCodePoint in legacy browsers.\n // Support: IE11.\n (function checkStringFromCodePoint() {\n if (String.fromCodePoint) {\n return;\n }\n String.fromCodePoint = require(\"core-js/es/string/from-code-point.js\");\n })();\n\n // Support: IE\n (function checkSymbol() {\n if (globalThis.Symbol) {\n return;\n }\n require(\"core-js/es/symbol/index.js\");\n })();\n\n // Provides support for String.prototype.padStart in legacy browsers.\n // Support: IE, Chrome<57\n (function checkStringPadStart() {\n if (String.prototype.padStart) {\n return;\n }\n require(\"core-js/es/string/pad-start.js\");\n })();\n\n // Provides support for String.prototype.padEnd in legacy browsers.\n // Support: IE, Chrome<57\n (function checkStringPadEnd() {\n if (String.prototype.padEnd) {\n return;\n }\n require(\"core-js/es/string/pad-end.js\");\n })();\n\n // Provides support for Object.values in legacy browsers.\n // Support: IE, Chrome<54\n (function checkObjectValues() {\n if (Object.values) {\n return;\n }\n Object.values = require(\"core-js/es/object/values.js\");\n })();\n\n // Provides support for Object.entries in legacy browsers.\n // Support: IE, Chrome<54\n (function checkObjectEntries() {\n if (Object.entries) {\n return;\n }\n Object.entries = require(\"core-js/es/object/entries.js\");\n })();\n}\n","/*\n * ofd.js - A Javascript class for reading and rendering ofd files\n * <https://github.com/DLTech21/ofd.js>\n *\n * Copyright (c) 2020. DLTech21 All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * You may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\nimport {calPageBox, calPageBoxScale, renderPage} from \"@/utils/ofd/ofd_render\";\nimport {pipeline} from \"@/utils/ofd/pipeline\";\nimport {\n getDocRoots,\n parseSingleDoc,\n unzipOfd\n} from \"@/utils/ofd/ofd_parser\";\nimport {digestCheckProcess} from \"@/utils/ofd/ses_signature_parser\"\nimport {getPageScal, setPageScal} from \"@/utils/ofd/ofd_util\";\n// import * as JSZipUtils from \"jszip-utils\";\n// import fa from \"element-ui/src/locale/lang/fa\";\n\n'use strict';\n/*globals Promise */\n\nvar JSZipUtils = {};\n// just use the responseText with xhr1, response with xhr2.\n// The transformation doesn't throw away high-order byte (with responseText)\n// because JSZip handles that case. If not used with JSZip, you may need to\n// do it, see https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data\nJSZipUtils._getBinaryFromXHR = function (xhr) {\n // for xhr.responseText, the 0xFF mask is applied by JSZip\n return xhr.response || xhr.responseText;\n};\n\n// taken from jQuery\nfunction createStandardXHR() {\n try {\n return new window.XMLHttpRequest();\n } catch( e ) {}\n}\n\nfunction createActiveXHR() {\n try {\n return new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch( e ) {}\n}\n\n// Create the request object\nvar createXHR = (typeof window !== \"undefined\" && window.ActiveXObject) ?\n /* Microsoft failed to properly\n * implement the XMLHttpRequest in IE7 (can't request local files),\n * so we use the ActiveXObject when it is available\n * Additionally XMLHttpRequest can be disabled in IE7/IE8 so\n * we need a fallback.\n */\n function() {\n return createStandardXHR() || createActiveXHR();\n } :\n // For all other browsers, use the standard XMLHttpRequest object\n createStandardXHR;\n\n\n/**\n * @param {string} path The path to the resource to GET.\n * @param {function|{callback: function, progress: function}} options\n * @return {Promise|undefined} If no callback is passed then a promise is returned\n */\nJSZipUtils.getBinaryContent = function (path, options) {\n console.log(\"getBinaryContent\")\n var promise, resolve, reject;\n var callback;\n\n if (!options) {\n options = {};\n }\n\n // backward compatible callback\n if (typeof options === \"function\") {\n callback = options;\n options = {};\n } else if (typeof options.callback === 'function') {\n // callback inside options object\n callback = options.callback;\n }\n\n if (!callback && typeof Promise !== \"undefined\") {\n promise = new Promise(function (_resolve, _reject) {\n resolve = _resolve;\n reject = _reject;\n });\n } else {\n resolve = function (data) { callback(null, data); };\n reject = function (err) { callback(err, null); };\n }\n\n /*\n * Here is the tricky part : getting the data.\n * In firefox/chrome/opera/... setting the mimeType to 'text/plain; charset=x-user-defined'\n * is enough, the result is in the standard xhr.responseText.\n * cf https://developer.mozilla.org/En/XMLHttpRequest/Using_XMLHttpRequest#Receiving_binary_data_in_older_browsers\n * In IE <= 9, we must use (the IE only) attribute responseBody\n * (for binary data, its content is different from responseText).\n * In IE 10, the 'charset=x-user-defined' trick doesn't work, only the\n * responseType will work :\n * http://msdn.microsoft.com/en-us/library/ie/hh673569%28v=vs.85%29.aspx#Binary_Object_upload_and_download\n *\n * I'd like to use jQuery to avoid this XHR madness, but it doesn't support\n * the responseType attribute : http://bugs.jquery.com/ticket/11461\n */\n try {\n var xhr = createXHR();\n\n xhr.open('GET', path, true);\n\n // recent browsers\n if (\"responseType\" in xhr) {\n xhr.responseType = \"arraybuffer\";\n }\n\n // older browser\n if(xhr.overrideMimeType) {\n xhr.overrideMimeType(\"text/plain; charset=x-user-defined\");\n }\n\n xhr.onreadystatechange = function (event) {\n // use `xhr` and not `this`... thanks IE\n if (xhr.readyState === 4) {\n if (xhr.status === 200 || xhr.status === 0) {\n try {\n resolve(JSZipUtils._getBinaryFromXHR(xhr));\n } catch(err) {\n reject(new Error(err));\n }\n } else {\n reject(new Error(\"Ajax error for \" + path + \" : \" + this.status + \" \" + this.statusText));\n }\n }\n };\n\n if(options.progress) {\n xhr.onprogress = function(e) {\n options.progress({\n path: path,\n originalEvent: e,\n percent: e.loaded / e.total * 100,\n loaded: e.loaded,\n total: e.total\n });\n };\n }\n xhr.withCredentials = true;\n xhr.send();\n\n } catch (e) {\n reject(new Error(e), null);\n }\n\n // returns a promise or undefined depending on whether a callback was\n // provided\n return promise;\n};\n\n// // export\n// module.exports = JSZipUtils;\n\n// enforcing Stuk's coding style\n// vim: set shiftwidth=4 softtabstop=4:\n\n\n\nexport const parseOfdDocument = function (options) {\n if (options.ofd instanceof File || options.ofd instanceof ArrayBuffer) {\n doParseOFD(options);\n } else {\n JSZipUtils.getBinaryContent(options.ofd, function (err, data) {\n if (err) {\n if (options.fail) {\n options.fail(err);\n }\n } else {\n options.ofd = data;\n doParseOFD(options);\n }\n });\n }\n}\n\nconst doParseOFD = function (options) {\n global.xmlParseFlag = 0;\n pipeline.call(this, async () => await unzipOfd(options.ofd), getDocRoots, parseSingleDoc)\n .then(res => {\n if (options.success) {\n options.success(res);\n }\n })\n .catch(res => {\n console.log(res)\n if (options.fail) {\n options.fail(res);\n }\n });\n}\n\nexport const renderOfd = function (screenWidth, ofd) {\n let divArray = [];\n if (!ofd) {\n return divArray;\n }\n for (const page of ofd.pages) {\n let box = calPageBox(screenWidth, ofd.document, page);\n const pageId = Object.keys(page)[0];\n let pageDiv = document.createElement('div');\n pageDiv.id = pageId;\n pageDiv.setAttribute('style', `margin-bottom: 20px;position: relative;width:${box.w}px;height:${box.h}px;background: white;`)\n renderPage(pageDiv, page, ofd.tpls, ofd.fontResObj, ofd.drawParamResObj, ofd.multiMediaResObj, ofd.compositeGraphicUnits);\n divArray.push(pageDiv);\n }\n return divArray;\n}\n\nexport const renderOfdByScale = function (ofd) {\n let divArray = [];\n if (!ofd) {\n return divArray;\n }\n for (const page of ofd.pages) {\n let box = calPageBoxScale(ofd.document, page);\n const pageId = Object.keys(page)[0];\n let pageDiv = document.createElement('div');\n pageDiv.id = pageId;\n pageDiv.setAttribute('style', `overflow: hidden;margin-bottom: 20px;position: relative;width:${box.w}px;height:${box.h}px;background: white;`)\n renderPage(pageDiv, page, ofd.tpls, ofd.fontResObj, ofd.drawParamResObj, ofd.multiMediaResObj, ofd.compositeGraphicUnits);\n divArray.push(pageDiv);\n }\n return divArray;\n}\n\nexport const digestCheck = function (options) {\n // pipeline.call(this, async () => await digestCheckProcess(options.arr))\n // .then(res => {\n // if (options.success) {\n // options.success(res);\n // }\n // });\n return digestCheckProcess(options)\n}\n\nexport const setPageScale = function (scale) {\n setPageScal(scale);\n}\n\nexport const getPageScale = function () {\n return getPageScal();\n}\n\n","/**\r\n * 左补0到指定长度\r\n */\r\nfunction leftPad(input, num) {\r\n if (input.length >= num) return input\r\n \r\n return (new Array(num - input.length + 1)).join('0') + input\r\n }\r\n \r\n /**\r\n * 二进制转化为十六进制\r\n */\r\n function binary2hex(binary) {\r\n const binaryLength = 8\r\n let hex = ''\r\n for (let i = 0; i < binary.length / binaryLength; i++) {\r\n hex += leftPad(parseInt(binary.substr(i * binaryLength, binaryLength), 2).toString(16), 2)\r\n }\r\n return hex\r\n }\r\n \r\n /**\r\n * 十六进制转化为二进制\r\n */\r\n function hex2binary(hex) {\r\n const hexLength = 2\r\n let binary = ''\r\n for (let i = 0; i < hex.length / hexLength; i++) {\r\n binary += leftPad(parseInt(hex.substr(i * hexLength, hexLength), 16).toString(2), 8)\r\n }\r\n return binary\r\n }\r\n \r\n /**\r\n * 普通字符串转化为二进制\r\n */\r\n function str2binary(str) {\r\n let binary = ''\r\n for (let i = 0, len = str.length; i < len; i++) {\r\n const ch = str[i]\r\n binary += leftPad(ch.codePointAt(0).toString(2), 8)\r\n }\r\n return binary\r\n }\r\n \r\n /**\r\n * 循环左移\r\n */\r\n function rol(str, n) {\r\n return str.substring(n % str.length) + str.substr(0, n % str.length)\r\n }\r\n \r\n /**\r\n * 二进制运算\r\n */\r\n function binaryCal(x, y, method) {\r\n const a = x || ''\r\n const b = y || ''\r\n const result = []\r\n let prevResult\r\n \r\n for (let i = a.length - 1; i >= 0; i--) { // 大端\r\n prevResult = method(a[i], b[i], prevResult)\r\n result[i] = prevResult[0]\r\n }\r\n return result.join('')\r\n }\r\n \r\n /**\r\n * 二进制异或运算\r\n */\r\n function xor(x, y) {\r\n return binaryCal(x, y, (a, b) => [(a === b ? '0' : '1')])\r\n }\r\n \r\n /**\r\n * 二进制与运算\r\n */\r\n function and(x, y) {\r\n return binaryCal(x, y, (a, b) => [(a === '1' && b === '1' ? '1' : '0')])\r\n }\r\n \r\n /**\r\n * 二进制或运算\r\n */\r\n function or(x, y) {\r\n return binaryCal(x, y, (a, b) => [(a === '1' || b === '1' ? '1' : '0')]) // a === '0' && b === '0' ? '0' : '1'\r\n }\r\n \r\n /**\r\n * 二进制与运算\r\n */\r\n function add(x, y) {\r\n const result = binaryCal(x, y, (a, b, prevResult) => {\r\n const carry = prevResult ? prevResult[1] : '0' || '0'\r\n \r\n // a,b不等时,carry不变,结果与carry相反\r\n // a,b相等时,结果等于原carry,新carry等于a\r\n if (a !== b) return [carry === '0' ? '1' : '0', carry]\r\n \r\n return [carry, a]\r\n })\r\n \r\n return result\r\n }\r\n \r\n /**\r\n * 二进制非运算\r\n */\r\n function not(x) {\r\n return binaryCal(x, undefined, a => [a === '1' ? '0' : '1'])\r\n }\r\n \r\n function calMulti(method) {\r\n return (...arr) => arr.reduce((prev, curr) => method(prev, curr))\r\n }\r\n \r\n /**\r\n * 压缩函数中的置换函数 P1(X) = X xor (X <<< 9) xor (X <<< 17)\r\n */\r\n function P0(X) {\r\n return calMulti(xor)(X, rol(X, 9), rol(X, 17))\r\n }\r\n \r\n /**\r\n * 消息扩展中的置换函数 P1(X) = X xor (X <<< 15) xor (X <<< 23)\r\n */\r\n function P1(X) {\r\n return calMulti(xor)(X, rol(X, 15), rol(X, 23))\r\n }\r\n \r\n function FF(X, Y, Z, j) {\r\n return j >= 0 && j <= 15 ? calMulti(xor)(X, Y, Z) : calMulti(or)(and(X, Y), and(X, Z), and(Y, Z))\r\n }\r\n \r\n function GG(X, Y, Z, j) {\r\n return j >= 0 && j <= 15 ? calMulti(xor)(X, Y, Z) : or(and(X, Y), and(not(X), Z))\r\n }\r\n \r\n function T(j) {\r\n return j >= 0 && j <= 15 ? hex2binary('79cc4519') : hex2binary('7a879d8a')\r\n }\r\n \r\n /**\r\n * 压缩函数\r\n */\r\n function CF(V, Bi) {\r\n // 消息扩展\r\n const wordLength = 32\r\n const W = []\r\n const M = [] // W'\r\n \r\n // 将消息分组B划分为16个字W0, W1,…… ,W15 (字为长度为32的比特串)\r\n for (let i = 0; i < 16; i++) {\r\n W.push(Bi.substr(i * wordLength, wordLength))\r\n }\r\n \r\n // W[j] <- P1(W[j−16] xor W[j−9] xor (W[j−3] <<< 15)) xor (W[j−13] <<< 7) xor W[j−6]\r\n for (let j = 16; j < 68; j++) {\r\n W.push(calMulti(xor)(\r\n P1(calMulti(xor)(W[j - 16], W[j - 9], rol(W[j - 3], 15))),\r\n rol(W[j - 13], 7),\r\n W[j - 6]\r\n ))\r\n }\r\n \r\n // W′[j] = W[j] xor W[j+4]\r\n for (let j = 0; j < 64; j++) {\r\n M.push(xor(W[j], W[j + 4]))\r\n }\r\n \r\n // 压缩\r\n const wordRegister = [] // 字寄存器\r\n for (let j = 0; j < 8; j++) {\r\n wordRegister.push(V.substr(j * wordLength, wordLength))\r\n }\r\n \r\n let A = wordRegister[0]\r\n let B = wordRegister[1]\r\n let C = wordRegister[2]\r\n let D = wordRegister[3]\r\n let E = wordRegister[4]\r\n let F = wordRegister[5]\r\n let G = wordRegister[6]\r\n let H = wordRegister[7]\r\n \r\n // 中间变量\r\n let SS1\r\n let SS2\r\n let TT1\r\n let TT2\r\n for (let j = 0; j < 64; j++) {\r\n SS1 = rol(calMulti(add)(rol(A, 12), E, rol(T(j), j)), 7)\r\n SS2 = xor(SS1, rol(A, 12))\r\n \r\n TT1 = calMulti(add)(FF(A, B, C, j), D, SS2, M[j])\r\n TT2 = calMulti(add)(GG(E, F, G, j), H, SS1, W[j])\r\n \r\n D = C\r\n C = rol(B, 9)\r\n B = A\r\n A = TT1\r\n H = G\r\n G = rol(F, 19)\r\n F = E\r\n E = P0(TT2)\r\n }\r\n \r\n return xor([A, B, C, D, E, F, G, H].join(''), V)\r\n }\r\n \r\n //export function sm3(str: string): string;\r\n export function sm3(hexstr) {\r\n const binary = hex2binary(hexstr)\r\n // 填充\r\n const len = binary.length\r\n \r\n // k是满足len + 1 + k = 448mod512的最小的非负整数\r\n let k = len % 512\r\n \r\n // 如果 448 <= (512 % len) < 512,需要多补充 (len % 448) 比特'0'以满足总比特长度为512的倍数\r\n k = k >= 448 ? 512 - (k % 448) - 1 : 448 - k - 1\r\n \r\n const m = `${binary}1${leftPad('', k)}${leftPad(len.toString(2), 64)}`.toString() // k个0\r\n \r\n // 迭代压缩\r\n const n = (len + k + 65) / 512\r\n \r\n let V = hex2binary('7380166f4914b2b9172442d7da8a0600a96f30bc163138aae38dee4db0fb0e4e')\r\n for (let i = 0; i <= n - 1; i++) {\r\n const B = m.substr(512 * i, 512)\r\n V = CF(V, B)\r\n }\r\n return binary2hex(V)\r\n }","import {\r\n sm2\r\n} from \"sm-crypto\";\r\nimport {sm3} from \"@/utils/ofd/sm3\";\r\nimport md5 from \"js-md5\";\r\nimport sha1 from \"js-sha1\"\r\nimport rsa from \"jsrsasign\"\r\nimport {Uint8ArrayToHexString} from \"@/utils/ofd/ofd_util\";\r\nimport Base64 from \"@lapo/asn1js/base64\";\r\n\r\nexport const digestByteArray = function(data,hashedBase64,checkMethod){\r\n const hashedHex = Uint8ArrayToHexString(Base64.decode(hashedBase64));\r\n checkMethod = checkMethod.toLowerCase();\r\n if(checkMethod.indexOf(\"1.2.156.10197.1.401\")>=0 || checkMethod.indexOf(\"sm3\")>=0){\r\n return hashedHex==sm3(Uint8ArrayToHexString(data));\r\n }else if(checkMethod.indexOf(\"md5\")>=0){\r\n return hashedHex==md5(data);\r\n }else if(checkMethod.indexOf(\"sha1\")>=0){\r\n return hashedHex==sha1(data);\r\n }else{\r\n return \"\";\r\n }\r\n}\r\n\r\nexport const SES_Signature_Verify = function(SES_Signature){\r\n try {\r\n let signAlg = SES_Signature.realVersion<4?SES_Signature.toSign.signatureAlgorithm:SES_Signature.signatureAlgID;\r\n signAlg = signAlg.toLowerCase();\r\n const msg = SES_Signature.toSignDer;\r\n if(signAlg.indexOf(\"1.2.156.10197.1.501\")>=0 || signAlg.indexOf(\"sm2\")>=0){\r\n let sigValueHex = SES_Signature.signature.replace(/ /g,'').replace(/\\n/g,'');\r\n if(sigValueHex.indexOf('00')==0){\r\n sigValueHex = sigValueHex.substr(2,sigValueHex.length-2);\r\n }\r\n const cert = SES_Signature.realVersion<4?SES_Signature.toSign.cert:SES_Signature.cert;\r\n let publicKey = cert.subjectPublicKeyInfo.subjectPublicKey.replace(/ /g,'').replace(/\\n/g,'');\r\n if(publicKey.indexOf('00')==0){\r\n publicKey = publicKey.substr(2,publicKey.length-2);\r\n }\r\n return sm2.doVerifySignature(msg, sigValueHex, publicKey, {\r\n der : true,\r\n hash: true,\r\n userId:\"1234567812345678\"\r\n });\r\n }else{\r\n let sig = new rsa.KJUR.crypto.Signature({\"alg\": \"SHA1withRSA\"});\r\n const cert = SES_Signature.realVersion<4?SES_Signature.toSign.cert:SES_Signature.cert;\r\n let sigValueHex = SES_Signature.signature.replace(/ /g,'').replace(/\\n/g,'');\r\n if(sigValueHex.indexOf('00')==0){\r\n sigValueHex = sigValueHex.substr(2,sigValueHex.length-2);\r\n }\r\n sig.init(cert);\r\n sig.updateHex(msg);\r\n return sig.verify(sigValueHex);\r\n }\r\n } catch (e) {\r\n console.log(e)\r\n return false;\r\n }\r\n}\r\n","/*\n * ofd.js - A Javascript class for reading and rendering ofd files\n * <https://github.com/DLTech21/ofd.js>\n *\n * Copyright (c) 2020. DLTech21 All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * You may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\n\nimport Hex from \"@lapo/asn1js/hex\";\nimport Base64 from \"@lapo/asn1js/base64\";\nimport ASN1 from \"@lapo/asn1js\";\nimport {SES_Signature_Verify} from \"@/utils/ofd/verify_signature_util\";\nimport {digestByteArray} from \"@/utils/ofd/verify_signature_util\";\nlet reHex = /^\\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\\s*)+$/;\n\nexport const parseSesSignature = async function (zip, name) {\n return new Promise((resolve, reject) => {\n zip.files[name].async('base64').then(function (bytes) {\n let res = decodeText(bytes);\n resolve(res);\n }, function error(e) {\n reject(e);\n })\n });\n}\n\nexport const digestCheckProcess = function (arr){\n let ret = true;\n for (const val of arr) {\n const value = digestByteArray(val.fileData, val.hashed, val.checkMethod);\n ret = ret && value;\n }\n return ret;\n}\n\nconst decodeText = function (val) {\n try {\n let der = reHex.test(val) ? Hex.decode(val) : Base64.unarmor(val);\n return decode(der);\n } catch (e) {\n console.log(e)\n return {};\n }\n}\n\nconst decode = function (der, offset) {\n offset = offset || 0;\n try {\n const SES_Signature = decodeSES_Signature(der,offset);\n const type = SES_Signature.toSign.eseal.esealInfo.picture.type;\n const ofdArray = SES_Signature.toSign.eseal.esealInfo.picture.data.byte;\n return {ofdArray, 'type': type.toLowerCase(), SES_Signature,'verifyRet':SES_Signature_Verify(SES_Signature)};\n } catch (e) {\n console.log(e)\n return {};\n }\n}\n\nconst decodeUTCTime = function (str) {\n str = str.replace('Unrecognized time: ','');\n const UTC = str.indexOf('Z') > 0;\n str = str.replace('Z', '');\n str = str.substr(0,1)<'5'?'20'+str:'19'+str;\n return str;\n}\n\nconst decodeSES_Signature = function (der, offset) {\n offset = offset || 0;\n let asn1 = ASN1.decode(der, offset);\n var SES_Signature;\n try {\n //V1 V4分支判断\n //V1\n //Unrecognized time:\n const createDate = decodeUTCTime(asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[3]?.stream.parseTime(asn1.sub[0].sub[1].sub[0].sub[2].sub[3].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[3].header, asn1.sub[0].sub[1].sub[0].sub[2].sub[3].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[3].header + asn1.sub[0].sub[1].sub[0].sub[2].sub[3].length));\n const validStart = decodeUTCTime(asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[4]?.stream.parseTime(asn1.sub[0].sub[1].sub[0].sub[2].sub[4].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[4].header, asn1.sub[0].sub[1].sub[0].sub[2].sub[4].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[4].header + asn1.sub[0].sub[1].sub[0].sub[2].sub[4].length));\n const validEnd = decodeUTCTime(asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[5]?.stream.parseTime(asn1.sub[0].sub[1].sub[0].sub[2].sub[5].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[5].header, asn1.sub[0].sub[1].sub[0].sub[2].sub[5].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[5].header + asn1.sub[0].sub[1].sub[0].sub[2].sub[5].length));\n const timeInfo = decodeUTCTime(asn1.sub[0]?.sub[2]?.stream.parseTime(asn1.sub[0].sub[2].stream.pos + asn1.sub[0].sub[2].header, asn1.sub[0].sub[2].stream.pos + asn1.sub[0].sub[2].header + asn1.sub[0].sub[2].length, false));\n const asn1CertList = asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[2];\n let certList = new Array();\n if(asn1CertList){\n asn1CertList.sub.forEach(asn1Cert => {\n certList.push(asn1Cert.stream.parseOctetString(asn1Cert.stream.pos + asn1Cert.header, asn1Cert.stream.pos + asn1Cert.header+asn1Cert.length));\n });\n }\n const asn1ExtDatas = asn1.sub[0]?.sub[1]?.sub[0]?.sub[4];\n let extDatas = new Array();\n if(asn1ExtDatas){\n asn1ExtDatas.sub.forEach(asn1ExtData => {\n extDatas.push({\n 'extnID':asn1ExtData.sub[0]?.stream.parseOID(asn1ExtData.sub[0].stream.pos + asn1ExtData.sub[0].header, asn1ExtData.sub[0].stream.pos + asn1ExtData.sub[0].header+asn1ExtData.sub[0].length),\n 'critical':asn1ExtData.sub[1]?.stream.parseInteger(asn1ExtData.sub[1].stream.pos + asn1ExtData.sub[1].header, asn1ExtData.sub[1].stream.pos + asn1ExtData.sub[1].header+asn1ExtData.sub[1].length),\n 'extnValue':asn1ExtData.sub[2]?.stream.parseOctetString(asn1ExtData.sub[2].stream.pos + asn1ExtData.sub[2].header, asn1ExtData.sub[2].stream.pos + asn1ExtData.sub[2].header+asn1ExtData.sub[2].length),\n })\n });\n }\n //ASN1.decode(asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[3]);\n SES_Signature =\n {\n 'realVersion':1,\n 'toSignDer':asn1.sub[0]?.stream.enc.subarray(asn1.sub[0].stream.pos,asn1.sub[0].stream.pos+asn1.sub[0].header+asn1.sub[0].length),\n 'toSign':{\n 'version':asn1.sub[0]?.sub[0]?.stream.parseInteger(asn1.sub[0].sub[0].stream.pos + asn1.sub[0].sub[0].header, asn1.sub[0].sub[0].stream.pos + asn1.sub[0].sub[0].header + asn1.sub[0].sub[0].length),\n 'eseal':{\n 'esealInfo':{\n 'header':{\n 'ID':asn1.sub[0]?.sub[1]?.sub[0]?.sub[0]?.sub[0]?.stream.parseStringUTF(asn1.sub[0].sub[1].sub[0].sub[0].sub[0].stream.pos + asn1.sub[0].sub[1].sub[0].sub[0].sub[0].header, asn1.sub[0].sub[1].sub[0].sub[0].sub[0].stream.pos + asn1.sub[0].sub[1].sub[0].sub[0].sub[0].header + asn1.sub[0].sub[1].sub[0].sub[0].sub[0].length),\n 'version':asn1.sub[0]?.sub[1]?.sub[0]?.sub[0]?.sub[1]?.stream.parseInteger(asn1.sub[0].sub[1].sub[0].sub[0].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[0].sub[1].header, asn1.sub[0].sub[1].sub[0].sub[0].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[0].sub[1].header + asn1.sub[0].sub[1].sub[0].sub[0].sub[1].length),\n 'Vid':asn1.sub[0]?.sub[1]?.sub[0]?.sub[0]?.sub[2]?.stream.parseStringUTF(asn1.sub[0].sub[1].sub[0].sub[0].sub[2].stream.pos + asn1.sub[0].sub[1].sub[0].sub[0].sub[2].header, asn1.sub[0].sub[1].sub[0].sub[0].sub[2].stream.pos + asn1.sub[0].sub[1].sub[0].sub[0].sub[2].header + asn1.sub[0].sub[1].sub[0].sub[0].sub[2].length),\n },\n 'esID':asn1.sub[0]?.sub[1]?.sub[0]?.sub[1]?.stream.parseStringUTF(asn1.sub[0].sub[1].sub[0].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[1].header, asn1.sub[0].sub[1].sub[0].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[1].header + asn1.sub[0].sub[1].sub[0].sub[1].length),\n 'property':{\n 'type':asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[0]?.stream.parseInteger(asn1.sub[0].sub[1].sub[0].sub[2].sub[0].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[0].header, asn1.sub[0].sub[1].sub[0].sub[2].sub[0].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[0].header + asn1.sub[0].sub[1].sub[0].sub[2].sub[0].length),\n 'name':asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[1]?.stream.parseStringUTF(asn1.sub[0].sub[1].sub[0].sub[2].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[1].header, asn1.sub[0].sub[1].sub[0].sub[2].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[1].header + asn1.sub[0].sub[1].sub[0].sub[2].sub[1].length),\n 'certList':certList,\n 'createDate':createDate,\n 'validStart':validStart,\n 'validEnd':validEnd,\n },\n 'picture':{\n 'type':asn1.sub[0]?.sub[1]?.sub[0]?.sub[3]?.sub[0]?.stream.parseStringUTF(asn1.sub[0].sub[1].sub[0].sub[3].sub[0].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[0].header, asn1.sub[0].sub[1].sub[0].sub[3].sub[0].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[0].header + asn1.sub[0].sub[1].sub[0].sub[3].sub[0].length),\n 'data': {'hex': asn1.sub[0]?.sub[1]?.sub[0]?.sub[3]?.sub[1]?.stream.parseOctetString(asn1.sub[0].sub[1].sub[0].sub[3].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[1].header, asn1.sub[0].sub[1].sub[0].sub[3].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[1].header + asn1.sub[0].sub[1].sub[0].sub[3].sub[1].length), byte: asn1.sub[0]?.sub[1]?.sub[0]?.sub[3]?.sub[1]?.stream.enc.subarray(asn1.sub[0].sub[1].sub[0].sub[3].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[1].header, asn1.sub[0].sub[1].sub[0].sub[3].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[1].header + asn1.sub[0].sub[1].sub[0].sub[3].sub[1].length)},\n 'width':asn1.sub[0]?.sub[1]?.sub[0]?.sub[3]?.sub[2]?.stream.parseInteger(asn1.sub[0].sub[1].sub[0].sub[3].sub[2].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[2].header, asn1.sub[0].sub[1].sub[0].sub[3].sub[2].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[2].header + asn1.sub[0].sub[1].sub[0].sub[3].sub[2].length),\n 'height':asn1.sub[0]?.sub[1]?.sub[0]?.sub[3]?.sub[3]?.stream.parseInteger(asn1.sub[0].sub[1].sub[0].sub[3].sub[3].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[3].header, asn1.sub[0].sub[1].sub[0].sub[3].sub[3].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[3].header + asn1.sub[0].sub[1].sub[0].sub[3].sub[3].length),\n },\n 'extDatas':extDatas,\n },\n 'signInfo':{\n 'cert':decodeCert(asn1.sub[0]?.sub[1]?.sub[1]?.sub[0]),\n 'signatureAlgorithm':asn1.sub[0]?.sub[1]?.sub[1]?.sub[1]?.stream.parseOID(asn1.sub[0].sub[1].sub[1].sub[1].stream.pos + asn1.sub[0].sub[1].sub[1].sub[1].header, asn1.sub[0].sub[1].sub[1].sub[1].stream.pos + asn1.sub[0].sub[1].sub[1].sub[1].header + asn1.sub[0].sub[1].sub[1].sub[1].length),\n 'signData':asn1.sub[0]?.sub[1]?.sub[1]?.sub[2]?.stream.hexDump(asn1.sub[0].sub[1].sub[1].sub[2].stream.pos + asn1.sub[0].sub[1].sub[1].sub[2].header, asn1.sub[0].sub[1].sub[1].sub[2].stream.pos + asn1.sub[0].sub[1].sub[1].sub[2].header + asn1.sub[0].sub[1].sub[1].sub[2].length, false)\n },\n\n },\n 'timeInfo':timeInfo,\n 'dataHash':asn1.sub[0]?.sub[3]?.stream.hexDump(asn1.sub[0].sub[3].stream.pos + asn1.sub[0].sub[3].header, asn1.sub[0].sub[3].stream.pos + asn1.sub[0].sub[3].header + asn1.sub[0].sub[3].length, false),\n 'propertyInfo':asn1.sub[0]?.sub[4]?.stream.parseStringUTF(asn1.sub[0].sub[4].stream.pos + asn1.sub[0].sub[4].header, asn1.sub[0].sub[4].stream.pos + asn1.sub[0].sub[4].header + asn1.sub[0].sub[4].length),\n 'cert':decodeCert(asn1.sub[0]?.sub[5]),\n 'signatureAlgorithm':asn1.sub[0]?.sub[6]?.stream.parseOID(asn1.sub[0].sub[6].stream.pos + asn1.sub[0].sub[6].header, asn1.sub[0].sub[6].stream.pos + asn1.sub[0].sub[6].header + asn1.sub[0].sub[6].length),\n },\n 'signature':asn1.sub[1]?.stream.hexDump(asn1.sub[1].stream.pos + asn1.sub[1].header, asn1.sub[1].stream.pos + asn1.sub[1].header + asn1.sub[1].length, false),\n };\n } catch (e) {\n try {\n //V4\n const certListType = asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[2]?.stream.parseInteger(asn1.sub[0].sub[1].sub[0].sub[2].sub[2].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[2].header, asn1.sub[0].sub[1].sub[0].sub[2].sub[2].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[2].header + asn1.sub[0].sub[1].sub[0].sub[2].sub[2].length);\n const asn1CertList = asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[3];\n let certList = new Array();\n if(asn1CertList){\n asn1CertList.sub.forEach(asn1Cert => {\n certList.push(asn1Cert.stream.parseOctetString(asn1Cert.stream.pos + asn1Cert.header, asn1Cert.stream.pos + asn1Cert.header+asn1Cert.length));\n });\n }\n const asn1ExtDatas = asn1.sub[0]?.sub[1]?.sub[0]?.sub[4];\n let extDatas = new Array();\n if(asn1ExtDatas){\n asn1ExtDatas.sub.forEach(asn1ExtData => {\n extDatas.push({\n 'extnID':asn1ExtData.sub[0]?.stream.parseOID(asn1ExtData.sub[0].stream.pos + asn1ExtData.sub[0].header, asn1ExtData.sub[0].stream.pos + asn1ExtData.sub[0].header+asn1ExtData.sub[0].length),\n 'critical':asn1ExtData.sub[1]?.stream.parseInteger(asn1ExtData.sub[1].stream.pos + asn1ExtData.sub[1].header, asn1ExtData.sub[1].stream.pos + asn1ExtData.sub[1].header+asn1ExtData.sub[1].length),\n 'extnValue':asn1ExtData.sub[2]?.stream.parseOctetString(asn1ExtData.sub[2].stream.pos + asn1ExtData.sub[2].header, asn1ExtData.sub[2].stream.pos + asn1ExtData.sub[2].header+asn1ExtData.sub[2].length),\n })\n });\n }\n SES_Signature =\n {\n 'realVersion':4,\n 'toSignDer':asn1.sub[0]?.stream.enc.subarray(asn1.sub[0].stream.pos,asn1.sub[0].stream.pos+asn1.sub[0].header+asn1.sub[0].length),\n 'toSign':{\n 'version':asn1.sub[0]?.sub[0]?.stream.parseInteger(asn1.sub[0].sub[0].stream.pos + asn1.sub[0].sub[0].header, asn1.sub[0].sub[0].stream.pos + asn1.sub[0].sub[0].header + asn1.sub[0].sub[0].length),\n 'eseal':{\n 'esealInfo':{\n 'header':{\n 'ID':asn1.sub[0]?.sub[1]?.sub[0]?.sub[0]?.sub[0]?.stream.parseStringUTF(asn1.sub[0].sub[1].sub[0].sub[0].sub[0].stream.pos + asn1.sub[0].sub[1].sub[0].sub[0].sub[0].header, asn1.sub[0].sub[1].sub[0].sub[0].sub[0].stream.pos + asn1.sub[0].sub[1].sub[0].sub[0].sub[0].header + asn1.sub[0].sub[1].sub[0].sub[0].sub[0].length),\n 'version':asn1.sub[0]?.sub[1]?.sub[0]?.sub[0]?.sub[1]?.stream.parseInteger(asn1.sub[0].sub[1].sub[0].sub[0].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[0].sub[1].header, asn1.sub[0].sub[1].sub[0].sub[0].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[0].sub[1].header + asn1.sub[0].sub[1].sub[0].sub[0].sub[1].length),\n 'Vid':asn1.sub[0]?.sub[1]?.sub[0]?.sub[0]?.sub[2]?.stream.parseStringUTF(asn1.sub[0].sub[1].sub[0].sub[0].sub[2].stream.pos + asn1.sub[0].sub[1].sub[0].sub[0].sub[2].header, asn1.sub[0].sub[1].sub[0].sub[0].sub[2].stream.pos + asn1.sub[0].sub[1].sub[0].sub[0].sub[2].header + asn1.sub[0].sub[1].sub[0].sub[0].sub[2].length),\n },\n 'esID':asn1.sub[0]?.sub[1]?.sub[0]?.sub[1]?.stream.parseStringUTF(asn1.sub[0].sub[1].sub[0].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[1].header, asn1.sub[0].sub[1].sub[0].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[1].header + asn1.sub[0].sub[1].sub[0].sub[1].length),\n 'property':{\n 'type':asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[0]?.stream.parseInteger(asn1.sub[0].sub[1].sub[0].sub[2].sub[0].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[0].header, asn1.sub[0].sub[1].sub[0].sub[2].sub[0].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[0].header + asn1.sub[0].sub[1].sub[0].sub[2].sub[0].length),\n 'name':asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[1]?.stream.parseStringUTF(asn1.sub[0].sub[1].sub[0].sub[2].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[1].header, asn1.sub[0].sub[1].sub[0].sub[2].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[1].header + asn1.sub[0].sub[1].sub[0].sub[2].sub[1].length),\n 'certListType':certListType,\n 'certList':certList,\n 'createDate':asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[4]?.stream.parseTime(asn1.sub[0].sub[1].sub[0].sub[2].sub[4].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[4].header, asn1.sub[0].sub[1].sub[0].sub[2].sub[4].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[4].header + asn1.sub[0].sub[1].sub[0].sub[2].sub[4].length),\n 'validStart':asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[5]?.stream.parseTime(asn1.sub[0].sub[1].sub[0].sub[2].sub[5].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[5].header, asn1.sub[0].sub[1].sub[0].sub[2].sub[5].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[5].header + asn1.sub[0].sub[1].sub[0].sub[2].sub[5].length),\n 'validEnd':asn1.sub[0]?.sub[1]?.sub[0]?.sub[2]?.sub[6]?.stream.parseTime(asn1.sub[0].sub[1].sub[0].sub[2].sub[6].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[6].header, asn1.sub[0].sub[1].sub[0].sub[2].sub[6].stream.pos + asn1.sub[0].sub[1].sub[0].sub[2].sub[6].header + asn1.sub[0].sub[1].sub[0].sub[2].sub[6].length),\n\n },\n 'picture':{\n 'type':asn1.sub[0]?.sub[1]?.sub[0]?.sub[3]?.sub[0]?.stream.parseStringUTF(asn1.sub[0].sub[1].sub[0].sub[3].sub[0].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[0].header, asn1.sub[0].sub[1].sub[0].sub[3].sub[0].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[0].header + asn1.sub[0].sub[1].sub[0].sub[3].sub[0].length),\n 'data': {'hex': asn1.sub[0]?.sub[1]?.sub[0]?.sub[3]?.sub[1]?.stream.parseOctetString(asn1.sub[0].sub[1].sub[0].sub[3].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[1].header, asn1.sub[0].sub[1].sub[0].sub[3].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[1].header + asn1.sub[0].sub[1].sub[0].sub[3].sub[1].length), byte: asn1.sub[0]?.sub[1]?.sub[0]?.sub[3]?.sub[1]?.stream.enc.subarray(asn1.sub[0].sub[1].sub[0].sub[3].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[1].header, asn1.sub[0].sub[1].sub[0].sub[3].sub[1].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[1].header + asn1.sub[0].sub[1].sub[0].sub[3].sub[1].length)},\n 'width':asn1.sub[0]?.sub[1]?.sub[0]?.sub[3]?.sub[2]?.stream.parseInteger(asn1.sub[0].sub[1].sub[0].sub[3].sub[2].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[2].header, asn1.sub[0].sub[1].sub[0].sub[3].sub[2].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[2].header + asn1.sub[0].sub[1].sub[0].sub[3].sub[2].length),\n 'height':asn1.sub[0]?.sub[1]?.sub[0]?.sub[3]?.sub[3]?.stream.parseInteger(asn1.sub[0].sub[1].sub[0].sub[3].sub[3].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[3].header, asn1.sub[0].sub[1].sub[0].sub[3].sub[3].stream.pos + asn1.sub[0].sub[1].sub[0].sub[3].sub[3].header + asn1.sub[0].sub[1].sub[0].sub[3].sub[3].length),\n },\n 'extDatas':extDatas,\n },\n 'cert':decodeCert(asn1.sub[0]?.sub[1]?.sub[1]),\n 'signAlgID':asn1.sub[0]?.sub[1]?.sub[2]?.stream.parseOID(asn1.sub[0].sub[1].sub[2].stream.pos + asn1.sub[0].sub[1].sub[2].header, asn1.sub[0].sub[1].sub[2].stream.pos + asn1.sub[0].sub[1].sub[2].header + asn1.sub[0].sub[1].sub[2].length),\n 'signedValue':asn1.sub[0]?.sub[1]?.sub[3]?.stream.hexDump(asn1.sub[0].sub[1].sub[3].stream.pos + asn1.sub[0].sub[1].sub[3].header, asn1.sub[0].sub[1].sub[3].stream.pos + asn1.sub[0].sub[1].sub[3].header + asn1.sub[0].sub[1].sub[3].length, false)\n },\n 'timeInfo':asn1.sub[0]?.sub[2]?.stream.parseTime(asn1.sub[0].sub[2].stream.pos + asn1.sub[0].sub[2].header, asn1.sub[0].sub[2].stream.pos + asn1.sub[0].sub[2].header + asn1.sub[0].sub[2].length, false),\n 'dataHash':asn1.sub[0]?.sub[3]?.stream.hexDump(asn1.sub[0].sub[3].stream.pos + asn1.sub[0].sub[3].header, asn1.sub[0].sub[3].stream.pos + asn1.sub[0].sub[3].header + asn1.sub[0].sub[3].length, false),\n 'propertyInfo':Uint8ArrayToString(asn1.sub[0].sub[4])\n },\n 'cert':decodeCert(asn1.sub[1]),\n 'signatureAlgID':asn1.sub[2]?.stream.parseOID(asn1.sub[2].stream.pos + asn1.sub[2].header, asn1.sub[2].stream.pos + asn1.sub[2].header + asn1.sub[2].length),\n 'signature':asn1.sub[3]?.stream.hexDump(asn1.sub[3].stream.pos + asn1.sub[3].header, asn1.sub[3].stream.pos + asn1.sub[3].header + asn1.sub[3].length, false),\n 'timpStamp':asn1.sub[4]?.stream.parseTime(asn1.sub[4].stream.pos + asn1.sub[4].header, asn1.sub[4].stream.pos + asn1.sub[4].header + asn1.sub[4].length)\n };\n } catch (e) {\n console.log(e);\n SES_Signature={};\n }\n }\n return SES_Signature;\n}\n\nconst decodeCert = function (asn1, offset) {\n offset = offset || 0;\n try {\n const asn1Subject = asn1.sub[0].sub[0].sub[5];\n let subject = new Map();\n asn1Subject.sub.forEach(element => {\n const key = element.sub[0].sub[0].content().split('\\n')[0];\n const value = element.sub[0].sub[1]?.stream.parseStringUTF(element.sub[0].sub[1].stream.pos + element.sub[0].sub[1].header, element.sub[0].sub[1].stream.pos + element.sub[0].sub[1].header + element.sub[0].sub[1].length);\n subject.set(key, value);\n });\n\n const asn1PublicKeyInfo = asn1.sub[0].sub[0].sub[6];\n return {\n subject,\n 'commonName':subject.get(\"2.5.4.3\"),\n 'subjectPublicKeyInfo':{\n 'algorithm':asn1PublicKeyInfo.sub[0]?.stream.parseOID(asn1PublicKeyInfo.sub[0].stream.pos+asn1PublicKeyInfo.sub[0].header,asn1PublicKeyInfo.sub[0].stream.pos+asn1PublicKeyInfo.sub[0].header+asn1PublicKeyInfo.sub[0].length),\n 'subjectPublicKey':asn1PublicKeyInfo.sub[1]?.stream.hexDump(asn1PublicKeyInfo.sub[1].stream.pos+asn1PublicKeyInfo.sub[1].header,asn1PublicKeyInfo.sub[1].stream.pos+asn1PublicKeyInfo.sub[1].header+asn1PublicKeyInfo.sub[1].length),\n }};\n } catch (e) {\n console.log(e)\n return {};\n }\n}\n\nconst Uint8ArrayToString = function (fileData) {\n let dataString = \"\";\n for (let i = 0; i < fileData.length; i++) {\n dataString += String.fromCharCode(fileData[i]);\n }\n return dataString\n}\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals process */\n\n// NW.js / Electron is a browser context, but copies some Node.js objects; see\n// http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context\n// https://www.electronjs.org/docs/api/process#processversionselectron-readonly\n// https://www.electronjs.org/docs/api/process#processtype-readonly\nconst isNodeJS =\n typeof process === \"object\" &&\n process + \"\" === \"[object process]\" &&\n !process.versions.nw &&\n !(process.versions.electron && process.type && process.type !== \"browser\");\n\nexport { isNodeJS };\n","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--6-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--6-oneOf-1-2!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ofd.vue?vue&type=style&index=0&id=df08fc1e&scoped=true&lang=css&\""],"sourceRoot":""}