vendor: 4,168 bytes, lines 1-100
1/** 2 * @licstart The following is the entire license notice for the 3 * Javascript code in this page 4 * 5 * Copyright 2018 Mozilla Foundation 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 * @licend The above is the entire license notice for the 20 * Javascript code in this page 21 */ 22 23(function webpackUniversalModuleDefinition(root, factory) { 24 if(typeof exports === 'object' && typeof module === 'object') 25 module.exports = factory(); 26 else if(typeof define === 'function' && define.amd) 27 define("pdfjs-dist/build/pdf.worker", [], factory); 28 else if(typeof exports === 'object') 29 exports["pdfjs-dist/build/pdf.worker"] = factory(); 30 else 31 root["pdfjs-dist/build/pdf.worker"] = root.pdfjsWorker = factory(); 32})(this, function() { 33return /******/ (function(modules) { // webpackBootstrap 34/******/ // The module cache 35/******/ var installedModules = {}; 36/******/ 37/******/ // The require function 38/******/ function __w_pdfjs_require__(moduleId) { 39/******/ 40/******/ // Check if module is in cache 41/******/ if(installedModules[moduleId]) { 42/******/ return installedModules[moduleId].exports; 43/******/ } 44/******/ // Create a new module (and put it into the cache) 45/******/ var module = installedModules[moduleId] = { 46/******/ i: moduleId, 47/******/ l: false, 48/******/ exports: {} 49/******/ }; 50/******/ 51/******/ // Execute the module function 52/******/ modules[moduleId].call(module.exports, module, module.exports, __w_pdfjs_require__); 53/******/ 54/******/ // Flag the module as loaded 55/******/ module.l = true; 56/******/ 57/******/ // Return the exports of the module 58/******/ return module.exports; 59/******/ } 60/******/ 61/******/ 62/******/ // expose the modules object (__webpack_modules__) 63/******/ __w_pdfjs_require__.m = modules; 64/******/ 65/******/ // expose the module cache 66/******/ __w_pdfjs_require__.c = installedModules; 67/******/ 68/******/ // define getter function for harmony exports 69/******/ __w_pdfjs_require__.d = function(exports, name, getter) { 70/******/ if(!__w_pdfjs_require__.o(exports, name)) { 71/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 72/******/ } 73/******/ }; 74/******/ 75/******/ // define __esModule on exports 76/******/ __w_pdfjs_require__.r = function(exports) { 77/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 78/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 79/******/ } 80/******/ Object.defineProperty(exports, '__esModule', { value: true }); 81/******/ }; 82/******/ 83/******/ // create a fake namespace object 84/******/ // mode & 1: value is a module id, require it 85/******/ // mode & 2: merge all properties of value into the ns 86/******/ // mode & 4: return value when already ns object 87/******/ // mode & 8|1: behave like require 88/******/ __w_pdfjs_require__.t = function(value, mode) { 89/******/ if(mode & 1) value = __w_pdfjs_require__(value); 90/******/ if(mode & 8) return value; 91/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 92/******/ var ns = Object.create(null); 93/******/ __w_pdfjs_require__.r(ns); 94/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 95/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __w_pdfjs_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 96/******/ return ns; 97/******/ }; 98/******/ 99/******/ // getDefaultExport function for compatibility with non-harmony modules 100/******/ __w_pdfjs_require__.n = function(module) {
101/******/ var getter = module && module.__esModule ? 102/******/ function getDefault() { return module['default']; } : 103/******/ function getModuleExports() { return module; }; 104/******/ __w_pdfjs_require__.d(getter, 'a', getter); 105/******/ return getter; 106/******/ }; 107/******/ 108/******/ // Object.prototype.hasOwnProperty.call 109/******/ __w_pdfjs_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 110/******/ 111/******/ // __webpack_public_path__ 112/******/ __w_pdfjs_require__.p = ""; 113/******/ 114/******/ 115/******/ // Load entry module and return exports 116/******/ return __w_pdfjs_require__(__w_pdfjs_require__.s = 0); 117/******/ }) 118/************************************************************************/ 119/******/ ([ 120/* 0 */ 121/***/ (function(module, exports, __w_pdfjs_require__) { 122 123"use strict"; 124 125 126var pdfjsVersion = '2.1.266'; 127var pdfjsBuild = '81f5835c'; 128 129var pdfjsCoreWorker = __w_pdfjs_require__(1); 130 131exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler; 132 133/***/ }), 134/* 1 */ 135/***/ (function(module, exports, __w_pdfjs_require__) { 136 137"use strict"; 138 139 140Object.defineProperty(exports, "__esModule", { 141 value: true 142}); 143exports.WorkerMessageHandler = exports.WorkerTask = void 0; 144 145var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2)); 146 147var _util = __w_pdfjs_require__(6); 148 149var _pdf_manager = __w_pdfjs_require__(151); 150 151var _is_node = _interopRequireDefault(__w_pdfjs_require__(9)); 152 153var _message_handler = __w_pdfjs_require__(189); 154 155var _primitives = __w_pdfjs_require__(155); 156 157function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 158 159function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 160 161function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } 162 163function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } 164 165function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } 166 167function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 168 169function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } 170 171function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } 172 173var WorkerTask = function WorkerTaskClosure() { 174 function WorkerTask(name) { 175 this.name = name; 176 this.terminated = false; 177 this._capability = (0, _util.createPromiseCapability)(); 178 } 179 180 WorkerTask.prototype = { 181 get finished() { 182 return this._capability.promise; 183 }, 184 185 finish: function finish() { 186 this._capability.resolve(); 187 }, 188 terminate: function terminate() { 189 this.terminated = true; 190 }, 191 ensureNotTerminated: function ensureNotTerminated() { 192 if (this.terminated) { 193 throw new Error('Worker task was terminated'); 194 } 195 } 196 }; 197 return WorkerTask; 198}(); 199 200exports.WorkerTask = WorkerTask; 201 202var PDFWorkerStream = function PDFWorkerStreamClosure() { 203 function PDFWorkerStream(msgHandler) { 204 this._msgHandler = msgHandler; 205 this._contentLength = null; 206 this._fullRequestReader = null; 207 this._rangeRequestReaders = []; 208 } 209 210 PDFWorkerStream.prototype = { 211 getFullReader: function getFullReader() { 212 (0, _util.assert)(!this._fullRequestReader); 213 this._fullRequestReader = new PDFWorkerStreamReader(this._msgHandler); 214 return this._fullRequestReader; 215 }, 216 getRangeReader: function getRangeReader(begin, end) { 217 var reader = new PDFWorkerStreamRangeReader(begin, end, this._msgHandler); 218 219 this._rangeRequestReaders.push(reader); 220 221 return reader; 222 }, 223 cancelAllRequests: function cancelAllRequests(reason) { 224 if (this._fullRequestReader) { 225 this._fullRequestReader.cancel(reason); 226 } 227 228 var readers = this._rangeRequestReaders.slice(0); 229
230 readers.forEach(function (reader) { 231 reader.cancel(reason); 232 }); 233 } 234 }; 235 236 function PDFWorkerStreamReader(msgHandler) { 237 var _this = this; 238 239 this._msgHandler = msgHandler; 240 this._contentLength = null; 241 this._isRangeSupported = false; 242 this._isStreamingSupported = false; 243 244 var readableStream = this._msgHandler.sendWithStream('GetReader'); 245 246 this._reader = readableStream.getReader(); 247 this._headersReady = this._msgHandler.sendWithPromise('ReaderHeadersReady').then(function (data) { 248 _this._isStreamingSupported = data.isStreamingSupported; 249 _this._isRangeSupported = data.isRangeSupported; 250 _this._contentLength = data.contentLength; 251 }); 252 } 253 254 PDFWorkerStreamReader.prototype = { 255 get headersReady() { 256 return this._headersReady; 257 }, 258 259 get contentLength() { 260 return this._contentLength; 261 }, 262 263 get isStreamingSupported() { 264 return this._isStreamingSupported; 265 }, 266 267 get isRangeSupported() { 268 return this._isRangeSupported; 269 }, 270 271 read: function read() { 272 return this._reader.read().then(function (_ref) { 273 var value = _ref.value, 274 done = _ref.done; 275 276 if (done) { 277 return { 278 value: undefined, 279 done: true 280 }; 281 } 282 283 return { 284 value: value.buffer, 285 done: false 286 }; 287 }); 288 }, 289 cancel: function cancel(reason) { 290 this._reader.cancel(reason); 291 } 292 }; 293 294 function PDFWorkerStreamRangeReader(begin, end, msgHandler) { 295 this._msgHandler = msgHandler; 296 this.onProgress = null; 297 298 var readableStream = this._msgHandler.sendWithStream('GetRangeReader', { 299 begin: begin, 300 end: end 301 }); 302 303 this._reader = readableStream.getReader(); 304 } 305 306 PDFWorkerStreamRangeReader.prototype = { 307 get isStreamingSupported() { 308 return false; 309 }, 310 311 read: function read() { 312 return this._reader.read().then(function (_ref2) { 313 var value = _ref2.value, 314 done = _ref2.done; 315 316 if (done) { 317 return { 318 value: undefined, 319 done: true 320 }; 321 } 322 323 return { 324 value: value.buffer, 325 done: false 326 }; 327 }); 328 }, 329 cancel: function cancel(reason) { 330 this._reader.cancel(reason); 331 } 332 }; 333 return PDFWorkerStream; 334}(); 335 336var WorkerMessageHandler = { 337 setup: function setup(handler, port) { 338 var testMessageProcessed = false; 339 handler.on('test', function wphSetupTest(data) { 340 if (testMessageProcessed) { 341 return; 342 } 343 344 testMessageProcessed = true; 345 346 if (!(data instanceof Uint8Array)) { 347 handler.send('test', false); 348 return; 349 } 350 351 var supportTransfers = data[0] === 255; 352 handler.postMessageTransfers = supportTransfers; 353 var xhr = new XMLHttpRequest(); 354 var responseExists = 'response' in xhr; 355 356 try { 357 xhr.responseType; 358 } catch (e) { 359 responseExists = false; 360 } 361 362 if (!responseExists) { 363 handler.send('test', false); 364 return; 365 } 366 367 handler.send('test', { 368 supportTypedArray: true, 369 supportTransfers: supportTransfers 370 }); 371 }); 372 handler.on('configure', function wphConfigure(data) { 373 (0, _util.setVerbosityLevel)(data.verbosity); 374 }); 375 handler.on('GetDocRequest', function wphSetupDoc(data) { 376 return WorkerMessageHandler.createDocumentHandler(data, port); 377 }); 378 }, 379 createDocumentHandler: function createDocumentHandler(docParams, port) { 380 var pdfManager; 381 var terminated = false; 382 var cancelXHRs = null; 383 var WorkerTasks = []; 384 var apiVersion = docParams.apiVersion; 385 var workerVersion = '2.1.266'; 386 387 if (apiVersion !== workerVersion) { 388 throw new Error("The API version \"".concat(apiVersion, "\" does not match ") + "the Worker version \"".concat(workerVersion, "\".")); 389 } 390 391 var docId = docParams.docId; 392 var docBaseUrl = docParams.docBaseUrl; 393 var workerHandlerName = docParams.docId + '_worker'; 394 var handler = new _message_handler.MessageHandler(workerHandlerName, docId, port); 395 handler.postMessageTransfers = docParams.postMessageTransfers; 396 397 function ensureNotTerminated() { 398 if (terminated) { 399 throw new Error('Worker was terminated'); 400 } 401 } 402 403 function startWorkerTask(task) { 404 WorkerTasks.push(task); 405 } 406 407 function finishWorkerTask(task) { 408 task.finish(); 409 var i = WorkerTasks.indexOf(task); 410 WorkerTasks.splice(i, 1); 411 } 412 413 function loadDocument(_x) { 414 return _loadDocument.apply(this, arguments); 415 } 416 417 function _loadDocument() { 418 _loadDocument = _asyncToGenerator( 419 /*#__PURE__*/ 420 _regenerator.default.mark(function _callee(recoveryMode) { 421 var _ref6, _ref7, numPages, fingerprint; 422 423 return _regenerator.default.wrap(function _callee$(_context) { 424 while (1) { 425 switch (_context.prev = _context.next) { 426 case 0: 427 _context.next = 2; 428 return pdfManager.ensureDoc('checkHeader'); 429 430 case 2: 431 _context.next = 4; 432 return pdfManager.ensureDoc('parseStartXRef'); 433 434 case 4: 435 _context.next = 6; 436 return pdfManager.ensureDoc('parse', [recoveryMode]); 437 438 case 6: 439 if (recoveryMode) { 440 _context.next = 9; 441 break; 442 } 443 444 _context.next = 9; 445 return pdfManager.ensureDoc('checkFirstPage'); 446 447 case 9: 448 _context.next = 11; 449 return Promise.all([pdfManager.ensureDoc('numPages'), pdfManager.ensureDoc('fingerprint')]); 450 451 case 11: 452 _ref6 = _context.sent; 453 _ref7 = _slicedToArray(_ref6, 2); 454 numPages = _ref7[0]; 455 fingerprint = _ref7[1]; 456 return _context.abrupt("return", { 457 numPages: numPages, 458 fingerprint: fingerprint 459 }); 460 461 case 16: 462 case "end": 463 return _context.stop(); 464 } 465 } 466 }, _callee, this); 467 })); 468 return _loadDocument.apply(this, arguments); 469 } 470 471 function getPdfManager(data, evaluatorOptions) { 472 var pdfManagerCapability = (0, _util.createPromiseCapability)(); 473 var pdfManager; 474 var source = data.source; 475 476 if (source.data) { 477 try { 478 pdfManager = new _pdf_manager.LocalPdfManager(docId, source.data, source.password, evaluatorOptions, docBaseUrl); 479 pdfManagerCapability.resolve(pdfManager); 480 } catch (ex) { 481 pdfManagerCapability.reject(ex); 482 } 483 484 return pdfManagerCapability.promise; 485 } 486 487 var pdfStream, 488 cachedChunks = []; 489
490 try { 491 pdfStream = new PDFWorkerStream(handler); 492 } catch (ex) { 493 pdfManagerCapability.reject(ex); 494 return pdfManagerCapability.promise; 495 } 496 497 var fullRequest = pdfStream.getFullReader(); 498 fullRequest.headersReady.then(function () { 499 if (!fullRequest.isRangeSupported) { 500 return; 501 } 502 503 var disableAutoFetch = source.disableAutoFetch || fullRequest.isStreamingSupported; 504 pdfManager = new _pdf_manager.NetworkPdfManager(docId, pdfStream, { 505 msgHandler: handler, 506 password: source.password, 507 length: fullRequest.contentLength, 508 disableAutoFetch: disableAutoFetch, 509 rangeChunkSize: source.rangeChunkSize 510 }, evaluatorOptions, docBaseUrl); 511 512 for (var i = 0; i < cachedChunks.length; i++) { 513 pdfManager.sendProgressiveData(cachedChunks[i]); 514 } 515 516 cachedChunks = []; 517 pdfManagerCapability.resolve(pdfManager); 518 cancelXHRs = null; 519 }).catch(function (reason) { 520 pdfManagerCapability.reject(reason); 521 cancelXHRs = null; 522 }); 523 var loaded = 0; 524 525 var flushChunks = function flushChunks() { 526 var pdfFile = (0, _util.arraysToBytes)(cachedChunks); 527 528 if (source.length && pdfFile.length !== source.length) { 529 (0, _util.warn)('reported HTTP length is different from actual'); 530 } 531 532 try { 533 pdfManager = new _pdf_manager.LocalPdfManager(docId, pdfFile, source.password, evaluatorOptions, docBaseUrl); 534 pdfManagerCapability.resolve(pdfManager); 535 } catch (ex) { 536 pdfManagerCapability.reject(ex); 537 } 538 539 cachedChunks = []; 540 }; 541 542 var readPromise = new Promise(function (resolve, reject) { 543 var readChunk = function readChunk(chunk) { 544 try { 545 ensureNotTerminated(); 546 547 if (chunk.done) { 548 if (!pdfManager) { 549 flushChunks(); 550 } 551 552 cancelXHRs = null; 553 return; 554 } 555 556 var data = chunk.value; 557 loaded += (0, _util.arrayByteLength)(data); 558 559 if (!fullRequest.isStreamingSupported) { 560 handler.send('DocProgress', { 561 loaded: loaded, 562 total: Math.max(loaded, fullRequest.contentLength || 0) 563 }); 564 } 565 566 if (pdfManager) { 567 pdfManager.sendProgressiveData(data); 568 } else { 569 cachedChunks.push(data); 570 } 571 572 fullRequest.read().then(readChunk, reject); 573 } catch (e) { 574 reject(e); 575 } 576 }; 577 578 fullRequest.read().then(readChunk, reject); 579 }); 580 readPromise.catch(function (e) { 581 pdfManagerCapability.reject(e); 582 cancelXHRs = null; 583 }); 584 585 cancelXHRs = function cancelXHRs() { 586 pdfStream.cancelAllRequests('abort'); 587 }; 588 589 return pdfManagerCapability.promise; 590 } 591 592 function setupDoc(data) { 593 function onSuccess(doc) { 594 ensureNotTerminated(); 595 handler.send('GetDoc', { 596 pdfInfo: doc 597 }); 598 } 599 600 function onFailure(e) { 601 ensureNotTerminated(); 602 603 if (e instanceof _util.PasswordException) { 604 var task = new WorkerTask('PasswordException: response ' + e.code); 605 startWorkerTask(task); 606 handler.sendWithPromise('PasswordRequest', e).then(function (data) { 607 finishWorkerTask(task); 608 pdfManager.updatePassword(data.password); 609 pdfManagerReady(); 610 }).catch(function (boundException) { 611 finishWorkerTask(task); 612 handler.send('PasswordException', boundException); 613 }.bind(null, e)); 614 } else if (e instanceof _util.InvalidPDFException) { 615 handler.send('InvalidPDF', e); 616 } else if (e instanceof _util.MissingPDFException) { 617 handler.send('MissingPDF', e); 618 } else if (e instanceof _util.UnexpectedResponseException) { 619 handler.send('UnexpectedResponse', e); 620 } else { 621 handler.send('UnknownError', new _util.UnknownErrorException(e.message, e.toString())); 622 } 623 } 624 625 function pdfManagerReady() { 626 ensureNotTerminated(); 627 loadDocument(false).then(onSuccess, function loadFailure(ex) { 628 ensureNotTerminated(); 629 630 if (!(ex instanceof _util.XRefParseException)) { 631 onFailure(ex); 632 return; 633 } 634 635 pdfManager.requestLoadedStream(); 636 pdfManager.onLoadedStream().then(function () { 637 ensureNotTerminated();
638 loadDocument(true).then(onSuccess, onFailure); 639 }); 640 }, onFailure); 641 } 642 643 ensureNotTerminated(); 644 var evaluatorOptions = { 645 forceDataSchema: data.disableCreateObjectURL, 646 maxImageSize: data.maxImageSize, 647 disableFontFace: data.disableFontFace, 648 nativeImageDecoderSupport: data.nativeImageDecoderSupport, 649 ignoreErrors: data.ignoreErrors, 650 isEvalSupported: data.isEvalSupported 651 }; 652 getPdfManager(data, evaluatorOptions).then(function (newPdfManager) { 653 if (terminated) { 654 newPdfManager.terminate(); 655 throw new Error('Worker was terminated'); 656 } 657 658 pdfManager = newPdfManager; 659 pdfManager.onLoadedStream().then(function (stream) { 660 handler.send('DataLoaded', { 661 length: stream.bytes.byteLength 662 }); 663 }); 664 }).then(pdfManagerReady, onFailure); 665 } 666 667 handler.on('GetPage', function wphSetupGetPage(data) { 668 return pdfManager.getPage(data.pageIndex).then(function (page) { 669 return Promise.all([pdfManager.ensure(page, 'rotate'), pdfManager.ensure(page, 'ref'), pdfManager.ensure(page, 'userUnit'), pdfManager.ensure(page, 'view')]).then(function (_ref3) { 670 var _ref4 = _slicedToArray(_ref3, 4), 671 rotate = _ref4[0], 672 ref = _ref4[1], 673 userUnit = _ref4[2], 674 view = _ref4[3]; 675 676 return { 677 rotate: rotate, 678 ref: ref, 679 userUnit: userUnit, 680 view: view 681 }; 682 }); 683 }); 684 }); 685 handler.on('GetPageIndex', function wphSetupGetPageIndex(data) { 686 var ref = new _primitives.Ref(data.ref.num, data.ref.gen); 687 var catalog = pdfManager.pdfDocument.catalog; 688 return catalog.getPageIndex(ref); 689 }); 690 handler.on('GetDestinations', function wphSetupGetDestinations(data) { 691 return pdfManager.ensureCatalog('destinations'); 692 }); 693 handler.on('GetDestination', function wphSetupGetDestination(data) { 694 return pdfManager.ensureCatalog('getDestination', [data.id]); 695 }); 696 handler.on('GetPageLabels', function wphSetupGetPageLabels(data) { 697 return pdfManager.ensureCatalog('pageLabels'); 698 }); 699 handler.on('GetPageMode', function wphSetupGetPageMode(data) { 700 return pdfManager.ensureCatalog('pageMode'); 701 }); 702 handler.on('getOpenActionDestination', function (data) { 703 return pdfManager.ensureCatalog('openActionDestination'); 704 }); 705 handler.on('GetAttachments', function wphSetupGetAttachments(data) { 706 return pdfManager.ensureCatalog('attachments'); 707 }); 708 handler.on('GetJavaScript', function wphSetupGetJavaScript(data) { 709 return pdfManager.ensureCatalog('javaScript'); 710 }); 711 handler.on('GetOutline', function wphSetupGetOutline(data) { 712 return pdfManager.ensureCatalog('documentOutline'); 713 }); 714 handler.on('GetPermissions', function (data) { 715 return pdfManager.ensureCatalog('permissions'); 716 }); 717 handler.on('GetMetadata', function wphSetupGetMetadata(data) { 718 return Promise.all([pdfManager.ensureDoc('documentInfo'), pdfManager.ensureCatalog('metadata')]); 719 }); 720 handler.on('GetData', function wphSetupGetData(data) { 721 pdfManager.requestLoadedStream(); 722 return pdfManager.onLoadedStream().then(function (stream) { 723 return stream.bytes; 724 }); 725 }); 726 handler.on('GetStats', function wphSetupGetStats(data) { 727 return pdfManager.pdfDocument.xref.stats; 728 }); 729 handler.on('GetAnnotations', function (_ref5) { 730 var pageIndex = _ref5.pageIndex, 731 intent = _ref5.intent; 732 return pdfManager.getPage(pageIndex).then(function (page) { 733 return page.getAnnotationsData(intent); 734 }); 735 }); 736 handler.on('RenderPageRequest', function wphSetupRenderPage(data) { 737 var pageIndex = data.pageIndex; 738 pdfManager.getPage(pageIndex).then(function (page) { 739 var task = new WorkerTask('RenderPageRequest: page ' + pageIndex); 740 startWorkerTask(task); 741 var pageNum = pageIndex + 1; 742 var start = Date.now(); 743 page.getOperatorList({ 744 handler: handler, 745 task: task, 746 intent: data.intent, 747 renderInteractiveForms: data.renderInteractiveForms 748 }).then(function (operatorList) { 749 finishWorkerTask(task); 750 (0, _util.info)('page=' + pageNum + ' - getOperatorList: time=' + (Date.now() - start) + 'ms, len=' + operatorList.totalLength); 751 }, function (e) { 752 finishWorkerTask(task); 753 754 if (task.terminated) { 755 return; 756 } 757 758 handler.send('UnsupportedFeature', { 759 featureId: _util.UNSUPPORTED_FEATURES.unknown 760 }); 761 var minimumStackMessage = 'worker.js: while trying to getPage() and getOperatorList()'; 762 var wrappedException; 763 764 if (typeof e === 'string') { 765 wrappedException = { 766 message: e, 767 stack: minimumStackMessage 768 }; 769 } else if (_typeof(e) === 'object') { 770 wrappedException = { 771 message: e.message || e.toString(), 772 stack: e.stack || minimumStackMessage 773 }; 774 } else { 775 wrappedException = { 776 message: 'Unknown exception type: ' + _typeof(e), 777 stack: minimumStackMessage 778 }; 779 } 780 781 handler.send('PageError', { 782 pageNum: pageNum, 783 error: wrappedException, 784 intent: data.intent 785 }); 786 }); 787 }); 788 }, this); 789 handler.on('GetTextContent', function wphExtractText(data, sink) { 790 var pageIndex = data.pageIndex; 791 792 sink.onPull = function (desiredSize) {}; 793 794 sink.onCancel = function (reason) {}; 795 796 pdfManager.getPage(pageIndex).then(function (page) { 797 var task = new WorkerTask('GetTextContent: page ' + pageIndex); 798 startWorkerTask(task); 799 var pageNum = pageIndex + 1; 800 var start = Date.now(); 801 page.extractTextContent({ 802 handler: handler, 803 task: task, 804 sink: sink, 805 normalizeWhitespace: data.normalizeWhitespace, 806 combineTextItems: data.combineTextItems 807 }).then(function () { 808 finishWorkerTask(task); 809 (0, _util.info)('text indexing: page=' + pageNum + ' - time=' + (Date.now() - start) + 'ms'); 810 sink.close(); 811 }, function (reason) { 812 finishWorkerTask(task); 813 814 if (task.terminated) { 815 return; 816 } 817 818 sink.error(reason); 819 throw reason; 820 }); 821 }); 822 });
823 handler.on('FontFallback', function (data) { 824 return pdfManager.fontFallback(data.id, handler); 825 }); 826 handler.on('Cleanup', function wphCleanup(data) { 827 return pdfManager.cleanup(); 828 }); 829 handler.on('Terminate', function wphTerminate(data) { 830 terminated = true; 831 832 if (pdfManager) { 833 pdfManager.terminate(); 834 pdfManager = null; 835 } 836 837 if (cancelXHRs) { 838 cancelXHRs(); 839 } 840 841 var waitOn = []; 842 WorkerTasks.forEach(function (task) { 843 waitOn.push(task.finished); 844 task.terminate(); 845 }); 846 return Promise.all(waitOn).then(function () { 847 handler.destroy(); 848 handler = null; 849 }); 850 }); 851 handler.on('Ready', function wphReady(data) { 852 setupDoc(docParams); 853 docParams = null; 854 }); 855 return workerHandlerName; 856 }, 857 initializeFromPort: function initializeFromPort(port) { 858 var handler = new _message_handler.MessageHandler('worker', 'main', port); 859 WorkerMessageHandler.setup(handler, port); 860 handler.send('ready', null); 861 } 862}; 863exports.WorkerMessageHandler = WorkerMessageHandler; 864 865function isMessagePort(maybePort) { 866 return typeof maybePort.postMessage === 'function' && 'onmessage' in maybePort; 867} 868 869if (typeof window === 'undefined' && !(0, _is_node.default)() && typeof self !== 'undefined' && isMessagePort(self)) { 870 WorkerMessageHandler.initializeFromPort(self); 871} 872 873/***/ }), 874/* 2 */ 875/***/ (function(module, exports, __w_pdfjs_require__) { 876 877"use strict"; 878 879 880module.exports = __w_pdfjs_require__(3); 881 882/***/ }), 883/* 3 */ 884/***/ (function(module, exports, __w_pdfjs_require__) { 885 886"use strict"; 887 888 889function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 890 891var g = function () { 892 return this || (typeof self === "undefined" ? "undefined" : _typeof(self)) === "object" && self; 893}() || Function("return this")(); 894 895var hadRuntime = g.regeneratorRuntime && Object.getOwnPropertyNames(g).indexOf("regeneratorRuntime") >= 0; 896var oldRuntime = hadRuntime && g.regeneratorRuntime; 897g.regeneratorRuntime = undefined; 898module.exports = __w_pdfjs_require__(4); 899 900if (hadRuntime) { 901 g.regeneratorRuntime = oldRuntime; 902} else { 903 try { 904 delete g.regeneratorRuntime; 905 } catch (e) { 906 g.regeneratorRuntime = undefined; 907 } 908} 909 910/***/ }), 911/* 4 */ 912/***/ (function(module, exports, __w_pdfjs_require__) { 913 914"use strict"; 915/* WEBPACK VAR INJECTION */(function(module) { 916 917function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 918 919!function (global) { 920 "use strict"; 921 922 var Op = Object.prototype; 923 var hasOwn = Op.hasOwnProperty; 924 var undefined; 925 var $Symbol = typeof Symbol === "function" ? Symbol : {}; 926 var iteratorSymbol = $Symbol.iterator || "@@iterator"; 927 var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; 928 var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; 929 var inModule = ( false ? undefined : _typeof(module)) === "object"; 930 var runtime = global.regeneratorRuntime; 931 932 if (runtime) { 933 if (inModule) { 934 module.exports = runtime; 935 } 936 937 return; 938 } 939 940 runtime = global.regeneratorRuntime = inModule ? module.exports : {}; 941 942 function wrap(innerFn, outerFn, self, tryLocsList) { 943 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; 944 var generator = Object.create(protoGenerator.prototype); 945 var context = new Context(tryLocsList || []); 946 generator._invoke = makeInvokeMethod(innerFn, self, context); 947 return generator; 948 } 949 950 runtime.wrap = wrap; 951 952 function tryCatch(fn, obj, arg) { 953 try { 954 return { 955 type: "normal", 956 arg: fn.call(obj, arg) 957 }; 958 } catch (err) { 959 return { 960 type: "throw", 961 arg: err 962 }; 963 } 964 } 965 966 var GenStateSuspendedStart = "suspendedStart"; 967 var GenStateSuspendedYield = "suspendedYield"; 968 var GenStateExecuting = "executing"; 969 var GenStateCompleted = "completed"; 970 var ContinueSentinel = {}; 971 972 function Generator() {} 973 974 function GeneratorFunction() {} 975 976 function GeneratorFunctionPrototype() {} 977 978 var IteratorPrototype = {}; 979 980 IteratorPrototype[iteratorSymbol] = function () { 981 return this; 982 }; 983 984 var getProto = Object.getPrototypeOf; 985 var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); 986 987 if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { 988 IteratorPrototype = NativeIteratorPrototype; 989 } 990 991 var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); 992 GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; 993 GeneratorFunctionPrototype.constructor = GeneratorFunction; 994 GeneratorFunctionPrototype[toStringTagSymbol] = GeneratorFunction.displayName = "GeneratorFunction"; 995 996 function defineIteratorMethods(prototype) { 997 ["next", "throw", "return"].forEach(function (method) { 998 prototype[method] = function (arg) { 999 return this._invoke(method, arg); 1000 }; 1001 });
vendor: 6,147 bytes, lines 1002-1223
1002 } 1003 1004 runtime.isGeneratorFunction = function (genFun) { 1005 var ctor = typeof genFun === "function" && genFun.constructor; 1006 return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false; 1007 }; 1008 1009 runtime.mark = function (genFun) { 1010 if (Object.setPrototypeOf) { 1011 Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); 1012 } else { 1013 genFun.__proto__ = GeneratorFunctionPrototype; 1014 1015 if (!(toStringTagSymbol in genFun)) { 1016 genFun[toStringTagSymbol] = "GeneratorFunction"; 1017 } 1018 } 1019 1020 genFun.prototype = Object.create(Gp); 1021 return genFun; 1022 }; 1023 1024 runtime.awrap = function (arg) { 1025 return { 1026 __await: arg 1027 }; 1028 }; 1029 1030 function AsyncIterator(generator) { 1031 function invoke(method, arg, resolve, reject) { 1032 var record = tryCatch(generator[method], generator, arg); 1033 1034 if (record.type === "throw") { 1035 reject(record.arg); 1036 } else { 1037 var result = record.arg; 1038 var value = result.value; 1039 1040 if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) { 1041 return Promise.resolve(value.__await).then(function (value) { 1042 invoke("next", value, resolve, reject); 1043 }, function (err) { 1044 invoke("throw", err, resolve, reject); 1045 }); 1046 } 1047 1048 return Promise.resolve(value).then(function (unwrapped) { 1049 result.value = unwrapped; 1050 resolve(result); 1051 }, function (error) { 1052 return invoke("throw", error, resolve, reject); 1053 }); 1054 } 1055 } 1056 1057 var previousPromise; 1058 1059 function enqueue(method, arg) { 1060 function callInvokeWithMethodAndArg() { 1061 return new Promise(function (resolve, reject) { 1062 invoke(method, arg, resolve, reject); 1063 }); 1064 } 1065 1066 return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); 1067 } 1068 1069 this._invoke = enqueue; 1070 } 1071 1072 defineIteratorMethods(AsyncIterator.prototype); 1073 1074 AsyncIterator.prototype[asyncIteratorSymbol] = function () { 1075 return this; 1076 }; 1077 1078 runtime.AsyncIterator = AsyncIterator; 1079 1080 runtime.async = function (innerFn, outerFn, self, tryLocsList) { 1081 var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList)); 1082 return runtime.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { 1083 return result.done ? result.value : iter.next(); 1084 }); 1085 }; 1086 1087 function makeInvokeMethod(innerFn, self, context) { 1088 var state = GenStateSuspendedStart; 1089 return function invoke(method, arg) { 1090 if (state === GenStateExecuting) { 1091 throw new Error("Generator is already running"); 1092 } 1093 1094 if (state === GenStateCompleted) { 1095 if (method === "throw") { 1096 throw arg; 1097 } 1098 1099 return doneResult(); 1100 } 1101 1102 context.method = method; 1103 context.arg = arg; 1104 1105 while (true) { 1106 var delegate = context.delegate; 1107 1108 if (delegate) { 1109 var delegateResult = maybeInvokeDelegate(delegate, context); 1110 1111 if (delegateResult) { 1112 if (delegateResult === ContinueSentinel) continue; 1113 return delegateResult; 1114 } 1115 } 1116 1117 if (context.method === "next") { 1118 context.sent = context._sent = context.arg; 1119 } else if (context.method === "throw") { 1120 if (state === GenStateSuspendedStart) { 1121 state = GenStateCompleted; 1122 throw context.arg; 1123 } 1124 1125 context.dispatchException(context.arg); 1126 } else if (context.method === "return") { 1127 context.abrupt("return", context.arg); 1128 } 1129 1130 state = GenStateExecuting; 1131 var record = tryCatch(innerFn, self, context); 1132 1133 if (record.type === "normal") { 1134 state = context.done ? GenStateCompleted : GenStateSuspendedYield; 1135 1136 if (record.arg === ContinueSentinel) { 1137 continue; 1138 } 1139 1140 return { 1141 value: record.arg, 1142 done: context.done 1143 }; 1144 } else if (record.type === "throw") { 1145 state = GenStateCompleted; 1146 context.method = "throw"; 1147 context.arg = record.arg; 1148 } 1149 } 1150 }; 1151 } 1152 1153 function maybeInvokeDelegate(delegate, context) { 1154 var method = delegate.iterator[context.method]; 1155 1156 if (method === undefined) { 1157 context.delegate = null; 1158 1159 if (context.method === "throw") { 1160 if (delegate.iterator.return) { 1161 context.method = "return"; 1162 context.arg = undefined; 1163 maybeInvokeDelegate(delegate, context); 1164 1165 if (context.method === "throw") { 1166 return ContinueSentinel; 1167 } 1168 } 1169 1170 context.method = "throw"; 1171 context.arg = new TypeError("The iterator does not provide a 'throw' method"); 1172 } 1173 1174 return ContinueSentinel; 1175 } 1176 1177 var record = tryCatch(method, delegate.iterator, context.arg); 1178 1179 if (record.type === "throw") { 1180 context.method = "throw"; 1181 context.arg = record.arg; 1182 context.delegate = null; 1183 return ContinueSentinel; 1184 } 1185 1186 var info = record.arg; 1187 1188 if (!info) { 1189 context.method = "throw"; 1190 context.arg = new TypeError("iterator result is not an object"); 1191 context.delegate = null; 1192 return ContinueSentinel; 1193 } 1194 1195 if (info.done) { 1196 context[delegate.resultName] = info.value; 1197 context.next = delegate.nextLoc; 1198 1199 if (context.method !== "return") { 1200 context.method = "next"; 1201 context.arg = undefined; 1202 } 1203 } else { 1204 return info; 1205 } 1206 1207 context.delegate = null; 1208 return ContinueSentinel; 1209 } 1210 1211 defineIteratorMethods(Gp); 1212 Gp[toStringTagSymbol] = "Generator"; 1213 1214 Gp[iteratorSymbol] = function () { 1215 return this; 1216 }; 1217 1218 Gp.toString = function () { 1219 return "[object Generator]"; 1220 }; 1221 1222 function pushTryEntry(locs) { 1223 var entry = {
vendor: 4,447 bytes, lines 1224-1409
1224 tryLoc: locs[0] 1225 }; 1226 1227 if (1 in locs) { 1228 entry.catchLoc = locs[1]; 1229 } 1230 1231 if (2 in locs) { 1232 entry.finallyLoc = locs[2]; 1233 entry.afterLoc = locs[3]; 1234 } 1235 1236 this.tryEntries.push(entry); 1237 } 1238 1239 function resetTryEntry(entry) { 1240 var record = entry.completion || {}; 1241 record.type = "normal"; 1242 delete record.arg; 1243 entry.completion = record; 1244 } 1245 1246 function Context(tryLocsList) { 1247 this.tryEntries = [{ 1248 tryLoc: "root" 1249 }]; 1250 tryLocsList.forEach(pushTryEntry, this); 1251 this.reset(true); 1252 } 1253 1254 runtime.keys = function (object) { 1255 var keys = []; 1256 1257 for (var key in object) { 1258 keys.push(key); 1259 } 1260 1261 keys.reverse(); 1262 return function next() { 1263 while (keys.length) { 1264 var key = keys.pop(); 1265 1266 if (key in object) { 1267 next.value = key; 1268 next.done = false; 1269 return next; 1270 } 1271 } 1272 1273 next.done = true; 1274 return next; 1275 }; 1276 }; 1277 1278 function values(iterable) { 1279 if (iterable) { 1280 var iteratorMethod = iterable[iteratorSymbol]; 1281 1282 if (iteratorMethod) { 1283 return iteratorMethod.call(iterable); 1284 } 1285 1286 if (typeof iterable.next === "function") { 1287 return iterable; 1288 } 1289 1290 if (!isNaN(iterable.length)) { 1291 var i = -1, 1292 next = function next() { 1293 while (++i < iterable.length) { 1294 if (hasOwn.call(iterable, i)) { 1295 next.value = iterable[i]; 1296 next.done = false; 1297 return next; 1298 } 1299 } 1300 1301 next.value = undefined; 1302 next.done = true; 1303 return next; 1304 }; 1305 1306 return next.next = next; 1307 } 1308 } 1309 1310 return { 1311 next: doneResult 1312 }; 1313 } 1314 1315 runtime.values = values; 1316 1317 function doneResult() { 1318 return { 1319 value: undefined, 1320 done: true 1321 }; 1322 } 1323 1324 Context.prototype = { 1325 constructor: Context, 1326 reset: function reset(skipTempReset) { 1327 this.prev = 0; 1328 this.next = 0; 1329 this.sent = this._sent = undefined; 1330 this.done = false; 1331 this.delegate = null; 1332 this.method = "next"; 1333 this.arg = undefined; 1334 this.tryEntries.forEach(resetTryEntry); 1335 1336 if (!skipTempReset) { 1337 for (var name in this) { 1338 if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { 1339 this[name] = undefined; 1340 } 1341 } 1342 } 1343 }, 1344 stop: function stop() { 1345 this.done = true; 1346 var rootEntry = this.tryEntries[0]; 1347 var rootRecord = rootEntry.completion; 1348 1349 if (rootRecord.type === "throw") { 1350 throw rootRecord.arg; 1351 } 1352 1353 return this.rval; 1354 }, 1355 dispatchException: function dispatchException(exception) { 1356 if (this.done) { 1357 throw exception; 1358 } 1359 1360 var context = this; 1361 1362 function handle(loc, caught) { 1363 record.type = "throw"; 1364 record.arg = exception; 1365 context.next = loc; 1366 1367 if (caught) { 1368 context.method = "next"; 1369 context.arg = undefined; 1370 } 1371 1372 return !!caught; 1373 } 1374 1375 for (var i = this.tryEntries.length - 1; i >= 0; --i) { 1376 var entry = this.tryEntries[i]; 1377 var record = entry.completion; 1378 1379 if (entry.tryLoc === "root") { 1380 return handle("end"); 1381 } 1382 1383 if (entry.tryLoc <= this.prev) { 1384 var hasCatch = hasOwn.call(entry, "catchLoc"); 1385 var hasFinally = hasOwn.call(entry, "finallyLoc"); 1386 1387 if (hasCatch && hasFinally) { 1388 if (this.prev < entry.catchLoc) { 1389 return handle(entry.catchLoc, true); 1390 } else if (this.prev < entry.finallyLoc) { 1391 return handle(entry.finallyLoc); 1392 } 1393 } else if (hasCatch) { 1394 if (this.prev < entry.catchLoc) { 1395 return handle(entry.catchLoc, true); 1396 } 1397 } else if (hasFinally) { 1398 if (this.prev < entry.finallyLoc) { 1399 return handle(entry.finallyLoc); 1400 } 1401 } else { 1402 throw new Error("try statement without catch or finally"); 1403 } 1404 } 1405 } 1406 }, 1407 abrupt: function abrupt(type, arg) { 1408 for (var i = this.tryEntries.length - 1; i >= 0; --i) { 1409 var entry = this.tryEntries[i];
vendor: 5,544 bytes, lines 1410-1586
1410 1411 if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { 1412 var finallyEntry = entry; 1413 break; 1414 } 1415 } 1416 1417 if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { 1418 finallyEntry = null; 1419 } 1420 1421 var record = finallyEntry ? finallyEntry.completion : {}; 1422 record.type = type; 1423 record.arg = arg; 1424 1425 if (finallyEntry) { 1426 this.method = "next"; 1427 this.next = finallyEntry.finallyLoc; 1428 return ContinueSentinel; 1429 } 1430 1431 return this.complete(record); 1432 }, 1433 complete: function complete(record, afterLoc) { 1434 if (record.type === "throw") { 1435 throw record.arg; 1436 } 1437 1438 if (record.type === "break" || record.type === "continue") { 1439 this.next = record.arg; 1440 } else if (record.type === "return") { 1441 this.rval = this.arg = record.arg; 1442 this.method = "return"; 1443 this.next = "end"; 1444 } else if (record.type === "normal" && afterLoc) { 1445 this.next = afterLoc; 1446 } 1447 1448 return ContinueSentinel; 1449 }, 1450 finish: function finish(finallyLoc) { 1451 for (var i = this.tryEntries.length - 1; i >= 0; --i) { 1452 var entry = this.tryEntries[i]; 1453 1454 if (entry.finallyLoc === finallyLoc) { 1455 this.complete(entry.completion, entry.afterLoc); 1456 resetTryEntry(entry); 1457 return ContinueSentinel; 1458 } 1459 } 1460 }, 1461 "catch": function _catch(tryLoc) { 1462 for (var i = this.tryEntries.length - 1; i >= 0; --i) { 1463 var entry = this.tryEntries[i]; 1464 1465 if (entry.tryLoc === tryLoc) { 1466 var record = entry.completion; 1467 1468 if (record.type === "throw") { 1469 var thrown = record.arg; 1470 resetTryEntry(entry); 1471 } 1472 1473 return thrown; 1474 } 1475 } 1476 1477 throw new Error("illegal catch attempt"); 1478 }, 1479 delegateYield: function delegateYield(iterable, resultName, nextLoc) { 1480 this.delegate = { 1481 iterator: values(iterable), 1482 resultName: resultName, 1483 nextLoc: nextLoc 1484 }; 1485 1486 if (this.method === "next") { 1487 this.arg = undefined; 1488 } 1489 1490 return ContinueSentinel; 1491 } 1492 }; 1493}(function () { 1494 return this || (typeof self === "undefined" ? "undefined" : _typeof(self)) === "object" && self; 1495}() || Function("return this")()); 1496/* WEBPACK VAR INJECTION */}.call(this, __w_pdfjs_require__(5)(module))) 1497 1498/***/ }), 1499/* 5 */ 1500/***/ (function(module, exports, __w_pdfjs_require__) { 1501 1502"use strict"; 1503 1504 1505module.exports = function (module) { 1506 if (!module.webpackPolyfill) { 1507 module.deprecate = function () {}; 1508 1509 module.paths = []; 1510 if (!module.children) module.children = []; 1511 Object.defineProperty(module, "loaded", { 1512 enumerable: true, 1513 get: function get() { 1514 return module.l; 1515 } 1516 }); 1517 Object.defineProperty(module, "id", { 1518 enumerable: true, 1519 get: function get() { 1520 return module.i; 1521 } 1522 }); 1523 module.webpackPolyfill = 1; 1524 } 1525 1526 return module; 1527}; 1528 1529/***/ }), 1530/* 6 */ 1531/***/ (function(module, exports, __w_pdfjs_require__) { 1532 1533"use strict"; 1534 1535 1536Object.defineProperty(exports, "__esModule", { 1537 value: true 1538}); 1539exports.toRomanNumerals = toRomanNumerals; 1540exports.arrayByteLength = arrayByteLength; 1541exports.arraysToBytes = arraysToBytes; 1542exports.assert = assert; 1543exports.bytesToString = bytesToString; 1544exports.createPromiseCapability = createPromiseCapability; 1545exports.deprecated = deprecated; 1546exports.getInheritableProperty = getInheritableProperty; 1547exports.getLookupTableFactory = getLookupTableFactory; 1548exports.getVerbosityLevel = getVerbosityLevel; 1549exports.info = info; 1550exports.isArrayBuffer = isArrayBuffer; 1551exports.isBool = isBool; 1552exports.isEmptyObj = isEmptyObj; 1553exports.isNum = isNum; 1554exports.isString = isString; 1555exports.isSpace = isSpace; 1556exports.isSameOrigin = isSameOrigin; 1557exports.createValidAbsoluteUrl = createValidAbsoluteUrl; 1558exports.isLittleEndian = isLittleEndian; 1559exports.isEvalSupported = isEvalSupported; 1560exports.log2 = log2; 1561exports.readInt8 = readInt8; 1562exports.readUint16 = readUint16; 1563exports.readUint32 = readUint32; 1564exports.removeNullCharacters = removeNullCharacters; 1565exports.setVerbosityLevel = setVerbosityLevel; 1566exports.shadow = shadow; 1567exports.string32 = string32; 1568exports.stringToBytes = stringToBytes; 1569exports.stringToPDFString = stringToPDFString; 1570exports.stringToUTF8String = stringToUTF8String; 1571exports.utf8StringToString = utf8StringToString; 1572exports.warn = warn; 1573exports.unreachable = unreachable; 1574Object.defineProperty(exports, "ReadableStream", { 1575 enumerable: true, 1576 get: function get() { 1577 return _streams_polyfill.ReadableStream; 1578 } 1579}); 1580Object.defineProperty(exports, "URL", { 1581 enumerable: true, 1582 get: function get() { 1583 return _url_polyfill.URL; 1584 } 1585}); 1586exports.createObjectURL = exports.FormatError = exports.XRefParseException = exports.XRefEntryException = exports.Util = exports.UnknownErrorException = exports.UnexpectedResponseException = exports.TextRenderingMode = exports.StreamType = exports.PermissionFlag = exports.PasswordResponses = exports.PasswordException = exports.NativeImageDecoding = exports.MissingPDFException = exports.MissingDataException = exports.InvalidPDFException = exports.AbortException = exports.CMapCompressionType = exports.ImageKind = exp
1586orts.FontType = exports.AnnotationType = exports.AnnotationFlag = exports.AnnotationFieldFlag = exports.AnnotationBorderStyleType = exports.UNSUPPORTED_FEATURES = exports.VerbosityLevel = exports.OPS = exports.IDENTITY_MATRIX = exports.FONT_IDENTITY_MATRIX = void 0; 1587 1588__w_pdfjs_require__(7); 1589 1590var _streams_polyfill = __w_pdfjs_require__(147); 1591 1592var _url_polyfill = __w_pdfjs_require__(149); 1593 1594function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 1595 1596var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; 1597exports.IDENTITY_MATRIX = IDENTITY_MATRIX; 1598var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; 1599exports.FONT_IDENTITY_MATRIX = FONT_IDENTITY_MATRIX; 1600var NativeImageDecoding = { 1601 NONE: 'none', 1602 DECODE: 'decode', 1603 DISPLAY: 'display' 1604}; 1605exports.NativeImageDecoding = NativeImageDecoding; 1606var PermissionFlag = { 1607 PRINT: 0x04, 1608 MODIFY_CONTENTS: 0x08, 1609 COPY: 0x10, 1610 MODIFY_ANNOTATIONS: 0x20, 1611 FILL_INTERACTIVE_FORMS: 0x100, 1612 COPY_FOR_ACCESSIBILITY: 0x200, 1613 ASSEMBLE: 0x400, 1614 PRINT_HIGH_QUALITY: 0x800 1615}; 1616exports.PermissionFlag = PermissionFlag; 1617var TextRenderingMode = { 1618 FILL: 0, 1619 STROKE: 1, 1620 FILL_STROKE: 2, 1621 INVISIBLE: 3, 1622 FILL_ADD_TO_PATH: 4, 1623 STROKE_ADD_TO_PATH: 5, 1624 FILL_STROKE_ADD_TO_PATH: 6, 1625 ADD_TO_PATH: 7, 1626 FILL_STROKE_MASK: 3, 1627 ADD_TO_PATH_FLAG: 4 1628}; 1629exports.TextRenderingMode = TextRenderingMode; 1630var ImageKind = { 1631 GRAYSCALE_1BPP: 1, 1632 RGB_24BPP: 2, 1633 RGBA_32BPP: 3 1634}; 1635exports.ImageKind = ImageKind; 1636var AnnotationType = { 1637 TEXT: 1, 1638 LINK: 2, 1639 FREETEXT: 3, 1640 LINE: 4, 1641 SQUARE: 5, 1642 CIRCLE: 6, 1643 POLYGON: 7, 1644 POLYLINE: 8, 1645 HIGHLIGHT: 9, 1646 UNDERLINE: 10, 1647 SQUIGGLY: 11, 1648 STRIKEOUT: 12, 1649 STAMP: 13, 1650 CARET: 14, 1651 INK: 15, 1652 POPUP: 16, 1653 FILEATTACHMENT: 17, 1654 SOUND: 18, 1655 MOVIE: 19, 1656 WIDGET: 20, 1657 SCREEN: 21, 1658 PRINTERMARK: 22, 1659 TRAPNET: 23, 1660 WATERMARK: 24, 1661 THREED: 25, 1662 REDACT: 26 1663}; 1664exports.AnnotationType = AnnotationType; 1665var AnnotationFlag = { 1666 INVISIBLE: 0x01, 1667 HIDDEN: 0x02, 1668 PRINT: 0x04, 1669 NOZOOM: 0x08, 1670 NOROTATE: 0x10, 1671 NOVIEW: 0x20, 1672 READONLY: 0x40, 1673 LOCKED: 0x80, 1674 TOGGLENOVIEW: 0x100, 1675 LOCKEDCONTENTS: 0x200 1676}; 1677exports.AnnotationFlag = AnnotationFlag; 1678var AnnotationFieldFlag = { 1679 READONLY: 0x0000001, 1680 REQUIRED: 0x0000002, 1681 NOEXPORT: 0x0000004, 1682 MULTILINE: 0x0001000, 1683 PASSWORD: 0x0002000, 1684 NOTOGGLETOOFF: 0x0004000, 1685 RADIO: 0x0008000, 1686 PUSHBUTTON: 0x0010000, 1687 COMBO: 0x0020000, 1688 EDIT: 0x0040000, 1689 SORT: 0x0080000, 1690 FILESELECT: 0x0100000, 1691 MULTISELECT: 0x0200000, 1692 DONOTSPELLCHECK: 0x0400000, 1693 DONOTSCROLL: 0x0800000, 1694 COMB: 0x1000000, 1695 RICHTEXT: 0x2000000, 1696 RADIOSINUNISON: 0x2000000, 1697 COMMITONSELCHANGE: 0x4000000 1698}; 1699exports.AnnotationFieldFlag = AnnotationFieldFlag; 1700var AnnotationBorderStyleType = { 1701 SOLID: 1, 1702 DASHED: 2, 1703 BEVELED: 3, 1704 INSET: 4, 1705 UNDERLINE: 5 1706}; 1707exports.AnnotationBorderStyleType = AnnotationBorderStyleType; 1708var StreamType = { 1709 UNKNOWN: 0, 1710 FLATE: 1, 1711 LZW: 2, 1712 DCT: 3, 1713 JPX: 4, 1714 JBIG: 5, 1715 A85: 6, 1716 AHX: 7, 1717 CCF: 8, 1718 RL: 9 1719}; 1720exports.StreamType = StreamType; 1721var FontType = { 1722 UNKNOWN: 0, 1723 TYPE1: 1, 1724 TYPE1C: 2, 1725 CIDFONTTYPE0: 3, 1726 CIDFONTTYPE0C: 4, 1727 TRUETYPE: 5, 1728 CIDFONTTYPE2: 6, 1729 TYPE3: 7, 1730 OPENTYPE: 8, 1731 TYPE0: 9, 1732 MMTYPE1: 10 1733}; 1734exports.FontType = FontType; 1735var VerbosityLevel = { 1736 ERRORS: 0, 1737 WARNINGS: 1, 1738 INFOS: 5 1739}; 1740exports.VerbosityLevel = VerbosityLevel; 1741var CMapCompressionType = { 1742 NONE: 0, 1743 BINARY: 1, 1744 STREAM: 2 1745}; 1746exports.CMapCompressionType = CMapCompressionType; 1747var OPS = { 1748 dependency: 1, 1749 setLineWidth: 2, 1750 setLineCap: 3, 1751 setLineJoin: 4, 1752 setMiterLimit: 5, 1753 setDash: 6, 1754 setRenderingIntent: 7, 1755 setFlatness: 8, 1756 setGState: 9, 1757 save: 10, 1758 restore: 11, 1759 transform: 12, 1760 moveTo: 13, 1761 lineTo: 14, 1762 curveTo: 15, 1763 curveTo2: 16, 1764 curveTo3: 17, 1765 closePath: 18, 1766 rectangle: 19, 1767 stroke: 20, 1768 closeStroke: 21, 1769 fill: 22, 1770 eoFill: 23, 1771 fillStroke: 24, 1772 eoFillStroke: 25, 1773 closeFillStroke: 26, 1774 closeEOFillStroke: 27, 1775 endPath: 28,
1776 clip: 29, 1777 eoClip: 30, 1778 beginText: 31, 1779 endText: 32, 1780 setCharSpacing: 33, 1781 setWordSpacing: 34, 1782 setHScale: 35, 1783 setLeading: 36, 1784 setFont: 37, 1785 setTextRenderingMode: 38, 1786 setTextRise: 39, 1787 moveText: 40, 1788 setLeadingMoveText: 41, 1789 setTextMatrix: 42, 1790 nextLine: 43, 1791 showText: 44, 1792 showSpacedText: 45, 1793 nextLineShowText: 46, 1794 nextLineSetSpacingShowText: 47, 1795 setCharWidth: 48, 1796 setCharWidthAndBounds: 49, 1797 setStrokeColorSpace: 50, 1798 setFillColorSpace: 51, 1799 setStrokeColor: 52, 1800 setStrokeColorN: 53, 1801 setFillColor: 54, 1802 setFillColorN: 55, 1803 setStrokeGray: 56, 1804 setFillGray: 57, 1805 setStrokeRGBColor: 58, 1806 setFillRGBColor: 59, 1807 setStrokeCMYKColor: 60, 1808 setFillCMYKColor: 61, 1809 shadingFill: 62, 1810 beginInlineImage: 63, 1811 beginImageData: 64, 1812 endInlineImage: 65, 1813 paintXObject: 66, 1814 markPoint: 67, 1815 markPointProps: 68, 1816 beginMarkedContent: 69, 1817 beginMarkedContentProps: 70, 1818 endMarkedContent: 71, 1819 beginCompat: 72, 1820 endCompat: 73, 1821 paintFormXObjectBegin: 74, 1822 paintFormXObjectEnd: 75, 1823 beginGroup: 76, 1824 endGroup: 77, 1825 beginAnnotations: 78, 1826 endAnnotations: 79, 1827 beginAnnotation: 80, 1828 endAnnotation: 81, 1829 paintJpegXObject: 82, 1830 paintImageMaskXObject: 83, 1831 paintImageMaskXObjectGroup: 84, 1832 paintImageXObject: 85, 1833 paintInlineImageXObject: 86, 1834 paintInlineImageXObjectGroup: 87, 1835 paintImageXObjectRepeat: 88, 1836 paintImageMaskXObjectRepeat: 89, 1837 paintSolidColorImageMask: 90, 1838 constructPath: 91 1839}; 1840exports.OPS = OPS; 1841var UNSUPPORTED_FEATURES = { 1842 unknown: 'unknown', 1843 forms: 'forms', 1844 javaScript: 'javaScript', 1845 smask: 'smask', 1846 shadingPattern: 'shadingPattern', 1847 font: 'font' 1848}; 1849exports.UNSUPPORTED_FEATURES = UNSUPPORTED_FEATURES; 1850var PasswordResponses = { 1851 NEED_PASSWORD: 1, 1852 INCORRECT_PASSWORD: 2 1853}; 1854exports.PasswordResponses = PasswordResponses; 1855var verbosity = VerbosityLevel.WARNINGS; 1856 1857function setVerbosityLevel(level) { 1858 if (Number.isInteger(level)) { 1859 verbosity = level; 1860 } 1861} 1862 1863function getVerbosityLevel() { 1864 return verbosity; 1865} 1866 1867function info(msg) { 1868 if (verbosity >= VerbosityLevel.INFOS) { 1869 console.log('Info: ' + msg); 1870 } 1871} 1872 1873function warn(msg) { 1874 if (verbosity >= VerbosityLevel.WARNINGS) { 1875 console.log('Warning: ' + msg); 1876 } 1877} 1878 1879function deprecated(details) { 1880 console.log('Deprecated API usage: ' + details); 1881} 1882 1883function unreachable(msg) { 1884 throw new Error(msg); 1885} 1886 1887function assert(cond, msg) { 1888 if (!cond) { 1889 unreachable(msg); 1890 } 1891} 1892 1893function isSameOrigin(baseUrl, otherUrl) { 1894 try { 1895 var base = new _url_polyfill.URL(baseUrl); 1896 1897 if (!base.origin || base.origin === 'null') { 1898 return false; 1899 } 1900 } catch (e) { 1901 return false; 1902 } 1903 1904 var other = new _url_polyfill.URL(otherUrl, base); 1905 return base.origin === other.origin; 1906} 1907 1908function _isValidProtocol(url) { 1909 if (!url) { 1910 return false; 1911 } 1912 1913 switch (url.protocol) { 1914 case 'http:': 1915 case 'https:': 1916 case 'ftp:': 1917 case 'mailto:': 1918 case 'tel:': 1919 return true; 1920 1921 default: 1922 return false; 1923 } 1924} 1925 1926function createValidAbsoluteUrl(url, baseUrl) { 1927 if (!url) { 1928 return null; 1929 } 1930 1931 try { 1932 var absoluteUrl = baseUrl ? new _url_polyfill.URL(url, baseUrl) : new _url_polyfill.URL(url); 1933 1934 if (_isValidProtocol(absoluteUrl)) { 1935 return absoluteUrl; 1936 } 1937 } catch (ex) {} 1938 1939 return null; 1940} 1941 1942function shadow(obj, prop, value) { 1943 Object.defineProperty(obj, prop, { 1944 value: value, 1945 enumerable: true, 1946 configurable: true, 1947 writable: false 1948 }); 1949 return value; 1950} 1951 1952function getLookupTableFactory(initializer) { 1953 var lookup; 1954 return function () { 1955 if (initializer) { 1956 lookup = Object.create(null); 1957 initializer(lookup); 1958 initializer = null; 1959 } 1960 1961 return lookup; 1962 }; 1963} 1964 1965var PasswordException = function PasswordExceptionClosure() { 1966 function PasswordException(msg, code) { 1967 this.name = 'PasswordException'; 1968 this.message = msg; 1969 this.code = code; 1970 } 1971 1972 PasswordException.prototype = new Error(); 1973 PasswordException.constructor = PasswordException; 1974 return PasswordException; 1975}(); 1976 1977exports.PasswordException = PasswordException; 1978 1979var UnknownErrorException = function UnknownErrorExceptionClosure() { 1980 function UnknownErrorException(msg, details) { 1981 this.name = 'UnknownErrorException'; 1982 this.message = msg; 1983 this.details = details; 1984 } 1985 1986 UnknownErrorException.prototype = new Error(); 1987 UnknownErrorException.constructor = UnknownErrorException; 1988 return UnknownErrorException; 1989}(); 1990 1991exports.UnknownErrorException = UnknownErrorException; 1992 1993var InvalidPDFException = function InvalidPDFExceptionClosure() { 1994 function InvalidPDFException(msg) { 1995 this.name = 'InvalidPDFException'; 1996 this.message = msg; 1997 } 1998 1999 InvalidPDFException.prototype = new Error(); 2000 InvalidPDFException.constructor = InvalidPDFException; 2001 return InvalidPDFException; 2002}(); 2003 2004exports.InvalidPDFException = InvalidPDFException; 2005 2006var MissingPDFException = function MissingPDFExceptionClosure() { 2007 function MissingPDFException(msg) { 2008 this.name = 'MissingPDFException'; 2009 this.message = msg; 2010 } 2011 2012 MissingPDFException.prototype = new Error(); 2013 MissingPDFException.constructor = MissingPDFException; 2014 return MissingPDFException; 2015}(); 2016 2017exports.MissingPDFException = MissingPDFException; 2018 2019var UnexpectedResponseException = function UnexpectedResponseExceptionClosure() { 2020 function UnexpectedResponseException(msg, status) { 2021 this.name = 'UnexpectedResponseException'; 2022 this.message = msg; 2023 this.status = status; 2024 } 2025 2026 UnexpectedResponseException.prototype = new Error(); 2027 UnexpectedResponseException.constructor = UnexpectedResponseException; 2028 return UnexpectedResponseException; 2029}(); 2030 2031exports.UnexpectedResponseException = UnexpectedResponseException; 2032 2033var MissingDataException = function MissingDataExceptionClosure() { 2034 function MissingDataException(begin, end) { 2035 this.begin = begin; 2036 this.end = end; 2037 this.message = 'Missing data [' + begin + ', ' + end + ')'; 2038 } 2039 2040 MissingDataException.prototype = new Error(); 2041 MissingDataException.prototype.name = 'MissingDataException'; 2042 MissingDataException.constructor = MissingDataException; 2043 return MissingDataException; 2044}(); 2045 2046exports.MissingDataException = MissingDataException; 2047 2048var XRefEntryException = function XRefEntryExceptionClosure() { 2049 function XRefEntryException(msg) { 2050 this.message = msg; 2051 } 2052 2053 XRefEntryException.prototype = new Error(); 2054 XRefEntryException.prototype.name = 'XRefEntryException'; 2055 XRefEntryException.constructor = XRefEntryException;
2056 return XRefEntryException; 2057}(); 2058 2059exports.XRefEntryException = XRefEntryException; 2060 2061var XRefParseException = function XRefParseExceptionClosure() { 2062 function XRefParseException(msg) { 2063 this.message = msg; 2064 } 2065 2066 XRefParseException.prototype = new Error(); 2067 XRefParseException.prototype.name = 'XRefParseException'; 2068 XRefParseException.constructor = XRefParseException; 2069 return XRefParseException; 2070}(); 2071 2072exports.XRefParseException = XRefParseException; 2073 2074var FormatError = function FormatErrorClosure() { 2075 function FormatError(msg) { 2076 this.message = msg; 2077 } 2078 2079 FormatError.prototype = new Error(); 2080 FormatError.prototype.name = 'FormatError'; 2081 FormatError.constructor = FormatError; 2082 return FormatError; 2083}(); 2084 2085exports.FormatError = FormatError; 2086 2087var AbortException = function AbortExceptionClosure() { 2088 function AbortException(msg) { 2089 this.name = 'AbortException'; 2090 this.message = msg; 2091 } 2092 2093 AbortException.prototype = new Error(); 2094 AbortException.constructor = AbortException; 2095 return AbortException; 2096}(); 2097 2098exports.AbortException = AbortException; 2099var NullCharactersRegExp = /\x00/g; 2100 2101function removeNullCharacters(str) { 2102 if (typeof str !== 'string') { 2103 warn('The argument for removeNullCharacters must be a string.'); 2104 return str; 2105 } 2106 2107 return str.replace(NullCharactersRegExp, ''); 2108} 2109 2110function bytesToString(bytes) { 2111 assert(bytes !== null && _typeof(bytes) === 'object' && bytes.length !== undefined, 'Invalid argument for bytesToString'); 2112 var length = bytes.length; 2113 var MAX_ARGUMENT_COUNT = 8192; 2114 2115 if (length < MAX_ARGUMENT_COUNT) { 2116 return String.fromCharCode.apply(null, bytes); 2117 } 2118 2119 var strBuf = []; 2120 2121 for (var i = 0; i < length; i += MAX_ARGUMENT_COUNT) { 2122 var chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); 2123 var chunk = bytes.subarray(i, chunkEnd); 2124 strBuf.push(String.fromCharCode.apply(null, chunk)); 2125 } 2126 2127 return strBuf.join(''); 2128} 2129 2130function stringToBytes(str) { 2131 assert(typeof str === 'string', 'Invalid argument for stringToBytes'); 2132 var length = str.length; 2133 var bytes = new Uint8Array(length); 2134 2135 for (var i = 0; i < length; ++i) { 2136 bytes[i] = str.charCodeAt(i) & 0xFF; 2137 } 2138 2139 return bytes; 2140} 2141 2142function arrayByteLength(arr) { 2143 if (arr.length !== undefined) { 2144 return arr.length; 2145 } 2146 2147 assert(arr.byteLength !== undefined); 2148 return arr.byteLength; 2149} 2150 2151function arraysToBytes(arr) { 2152 if (arr.length === 1 && arr[0] instanceof Uint8Array) { 2153 return arr[0]; 2154 } 2155 2156 var resultLength = 0; 2157 var i, 2158 ii = arr.length; 2159 var item, itemLength; 2160 2161 for (i = 0; i < ii; i++) { 2162 item = arr[i]; 2163 itemLength = arrayByteLength(item); 2164 resultLength += itemLength; 2165 } 2166 2167 var pos = 0; 2168 var data = new Uint8Array(resultLength); 2169 2170 for (i = 0; i < ii; i++) { 2171 item = arr[i]; 2172 2173 if (!(item instanceof Uint8Array)) { 2174 if (typeof item === 'string') { 2175 item = stringToBytes(item); 2176 } else { 2177 item = new Uint8Array(item); 2178 } 2179 } 2180 2181 itemLength = item.byteLength; 2182 data.set(item, pos); 2183 pos += itemLength; 2184 } 2185 2186 return data; 2187} 2188 2189function string32(value) { 2190 return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); 2191} 2192 2193function log2(x) { 2194 if (x <= 0) { 2195 return 0; 2196 } 2197 2198 return Math.ceil(Math.log2(x)); 2199} 2200 2201function readInt8(data, start) { 2202 return data[start] << 24 >> 24; 2203} 2204 2205function readUint16(data, offset) { 2206 return data[offset] << 8 | data[offset + 1]; 2207} 2208 2209function readUint32(data, offset) { 2210 return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0; 2211} 2212 2213function isLittleEndian() { 2214 var buffer8 = new Uint8Array(4); 2215 buffer8[0] = 1; 2216 var view32 = new Uint32Array(buffer8.buffer, 0, 1); 2217 return view32[0] === 1; 2218} 2219 2220function isEvalSupported() { 2221 try { 2222 new Function(''); 2223 return true; 2224 } catch (e) { 2225 return false; 2226 } 2227} 2228 2229function getInheritableProperty(_ref) { 2230 var dict = _ref.dict, 2231 key = _ref.key, 2232 _ref$getArray = _ref.getArray, 2233 getArray = _ref$getArray === void 0 ? false : _ref$getArray, 2234 _ref$stopWhenFound = _ref.stopWhenFound, 2235 stopWhenFound = _ref$stopWhenFound === void 0 ? true : _ref$stopWhenFound; 2236 var LOOP_LIMIT = 100; 2237 var loopCount = 0; 2238 var values; 2239 2240 while (dict) { 2241 var value = getArray ? dict.getArray(key) : dict.get(key); 2242 2243 if (value !== undefined) { 2244 if (stopWhenFound) { 2245 return value; 2246 } 2247 2248 if (!values) { 2249 values = []; 2250 } 2251 2252 values.push(value); 2253 } 2254 2255 if (++loopCount > LOOP_LIMIT) { 2256 warn("getInheritableProperty: maximum loop count exceeded for \"".concat(key, "\"")); 2257 break; 2258 } 2259 2260 dict = dict.get('Parent'); 2261 } 2262 2263 return values; 2264} 2265 2266var Util = function UtilClosure() { 2267 function Util() {} 2268 2269 var rgbBuf = ['rgb(', 0, ',', 0, ',', 0, ')']; 2270 2271 Util.makeCssRgb = function Util_makeCssRgb(r, g, b) { 2272 rgbBuf[1] = r; 2273 rgbBuf[3] = g; 2274 rgbBuf[5] = b; 2275 return rgbBuf.join(''); 2276 }; 2277 2278 Util.transform = function Util_transform(m1, m2) { 2279 return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]]; 2280 }; 2281 2282 Util.applyTransform = function Util_applyTransform(p, m) { 2283 var xt = p[0] * m[0] + p[1] * m[2] + m[4]; 2284 var yt = p[0] * m[1] + p[1] * m[3] + m[5]; 2285 return [xt, yt]; 2286 }; 2287 2288 Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { 2289 var d = m[0] * m[3] - m[1] * m[2]; 2290 var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; 2291 var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; 2292 return [xt, yt]; 2293 }; 2294 2295 Util.getAxialAlignedBoundingBox = function Util_getAxialAlignedBoundingBox(r, m) { 2296 var p1 = Util.applyTransform(r, m); 2297 var p2 = Util.applyTransform(r.slice(2, 4), m); 2298 var p3 = Util.applyTransform([r[0], r[3]], m); 2299 var p4 = Util.applyTransform([r[2], r[1]], m); 2300 return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])]; 2301 }; 2302 2303 Util.inverseTransform = function Util_inverseTransform(m) { 2304 var d = m[0] * m[3] - m[1] * m[2]; 2305 return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; 2306 }; 2307 2308 Util.apply3dTransform = function Util_apply3dTransform(m, v) { 2309 return [m[0] * v[0] + m[1] * v[1] + m[2] * v[2], m[3] * v[0] + m[4] * v[1] + m[5] * v[2], m[6] * v[0] + m[7] * v[1] + m[8] * v[2]]; 2310 }; 2311 2312 Util.singularValueDecompose2dScale = function Util_singularValueDecompose2dScale(m) { 2313 var transpose = [m[0], m[2], m[1], m[3]]; 2314 var a = m[0] * transpose[0] + m[1] * transpose[2]; 2315 var b = m[0] * transpose[1] + m[1] * transpose[3]; 2316 var c = m[2] * transpose[0] + m[3] * transpose[2]; 2317 var d = m[2] * transpose[1] + m[3] * transpose[3]; 2318 var first = (a + d) / 2; 2319 var second = Math.sqrt((a + d) * (a + d) - 4 * (a * d - c * b)) / 2; 2320 var sx = first + second || 1; 2321 var sy = first - second || 1; 2322 return [Math.sqrt(sx), Math.sqrt(sy)]; 2323 }; 2324 2325 Util.normalizeRect = function Util_normalizeRect(rect) { 2326 var r = rect.slice(0); 2327 2328 if (rect[0] > rect[2]) { 2329 r[0] = rect[2]; 2330 r[2] = rect[0];
2331 } 2332 2333 if (rect[1] > rect[3]) { 2334 r[1] = rect[3]; 2335 r[3] = rect[1]; 2336 } 2337 2338 return r; 2339 }; 2340 2341 Util.intersect = function Util_intersect(rect1, rect2) { 2342 function compare(a, b) { 2343 return a - b; 2344 } 2345 2346 var orderedX = [rect1[0], rect1[2], rect2[0], rect2[2]].sort(compare), 2347 orderedY = [rect1[1], rect1[3], rect2[1], rect2[3]].sort(compare), 2348 result = []; 2349 rect1 = Util.normalizeRect(rect1); 2350 rect2 = Util.normalizeRect(rect2); 2351 2352 if (orderedX[0] === rect1[0] && orderedX[1] === rect2[0] || orderedX[0] === rect2[0] && orderedX[1] === rect1[0]) { 2353 result[0] = orderedX[1]; 2354 result[2] = orderedX[2]; 2355 } else { 2356 return false; 2357 } 2358 2359 if (orderedY[0] === rect1[1] && orderedY[1] === rect2[1] || orderedY[0] === rect2[1] && orderedY[1] === rect1[1]) { 2360 result[1] = orderedY[1]; 2361 result[3] = orderedY[2]; 2362 } else { 2363 return false; 2364 } 2365 2366 return result; 2367 }; 2368 2369 return Util; 2370}(); 2371 2372exports.Util = Util; 2373var ROMAN_NUMBER_MAP = ['', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM', '', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC', '', 'I', 'II', 'III', 'IV', 'V', 'VI', 'VII', 'VIII', 'IX']; 2374 2375function toRomanNumerals(number) { 2376 var lowerCase = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 2377 assert(Number.isInteger(number) && number > 0, 'The number should be a positive integer.'); 2378 var pos, 2379 romanBuf = []; 2380 2381 while (number >= 1000) { 2382 number -= 1000; 2383 romanBuf.push('M'); 2384 } 2385 2386 pos = number / 100 | 0; 2387 number %= 100; 2388 romanBuf.push(ROMAN_NUMBER_MAP[pos]); 2389 pos = number / 10 | 0; 2390 number %= 10; 2391 romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); 2392 romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); 2393 var romanStr = romanBuf.join(''); 2394 return lowerCase ? romanStr.toLowerCase() : romanStr; 2395} 2396 2397var PDFStringTranslateTable = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203A, 0x2212, 0x2030, 0x201E, 0x201C, 0x201D, 0x2018, 0x2019, 0x201A, 0x2122, 0xFB01, 0xFB02, 0x141, 0x152, 0x160, 0x178, 0x17D, 0x131, 0x142, 0x153, 0x161, 0x17E, 0, 0x20AC]; 2398 2399function stringToPDFString(str) { 2400 var i, 2401 n = str.length, 2402 strBuf = []; 2403 2404 if (str[0] === '\xFE' && str[1] === '\xFF') { 2405 for (i = 2; i < n; i += 2) { 2406 strBuf.push(String.fromCharCode(str.charCodeAt(i) << 8 | str.charCodeAt(i + 1))); 2407 } 2408 } else { 2409 for (i = 0; i < n; ++i) { 2410 var code = PDFStringTranslateTable[str.charCodeAt(i)]; 2411 strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); 2412 } 2413 } 2414 2415 return strBuf.join(''); 2416} 2417 2418function stringToUTF8String(str) { 2419 return decodeURIComponent(escape(str)); 2420} 2421 2422function utf8StringToString(str) { 2423 return unescape(encodeURIComponent(str)); 2424} 2425 2426function isEmptyObj(obj) { 2427 for (var key in obj) { 2428 return false; 2429 } 2430 2431 return true; 2432} 2433 2434function isBool(v) { 2435 return typeof v === 'boolean'; 2436} 2437 2438function isNum(v) { 2439 return typeof v === 'number'; 2440} 2441 2442function isString(v) { 2443 return typeof v === 'string'; 2444} 2445 2446function isArrayBuffer(v) { 2447 return _typeof(v) === 'object' && v !== null && v.byteLength !== undefined; 2448} 2449 2450function isSpace(ch) { 2451 return ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A; 2452} 2453 2454function createPromiseCapability() { 2455 var capability = Object.create(null); 2456 var isSettled = false; 2457 Object.defineProperty(capability, 'settled', { 2458 get: function get() { 2459 return isSettled; 2460 } 2461 }); 2462 capability.promise = new Promise(function (resolve, reject) { 2463 capability.resolve = function (data) { 2464 isSettled = true; 2465 resolve(data); 2466 }; 2467 2468 capability.reject = function (reason) { 2469 isSettled = true; 2470 reject(reason); 2471 }; 2472 }); 2473 return capability; 2474} 2475 2476var createObjectURL = function createObjectURLClosure() { 2477 var digits = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
2477+/='; 2478 return function createObjectURL(data, contentType) { 2479 var forceDataSchema = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 2480 2481 if (!forceDataSchema && _url_polyfill.URL.createObjectURL) { 2482 var blob = new Blob([data], { 2483 type: contentType 2484 }); 2485 return _url_polyfill.URL.createObjectURL(blob); 2486 } 2487 2488 var buffer = 'data:' + contentType + ';base64,'; 2489 2490 for (var i = 0, ii = data.length; i < ii; i += 3) { 2491 var b1 = data[i] & 0xFF; 2492 var b2 = data[i + 1] & 0xFF; 2493 var b3 = data[i + 2] & 0xFF; 2494 var d1 = b1 >> 2, 2495 d2 = (b1 & 3) << 4 | b2 >> 4; 2496 var d3 = i + 1 < ii ? (b2 & 0xF) << 2 | b3 >> 6 : 64; 2497 var d4 = i + 2 < ii ? b3 & 0x3F : 64; 2498 buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4]; 2499 } 2500 2501 return buffer; 2502 }; 2503}(); 2504 2505exports.createObjectURL = createObjectURL; 2506 2507/***/ }), 2508/* 7 */ 2509/***/ (function(module, exports, __w_pdfjs_require__) { 2510 2511"use strict"; 2512 2513 2514function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 2515 2516var globalScope = __w_pdfjs_require__(8); 2517 2518if (!globalScope._pdfjsCompatibilityChecked) { 2519 globalScope._pdfjsCompatibilityChecked = true; 2520 2521 var isNodeJS = __w_pdfjs_require__(9); 2522 2523 var hasDOM = (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' && (typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object'; 2524 2525 (function checkNodeBtoa() { 2526 if (globalScope.btoa || !isNodeJS()) { 2527 return; 2528 } 2529 2530 globalScope.btoa = function (chars) { 2531 return Buffer.from(chars, 'binary').toString('base64'); 2532 }; 2533 })(); 2534 2535 (function checkNodeAtob() { 2536 if (globalScope.atob || !isNodeJS()) { 2537 return; 2538 } 2539 2540 globalScope.atob = function (input) { 2541 return Buffer.from(input, 'base64').toString('binary'); 2542 }; 2543 })(); 2544 2545 (function checkChildNodeRemove() { 2546 if (!hasDOM) { 2547 return; 2548 } 2549 2550 if (typeof Element.prototype.remove !== 'undefined') { 2551 return; 2552 } 2553 2554 Element.prototype.remove = function () { 2555 if (this.parentNode) { 2556 this.parentNode.removeChild(this); 2557 } 2558 }; 2559 })(); 2560 2561 (function checkDOMTokenListAddRemove() { 2562 if (!hasDOM || isNodeJS()) { 2563 return; 2564 } 2565 2566 var div = document.createElement('div'); 2567 div.classList.add('testOne', 'testTwo'); 2568 2569 if (div.classList.contains('testOne') === true && div.classList.contains('testTwo') === true) { 2570 return; 2571 } 2572 2573 var OriginalDOMTokenListAdd = DOMTokenList.prototype.add; 2574 var OriginalDOMTokenListRemove = DOMTokenList.prototype.remove; 2575 2576 DOMTokenList.prototype.add = function () { 2577 for (var _len = arguments.length, tokens = new Array(_len), _key = 0; _key < _len; _key++) { 2578 tokens[_key] = arguments[_key]; 2579 } 2580 2581 for (var _i = 0; _i < tokens.length; _i++) { 2582 var token = tokens[_i]; 2583 OriginalDOMTokenListAdd.call(this, token); 2584 } 2585 }; 2586 2587 DOMTokenList.prototype.remove = function () { 2588 for (var _len2 = arguments.length, tokens = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { 2589 tokens[_key2] = arguments[_key2]; 2590 } 2591 2592 for (var _i2 = 0; _i2 < tokens.length; _i2++) { 2593 var token = tokens[_i2]; 2594 OriginalDOMTokenListRemove.call(this, token); 2595 } 2596 }; 2597 })(); 2598 2599 (function checkDOMTokenListToggle() { 2600 if (!hasDOM || isNodeJS()) { 2601 return; 2602 } 2603 2604 var div = document.createElement('div'); 2605 2606 if (div.classList.toggle('test', 0) === false) { 2607 return; 2608 } 2609 2610 DOMTokenList.prototype.toggle = function (token) { 2611 var force = arguments.length > 1 ? !!arguments[1] : !this.contains(token); 2612 return this[force ? 'add' : 'remove'](token), force; 2613 }; 2614 })();
2615 2616 (function checkStringStartsWith() { 2617 if (String.prototype.startsWith) { 2618 return; 2619 } 2620 2621 __w_pdfjs_require__(10); 2622 })(); 2623 2624 (function checkStringEndsWith() { 2625 if (String.prototype.endsWith) { 2626 return; 2627 } 2628 2629 __w_pdfjs_require__(40); 2630 })(); 2631 2632 (function checkStringIncludes() { 2633 if (String.prototype.includes) { 2634 return; 2635 } 2636 2637 __w_pdfjs_require__(42); 2638 })(); 2639 2640 (function checkArrayIncludes() { 2641 if (Array.prototype.includes) { 2642 return; 2643 } 2644 2645 __w_pdfjs_require__(44); 2646 })(); 2647 2648 (function checkArrayFrom() { 2649 if (Array.from) { 2650 return; 2651 } 2652 2653 __w_pdfjs_require__(51); 2654 })(); 2655 2656 (function checkObjectAssign() { 2657 if (Object.assign) { 2658 return; 2659 } 2660 2661 __w_pdfjs_require__(74); 2662 })(); 2663 2664 (function checkMathLog2() { 2665 if (Math.log2) { 2666 return; 2667 } 2668 2669 Math.log2 = __w_pdfjs_require__(79); 2670 })(); 2671 2672 (function checkNumberIsNaN() { 2673 if (Number.isNaN) { 2674 return; 2675 } 2676 2677 Number.isNaN = __w_pdfjs_require__(81); 2678 })(); 2679 2680 (function checkNumberIsInteger() { 2681 if (Number.isInteger) { 2682 return; 2683 } 2684 2685 Number.isInteger = __w_pdfjs_require__(83); 2686 })(); 2687 2688 (function checkPromise() { 2689 if (globalScope.Promise && globalScope.Promise.prototype && globalScope.Promise.prototype.finally) { 2690 return; 2691 } 2692 2693 globalScope.Promise = __w_pdfjs_require__(86); 2694 })(); 2695 2696 (function checkWeakMap() { 2697 if (globalScope.WeakMap) { 2698 return; 2699 } 2700 2701 globalScope.WeakMap = __w_pdfjs_require__(106); 2702 })(); 2703 2704 (function checkWeakSet() { 2705 if (globalScope.WeakSet) { 2706 return; 2707 } 2708 2709 globalScope.WeakSet = __w_pdfjs_require__(123); 2710 })(); 2711 2712 (function checkStringCodePointAt() { 2713 if (String.codePointAt) { 2714 return; 2715 } 2716 2717 String.codePointAt = __w_pdfjs_require__(127); 2718 })(); 2719 2720 (function checkStringFromCodePoint() { 2721 if (String.fromCodePoint) { 2722 return; 2723 } 2724 2725 String.fromCodePoint = __w_pdfjs_require__(129); 2726 })(); 2727 2728 (function checkSymbol() { 2729 if (globalScope.Symbol) { 2730 return; 2731 } 2732 2733 __w_pdfjs_require__(131); 2734 })(); 2735 2736 (function checkStringPadStart() { 2737 if (String.prototype.padStart) { 2738 return; 2739 } 2740 2741 __w_pdfjs_require__(138); 2742 })(); 2743 2744 (function checkStringPadEnd() { 2745 if (String.prototype.padEnd) { 2746 return; 2747 } 2748 2749 __w_pdfjs_require__(142); 2750 })(); 2751 2752 (function checkObjectValues() { 2753 if (Object.values) { 2754 return; 2755 } 2756 2757 Object.values = __w_pdfjs_require__(144); 2758 })(); 2759} 2760 2761/***/ }), 2762/* 8 */ 2763/***/ (function(module, exports, __w_pdfjs_require__) { 2764 2765"use strict"; 2766 2767 2768module.exports = typeof window !== 'undefined' && window.Math === Math ? window : typeof global !== 'undefined' && global.Math === Math ? global : typeof self !== 'undefined' && self.Math === Math ? self : {}; 2769 2770/***/ }), 2771/* 9 */ 2772/***/ (function(module, exports, __w_pdfjs_require__) { 2773 2774"use strict"; 2775 2776 2777function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 2778 2779module.exports = function isNodeJS() { 2780 return (typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object' && process + '' === '[object process]' && !process.versions['nw']; 2781}; 2782 2783/***/ }), 2784/* 10 */ 2785/***/ (function(module, exports, __w_pdfjs_require__) { 2786 2787"use strict"; 2788 2789 2790__w_pdfjs_require__(11); 2791 2792module.exports = __w_pdfjs_require__(14).String.startsWith; 2793 2794/***/ }), 2795/* 11 */ 2796/***/ (function(module, exports, __w_pdfjs_require__) { 2797 2798"use strict"; 2799 2800 2801var $export = __w_pdfjs_require__(12); 2802 2803var toLength = __w_pdfjs_require__(30); 2804 2805var context = __w_pdfjs_require__(32); 2806 2807var STARTS_WITH = 'startsWith'; 2808var $startsWith = ''[STARTS_WITH]; 2809$export($export.P + $export.F * __w_pdfjs_require__(39)(STARTS_WITH), 'String', { 2810 startsWith: function startsWith(searchString) { 2811 var that = context(this, searchString, STARTS_WITH); 2812 var index = toLength(Math.min(arguments.length > 1 ? arguments[1] : undefined, that.length)); 2813 var search = String(searchString); 2814 return $startsWith ? $startsWith.call(that, search, index) : that.slice(index, index + search.length) === search; 2815 } 2816}); 2817 2818/***/ }), 2819/* 12 */ 2820/***/ (function(module, exports, __w_pdfjs_require__) { 2821 2822"use strict"; 2823 2824 2825var global = __w_pdfjs_require__(13); 2826 2827var core = __w_pdfjs_require__(14); 2828 2829var hide = __w_pdfjs_require__(15); 2830 2831var redefine = __w_pdfjs_require__(25); 2832 2833var ctx = __w_pdfjs_require__(28); 2834 2835var PROTOTYPE = 'prototype'; 2836
2837var $export = function $export(type, name, source) { 2838 var IS_FORCED = type & $export.F; 2839 var IS_GLOBAL = type & $export.G; 2840 var IS_STATIC = type & $export.S; 2841 var IS_PROTO = type & $export.P; 2842 var IS_BIND = type & $export.B; 2843 var target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE]; 2844 var exports = IS_GLOBAL ? core : core[name] || (core[name] = {}); 2845 var expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}); 2846 var key, own, out, exp; 2847 if (IS_GLOBAL) source = name; 2848 2849 for (key in source) { 2850 own = !IS_FORCED && target && target[key] !== undefined; 2851 out = (own ? target : source)[key]; 2852 exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; 2853 if (target) redefine(target, key, out, type & $export.U); 2854 if (exports[key] != out) hide(exports, key, exp); 2855 if (IS_PROTO && expProto[key] != out) expProto[key] = out; 2856 } 2857}; 2858 2859global.core = core; 2860$export.F = 1; 2861$export.G = 2; 2862$export.S = 4; 2863$export.P = 8; 2864$export.B = 16; 2865$export.W = 32; 2866$export.U = 64; 2867$export.R = 128; 2868module.exports = $export; 2869 2870/***/ }), 2871/* 13 */ 2872/***/ (function(module, exports, __w_pdfjs_require__) { 2873 2874"use strict"; 2875 2876 2877var global = module.exports = typeof window != 'undefined' && window.Math == Math ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); 2878if (typeof __g == 'number') __g = global; 2879 2880/***/ }), 2881/* 14 */ 2882/***/ (function(module, exports, __w_pdfjs_require__) { 2883 2884"use strict"; 2885 2886 2887var core = module.exports = { 2888 version: '2.6.2' 2889}; 2890if (typeof __e == 'number') __e = core; 2891 2892/***/ }), 2893/* 15 */ 2894/***/ (function(module, exports, __w_pdfjs_require__) { 2895 2896"use strict"; 2897 2898 2899var dP = __w_pdfjs_require__(16); 2900 2901var createDesc = __w_pdfjs_require__(24); 2902 2903module.exports = __w_pdfjs_require__(20) ? function (object, key, value) { 2904 return dP.f(object, key, createDesc(1, value)); 2905} : function (object, key, value) { 2906 object[key] = value; 2907 return object; 2908}; 2909 2910/***/ }), 2911/* 16 */ 2912/***/ (function(module, exports, __w_pdfjs_require__) { 2913 2914"use strict"; 2915 2916 2917var anObject = __w_pdfjs_require__(17); 2918 2919var IE8_DOM_DEFINE = __w_pdfjs_require__(19); 2920 2921var toPrimitive = __w_pdfjs_require__(23); 2922 2923var dP = Object.defineProperty; 2924exports.f = __w_pdfjs_require__(20) ? Object.defineProperty : function defineProperty(O, P, Attributes) { 2925 anObject(O); 2926 P = toPrimitive(P, true); 2927 anObject(Attributes); 2928 if (IE8_DOM_DEFINE) try { 2929 return dP(O, P, Attributes); 2930 } catch (e) {} 2931 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!'); 2932 if ('value' in Attributes) O[P] = Attributes.value; 2933 return O; 2934}; 2935 2936/***/ }), 2937/* 17 */ 2938/***/ (function(module, exports, __w_pdfjs_require__) { 2939 2940"use strict"; 2941 2942 2943var isObject = __w_pdfjs_require__(18); 2944 2945module.exports = function (it) { 2946 if (!isObject(it)) throw TypeError(it + ' is not an object!'); 2947 return it; 2948}; 2949 2950/***/ }), 2951/* 18 */ 2952/***/ (function(module, exports, __w_pdfjs_require__) { 2953 2954"use strict"; 2955 2956 2957function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 2958 2959module.exports = function (it) { 2960 return _typeof(it) === 'object' ? it !== null : typeof it === 'function'; 2961}; 2962 2963/***/ }), 2964/* 19 */ 2965/***/ (function(module, exports, __w_pdfjs_require__) { 2966 2967"use strict"; 2968 2969 2970module.exports = !__w_pdfjs_require__(20) && !__w_pdfjs_require__(21)(function () { 2971 return Object.defineProperty(__w_pdfjs_require__(22)('div'), 'a', { 2972 get: function get() { 2973 return 7; 2974 } 2975 }).a != 7; 2976}); 2977 2978/***/ }), 2979/* 20 */ 2980/***/ (function(module, exports, __w_pdfjs_require__) { 2981 2982"use strict"; 2983 2984 2985module.exports = !__w_pdfjs_require__(21)(function () { 2986 return Object.defineProperty({}, 'a', { 2987 get: function get() { 2988 return 7; 2989 } 2990 }).a != 7; 2991}); 2992 2993/***/ }), 2994/* 21 */ 2995/***/ (function(module, exports, __w_pdfjs_require__) { 2996 2997"use strict"; 2998 2999 3000module.exports = function (exec) { 3001 try { 3002 return !!exec();
vendor: 5,381 bytes, lines 3003-3261
3003 } catch (e) { 3004 return true; 3005 } 3006}; 3007 3008/***/ }), 3009/* 22 */ 3010/***/ (function(module, exports, __w_pdfjs_require__) { 3011 3012"use strict"; 3013 3014 3015var isObject = __w_pdfjs_require__(18); 3016 3017var document = __w_pdfjs_require__(13).document; 3018 3019var is = isObject(document) && isObject(document.createElement); 3020 3021module.exports = function (it) { 3022 return is ? document.createElement(it) : {}; 3023}; 3024 3025/***/ }), 3026/* 23 */ 3027/***/ (function(module, exports, __w_pdfjs_require__) { 3028 3029"use strict"; 3030 3031 3032var isObject = __w_pdfjs_require__(18); 3033 3034module.exports = function (it, S) { 3035 if (!isObject(it)) return it; 3036 var fn, val; 3037 if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; 3038 if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val; 3039 if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val; 3040 throw TypeError("Can't convert object to primitive value"); 3041}; 3042 3043/***/ }), 3044/* 24 */ 3045/***/ (function(module, exports, __w_pdfjs_require__) { 3046 3047"use strict"; 3048 3049 3050module.exports = function (bitmap, value) { 3051 return { 3052 enumerable: !(bitmap & 1), 3053 configurable: !(bitmap & 2), 3054 writable: !(bitmap & 4), 3055 value: value 3056 }; 3057}; 3058 3059/***/ }), 3060/* 25 */ 3061/***/ (function(module, exports, __w_pdfjs_require__) { 3062 3063"use strict"; 3064 3065 3066var global = __w_pdfjs_require__(13); 3067 3068var hide = __w_pdfjs_require__(15); 3069 3070var has = __w_pdfjs_require__(26); 3071 3072var SRC = __w_pdfjs_require__(27)('src'); 3073 3074var TO_STRING = 'toString'; 3075var $toString = Function[TO_STRING]; 3076var TPL = ('' + $toString).split(TO_STRING); 3077 3078__w_pdfjs_require__(14).inspectSource = function (it) { 3079 return $toString.call(it); 3080}; 3081 3082(module.exports = function (O, key, val, safe) { 3083 var isFunction = typeof val == 'function'; 3084 if (isFunction) has(val, 'name') || hide(val, 'name', key); 3085 if (O[key] === val) return; 3086 if (isFunction) has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); 3087 3088 if (O === global) { 3089 O[key] = val; 3090 } else if (!safe) { 3091 delete O[key]; 3092 hide(O, key, val); 3093 } else if (O[key]) { 3094 O[key] = val; 3095 } else { 3096 hide(O, key, val); 3097 } 3098})(Function.prototype, TO_STRING, function toString() { 3099 return typeof this == 'function' && this[SRC] || $toString.call(this); 3100}); 3101 3102/***/ }), 3103/* 26 */ 3104/***/ (function(module, exports, __w_pdfjs_require__) { 3105 3106"use strict"; 3107 3108 3109var hasOwnProperty = {}.hasOwnProperty; 3110 3111module.exports = function (it, key) { 3112 return hasOwnProperty.call(it, key); 3113}; 3114 3115/***/ }), 3116/* 27 */ 3117/***/ (function(module, exports, __w_pdfjs_require__) { 3118 3119"use strict"; 3120 3121 3122var id = 0; 3123var px = Math.random(); 3124 3125module.exports = function (key) { 3126 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); 3127}; 3128 3129/***/ }), 3130/* 28 */ 3131/***/ (function(module, exports, __w_pdfjs_require__) { 3132 3133"use strict"; 3134 3135 3136var aFunction = __w_pdfjs_require__(29); 3137 3138module.exports = function (fn, that, length) { 3139 aFunction(fn); 3140 if (that === undefined) return fn; 3141 3142 switch (length) { 3143 case 1: 3144 return function (a) { 3145 return fn.call(that, a); 3146 }; 3147 3148 case 2: 3149 return function (a, b) { 3150 return fn.call(that, a, b); 3151 }; 3152 3153 case 3: 3154 return function (a, b, c) { 3155 return fn.call(that, a, b, c); 3156 }; 3157 } 3158 3159 return function () { 3160 return fn.apply(that, arguments); 3161 }; 3162}; 3163 3164/***/ }), 3165/* 29 */ 3166/***/ (function(module, exports, __w_pdfjs_require__) { 3167 3168"use strict"; 3169 3170 3171module.exports = function (it) { 3172 if (typeof it != 'function') throw TypeError(it + ' is not a function!'); 3173 return it; 3174}; 3175 3176/***/ }), 3177/* 30 */ 3178/***/ (function(module, exports, __w_pdfjs_require__) { 3179 3180"use strict"; 3181 3182 3183var toInteger = __w_pdfjs_require__(31); 3184 3185var min = Math.min; 3186 3187module.exports = function (it) { 3188 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; 3189}; 3190 3191/***/ }), 3192/* 31 */ 3193/***/ (function(module, exports, __w_pdfjs_require__) { 3194 3195"use strict"; 3196 3197 3198var ceil = Math.ceil; 3199var floor = Math.floor; 3200 3201module.exports = function (it) { 3202 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); 3203}; 3204 3205/***/ }), 3206/* 32 */ 3207/***/ (function(module, exports, __w_pdfjs_require__) { 3208 3209"use strict"; 3210 3211 3212var isRegExp = __w_pdfjs_require__(33); 3213 3214var defined = __w_pdfjs_require__(38); 3215 3216module.exports = function (that, searchString, NAME) { 3217 if (isRegExp(searchString)) throw TypeError('String#' + NAME + " doesn't accept regex!"); 3218 return String(defined(that)); 3219}; 3220 3221/***/ }), 3222/* 33 */ 3223/***/ (function(module, exports, __w_pdfjs_require__) { 3224 3225"use strict"; 3226 3227 3228var isObject = __w_pdfjs_require__(18); 3229 3230var cof = __w_pdfjs_require__(34); 3231 3232var MATCH = __w_pdfjs_require__(35)('match'); 3233 3234module.exports = function (it) { 3235 var isRegExp; 3236 return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : cof(it) == 'RegExp'); 3237}; 3238 3239/***/ }), 3240/* 34 */ 3241/***/ (function(module, exports, __w_pdfjs_require__) { 3242 3243"use strict"; 3244 3245 3246var toString = {}.toString; 3247 3248module.exports = function (it) { 3249 return toString.call(it).slice(8, -1); 3250}; 3251 3252/***/ }), 3253/* 35 */ 3254/***/ (function(module, exports, __w_pdfjs_require__) { 3255 3256"use strict"; 3257 3258 3259var store = __w_pdfjs_require__(36)('wks'); 3260 3261var uid = __w_pdfjs_require__(27);
vendor: 4,296 bytes, lines 3262-3453
3262 3263var _Symbol = __w_pdfjs_require__(13).Symbol; 3264 3265var USE_SYMBOL = typeof _Symbol == 'function'; 3266 3267var $exports = module.exports = function (name) { 3268 return store[name] || (store[name] = USE_SYMBOL && _Symbol[name] || (USE_SYMBOL ? _Symbol : uid)('Symbol.' + name)); 3269}; 3270 3271$exports.store = store; 3272 3273/***/ }), 3274/* 36 */ 3275/***/ (function(module, exports, __w_pdfjs_require__) { 3276 3277"use strict"; 3278 3279 3280var core = __w_pdfjs_require__(14); 3281 3282var global = __w_pdfjs_require__(13); 3283 3284var SHARED = '__core-js_shared__'; 3285var store = global[SHARED] || (global[SHARED] = {}); 3286(module.exports = function (key, value) { 3287 return store[key] || (store[key] = value !== undefined ? value : {}); 3288})('versions', []).push({ 3289 version: core.version, 3290 mode: __w_pdfjs_require__(37) ? 'pure' : 'global', 3291 copyright: '© 2019 Denis Pushkarev (zloirock.ru)' 3292}); 3293 3294/***/ }), 3295/* 37 */ 3296/***/ (function(module, exports, __w_pdfjs_require__) { 3297 3298"use strict"; 3299 3300 3301module.exports = false; 3302 3303/***/ }), 3304/* 38 */ 3305/***/ (function(module, exports, __w_pdfjs_require__) { 3306 3307"use strict"; 3308 3309 3310module.exports = function (it) { 3311 if (it == undefined) throw TypeError("Can't call method on " + it); 3312 return it; 3313}; 3314 3315/***/ }), 3316/* 39 */ 3317/***/ (function(module, exports, __w_pdfjs_require__) { 3318 3319"use strict"; 3320 3321 3322var MATCH = __w_pdfjs_require__(35)('match'); 3323 3324module.exports = function (KEY) { 3325 var re = /./; 3326 3327 try { 3328 '/./'[KEY](re); 3329 } catch (e) { 3330 try { 3331 re[MATCH] = false; 3332 return !'/./'[KEY](re); 3333 } catch (f) {} 3334 } 3335 3336 return true; 3337}; 3338 3339/***/ }), 3340/* 40 */ 3341/***/ (function(module, exports, __w_pdfjs_require__) { 3342 3343"use strict"; 3344 3345 3346__w_pdfjs_require__(41); 3347 3348module.exports = __w_pdfjs_require__(14).String.endsWith; 3349 3350/***/ }), 3351/* 41 */ 3352/***/ (function(module, exports, __w_pdfjs_require__) { 3353 3354"use strict"; 3355 3356 3357var $export = __w_pdfjs_require__(12); 3358 3359var toLength = __w_pdfjs_require__(30); 3360 3361var context = __w_pdfjs_require__(32); 3362 3363var ENDS_WITH = 'endsWith'; 3364var $endsWith = ''[ENDS_WITH]; 3365$export($export.P + $export.F * __w_pdfjs_require__(39)(ENDS_WITH), 'String', { 3366 endsWith: function endsWith(searchString) { 3367 var that = context(this, searchString, ENDS_WITH); 3368 var endPosition = arguments.length > 1 ? arguments[1] : undefined; 3369 var len = toLength(that.length); 3370 var end = endPosition === undefined ? len : Math.min(toLength(endPosition), len); 3371 var search = String(searchString); 3372 return $endsWith ? $endsWith.call(that, search, end) : that.slice(end - search.length, end) === search; 3373 } 3374}); 3375 3376/***/ }), 3377/* 42 */ 3378/***/ (function(module, exports, __w_pdfjs_require__) { 3379 3380"use strict"; 3381 3382 3383__w_pdfjs_require__(43); 3384 3385module.exports = __w_pdfjs_require__(14).String.includes; 3386 3387/***/ }), 3388/* 43 */ 3389/***/ (function(module, exports, __w_pdfjs_require__) { 3390 3391"use strict"; 3392 3393 3394var $export = __w_pdfjs_require__(12); 3395 3396var context = __w_pdfjs_require__(32); 3397 3398var INCLUDES = 'includes'; 3399$export($export.P + $export.F * __w_pdfjs_require__(39)(INCLUDES), 'String', { 3400 includes: function includes(searchString) { 3401 return !!~context(this, searchString, INCLUDES).indexOf(searchString, arguments.length > 1 ? arguments[1] : undefined); 3402 } 3403}); 3404 3405/***/ }), 3406/* 44 */ 3407/***/ (function(module, exports, __w_pdfjs_require__) { 3408 3409"use strict"; 3410 3411 3412__w_pdfjs_require__(45); 3413 3414module.exports = __w_pdfjs_require__(14).Array.includes; 3415 3416/***/ }), 3417/* 45 */ 3418/***/ (function(module, exports, __w_pdfjs_require__) { 3419 3420"use strict"; 3421 3422 3423var $export = __w_pdfjs_require__(12); 3424 3425var $includes = __w_pdfjs_require__(46)(true); 3426 3427$export($export.P, 'Array', { 3428 includes: function includes(el) { 3429 return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined); 3430 } 3431}); 3432 3433__w_pdfjs_require__(50)('includes'); 3434 3435/***/ }), 3436/* 46 */ 3437/***/ (function(module, exports, __w_pdfjs_require__) { 3438 3439"use strict"; 3440 3441 3442var toIObject = __w_pdfjs_require__(47); 3443 3444var toLength = __w_pdfjs_require__(30); 3445 3446var toAbsoluteIndex = __w_pdfjs_require__(49); 3447 3448module.exports = function (IS_INCLUDES) { 3449 return function ($this, el, fromIndex) { 3450 var O = toIObject($this); 3451 var length = toLength(O.length); 3452 var index = toAbsoluteIndex(fromIndex, length); 3453 var value;
vendor: 9,578 bytes, lines 3454-3875
3454 if (IS_INCLUDES && el != el) while (length > index) { 3455 value = O[index++]; 3456 if (value != value) return true; 3457 } else for (; length > index; index++) { 3458 if (IS_INCLUDES || index in O) { 3459 if (O[index] === el) return IS_INCLUDES || index || 0; 3460 } 3461 } 3462 return !IS_INCLUDES && -1; 3463 }; 3464}; 3465 3466/***/ }), 3467/* 47 */ 3468/***/ (function(module, exports, __w_pdfjs_require__) { 3469 3470"use strict"; 3471 3472 3473var IObject = __w_pdfjs_require__(48); 3474 3475var defined = __w_pdfjs_require__(38); 3476 3477module.exports = function (it) { 3478 return IObject(defined(it)); 3479}; 3480 3481/***/ }), 3482/* 48 */ 3483/***/ (function(module, exports, __w_pdfjs_require__) { 3484 3485"use strict"; 3486 3487 3488var cof = __w_pdfjs_require__(34); 3489 3490module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { 3491 return cof(it) == 'String' ? it.split('') : Object(it); 3492}; 3493 3494/***/ }), 3495/* 49 */ 3496/***/ (function(module, exports, __w_pdfjs_require__) { 3497 3498"use strict"; 3499 3500 3501var toInteger = __w_pdfjs_require__(31); 3502 3503var max = Math.max; 3504var min = Math.min; 3505 3506module.exports = function (index, length) { 3507 index = toInteger(index); 3508 return index < 0 ? max(index + length, 0) : min(index, length); 3509}; 3510 3511/***/ }), 3512/* 50 */ 3513/***/ (function(module, exports, __w_pdfjs_require__) { 3514 3515"use strict"; 3516 3517 3518var UNSCOPABLES = __w_pdfjs_require__(35)('unscopables'); 3519 3520var ArrayProto = Array.prototype; 3521if (ArrayProto[UNSCOPABLES] == undefined) __w_pdfjs_require__(15)(ArrayProto, UNSCOPABLES, {}); 3522 3523module.exports = function (key) { 3524 ArrayProto[UNSCOPABLES][key] = true; 3525}; 3526 3527/***/ }), 3528/* 51 */ 3529/***/ (function(module, exports, __w_pdfjs_require__) { 3530 3531"use strict"; 3532 3533 3534__w_pdfjs_require__(52); 3535 3536__w_pdfjs_require__(67); 3537 3538module.exports = __w_pdfjs_require__(14).Array.from; 3539 3540/***/ }), 3541/* 52 */ 3542/***/ (function(module, exports, __w_pdfjs_require__) { 3543 3544"use strict"; 3545 3546 3547var $at = __w_pdfjs_require__(53)(true); 3548 3549__w_pdfjs_require__(54)(String, 'String', function (iterated) { 3550 this._t = String(iterated); 3551 this._i = 0; 3552}, function () { 3553 var O = this._t; 3554 var index = this._i; 3555 var point; 3556 if (index >= O.length) return { 3557 value: undefined, 3558 done: true 3559 }; 3560 point = $at(O, index); 3561 this._i += point.length; 3562 return { 3563 value: point, 3564 done: false 3565 }; 3566}); 3567 3568/***/ }), 3569/* 53 */ 3570/***/ (function(module, exports, __w_pdfjs_require__) { 3571 3572"use strict"; 3573 3574 3575var toInteger = __w_pdfjs_require__(31); 3576 3577var defined = __w_pdfjs_require__(38); 3578 3579module.exports = function (TO_STRING) { 3580 return function (that, pos) { 3581 var s = String(defined(that)); 3582 var i = toInteger(pos); 3583 var l = s.length; 3584 var a, b; 3585 if (i < 0 || i >= l) return TO_STRING ? '' : undefined; 3586 a = s.charCodeAt(i); 3587 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff ? TO_STRING ? s.charAt(i) : a : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000; 3588 }; 3589}; 3590 3591/***/ }), 3592/* 54 */ 3593/***/ (function(module, exports, __w_pdfjs_require__) { 3594 3595"use strict"; 3596 3597 3598var LIBRARY = __w_pdfjs_require__(37); 3599 3600var $export = __w_pdfjs_require__(12); 3601 3602var redefine = __w_pdfjs_require__(25); 3603 3604var hide = __w_pdfjs_require__(15); 3605 3606var Iterators = __w_pdfjs_require__(55); 3607 3608var $iterCreate = __w_pdfjs_require__(56); 3609 3610var setToStringTag = __w_pdfjs_require__(64); 3611 3612var getPrototypeOf = __w_pdfjs_require__(65); 3613 3614var ITERATOR = __w_pdfjs_require__(35)('iterator'); 3615 3616var BUGGY = !([].keys && 'next' in [].keys()); 3617var FF_ITERATOR = '@@iterator'; 3618var KEYS = 'keys'; 3619var VALUES = 'values'; 3620 3621var returnThis = function returnThis() { 3622 return this; 3623}; 3624 3625module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) { 3626 $iterCreate(Constructor, NAME, next); 3627 3628 var getMethod = function getMethod(kind) { 3629 if (!BUGGY && kind in proto) return proto[kind]; 3630 3631 switch (kind) { 3632 case KEYS: 3633 return function keys() { 3634 return new Constructor(this, kind); 3635 }; 3636 3637 case VALUES: 3638 return function values() { 3639 return new Constructor(this, kind); 3640 }; 3641 } 3642 3643 return function entries() { 3644 return new Constructor(this, kind); 3645 }; 3646 }; 3647 3648 var TAG = NAME + ' Iterator'; 3649 var DEF_VALUES = DEFAULT == VALUES; 3650 var VALUES_BUG = false; 3651 var proto = Base.prototype; 3652 var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT]; 3653 var $default = $native || getMethod(DEFAULT); 3654 var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined; 3655 var $anyNative = NAME == 'Array' ? proto.entries || $native : $native; 3656 var methods, key, IteratorPrototype; 3657 3658 if ($anyNative) { 3659 IteratorPrototype = getPrototypeOf($anyNative.call(new Base())); 3660 3661 if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) { 3662 setToStringTag(IteratorPrototype, TAG, true); 3663 if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis); 3664 } 3665 } 3666 3667 if (DEF_VALUES && $native && $native.name !== VALUES) { 3668 VALUES_BUG = true; 3669 3670 $default = function values() { 3671 return $native.call(this); 3672 }; 3673 } 3674 3675 if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) { 3676 hide(proto, ITERATOR, $default); 3677 } 3678 3679 Iterators[NAME] = $default; 3680 Iterators[TAG] = returnThis; 3681 3682 if (DEFAULT) { 3683 methods = { 3684 values: DEF_VALUES ? $default : getMethod(VALUES), 3685 keys: IS_SET ? $default : getMethod(KEYS), 3686 entries: $entries 3687 }; 3688 if (FORCED) for (key in methods) { 3689 if (!(key in proto)) redefine(proto, key, methods[key]); 3690 } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); 3691 } 3692 3693 return methods; 3694}; 3695 3696/***/ }), 3697/* 55 */ 3698/***/ (function(module, exports, __w_pdfjs_require__) { 3699 3700"use strict"; 3701 3702 3703module.exports = {}; 3704 3705/***/ }), 3706/* 56 */ 3707/***/ (function(module, exports, __w_pdfjs_require__) { 3708 3709"use strict"; 3710 3711 3712var create = __w_pdfjs_require__(57); 3713 3714var descriptor = __w_pdfjs_require__(24); 3715 3716var setToStringTag = __w_pdfjs_require__(64); 3717 3718var IteratorPrototype = {}; 3719 3720__w_pdfjs_require__(15)(IteratorPrototype, __w_pdfjs_require__(35)('iterator'), function () { 3721 return this; 3722}); 3723 3724module.exports = function (Constructor, NAME, next) { 3725 Constructor.prototype = create(IteratorPrototype, { 3726 next: descriptor(1, next) 3727 }); 3728 setToStringTag(Constructor, NAME + ' Iterator'); 3729}; 3730 3731/***/ }), 3732/* 57 */ 3733/***/ (function(module, exports, __w_pdfjs_require__) { 3734 3735"use strict"; 3736 3737 3738var anObject = __w_pdfjs_require__(17); 3739 3740var dPs = __w_pdfjs_require__(58); 3741 3742var enumBugKeys = __w_pdfjs_require__(62); 3743 3744var IE_PROTO = __w_pdfjs_require__(61)('IE_PROTO'); 3745 3746var Empty = function Empty() {}; 3747 3748var PROTOTYPE = 'prototype'; 3749 3750var _createDict = function createDict() { 3751 var iframe = __w_pdfjs_require__(22)('iframe'); 3752 3753 var i = enumBugKeys.length; 3754 var lt = '<'; 3755 var gt = '>'; 3756 var iframeDocument; 3757 iframe.style.display = 'none'; 3758 3759 __w_pdfjs_require__(63).appendChild(iframe); 3760 3761 iframe.src = 'javascript:'; 3762 iframeDocument = iframe.contentWindow.document; 3763 iframeDocument.open(); 3764 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); 3765 iframeDocument.close(); 3766 _createDict = iframeDocument.F; 3767 3768 while (i--) { 3769 delete _createDict[PROTOTYPE][enumBugKeys[i]]; 3770 } 3771 3772 return _createDict(); 3773}; 3774 3775module.exports = Object.create || function create(O, Properties) { 3776 var result; 3777 3778 if (O !== null) { 3779 Empty[PROTOTYPE] = anObject(O); 3780 result = new Empty(); 3781 Empty[PROTOTYPE] = null; 3782 result[IE_PROTO] = O; 3783 } else result = _createDict(); 3784 3785 return Properties === undefined ? result : dPs(result, Properties); 3786}; 3787 3788/***/ }), 3789/* 58 */ 3790/***/ (function(module, exports, __w_pdfjs_require__) { 3791 3792"use strict"; 3793 3794 3795var dP = __w_pdfjs_require__(16); 3796 3797var anObject = __w_pdfjs_require__(17); 3798 3799var getKeys = __w_pdfjs_require__(59); 3800 3801module.exports = __w_pdfjs_require__(20) ? Object.defineProperties : function defineProperties(O, Properties) { 3802 anObject(O); 3803 var keys = getKeys(Properties); 3804 var length = keys.length; 3805 var i = 0; 3806 var P; 3807 3808 while (length > i) { 3809 dP.f(O, P = keys[i++], Properties[P]); 3810 } 3811 3812 return O; 3813}; 3814 3815/***/ }), 3816/* 59 */ 3817/***/ (function(module, exports, __w_pdfjs_require__) { 3818 3819"use strict"; 3820 3821 3822var $keys = __w_pdfjs_require__(60); 3823 3824var enumBugKeys = __w_pdfjs_require__(62); 3825 3826module.exports = Object.keys || function keys(O) { 3827 return $keys(O, enumBugKeys); 3828}; 3829 3830/***/ }), 3831/* 60 */ 3832/***/ (function(module, exports, __w_pdfjs_require__) { 3833 3834"use strict"; 3835 3836 3837var has = __w_pdfjs_require__(26); 3838 3839var toIObject = __w_pdfjs_require__(47); 3840 3841var arrayIndexOf = __w_pdfjs_require__(46)(false); 3842 3843var IE_PROTO = __w_pdfjs_require__(61)('IE_PROTO'); 3844 3845module.exports = function (object, names) { 3846 var O = toIObject(object); 3847 var i = 0; 3848 var result = []; 3849 var key; 3850 3851 for (key in O) { 3852 if (key != IE_PROTO) has(O, key) && result.push(key); 3853 } 3854 3855 while (names.length > i) { 3856 if (has(O, key = names[i++])) { 3857 ~arrayIndexOf(result, key) || result.push(key); 3858 } 3859 } 3860 3861 return result; 3862}; 3863 3864/***/ }), 3865/* 61 */ 3866/***/ (function(module, exports, __w_pdfjs_require__) { 3867 3868"use strict"; 3869 3870 3871var shared = __w_pdfjs_require__(36)('keys'); 3872 3873var uid = __w_pdfjs_require__(27); 3874 3875module.exports = function (key) {
vendor: 4,510 bytes, lines 3876-4071
3876 return shared[key] || (shared[key] = uid(key)); 3877}; 3878 3879/***/ }), 3880/* 62 */ 3881/***/ (function(module, exports, __w_pdfjs_require__) { 3882 3883"use strict"; 3884 3885 3886module.exports = 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'.split(','); 3887 3888/***/ }), 3889/* 63 */ 3890/***/ (function(module, exports, __w_pdfjs_require__) { 3891 3892"use strict"; 3893 3894 3895var document = __w_pdfjs_require__(13).document; 3896 3897module.exports = document && document.documentElement; 3898 3899/***/ }), 3900/* 64 */ 3901/***/ (function(module, exports, __w_pdfjs_require__) { 3902 3903"use strict"; 3904 3905 3906var def = __w_pdfjs_require__(16).f; 3907 3908var has = __w_pdfjs_require__(26); 3909 3910var TAG = __w_pdfjs_require__(35)('toStringTag'); 3911 3912module.exports = function (it, tag, stat) { 3913 if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { 3914 configurable: true, 3915 value: tag 3916 }); 3917}; 3918 3919/***/ }), 3920/* 65 */ 3921/***/ (function(module, exports, __w_pdfjs_require__) { 3922 3923"use strict"; 3924 3925 3926var has = __w_pdfjs_require__(26); 3927 3928var toObject = __w_pdfjs_require__(66); 3929 3930var IE_PROTO = __w_pdfjs_require__(61)('IE_PROTO'); 3931 3932var ObjectProto = Object.prototype; 3933 3934module.exports = Object.getPrototypeOf || function (O) { 3935 O = toObject(O); 3936 if (has(O, IE_PROTO)) return O[IE_PROTO]; 3937 3938 if (typeof O.constructor == 'function' && O instanceof O.constructor) { 3939 return O.constructor.prototype; 3940 } 3941 3942 return O instanceof Object ? ObjectProto : null; 3943}; 3944 3945/***/ }), 3946/* 66 */ 3947/***/ (function(module, exports, __w_pdfjs_require__) { 3948 3949"use strict"; 3950 3951 3952var defined = __w_pdfjs_require__(38); 3953 3954module.exports = function (it) { 3955 return Object(defined(it)); 3956}; 3957 3958/***/ }), 3959/* 67 */ 3960/***/ (function(module, exports, __w_pdfjs_require__) { 3961 3962"use strict"; 3963 3964 3965var ctx = __w_pdfjs_require__(28); 3966 3967var $export = __w_pdfjs_require__(12); 3968 3969var toObject = __w_pdfjs_require__(66); 3970 3971var call = __w_pdfjs_require__(68); 3972 3973var isArrayIter = __w_pdfjs_require__(69); 3974 3975var toLength = __w_pdfjs_require__(30); 3976 3977var createProperty = __w_pdfjs_require__(70); 3978 3979var getIterFn = __w_pdfjs_require__(71); 3980 3981$export($export.S + $export.F * !__w_pdfjs_require__(73)(function (iter) { 3982 Array.from(iter); 3983}), 'Array', { 3984 from: function from(arrayLike) { 3985 var O = toObject(arrayLike); 3986 var C = typeof this == 'function' ? this : Array; 3987 var aLen = arguments.length; 3988 var mapfn = aLen > 1 ? arguments[1] : undefined; 3989 var mapping = mapfn !== undefined; 3990 var index = 0; 3991 var iterFn = getIterFn(O); 3992 var length, result, step, iterator; 3993 if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); 3994 3995 if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) { 3996 for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) { 3997 createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); 3998 } 3999 } else { 4000 length = toLength(O.length); 4001 4002 for (result = new C(length); length > index; index++) { 4003 createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); 4004 } 4005 } 4006 4007 result.length = index; 4008 return result; 4009 } 4010}); 4011 4012/***/ }), 4013/* 68 */ 4014/***/ (function(module, exports, __w_pdfjs_require__) { 4015 4016"use strict"; 4017 4018 4019var anObject = __w_pdfjs_require__(17); 4020 4021module.exports = function (iterator, fn, value, entries) { 4022 try { 4023 return entries ? fn(anObject(value)[0], value[1]) : fn(value); 4024 } catch (e) { 4025 var ret = iterator['return']; 4026 if (ret !== undefined) anObject(ret.call(iterator)); 4027 throw e; 4028 } 4029}; 4030 4031/***/ }), 4032/* 69 */ 4033/***/ (function(module, exports, __w_pdfjs_require__) { 4034 4035"use strict"; 4036 4037 4038var Iterators = __w_pdfjs_require__(55); 4039 4040var ITERATOR = __w_pdfjs_require__(35)('iterator'); 4041 4042var ArrayProto = Array.prototype; 4043 4044module.exports = function (it) { 4045 return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); 4046}; 4047 4048/***/ }), 4049/* 70 */ 4050/***/ (function(module, exports, __w_pdfjs_require__) { 4051 4052"use strict"; 4053 4054 4055var $defineProperty = __w_pdfjs_require__(16); 4056 4057var createDesc = __w_pdfjs_require__(24); 4058 4059module.exports = function (object, index, value) { 4060 if (index in object) $defineProperty.f(object, index, createDesc(0, value));else object[index] = value; 4061}; 4062 4063/***/ }), 4064/* 71 */ 4065/***/ (function(module, exports, __w_pdfjs_require__) { 4066 4067"use strict"; 4068 4069 4070var classof = __w_pdfjs_require__(72); 4071
vendor: 4,235 bytes, lines 4072-4288
4072var ITERATOR = __w_pdfjs_require__(35)('iterator'); 4073 4074var Iterators = __w_pdfjs_require__(55); 4075 4076module.exports = __w_pdfjs_require__(14).getIteratorMethod = function (it) { 4077 if (it != undefined) return it[ITERATOR] || it['@@iterator'] || Iterators[classof(it)]; 4078}; 4079 4080/***/ }), 4081/* 72 */ 4082/***/ (function(module, exports, __w_pdfjs_require__) { 4083 4084"use strict"; 4085 4086 4087var cof = __w_pdfjs_require__(34); 4088 4089var TAG = __w_pdfjs_require__(35)('toStringTag'); 4090 4091var ARG = cof(function () { 4092 return arguments; 4093}()) == 'Arguments'; 4094 4095var tryGet = function tryGet(it, key) { 4096 try { 4097 return it[key]; 4098 } catch (e) {} 4099}; 4100 4101module.exports = function (it) { 4102 var O, T, B; 4103 return it === undefined ? 'Undefined' : it === null ? 'Null' : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T : ARG ? cof(O) : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; 4104}; 4105 4106/***/ }), 4107/* 73 */ 4108/***/ (function(module, exports, __w_pdfjs_require__) { 4109 4110"use strict"; 4111 4112 4113var ITERATOR = __w_pdfjs_require__(35)('iterator'); 4114 4115var SAFE_CLOSING = false; 4116 4117try { 4118 var riter = [7][ITERATOR](); 4119 4120 riter['return'] = function () { 4121 SAFE_CLOSING = true; 4122 }; 4123 4124 Array.from(riter, function () { 4125 throw 2; 4126 }); 4127} catch (e) {} 4128 4129module.exports = function (exec, skipClosing) { 4130 if (!skipClosing && !SAFE_CLOSING) return false; 4131 var safe = false; 4132 4133 try { 4134 var arr = [7]; 4135 var iter = arr[ITERATOR](); 4136 4137 iter.next = function () { 4138 return { 4139 done: safe = true 4140 }; 4141 }; 4142 4143 arr[ITERATOR] = function () { 4144 return iter; 4145 }; 4146 4147 exec(arr); 4148 } catch (e) {} 4149 4150 return safe; 4151}; 4152 4153/***/ }), 4154/* 74 */ 4155/***/ (function(module, exports, __w_pdfjs_require__) { 4156 4157"use strict"; 4158 4159 4160__w_pdfjs_require__(75); 4161 4162module.exports = __w_pdfjs_require__(14).Object.assign; 4163 4164/***/ }), 4165/* 75 */ 4166/***/ (function(module, exports, __w_pdfjs_require__) { 4167 4168"use strict"; 4169 4170 4171var $export = __w_pdfjs_require__(12); 4172 4173$export($export.S + $export.F, 'Object', { 4174 assign: __w_pdfjs_require__(76) 4175}); 4176 4177/***/ }), 4178/* 76 */ 4179/***/ (function(module, exports, __w_pdfjs_require__) { 4180 4181"use strict"; 4182 4183 4184var getKeys = __w_pdfjs_require__(59); 4185 4186var gOPS = __w_pdfjs_require__(77); 4187 4188var pIE = __w_pdfjs_require__(78); 4189 4190var toObject = __w_pdfjs_require__(66); 4191 4192var IObject = __w_pdfjs_require__(48); 4193 4194var $assign = Object.assign; 4195module.exports = !$assign || __w_pdfjs_require__(21)(function () { 4196 var A = {}; 4197 var B = {}; 4198 var S = Symbol(); 4199 var K = 'abcdefghijklmnopqrst'; 4200 A[S] = 7; 4201 K.split('').forEach(function (k) { 4202 B[k] = k; 4203 }); 4204 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; 4205}) ? function assign(target, source) { 4206 var T = toObject(target); 4207 var aLen = arguments.length; 4208 var index = 1; 4209 var getSymbols = gOPS.f; 4210 var isEnum = pIE.f; 4211 4212 while (aLen > index) { 4213 var S = IObject(arguments[index++]); 4214 var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S); 4215 var length = keys.length; 4216 var j = 0; 4217 var key; 4218 4219 while (length > j) { 4220 if (isEnum.call(S, key = keys[j++])) T[key] = S[key]; 4221 } 4222 } 4223 4224 return T; 4225} : $assign; 4226 4227/***/ }), 4228/* 77 */ 4229/***/ (function(module, exports, __w_pdfjs_require__) { 4230 4231"use strict"; 4232 4233 4234exports.f = Object.getOwnPropertySymbols; 4235 4236/***/ }), 4237/* 78 */ 4238/***/ (function(module, exports, __w_pdfjs_require__) { 4239 4240"use strict"; 4241 4242 4243exports.f = {}.propertyIsEnumerable; 4244 4245/***/ }), 4246/* 79 */ 4247/***/ (function(module, exports, __w_pdfjs_require__) { 4248 4249"use strict"; 4250 4251 4252__w_pdfjs_require__(80); 4253 4254module.exports = __w_pdfjs_require__(14).Math.log2; 4255 4256/***/ }), 4257/* 80 */ 4258/***/ (function(module, exports, __w_pdfjs_require__) { 4259 4260"use strict"; 4261 4262 4263var $export = __w_pdfjs_require__(12); 4264 4265$export($export.S, 'Math', { 4266 log2: function log2(x) { 4267 return Math.log(x) / Math.LN2; 4268 } 4269}); 4270 4271/***/ }), 4272/* 81 */ 4273/***/ (function(module, exports, __w_pdfjs_require__) { 4274 4275"use strict"; 4276 4277 4278__w_pdfjs_require__(82); 4279 4280module.exports = __w_pdfjs_require__(14).Number.isNaN; 4281 4282/***/ }), 4283/* 82 */ 4284/***/ (function(module, exports, __w_pdfjs_require__) { 4285 4286"use strict"; 4287 4288
vendor: 4,502 bytes, lines 4289-4500
4289var $export = __w_pdfjs_require__(12); 4290 4291$export($export.S, 'Number', { 4292 isNaN: function isNaN(number) { 4293 return number != number; 4294 } 4295}); 4296 4297/***/ }), 4298/* 83 */ 4299/***/ (function(module, exports, __w_pdfjs_require__) { 4300 4301"use strict"; 4302 4303 4304__w_pdfjs_require__(84); 4305 4306module.exports = __w_pdfjs_require__(14).Number.isInteger; 4307 4308/***/ }), 4309/* 84 */ 4310/***/ (function(module, exports, __w_pdfjs_require__) { 4311 4312"use strict"; 4313 4314 4315var $export = __w_pdfjs_require__(12); 4316 4317$export($export.S, 'Number', { 4318 isInteger: __w_pdfjs_require__(85) 4319}); 4320 4321/***/ }), 4322/* 85 */ 4323/***/ (function(module, exports, __w_pdfjs_require__) { 4324 4325"use strict"; 4326 4327 4328var isObject = __w_pdfjs_require__(18); 4329 4330var floor = Math.floor; 4331 4332module.exports = function isInteger(it) { 4333 return !isObject(it) && isFinite(it) && floor(it) === it; 4334}; 4335 4336/***/ }), 4337/* 86 */ 4338/***/ (function(module, exports, __w_pdfjs_require__) { 4339 4340"use strict"; 4341 4342 4343__w_pdfjs_require__(87); 4344 4345__w_pdfjs_require__(52); 4346 4347__w_pdfjs_require__(88); 4348 4349__w_pdfjs_require__(91); 4350 4351__w_pdfjs_require__(104); 4352 4353__w_pdfjs_require__(105); 4354 4355module.exports = __w_pdfjs_require__(14).Promise; 4356 4357/***/ }), 4358/* 87 */ 4359/***/ (function(module, exports, __w_pdfjs_require__) { 4360 4361"use strict"; 4362 4363 4364var classof = __w_pdfjs_require__(72); 4365 4366var test = {}; 4367test[__w_pdfjs_require__(35)('toStringTag')] = 'z'; 4368 4369if (test + '' != '[object z]') { 4370 __w_pdfjs_require__(25)(Object.prototype, 'toString', function toString() { 4371 return '[object ' + classof(this) + ']'; 4372 }, true); 4373} 4374 4375/***/ }), 4376/* 88 */ 4377/***/ (function(module, exports, __w_pdfjs_require__) { 4378 4379"use strict"; 4380 4381 4382var $iterators = __w_pdfjs_require__(89); 4383 4384var getKeys = __w_pdfjs_require__(59); 4385 4386var redefine = __w_pdfjs_require__(25); 4387 4388var global = __w_pdfjs_require__(13); 4389 4390var hide = __w_pdfjs_require__(15); 4391 4392var Iterators = __w_pdfjs_require__(55); 4393 4394var wks = __w_pdfjs_require__(35); 4395 4396var ITERATOR = wks('iterator'); 4397var TO_STRING_TAG = wks('toStringTag'); 4398var ArrayValues = Iterators.Array; 4399var DOMIterables = { 4400 CSSRuleList: true, 4401 CSSStyleDeclaration: false, 4402 CSSValueList: false, 4403 ClientRectList: false, 4404 DOMRectList: false, 4405 DOMStringList: false, 4406 DOMTokenList: true, 4407 DataTransferItemList: false, 4408 FileList: false, 4409 HTMLAllCollection: false, 4410 HTMLCollection: false, 4411 HTMLFormElement: false, 4412 HTMLSelectElement: false, 4413 MediaList: true, 4414 MimeTypeArray: false, 4415 NamedNodeMap: false, 4416 NodeList: true, 4417 PaintRequestList: false, 4418 Plugin: false, 4419 PluginArray: false, 4420 SVGLengthList: false, 4421 SVGNumberList: false, 4422 SVGPathSegList: false, 4423 SVGPointList: false, 4424 SVGStringList: false, 4425 SVGTransformList: false, 4426 SourceBufferList: false, 4427 StyleSheetList: true, 4428 TextTrackCueList: false, 4429 TextTrackList: false, 4430 TouchList: false 4431}; 4432 4433for (var collections = getKeys(DOMIterables), i = 0; i < collections.length; i++) { 4434 var NAME = collections[i]; 4435 var explicit = DOMIterables[NAME]; 4436 var Collection = global[NAME]; 4437 var proto = Collection && Collection.prototype; 4438 var key; 4439 4440 if (proto) { 4441 if (!proto[ITERATOR]) hide(proto, ITERATOR, ArrayValues); 4442 if (!proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME); 4443 Iterators[NAME] = ArrayValues; 4444 if (explicit) for (key in $iterators) { 4445 if (!proto[key]) redefine(proto, key, $iterators[key], true); 4446 } 4447 } 4448} 4449 4450/***/ }), 4451/* 89 */ 4452/***/ (function(module, exports, __w_pdfjs_require__) { 4453 4454"use strict"; 4455 4456 4457var addToUnscopables = __w_pdfjs_require__(50); 4458 4459var step = __w_pdfjs_require__(90); 4460 4461var Iterators = __w_pdfjs_require__(55); 4462 4463var toIObject = __w_pdfjs_require__(47); 4464 4465module.exports = __w_pdfjs_require__(54)(Array, 'Array', function (iterated, kind) { 4466 this._t = toIObject(iterated); 4467 this._i = 0; 4468 this._k = kind; 4469}, function () { 4470 var O = this._t; 4471 var kind = this._k; 4472 var index = this._i++; 4473 4474 if (!O || index >= O.length) { 4475 this._t = undefined; 4476 return step(1); 4477 } 4478 4479 if (kind == 'keys') return step(0, index); 4480 if (kind == 'values') return step(0, O[index]); 4481 return step(0, [index, O[index]]); 4482}, 'values'); 4483Iterators.Arguments = Iterators.Array; 4484addToUnscopables('keys'); 4485addToUnscopables('values'); 4486addToUnscopables('entries'); 4487 4488/***/ }), 4489/* 90 */ 4490/***/ (function(module, exports, __w_pdfjs_require__) { 4491 4492"use strict"; 4493 4494 4495module.exports = function (done, value) { 4496 return { 4497 value: value, 4498 done: !!done 4499 }; 4500};
vendor: 5,104 bytes, lines 4501-4690
4501 4502/***/ }), 4503/* 91 */ 4504/***/ (function(module, exports, __w_pdfjs_require__) { 4505 4506"use strict"; 4507 4508 4509var LIBRARY = __w_pdfjs_require__(37); 4510 4511var global = __w_pdfjs_require__(13); 4512 4513var ctx = __w_pdfjs_require__(28); 4514 4515var classof = __w_pdfjs_require__(72); 4516 4517var $export = __w_pdfjs_require__(12); 4518 4519var isObject = __w_pdfjs_require__(18); 4520 4521var aFunction = __w_pdfjs_require__(29); 4522 4523var anInstance = __w_pdfjs_require__(92); 4524 4525var forOf = __w_pdfjs_require__(93); 4526 4527var speciesConstructor = __w_pdfjs_require__(94); 4528 4529var task = __w_pdfjs_require__(95).set; 4530 4531var microtask = __w_pdfjs_require__(97)(); 4532 4533var newPromiseCapabilityModule = __w_pdfjs_require__(98); 4534 4535var perform = __w_pdfjs_require__(99); 4536 4537var userAgent = __w_pdfjs_require__(100); 4538 4539var promiseResolve = __w_pdfjs_require__(101); 4540 4541var PROMISE = 'Promise'; 4542var TypeError = global.TypeError; 4543var process = global.process; 4544var versions = process && process.versions; 4545var v8 = versions && versions.v8 || ''; 4546var $Promise = global[PROMISE]; 4547var isNode = classof(process) == 'process'; 4548 4549var empty = function empty() {}; 4550 4551var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper; 4552var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f; 4553var USE_NATIVE = !!function () { 4554 try { 4555 var promise = $Promise.resolve(1); 4556 4557 var FakePromise = (promise.constructor = {})[__w_pdfjs_require__(35)('species')] = function (exec) { 4558 exec(empty, empty); 4559 }; 4560 4561 return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise && v8.indexOf('6.6') !== 0 && userAgent.indexOf('Chrome/66') === -1; 4562 } catch (e) {} 4563}(); 4564 4565var isThenable = function isThenable(it) { 4566 var then; 4567 return isObject(it) && typeof (then = it.then) == 'function' ? then : false; 4568}; 4569 4570var notify = function notify(promise, isReject) { 4571 if (promise._n) return; 4572 promise._n = true; 4573 var chain = promise._c; 4574 microtask(function () { 4575 var value = promise._v; 4576 var ok = promise._s == 1; 4577 var i = 0; 4578 4579 var run = function run(reaction) { 4580 var handler = ok ? reaction.ok : reaction.fail; 4581 var resolve = reaction.resolve; 4582 var reject = reaction.reject; 4583 var domain = reaction.domain; 4584 var result, then, exited; 4585 4586 try { 4587 if (handler) { 4588 if (!ok) { 4589 if (promise._h == 2) onHandleUnhandled(promise); 4590 promise._h = 1; 4591 } 4592 4593 if (handler === true) result = value;else { 4594 if (domain) domain.enter(); 4595 result = handler(value); 4596 4597 if (domain) { 4598 domain.exit(); 4599 exited = true; 4600 } 4601 } 4602 4603 if (result === reaction.promise) { 4604 reject(TypeError('Promise-chain cycle')); 4605 } else if (then = isThenable(result)) { 4606 then.call(result, resolve, reject); 4607 } else resolve(result); 4608 } else reject(value); 4609 } catch (e) { 4610 if (domain && !exited) domain.exit(); 4611 reject(e); 4612 } 4613 }; 4614 4615 while (chain.length > i) { 4616 run(chain[i++]); 4617 } 4618 4619 promise._c = []; 4620 promise._n = false; 4621 if (isReject && !promise._h) onUnhandled(promise); 4622 }); 4623}; 4624 4625var onUnhandled = function onUnhandled(promise) { 4626 task.call(global, function () { 4627 var value = promise._v; 4628 var unhandled = isUnhandled(promise); 4629 var result, handler, console; 4630 4631 if (unhandled) { 4632 result = perform(function () { 4633 if (isNode) { 4634 process.emit('unhandledRejection', value, promise); 4635 } else if (handler = global.onunhandledrejection) { 4636 handler({ 4637 promise: promise, 4638 reason: value 4639 }); 4640 } else if ((console = global.console) && console.error) { 4641 console.error('Unhandled promise rejection', value); 4642 } 4643 }); 4644 promise._h = isNode || isUnhandled(promise) ? 2 : 1; 4645 } 4646 4647 promise._a = undefined; 4648 if (unhandled && result.e) throw result.v; 4649 }); 4650}; 4651 4652var isUnhandled = function isUnhandled(promise) { 4653 return promise._h !== 1 && (promise._a || promise._c).length === 0; 4654}; 4655 4656var onHandleUnhandled = function onHandleUnhandled(promise) { 4657 task.call(global, function () { 4658 var handler; 4659 4660 if (isNode) { 4661 process.emit('rejectionHandled', promise); 4662 } else if (handler = global.onrejectionhandled) { 4663 handler({ 4664 promise: promise, 4665 reason: promise._v 4666 }); 4667 } 4668 }); 4669}; 4670 4671var $reject = function $reject(value) { 4672 var promise = this; 4673 if (promise._d) return; 4674 promise._d = true; 4675 promise = promise._w || promise; 4676 promise._v = value; 4677 promise._s = 2; 4678 if (!promise._a) promise._a = promise._c.slice(); 4679 notify(promise, true); 4680}; 4681 4682var $resolve = function $resolve(value) { 4683 var promise = this; 4684 var then; 4685 if (promise._d) return; 4686 promise._d = true; 4687 promise = promise._w || promise; 4688 4689 try { 4690 if (promise === value) throw TypeError("Promise can't be resolved
vendor: 4,781 bytes, lines 4690-4865
4690itself"); 4691 4692 if (then = isThenable(value)) { 4693 microtask(function () { 4694 var wrapper = { 4695 _w: promise, 4696 _d: false 4697 }; 4698 4699 try { 4700 then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); 4701 } catch (e) { 4702 $reject.call(wrapper, e); 4703 } 4704 }); 4705 } else { 4706 promise._v = value; 4707 promise._s = 1; 4708 notify(promise, false); 4709 } 4710 } catch (e) { 4711 $reject.call({ 4712 _w: promise, 4713 _d: false 4714 }, e); 4715 } 4716}; 4717 4718if (!USE_NATIVE) { 4719 $Promise = function Promise(executor) { 4720 anInstance(this, $Promise, PROMISE, '_h'); 4721 aFunction(executor); 4722 Internal.call(this); 4723 4724 try { 4725 executor(ctx($resolve, this, 1), ctx($reject, this, 1)); 4726 } catch (err) { 4727 $reject.call(this, err); 4728 } 4729 }; 4730 4731 Internal = function Promise(executor) { 4732 this._c = []; 4733 this._a = undefined; 4734 this._s = 0; 4735 this._d = false; 4736 this._v = undefined; 4737 this._h = 0; 4738 this._n = false; 4739 }; 4740 4741 Internal.prototype = __w_pdfjs_require__(102)($Promise.prototype, { 4742 then: function then(onFulfilled, onRejected) { 4743 var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); 4744 reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; 4745 reaction.fail = typeof onRejected == 'function' && onRejected; 4746 reaction.domain = isNode ? process.domain : undefined; 4747 4748 this._c.push(reaction); 4749 4750 if (this._a) this._a.push(reaction); 4751 if (this._s) notify(this, false); 4752 return reaction.promise; 4753 }, 4754 'catch': function _catch(onRejected) { 4755 return this.then(undefined, onRejected); 4756 } 4757 }); 4758 4759 OwnPromiseCapability = function OwnPromiseCapability() { 4760 var promise = new Internal(); 4761 this.promise = promise; 4762 this.resolve = ctx($resolve, promise, 1); 4763 this.reject = ctx($reject, promise, 1); 4764 }; 4765 4766 newPromiseCapabilityModule.f = newPromiseCapability = function newPromiseCapability(C) { 4767 return C === $Promise || C === Wrapper ? new OwnPromiseCapability(C) : newGenericPromiseCapability(C); 4768 }; 4769} 4770 4771$export($export.G + $export.W + $export.F * !USE_NATIVE, { 4772 Promise: $Promise 4773}); 4774 4775__w_pdfjs_require__(64)($Promise, PROMISE); 4776 4777__w_pdfjs_require__(103)(PROMISE); 4778 4779Wrapper = __w_pdfjs_require__(14)[PROMISE]; 4780$export($export.S + $export.F * !USE_NATIVE, PROMISE, { 4781 reject: function reject(r) { 4782 var capability = newPromiseCapability(this); 4783 var $$reject = capability.reject; 4784 $$reject(r); 4785 return capability.promise; 4786 } 4787}); 4788$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { 4789 resolve: function resolve(x) { 4790 return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); 4791 } 4792}); 4793$export($export.S + $export.F * !(USE_NATIVE && __w_pdfjs_require__(73)(function (iter) { 4794 $Promise.all(iter)['catch'](empty); 4795})), PROMISE, { 4796 all: function all(iterable) { 4797 var C = this; 4798 var capability = newPromiseCapability(C); 4799 var resolve = capability.resolve; 4800 var reject = capability.reject; 4801 var result = perform(function () { 4802 var values = []; 4803 var index = 0; 4804 var remaining = 1; 4805 forOf(iterable, false, function (promise) { 4806 var $index = index++; 4807 var alreadyCalled = false; 4808 values.push(undefined); 4809 remaining++; 4810 C.resolve(promise).then(function (value) { 4811 if (alreadyCalled) return; 4812 alreadyCalled = true; 4813 values[$index] = value; 4814 --remaining || resolve(values); 4815 }, reject); 4816 }); 4817 --remaining || resolve(values); 4818 }); 4819 if (result.e) reject(result.v); 4820 return capability.promise; 4821 }, 4822 race: function race(iterable) { 4823 var C = this; 4824 var capability = newPromiseCapability(C); 4825 var reject = capability.reject; 4826 var result = perform(function () { 4827 forOf(iterable, false, function (promise) { 4828 C.resolve(promise).then(capability.resolve, reject); 4829 }); 4830 }); 4831 if (result.e) reject(result.v); 4832 return capability.promise; 4833 } 4834}); 4835 4836/***/ }), 4837/* 92 */ 4838/***/ (function(module, exports, __w_pdfjs_require__) { 4839 4840"use strict"; 4841 4842 4843module.exports = function (it, Constructor, name, forbiddenField) { 4844 if (!(it instanceof Constructor) || forbiddenField !== undefined && forbiddenField in it) { 4845 throw TypeError(name + ': incorrect invocation!'); 4846 } 4847 4848 return it; 4849}; 4850 4851/***/ }), 4852/* 93 */ 4853/***/ (function(module, exports, __w_pdfjs_require__) { 4854 4855"use strict"; 4856 4857 4858var ctx = __w_pdfjs_require__(28); 4859 4860var call = __w_pdfjs_require__(68); 4861 4862var isArrayIter = __w_pdfjs_require__(69); 4863 4864var anObject = __w_pdfjs_require__(17); 4865
vendor: 4,906 bytes, lines 4866-5059
4866var toLength = __w_pdfjs_require__(30); 4867 4868var getIterFn = __w_pdfjs_require__(71); 4869 4870var BREAK = {}; 4871var RETURN = {}; 4872 4873var _exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { 4874 var iterFn = ITERATOR ? function () { 4875 return iterable; 4876 } : getIterFn(iterable); 4877 var f = ctx(fn, that, entries ? 2 : 1); 4878 var index = 0; 4879 var length, step, iterator, result; 4880 if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!'); 4881 if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) { 4882 result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); 4883 if (result === BREAK || result === RETURN) return result; 4884 } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) { 4885 result = call(iterator, f, step.value, entries); 4886 if (result === BREAK || result === RETURN) return result; 4887 } 4888}; 4889 4890_exports.BREAK = BREAK; 4891_exports.RETURN = RETURN; 4892 4893/***/ }), 4894/* 94 */ 4895/***/ (function(module, exports, __w_pdfjs_require__) { 4896 4897"use strict"; 4898 4899 4900var anObject = __w_pdfjs_require__(17); 4901 4902var aFunction = __w_pdfjs_require__(29); 4903 4904var SPECIES = __w_pdfjs_require__(35)('species'); 4905 4906module.exports = function (O, D) { 4907 var C = anObject(O).constructor; 4908 var S; 4909 return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); 4910}; 4911 4912/***/ }), 4913/* 95 */ 4914/***/ (function(module, exports, __w_pdfjs_require__) { 4915 4916"use strict"; 4917 4918 4919var ctx = __w_pdfjs_require__(28); 4920 4921var invoke = __w_pdfjs_require__(96); 4922 4923var html = __w_pdfjs_require__(63); 4924 4925var cel = __w_pdfjs_require__(22); 4926 4927var global = __w_pdfjs_require__(13); 4928 4929var process = global.process; 4930var setTask = global.setImmediate; 4931var clearTask = global.clearImmediate; 4932var MessageChannel = global.MessageChannel; 4933var Dispatch = global.Dispatch; 4934var counter = 0; 4935var queue = {}; 4936var ONREADYSTATECHANGE = 'onreadystatechange'; 4937var defer, channel, port; 4938 4939var run = function run() { 4940 var id = +this; 4941 4942 if (queue.hasOwnProperty(id)) { 4943 var fn = queue[id]; 4944 delete queue[id]; 4945 fn(); 4946 } 4947}; 4948 4949var listener = function listener(event) { 4950 run.call(event.data); 4951}; 4952 4953if (!setTask || !clearTask) { 4954 setTask = function setImmediate(fn) { 4955 var args = []; 4956 var i = 1; 4957 4958 while (arguments.length > i) { 4959 args.push(arguments[i++]); 4960 } 4961 4962 queue[++counter] = function () { 4963 invoke(typeof fn == 'function' ? fn : Function(fn), args); 4964 }; 4965 4966 defer(counter); 4967 return counter; 4968 }; 4969 4970 clearTask = function clearImmediate(id) { 4971 delete queue[id]; 4972 }; 4973 4974 if (__w_pdfjs_require__(34)(process) == 'process') { 4975 defer = function defer(id) { 4976 process.nextTick(ctx(run, id, 1)); 4977 }; 4978 } else if (Dispatch && Dispatch.now) { 4979 defer = function defer(id) { 4980 Dispatch.now(ctx(run, id, 1)); 4981 }; 4982 } else if (MessageChannel) { 4983 channel = new MessageChannel(); 4984 port = channel.port2; 4985 channel.port1.onmessage = listener; 4986 defer = ctx(port.postMessage, port, 1); 4987 } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) { 4988 defer = function defer(id) { 4989 global.postMessage(id + '', '*'); 4990 }; 4991 4992 global.addEventListener('message', listener, false); 4993 } else if (ONREADYSTATECHANGE in cel('script')) { 4994 defer = function defer(id) { 4995 html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () { 4996 html.removeChild(this); 4997 run.call(id); 4998 }; 4999 }; 5000 } else { 5001 defer = function defer(id) { 5002 setTimeout(ctx(run, id, 1), 0); 5003 }; 5004 } 5005} 5006 5007module.exports = { 5008 set: setTask, 5009 clear: clearTask 5010}; 5011 5012/***/ }), 5013/* 96 */ 5014/***/ (function(module, exports, __w_pdfjs_require__) { 5015 5016"use strict"; 5017 5018 5019module.exports = function (fn, args, that) { 5020 var un = that === undefined; 5021 5022 switch (args.length) { 5023 case 0: 5024 return un ? fn() : fn.call(that); 5025 5026 case 1: 5027 return un ? fn(args[0]) : fn.call(that, args[0]); 5028 5029 case 2: 5030 return un ? fn(args[0], args[1]) : fn.call(that, args[0], args[1]); 5031 5032 case 3: 5033 return un ? fn(args[0], args[1], args[2]) : fn.call(that, args[0], args[1], args[2]); 5034 5035 case 4: 5036 return un ? fn(args[0], args[1], args[2], args[3]) : fn.call(that, args[0], args[1], args[2], args[3]); 5037 } 5038 5039 return fn.apply(that, args); 5040}; 5041 5042/***/ }), 5043/* 97 */ 5044/***/ (function(module, exports, __w_pdfjs_require__) { 5045 5046"use strict"; 5047 5048 5049var global = __w_pdfjs_require__(13); 5050 5051var macrotask = __w_pdfjs_require__(95).set; 5052 5053var Observer = global.MutationObserver || global.WebKitMutationObserver; 5054var process = global.process; 5055var Promise = global.Promise; 5056var isNode = __w_pdfjs_require__(34)(process) == 'process'; 5057 5058module.exports = function () { 5059 var head, last, notify;
vendor: 4,591 bytes, lines 5060-5283
5060 5061 var flush = function flush() { 5062 var parent, fn; 5063 if (isNode && (parent = process.domain)) parent.exit(); 5064 5065 while (head) { 5066 fn = head.fn; 5067 head = head.next; 5068 5069 try { 5070 fn(); 5071 } catch (e) { 5072 if (head) notify();else last = undefined; 5073 throw e; 5074 } 5075 } 5076 5077 last = undefined; 5078 if (parent) parent.enter(); 5079 }; 5080 5081 if (isNode) { 5082 notify = function notify() { 5083 process.nextTick(flush); 5084 }; 5085 } else if (Observer && !(global.navigator && global.navigator.standalone)) { 5086 var toggle = true; 5087 var node = document.createTextNode(''); 5088 new Observer(flush).observe(node, { 5089 characterData: true 5090 }); 5091 5092 notify = function notify() { 5093 node.data = toggle = !toggle; 5094 }; 5095 } else if (Promise && Promise.resolve) { 5096 var promise = Promise.resolve(undefined); 5097 5098 notify = function notify() { 5099 promise.then(flush); 5100 }; 5101 } else { 5102 notify = function notify() { 5103 macrotask.call(global, flush); 5104 }; 5105 } 5106 5107 return function (fn) { 5108 var task = { 5109 fn: fn, 5110 next: undefined 5111 }; 5112 if (last) last.next = task; 5113 5114 if (!head) { 5115 head = task; 5116 notify(); 5117 } 5118 5119 last = task; 5120 }; 5121}; 5122 5123/***/ }), 5124/* 98 */ 5125/***/ (function(module, exports, __w_pdfjs_require__) { 5126 5127"use strict"; 5128 5129 5130var aFunction = __w_pdfjs_require__(29); 5131 5132function PromiseCapability(C) { 5133 var resolve, reject; 5134 this.promise = new C(function ($$resolve, $$reject) { 5135 if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor'); 5136 resolve = $$resolve; 5137 reject = $$reject; 5138 }); 5139 this.resolve = aFunction(resolve); 5140 this.reject = aFunction(reject); 5141} 5142 5143module.exports.f = function (C) { 5144 return new PromiseCapability(C); 5145}; 5146 5147/***/ }), 5148/* 99 */ 5149/***/ (function(module, exports, __w_pdfjs_require__) { 5150 5151"use strict"; 5152 5153 5154module.exports = function (exec) { 5155 try { 5156 return { 5157 e: false, 5158 v: exec() 5159 }; 5160 } catch (e) { 5161 return { 5162 e: true, 5163 v: e 5164 }; 5165 } 5166}; 5167 5168/***/ }), 5169/* 100 */ 5170/***/ (function(module, exports, __w_pdfjs_require__) { 5171 5172"use strict"; 5173 5174 5175var global = __w_pdfjs_require__(13); 5176 5177var navigator = global.navigator; 5178module.exports = navigator && navigator.userAgent || ''; 5179 5180/***/ }), 5181/* 101 */ 5182/***/ (function(module, exports, __w_pdfjs_require__) { 5183 5184"use strict"; 5185 5186 5187var anObject = __w_pdfjs_require__(17); 5188 5189var isObject = __w_pdfjs_require__(18); 5190 5191var newPromiseCapability = __w_pdfjs_require__(98); 5192 5193module.exports = function (C, x) { 5194 anObject(C); 5195 if (isObject(x) && x.constructor === C) return x; 5196 var promiseCapability = newPromiseCapability.f(C); 5197 var resolve = promiseCapability.resolve; 5198 resolve(x); 5199 return promiseCapability.promise; 5200}; 5201 5202/***/ }), 5203/* 102 */ 5204/***/ (function(module, exports, __w_pdfjs_require__) { 5205 5206"use strict"; 5207 5208 5209var redefine = __w_pdfjs_require__(25); 5210 5211module.exports = function (target, src, safe) { 5212 for (var key in src) { 5213 redefine(target, key, src[key], safe); 5214 } 5215 5216 return target; 5217}; 5218 5219/***/ }), 5220/* 103 */ 5221/***/ (function(module, exports, __w_pdfjs_require__) { 5222 5223"use strict"; 5224 5225 5226var global = __w_pdfjs_require__(13); 5227 5228var dP = __w_pdfjs_require__(16); 5229 5230var DESCRIPTORS = __w_pdfjs_require__(20); 5231 5232var SPECIES = __w_pdfjs_require__(35)('species'); 5233 5234module.exports = function (KEY) { 5235 var C = global[KEY]; 5236 if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, { 5237 configurable: true, 5238 get: function get() { 5239 return this; 5240 } 5241 }); 5242}; 5243 5244/***/ }), 5245/* 104 */ 5246/***/ (function(module, exports, __w_pdfjs_require__) { 5247 5248"use strict"; 5249 5250 5251var $export = __w_pdfjs_require__(12); 5252 5253var core = __w_pdfjs_require__(14); 5254 5255var global = __w_pdfjs_require__(13); 5256 5257var speciesConstructor = __w_pdfjs_require__(94); 5258 5259var promiseResolve = __w_pdfjs_require__(101); 5260 5261$export($export.P + $export.R, 'Promise', { 5262 'finally': function _finally(onFinally) { 5263 var C = speciesConstructor(this, core.Promise || global.Promise); 5264 var isFunction = typeof onFinally == 'function'; 5265 return this.then(isFunction ? function (x) { 5266 return promiseResolve(C, onFinally()).then(function () { 5267 return x; 5268 }); 5269 } : onFinally, isFunction ? function (e) { 5270 return promiseResolve(C, onFinally()).then(function () { 5271 throw e; 5272 }); 5273 } : onFinally); 5274 } 5275}); 5276 5277/***/ }), 5278/* 105 */ 5279/***/ (function(module, exports, __w_pdfjs_require__) { 5280 5281"use strict"; 5282 5283
vendor: 8,418 bytes, lines 5284-5637
5284var $export = __w_pdfjs_require__(12); 5285 5286var newPromiseCapability = __w_pdfjs_require__(98); 5287 5288var perform = __w_pdfjs_require__(99); 5289 5290$export($export.S, 'Promise', { 5291 'try': function _try(callbackfn) { 5292 var promiseCapability = newPromiseCapability.f(this); 5293 var result = perform(callbackfn); 5294 (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v); 5295 return promiseCapability.promise; 5296 } 5297}); 5298 5299/***/ }), 5300/* 106 */ 5301/***/ (function(module, exports, __w_pdfjs_require__) { 5302 5303"use strict"; 5304 5305 5306__w_pdfjs_require__(87); 5307 5308__w_pdfjs_require__(88); 5309 5310__w_pdfjs_require__(107); 5311 5312__w_pdfjs_require__(119); 5313 5314__w_pdfjs_require__(121); 5315 5316module.exports = __w_pdfjs_require__(14).WeakMap; 5317 5318/***/ }), 5319/* 107 */ 5320/***/ (function(module, exports, __w_pdfjs_require__) { 5321 5322"use strict"; 5323 5324 5325var each = __w_pdfjs_require__(108)(0); 5326 5327var redefine = __w_pdfjs_require__(25); 5328 5329var meta = __w_pdfjs_require__(112); 5330 5331var assign = __w_pdfjs_require__(76); 5332 5333var weak = __w_pdfjs_require__(113); 5334 5335var isObject = __w_pdfjs_require__(18); 5336 5337var fails = __w_pdfjs_require__(21); 5338 5339var validate = __w_pdfjs_require__(114); 5340 5341var WEAK_MAP = 'WeakMap'; 5342var getWeak = meta.getWeak; 5343var isExtensible = Object.isExtensible; 5344var uncaughtFrozenStore = weak.ufstore; 5345var tmp = {}; 5346var InternalMap; 5347 5348var wrapper = function wrapper(get) { 5349 return function WeakMap() { 5350 return get(this, arguments.length > 0 ? arguments[0] : undefined); 5351 }; 5352}; 5353 5354var methods = { 5355 get: function get(key) { 5356 if (isObject(key)) { 5357 var data = getWeak(key); 5358 if (data === true) return uncaughtFrozenStore(validate(this, WEAK_MAP)).get(key); 5359 return data ? data[this._i] : undefined; 5360 } 5361 }, 5362 set: function set(key, value) { 5363 return weak.def(validate(this, WEAK_MAP), key, value); 5364 } 5365}; 5366 5367var $WeakMap = module.exports = __w_pdfjs_require__(115)(WEAK_MAP, wrapper, methods, weak, true, true); 5368 5369if (fails(function () { 5370 return new $WeakMap().set((Object.freeze || Object)(tmp), 7).get(tmp) != 7; 5371})) { 5372 InternalMap = weak.getConstructor(wrapper, WEAK_MAP); 5373 assign(InternalMap.prototype, methods); 5374 meta.NEED = true; 5375 each(['delete', 'has', 'get', 'set'], function (key) { 5376 var proto = $WeakMap.prototype; 5377 var method = proto[key]; 5378 redefine(proto, key, function (a, b) { 5379 if (isObject(a) && !isExtensible(a)) { 5380 if (!this._f) this._f = new InternalMap(); 5381 5382 var result = this._f[key](a, b); 5383 5384 return key == 'set' ? this : result; 5385 } 5386 5387 return method.call(this, a, b); 5388 }); 5389 }); 5390} 5391 5392/***/ }), 5393/* 108 */ 5394/***/ (function(module, exports, __w_pdfjs_require__) { 5395 5396"use strict"; 5397 5398 5399var ctx = __w_pdfjs_require__(28); 5400 5401var IObject = __w_pdfjs_require__(48); 5402 5403var toObject = __w_pdfjs_require__(66); 5404 5405var toLength = __w_pdfjs_require__(30); 5406 5407var asc = __w_pdfjs_require__(109); 5408 5409module.exports = function (TYPE, $create) { 5410 var IS_MAP = TYPE == 1; 5411 var IS_FILTER = TYPE == 2; 5412 var IS_SOME = TYPE == 3; 5413 var IS_EVERY = TYPE == 4; 5414 var IS_FIND_INDEX = TYPE == 6; 5415 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX; 5416 var create = $create || asc; 5417 return function ($this, callbackfn, that) { 5418 var O = toObject($this); 5419 var self = IObject(O); 5420 var f = ctx(callbackfn, that, 3); 5421 var length = toLength(self.length); 5422 var index = 0; 5423 var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined; 5424 var val, res; 5425 5426 for (; length > index; index++) { 5427 if (NO_HOLES || index in self) { 5428 val = self[index]; 5429 res = f(val, index, O); 5430 5431 if (TYPE) { 5432 if (IS_MAP) result[index] = res;else if (res) switch (TYPE) { 5433 case 3: 5434 return true; 5435 5436 case 5: 5437 return val; 5438 5439 case 6: 5440 return index; 5441 5442 case 2: 5443 result.push(val); 5444 } else if (IS_EVERY) return false; 5445 } 5446 } 5447 } 5448 5449 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result; 5450 }; 5451}; 5452 5453/***/ }), 5454/* 109 */ 5455/***/ (function(module, exports, __w_pdfjs_require__) { 5456 5457"use strict"; 5458 5459 5460var speciesConstructor = __w_pdfjs_require__(110); 5461 5462module.exports = function (original, length) { 5463 return new (speciesConstructor(original))(length); 5464}; 5465 5466/***/ }), 5467/* 110 */ 5468/***/ (function(module, exports, __w_pdfjs_require__) { 5469 5470"use strict"; 5471 5472 5473var isObject = __w_pdfjs_require__(18); 5474 5475var isArray = __w_pdfjs_require__(111); 5476 5477var SPECIES = __w_pdfjs_require__(35)('species'); 5478 5479module.exports = function (original) { 5480 var C; 5481 5482 if (isArray(original)) { 5483 C = original.constructor; 5484 if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined; 5485 5486 if (isObject(C)) { 5487 C = C[SPECIES]; 5488 if (C === null) C = undefined; 5489 } 5490 } 5491 5492 return C === undefined ? Array : C; 5493}; 5494 5495/***/ }), 5496/* 111 */ 5497/***/ (function(module, exports, __w_pdfjs_require__) { 5498 5499"use strict"; 5500 5501 5502var cof = __w_pdfjs_require__(34); 5503 5504module.exports = Array.isArray || function isArray(arg) { 5505 return cof(arg) == 'Array'; 5506}; 5507 5508/***/ }), 5509/* 112 */ 5510/***/ (function(module, exports, __w_pdfjs_require__) { 5511 5512"use strict"; 5513 5514 5515function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 5516 5517var META = __w_pdfjs_require__(27)('meta'); 5518 5519var isObject = __w_pdfjs_require__(18); 5520 5521var has = __w_pdfjs_require__(26); 5522 5523var setDesc = __w_pdfjs_require__(16).f; 5524 5525var id = 0; 5526 5527var isExtensible = Object.isExtensible || function () { 5528 return true; 5529}; 5530 5531var FREEZE = !__w_pdfjs_require__(21)(function () { 5532 return isExtensible(Object.preventExtensions({})); 5533}); 5534 5535var setMeta = function setMeta(it) { 5536 setDesc(it, META, { 5537 value: { 5538 i: 'O' + ++id, 5539 w: {} 5540 } 5541 }); 5542}; 5543 5544var fastKey = function fastKey(it, create) { 5545 if (!isObject(it)) return _typeof(it) == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; 5546 5547 if (!has(it, META)) { 5548 if (!isExtensible(it)) return 'F'; 5549 if (!create) return 'E'; 5550 setMeta(it); 5551 } 5552 5553 return it[META].i; 5554}; 5555 5556var getWeak = function getWeak(it, create) { 5557 if (!has(it, META)) { 5558 if (!isExtensible(it)) return true; 5559 if (!create) return false; 5560 setMeta(it); 5561 } 5562 5563 return it[META].w; 5564}; 5565 5566var onFreeze = function onFreeze(it) { 5567 if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it); 5568 return it; 5569}; 5570 5571var meta = module.exports = { 5572 KEY: META, 5573 NEED: false, 5574 fastKey: fastKey, 5575 getWeak: getWeak, 5576 onFreeze: onFreeze 5577}; 5578 5579/***/ }), 5580/* 113 */ 5581/***/ (function(module, exports, __w_pdfjs_require__) { 5582 5583"use strict"; 5584 5585 5586var redefineAll = __w_pdfjs_require__(102); 5587 5588var getWeak = __w_pdfjs_require__(112).getWeak; 5589 5590var anObject = __w_pdfjs_require__(17); 5591 5592var isObject = __w_pdfjs_require__(18); 5593 5594var anInstance = __w_pdfjs_require__(92); 5595 5596var forOf = __w_pdfjs_require__(93); 5597 5598var createArrayMethod = __w_pdfjs_require__(108); 5599 5600var $has = __w_pdfjs_require__(26); 5601 5602var validate = __w_pdfjs_require__(114); 5603 5604var arrayFind = createArrayMethod(5); 5605var arrayFindIndex = createArrayMethod(6); 5606var id = 0; 5607 5608var uncaughtFrozenStore = function uncaughtFrozenStore(that) { 5609 return that._l || (that._l = new UncaughtFrozenStore()); 5610}; 5611 5612var UncaughtFrozenStore = function UncaughtFrozenStore() { 5613 this.a = []; 5614}; 5615 5616var findUncaughtFrozen = function findUncaughtFrozen(store, key) { 5617 return arrayFind(store.a, function (it) { 5618 return it[0] === key; 5619 }); 5620}; 5621 5622UncaughtFrozenStore.prototype = { 5623 get: function get(key) { 5624 var entry = findUncaughtFrozen(this, key); 5625 if (entry) return entry[1]; 5626 }, 5627 has: function has(key) { 5628 return !!findUncaughtFrozen(this, key); 5629 }, 5630 set: function set(key, value) { 5631 var entry = findUncaughtFrozen(this, key); 5632 if (entry) entry[1] = value;else this.a.push([key, value]); 5633 }, 5634 'delete': function _delete(key) { 5635 var index = arrayFindIndex(this.a, function (it) { 5636 return it[0] === key; 5637 });
vendor: 4,647 bytes, lines 5638-5795
5638 if (~index) this.a.splice(index, 1); 5639 return !!~index; 5640 } 5641}; 5642module.exports = { 5643 getConstructor: function getConstructor(wrapper, NAME, IS_MAP, ADDER) { 5644 var C = wrapper(function (that, iterable) { 5645 anInstance(that, C, NAME, '_i'); 5646 that._t = NAME; 5647 that._i = id++; 5648 that._l = undefined; 5649 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); 5650 }); 5651 redefineAll(C.prototype, { 5652 'delete': function _delete(key) { 5653 if (!isObject(key)) return false; 5654 var data = getWeak(key); 5655 if (data === true) return uncaughtFrozenStore(validate(this, NAME))['delete'](key); 5656 return data && $has(data, this._i) && delete data[this._i]; 5657 }, 5658 has: function has(key) { 5659 if (!isObject(key)) return false; 5660 var data = getWeak(key); 5661 if (data === true) return uncaughtFrozenStore(validate(this, NAME)).has(key); 5662 return data && $has(data, this._i); 5663 } 5664 }); 5665 return C; 5666 }, 5667 def: function def(that, key, value) { 5668 var data = getWeak(anObject(key), true); 5669 if (data === true) uncaughtFrozenStore(that).set(key, value);else data[that._i] = value; 5670 return that; 5671 }, 5672 ufstore: uncaughtFrozenStore 5673}; 5674 5675/***/ }), 5676/* 114 */ 5677/***/ (function(module, exports, __w_pdfjs_require__) { 5678 5679"use strict"; 5680 5681 5682var isObject = __w_pdfjs_require__(18); 5683 5684module.exports = function (it, TYPE) { 5685 if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!'); 5686 return it; 5687}; 5688 5689/***/ }), 5690/* 115 */ 5691/***/ (function(module, exports, __w_pdfjs_require__) { 5692 5693"use strict"; 5694 5695 5696var global = __w_pdfjs_require__(13); 5697 5698var $export = __w_pdfjs_require__(12); 5699 5700var redefine = __w_pdfjs_require__(25); 5701 5702var redefineAll = __w_pdfjs_require__(102); 5703 5704var meta = __w_pdfjs_require__(112); 5705 5706var forOf = __w_pdfjs_require__(93); 5707 5708var anInstance = __w_pdfjs_require__(92); 5709 5710var isObject = __w_pdfjs_require__(18); 5711 5712var fails = __w_pdfjs_require__(21); 5713 5714var $iterDetect = __w_pdfjs_require__(73); 5715 5716var setToStringTag = __w_pdfjs_require__(64); 5717 5718var inheritIfRequired = __w_pdfjs_require__(116); 5719 5720module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) { 5721 var Base = global[NAME]; 5722 var C = Base; 5723 var ADDER = IS_MAP ? 'set' : 'add'; 5724 var proto = C && C.prototype; 5725 var O = {}; 5726 5727 var fixMethod = function fixMethod(KEY) { 5728 var fn = proto[KEY]; 5729 redefine(proto, KEY, KEY == 'delete' ? function (a) { 5730 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); 5731 } : KEY == 'has' ? function has(a) { 5732 return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); 5733 } : KEY == 'get' ? function get(a) { 5734 return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); 5735 } : KEY == 'add' ? function add(a) { 5736 fn.call(this, a === 0 ? 0 : a); 5737 return this; 5738 } : function set(a, b) { 5739 fn.call(this, a === 0 ? 0 : a, b); 5740 return this; 5741 }); 5742 }; 5743 5744 if (typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () { 5745 new C().entries().next(); 5746 }))) { 5747 C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); 5748 redefineAll(C.prototype, methods); 5749 meta.NEED = true; 5750 } else { 5751 var instance = new C(); 5752 var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance; 5753 var THROWS_ON_PRIMITIVES = fails(function () { 5754 instance.has(1); 5755 }); 5756 var ACCEPT_ITERABLES = $iterDetect(function (iter) { 5757 new C(iter); 5758 }); 5759 var BUGGY_ZERO = !IS_WEAK && fails(function () { 5760 var $instance = new C(); 5761 var index = 5; 5762 5763 while (index--) { 5764 $instance[ADDER](index, index); 5765 } 5766 5767 return !$instance.has(-0); 5768 }); 5769 5770 if (!ACCEPT_ITERABLES) { 5771 C = wrapper(function (target, iterable) { 5772 anInstance(target, C, NAME); 5773 var that = inheritIfRequired(new Base(), target, C); 5774 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that); 5775 return that; 5776 }); 5777 C.prototype = proto; 5778 proto.constructor = C; 5779 } 5780 5781 if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { 5782 fixMethod('delete'); 5783 fixMethod('has'); 5784 IS_MAP && fixMethod('get'); 5785 } 5786 5787 if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); 5788 if (IS_WEAK && proto.clear) delete proto.clear; 5789 } 5790 5791 setToStringTag(C, NAME); 5792 O[NAME] = C; 5793 $export($export.G + $export.W + $export.F * (C != Base), O); 5794 if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP); 5795 return C;
vendor: 5,049 bytes, lines 5796-6044
5796}; 5797 5798/***/ }), 5799/* 116 */ 5800/***/ (function(module, exports, __w_pdfjs_require__) { 5801 5802"use strict"; 5803 5804 5805var isObject = __w_pdfjs_require__(18); 5806 5807var setPrototypeOf = __w_pdfjs_require__(117).set; 5808 5809module.exports = function (that, target, C) { 5810 var S = target.constructor; 5811 var P; 5812 5813 if (S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf) { 5814 setPrototypeOf(that, P); 5815 } 5816 5817 return that; 5818}; 5819 5820/***/ }), 5821/* 117 */ 5822/***/ (function(module, exports, __w_pdfjs_require__) { 5823 5824"use strict"; 5825 5826 5827var isObject = __w_pdfjs_require__(18); 5828 5829var anObject = __w_pdfjs_require__(17); 5830 5831var check = function check(O, proto) { 5832 anObject(O); 5833 if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!"); 5834}; 5835 5836module.exports = { 5837 set: Object.setPrototypeOf || ('__proto__' in {} ? function (test, buggy, set) { 5838 try { 5839 set = __w_pdfjs_require__(28)(Function.call, __w_pdfjs_require__(118).f(Object.prototype, '__proto__').set, 2); 5840 set(test, []); 5841 buggy = !(test instanceof Array); 5842 } catch (e) { 5843 buggy = true; 5844 } 5845 5846 return function setPrototypeOf(O, proto) { 5847 check(O, proto); 5848 if (buggy) O.__proto__ = proto;else set(O, proto); 5849 return O; 5850 }; 5851 }({}, false) : undefined), 5852 check: check 5853}; 5854 5855/***/ }), 5856/* 118 */ 5857/***/ (function(module, exports, __w_pdfjs_require__) { 5858 5859"use strict"; 5860 5861 5862var pIE = __w_pdfjs_require__(78); 5863 5864var createDesc = __w_pdfjs_require__(24); 5865 5866var toIObject = __w_pdfjs_require__(47); 5867 5868var toPrimitive = __w_pdfjs_require__(23); 5869 5870var has = __w_pdfjs_require__(26); 5871 5872var IE8_DOM_DEFINE = __w_pdfjs_require__(19); 5873 5874var gOPD = Object.getOwnPropertyDescriptor; 5875exports.f = __w_pdfjs_require__(20) ? gOPD : function getOwnPropertyDescriptor(O, P) { 5876 O = toIObject(O); 5877 P = toPrimitive(P, true); 5878 if (IE8_DOM_DEFINE) try { 5879 return gOPD(O, P); 5880 } catch (e) {} 5881 if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]); 5882}; 5883 5884/***/ }), 5885/* 119 */ 5886/***/ (function(module, exports, __w_pdfjs_require__) { 5887 5888"use strict"; 5889 5890 5891__w_pdfjs_require__(120)('WeakMap'); 5892 5893/***/ }), 5894/* 120 */ 5895/***/ (function(module, exports, __w_pdfjs_require__) { 5896 5897"use strict"; 5898 5899 5900var $export = __w_pdfjs_require__(12); 5901 5902module.exports = function (COLLECTION) { 5903 $export($export.S, COLLECTION, { 5904 of: function of() { 5905 var length = arguments.length; 5906 var A = new Array(length); 5907 5908 while (length--) { 5909 A[length] = arguments[length]; 5910 } 5911 5912 return new this(A); 5913 } 5914 }); 5915}; 5916 5917/***/ }), 5918/* 121 */ 5919/***/ (function(module, exports, __w_pdfjs_require__) { 5920 5921"use strict"; 5922 5923 5924__w_pdfjs_require__(122)('WeakMap'); 5925 5926/***/ }), 5927/* 122 */ 5928/***/ (function(module, exports, __w_pdfjs_require__) { 5929 5930"use strict"; 5931 5932 5933var $export = __w_pdfjs_require__(12); 5934 5935var aFunction = __w_pdfjs_require__(29); 5936 5937var ctx = __w_pdfjs_require__(28); 5938 5939var forOf = __w_pdfjs_require__(93); 5940 5941module.exports = function (COLLECTION) { 5942 $export($export.S, COLLECTION, { 5943 from: function from(source) { 5944 var mapFn = arguments[1]; 5945 var mapping, A, n, cb; 5946 aFunction(this); 5947 mapping = mapFn !== undefined; 5948 if (mapping) aFunction(mapFn); 5949 if (source == undefined) return new this(); 5950 A = []; 5951 5952 if (mapping) { 5953 n = 0; 5954 cb = ctx(mapFn, arguments[2], 2); 5955 forOf(source, false, function (nextItem) { 5956 A.push(cb(nextItem, n++)); 5957 }); 5958 } else { 5959 forOf(source, false, A.push, A); 5960 } 5961 5962 return new this(A); 5963 } 5964 }); 5965}; 5966 5967/***/ }), 5968/* 123 */ 5969/***/ (function(module, exports, __w_pdfjs_require__) { 5970 5971"use strict"; 5972 5973 5974__w_pdfjs_require__(87); 5975 5976__w_pdfjs_require__(88); 5977 5978__w_pdfjs_require__(124); 5979 5980__w_pdfjs_require__(125); 5981 5982__w_pdfjs_require__(126); 5983 5984module.exports = __w_pdfjs_require__(14).WeakSet; 5985 5986/***/ }), 5987/* 124 */ 5988/***/ (function(module, exports, __w_pdfjs_require__) { 5989 5990"use strict"; 5991 5992 5993var weak = __w_pdfjs_require__(113); 5994 5995var validate = __w_pdfjs_require__(114); 5996 5997var WEAK_SET = 'WeakSet'; 5998 5999__w_pdfjs_require__(115)(WEAK_SET, function (get) { 6000 return function WeakSet() { 6001 return get(this, arguments.length > 0 ? arguments[0] : undefined); 6002 }; 6003}, { 6004 add: function add(value) { 6005 return weak.def(validate(this, WEAK_SET), value, true); 6006 } 6007}, weak, false, true); 6008 6009/***/ }), 6010/* 125 */ 6011/***/ (function(module, exports, __w_pdfjs_require__) { 6012 6013"use strict"; 6014 6015 6016__w_pdfjs_require__(120)('WeakSet'); 6017 6018/***/ }), 6019/* 126 */ 6020/***/ (function(module, exports, __w_pdfjs_require__) { 6021 6022"use strict"; 6023 6024 6025__w_pdfjs_require__(122)('WeakSet'); 6026 6027/***/ }), 6028/* 127 */ 6029/***/ (function(module, exports, __w_pdfjs_require__) { 6030 6031"use strict"; 6032 6033 6034__w_pdfjs_require__(128); 6035 6036module.exports = __w_pdfjs_require__(14).String.codePointAt; 6037 6038/***/ }), 6039/* 128 */ 6040/***/ (function(module, exports, __w_pdfjs_require__) { 6041 6042"use strict"; 6043 6044
vendor: 4,993 bytes, lines 6045-6239
6045var $export = __w_pdfjs_require__(12); 6046 6047var $at = __w_pdfjs_require__(53)(false); 6048 6049$export($export.P, 'String', { 6050 codePointAt: function codePointAt(pos) { 6051 return $at(this, pos); 6052 } 6053}); 6054 6055/***/ }), 6056/* 129 */ 6057/***/ (function(module, exports, __w_pdfjs_require__) { 6058 6059"use strict"; 6060 6061 6062__w_pdfjs_require__(130); 6063 6064module.exports = __w_pdfjs_require__(14).String.fromCodePoint; 6065 6066/***/ }), 6067/* 130 */ 6068/***/ (function(module, exports, __w_pdfjs_require__) { 6069 6070"use strict"; 6071 6072 6073var $export = __w_pdfjs_require__(12); 6074 6075var toAbsoluteIndex = __w_pdfjs_require__(49); 6076 6077var fromCharCode = String.fromCharCode; 6078var $fromCodePoint = String.fromCodePoint; 6079$export($export.S + $export.F * (!!$fromCodePoint && $fromCodePoint.length != 1), 'String', { 6080 fromCodePoint: function fromCodePoint(x) { 6081 var res = []; 6082 var aLen = arguments.length; 6083 var i = 0; 6084 var code; 6085 6086 while (aLen > i) { 6087 code = +arguments[i++]; 6088 if (toAbsoluteIndex(code, 0x10ffff) !== code) throw RangeError(code + ' is not a valid code point'); 6089 res.push(code < 0x10000 ? fromCharCode(code) : fromCharCode(((code -= 0x10000) >> 10) + 0xd800, code % 0x400 + 0xdc00)); 6090 } 6091 6092 return res.join(''); 6093 } 6094}); 6095 6096/***/ }), 6097/* 131 */ 6098/***/ (function(module, exports, __w_pdfjs_require__) { 6099 6100"use strict"; 6101 6102 6103__w_pdfjs_require__(132); 6104 6105__w_pdfjs_require__(87); 6106 6107module.exports = __w_pdfjs_require__(14).Symbol; 6108 6109/***/ }), 6110/* 132 */ 6111/***/ (function(module, exports, __w_pdfjs_require__) { 6112 6113"use strict"; 6114 6115 6116function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 6117 6118var global = __w_pdfjs_require__(13); 6119 6120var has = __w_pdfjs_require__(26); 6121 6122var DESCRIPTORS = __w_pdfjs_require__(20); 6123 6124var $export = __w_pdfjs_require__(12); 6125 6126var redefine = __w_pdfjs_require__(25); 6127 6128var META = __w_pdfjs_require__(112).KEY; 6129 6130var $fails = __w_pdfjs_require__(21); 6131 6132var shared = __w_pdfjs_require__(36); 6133 6134var setToStringTag = __w_pdfjs_require__(64); 6135 6136var uid = __w_pdfjs_require__(27); 6137 6138var wks = __w_pdfjs_require__(35); 6139 6140var wksExt = __w_pdfjs_require__(133); 6141 6142var wksDefine = __w_pdfjs_require__(134); 6143 6144var enumKeys = __w_pdfjs_require__(135); 6145 6146var isArray = __w_pdfjs_require__(111); 6147 6148var anObject = __w_pdfjs_require__(17); 6149 6150var isObject = __w_pdfjs_require__(18); 6151 6152var toIObject = __w_pdfjs_require__(47); 6153 6154var toPrimitive = __w_pdfjs_require__(23); 6155 6156var createDesc = __w_pdfjs_require__(24); 6157 6158var _create = __w_pdfjs_require__(57); 6159 6160var gOPNExt = __w_pdfjs_require__(136); 6161 6162var $GOPD = __w_pdfjs_require__(118); 6163 6164var $DP = __w_pdfjs_require__(16); 6165 6166var $keys = __w_pdfjs_require__(59); 6167 6168var gOPD = $GOPD.f; 6169var dP = $DP.f; 6170var gOPN = gOPNExt.f; 6171var $Symbol = global.Symbol; 6172var $JSON = global.JSON; 6173 6174var _stringify = $JSON && $JSON.stringify; 6175 6176var PROTOTYPE = 'prototype'; 6177var HIDDEN = wks('_hidden'); 6178var TO_PRIMITIVE = wks('toPrimitive'); 6179var isEnum = {}.propertyIsEnumerable; 6180var SymbolRegistry = shared('symbol-registry'); 6181var AllSymbols = shared('symbols'); 6182var OPSymbols = shared('op-symbols'); 6183var ObjectProto = Object[PROTOTYPE]; 6184var USE_NATIVE = typeof $Symbol == 'function'; 6185var QObject = global.QObject; 6186var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; 6187var setSymbolDesc = DESCRIPTORS && $fails(function () { 6188 return _create(dP({}, 'a', { 6189 get: function get() { 6190 return dP(this, 'a', { 6191 value: 7 6192 }).a; 6193 } 6194 })).a != 7; 6195}) ? function (it, key, D) { 6196 var protoDesc = gOPD(ObjectProto, key); 6197 if (protoDesc) delete ObjectProto[key]; 6198 dP(it, key, D); 6199 if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc); 6200} : dP; 6201 6202var wrap = function wrap(tag) { 6203 var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); 6204 6205 sym._k = tag; 6206 return sym; 6207}; 6208 6209var isSymbol = USE_NATIVE && _typeof($Symbol.iterator) == 'symbol' ? function (it) { 6210 return _typeof(it) == 'symbol'; 6211} : function (it) { 6212 return it instanceof $Symbol; 6213}; 6214 6215var $defineProperty = function defineProperty(it, key, D) { 6216 if (it === ObjectProto) $defineProperty(OPSymbols, key, D); 6217 anObject(it); 6218 key = toPrimitive(key, true); 6219 anObject(D); 6220 6221 if (has(AllSymbols, key)) { 6222 if (!D.enumerable) { 6223 if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {})); 6224 it[HIDDEN][key] = true; 6225 } else { 6226 if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false; 6227 D = _create(D, { 6228 enumerable: createDesc(0, false) 6229 }); 6230 } 6231 6232 return setSymbolDesc(it, key, D); 6233 } 6234 6235 return dP(it, key, D); 6236}; 6237 6238var $defineProperties = function defineProperties(it, P) { 6239 anObject(it);
vendor: 4,221 bytes, lines 6240-6373
6240 var keys = enumKeys(P = toIObject(P)); 6241 var i = 0; 6242 var l = keys.length; 6243 var key; 6244 6245 while (l > i) { 6246 $defineProperty(it, key = keys[i++], P[key]); 6247 } 6248 6249 return it; 6250}; 6251 6252var $create = function create(it, P) { 6253 return P === undefined ? _create(it) : $defineProperties(_create(it), P); 6254}; 6255 6256var $propertyIsEnumerable = function propertyIsEnumerable(key) { 6257 var E = isEnum.call(this, key = toPrimitive(key, true)); 6258 if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false; 6259 return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; 6260}; 6261 6262var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) { 6263 it = toIObject(it); 6264 key = toPrimitive(key, true); 6265 if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return; 6266 var D = gOPD(it, key); 6267 if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true; 6268 return D; 6269}; 6270 6271var $getOwnPropertyNames = function getOwnPropertyNames(it) { 6272 var names = gOPN(toIObject(it)); 6273 var result = []; 6274 var i = 0; 6275 var key; 6276 6277 while (names.length > i) { 6278 if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key); 6279 } 6280 6281 return result; 6282}; 6283 6284var $getOwnPropertySymbols = function getOwnPropertySymbols(it) { 6285 var IS_OP = it === ObjectProto; 6286 var names = gOPN(IS_OP ? OPSymbols : toIObject(it)); 6287 var result = []; 6288 var i = 0; 6289 var key; 6290 6291 while (names.length > i) { 6292 if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]); 6293 } 6294 6295 return result; 6296}; 6297 6298if (!USE_NATIVE) { 6299 $Symbol = function _Symbol() { 6300 if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!'); 6301 var tag = uid(arguments.length > 0 ? arguments[0] : undefined); 6302 6303 var $set = function $set(value) { 6304 if (this === ObjectProto) $set.call(OPSymbols, value); 6305 if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false; 6306 setSymbolDesc(this, tag, createDesc(1, value)); 6307 }; 6308 6309 if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { 6310 configurable: true, 6311 set: $set 6312 }); 6313 return wrap(tag); 6314 }; 6315 6316 redefine($Symbol[PROTOTYPE], 'toString', function toString() { 6317 return this._k; 6318 }); 6319 $GOPD.f = $getOwnPropertyDescriptor; 6320 $DP.f = $defineProperty; 6321 __w_pdfjs_require__(137).f = gOPNExt.f = $getOwnPropertyNames; 6322 __w_pdfjs_require__(78).f = $propertyIsEnumerable; 6323 __w_pdfjs_require__(77).f = $getOwnPropertySymbols; 6324 6325 if (DESCRIPTORS && !__w_pdfjs_require__(37)) { 6326 redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); 6327 } 6328 6329 wksExt.f = function (name) { 6330 return wrap(wks(name)); 6331 }; 6332} 6333 6334$export($export.G + $export.W + $export.F * !USE_NATIVE, { 6335 Symbol: $Symbol 6336}); 6337 6338for (var es6Symbols = 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'.split(','), j = 0; es6Symbols.length > j;) { 6339 wks(es6Symbols[j++]); 6340} 6341 6342for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) { 6343 wksDefine(wellKnownSymbols[k++]); 6344} 6345 6346$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { 6347 'for': function _for(key) { 6348 return has(SymbolRegistry, key += '') ? SymbolRegistry[key] : SymbolRegistry[key] = $Symbol(key); 6349 }, 6350 keyFor: function keyFor(sym) { 6351 if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!'); 6352 6353 for (var key in SymbolRegistry) { 6354 if (SymbolRegistry[key] === sym) return key; 6355 } 6356 }, 6357 useSetter: function useSetter() { 6358 setter = true; 6359 }, 6360 useSimple: function useSimple() { 6361 setter = false; 6362 } 6363}); 6364$export($export.S + $export.F * !USE_NATIVE, 'Object', { 6365 create: $create, 6366 defineProperty: $defineProperty, 6367 defineProperties: $defineProperties, 6368 getOwnPropertyDescriptor: $getOwnPropertyDescriptor, 6369 getOwnPropertyNames: $getOwnPropertyNames, 6370 getOwnPropertySymbols: $getOwnPropertySymbols 6371}); 6372$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () { 6373 var S = $Symbol();
6374 return _stringify([S]) != '[null]' || _stringify({ 6375 a: S 6376 }) != '{}' || _stringify(Object(S)) != '{}'; 6377})), 'JSON', { 6378 stringify: function stringify(it) { 6379 var args = [it]; 6380 var i = 1; 6381 var replacer, $replacer; 6382 6383 while (arguments.length > i) { 6384 args.push(arguments[i++]); 6385 } 6386 6387 $replacer = replacer = args[1]; 6388 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; 6389 if (!isArray(replacer)) replacer = function replacer(key, value) { 6390 if (typeof $replacer == 'function') value = $replacer.call(this, key, value); 6391 if (!isSymbol(value)) return value; 6392 }; 6393 args[1] = replacer; 6394 return _stringify.apply($JSON, args); 6395 } 6396}); 6397$Symbol[PROTOTYPE][TO_PRIMITIVE] || __w_pdfjs_require__(15)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); 6398setToStringTag($Symbol, 'Symbol'); 6399setToStringTag(Math, 'Math', true); 6400setToStringTag(global.JSON, 'JSON', true); 6401 6402/***/ }), 6403/* 133 */ 6404/***/ (function(module, exports, __w_pdfjs_require__) { 6405 6406"use strict"; 6407 6408 6409exports.f = __w_pdfjs_require__(35); 6410 6411/***/ }), 6412/* 134 */ 6413/***/ (function(module, exports, __w_pdfjs_require__) { 6414 6415"use strict"; 6416 6417 6418var global = __w_pdfjs_require__(13); 6419 6420var core = __w_pdfjs_require__(14); 6421 6422var LIBRARY = __w_pdfjs_require__(37); 6423 6424var wksExt = __w_pdfjs_require__(133); 6425 6426var defineProperty = __w_pdfjs_require__(16).f; 6427 6428module.exports = function (name) { 6429 var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); 6430 if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { 6431 value: wksExt.f(name) 6432 }); 6433}; 6434 6435/***/ }), 6436/* 135 */ 6437/***/ (function(module, exports, __w_pdfjs_require__) { 6438 6439"use strict"; 6440 6441 6442var getKeys = __w_pdfjs_require__(59); 6443 6444var gOPS = __w_pdfjs_require__(77); 6445 6446var pIE = __w_pdfjs_require__(78); 6447 6448module.exports = function (it) { 6449 var result = getKeys(it); 6450 var getSymbols = gOPS.f; 6451 6452 if (getSymbols) { 6453 var symbols = getSymbols(it); 6454 var isEnum = pIE.f; 6455 var i = 0; 6456 var key; 6457 6458 while (symbols.length > i) { 6459 if (isEnum.call(it, key = symbols[i++])) result.push(key); 6460 } 6461 } 6462 6463 return result; 6464}; 6465 6466/***/ }), 6467/* 136 */ 6468/***/ (function(module, exports, __w_pdfjs_require__) { 6469 6470"use strict"; 6471 6472 6473function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 6474 6475var toIObject = __w_pdfjs_require__(47); 6476 6477var gOPN = __w_pdfjs_require__(137).f; 6478 6479var toString = {}.toString; 6480var windowNames = (typeof window === "undefined" ? "undefined" : _typeof(window)) == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; 6481 6482var getWindowNames = function getWindowNames(it) { 6483 try { 6484 return gOPN(it); 6485 } catch (e) { 6486 return windowNames.slice(); 6487 } 6488}; 6489 6490module.exports.f = function getOwnPropertyNames(it) { 6491 return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); 6492}; 6493 6494/***/ }), 6495/* 137 */ 6496/***/ (function(module, exports, __w_pdfjs_require__) { 6497 6498"use strict"; 6499 6500 6501var $keys = __w_pdfjs_require__(60); 6502 6503var hiddenKeys = __w_pdfjs_require__(62).concat('length', 'prototype'); 6504 6505exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { 6506 return $keys(O, hiddenKeys); 6507}; 6508 6509/***/ }), 6510/* 138 */ 6511/***/ (function(module, exports, __w_pdfjs_require__) { 6512 6513"use strict"; 6514 6515 6516__w_pdfjs_require__(139); 6517 6518module.exports = __w_pdfjs_require__(14).String.padStart; 6519 6520/***/ }), 6521/* 139 */ 6522/***/ (function(module, exports, __w_pdfjs_require__) { 6523 6524"use strict"; 6525 6526 6527var $export = __w_pdfjs_require__(12); 6528 6529var $pad = __w_pdfjs_require__(140); 6530 6531var userAgent = __w_pdfjs_require__(100); 6532 6533$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { 6534 padStart: function padStart(maxLength) { 6535 return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, true); 6536 } 6537}); 6538 6539/***/ }), 6540/* 140 */ 6541/***/ (function(module, exports, __w_pdfjs_require__) { 6542 6543"use strict"; 6544 6545
6546var toLength = __w_pdfjs_require__(30); 6547 6548var repeat = __w_pdfjs_require__(141); 6549 6550var defined = __w_pdfjs_require__(38); 6551 6552module.exports = function (that, maxLength, fillString, left) { 6553 var S = String(defined(that)); 6554 var stringLength = S.length; 6555 var fillStr = fillString === undefined ? ' ' : String(fillString); 6556 var intMaxLength = toLength(maxLength); 6557 if (intMaxLength <= stringLength || fillStr == '') return S; 6558 var fillLen = intMaxLength - stringLength; 6559 var stringFiller = repeat.call(fillStr, Math.ceil(fillLen / fillStr.length)); 6560 if (stringFiller.length > fillLen) stringFiller = stringFiller.slice(0, fillLen); 6561 return left ? stringFiller + S : S + stringFiller; 6562}; 6563 6564/***/ }), 6565/* 141 */ 6566/***/ (function(module, exports, __w_pdfjs_require__) { 6567 6568"use strict"; 6569 6570 6571var toInteger = __w_pdfjs_require__(31); 6572 6573var defined = __w_pdfjs_require__(38); 6574 6575module.exports = function repeat(count) { 6576 var str = String(defined(this)); 6577 var res = ''; 6578 var n = toInteger(count); 6579 if (n < 0 || n == Infinity) throw RangeError("Count can't be negative"); 6580 6581 for (; n > 0; (n >>>= 1) && (str += str)) { 6582 if (n & 1) res += str; 6583 } 6584 6585 return res; 6586}; 6587 6588/***/ }), 6589/* 142 */ 6590/***/ (function(module, exports, __w_pdfjs_require__) { 6591 6592"use strict"; 6593 6594 6595__w_pdfjs_require__(143); 6596 6597module.exports = __w_pdfjs_require__(14).String.padEnd; 6598 6599/***/ }), 6600/* 143 */ 6601/***/ (function(module, exports, __w_pdfjs_require__) { 6602 6603"use strict"; 6604 6605 6606var $export = __w_pdfjs_require__(12); 6607 6608var $pad = __w_pdfjs_require__(140); 6609 6610var userAgent = __w_pdfjs_require__(100); 6611 6612$export($export.P + $export.F * /Version\/10\.\d+(\.\d+)? Safari\//.test(userAgent), 'String', { 6613 padEnd: function padEnd(maxLength) { 6614 return $pad(this, maxLength, arguments.length > 1 ? arguments[1] : undefined, false); 6615 } 6616}); 6617 6618/***/ }), 6619/* 144 */ 6620/***/ (function(module, exports, __w_pdfjs_require__) { 6621 6622"use strict"; 6623 6624 6625__w_pdfjs_require__(145); 6626 6627module.exports = __w_pdfjs_require__(14).Object.values; 6628 6629/***/ }), 6630/* 145 */ 6631/***/ (function(module, exports, __w_pdfjs_require__) { 6632 6633"use strict"; 6634 6635 6636var $export = __w_pdfjs_require__(12); 6637 6638var $values = __w_pdfjs_require__(146)(false); 6639 6640$export($export.S, 'Object', { 6641 values: function values(it) { 6642 return $values(it); 6643 } 6644}); 6645 6646/***/ }), 6647/* 146 */ 6648/***/ (function(module, exports, __w_pdfjs_require__) { 6649 6650"use strict"; 6651 6652 6653var getKeys = __w_pdfjs_require__(59); 6654 6655var toIObject = __w_pdfjs_require__(47); 6656 6657var isEnum = __w_pdfjs_require__(78).f; 6658 6659module.exports = function (isEntries) { 6660 return function (it) { 6661 var O = toIObject(it); 6662 var keys = getKeys(O); 6663 var length = keys.length; 6664 var i = 0; 6665 var result = []; 6666 var key; 6667 6668 while (length > i) { 6669 if (isEnum.call(O, key = keys[i++])) { 6670 result.push(isEntries ? [key, O[key]] : O[key]); 6671 } 6672 } 6673 6674 return result; 6675 }; 6676}; 6677 6678/***/ }), 6679/* 147 */ 6680/***/ (function(module, exports, __w_pdfjs_require__) { 6681 6682"use strict"; 6683 6684 6685{ 6686 var isReadableStreamSupported = false; 6687 6688 if (typeof ReadableStream !== 'undefined') { 6689 try { 6690 new ReadableStream({ 6691 start: function start(controller) { 6692 controller.close(); 6693 } 6694 }); 6695 isReadableStreamSupported = true; 6696 } catch (e) {} 6697 } 6698 6699 if (isReadableStreamSupported) { 6700 exports.ReadableStream = ReadableStream; 6701 } else { 6702 exports.ReadableStream = __w_pdfjs_require__(148).ReadableStream; 6703 } 6704} 6705 6706/***/ }), 6707/* 148 */ 6708/***/ (function(module, exports, __w_pdfjs_require__) { 6709 6710"use strict"; 6711 6712 6713function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); } 6714 6715(function (e, a) { 6716 for (var i in a) { 6717 e[i] = a[i]; 6718 } 6719})(exports, function (modules) { 6720 var installedModules = {}; 6721 6722 function __w_pdfjs_require__(moduleId) { 6723 if (installedModules[moduleId]) return installedModules[moduleId].exports; 6724 var module = installedModules[moduleId] = { 6725 i: moduleId, 6726 l: false, 6727 exports: {} 6728 }; 6729 modules[moduleId].call(module.exports, module, module.exports, __w_pdfjs_require__); 6730 module.l = true; 6731 return module.exports; 6732 } 6733 6734 __w_pdfjs_require__.m = modules; 6735 __w_pdfjs_require__.c = installedModules; 6736 6737 __w_pdfjs_require__.i = function (value) { 6738 return value; 6739 }; 6740 6741 __w_pdfjs_require__.d = function (exports, name, getter) { 6742 if (!__w_pdfjs_require__.o(exports, name)) { 6743 Object.defineProperty(exports, name, { 6744 configurable: false, 6745 enumerable: true, 6746 get: getter 6747 }); 6748 } 6749 }; 6750 6751 __w_pdfjs_require__.n = function (module) {
6752 var getter = module && module.__esModule ? function getDefault() { 6753 return module['default']; 6754 } : function getModuleExports() { 6755 return module; 6756 }; 6757 6758 __w_pdfjs_require__.d(getter, 'a', getter); 6759 6760 return getter; 6761 }; 6762 6763 __w_pdfjs_require__.o = function (object, property) { 6764 return Object.prototype.hasOwnProperty.call(object, property); 6765 }; 6766 6767 __w_pdfjs_require__.p = ""; 6768 return __w_pdfjs_require__(__w_pdfjs_require__.s = 7); 6769}([function (module, exports, __w_pdfjs_require__) { 6770 "use strict"; 6771 6772 var _typeof = typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol" ? function (obj) { 6773 return _typeof2(obj); 6774 } : function (obj) { 6775 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj); 6776 }; 6777 6778 var _require = __w_pdfjs_require__(1), 6779 assert = _require.assert; 6780 6781 function IsPropertyKey(argument) { 6782 return typeof argument === 'string' || (typeof argument === 'undefined' ? 'undefined' : _typeof(argument)) === 'symbol'; 6783 } 6784 6785 exports.typeIsObject = function (x) { 6786 return (typeof x === 'undefined' ? 'undefined' : _typeof(x)) === 'object' && x !== null || typeof x === 'function'; 6787 }; 6788 6789 exports.createDataProperty = function (o, p, v) { 6790 assert(exports.typeIsObject(o)); 6791 Object.defineProperty(o, p, { 6792 value: v, 6793 writable: true, 6794 enumerable: true, 6795 configurable: true 6796 }); 6797 }; 6798 6799 exports.createArrayFromList = function (elements) { 6800 return elements.slice(); 6801 }; 6802 6803 exports.ArrayBufferCopy = function (dest, destOffset, src, srcOffset, n) { 6804 new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset); 6805 }; 6806 6807 exports.CreateIterResultObject = function (value, done) { 6808 assert(typeof done === 'boolean'); 6809 var obj = {}; 6810 Object.defineProperty(obj, 'value', { 6811 value: value, 6812 enumerable: true, 6813 writable: true, 6814 configurable: true 6815 }); 6816 Object.defineProperty(obj, 'done', { 6817 value: done, 6818 enumerable: true, 6819 writable: true, 6820 configurable: true 6821 }); 6822 return obj; 6823 }; 6824 6825 exports.IsFiniteNonNegativeNumber = function (v) { 6826 if (Number.isNaN(v)) { 6827 return false; 6828 } 6829 6830 if (v === Infinity) { 6831 return false; 6832 } 6833 6834 if (v < 0) { 6835 return false; 6836 } 6837 6838 return true; 6839 }; 6840 6841 function Call(F, V, args) { 6842 if (typeof F !== 'function') { 6843 throw new TypeError('Argument is not a function'); 6844 } 6845 6846 return Function.prototype.apply.call(F, V, args); 6847 } 6848 6849 exports.InvokeOrNoop = function (O, P, args) { 6850 assert(O !== undefined); 6851 assert(IsPropertyKey(P)); 6852 assert(Array.isArray(args)); 6853 var method = O[P]; 6854 6855 if (method === undefined) { 6856 return undefined; 6857 } 6858 6859 return Call(method, O, args); 6860 }; 6861 6862 exports.PromiseInvokeOrNoop = function (O, P, args) { 6863 assert(O !== undefined); 6864 assert(IsPropertyKey(P)); 6865 assert(Array.isArray(args)); 6866 6867 try { 6868 return Promise.resolve(exports.InvokeOrNoop(O, P, args)); 6869 } catch (returnValueE) { 6870 return Promise.reject(returnValueE); 6871 } 6872 }; 6873 6874 exports.PromiseInvokeOrPerformFallback = function (O, P, args, F, argsF) { 6875 assert(O !== undefined); 6876 assert(IsPropertyKey(P)); 6877 assert(Array.isArray(args)); 6878 assert(Array.isArray(argsF)); 6879 var method = void 0; 6880 6881 try { 6882 method = O[P]; 6883 } catch (methodE) { 6884 return Promise.reject(methodE); 6885 } 6886 6887 if (method === undefined) { 6888 return F.apply(null, argsF); 6889 } 6890 6891 try { 6892 return Promise.resolve(Call(method, O, args)); 6893 } catch (e) { 6894 return Promise.reject(e); 6895 } 6896 }; 6897 6898 exports.TransferArrayBuffer = function (O) { 6899 return O.slice(); 6900 }; 6901 6902 exports.ValidateAndNormalizeHighWaterMark = function (highWaterMark) { 6903 highWaterMark = Number(highWaterMark); 6904 6905 if (Number.isNaN(highWaterMark) || highWaterMark < 0) { 6906 throw new RangeError('highWaterMark property of a queuing strategy must be non-negative and non-NaN'); 6907 } 6908 6909 return highWaterMark; 6910 }; 6911 6912 exports.ValidateAndNormalizeQueuingStrategy = function (size, highWaterMark) { 6913 if (size !== undefined && typeof size !== 'function') { 6914 throw new TypeError('size property of a queuing strategy must be a function'); 6915 } 6916 6917 highWaterMark = exports.ValidateAndNormalizeHighWaterMark(highWaterMark); 6918 return { 6919 size: size, 6920 highWaterMark: highWaterMark 6921 }; 6922 }; 6923}, function (module, exports, __w_pdfjs_require__) { 6924 "use strict"; 6925 6926 function rethrowAssertionErrorRejection(e) { 6927 if (e && e.constructor === AssertionError) { 6928 setTimeout(function () { 6929 throw e; 6930 }, 0); 6931 } 6932 } 6933 6934 function AssertionError(message) { 6935 this.name = 'AssertionError'; 6936 this.message = message || ''; 6937 this.stack = new Error().stack; 6938 } 6939 6940 AssertionError.prototype = Object.create(Error.prototype); 6941 AssertionError.prototype.constructor = AssertionError; 6942 6943 function assert(value, message) { 6944 if (!value) { 6945 throw new AssertionError(message); 6946 } 6947 } 6948 6949 module.exports = { 6950 rethrowAssertionErrorRejection: rethrowAssertionErrorRejection, 6951 AssertionError: AssertionError, 6952 assert: assert 6953 }; 6954}, function (module, exports, __w_pdfjs_require__) { 6955 "use strict"; 6956 6957 var _createClass = function () { 6958 function defineProperties(target, props) { 6959 for (var i = 0; i < props.length; i++) { 6960 var descriptor = props[i]; 6961 descriptor.enumerable = descriptor.enumerable || false; 6962 descriptor.configurable = true; 6963 if ("value" in descriptor) descriptor.writable = true; 6964 Object.defineProperty(target, descriptor.key, descriptor); 6965 } 6966 } 6967 6968 return function (Constructor, protoProps, staticProps) { 6969 if (protoProps) defineProperties(Constructor.prototype, protoProps); 6970 if (staticProps) defineProperties(Constructor, staticProps); 6971 return Constructor; 6972 }; 6973 }(); 6974 6975 function _classCallCheck(instance, Constructor) { 6976 if (!(instance instanceof Constructor)) { 6977 throw new TypeError("Cannot call a class as a function"); 6978 } 6979 } 6980 6981 var _require = __w_pdfjs_require__(0), 6982 InvokeOrNoop = _require.InvokeOrNoop, 6983 PromiseInvokeOrNoop = _require.PromiseInvokeOrNoop, 6984 ValidateAndNormalizeQueuingStrategy = _require.ValidateAndNormalizeQueuingStrategy, 6985 typeIsObject = _require.typeIsObject; 6986 6987 var _require2 = __w_pdfjs_require__(1), 6988 assert = _require2.assert, 6989 rethrowAssertionErrorRejection = _require2.rethrowAssertionErrorRejection; 6990 6991 var _require3 = __w_pdfjs_require__(3), 6992 DequeueValue = _require3.DequeueValue, 6993 EnqueueValueWithSize = _require3.EnqueueValueWithSize, 6994 PeekQueueValue = _require3.PeekQueueValue, 6995 ResetQueue = _require3.ResetQueue; 6996 6997 var WritableStream = function () { 6998 function WritableStream() { 6999 var underlyingSink = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 7000 7001 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 7002 size = _ref.size, 7003 _ref$highWaterMark = _ref.highWaterMark, 7004 highWaterMark = _ref$highWaterMark === undefined ? 1 : _ref$highWaterMark; 7005 7006 _classCallCheck(this, WritableStream); 7007 7008 this._state = 'writable'; 7009 this._storedError = undefined; 7010 this._writer = undefined; 7011 this._writableStreamController = undefined; 7012 this._writeRequests = []; 7013 this._inFlightWriteRequest = undefined; 7014 this._closeRequest = undefined; 7015 this._inFlightCloseRequest = undefined; 7016 this._pendingAbortRequest = undefined; 7017 this._backpressure = false; 7018 var type = underlyingSink.type; 7019 7020 if (type !== undefined) { 7021 throw new RangeError('Invalid type is specified'); 7022 } 7023 7024 this._writableStreamController = new WritableStreamDefaultController(this, underlyingSink, size, highWaterMark); 7025 7026 this._writableStreamController.__startSteps(); 7027 } 7028 7029 _createClass(WritableStream, [{ 7030 key: 'abort', 7031 value: function abort(reason) { 7032 if (IsWritableStream(this) === false) { 7033 return Promise.reject(streamBrandCheckException('abort')); 7034 } 7035 7036 if (IsWritableStreamLocked(this) === true) { 7037 return Promise.reject(new TypeError('Cannot abort a stream that already has a writer')); 7038 } 7039 7040 return WritableStreamAbort(this, reason); 7041 } 7042 }, { 7043 key: 'getWriter', 7044 value: function getWriter() { 7045 if (IsWritableStream(this) === false) { 7046 throw streamBrandCheckException('getWriter'); 7047 } 7048 7049 return AcquireWritableStreamDefaultWriter(this); 7050 } 7051 }, { 7052 key: 'locked', 7053 get: function get() { 7054 if (IsWritableStream(this) === false) { 7055 throw streamBrandCheckException('locked'); 7056 } 7057 7058 return IsWritableStreamLocked(this); 7059 } 7060 }]); 7061 7062 return WritableStream; 7063 }(); 7064 7065 module.exports = { 7066 AcquireWritableStreamDefaultWriter: AcquireWritableStreamDefaultWriter, 7067 IsWritableStream: IsWritableStream, 7068 IsWritableStreamLocked: IsWritableStreamLocked, 7069 WritableStream: WritableStream, 7070 WritableStreamAbort: WritableStreamAbort, 7071 WritableStreamDefaultControllerError: WritableStreamDefaultControllerError, 7072 WritableStreamDefaultWriterCloseWithErrorPropagation: WritableStreamDefaultWriterCloseWithErrorPropagation, 7073 WritableStreamDefaultWriterRelease: WritableStreamDefaultWriterRelease, 7074 WritableStreamDefaultWriterWrite: WritableStreamDefaultWriterWrite, 7075 WritableStreamCloseQueuedOrInFlight: WritableStreamCloseQueuedOrInFlight 7076 }; 7077 7078 function AcquireWritableStreamDefaultWriter(stream) { 7079 return new WritableStreamDefaultWriter(stream); 7080 } 7081 7082 function IsWritableStream(x) { 7083 if (!typeIsObject(x)) { 7084 return false; 7085 } 7086 7087 if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) { 7088 return false; 7089 } 7090 7091 return true; 7092 } 7093 7094 function IsWritableStreamLocked(stream) {
7095 assert(IsWritableStream(stream) === true, 'IsWritableStreamLocked should only be used on known writable streams'); 7096 7097 if (stream._writer === undefined) { 7098 return false; 7099 } 7100 7101 return true; 7102 } 7103 7104 function WritableStreamAbort(stream, reason) { 7105 var state = stream._state; 7106 7107 if (state === 'closed') { 7108 return Promise.resolve(undefined); 7109 } 7110 7111 if (state === 'errored') { 7112 return Promise.reject(stream._storedError); 7113 } 7114 7115 var error = new TypeError('Requested to abort'); 7116 7117 if (stream._pendingAbortRequest !== undefined) { 7118 return Promise.reject(error); 7119 } 7120 7121 assert(state === 'writable' || state === 'erroring', 'state must be writable or erroring'); 7122 var wasAlreadyErroring = false; 7123 7124 if (state === 'erroring') { 7125 wasAlreadyErroring = true; 7126 reason = undefined; 7127 } 7128 7129 var promise = new Promise(function (resolve, reject) { 7130 stream._pendingAbortRequest = { 7131 _resolve: resolve, 7132 _reject: reject, 7133 _reason: reason, 7134 _wasAlreadyErroring: wasAlreadyErroring 7135 }; 7136 }); 7137 7138 if (wasAlreadyErroring === false) { 7139 WritableStreamStartErroring(stream, error); 7140 } 7141 7142 return promise; 7143 } 7144 7145 function WritableStreamAddWriteRequest(stream) { 7146 assert(IsWritableStreamLocked(stream) === true); 7147 assert(stream._state === 'writable'); 7148 var promise = new Promise(function (resolve, reject) { 7149 var writeRequest = { 7150 _resolve: resolve, 7151 _reject: reject 7152 }; 7153 7154 stream._writeRequests.push(writeRequest); 7155 }); 7156 return promise; 7157 } 7158 7159 function WritableStreamDealWithRejection(stream, error) { 7160 var state = stream._state; 7161 7162 if (state === 'writable') { 7163 WritableStreamStartErroring(stream, error); 7164 return; 7165 } 7166 7167 assert(state === 'erroring'); 7168 WritableStreamFinishErroring(stream); 7169 } 7170 7171 function WritableStreamStartErroring(stream, reason) { 7172 assert(stream._storedError === undefined, 'stream._storedError === undefined'); 7173 assert(stream._state === 'writable', 'state must be writable'); 7174 var controller = stream._writableStreamController; 7175 assert(controller !== undefined, 'controller must not be undefined'); 7176 stream._state = 'erroring'; 7177 stream._storedError = reason; 7178 var writer = stream._writer; 7179 7180 if (writer !== undefined) { 7181 WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason); 7182 } 7183 7184 if (WritableStreamHasOperationMarkedInFlight(stream) === false && controller._started === true) { 7185 WritableStreamFinishErroring(stream); 7186 } 7187 } 7188 7189 function WritableStreamFinishErroring(stream) { 7190 assert(stream._state === 'erroring', 'stream._state === erroring'); 7191 assert(WritableStreamHasOperationMarkedInFlight(stream) === false, 'WritableStreamHasOperationMarkedInFlight(stream) === false'); 7192 stream._state = 'errored'; 7193 7194 stream._writableStreamController.__errorSteps(); 7195 7196 var storedError = stream._storedError; 7197 7198 for (var i = 0; i < stream._writeRequests.length; i++) { 7199 var writeRequest = stream._writeRequests[i]; 7200 7201 writeRequest._reject(storedError); 7202 } 7203 7204 stream._writeRequests = []; 7205 7206 if (stream._pendingAbortRequest === undefined) { 7207 WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); 7208 return; 7209 } 7210 7211 var abortRequest = stream._pendingAbortRequest; 7212 stream._pendingAbortRequest = undefined; 7213 7214 if (abortRequest._wasAlreadyErroring === true) { 7215 abortRequest._reject(storedError); 7216 7217 WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); 7218 return; 7219 } 7220 7221 var promise = stream._writableStreamController.__abortSteps(abortRequest._reason); 7222 7223 promise.then(function () { 7224 abortRequest._resolve(); 7225 7226 WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); 7227 }, function (reason) { 7228 abortRequest._reject(reason); 7229 7230 WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream); 7231 }); 7232 } 7233 7234 function WritableStreamFinishInFlightWrite(stream) { 7235 assert(stream._inFlightWriteRequest !== undefined); 7236 7237 stream._inFlightWriteRequest._resolve(undefined); 7238 7239 stream._inFlightWriteRequest = undefined; 7240 } 7241 7242 function WritableStreamFinishInFlightWriteWithError(stream, error) { 7243 assert(stream._inFlightWriteRequest !== undefined); 7244 7245 stream._inFlightWriteRequest._reject(error); 7246 7247 stream._inFlightWriteRequest = undefined; 7248 assert(stream._state === 'writable' || stream._state === 'erroring'); 7249 WritableStreamDealWithRejection(stream, error); 7250 } 7251 7252 function WritableStreamFinishInFlightClose(stream) { 7253 assert(stream._inFlightCloseRequest !== undefined); 7254 7255 stream._inFlightCloseRequest._resolve(undefined); 7256 7257 stream._inFlightCloseRequest = undefined; 7258 var state = stream._state; 7259 assert(state === 'writable' || state === 'erroring'); 7260 7261 if (state === 'erroring') { 7262 stream._storedError = undefined; 7263 7264 if (stream._pendingAbortRequest !== undefined) { 7265 stream._pendingAbortRequest._resolve(); 7266 7267 stream._pendingAbortRequest = undefined; 7268 } 7269 } 7270 7271 stream._state = 'closed'; 7272 var writer = stream._writer; 7273 7274 if (writer !== undefined) { 7275 defaultWriterClosedPromiseResolve(writer); 7276 } 7277 7278 assert(stream._pendingAbortRequest === undefined, 'stream._pendingAbortRequest === undefined'); 7279 assert(stream._storedError === undefined, 'stream._storedError === undefined'); 7280 } 7281 7282 function WritableStreamFinishInFlightCloseWithError(stream, error) { 7283 assert(stream._inFlightCloseRequest !== undefined); 7284 7285 stream._inFlightCloseRequest._reject(error); 7286 7287 stream._inFlightCloseRequest = undefined; 7288 assert(stream._state === 'writable' || stream._state === 'erroring'); 7289 7290 if (stream._pendingAbortRequest !== undefined) { 7291 stream._pendingAbortRequest._reject(error); 7292 7293 stream._pendingAbortRequest = undefined; 7294 } 7295 7296 WritableStreamDealWithRejection(stream, error); 7297 } 7298 7299 function WritableStreamCloseQueuedOrInFlight(stream) { 7300 if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) { 7301 return false; 7302 } 7303 7304 return true; 7305 } 7306 7307 function WritableStreamHasOperationMarkedInFlight(stream) { 7308 if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) { 7309 return false; 7310 } 7311 7312 return true; 7313 } 7314 7315 function WritableStreamMarkCloseRequestInFlight(stream) { 7316 assert(stream._inFlightCloseRequest === undefined); 7317 assert(stream._closeRequest !== undefined); 7318 stream._inFlightCloseRequest = stream._closeRequest; 7319 stream._closeRequest = undefined; 7320 } 7321 7322 function WritableStreamMarkFirstWriteRequestInFlight(stream) { 7323 assert(stream._inFlightWriteRequest === undefined, 'there must be no pending write request'); 7324 assert(stream._writeRequests.length !== 0, 'writeRequests must not be empty'); 7325 stream._inFlightWriteRequest = stream._writeRequests.shift(); 7326 } 7327 7328 function WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) { 7329 assert(stream._state === 'errored', '_stream_.[[state]] is `"errored"`'); 7330 7331 if (stream._closeRequest !== undefined) { 7332 assert(stream._inFlightCloseRequest === undefined); 7333 7334 stream._closeRequest._reject(stream._storedError); 7335 7336 stream._closeRequest = undefined; 7337 } 7338 7339 var writer = stream._writer; 7340 7341 if (writer !== undefined) { 7342 defaultWriterClosedPromiseReject(writer, stream._storedError); 7343 7344 writer._closedPromise.catch(function () {}); 7345 } 7346 } 7347 7348 function WritableStreamUpdateBackpressure(stream, backpressure) { 7349 assert(stream._state === 'writable');
7350 assert(WritableStreamCloseQueuedOrInFlight(stream) === false); 7351 var writer = stream._writer; 7352 7353 if (writer !== undefined && backpressure !== stream._backpressure) { 7354 if (backpressure === true) { 7355 defaultWriterReadyPromiseReset(writer); 7356 } else { 7357 assert(backpressure === false); 7358 defaultWriterReadyPromiseResolve(writer); 7359 } 7360 } 7361 7362 stream._backpressure = backpressure; 7363 } 7364 7365 var WritableStreamDefaultWriter = function () { 7366 function WritableStreamDefaultWriter(stream) { 7367 _classCallCheck(this, WritableStreamDefaultWriter); 7368 7369 if (IsWritableStream(stream) === false) { 7370 throw new TypeError('WritableStreamDefaultWriter can only be constructed with a WritableStream instance'); 7371 } 7372 7373 if (IsWritableStreamLocked(stream) === true) { 7374 throw new TypeError('This stream has already been locked for exclusive writing by another writer'); 7375 } 7376 7377 this._ownerWritableStream = stream; 7378 stream._writer = this; 7379 var state = stream._state; 7380 7381 if (state === 'writable') { 7382 if (WritableStreamCloseQueuedOrInFlight(stream) === false && stream._backpressure === true) { 7383 defaultWriterReadyPromiseInitialize(this); 7384 } else { 7385 defaultWriterReadyPromiseInitializeAsResolved(this); 7386 } 7387 7388 defaultWriterClosedPromiseInitialize(this); 7389 } else if (state === 'erroring') { 7390 defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError); 7391 7392 this._readyPromise.catch(function () {}); 7393 7394 defaultWriterClosedPromiseInitialize(this); 7395 } else if (state === 'closed') { 7396 defaultWriterReadyPromiseInitializeAsResolved(this); 7397 defaultWriterClosedPromiseInitializeAsResolved(this); 7398 } else { 7399 assert(state === 'errored', 'state must be errored'); 7400 var storedError = stream._storedError; 7401 defaultWriterReadyPromiseInitializeAsRejected(this, storedError); 7402 7403 this._readyPromise.catch(function () {}); 7404 7405 defaultWriterClosedPromiseInitializeAsRejected(this, storedError); 7406 7407 this._closedPromise.catch(function () {}); 7408 } 7409 } 7410 7411 _createClass(WritableStreamDefaultWriter, [{ 7412 key: 'abort', 7413 value: function abort(reason) { 7414 if (IsWritableStreamDefaultWriter(this) === false) { 7415 return Promise.reject(defaultWriterBrandCheckException('abort')); 7416 } 7417 7418 if (this._ownerWritableStream === undefined) { 7419 return Promise.reject(defaultWriterLockException('abort')); 7420 } 7421 7422 return WritableStreamDefaultWriterAbort(this, reason); 7423 } 7424 }, { 7425 key: 'close', 7426 value: function close() { 7427 if (IsWritableStreamDefaultWriter(this) === false) { 7428 return Promise.reject(defaultWriterBrandCheckException('close')); 7429 } 7430 7431 var stream = this._ownerWritableStream; 7432 7433 if (stream === undefined) { 7434 return Promise.reject(defaultWriterLockException('close')); 7435 } 7436 7437 if (WritableStreamCloseQueuedOrInFlight(stream) === true) { 7438 return Promise.reject(new TypeError('cannot close an already-closing stream')); 7439 } 7440 7441 return WritableStreamDefaultWriterClose(this); 7442 } 7443 }, { 7444 key: 'releaseLock', 7445 value: function releaseLock() { 7446 if (IsWritableStreamDefaultWriter(this) === false) { 7447 throw defaultWriterBrandCheckException('releaseLock'); 7448 } 7449 7450 var stream = this._ownerWritableStream; 7451 7452 if (stream === undefined) { 7453 return; 7454 } 7455 7456 assert(stream._writer !== undefined); 7457 WritableStreamDefaultWriterRelease(this); 7458 } 7459 }, { 7460 key: 'write', 7461 value: function write(chunk) { 7462 if (IsWritableStreamDefaultWriter(this) === false) { 7463 return Promise.reject(defaultWriterBrandCheckException('write')); 7464 } 7465 7466 if (this._ownerWritableStream === undefined) { 7467 return Promise.reject(defaultWriterLockException('write to')); 7468 } 7469 7470 return WritableStreamDefaultWriterWrite(this, chunk); 7471 } 7472 }, { 7473 key: 'closed', 7474 get: function get() { 7475 if (IsWritableStreamDefaultWriter(this) === false) { 7476 return Promise.reject(defaultWriterBrandCheckException('closed')); 7477 } 7478 7479 return this._closedPromise; 7480 } 7481 }, { 7482 key: 'desiredSize', 7483 get: function get() { 7484 if (IsWritableStreamDefaultWriter(this) === false) { 7485 throw defaultWriterBrandCheckException('desiredSize'); 7486 } 7487 7488 if (this._ownerWritableStream === undefined) { 7489 throw defaultWriterLockException('desiredSize'); 7490 } 7491 7492 return WritableStreamDefaultWriterGetDesiredSize(this); 7493 } 7494 }, { 7495 key: 'ready', 7496 get: function get() { 7497 if (IsWritableStreamDefaultWriter(this) === false) { 7498 return Promise.reject(defaultWriterBrandCheckException('ready')); 7499 } 7500 7501 return this._readyPromise; 7502 } 7503 }]); 7504 7505 return WritableStreamDefaultWriter; 7506 }(); 7507 7508 function IsWritableStreamDefaultWriter(x) { 7509 if (!typeIsObject(x)) { 7510 return false; 7511 } 7512 7513 if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) { 7514 return false; 7515 } 7516 7517 return true; 7518 } 7519 7520 function WritableStreamDefaultWriterAbort(writer, reason) { 7521 var stream = writer._ownerWritableStream; 7522 assert(stream !== undefined); 7523 return WritableStreamAbort(stream, reason); 7524 } 7525 7526 function WritableStreamDefaultWriterClose(writer) { 7527 var stream = writer._ownerWritableStream; 7528 assert(stream !== undefined); 7529 var state = stream._state; 7530 7531 if (state === 'closed' || state === 'errored') { 7532 return Promise.reject(new TypeError('The stream (in ' + state
7532+ ' state) is not in the writable state and cannot be closed')); 7533 } 7534 7535 assert(state === 'writable' || state === 'erroring'); 7536 assert(WritableStreamCloseQueuedOrInFlight(stream) === false); 7537 var promise = new Promise(function (resolve, reject) { 7538 var closeRequest = { 7539 _resolve: resolve, 7540 _reject: reject 7541 }; 7542 stream._closeRequest = closeRequest; 7543 }); 7544 7545 if (stream._backpressure === true && state === 'writable') { 7546 defaultWriterReadyPromiseResolve(writer); 7547 } 7548 7549 WritableStreamDefaultControllerClose(stream._writableStreamController); 7550 return promise; 7551 } 7552 7553 function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) { 7554 var stream = writer._ownerWritableStream; 7555 assert(stream !== undefined); 7556 var state = stream._state; 7557 7558 if (WritableStreamCloseQueuedOrInFlight(stream) === true || state === 'closed') { 7559 return Promise.resolve(); 7560 } 7561 7562 if (state === 'errored') { 7563 return Promise.reject(stream._storedError); 7564 } 7565 7566 assert(state === 'writable' || state === 'erroring'); 7567 return WritableStreamDefaultWriterClose(writer); 7568 } 7569 7570 function WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) { 7571 if (writer._closedPromiseState === 'pending') { 7572 defaultWriterClosedPromiseReject(writer, error); 7573 } else { 7574 defaultWriterClosedPromiseResetToRejected(writer, error); 7575 } 7576 7577 writer._closedPromise.catch(function () {}); 7578 } 7579 7580 function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) { 7581 if (writer._readyPromiseState === 'pending') { 7582 defaultWriterReadyPromiseReject(writer, error); 7583 } else { 7584 defaultWriterReadyPromiseResetToRejected(writer, error); 7585 } 7586 7587 writer._readyPromise.catch(function () {}); 7588 } 7589 7590 function WritableStreamDefaultWriterGetDesiredSize(writer) { 7591 var stream = writer._ownerWritableStream; 7592 var state = stream._state; 7593 7594 if (state === 'errored' || state === 'erroring') { 7595 return null; 7596 } 7597 7598 if (state === 'closed') { 7599 return 0; 7600 } 7601 7602 return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController); 7603 } 7604 7605 function WritableStreamDefaultWriterRelease(writer) { 7606 var stream = writer._ownerWritableStream; 7607 assert(stream !== undefined); 7608 assert(stream._writer === writer); 7609 var releasedError = new TypeError('Writer was released and can no longer be used to monitor the stream\'s closedness'); 7610 WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError); 7611 WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError); 7612 stream._writer = undefined; 7613 writer._ownerWritableStream = undefined; 7614 } 7615 7616 function WritableStreamDefaultWriterWrite(writer, chunk) { 7617 var stream = writer._ownerWritableStream; 7618 assert(stream !== undefined); 7619 var controller = stream._writableStreamController; 7620 var chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk); 7621 7622 if (stream !== writer._ownerWritableStream) { 7623 return Promise.reject(defaultWriterLockException('write to')); 7624 } 7625 7626 var state = stream._state; 7627 7628 if (state === 'errored') { 7629 return Promise.reject(stream._storedError); 7630 } 7631 7632 if (WritableStreamCloseQueuedOrInFlight(stream) === true || state === 'closed') { 7633 return Promise.reject(new TypeError('The stream is closing or closed and cannot be written to')); 7634 } 7635 7636 if (state === 'erroring') { 7637 return Promise.reject(stream._storedError); 7638 } 7639 7640 assert(state === 'writable'); 7641 var promise = WritableStreamAddWriteRequest(stream); 7642 WritableStreamDefaultControllerWrite(controller, chunk, chunkSize); 7643 return promise; 7644 } 7645 7646 var WritableStreamDefaultController = function () { 7647 function WritableStreamDefaultController(stream, underlyingSink, size, highWaterMark) { 7648 _classCallCheck(this, WritableStreamDefaultController); 7649 7650 if (IsWritableStream(stream) === false) { 7651 throw new TypeError('WritableStreamDefaultController can only be constructed with a WritableStream instance'); 7652 } 7653 7654 if (stream._writableStreamController !== undefined) { 7655 throw new TypeError('WritableStreamDefaultController instances can only be created by the WritableStream constructor'); 7656 } 7657 7658 this._controlledWritableStream = stream; 7659 this._underlyingSink = underlyingSink; 7660 this._queue = undefined; 7661 this._queueTotalSize = undefined; 7662 ResetQueue(this); 7663 this._started = false; 7664 var normalizedStrategy = ValidateAndNormalizeQueuingStrategy(size, highWaterMark); 7665 this._strategySize = normalizedStrategy.size; 7666 this._strategyHWM = normalizedStrategy.highWaterMark; 7667 var backpressure = WritableStreamDefaultControllerGetBackpressure(this); 7668 WritableStreamUpdateBackpressure(stream, backpressure); 7669 } 7670 7671 _createClass(WritableStreamDefaultController, [{ 7672 key: 'error', 7673 value: function error(e) { 7674 if (IsWritableStreamDefaultController(this) === false) { 7675 throw new TypeError('WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController'); 7676 } 7677 7678 var state = this._controlledWritableStream._state; 7679 7680 if (state !== 'writable') { 7681 return; 7682 } 7683 7684 WritableStreamDefaultControllerError(this, e); 7685 } 7686 }, { 7687 key: '__abortSteps', 7688 value: function __abortSteps(reason) { 7689 return PromiseInvokeOrNoop(this._underlyingSink, 'abort', [reason]); 7690 } 7691 }, { 7692 key: '__errorSteps', 7693 value: function __errorSteps() { 7694 ResetQueue(this); 7695 } 7696 }, { 7697 key: '__startSteps', 7698 value: function __startSteps() { 7699 var _this = this; 7700 7701 var startResult = InvokeOrNoop(this._underlyingSink, 'start', [this]); 7702 var stream = this._controlledWritableStream; 7703 Promise.resolve(startResult).then(function () { 7704 assert(stream._state === 'writable' || stream._state === 'erroring'); 7705 _this._started = true; 7706 WritableStreamDefaultControllerAdvanceQueueIfNeeded(_this); 7707 }, function (r) { 7708 assert(stream._state === 'writable' || stream._state === 'erroring'); 7709 _this._started = true; 7710 WritableStreamDealWithRejection(stream, r); 7711 }).catch(rethrowAssertionErrorRejection); 7712 } 7713 }]); 7714 7715 return WritableStreamDefaultController; 7716 }(); 7717 7718 function WritableStreamDefaultControllerClose(controller) { 7719 EnqueueValueWithSize(controller, 'close', 0); 7720 WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); 7721 } 7722 7723 function WritableStreamDefaultControllerGetChunkSize(controller, chunk) { 7724 var strategySize = controller._strategySize; 7725 7726 if (strategySize === undefined) { 7727 return 1; 7728 } 7729 7730 try { 7731 return strategySize(chunk);
7732 } catch (chunkSizeE) { 7733 WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE); 7734 return 1; 7735 } 7736 } 7737 7738 function WritableStreamDefaultControllerGetDesiredSize(controller) { 7739 return controller._strategyHWM - controller._queueTotalSize; 7740 } 7741 7742 function WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) { 7743 var writeRecord = { 7744 chunk: chunk 7745 }; 7746 7747 try { 7748 EnqueueValueWithSize(controller, writeRecord, chunkSize); 7749 } catch (enqueueE) { 7750 WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE); 7751 return; 7752 } 7753 7754 var stream = controller._controlledWritableStream; 7755 7756 if (WritableStreamCloseQueuedOrInFlight(stream) === false && stream._state === 'writable') { 7757 var backpressure = WritableStreamDefaultControllerGetBackpressure(controller); 7758 WritableStreamUpdateBackpressure(stream, backpressure); 7759 } 7760 7761 WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); 7762 } 7763 7764 function IsWritableStreamDefaultController(x) { 7765 if (!typeIsObject(x)) { 7766 return false; 7767 } 7768 7769 if (!Object.prototype.hasOwnProperty.call(x, '_underlyingSink')) { 7770 return false; 7771 } 7772 7773 return true; 7774 } 7775 7776 function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) { 7777 var stream = controller._controlledWritableStream; 7778 7779 if (controller._started === false) { 7780 return; 7781 } 7782 7783 if (stream._inFlightWriteRequest !== undefined) { 7784 return; 7785 } 7786 7787 var state = stream._state; 7788 7789 if (state === 'closed' || state === 'errored') { 7790 return; 7791 } 7792 7793 if (state === 'erroring') { 7794 WritableStreamFinishErroring(stream); 7795 return; 7796 } 7797 7798 if (controller._queue.length === 0) { 7799 return; 7800 } 7801 7802 var writeRecord = PeekQueueValue(controller); 7803 7804 if (writeRecord === 'close') { 7805 WritableStreamDefaultControllerProcessClose(controller); 7806 } else { 7807 WritableStreamDefaultControllerProcessWrite(controller, writeRecord.chunk); 7808 } 7809 } 7810 7811 function WritableStreamDefaultControllerErrorIfNeeded(controller, error) { 7812 if (controller._controlledWritableStream._state === 'writable') { 7813 WritableStreamDefaultControllerError(controller, error); 7814 } 7815 } 7816 7817 function WritableStreamDefaultControllerProcessClose(controller) { 7818 var stream = controller._controlledWritableStream; 7819 WritableStreamMarkCloseRequestInFlight(stream); 7820 DequeueValue(controller); 7821 assert(controller._queue.length === 0, 'queue must be empty once the final write record is dequeued'); 7822 var sinkClosePromise = PromiseInvokeOrNoop(controller._underlyingSink, 'close', []); 7823 sinkClosePromise.then(function () { 7824 WritableStreamFinishInFlightClose(stream); 7825 }, function (reason) { 7826 WritableStreamFinishInFlightCloseWithError(stream, reason); 7827 }).catch(rethrowAssertionErrorRejection); 7828 } 7829 7830 function WritableStreamDefaultControllerProcessWrite(controller, chunk) { 7831 var stream = controller._controlledWritableStream; 7832 WritableStreamMarkFirstWriteRequestInFlight(stream); 7833 var sinkWritePromise = PromiseInvokeOrNoop(controller._underlyingSink, 'write', [chunk, controller]); 7834 sinkWritePromise.then(function () { 7835 WritableStreamFinishInFlightWrite(stream); 7836 var state = stream._state; 7837 assert(state === 'writable' || state === 'erroring'); 7838 DequeueValue(controller); 7839 7840 if (WritableStreamCloseQueuedOrInFlight(stream) === false && state === 'writable') { 7841 var backpressure = WritableStreamDefaultControllerGetBackpressure(controller); 7842 WritableStreamUpdateBackpressure(stream, backpressure); 7843 } 7844 7845 WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller); 7846 }, function (reason) { 7847 WritableStreamFinishInFlightWriteWithError(stream, reason); 7848 }).catch(rethrowAssertionErrorRejection); 7849 } 7850 7851 function WritableStreamDefaultControllerGetBackpressure(controller) { 7852 var desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller); 7853 return desiredSize <= 0;
vendor: 4,869 bytes, lines 7854-7967
7854 } 7855 7856 function WritableStreamDefaultControllerError(controller, error) { 7857 var stream = controller._controlledWritableStream; 7858 assert(stream._state === 'writable'); 7859 WritableStreamStartErroring(stream, error); 7860 } 7861 7862 function streamBrandCheckException(name) { 7863 return new TypeError('WritableStream.prototype.' + name + ' can only be used on a WritableStream'); 7864 } 7865 7866 function defaultWriterBrandCheckException(name) { 7867 return new TypeError('WritableStreamDefaultWriter.prototype.' + name + ' can only be used on a WritableStreamDefaultWriter'); 7868 } 7869 7870 function defaultWriterLockException(name) { 7871 return new TypeError('Cannot ' + name + ' a stream using a released writer'); 7872 } 7873 7874 function defaultWriterClosedPromiseInitialize(writer) { 7875 writer._closedPromise = new Promise(function (resolve, reject) { 7876 writer._closedPromise_resolve = resolve; 7877 writer._closedPromise_reject = reject; 7878 writer._closedPromiseState = 'pending'; 7879 }); 7880 } 7881 7882 function defaultWriterClosedPromiseInitializeAsRejected(writer, reason) { 7883 writer._closedPromise = Promise.reject(reason); 7884 writer._closedPromise_resolve = undefined; 7885 writer._closedPromise_reject = undefined; 7886 writer._closedPromiseState = 'rejected'; 7887 } 7888 7889 function defaultWriterClosedPromiseInitializeAsResolved(writer) { 7890 writer._closedPromise = Promise.resolve(undefined); 7891 writer._closedPromise_resolve = undefined; 7892 writer._closedPromise_reject = undefined; 7893 writer._closedPromiseState = 'resolved'; 7894 } 7895 7896 function defaultWriterClosedPromiseReject(writer, reason) { 7897 assert(writer._closedPromise_resolve !== undefined, 'writer._closedPromise_resolve !== undefined'); 7898 assert(writer._closedPromise_reject !== undefined, 'writer._closedPromise_reject !== undefined'); 7899 assert(writer._closedPromiseState === 'pending', 'writer._closedPromiseState is pending'); 7900 7901 writer._closedPromise_reject(reason); 7902 7903 writer._closedPromise_resolve = undefined; 7904 writer._closedPromise_reject = undefined; 7905 writer._closedPromiseState = 'rejected'; 7906 } 7907 7908 function defaultWriterClosedPromiseResetToRejected(writer, reason) { 7909 assert(writer._closedPromise_resolve === undefined, 'writer._closedPromise_resolve === undefined'); 7910 assert(writer._closedPromise_reject === undefined, 'writer._closedPromise_reject === undefined'); 7911 assert(writer._closedPromiseState !== 'pending', 'writer._closedPromiseState is not pending'); 7912 writer._closedPromise = Promise.reject(reason); 7913 writer._closedPromiseState = 'rejected'; 7914 } 7915 7916 function defaultWriterClosedPromiseResolve(writer) { 7917 assert(writer._closedPromise_resolve !== undefined, 'writer._closedPromise_resolve !== undefined'); 7918 assert(writer._closedPromise_reject !== undefined, 'writer._closedPromise_reject !== undefined'); 7919 assert(writer._closedPromiseState === 'pending', 'writer._closedPromiseState is pending'); 7920 7921 writer._closedPromise_resolve(undefined); 7922 7923 writer._closedPromise_resolve = undefined; 7924 writer._closedPromise_reject = undefined; 7925 writer._closedPromiseState = 'resolved'; 7926 } 7927 7928 function defaultWriterReadyPromiseInitialize(writer) { 7929 writer._readyPromise = new Promise(function (resolve, reject) { 7930 writer._readyPromise_resolve = resolve; 7931 writer._readyPromise_reject = reject; 7932 }); 7933 writer._readyPromiseState = 'pending'; 7934 } 7935 7936 function defaultWriterReadyPromiseInitializeAsRejected(writer, reason) { 7937 writer._readyPromise = Promise.reject(reason); 7938 writer._readyPromise_resolve = undefined; 7939 writer._readyPromise_reject = undefined; 7940 writer._readyPromiseState = 'rejected'; 7941 } 7942 7943 function defaultWriterReadyPromiseInitializeAsResolved(writer) { 7944 writer._readyPromise = Promise.resolve(undefined); 7945 writer._readyPromise_resolve = undefined; 7946 writer._readyPromise_reject = undefined; 7947 writer._readyPromiseState = 'fulfilled'; 7948 } 7949 7950 function defaultWriterReadyPromiseReject(writer, reason) { 7951 assert(writer._readyPromise_resolve !== undefined, 'writer._readyPromise_resolve !== undefined'); 7952 assert(writer._readyPromise_reject !== undefined, 'writer._readyPromise_reject !== undefined'); 7953 7954 writer._readyPromise_reject(reason); 7955 7956 writer._readyPromise_resolve = undefined; 7957 writer._readyPromise_reject = undefined; 7958 writer._readyPromiseState = 'rejected'; 7959 } 7960 7961 function defaultWriterReadyPromiseReset(writer) { 7962 assert(writer._readyPromise_resolve === undefined, 'writer._readyPromise_resolve === undefined'); 7963 assert(writer._readyPromise_reject === undefined, 'writer._readyPromise_reject === undefined'); 7964 writer._readyPromise = new Promise(function (resolve, reject) { 7965 writer._readyPromise_resolve = resolve; 7966 writer._readyPromise_reject = reject; 7967 });
7968 writer._readyPromiseState = 'pending'; 7969 } 7970 7971 function defaultWriterReadyPromiseResetToRejected(writer, reason) { 7972 assert(writer._readyPromise_resolve === undefined, 'writer._readyPromise_resolve === undefined'); 7973 assert(writer._readyPromise_reject === undefined, 'writer._readyPromise_reject === undefined'); 7974 writer._readyPromise = Promise.reject(reason); 7975 writer._readyPromiseState = 'rejected'; 7976 } 7977 7978 function defaultWriterReadyPromiseResolve(writer) { 7979 assert(writer._readyPromise_resolve !== undefined, 'writer._readyPromise_resolve !== undefined'); 7980 assert(writer._readyPromise_reject !== undefined, 'writer._readyPromise_reject !== undefined'); 7981 7982 writer._readyPromise_resolve(undefined); 7983 7984 writer._readyPromise_resolve = undefined; 7985 writer._readyPromise_reject = undefined; 7986 writer._readyPromiseState = 'fulfilled'; 7987 } 7988}, function (module, exports, __w_pdfjs_require__) { 7989 "use strict"; 7990 7991 var _require = __w_pdfjs_require__(0), 7992 IsFiniteNonNegativeNumber = _require.IsFiniteNonNegativeNumber; 7993 7994 var _require2 = __w_pdfjs_require__(1), 7995 assert = _require2.assert; 7996 7997 exports.DequeueValue = function (container) { 7998 assert('_queue' in container && '_queueTotalSize' in container, 'Spec-level failure: DequeueValue should only be used on containers with [[queue]] and [[queueTotalSize]].'); 7999 assert(container._queue.length > 0, 'Spec-level failure: should never dequeue from an empty queue.'); 8000 8001 var pair = container._queue.shift(); 8002 8003 container._queueTotalSize -= pair.size; 8004 8005 if (container._queueTotalSize < 0) { 8006 container._queueTotalSize = 0; 8007 } 8008 8009 return pair.value; 8010 }; 8011 8012 exports.EnqueueValueWithSize = function (container, value, size) { 8013 assert('_queue' in container && '_queueTotalSize' in container, 'Spec-level failure: EnqueueValueWithSize should only be used on containers with [[queue]] and ' + '[[queueTotalSize]].'); 8014 size = Number(size); 8015 8016 if (!IsFiniteNonNegativeNumber(size)) { 8017 throw new RangeError('Size must be a finite, non-NaN, non-negative number.'); 8018 } 8019 8020 container._queue.push({ 8021 value: value, 8022 size: size 8023 }); 8024 8025 container._queueTotalSize += size; 8026 }; 8027 8028 exports.PeekQueueValue = function (container) { 8029 assert('_queue' in container && '_queueTotalSize' in container, 'Spec-level failure: PeekQueueValue should only be used on containers with [[queue]] and [[queueTotalSize]].'); 8030 assert(container._queue.length > 0, 'Spec-level failure: should never peek at an empty queue.'); 8031 var pair = container._queue[0]; 8032 return pair.value; 8033 }; 8034 8035 exports.ResetQueue = function (container) { 8036 assert('_queue' in container && '_queueTotalSize' in container, 'Spec-level failure: ResetQueue should only be used on containers with [[queue]] and [[queueTotalSize]].'); 8037 container._queue = []; 8038 container._queueTotalSize = 0; 8039 }; 8040}, function (module, exports, __w_pdfjs_require__) { 8041 "use strict"; 8042 8043 var _createClass = function () { 8044 function defineProperties(target, props) { 8045 for (var i = 0; i < props.length; i++) { 8046 var descriptor = props[i]; 8047 descriptor.enumerable = descriptor.enumerable || false; 8048 descriptor.configurable = true; 8049 if ("value" in descriptor) descriptor.writable = true; 8050 Object.defineProperty(target, descriptor.key, descriptor); 8051 } 8052 } 8053 8054 return function (Constructor, protoProps, staticProps) { 8055 if (protoProps) defineProperties(Constructor.prototype, protoProps); 8056 if (staticProps) defineProperties(Constructor, staticProps); 8057 return Constructor; 8058 }; 8059 }(); 8060 8061 function _classCallCheck(instance, Constructor) { 8062 if (!(instance instanceof Constructor)) { 8063 throw new TypeError("Cannot call a class as a function"); 8064 } 8065 } 8066 8067 var _require = __w_pdfjs_require__(0), 8068 ArrayBufferCopy = _require.ArrayBufferCopy, 8069 CreateIterResultObject = _require.CreateIterResultObject, 8070 IsFiniteNonNegativeNumber = _require.IsFiniteNonNegativeNumber, 8071 InvokeOrNoop = _require.InvokeOrNoop, 8072 PromiseInvokeOrNoop = _require.PromiseInvokeOrNoop, 8073 TransferArrayBuffer = _require.TransferArrayBuffer, 8074 ValidateAndNormalizeQueuingStrategy = _require.ValidateAndNormalizeQueuingStrategy, 8075 ValidateAndNormalizeHighWaterMark = _require.ValidateAndNormalizeHighWaterMark; 8076 8077 var _require2 = __w_pdfjs_require__(0), 8078 createArrayFromList = _require2.createArrayFromList, 8079 createDataProperty = _require2.createDataProperty, 8080 typeIsObject = _require2.typeIsObject; 8081 8082 var _require3 = __w_pdfjs_require__(1), 8083 assert = _require3.assert, 8084 rethrowAssertionErrorRejection = _require3.rethrowAssertionErrorRejection; 8085 8086 var _require4 = __w_pdfjs_require__(3), 8087 DequeueValue = _require4.DequeueValue, 8088 EnqueueValueWithSize = _require4.EnqueueValueWithSize, 8089 ResetQueue = _require4.ResetQueue; 8090 8091 var _require5 = __w_pdfjs_require__(2), 8092 AcquireWritableStreamDefaultWriter = _require5.AcquireWritableStreamDefaultWriter, 8093 IsWritableStream = _require5.IsWritableStream, 8094 IsWritableStreamLocked = _require5.IsWritableStreamLocked, 8095 WritableStreamAbort = _require5.WritableStreamAbort, 8096 WritableStreamDefaultWriterCloseWithErrorPropagation = _require5.WritableStreamDefaultWriterCloseWithErrorPropagation, 8097 WritableStreamDefaultWriterRelease = _require5.WritableStreamDefaultWriterRelease, 8098 WritableStreamDefaultWriterWrite = _require5.WritableStreamDefaultWriterWrite, 8099 WritableStreamCloseQueuedOrInFlight = _require5.WritableStreamCloseQueuedOrInFlight; 8100 8101 var ReadableStream = function () { 8102 function ReadableStream() { 8103 var underlyingSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 8104 8105 var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 8106 size = _ref.size, 8107 highWaterMark = _ref.highWaterMark; 8108 8109 _classCallCheck(this, ReadableStream); 8110 8111 this._state = 'readable'; 8112 this._reader = undefined; 8113 this._storedError = undefined; 8114 this._disturbed = false; 8115 this._readableStreamController = undefined; 8116 var type = underlyingSource.type; 8117 var typeString = String(type); 8118 8119 if (typeString === 'bytes') { 8120 if (highWaterMark === undefined) { 8121 highWaterMark = 0; 8122 } 8123 8124 this._readableStreamController = new ReadableByteStreamController(this, underlyingSource, highWaterMark); 8125 } else if (type === undefined) { 8126 if (highWaterMark === undefined) { 8127 highWaterMark = 1; 8128 } 8129 8130 this._readableStreamController = new ReadableStreamDefaultController(this, underlyingSource, size, highWaterMark); 8131 } else { 8132 throw new RangeError('Invalid type is specified'); 8133 } 8134 } 8135 8136 _createClass(ReadableStream, [{ 8137 key: 'cancel', 8138 value: function cancel(reason) { 8139 if (IsReadableStream(this) === false) { 8140 return Promise.reject(streamBrandCheckException('cancel')); 8141 } 8142 8143 if (IsReadableStreamLocked(this) === true) { 8144 return Promise.reject(new TypeError('Cannot cancel a stream that already has a reader')); 8145 } 8146 8147 return ReadableStreamCancel(this, reason); 8148 } 8149 }, { 8150 key: 'getReader', 8151 value: function getReader() { 8152 var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, 8153 mode = _ref2.mode; 8154 8155 if (IsReadableStream(this) === false) { 8156 throw streamBrandCheckException('getReader'); 8157 } 8158 8159 if (mode === undefined) { 8160 return AcquireReadableStreamDefaultReader(this); 8161 } 8162 8163 mode = String(mode); 8164 8165 if (mode === 'byob') { 8166 return AcquireReadableStreamBYOBReader(this); 8167 } 8168 8169 throw new RangeError('Invalid mode is specified'); 8170 } 8171 }, { 8172 key: 'pipeThrough', 8173 value: function pipeThrough(_ref3, options) { 8174 var writable = _ref3.writable, 8175 readable = _ref3.readable; 8176 var promise = this.pipeTo(writable, options); 8177 ifIsObjectAndHasAPromiseIsHandledInternalSlotSetPromiseIsHandledToTrue(promise); 8178 return readable; 8179 } 8180 }, { 8181 key: 'pipeTo', 8182 value: function pipeTo(dest) { 8183 var _this = this; 8184 8185 var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 8186 preventClose = _ref4.preventClose, 8187 preventAbort = _ref4.preventAbort, 8188 preventCancel = _ref4.preventCancel; 8189 8190 if (IsReadableStream(this) === false) { 8191 return Promise.reject(streamBrandCheckException('pipeTo')); 8192 } 8193 8194 if (IsWritableStream(dest) === false) { 8195 return Promise.reject(new TypeError('ReadableStream.prototype.pipeTo\'s first argument must be a WritableStream')); 8196 } 8197 8198 preventClose = Boolean(preventClose); 8199 preventAbort = Boolean(preventAbort); 8200 preventCancel = Boolean(preventCancel); 8201 8202 if (IsReadableStreamLocked(this) === true) { 8203 return Promise.reject(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream')); 8204 } 8205 8206 if (IsWritableStreamLocked(dest) === true) { 8207 return Promise.reject(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream')); 8208 } 8209 8210 var reader = AcquireReadableStreamDefaultReader(this); 8211 var writer = AcquireWritableStreamDefaultWriter(dest); 8212 var shuttingDown = false; 8213 var currentWrite = Promise.resolve(); 8214 return new Promise(function (resolve, reject) { 8215 function pipeLoop() { 8216 currentWrite = Promise.resolve(); 8217 8218 if (shuttingDown === true) { 8219 return Promise.resolve(); 8220 } 8221 8222 return writer._readyPromise.then(function () { 8223 return ReadableStreamDefaultReaderRead(reader).then(function (_ref5) { 8224 var value = _ref5.value, 8225 done = _ref5.done; 8226 8227 if (done === true) { 8228 return; 8229 } 8230 8231 currentWrite = WritableStreamDefaultWriterWrite(writer, value).cat
8231ch(function () {}); 8232 }); 8233 }).then(pipeLoop); 8234 } 8235 8236 isOrBecomesErrored(_this, reader._closedPromise, function (storedError) { 8237 if (preventAbort === false) { 8238 shutdownWithAction(function () { 8239 return WritableStreamAbort(dest, storedError); 8240 }, true, storedError); 8241 } else { 8242 shutdown(true, storedError); 8243 } 8244 }); 8245 isOrBecomesErrored(dest, writer._closedPromise, function (storedError) { 8246 if (preventCancel === false) { 8247 shutdownWithAction(function () { 8248 return ReadableStreamCancel(_this, storedError); 8249 }, true, storedError); 8250 } else { 8251 shutdown(true, storedError); 8252 } 8253 }); 8254 isOrBecomesClosed(_this, reader._closedPromise, function () { 8255 if (preventClose === false) { 8256 shutdownWithAction(function () { 8257 return WritableStreamDefaultWriterCloseWithErrorPropagation(writer); 8258 }); 8259 } else { 8260 shutdown(); 8261 } 8262 }); 8263 8264 if (WritableStreamCloseQueuedOrInFlight(dest) === true || dest._state === 'closed') { 8265 var destClosed = new TypeError('the destination writable stream closed before all data could be piped to it'); 8266 8267 if (preventCancel === false) { 8268 shutdownWithAction(function () { 8269 return ReadableStreamCancel(_this, destClosed); 8270 }, true, destClosed); 8271 } else { 8272 shutdown(true, destClosed); 8273 } 8274 } 8275 8276 pipeLoop().catch(function (err) { 8277 currentWrite = Promise.resolve(); 8278 rethrowAssertionErrorRejection(err); 8279 }); 8280 8281 function waitForWritesToFinish() { 8282 var oldCurrentWrite = currentWrite; 8283 return currentWrite.then(function () { 8284 return oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined; 8285 }); 8286 } 8287 8288 function isOrBecomesErrored(stream, promise, action) { 8289 if (stream._state === 'errored') { 8290 action(stream._storedError); 8291 } else { 8292 promise.catch(action).catch(rethrowAssertionErrorRejection); 8293 } 8294 } 8295 8296 function isOrBecomesClosed(stream, promise, action) { 8297 if (stream._state === 'closed') { 8298 action(); 8299 } else { 8300 promise.then(action).catch(rethrowAssertionErrorRejection); 8301 } 8302 } 8303 8304 function shutdownWithAction(action, originalIsError, originalError) { 8305 if (shuttingDown === true) { 8306 return; 8307 } 8308 8309 shuttingDown = true; 8310 8311 if (dest._state === 'writable' && WritableStreamCloseQueuedOrInFlight(dest) === false) { 8312 waitForWritesToFinish().then(doTheRest); 8313 } else { 8314 doTheRest(); 8315 } 8316 8317 function doTheRest() { 8318 action().then(function () { 8319 return finalize(originalIsError, originalError); 8320 }, function (newError) { 8321 return finalize(true, newError); 8322 }).catch(rethrowAssertionErrorRejection); 8323 } 8324 } 8325 8326 function shutdown(isError, error) { 8327 if (shuttingDown === true) { 8328 return; 8329 } 8330 8331 shuttingDown = true; 8332 8333 if (dest._state === 'writable' && WritableStreamCloseQueuedOrInFlight(dest) === false) { 8334 waitForWritesToFinish().then(function () { 8335 return finalize(isError, error); 8336 }).catch(rethrowAssertionErrorRejection); 8337 } else { 8338 finalize(isError, error); 8339 } 8340 } 8341 8342 function finalize(isError, error) { 8343 WritableStreamDefaultWriterRelease(writer); 8344 ReadableStreamReaderGenericRelease(reader); 8345 8346 if (isError) { 8347 reject(error); 8348 } else { 8349 resolve(undefined); 8350 } 8351 } 8352 }); 8353 } 8354 }, { 8355 key: 'tee', 8356 value: function tee() { 8357 if (IsReadableStream(this) === false) { 8358 throw streamBrandCheckException('tee'); 8359 } 8360 8361 var branches = ReadableStreamTee(this, false); 8362 return createArrayFromList(branches); 8363 } 8364 }, { 8365 key: 'locked', 8366 get: function get() { 8367 if (IsReadableStream(this) === false) { 8368 throw streamBrandCheckException('locked'); 8369 } 8370 8371 return IsReadableStreamLocked(this); 8372 } 8373 }]); 8374 8375 return ReadableStream; 8376 }(); 8377 8378 module.exports = { 8379 ReadableStream: ReadableStream, 8380 IsReadableStreamDisturbed: IsReadableStreamDisturbed, 8381 ReadableStreamDefaultControllerClose: ReadableStreamDefaultControllerClose, 8382 ReadableStreamDefaultControllerEnqueue: ReadableStreamDefaultControllerEnqueue, 8383 ReadableStreamDefaultControllerError: ReadableStreamDefaultControllerError, 8384 ReadableStreamDefaultControllerGetDesiredSize: ReadableStreamDefaultControllerGetDesiredSize 8385 }; 8386 8387 function AcquireReadableStreamBYOBReader(stream) { 8388 return new ReadableStreamBYOBReader(stream); 8389 } 8390 8391 function AcquireReadableStreamDefaultReader(stream) { 8392 return new ReadableStreamDefaultReader(stream); 8393 } 8394 8395 function IsReadableStream(x) { 8396 if (!typeIsObject(x)) { 8397 return false; 8398 } 8399 8400 if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) { 8401 return false; 8402 } 8403 8404 return true; 8405 } 8406 8407 function IsReadableStreamDisturbed(stream) {
8408 assert(IsReadableStream(stream) === true, 'IsReadableStreamDisturbed should only be used on known readable streams'); 8409 return stream._disturbed; 8410 } 8411 8412 function IsReadableStreamLocked(stream) { 8413 assert(IsReadableStream(stream) === true, 'IsReadableStreamLocked should only be used on known readable streams'); 8414 8415 if (stream._reader === undefined) { 8416 return false; 8417 } 8418 8419 return true; 8420 } 8421 8422 function ReadableStreamTee(stream, cloneForBranch2) { 8423 assert(IsReadableStream(stream) === true); 8424 assert(typeof cloneForBranch2 === 'boolean'); 8425 var reader = AcquireReadableStreamDefaultReader(stream); 8426 var teeState = { 8427 closedOrErrored: false, 8428 canceled1: false, 8429 canceled2: false, 8430 reason1: undefined, 8431 reason2: undefined 8432 }; 8433 teeState.promise = new Promise(function (resolve) { 8434 teeState._resolve = resolve; 8435 }); 8436 var pull = create_ReadableStreamTeePullFunction(); 8437 pull._reader = reader; 8438 pull._teeState = teeState; 8439 pull._cloneForBranch2 = cloneForBranch2; 8440 var cancel1 = create_ReadableStreamTeeBranch1CancelFunction(); 8441 cancel1._stream = stream; 8442 cancel1._teeState = teeState; 8443 var cancel2 = create_ReadableStreamTeeBranch2CancelFunction(); 8444 cancel2._stream = stream; 8445 cancel2._teeState = teeState; 8446 var underlyingSource1 = Object.create(Object.prototype);
8447 createDataProperty(underlyingSource1, 'pull', pull); 8448 createDataProperty(underlyingSource1, 'cancel', cancel1); 8449 var branch1Stream = new ReadableStream(underlyingSource1); 8450 var underlyingSource2 = Object.create(Object.prototype); 8451 createDataProperty(underlyingSource2, 'pull', pull); 8452 createDataProperty(underlyingSource2, 'cancel', cancel2); 8453 var branch2Stream = new ReadableStream(underlyingSource2); 8454 pull._branch1 = branch1Stream._readableStreamController; 8455 pull._branch2 = branch2Stream._readableStreamController; 8456 8457 reader._closedPromise.catch(function (r) { 8458 if (teeState.closedOrErrored === true) { 8459 return; 8460 } 8461 8462 ReadableStreamDefaultControllerError(pull._branch1, r); 8463 ReadableStreamDefaultControllerError(pull._branch2, r); 8464 teeState.closedOrErrored = true; 8465 }); 8466 8467 return [branch1Stream, branch2Stream]; 8468 } 8469 8470 function create_ReadableStreamTeePullFunction() { 8471 function f() { 8472 var reader = f._reader, 8473 branch1 = f._branch1, 8474 branch2 = f._branch2, 8475 teeState = f._teeState; 8476 return ReadableStreamDefaultReaderRead(reader).then(function (result) { 8477 assert(typeIsObject(result)); 8478 var value = result.value; 8479 var done = result.done; 8480 assert(typeof done === 'boolean'); 8481 8482 if (done === true && teeState.closedOrErrored === false) { 8483 if (teeState.canceled1 === false) { 8484 ReadableStreamDefaultControllerClose(branch1); 8485 } 8486 8487 if (teeState.canceled2 === false) { 8488 ReadableStreamDefaultControllerClose(branch2); 8489 } 8490 8491 teeState.closedOrErrored = true; 8492 } 8493 8494 if (teeState.closedOrErrored === true) { 8495 return; 8496 } 8497 8498 var value1 = value; 8499 var value2 = value; 8500 8501 if (teeState.canceled1 === false) { 8502 ReadableStreamDefaultControllerEnqueue(branch1, value1); 8503 } 8504 8505 if (teeState.canceled2 === false) { 8506 ReadableStreamDefaultControllerEnqueue(branch2, value2); 8507 } 8508 }); 8509 } 8510 8511 return f; 8512 } 8513 8514 function create_ReadableStreamTeeBranch1CancelFunction() { 8515 function f(reason) { 8516 var stream = f._stream, 8517 teeState = f._teeState; 8518 teeState.canceled1 = true; 8519 teeState.reason1 = reason; 8520 8521 if (teeState.canceled2 === true) { 8522 var compositeReason = createArrayFromList([teeState.reason1, teeState.reason2]); 8523 var cancelResult = ReadableStreamCancel(stream, compositeReason); 8524 8525 teeState._resolve(cancelResult); 8526 } 8527 8528 return teeState.promise; 8529 } 8530 8531 return f; 8532 } 8533 8534 function create_ReadableStreamTeeBranch2CancelFunction() { 8535 function f(reason) { 8536 var stream = f._stream, 8537 teeState = f._teeState; 8538 teeState.canceled2 = true; 8539 teeState.reason2 = reason; 8540 8541 if (teeState.canceled1 === true) { 8542 var compositeReason = createArrayFromList([teeState.reason1, teeState.reason2]); 8543 var cancelResult = ReadableStreamCancel(stream, compositeReason); 8544 8545 teeState._resolve(cancelResult); 8546 } 8547 8548 return teeState.promise; 8549 } 8550 8551 return f; 8552 } 8553 8554 function ReadableStreamAddReadIntoRequest(stream) { 8555 assert(IsReadableStreamBYOBReader(stream._reader) === true); 8556 assert(stream._state === 'readable' || stream._state === 'closed'); 8557 var promise = new Promise(function (resolve, reject) { 8558 var readIntoRequest = { 8559 _resolve: resolve, 8560 _reject: reject 8561 }; 8562 8563 stream._reader._readIntoRequests.push(readIntoRequest); 8564 }); 8565 return promise; 8566 } 8567 8568 function ReadableStreamAddReadRequest(stream) { 8569 assert(IsReadableStreamDefaultReader(stream._reader) === true); 8570 assert(stream._state === 'readable'); 8571 var promise = new Promise(function (resolve, reject) { 8572 var readRequest = { 8573 _resolve: resolve, 8574 _reject: reject 8575 }; 8576 8577 stream._reader._readRequests.push(readRequest); 8578 }); 8579 return promise; 8580 } 8581 8582 function ReadableStreamCancel(stream, reason) { 8583 stream._disturbed = true; 8584 8585 if (stream._state === 'closed') { 8586 return Promise.resolve(undefined); 8587 } 8588 8589 if (stream._state === 'errored') { 8590 return Promise.reject(stream._storedError); 8591 } 8592 8593 ReadableStreamClose(stream); 8594 8595 var sourceCancelPromise = stream._readableStreamController.__cancelSteps(reason); 8596 8597 return sourceCancelPromise.then(function () { 8598 return undefined; 8599 });
8600 } 8601 8602 function ReadableStreamClose(stream) { 8603 assert(stream._state === 'readable'); 8604 stream._state = 'closed'; 8605 var reader = stream._reader; 8606 8607 if (reader === undefined) { 8608 return undefined; 8609 } 8610 8611 if (IsReadableStreamDefaultReader(reader) === true) { 8612 for (var i = 0; i < reader._readRequests.length; i++) { 8613 var _resolve = reader._readRequests[i]._resolve; 8614 8615 _resolve(CreateIterResultObject(undefined, true)); 8616 } 8617 8618 reader._readRequests = []; 8619 } 8620 8621 defaultReaderClosedPromiseResolve(reader); 8622 return undefined; 8623 } 8624 8625 function ReadableStreamError(stream, e) { 8626 assert(IsReadableStream(stream) === true, 'stream must be ReadableStream'); 8627 assert(stream._state === 'readable', 'state must be readable'); 8628 stream._state = 'errored'; 8629 stream._storedError = e; 8630 var reader = stream._reader; 8631 8632 if (reader === undefined) { 8633 return undefined; 8634 } 8635 8636 if (IsReadableStreamDefaultReader(reader) === true) { 8637 for (var i = 0; i < reader._readRequests.length; i++) { 8638 var readRequest = reader._readRequests[i]; 8639 8640 readRequest._reject(e); 8641 } 8642 8643 reader._readRequests = []; 8644 } else { 8645 assert(IsReadableStreamBYOBReader(reader), 'reader must be ReadableStreamBYOBReader'); 8646 8647 for (var _i = 0; _i < reader._readIntoRequests.length; _i++) { 8648 var readIntoRequest = reader._readIntoRequests[_i]; 8649 8650 readIntoRequest._reject(e); 8651 } 8652 8653 reader._readIntoRequests = []; 8654 } 8655 8656 defaultReaderClosedPromiseReject(reader, e); 8657 8658 reader._closedPromise.catch(function () {}); 8659 } 8660 8661 function ReadableStreamFulfillReadIntoRequest(stream, chunk, done) { 8662 var reader = stream._reader; 8663 assert(reader._readIntoRequests.length > 0); 8664 8665 var readIntoRequest = reader._readIntoRequests.shift(); 8666 8667 readIntoRequest._resolve(CreateIterResultObject(chunk, done)); 8668 } 8669 8670 function ReadableStreamFulfillReadRequest(stream, chunk, done) { 8671 var reader = stream._reader; 8672 assert(reader._readRequests.length > 0); 8673 8674 var readRequest = reader._readRequests.shift(); 8675 8676 readRequest._resolve(CreateIterResultObject(chunk, done)); 8677 } 8678 8679 function ReadableStreamGetNumReadIntoRequests(stream) { 8680 return stream._reader._readIntoRequests.length; 8681 } 8682 8683 function ReadableStreamGetNumReadRequests(stream) { 8684 return stream._reader._readRequests.length; 8685 } 8686 8687 function ReadableStreamHasBYOBReader(stream) { 8688 var reader = stream._reader; 8689 8690 if (reader === undefined) { 8691 return false; 8692 } 8693 8694 if (IsReadableStreamBYOBReader(reader) === false) { 8695 return false; 8696 } 8697 8698 return true; 8699 } 8700 8701 function ReadableStreamHasDefaultReader(stream) { 8702 var reader = stream._reader; 8703 8704 if (reader === undefined) { 8705 return false; 8706 } 8707 8708 if (IsReadableStreamDefaultReader(reader) === false) { 8709 return false; 8710 } 8711 8712 return true; 8713 } 8714 8715 var ReadableStreamDefaultReader = function () { 8716 function ReadableStreamDefaultReader(stream) { 8717 _classCallCheck(this, ReadableStreamDefaultReader); 8718 8719 if (IsReadableStream(stream) === false) { 8720 throw new TypeError('ReadableStreamDefaultReader can only be constructed with a ReadableStream instance'); 8721 } 8722 8723 if (IsReadableStreamLocked(stream) === true) { 8724 throw new TypeError('This stream has already been locked for exclusive reading by another reader'); 8725 } 8726 8727 ReadableStreamReaderGenericInitialize(this, stream); 8728 this._readRequests = []; 8729 } 8730 8731 _createClass(ReadableStreamDefaultReader, [{ 8732 key: 'cancel', 8733 value: function cancel(reason) { 8734 if (IsReadableStreamDefaultReader(this) === false) { 8735 return Promise.reject(defaultReaderBrandCheckException('cancel')); 8736 } 8737 8738 if (this._ownerReadableStream === undefined) { 8739 return Promise.reject(readerLockException('cancel')); 8740 } 8741 8742 return ReadableStreamReaderGenericCancel(this, reason); 8743 } 8744 }, { 8745 key: 'read', 8746 value: function read() { 8747 if (IsReadableStreamDefaultReader(this) === false) { 8748 return Promise.reject(defaultReaderBrandCheckException('read')); 8749 } 8750 8751 if (this._ownerReadableStream === undefined) { 8752 return Promise.reject(readerLockException('read from')); 8753 } 8754 8755 return ReadableStreamDefaultReaderRead(this); 8756 } 8757 }, { 8758 key: 'releaseLock', 8759 value: function releaseLock() { 8760 if (IsReadableStreamDefaultReader(this) === false) { 8761 throw defaultReaderBrandCheckException('releaseLock'); 8762 } 8763 8764 if (this._ownerReadableStream === undefined) { 8765 return; 8766 } 8767 8768 if (this._readRequests.length > 0) { 8769 throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled'); 8770 } 8771 8772 ReadableStreamReaderGenericRelease(this); 8773 } 8774 }, { 8775 key: 'closed', 8776 get: function get() { 8777 if (IsReadableStreamDefaultReader(this) === false) { 8778 return Promise.reject(defaultReaderBrandCheckException('closed')); 8779 } 8780 8781 return this._closedPromise; 8782 } 8783 }]); 8784 8785 return ReadableStreamDefaultReader; 8786 }(); 8787 8788 var ReadableStreamBYOBReader = function () { 8789 function ReadableStreamBYOBReader(stream) { 8790 _classCallCheck(this, ReadableStreamBYOBReader); 8791 8792 if (!IsReadableStream(stream)) { 8793 throw new TypeError('ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a ' + 'byte source'); 8794 } 8795 8796 if (IsReadableByteStreamController(stream._readableStreamController) === false) { 8797 throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' + '
8797source'); 8798 } 8799 8800 if (IsReadableStreamLocked(stream)) { 8801 throw new TypeError('This stream has already been locked for exclusive reading by another reader'); 8802 } 8803 8804 ReadableStreamReaderGenericInitialize(this, stream); 8805 this._readIntoRequests = []; 8806 } 8807 8808 _createClass(ReadableStreamBYOBReader, [{ 8809 key: 'cancel', 8810 value: function cancel(reason) { 8811 if (!IsReadableStreamBYOBReader(this)) { 8812 return Promise.reject(byobReaderBrandCheckException('cancel')); 8813 } 8814 8815 if (this._ownerReadableStream === undefined) { 8816 return Promise.reject(readerLockException('cancel')); 8817 } 8818 8819 return ReadableStreamReaderGenericCancel(this, reason); 8820 } 8821 }, { 8822 key: 'read', 8823 value: function read(view) { 8824 if (!IsReadableStreamBYOBReader(this)) { 8825 return Promise.reject(byobReaderBrandCheckException('read')); 8826 } 8827 8828 if (this._ownerReadableStream === undefined) { 8829 return Promise.reject(readerLockException('read from')); 8830 } 8831 8832 if (!ArrayBuffer.isView(view)) { 8833 return Promise.reject(new TypeError('view must be an array buffer view')); 8834 } 8835 8836 if (view.byteLength === 0) { 8837 return Promise.reject(new TypeError('view must have non-zero byteLength')); 8838 } 8839 8840 return ReadableStreamBYOBReaderRead(this, view); 8841 } 8842 }, { 8843 key: 'releaseLock', 8844 value: function releaseLock() { 8845 if (!IsReadableStreamBYOBReader(this)) { 8846 throw byobReaderBrandCheckException('releaseLock'); 8847 } 8848 8849 if (this._ownerReadableStream === undefined) { 8850 return; 8851 } 8852 8853 if (this._readIntoRequests.length > 0) { 8854 throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled'); 8855 } 8856 8857 ReadableStreamReaderGenericRelease(this); 8858 } 8859 }, { 8860 key: 'closed', 8861 get: function get() { 8862 if (!IsReadableStreamBYOBReader(this)) { 8863 return Promise.reject(byobReaderBrandCheckException('closed')); 8864 } 8865 8866 return this._closedPromise; 8867 } 8868 }]); 8869 8870 return ReadableStreamBYOBReader; 8871 }(); 8872 8873 function IsReadableStreamBYOBReader(x) { 8874 if (!typeIsObject(x)) { 8875 return false; 8876 } 8877 8878 if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) { 8879 return false; 8880 } 8881 8882 return true; 8883 } 8884 8885 function IsReadableStreamDefaultReader(x) { 8886 if (!typeIsObject(x)) { 8887 return false; 8888 } 8889 8890 if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) { 8891 return false; 8892 } 8893 8894 return true; 8895 } 8896 8897 function ReadableStreamReaderGenericInitialize(reader, stream) { 8898 reader._ownerReadableStream = stream; 8899 stream._reader = reader; 8900 8901 if (stream._state === 'readable') { 8902 defaultReaderClosedPromiseInitialize(reader); 8903 } else if (stream._state === 'closed') { 8904 defaultReaderClosedPromiseInitializeAsResolved(reader); 8905 } else { 8906 assert(stream._state === 'errored', 'state must be errored'); 8907 defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError); 8908 8909 reader._closedPromise.catch(function () {}); 8910 } 8911 } 8912 8913 function ReadableStreamReaderGenericCancel(reader, reason) { 8914 var stream = reader._ownerReadableStream; 8915 assert(stream !== undefined); 8916 return ReadableStreamCancel(stream, reason); 8917 } 8918 8919 function ReadableStreamReaderGenericRelease(reader) { 8920 assert(reader._ownerReadableStream !== undefined); 8921 assert(reader._ownerReadableStream._reader === reader); 8922 8923 if (reader._ownerReadableStream._state === 'readable') { 8924 defaultReaderClosedPromiseReject(reader, new TypeError('Reader was released and can no longer be used to monitor the stream\'s closedness')); 8925 } else { 8926 defaultReaderClosedPromiseResetToRejected(reader, new TypeError('Reader was released and can no longer be used to monitor the stream\'s closedness')); 8927 } 8928 8929 reader._closedPromise.catch(function () {}); 8930 8931 reader._ownerReadableStream._reader = undefined; 8932 reader._ownerReadableStream = undefined; 8933 } 8934 8935 function ReadableStreamBYOBReaderRead(reader, view) { 8936 var stream = reader._ownerReadableStream; 8937 assert(stream !== undefined); 8938 stream._disturbed = true; 8939 8940 if (stream._state === 'errored') { 8941 return Promise.reject(stream._storedError); 8942 } 8943 8944 return ReadableByteStreamControllerPullInto(stream._readableStreamController, view); 8945 } 8946 8947 function ReadableStreamDefaultReaderRead(reader) { 8948 var stream = reader._ownerReadableStream; 8949 assert(stream !== undefined); 8950 stream._disturbed = true; 8951 8952 if (stream._state === 'closed') { 8953 return Promise.resolve(CreateIterResultObject(undefined, true)); 8954 } 8955 8956 if (stream._state === 'errored') { 8957 return Promise.reject(stream._storedError); 8958 } 8959 8960 assert(stream._state === 'readable'); 8961 return stream._readableStreamController.__pullSteps(); 8962 } 8963 8964 var ReadableStreamDefaultController = function () { 8965 function ReadableStreamDefaultController(stream, underlyingSource, size, highWaterMark) { 8966 _classCallCheck(this, ReadableStreamDefaultController); 8967
8968 if (IsReadableStream(stream) === false) { 8969 throw new TypeError('ReadableStreamDefaultController can only be constructed with a ReadableStream instance'); 8970 } 8971 8972 if (stream._readableStreamController !== undefined) { 8973 throw new TypeError('ReadableStreamDefaultController instances can only be created by the ReadableStream constructor'); 8974 } 8975 8976 this._controlledReadableStream = stream; 8977 this._underlyingSource = underlyingSource; 8978 this._queue = undefined; 8979 this._queueTotalSize = undefined; 8980 ResetQueue(this); 8981 this._started = false; 8982 this._closeRequested = false; 8983 this._pullAgain = false; 8984 this._pulling = false; 8985 var normalizedStrategy = ValidateAndNormalizeQueuingStrategy(size, highWaterMark); 8986 this._strategySize = normalizedStrategy.size; 8987 this._strategyHWM = normalizedStrategy.highWaterMark; 8988 var controller = this; 8989 var startResult = InvokeOrNoop(underlyingSource, 'start', [this]); 8990 Promise.resolve(startResult).then(function () { 8991 controller._started = true; 8992 assert(controller._pulling === false); 8993 assert(controller._pullAgain === false); 8994 ReadableStreamDefaultControllerCallPullIfNeeded(controller); 8995 }, function (r) { 8996 ReadableStreamDefaultControllerErrorIfNeeded(controller, r); 8997 }).catch(rethrowAssertionErrorRejection); 8998 } 8999 9000 _createClass(ReadableStreamDefaultController, [{ 9001 key: 'close', 9002 value: function close() { 9003 if (IsReadableStreamDefaultController(this) === false) { 9004 throw defaultControllerBrandCheckException('close'); 9005 } 9006 9007 if (this._closeRequested === true) { 9008 throw new TypeError('The stream has already been closed; do not close it again!'); 9009 } 9010 9011 var state = this._controlledReadableStream._state; 9012 9013 if (state !== 'readable') { 9014 throw new TypeError('The stream (in ' + state + ' state) is not in the readable state and cannot be closed'); 9015 } 9016 9017 ReadableStreamDefaultControllerClose(this); 9018 } 9019 }, { 9020 key: 'enqueue', 9021 value: function enqueue(chunk) { 9022 if (IsReadableStreamDefaultController(this) === false) { 9023 throw defaultControllerBrandCheckException('enqueue'); 9024 } 9025 9026 if (this._closeRequested === true) { 9027 throw new TypeError('stream is closed or draining'); 9028 } 9029 9030 var state = this._controlledReadableStream._state; 9031 9032 if (state !== 'readable') { 9033 throw new TypeError('The stream (in ' + state + ' state) is not in the readable state and cannot be enqueued to'); 9034 } 9035 9036 return ReadableStreamDefaultControllerEnqueue(this, chunk); 9037 } 9038 }, { 9039 key: 'error', 9040 value: function error(e) { 9041 if (IsReadableStreamDefaultController(this) === false) { 9042 throw defaultControllerBrandCheckException('error'); 9043 } 9044 9045 var stream = this._controlledReadableStream; 9046 9047 if (stream._state !== 'readable') { 9048 throw new TypeError('The stream is ' + stream._state + ' and so cannot be errored'); 9049 } 9050 9051 ReadableStreamDefaultControllerError(this, e); 9052 } 9053 }, { 9054 key: '__cancelSteps', 9055 value: function __cancelSteps(reason) { 9056 ResetQueue(this); 9057 return PromiseInvokeOrNoop(this._underlyingSource, 'cancel', [reason]); 9058 } 9059 }, { 9060 key: '__pullSteps', 9061 value: function __pullSteps() { 9062 var stream = this._controlledReadableStream; 9063 9064 if (this._queue.length > 0) { 9065 var chunk = DequeueValue(this); 9066 9067 if (this._closeRequested === true && this._queue.length === 0) { 9068 ReadableStreamClose(stream); 9069 } else { 9070 ReadableStreamDefaultControllerCallPullIfNeeded(this); 9071 } 9072 9073 return Promise.resolve(CreateIterResultObject(chunk, false)); 9074 } 9075 9076 var pendingPromise = ReadableStreamAddReadRequest(stream); 9077 ReadableStreamDefaultControllerCallPullIfNeeded(this); 9078 return pendingPromise; 9079 } 9080 }, { 9081 key: 'desiredSize', 9082 get: function get() { 9083 if (IsReadableStreamDefaultController(this) === false) { 9084 throw defaultControllerBrandCheckException('desiredSize'); 9085 } 9086 9087 return ReadableStreamDefaultControllerGetDesiredSize(this); 9088 } 9089 }]); 9090 9091 return ReadableStreamDefaultController; 9092 }(); 9093 9094 function IsReadableStreamDefaultController(x) { 9095 if (!typeIsObject(x)) { 9096 return false; 9097 } 9098 9099 if (!Object.prototype.hasOwnProperty.call(x, '_underlyingSource')) { 9100 return false; 9101 } 9102 9103 return true; 9104 } 9105 9106 function ReadableStreamDefaultControllerCallPullIfNeeded(controller) { 9107 var shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller); 9108 9109 if (shouldPull === false) { 9110 return undefined; 9111 } 9112 9113 if (controller._pulling === true) { 9114 controller._pullAgain = true; 9115 return undefined; 9116 } 9117 9118 assert(controller._pullAgain === false); 9119 controller._pulling = true; 9120 var pullPromise = PromiseInvokeOrNoop(controller._underlyingSource, 'pull', [controller]); 9121 pullPromise.then(function () { 9122 controller._pulling = false; 9123 9124 if (controller._pullAgain === true) { 9125 controller._pullAgain = false; 9126 return ReadableStreamDefaultControllerCallPullIfNeeded(controller); 9127 } 9128 9129 return undefined; 9130 }, function (e) { 9131 ReadableStreamDefaultControllerErrorIfNeeded(controller, e); 9132 }).catch(rethrowAssertionErrorRejection); 9133 return undefined; 9134 } 9135 9136 function ReadableStreamDefaultControllerShouldCallPull(controller) { 9137 var stream = controller._controlledReadableStream; 9138 9139 if (stream._state === 'closed' || stream._state === 'errored') { 9140 return false; 9141 } 9142 9143 if (controller._closeRequested === true) { 9144 return false; 9145 } 9146 9147 if (controller._started === false) { 9148 return false; 9149 } 9150
9151 if (IsReadableStreamLocked(stream) === true && ReadableStreamGetNumReadRequests(stream) > 0) { 9152 return true; 9153 } 9154 9155 var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller); 9156 9157 if (desiredSize > 0) { 9158 return true; 9159 } 9160 9161 return false; 9162 } 9163 9164 function ReadableStreamDefaultControllerClose(controller) { 9165 var stream = controller._controlledReadableStream; 9166 assert(controller._closeRequested === false); 9167 assert(stream._state === 'readable'); 9168 controller._closeRequested = true; 9169 9170 if (controller._queue.length === 0) { 9171 ReadableStreamClose(stream); 9172 } 9173 } 9174 9175 function ReadableStreamDefaultControllerEnqueue(controller, chunk) { 9176 var stream = controller._controlledReadableStream; 9177 assert(controller._closeRequested === false); 9178 assert(stream._state === 'readable'); 9179 9180 if (IsReadableStreamLocked(stream) === true && ReadableStreamGetNumReadRequests(stream) > 0) { 9181 ReadableStreamFulfillReadRequest(stream, chunk, false); 9182 } else { 9183 var chunkSize = 1; 9184 9185 if (controller._strategySize !== undefined) { 9186 var strategySize = controller._strategySize; 9187 9188 try { 9189 chunkSize = strategySize(chunk); 9190 } catch (chunkSizeE) { 9191 ReadableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE); 9192 throw chunkSizeE; 9193 } 9194 } 9195 9196 try { 9197 EnqueueValueWithSize(controller, chunk, chunkSize); 9198 } catch (enqueueE) { 9199 ReadableStreamDefaultControllerErrorIfNeeded(controller, enqueueE); 9200 throw enqueueE; 9201 } 9202 } 9203 9204 ReadableStreamDefaultControllerCallPullIfNeeded(controller); 9205 return undefined; 9206 } 9207 9208 function ReadableStreamDefaultControllerError(controller, e) { 9209 var stream = controller._controlledReadableStream; 9210 assert(stream._state === 'readable'); 9211 ResetQueue(controller); 9212 ReadableStreamError(stream, e); 9213 } 9214 9215 function ReadableStreamDefaultControllerErrorIfNeeded(controller, e) { 9216 if (controller._controlledReadableStream._state === 'readable') { 9217 ReadableStreamDefaultControllerError(controller, e); 9218 } 9219 } 9220 9221 function ReadableStreamDefaultControllerGetDesiredSize(controller) { 9222 var stream = controller._controlledReadableStream; 9223 var state = stream._state; 9224 9225 if (state === 'errored') { 9226 return null; 9227 } 9228 9229 if (state === 'closed') { 9230 return 0; 9231 } 9232 9233 return controller._strategyHWM - controller._queueTotalSize; 9234 } 9235 9236 var ReadableStreamBYOBRequest = function () { 9237 function ReadableStreamBYOBRequest(controller, view) { 9238 _classCallCheck(this, ReadableStreamBYOBRequest); 9239 9240 this._associatedReadableByteStreamController = controller; 9241 this._view = view; 9242 } 9243 9244 _createClass(ReadableStreamBYOBRequest, [{ 9245 key: 'respond', 9246 value: function respond(bytesWritten) { 9247 if (IsReadableStreamBYOBRequest(this) === false) { 9248 throw byobRequestBrandCheckException('respond'); 9249 } 9250 9251 if (this._associatedReadableByteStreamController === undefined) { 9252 throw new TypeError('This BYOB request has been invalidated'); 9253 } 9254 9255 ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten); 9256 } 9257 }, { 9258 key: 'respondWithNewView', 9259 value: function respondWithNewView(view) { 9260 if (IsReadableStreamBYOBRequest(this) === false) { 9261 throw byobRequestBrandCheckException('respond'); 9262 } 9263 9264 if (this._associatedReadableByteStreamController === undefined) { 9265 throw new TypeError('This BYOB request has been invalidated'); 9266 } 9267 9268 if (!ArrayBuffer.isView(view)) { 9269 throw new TypeError('You can only respond with array buffer views'); 9270 } 9271 9272 ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view); 9273 } 9274 }, { 9275 key: 'view', 9276 get: function get() { 9277 return this._view; 9278 } 9279 }]); 9280 9281 return ReadableStreamBYOBRequest; 9282 }(); 9283 9284 var ReadableByteStreamController = function () { 9285 function ReadableByteStreamController(stream, underlyingByteSource, highWaterMark) { 9286 _classCallCheck(this, ReadableByteStreamController); 9287
9288 if (IsReadableStream(stream) === false) { 9289 throw new TypeError('ReadableByteStreamController can only be constructed with a ReadableStream instance given ' + 'a byte source'); 9290 } 9291 9292 if (stream._readableStreamController !== undefined) { 9293 throw new TypeError('ReadableByteStreamController instances can only be created by the ReadableStream constructor given a byte ' + 'source'); 9294 } 9295 9296 this._controlledReadableStream = stream; 9297 this._underlyingByteSource = underlyingByteSource; 9298 this._pullAgain = false; 9299 this._pulling = false; 9300 ReadableByteStreamControllerClearPendingPullIntos(this); 9301 this._queue = this._queueTotalSize = undefined; 9302 ResetQueue(this); 9303 this._closeRequested = false; 9304 this._started = false; 9305 this._strategyHWM = ValidateAndNormalizeHighWaterMark(highWaterMark); 9306 var autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize; 9307 9308 if (autoAllocateChunkSize !== undefined) { 9309 if (Number.isInteger(autoAllocateChunkSize) === false || autoAllocateChunkSize <= 0) { 9310 throw new RangeError('autoAllocateChunkSize must be a positive integer'); 9311 } 9312 } 9313 9314 this._autoAllocateChunkSize = autoAllocateChunkSize; 9315 this._pendingPullIntos = []; 9316 var controller = this; 9317 var startResult = InvokeOrNoop(underlyingByteSource, 'start', [this]); 9318 Promise.resolve(startResult).then(function () { 9319 controller._started = true; 9320 assert(controller._pulling === false); 9321 assert(controller._pullAgain === false); 9322 ReadableByteStreamControllerCallPullIfNeeded(controller); 9323 }, function (r) { 9324 if (stream._state === 'readable') { 9325 ReadableByteStreamControllerError(controller, r); 9326 } 9327 }).catch(rethrowAssertionErrorRejection); 9328 } 9329 9330 _createClass(ReadableByteStreamController, [{ 9331 key: 'close', 9332 value: function close() { 9333 if (IsReadableByteStreamController(this) === false) { 9334 throw byteStreamControllerBrandCheckException('close'); 9335 } 9336 9337 if (this._closeRequested === true) { 9338 throw new TypeError('The stream has already been closed; do not close it again!'); 9339 } 9340 9341 var state = this._controlledReadableStream._state; 9342 9343 if (state !== 'readable') { 9344 throw new TypeError('The stream (in ' + state + ' state) is not in the readable state and cannot be closed'); 9345 } 9346 9347 ReadableByteStreamControllerClose(this); 9348 } 9349 }, { 9350 key: 'enqueue', 9351 value: function enqueue(chunk) { 9352 if (IsReadableByteStreamController(this) === false) { 9353 throw byteStreamControllerBrandCheckException('enqueue'); 9354 } 9355 9356 if (this._closeRequested === true) { 9357 throw new TypeError('stream is closed or draining'); 9358 } 9359 9360 var state = this._controlledReadableStream._state; 9361 9362 if (state !== 'readable') { 9363 throw new TypeError('The stream (in ' + state + ' state) is not in the readable state and cannot be enqueued to'); 9364 } 9365 9366 if (!ArrayBuffer.isView(chunk)) { 9367 throw new TypeError('You can only enqueue array buffer views when using a ReadableByteStreamController'); 9368 } 9369 9370 ReadableByteStreamControllerEnqueue(this, chunk); 9371 } 9372 }, { 9373 key: 'error', 9374 value: function error(e) { 9375 if (IsReadableByteStreamController(this) === false) { 9376 throw byteStreamControllerBrandCheckException('error'); 9377 } 9378 9379 var stream = this._controlledReadableStream; 9380 9381 if (stream._state !== 'readable') { 9382 throw new TypeError('The stream is ' + stream._state + ' and so cannot be errored'); 9383 } 9384 9385 ReadableByteStreamControllerError(this, e); 9386 } 9387 }, { 9388 key: '__cancelSteps', 9389 value: function __cancelSteps(reason) { 9390 if (this._pendingPullIntos.length > 0) { 9391 var firstDescriptor = this._pendingPullIntos[0]; 9392 firstDescriptor.bytesFilled = 0; 9393 } 9394 9395 ResetQueue(this); 9396 return PromiseInvokeOrNoop(this._underlyingByteSource, 'cancel', [reason]); 9397 } 9398 }, { 9399 key: '__pullSteps', 9400 value: function __pullSteps() { 9401 var stream = this._controlledReadableStream;
9402 assert(ReadableStreamHasDefaultReader(stream) === true); 9403 9404 if (this._queueTotalSize > 0) { 9405 assert(ReadableStreamGetNumReadRequests(stream) === 0); 9406 9407 var entry = this._queue.shift(); 9408 9409 this._queueTotalSize -= entry.byteLength; 9410 ReadableByteStreamControllerHandleQueueDrain(this); 9411 var view = void 0; 9412 9413 try { 9414 view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength); 9415 } catch (viewE) { 9416 return Promise.reject(viewE); 9417 } 9418 9419 return Promise.resolve(CreateIterResultObject(view, false)); 9420 } 9421 9422 var autoAllocateChunkSize = this._autoAllocateChunkSize; 9423 9424 if (autoAllocateChunkSize !== undefined) { 9425 var buffer = void 0; 9426 9427 try { 9428 buffer = new ArrayBuffer(autoAllocateChunkSize); 9429 } catch (bufferE) { 9430 return Promise.reject(bufferE); 9431 } 9432 9433 var pullIntoDescriptor = { 9434 buffer: buffer, 9435 byteOffset: 0, 9436 byteLength: autoAllocateChunkSize, 9437 bytesFilled: 0, 9438 elementSize: 1, 9439 ctor: Uint8Array, 9440 readerType: 'default' 9441 }; 9442 9443 this._pendingPullIntos.push(pullIntoDescriptor); 9444 } 9445 9446 var promise = ReadableStreamAddReadRequest(stream); 9447 ReadableByteStreamControllerCallPullIfNeeded(this); 9448 return promise; 9449 } 9450 }, { 9451 key: 'byobRequest', 9452 get: function get() { 9453 if (IsReadableByteStreamController(this) === false) { 9454 throw byteStreamControllerBrandCheckException('byobRequest'); 9455 } 9456 9457 if (this._byobRequest === undefined && this._pendingPullIntos.length > 0) { 9458 var firstDescriptor = this._pendingPullIntos[0]; 9459 var view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled); 9460 this._byobRequest = new ReadableStreamBYOBRequest(this, view); 9461 } 9462 9463 return this._byobRequest; 9464 } 9465 }, { 9466 key: 'desiredSize', 9467 get: function get() { 9468 if (IsReadableByteStreamController(this) === false) { 9469 throw byteStreamControllerBrandCheckException('desiredSize'); 9470 } 9471 9472 return ReadableByteStreamControllerGetDesiredSize(this); 9473 } 9474 }]); 9475 9476 return ReadableByteStreamController; 9477 }(); 9478 9479 function IsReadableByteStreamController(x) { 9480 if (!typeIsObject(x)) { 9481 return false; 9482 } 9483 9484 if (!Object.prototype.hasOwnProperty.call(x, '_underlyingByteSource')) { 9485 return false; 9486 } 9487 9488 return true; 9489 } 9490 9491 function IsReadableStreamBYOBRequest(x) { 9492 if (!typeIsObject(x)) { 9493 return false; 9494 } 9495 9496 if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) { 9497 return false; 9498 } 9499 9500 return true; 9501 } 9502 9503 function ReadableByteStreamControllerCallPullIfNeeded(controller) { 9504 var shouldPull = ReadableByteStreamControllerShouldCallPull(controller); 9505 9506 if (shouldPull === false) { 9507 return undefined; 9508 } 9509 9510 if (controller._pulling === true) { 9511 controller._pullAgain = true; 9512 return undefined; 9513 } 9514 9515 assert(controller._pullAgain === false); 9516 controller._pulling = true; 9517 var pullPromise = PromiseInvokeOrNoop(controller._underlyingByteSource, 'pull', [controller]); 9518 pullPromise.then(function () { 9519 controller._pulling = false; 9520 9521 if (controller._pullAgain === true) { 9522 controller._pullAgain = false; 9523 ReadableByteStreamControllerCallPullIfNeeded(controller); 9524 } 9525 }, function (e) { 9526 if (controller._controlledReadableStream._state === 'readable') { 9527 ReadableByteStreamControllerError(controller, e); 9528 } 9529 }).catch(rethrowAssertionErrorRejection); 9530 return undefined; 9531 } 9532 9533 function ReadableByteStreamControllerClearPendingPullIntos(controller) { 9534 ReadableByteStreamControllerInvalidateBYOBRequest(controller); 9535 controller._pendingPullIntos = []; 9536 } 9537 9538 function ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) { 9539 assert(stream._state !== 'errored', 'state must not be errored'); 9540 var done = false; 9541 9542 if (stream._state === 'closed') { 9543 assert(pullIntoDescriptor.bytesFilled === 0); 9544 done = true; 9545 } 9546 9547 var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); 9548 9549 if (pullIntoDescriptor.readerType === 'default') { 9550 ReadableStreamFulfillReadRequest(stream, filledView, done); 9551 } else { 9552 assert(pullIntoDescriptor.readerType === 'byob'); 9553 ReadableStreamFulfillReadIntoRequest(stream, filledView, done); 9554 } 9555 } 9556 9557 function ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) { 9558 var bytesFilled = pullIntoDescriptor.bytesFilled; 9559 var elementSize = pullIntoDescriptor.elementSize; 9560 assert(bytesFilled <= pullIntoDescriptor.byteLength); 9561 assert(bytesFilled % elementSize === 0); 9562 return new pullIntoDescriptor.ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize); 9563 } 9564 9565 function ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) { 9566 controller._queue.push({ 9567 buffer: buffer, 9568 byteOffset: byteOffset, 9569 byteLength: byteLength 9570 });
9571 9572 controller._queueTotalSize += byteLength; 9573 } 9574 9575 function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) { 9576 var elementSize = pullIntoDescriptor.elementSize; 9577 var currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % elementSize; 9578 var maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled); 9579 var maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy; 9580 var maxAlignedBytes = maxBytesFilled - maxBytesFilled % elementSize; 9581 var totalBytesToCopyRemaining = maxBytesToCopy; 9582 var ready = false; 9583 9584 if (maxAlignedBytes > currentAlignedBytes) { 9585 totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled; 9586 ready = true; 9587 } 9588 9589 var queue = controller._queue; 9590 9591 while (totalBytesToCopyRemaining > 0) { 9592 var headOfQueue = queue[0]; 9593 var bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength); 9594 var destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; 9595 ArrayBufferCopy(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy); 9596 9597 if (headOfQueue.byteLength === bytesToCopy) { 9598 queue.shift(); 9599 } else { 9600 headOfQueue.byteOffset += bytesToCopy; 9601 headOfQueue.byteLength -= bytesToCopy; 9602 } 9603 9604 controller._queueTotalSize -= bytesToCopy; 9605 ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor); 9606 totalBytesToCopyRemaining -= bytesToCopy; 9607 } 9608 9609 if (ready === false) { 9610 assert(controller._queueTotalSize === 0, 'queue must be empty'); 9611 assert(pullIntoDescriptor.bytesFilled > 0); 9612 assert(pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize); 9613 } 9614 9615 return ready; 9616 } 9617 9618 function ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) { 9619 assert(controller._pendingPullIntos.length === 0 || controller._pendingPullIntos[0] === pullIntoDescriptor); 9620 ReadableByteStreamControllerInvalidateBYOBRequest(controller); 9621 pullIntoDescriptor.bytesFilled += size; 9622 } 9623 9624 function ReadableByteStreamControllerHandleQueueDrain(controller) { 9625 assert(controller._controlledReadableStream._state === 'readable'); 9626 9627 if (controller._queueTotalSize === 0 && controller._closeRequested === true) { 9628 ReadableStreamClose(controller._controlledReadableStream); 9629 } else { 9630 ReadableByteStreamControllerCallPullIfNeeded(controller); 9631 } 9632 } 9633 9634 function ReadableByteStreamControllerInvalidateBYOBRequest(controller) { 9635 if (controller._byobRequest === undefined) { 9636 return; 9637 } 9638 9639 controller._byobRequest._associatedReadableByteStreamController = undefined; 9640 controller._byobRequest._view = undefined; 9641 controller._byobRequest = undefined; 9642 } 9643 9644 function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) { 9645 assert(controller._closeRequested === false); 9646 9647 while (controller._pendingPullIntos.length > 0) { 9648 if (controller._queueTotalSize === 0) { 9649 return; 9650 } 9651 9652 var pullIntoDescriptor = controller._pendingPullIntos[0]; 9653 9654 if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) === true) { 9655 ReadableByteStreamControllerShiftPendingPullInto(controller); 9656 ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableStream, pullIntoDescriptor); 9657 } 9658 } 9659 } 9660 9661 function ReadableByteStreamControllerPullInto(controller, view) { 9662 var stream = controller._controlledReadableStream; 9663 var elementSize = 1; 9664 9665 if (view.constructor !== DataView) { 9666 elementSize = view.constructor.BYTES_PER_ELEMENT; 9667 } 9668 9669 var ctor = view.constructor; 9670 var pullIntoDescriptor = { 9671 buffer: view.buffer, 9672 byteOffset: view.byteOffset, 9673 byteLength: view.byteLength, 9674 bytesFilled: 0, 9675 elementSize: elementSize, 9676 ctor: ctor, 9677 readerType: 'byob' 9678 }; 9679 9680 if (controller._pendingPullIntos.length > 0) { 9681 pullIntoDescriptor.buffer = TransferArrayBuffer(pullIntoDescriptor.buffer); 9682 9683 controller._pendingPullIntos.push(pullIntoDescriptor); 9684 9685 return ReadableStreamAddReadIntoRequest(stream); 9686 } 9687 9688 if (stream._state === 'closed') { 9689 var emptyView = new view.constructor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0); 9690 return Promise.resolve(CreateIterResultObject(emptyView, true)); 9691 } 9692 9693 if (controller._queueTotalSize > 0) { 9694 if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) === true) { 9695 var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor); 9696 ReadableByteStreamControllerHandleQueueDrain(controller); 9697 return Promise.resolve(CreateIterResultObject(filledView, false)); 9698 } 9699 9700 if (controller._closeRequested === true) { 9701 var e = new TypeError('Insufficient bytes to fill elements in the given buffer'); 9702 ReadableByteStreamControllerError(controller, e); 9703 return Promise.reject(e); 9704 } 9705 } 9706 9707 pullIntoDescriptor.buffer = TransferArrayBuffer(pullIntoDescriptor.buffer); 9708 9709 controller._pendingPullIntos.push(pullIntoDescriptor); 9710 9711 var promise = ReadableStreamAddReadIntoRequest(stream); 9712 ReadableByteStreamControllerCallPullIfNeeded(controller); 9713 return promise; 9714 } 9715 9716 function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) { 9717 firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer); 9718 assert(firstDescriptor.bytesFilled === 0, 'bytesFilled must be 0'); 9719 var stream = controller._controlledReadableStream; 9720
9721 if (ReadableStreamHasBYOBReader(stream) === true) { 9722 while (ReadableStreamGetNumReadIntoRequests(stream) > 0) { 9723 var pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller); 9724 ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor); 9725 } 9726 } 9727 } 9728 9729 function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) { 9730 if (pullIntoDescriptor.bytesFilled + bytesWritten > pullIntoDescriptor.byteLength) { 9731 throw new RangeError('bytesWritten out of range'); 9732 } 9733 9734 ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor); 9735 9736 if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize) { 9737 return; 9738 } 9739 9740 ReadableByteStreamControllerShiftPendingPullInto(controller); 9741 var remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize; 9742 9743 if (remainderSize > 0) { 9744 var end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled; 9745 var remainder = pullIntoDescriptor.buffer.slice(end - remainderSize, end); 9746 ReadableByteStreamControllerEnqueueChunkToQueue(controller, remainder, 0, remainder.byteLength); 9747 } 9748 9749 pullIntoDescriptor.buffer = TransferArrayBuffer(pullIntoDescriptor.buffer); 9750 pullIntoDescriptor.bytesFilled -= remainderSize; 9751 ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableStream, pullIntoDescriptor); 9752 ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); 9753 } 9754 9755 function ReadableByteStreamControllerRespondInternal(controller, bytesWritten) { 9756 var firstDescriptor = controller._pendingPullIntos[0]; 9757 var stream = controller._controlledReadableStream; 9758 9759 if (stream._state === 'closed') { 9760 if (bytesWritten !== 0) { 9761 throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream'); 9762 } 9763 9764 ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor); 9765 } else { 9766 assert(stream._state === 'readable'); 9767 ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor); 9768 } 9769 } 9770 9771 function ReadableByteStreamControllerShiftPendingPullInto(controller) { 9772 var descriptor = controller._pendingPullIntos.shift(); 9773 9774 ReadableByteStreamControllerInvalidateBYOBRequest(controller); 9775 return descriptor; 9776 } 9777 9778 function ReadableByteStreamControllerShouldCallPull(controller) { 9779 var stream = controller._controlledReadableStream; 9780 9781 if (stream._state !== 'readable') { 9782 return false; 9783 } 9784 9785 if (controller._closeRequested === true) { 9786 return false; 9787 } 9788 9789 if (controller._started === false) { 9790 return false; 9791 } 9792 9793 if (ReadableStreamHasDefaultReader(stream) === true && ReadableStreamGetNumReadRequests(stream) > 0) { 9794 return true; 9795 } 9796 9797 if (ReadableStreamHasBYOBReader(stream) === true && ReadableStreamGetNumReadIntoRequests(stream) > 0) { 9798 return true; 9799 } 9800 9801 if (ReadableByteStreamControllerGetDesiredSize(controller) > 0) { 9802 return true; 9803 } 9804 9805 return false; 9806 } 9807 9808 function ReadableByteStreamControllerClose(controller) { 9809 var stream = controller._controlledReadableStream; 9810 assert(controller._closeRequested === false); 9811 assert(stream._state === 'readable'); 9812 9813 if (controller._queueTotalSize > 0) { 9814 controller._closeRequested = true; 9815 return; 9816 } 9817 9818 if (controller._pendingPullIntos.length > 0) { 9819 var firstPendingPullInto = controller._pendingPullIntos[0]; 9820 9821 if (firstPendingPullInto.bytesFilled > 0) { 9822 var e = new TypeError('Insufficient bytes to fill elements in the given buffer'); 9823 ReadableByteStreamControllerError(controller, e); 9824 throw e; 9825 } 9826 } 9827 9828 ReadableStreamClose(stream); 9829 } 9830 9831 function ReadableByteStreamControllerEnqueue(controller, chunk) { 9832 var stream = controller._controlledReadableStream; 9833 assert(controller._closeRequested === false); 9834 assert(stream._state === 'readable'); 9835 var buffer = chunk.buffer; 9836 var byteOffset = chunk.byteOffset; 9837 var byteLength = chunk.byteLength; 9838 var transferredBuffer = TransferArrayBuffer(buffer); 9839
9840 if (ReadableStreamHasDefaultReader(stream) === true) { 9841 if (ReadableStreamGetNumReadRequests(stream) === 0) { 9842 ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); 9843 } else { 9844 assert(controller._queue.length === 0); 9845 var transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength); 9846 ReadableStreamFulfillReadRequest(stream, transferredView, false); 9847 } 9848 } else if (ReadableStreamHasBYOBReader(stream) === true) { 9849 ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); 9850 ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller); 9851 } else { 9852 assert(IsReadableStreamLocked(stream) === false, 'stream must not be locked'); 9853 ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength); 9854 } 9855 } 9856 9857 function ReadableByteStreamControllerError(controller, e) { 9858 var stream = controller._controlledReadableStream; 9859 assert(stream._state === 'readable'); 9860 ReadableByteStreamControllerClearPendingPullIntos(controller); 9861 ResetQueue(controller); 9862 ReadableStreamError(stream, e); 9863 } 9864 9865 function ReadableByteStreamControllerGetDesiredSize(controller) { 9866 var stream = controller._controlledReadableStream; 9867 var state = stream._state; 9868 9869 if (state === 'errored') { 9870 return null; 9871 } 9872 9873 if (state === 'closed') { 9874 return 0; 9875 } 9876 9877 return controller._strategyHWM - controller._queueTotalSize; 9878 } 9879 9880 function ReadableByteStreamControllerRespond(controller, bytesWritten) { 9881 bytesWritten = Number(bytesWritten); 9882 9883 if (IsFiniteNonNegativeNumber(bytesWritten) === false) { 9884 throw new RangeError('bytesWritten must be a finite'); 9885 } 9886 9887 assert(controller._pendingPullIntos.length > 0); 9888 ReadableByteStreamControllerRespondInternal(controller, bytesWritten); 9889 } 9890 9891 function ReadableByteStreamControllerRespondWithNewView(controller, view) { 9892 assert(controller._pendingPullIntos.length > 0); 9893 var firstDescriptor = controller._pendingPullIntos[0]; 9894 9895 if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) { 9896 throw new RangeError('The region specified by view does not match byobRequest'); 9897 } 9898 9899 if (firstDescriptor.byteLength !== view.byteLength) { 9900 throw new RangeError('The buffer of view has different capacity than byobRequest'); 9901 } 9902 9903 firstDescriptor.buffer = view.buffer; 9904 ReadableByteStreamControllerRespondInternal(controller, view.byteLength); 9905 } 9906 9907 function streamBrandCheckException(name) { 9908 return new TypeError('ReadableStream.prototype.' + name + ' can only be used on a ReadableStream'); 9909 } 9910 9911 function readerLockException(name) { 9912 return new TypeError('Cannot ' + name + ' a stream using a released reader'); 9913 } 9914 9915 function defaultReaderBrandCheckException(name) { 9916 return new TypeError('ReadableStreamDefaultReader.prototype.' + name + ' can only be used on a ReadableStreamDefaultReader'); 9917 } 9918 9919 function defaultReaderClosedPromiseInitialize(reader) { 9920 reader._closedPromise = new Promise(function (resolve, reject) { 9921 reader._closedPromise_resolve = resolve; 9922 reader._closedPromise_reject = reject; 9923 }); 9924 } 9925 9926 function defaultReaderClosedPromiseInitializeAsRejected(reader, reason) { 9927 reader._closedPromise = Promise.reject(reason); 9928 reader._closedPromise_resolve = undefined; 9929 reader._closedPromise_reject = undefined; 9930 } 9931 9932 function defaultReaderClosedPromiseInitializeAsResolved(reader) { 9933 reader._closedPromise = Promise.resolve(undefined); 9934 reader._closedPromise_resolve = undefined; 9935 reader._closedPromise_reject = undefined; 9936 } 9937 9938 function defaultReaderClosedPromiseReject(reader, reason) { 9939 assert(reader._closedPromise_resolve !== undefined); 9940 assert(reader._closedPromise_reject !== undefined); 9941 9942 reader._closedPromise_reject(reason); 9943 9944 reader._closedPromise_resolve = undefined; 9945 reader._closedPromise_reject = undefined; 9946 } 9947 9948 function defaultReaderClosedPromiseResetToRejected(reader, reason) { 9949 assert(reader._closedPromise_resolve === undefined); 9950 assert(reader._closedPromise_reject === undefined); 9951 reader._closedPromise = Promise.reject(reason); 9952 } 9953 9954 function defaultReaderClosedPromiseResolve(reader) { 9955 assert(reader._closedPromise_resolve !== undefined); 9956 assert(reader._closedPromise_reject !== undefined); 9957 9958 reader._closedPromise_resolve(undefined); 9959 9960 reader._closedPromise_resolve = undefined; 9961 reader._closedPromise_reject = undefined; 9962 } 9963 9964 function byobReaderBrandCheckException(name) { 9965 return new TypeError('ReadableStreamBYOBReader.prototype.' + name + ' can only be used on a ReadableStreamBYOBReader'); 9966 } 9967 9968 function defaultControllerBrandCheckException(name) { 9969 return new TypeError('ReadableStreamDefaultController.prototype.' + name + ' can only be used on a ReadableStreamDefaultController'); 9970 } 9971 9972 function byobRequestBrandCheckException(name) { 9973 return new TypeError('ReadableStreamBYOBRequest.prototype.' + name + ' can only be used on a ReadableStreamBYOBRequest'); 9974 } 9975 9976 function byteStreamControllerBrandCheckException(name) { 9977 return new TypeError('ReadableByteStreamController.prototype.' + name + ' can only be used on a ReadableByteStreamController'); 9978 } 9979 9980 function ifIsObjectAndHasAPromiseIsHandledInternalSlotSetPromiseIsHandledToTrue(promise) { 9981 try { 9982 Promise.prototype.then.call(promise, undefined, function () {}); 9983 } catch (e) {} 9984 } 9985}, function (module, exports, __w_pdfjs_require__) { 9986 "use strict"; 9987 9988 var transformStream = __w_pdfjs_require__(6); 9989 9990 var readableStream = __w_pdfjs_require__(4); 9991 9992 var writableStream = __w_pdfjs_require__(2); 9993 9994 exports.TransformStream = transformStream.TransformStream; 9995 exports.ReadableStream = readableStream.ReadableStream; 9996 exports.IsReadableStreamDisturbed = readableStream.IsReadableStreamDisturbed; 9997 exports.ReadableStreamDefaultControllerClose = readableStream.ReadableStreamDefaultControllerClose; 9998 exports.ReadableStreamDefaultControllerEnqueue = readableStream.ReadableStreamDefaultControllerEnqueue; 9999 exports.ReadableStreamDefaultControllerError = readableStream.ReadableStreamDefaultControllerError; 10000 exports.ReadableStreamDefaultControllerGetDesiredSize = readableStream.ReadableStreamDefaultControllerGetDesiredSize; 10001 exports.AcquireWritableStreamDefaultWriter = writableStream.AcquireWritableStreamDefaultWriter; 10002 exports.IsWritableStream = writableStream.IsWritableStream; 10003 exports.IsWritableStreamLocked = writableStream.IsWritableStreamLocked; 10004 exports.WritableStream = writableStream.WritableStream; 10005 exports.WritableStreamAbort = writableStream.WritableStreamAbort; 10006 exports.WritableStreamDefaultControllerError = writableStream.WritableStreamDefaultControllerError; 10007 exports.WritableStreamDefaultWriterCloseWithErrorPropagation = writableStream.WritableStreamDefaultWriterCloseWithErrorPropagation; 10008 exports.WritableStreamDefaultWriterRelease = writableStream.WritableStreamDefaultWriterRelease; 10009 exports.WritableStreamDefaultWriterWrite = writableStream.WritableStreamDefaultWriterWrite; 10010}, function (module, exports, __w_pdfjs_require__) { 10011 "use strict"; 10012 10013 var _createClass = function () { 10014 function defineProperties(target, props) { 10015 for (var i = 0; i < props.length; i++) { 10016 var descriptor = props[i]; 10017 descriptor.enumerable = descriptor.enumerable || false; 10018 descriptor.configurable = true; 10019 if ("value" in descriptor) descriptor.writable = true; 10020 Object.defineProperty(target, descriptor.key, descriptor); 10021 } 10022 } 10023 10024 return function (Constructor, protoProps, staticProps) { 10025 if (protoProps) defineProperties(Constructor.prototype, protoProps); 10026 if (staticProps) defineProperties(Constructor, staticProps); 10027 return Constructor; 10028 }; 10029 }(); 10030 10031 function _classCallCheck(instance, Constructor) { 10032 if (!(instance instanceof Constructor)) { 10033 throw new TypeError("Cannot call a class as a function"); 10034 } 10035 } 10036 10037 var _require = __w_pdfjs_require__(1), 10038 assert = _require.assert; 10039 10040 var _require2 = __w_pdfjs_require__(0), 10041 InvokeOrNoop = _require2.InvokeOrNoop, 10042 PromiseInvokeOrPerformFallback = _require2.PromiseInvokeOrPerformFallback, 10043 PromiseInvokeOrNoop = _require2.PromiseInvokeOrNoop, 10044 typeIsObject = _require2.typeIsObject; 10045 10046 var _require3 = __w_pdfjs_require__(4), 10047 ReadableStream = _require3.ReadableStream, 10048 ReadableStreamDefaultControllerClose = _require3.ReadableStreamDefaultControllerClose, 10049 ReadableStreamDefaultControllerEnqueue = _require3.ReadableStreamDefaultControllerEnqueue, 10050 ReadableStreamDefaultControllerError = _require3.ReadableStreamDefaultControllerError, 10051 ReadableStreamDefaultControllerGetDesiredSize = _require3.ReadableStreamDefaultControllerGetDesiredSize; 10052 10053 var _require4 = __w_pdfjs_require__(2), 10054 WritableStream = _require4.WritableStream, 10055 WritableStreamDefaultControllerError = _require4.WritableStreamDefaultControllerError; 10056 10057 function TransformStreamCloseReadable(transformStream) { 10058 if (transformStream._errored === true) { 10059 throw new TypeError('TransformStream is already errored'); 10060 } 10061 10062 if (transformStream._readableClosed === true) { 10063 throw new TypeError('Readable side is already closed'); 10064 } 10065 10066 TransformStreamCloseReadableInternal(transformStream); 10067 } 10068 10069 function TransformStreamEnqueueToReadable(transformStream, chunk) { 10070 if (transformStream._errored === true) { 10071 throw new TypeError('TransformStream is already errored'); 10072 } 10073 10074 if (transformStream._readableClosed === true) { 10075 throw new TypeError('Readable side is already closed'); 10076 } 10077 10078 var controller = transformStream._readableController; 10079 10080 try { 10081 ReadableStreamDefaultControllerEnqueue(controller, chunk); 10082 } catch (e) { 10083 transformStream._readableClosed = true; 10084 TransformStreamErrorIfNeeded(transformStream, e); 10085 throw transformStream._storedError; 10086 } 10087 10088 var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller); 10089 var maybeBackpressure = desiredSize <= 0;
10090 10091 if (maybeBackpressure === true && transformStream._backpressure === false) { 10092 TransformStreamSetBackpressure(transformStream, true); 10093 } 10094 } 10095 10096 function TransformStreamError(transformStream, e) { 10097 if (transformStream._errored === true) { 10098 throw new TypeError('TransformStream is already errored'); 10099 } 10100 10101 TransformStreamErrorInternal(transformStream, e); 10102 } 10103 10104 function TransformStreamCloseReadableInternal(transformStream) { 10105 assert(transformStream._errored === false); 10106 assert(transformStream._readableClosed === false); 10107 10108 try { 10109 ReadableStreamDefaultControllerClose(transformStream._readableController); 10110 } catch (e) { 10111 assert(false); 10112 } 10113 10114 transformStream._readableClosed = true; 10115 } 10116 10117 function TransformStreamErrorIfNeeded(transformStream, e) { 10118 if (transformStream._errored === false) { 10119 TransformStreamErrorInternal(transformStream, e); 10120 } 10121 } 10122 10123 function TransformStreamErrorInternal(transformStream, e) { 10124 assert(transformStream._errored === false); 10125 transformStream._errored = true; 10126 transformStream._storedError = e; 10127 10128 if (transformStream._writableDone === false) { 10129 WritableStreamDefaultControllerError(transformStream._writableController, e); 10130 } 10131 10132 if (transformStream._readableClosed === false) { 10133 ReadableStreamDefaultControllerError(transformStream._readableController, e); 10134 } 10135 } 10136 10137 function TransformStreamReadableReadyPromise(transformStream) { 10138 assert(transformStream._backpressureChangePromise !== undefined, '_backpressureChangePromise should have been initialized'); 10139 10140 if (transformStream._backpressure === false) { 10141 return Promise.resolve(); 10142 } 10143 10144 assert(transformStream._backpressure === true, '_backpressure should have been initialized'); 10145 return transformStream._backpressureChangePromise; 10146 } 10147 10148 function TransformStreamSetBackpressure(transformStream, backpressure) { 10149 assert(transformStream._backpressure !== backpressure, 'TransformStreamSetBackpressure() should be called only when backpressure is changed'); 10150 10151 if (transformStream._backpressureChangePromise !== undefined) { 10152 transformStream._backpressureChangePromise_resolve(backpressure); 10153 } 10154 10155 transformStream._backpressureChangePromise = new Promise(function (resolve) { 10156 transformStream._backpressureChangePromise_resolve = resolve; 10157 }); 10158 10159 transformStream._backpressureChangePromise.then(function (resolution) { 10160 assert(resolution !== backpressure, '_backpressureChangePromise should be fulfilled only when backpressure is changed'); 10161 }); 10162 10163 transformStream._backpressure = backpressure; 10164 } 10165 10166 function TransformStreamDefaultTransform(chunk, transformStreamController) { 10167 var transformStream = transformStreamController._controlledTransformStream; 10168 TransformStreamEnqueueToReadable(transformStream, chunk); 10169 return Promise.resolve(); 10170 } 10171 10172 function TransformStreamTransform(transformStream, chunk) { 10173 assert(transformStream._errored === false); 10174 assert(transformStream._transforming === false); 10175 assert(transformStream._backpressure === false); 10176 transformStream._transforming = true; 10177 var transformer = transformStream._transformer; 10178 var controller = transformStream._transformStreamController; 10179 var transformPromise = PromiseInvokeOrPerformFallback(transformer, 'transform', [chunk, controller], TransformStreamDefaultTransform, [chunk, controller]); 10180 return transformPromise.then(function () { 10181 transformStream._transforming = false; 10182 return TransformStreamReadableReadyPromise(transformStream); 10183 }, function (e) { 10184 TransformStreamErrorIfNeeded(transformStream, e); 10185 return Promise.reject(e); 10186 }); 10187 } 10188 10189 function IsTransformStreamDefaultController(x) { 10190 if (!typeIsObject(x)) { 10191 return false; 10192 } 10193 10194 if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) { 10195 return false; 10196 } 10197 10198 return true; 10199 } 10200 10201 function IsTransformStream(x) { 10202 if (!typeIsObject(x)) { 10203 return false; 10204 } 10205 10206 if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) { 10207 return false; 10208 } 10209 10210 return true; 10211 } 10212 10213 var TransformStreamSink = function () { 10214 function TransformStreamSink(transformStream, startPromise) { 10215 _classCallCheck(this, TransformStreamSink); 10216 10217 this._transformStream = transformStream; 10218 this._startPromise = startPromise; 10219 } 10220 10221 _createClass(TransformStreamSink, [{ 10222 key: 'start', 10223 value: function start(c) { 10224 var transformStream = this._transformStream; 10225 transformStream._writableController = c; 10226 return this._startPromise.then(function () { 10227 return TransformStreamReadableReadyPromise(transformStream); 10228 }); 10229 } 10230 }, { 10231 key: 'write', 10232 value: function write(chunk) { 10233 var transformStream = this._transformStream; 10234 return TransformStreamTransform(transformStream, chunk); 10235 } 10236 }, { 10237 key: 'abort', 10238 value: function abort() { 10239 var transformStream = this._transformStream; 10240 transformStream._writableDone = true; 10241 TransformStreamErrorInternal(transformStream, new TypeError('Writable side aborted')); 10242 } 10243 }, { 10244 key: 'close', 10245 value: function close() { 10246 var transformStream = this._transformStream; 10247 assert(transformStream._transforming === false); 10248 transformStream._writableDone = true; 10249 var flushPromise = PromiseInvokeOrNoop(transformStream._transformer, 'flush', [transformStream._transformStreamController]); 10250 return flushPromise.then(function () { 10251 if (transformStream._errored === true) { 10252 return Promise.reject(transformStream._storedError); 10253 } 10254 10255 if (transformStream._readableClosed === false) { 10256 TransformStreamCloseReadableInternal(transformStream); 10257 } 10258 10259 return Promise.resolve(); 10260 }).catch(function (r) { 10261 TransformStreamErrorIfNeeded(transformStream, r); 10262 return Promise.reject(transformStream._storedError); 10263 }); 10264 } 10265 }]); 10266 10267 return TransformStreamSink; 10268 }(); 10269 10270 var TransformStreamSource = function () { 10271 function TransformStreamSource(transformStream, startPromise) { 10272 _classCallCheck(this, TransformStreamSource); 10273 10274 this._transformStream = transformStream; 10275 this._startPromise = startPromise; 10276 } 10277 10278 _createClass(TransformStreamSource, [{ 10279 key: 'start', 10280 value: function start(c) { 10281 var transformStream = this._transformStream; 10282 transformStream._readableController = c; 10283 return this._startPromise.then(function () { 10284 assert(transformStream._backpressureChangePromise !== undefined, '_backpressureChangePromise should have been initialized'); 10285 10286 if (transformStream._backpressure === true) { 10287 return Promise.resolve(); 10288 } 10289 10290 assert(transformStream._backpressure === false, '_backpressure should have been initialized'); 10291 return transformStream._backpressureChangePromise; 10292 }); 10293 } 10294 }, { 10295 key: 'pull', 10296 value: function pull() { 10297 var transformStream = this._transformStream; 10298 assert(transformStream._backpressure === true, 'pull() should be never called while _backpressure is false'); 10299 assert(transformStream._backpressureChangePromise !== undefined, '_backpressureChangePromise should have been initialized'); 10300 TransformStreamSetBackpressure(transformStream, false); 10301 return transformStream._backpressureChangePromise; 10302 } 10303 }, { 10304 key: 'cancel', 10305 value: function cancel() { 10306 var transformStream = this._transformStream; 10307 transformStream._readableClosed = true; 10308 TransformStreamErrorInternal(transformStream, new TypeError('Readable side canceled')); 10309 } 10310 }]); 10311 10312 return TransformStreamSource; 10313 }(); 10314 10315 var TransformStreamDefaultController = function () { 10316 function TransformStreamDefaultController(transformStream) { 10317 _classCallCheck(this, TransformStreamDefaultController); 10318 10319 if (IsTransformStream(transformStream) === false) { 10320 throw new TypeError('TransformStreamDefaultController can only be ' + 'constructed with a TransformStream instance'); 10321 } 10322 10323 if (transformStream._transformStreamController !== undefined) { 10324 throw new TypeError('TransformStreamDefaultController instances can ' + 'only be created by the TransformStream constructor'); 10325 } 10326 10327 this._controlledTransformStream = transformStream; 10328 } 10329 10330 _createClass(TransformStreamDefaultController, [{ 10331 key: 'enqueue',
10332 value: function enqueue(chunk) { 10333 if (IsTransformStreamDefaultController(this) === false) { 10334 throw defaultControllerBrandCheckException('enqueue'); 10335 } 10336 10337 TransformStreamEnqueueToReadable(this._controlledTransformStream, chunk); 10338 } 10339 }, { 10340 key: 'close', 10341 value: function close() { 10342 if (IsTransformStreamDefaultController(this) === false) { 10343 throw defaultControllerBrandCheckException('close'); 10344 } 10345 10346 TransformStreamCloseReadable(this._controlledTransformStream); 10347 } 10348 }, { 10349 key: 'error', 10350 value: function error(reason) { 10351 if (IsTransformStreamDefaultController(this) === false) { 10352 throw defaultControllerBrandCheckException('error'); 10353 } 10354 10355 TransformStreamError(this._controlledTransformStream, reason); 10356 } 10357 }, { 10358 key: 'desiredSize', 10359 get: function get() { 10360 if (IsTransformStreamDefaultController(this) === false) { 10361 throw defaultControllerBrandCheckException('desiredSize'); 10362 } 10363 10364 var transformStream = this._controlledTransformStream; 10365 var readableController = transformStream._readableController; 10366 return ReadableStreamDefaultControllerGetDesiredSize(readableController); 10367 } 10368 }]); 10369 10370 return TransformStreamDefaultController; 10371 }(); 10372 10373 var TransformStream = function () { 10374 function TransformStream() { 10375 var transformer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 10376 10377 _classCallCheck(this, TransformStream); 10378 10379 this._transformer = transformer; 10380 var readableStrategy = transformer.readableStrategy, 10381 writableStrategy = transformer.writableStrategy; 10382 this._transforming = false; 10383 this._errored = false; 10384 this._storedError = undefined; 10385 this._writableController = undefined; 10386 this._readableController = undefined; 10387 this._transformStreamController = undefined; 10388 this._writableDone = false; 10389 this._readableClosed = false; 10390 this._backpressure = undefined; 10391 this._backpressureChangePromise = undefined; 10392 this._backpressureChangePromise_resolve = undefined; 10393 this._transformStreamController = new TransformStreamDefaultController(this); 10394 var startPromise_resolve = void 0; 10395 var startPromise = new Promise(function (resolve) { 10396 startPromise_resolve = resolve; 10397 }); 10398 var source = new TransformStreamSource(this, startPromise); 10399 this._readable = new ReadableStream(source, readableStrategy); 10400 var sink = new TransformStreamSink(this, startPromise); 10401 this._writable = new WritableStream(sink, writableStrategy); 10402 assert(this._writableController !== undefined); 10403 assert(this._readableController !== undefined); 10404 var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(this._readableController); 10405 TransformStreamSetBackpressure(this, desiredSize <= 0); 10406 var transformStream = this; 10407 var startResult = InvokeOrNoop(transformer, 'start', [transformStream._transformStreamController]); 10408 startPromise_resolve(startResult); 10409 startPromise.catch(function (e) { 10410 if (transformStream._errored === false) { 10411 transformStream._errored = true; 10412 transformStream._storedError = e; 10413 } 10414 }); 10415 } 10416 10417 _createClass(TransformStream, [{ 10418 key: 'readable', 10419 get: function get() { 10420 if (IsTransformStream(this) === false) { 10421 throw streamBrandCheckException('readable'); 10422 } 10423 10424 return this._readable; 10425 } 10426 }, { 10427 key: 'writable', 10428 get: function get() { 10429 if (IsTransformStream(this) === false) { 10430 throw streamBrandCheckException('writable'); 10431 } 10432 10433 return this._writable; 10434 } 10435 }]); 10436 10437 return TransformStream; 10438 }(); 10439 10440 module.exports = { 10441 TransformStream: TransformStream 10442 }; 10443 10444 function defaultControllerBrandCheckException(name) { 10445 return new TypeError('TransformStreamDefaultController.prototype.' + name + ' can only be used on a TransformStreamDefaultController'); 10446 } 10447 10448 function streamBrandCheckException(name) { 10449 return new TypeError('TransformStream.prototype.' + name + ' can only be used on a TransformStream'); 10450 } 10451}, function (module, exports, __w_pdfjs_require__) { 10452 module.exports = __w_pdfjs_require__(5); 10453}])); 10454 10455/***/ }), 10456/* 149 */ 10457/***/ (function(module, exports, __w_pdfjs_require__) { 10458 10459"use strict"; 10460 10461 10462function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 10463 10464{ 10465 var isURLSupported = false; 10466 10467 try { 10468 if (typeof URL === 'function' && _typeof(URL.prototype) === 'object' && 'origin' in URL.prototype) { 10469 var u = new URL('b', 'http://a'); 10470 u.pathname = 'c%20d'; 10471 isURLSupported = u.href === 'http://a/c%20d'; 10472 } 10473 } catch (ex) {} 10474 10475 if (isURLSupported) { 10476 exports.URL = URL; 10477 } else { 10478 var PolyfillURL = __w_pdfjs_require__(150).URL; 10479 10480 var OriginalURL = __w_pdfjs_require__(8).URL; 10481 10482 if (OriginalURL) { 10483 PolyfillURL.createObjectURL = function (blob) { 10484 return OriginalURL.createObjectURL.apply(OriginalURL, arguments); 10485 }; 10486 10487 PolyfillURL.revokeObjectURL = function (url) { 10488 OriginalURL.revokeObjectURL(url); 10489 }; 10490 } 10491 10492 exports.URL = PolyfillURL; 10493 } 10494} 10495 10496/***/ }), 10497/* 150 */ 10498/***/ (function(module, exports, __w_pdfjs_require__) { 10499 10500"use strict"; 10501 10502 10503(function URLConstructorClosure() { 10504 'use strict'; 10505 10506 var relative = Object.create(null); 10507 relative['ftp'] = 21; 10508 relative['file'] = 0; 10509 relative['gopher'] = 70; 10510 relative['http'] = 80; 10511 relative['https'] = 443; 10512 relative['ws'] = 80; 10513 relative['wss'] = 443; 10514 var relativePathDotMapping = Object.create(null); 10515 relativePathDotMapping['%2e'] = '.'; 10516 relativePathDotMapping['.%2e'] = '..'; 10517 relativePathDotMapping['%2e.'] = '..'; 10518 relativePathDotMapping['%2e%2e'] = '..'; 10519 10520 function isRelativeScheme(scheme) { 10521 return relative[scheme] !== undefined; 10522 } 10523
10524 function invalid() { 10525 clear.call(this); 10526 this._isInvalid = true; 10527 } 10528 10529 function IDNAToASCII(h) { 10530 if (h === '') { 10531 invalid.call(this); 10532 } 10533 10534 return h.toLowerCase(); 10535 } 10536 10537 function percentEscape(c) { 10538 var unicode = c.charCodeAt(0); 10539 10540 if (unicode > 0x20 && unicode < 0x7F && [0x22, 0x23, 0x3C, 0x3E, 0x3F, 0x60].indexOf(unicode) === -1) { 10541 return c; 10542 } 10543 10544 return encodeURIComponent(c); 10545 } 10546 10547 function percentEscapeQuery(c) { 10548 var unicode = c.charCodeAt(0); 10549 10550 if (unicode > 0x20 && unicode < 0x7F && [0x22, 0x23, 0x3C, 0x3E, 0x60].indexOf(unicode) === -1) { 10551 return c; 10552 } 10553 10554 return encodeURIComponent(c); 10555 } 10556 10557 var EOF, 10558 ALPHA = /[a-zA-Z]/, 10559 ALPHANUMERIC = /[a-zA-Z0-9\+\-\.]/; 10560 10561 function parse(input, stateOverride, base) { 10562 function err(message) { 10563 errors.push(message); 10564 } 10565 10566 var state = stateOverride || 'scheme start', 10567 cursor = 0, 10568 buffer = '', 10569 seenAt = false, 10570 seenBracket = false, 10571 errors = []; 10572 10573 loop: while ((input[cursor - 1] !== EOF || cursor === 0) && !this._isInvalid) { 10574 var c = input[cursor]; 10575 10576 switch (state) { 10577 case 'scheme start': 10578 if (c && ALPHA.test(c)) { 10579 buffer += c.toLowerCase(); 10580 state = 'scheme'; 10581 } else if (!stateOverride) { 10582 buffer = ''; 10583 state = 'no scheme'; 10584 continue; 10585 } else { 10586 err('Invalid scheme.'); 10587 break loop; 10588 } 10589 10590 break; 10591 10592 case 'scheme': 10593 if (c && ALPHANUMERIC.test(c)) { 10594 buffer += c.toLowerCase(); 10595 } else if (c === ':') { 10596 this._scheme = buffer; 10597 buffer = ''; 10598 10599 if (stateOverride) { 10600 break loop; 10601 } 10602 10603 if (isRelativeScheme(this._scheme)) { 10604 this._isRelative = true; 10605 } 10606 10607 if (this._scheme === 'file') { 10608 state = 'relative'; 10609 } else if (this._isRelative && base && base._scheme === this._scheme) { 10610 state = 'relative or authority'; 10611 } else if (this._isRelative) { 10612 state = 'authority first slash'; 10613 } else { 10614 state = 'scheme data'; 10615 } 10616 } else if (!stateOverride) { 10617 buffer = ''; 10618 cursor = 0; 10619 state = 'no scheme'; 10620 continue; 10621 } else if (c === EOF) { 10622 break loop; 10623 } else { 10624 err('Code point not allowed in scheme: ' + c); 10625 break loop; 10626 } 10627 10628 break; 10629 10630 case 'scheme data': 10631 if (c === '?') { 10632 this._query = '?'; 10633 state = 'query'; 10634 } else if (c === '#') { 10635 this._fragment = '#'; 10636 state = 'fragment'; 10637 } else { 10638 if (c !== EOF && c !== '\t' && c !== '\n' && c !== '\r') { 10639 this._schemeData += percentEscape(c); 10640 } 10641 } 10642 10643 break; 10644 10645 case 'no scheme': 10646 if (!base || !isRelativeScheme(base._scheme)) { 10647 err('Missing scheme.'); 10648 invalid.call(this); 10649 } else { 10650 state = 'relative'; 10651 continue; 10652 } 10653 10654 break; 10655 10656 case 'relative or authority': 10657 if (c === '/' && input[cursor + 1] === '/') { 10658 state = 'authority ignore slashes'; 10659 } else { 10660 err('Expected /, got: ' + c); 10661 state = 'relative'; 10662 continue; 10663 } 10664 10665 break; 10666 10667 case 'relative': 10668 this._isRelative = true; 10669 10670 if (this._scheme !== 'file') { 10671 this._scheme = base._scheme; 10672 } 10673 10674 if (c === EOF) { 10675 this._host = base._host; 10676 this._port = base._port; 10677 this._path = base._path.slice(); 10678 this._query = base._query; 10679 this._username = base._username; 10680 this._password = base._password; 10681 break loop; 10682 } else if (c === '/' || c === '\\') { 10683 if (c === '\\') {
10684 err('\\ is an invalid code point.'); 10685 } 10686 10687 state = 'relative slash'; 10688 } else if (c === '?') { 10689 this._host = base._host; 10690 this._port = base._port; 10691 this._path = base._path.slice(); 10692 this._query = '?'; 10693 this._username = base._username; 10694 this._password = base._password; 10695 state = 'query'; 10696 } else if (c === '#') { 10697 this._host = base._host; 10698 this._port = base._port; 10699 this._path = base._path.slice(); 10700 this._query = base._query; 10701 this._fragment = '#'; 10702 this._username = base._username; 10703 this._password = base._password; 10704 state = 'fragment'; 10705 } else { 10706 var nextC = input[cursor + 1]; 10707 var nextNextC = input[cursor + 2]; 10708 10709 if (this._scheme !== 'file' || !ALPHA.test(c) || nextC !== ':' && nextC !== '|' || nextNextC !== EOF && nextNextC !== '/' && nextNextC !== '\\' && nextNextC !== '?' && nextNextC !== '#') { 10710 this._host = base._host; 10711 this._port = base._port; 10712 this._username = base._username; 10713 this._password = base._password; 10714 this._path = base._path.slice(); 10715 10716 this._path.pop(); 10717 } 10718 10719 state = 'relative path'; 10720 continue; 10721 } 10722 10723 break; 10724 10725 case 'relative slash': 10726 if (c === '/' || c === '\\') { 10727 if (c === '\\') { 10728 err('\\ is an invalid code point.'); 10729 } 10730 10731 if (this._scheme === 'file') { 10732 state = 'file host'; 10733 } else { 10734 state = 'authority ignore slashes'; 10735 } 10736 } else { 10737 if (this._scheme !== 'file') { 10738 this._host = base._host; 10739 this._port = base._port; 10740 this._username = base._username; 10741 this._password = base._password; 10742 } 10743 10744 state = 'relative path'; 10745 continue; 10746 } 10747 10748 break; 10749 10750 case 'authority first slash': 10751 if (c === '/') { 10752 state = 'authority second slash'; 10753 } else { 10754 err('Expected \'/\', got: ' + c); 10755 state = 'authority ignore slashes'; 10756 continue; 10757 } 10758 10759 break; 10760 10761 case 'authority second slash': 10762 state = 'authority ignore slashes'; 10763 10764 if (c !== '/') { 10765 err('Expected \'/\', got: ' + c); 10766 continue; 10767 } 10768 10769 break; 10770 10771 case 'authority ignore slashes': 10772 if (c !== '/' && c !== '\\') { 10773 state = 'authority'; 10774 continue; 10775 } else { 10776 err('Expected authority, got: ' + c); 10777 } 10778 10779 break; 10780 10781 case 'authority': 10782 if (c === '@') { 10783 if (seenAt) { 10784 err('@ already seen.'); 10785 buffer += '%40'; 10786 } 10787 10788 seenAt = true; 10789 10790 for (var i = 0; i < buffer.length; i++) { 10791 var cp = buffer[i]; 10792 10793 if (cp === '\t' || cp === '\n' || cp === '\r') { 10794 err('Invalid whitespace in authority.'); 10795 continue; 10796 } 10797 10798 if (cp === ':' && this._password === null) { 10799 this._password = ''; 10800 continue; 10801 } 10802 10803 var tempC = percentEscape(cp); 10804 10805 if (this._password !== null) { 10806 this._password += tempC; 10807 } else { 10808 this._username += tempC; 10809 } 10810 } 10811 10812 buffer = ''; 10813 } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') { 10814 cursor -= buffer.length; 10815 buffer = ''; 10816 state = 'host'; 10817 continue; 10818 } else { 10819 buffer += c; 10820 } 10821 10822 break; 10823 10824 case 'file host': 10825 if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') { 10826 if (buffer.length === 2 && ALPHA.test(buffer[0]) && (buffer[1] === ':' || buffer[1] === '|')) { 10827 state = 'relative path'; 10828 } else if (buffer.length === 0) { 10829 state = 'relative path start'; 10830 } else {
10831 this._host = IDNAToASCII.call(this, buffer); 10832 buffer = ''; 10833 state = 'relative path start'; 10834 } 10835 10836 continue; 10837 } else if (c === '\t' || c === '\n' || c === '\r') { 10838 err('Invalid whitespace in file host.'); 10839 } else { 10840 buffer += c; 10841 } 10842 10843 break; 10844 10845 case 'host': 10846 case 'hostname': 10847 if (c === ':' && !seenBracket) { 10848 this._host = IDNAToASCII.call(this, buffer); 10849 buffer = ''; 10850 state = 'port'; 10851 10852 if (stateOverride === 'hostname') { 10853 break loop; 10854 } 10855 } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#') { 10856 this._host = IDNAToASCII.call(this, buffer); 10857 buffer = ''; 10858 state = 'relative path start'; 10859 10860 if (stateOverride) { 10861 break loop; 10862 } 10863 10864 continue; 10865 } else if (c !== '\t' && c !== '\n' && c !== '\r') { 10866 if (c === '[') { 10867 seenBracket = true; 10868 } else if (c === ']') { 10869 seenBracket = false; 10870 } 10871 10872 buffer += c; 10873 } else { 10874 err('Invalid code point in host/hostname: ' + c); 10875 } 10876 10877 break; 10878 10879 case 'port': 10880 if (/[0-9]/.test(c)) { 10881 buffer += c; 10882 } else if (c === EOF || c === '/' || c === '\\' || c === '?' || c === '#' || stateOverride) { 10883 if (buffer !== '') { 10884 var temp = parseInt(buffer, 10); 10885 10886 if (temp !== relative[this._scheme]) { 10887 this._port = temp + ''; 10888 } 10889 10890 buffer = ''; 10891 } 10892 10893 if (stateOverride) { 10894 break loop; 10895 } 10896 10897 state = 'relative path start'; 10898 continue; 10899 } else if (c === '\t' || c === '\n' || c === '\r') { 10900 err('Invalid code point in port: ' + c); 10901 } else { 10902 invalid.call(this); 10903 } 10904 10905 break; 10906 10907 case 'relative path start': 10908 if (c === '\\') { 10909 err('\'\\\' not allowed in path.'); 10910 } 10911 10912 state = 'relative path'; 10913 10914 if (c !== '/' && c !== '\\') { 10915 continue; 10916 } 10917 10918 break; 10919 10920 case 'relative path': 10921 if (c === EOF || c === '/' || c === '\\' || !stateOverride && (c === '?' || c === '#')) { 10922 if (c === '\\') { 10923 err('\\ not allowed in relative path.'); 10924 } 10925 10926 var tmp; 10927 10928 if (tmp = relativePathDotMapping[buffer.toLowerCase()]) { 10929 buffer = tmp; 10930 } 10931 10932 if (buffer === '..') { 10933 this._path.pop(); 10934 10935 if (c !== '/' && c !== '\\') { 10936 this._path.push(''); 10937 } 10938 } else if (buffer === '.' && c !== '/' && c !== '\\') { 10939 this._path.push(''); 10940 } else if (buffer !== '.') { 10941 if (this._scheme === 'file' && this._path.length === 0 && buffer.length === 2 && ALPHA.test(buffer[0]) && buffer[1] === '|') { 10942 buffer = buffer[0] + ':'; 10943 } 10944 10945 this._path.push(buffer); 10946 } 10947 10948 buffer = ''; 10949 10950 if (c === '?') { 10951 this._query = '?'; 10952 state = 'query'; 10953 } else if (c === '#') { 10954 this._fragment = '#'; 10955 state = 'fragment'; 10956 } 10957 } else if (c !== '\t' && c !== '\n' && c !== '\r') { 10958 buffer += percentEscape(c); 10959 } 10960 10961 break; 10962 10963 case 'query': 10964 if (!stateOverride && c === '#') { 10965 this._fragment = '#'; 10966 state = 'fragment'; 10967 } else if (c !== EOF && c !== '\t' && c !== '\n' && c !== '\r') { 10968 this._query += percentEscapeQuery(c); 10969 } 10970 10971 break; 10972 10973 case 'fragment': 10974 if (c !== EOF && c !== '\t' && c !== '\n' && c !== '\r') { 10975 this._fragment += c; 10976 } 10977 10978 break; 10979 } 10980 10981 cursor++; 10982 } 10983 } 10984 10985 function clear() { 10986 this._scheme = ''; 10987 this._schemeData = ''; 10988 this._username = ''; 10989 this._password = null; 10990 this._host = ''; 10991 this._port = ''; 10992 this._path = []; 10993 this._query = ''; 10994 this._fragment = ''; 10995 this._isInvalid = false; 10996 this._isRelative = false; 10997 } 10998 10999 function JURL(url, base) { 11000 if (base !== undefined && !(base instanceof JURL)) { 11001 base = new JURL(String(base)); 11002 } 11003 11004 this._url = url; 11005 clear.call(this); 11006 var input = url.replace(/^[ \t\r\n\f]+|[ \t\r\n\f]+$/g, ''); 11007 parse.call(this, input, null, base); 11008 } 11009 11010 JURL.prototype = { 11011 toString: function toString() { 11012 return this.href; 11013 }, 11014 11015 get href() { 11016 if (this._isInvalid) { 11017 return this._url; 11018 } 11019 11020 var authority = ''; 11021 11022 if (this._username !== '' || this._password !== null) { 11023 authority = this._username + (this._password !== null ? ':' + this._password : '') + '@'; 11024 } 11025 11026 return this.protocol + (this._isRelative ? '//' + authority + this.host : '') + this.pathname + this._query + this._fragment; 11027 }, 11028 11029 set href(value) { 11030 clear.call(this); 11031 parse.call(this, value); 11032 }, 11033 11034 get protocol() { 11035 return this._scheme + ':'; 11036 }, 11037 11038 set protocol(value) { 11039 if (this._isInvalid) { 11040 return; 11041 } 11042 11043 parse.call(this, value + ':', 'scheme start'); 11044 }, 11045 11046 get host() { 11047 return this._isInvalid ? '' : this._port ? this._host + ':' + this._port : this._host; 11048 }, 11049 11050 set host(value) { 11051 if (this._isInvalid || !this._isRelative) { 11052 return; 11053 } 11054 11055 parse.call(this, value, 'host'); 11056 }, 11057 11058 get hostname() { 11059 return this._host; 11060 }, 11061 11062 set hostname(value) { 11063 if (this._isInvalid || !this._isRelative) { 11064 return; 11065 } 11066 11067 parse.call(this, value, 'hostname'); 11068 }, 11069 11070 get port() { 11071 return this._port; 11072 }, 11073 11074 set port(value) { 11075 if (this._isInvalid || !this._isRelative) { 11076 return; 11077 } 11078 11079 parse.call(this, value, 'port'); 11080 }, 11081 11082 get pathname() { 11083 return this._isInvalid ? '' : this._isRelative ? '/' + this._path.join('/') : this._schemeData; 11084 }, 11085 11086 set pathname(value) { 11087 if (this._isInvalid || !this._isRelative) { 11088 return; 11089 } 11090 11091 this._path = []; 11092 parse.call(this, value, 'relative path start'); 11093 }, 11094 11095 get search() { 11096 return this._isInvalid || !this._query || this._query === '?' ? '' : this._query; 11097 }, 11098 11099 set search(value) { 11100 if (this._isInvalid || !this._isRelative) { 11101 return; 11102 } 11103 11104 this._query = '?'; 11105 11106 if (value[0] === '?') { 11107 value = value.slice(1); 11108 } 11109 11110 parse.call(this, value, 'query'); 11111 }, 11112 11113 get hash() { 11114 return this._isInvalid || !this._fragment || this._fragment === '#' ? '' : this._fragment; 11115 }, 11116 11117 set hash(value) { 11118 if (this._isInvalid) { 11119 return; 11120 } 11121 11122 this._fragment = '#'; 11123 11124 if (value[0] === '#') { 11125 value = value.slice(1); 11126 } 11127 11128 parse.call(this, value, 'fragment'); 11129 }, 11130 11131 get origin() { 11132 var host; 11133 11134 if (this._isInvalid || !this._scheme) { 11135 return ''; 11136 } 11137 11138 switch (this._scheme) { 11139 case 'data': 11140 case 'file': 11141 case 'javascript': 11142 case 'mailto': 11143 return 'null'; 11144 11145 case 'blob': 11146 try { 11147 return new JURL(this._schemeData).origin || 'null'; 11148 } catch (_) {} 11149 11150 return 'null'; 11151 } 11152 11153 host = this.host; 11154 11155 if (!host) { 11156 return ''; 11157 } 11158 11159 return this._scheme + '://' + host; 11160 } 11161 11162 }; 11163 exports.URL = JURL; 11164})(); 11165 11166/***/ }), 11167/* 151 */ 11168/***/ (function(module, exports, __w_pdfjs_require__) { 11169 11170"use strict"; 11171 11172 11173Object.defineProperty(exports, "__esModule", { 11174 value: true 11175}); 11176exports.NetworkPdfManager = exports.LocalPdfManager = void 0; 11177 11178var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2)); 11179 11180var _util = __w_pdfjs_require__(6); 11181 11182var _chunked_stream = __w_pdfjs_require__(152); 11183 11184var _document = __w_pdfjs_require__(153); 11185 11186var _stream = __w_pdfjs_require__(157); 11187 11188function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 11189 11190function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 11191 11192function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 11193
11194function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 11195 11196function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 11197 11198function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 11199 11200function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 11201 11202function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } 11203 11204function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } 11205 11206function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 11207 11208function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 11209 11210function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 11211 11212var BasePdfManager = 11213/*#__PURE__*/ 11214function () { 11215 function BasePdfManager() { 11216 _classCallCheck(this, BasePdfManager); 11217 11218 if (this.constructor === BasePdfManager) { 11219 (0, _util.unreachable)('Cannot initialize BasePdfManager.'); 11220 } 11221 } 11222 11223 _createClass(BasePdfManager, [{ 11224 key: "onLoadedStream", 11225 value: function onLoadedStream() { 11226 (0, _util.unreachable)('Abstract method `onLoadedStream` called'); 11227 } 11228 }, { 11229 key: "ensureDoc", 11230 value: function ensureDoc(prop, args) { 11231 return this.ensure(this.pdfDocument, prop, args); 11232 } 11233 }, { 11234 key: "ensureXRef", 11235 value: function ensureXRef(prop, args) { 11236 return this.ensure(this.pdfDocument.xref, prop, args); 11237 } 11238 }, { 11239 key: "ensureCatalog", 11240 value: function ensureCatalog(prop, args) { 11241 return this.ensure(this.pdfDocument.catalog, prop, args); 11242 } 11243 }, { 11244 key: "getPage", 11245 value: function getPage(pageIndex) { 11246 return this.pdfDocument.getPage(pageIndex); 11247 } 11248 }, { 11249 key: "fontFallback", 11250 value: function fontFallback(id, handler) { 11251 return this.pdfDocument.fontFallback(id, handler); 11252 } 11253 }, { 11254 key: "cleanup", 11255 value: function cleanup() { 11256 return this.pdfDocument.cleanup(); 11257 } 11258 }, { 11259 key: "ensure", 11260 value: function () { 11261 var _ensure = _asyncToGenerator( 11262 /*#__PURE__*/ 11263 _regenerator.default.mark(function _callee(obj, prop, args) { 11264 return _regenerator.default.wrap(function _callee$(_context) { 11265 while (1) { 11266 switch (_context.prev = _context.next) { 11267 case 0: 11268 (0, _util.unreachable)('Abstract method `ensure` called'); 11269 11270 case 1: 11271 case "end": 11272 return _context.stop(); 11273 } 11274 } 11275 }, _callee, this); 11276 })); 11277 11278 function ensure(_x, _x2, _x3) { 11279 return _ensure.apply(this, arguments); 11280 } 11281 11282 return ensure; 11283 }() 11284 }, { 11285 key: "requestRange", 11286 value: function requestRange(begin, end) { 11287 (0, _util.unreachable)('Abstract method `requestRange` called'); 11288 } 11289 }, { 11290 key: "requestLoadedStream", 11291 value: function requestLoadedStream() { 11292 (0, _util.unreachable)('Abstract method `requestLoadedStream` called'); 11293 } 11294 }, { 11295 key: "sendProgressiveData", 11296 value: function sendProgressiveData(chunk) { 11297 (0, _util.unreachable)('Abstract method `sendProgressiveData` called'); 11298 } 11299 }, { 11300 key: "updatePassword", 11301 value: function updatePassword(password) { 11302 this._password = password; 11303 } 11304 }, { 11305 key: "terminate", 11306 value: function terminate() { 11307 (0, _util.unreachable)('Abstract method `terminate` called'); 11308 } 11309 }, { 11310 key: "docId", 11311 get: function get() { 11312 return this._docId; 11313 } 11314 }, { 11315 key: "password", 11316 get: function get() { 11317 return this._password; 11318 } 11319 }, { 11320 key: "docBaseUrl", 11321 get: function get() { 11322 var docBaseUrl = null; 11323 11324 if (this._docBaseUrl) { 11325 var absoluteUrl = (0, _util.createValidAbsoluteUrl)(this._docBaseUrl); 11326 11327 if (absoluteUrl) { 11328 docBaseUrl = absoluteUrl.href; 11329 } else { 11330 (0, _util.warn)("Invalid absolute docBaseUrl: \"".concat(this._docBaseUrl, "\".")); 11331 } 11332 } 11333 11334 return (0, _util.shadow)(this, 'docBaseUrl', docBaseUrl); 11335 } 11336 }]); 11337 11338 return BasePdfManager; 11339}();
11340 11341var LocalPdfManager = 11342/*#__PURE__*/ 11343function (_BasePdfManager) { 11344 _inherits(LocalPdfManager, _BasePdfManager); 11345 11346 function LocalPdfManager(docId, data, password, evaluatorOptions, docBaseUrl) { 11347 var _this; 11348 11349 _classCallCheck(this, LocalPdfManager); 11350 11351 _this = _possibleConstructorReturn(this, _getPrototypeOf(LocalPdfManager).call(this)); 11352 _this._docId = docId; 11353 _this._password = password; 11354 _this._docBaseUrl = docBaseUrl; 11355 _this.evaluatorOptions = evaluatorOptions; 11356 var stream = new _stream.Stream(data); 11357 _this.pdfDocument = new _document.PDFDocument(_assertThisInitialized(_assertThisInitialized(_this)), stream); 11358 _this._loadedStreamPromise = Promise.resolve(stream); 11359 return _this; 11360 } 11361 11362 _createClass(LocalPdfManager, [{ 11363 key: "ensure", 11364 value: function () { 11365 var _ensure2 = _asyncToGenerator( 11366 /*#__PURE__*/ 11367 _regenerator.default.mark(function _callee2(obj, prop, args) { 11368 var value; 11369 return _regenerator.default.wrap(function _callee2$(_context2) { 11370 while (1) { 11371 switch (_context2.prev = _context2.next) { 11372 case 0: 11373 value = obj[prop]; 11374 11375 if (!(typeof value === 'function')) { 11376 _context2.next = 3; 11377 break; 11378 } 11379 11380 return _context2.abrupt("return", value.apply(obj, args)); 11381 11382 case 3: 11383 return _context2.abrupt("return", value); 11384 11385 case 4: 11386 case "end": 11387 return _context2.stop(); 11388 } 11389 } 11390 }, _callee2, this); 11391 })); 11392 11393 function ensure(_x4, _x5, _x6) { 11394 return _ensure2.apply(this, arguments); 11395 } 11396 11397 return ensure; 11398 }() 11399 }, { 11400 key: "requestRange", 11401 value: function requestRange(begin, end) { 11402 return Promise.resolve(); 11403 } 11404 }, { 11405 key: "requestLoadedStream", 11406 value: function requestLoadedStream() {} 11407 }, { 11408 key: "onLoadedStream", 11409 value: function onLoadedStream() { 11410 return this._loadedStreamPromise; 11411 } 11412 }, { 11413 key: "terminate", 11414 value: function terminate() {} 11415 }]); 11416 11417 return LocalPdfManager; 11418}(BasePdfManager); 11419 11420exports.LocalPdfManager = LocalPdfManager; 11421 11422var NetworkPdfManager = 11423/*#__PURE__*/ 11424function (_BasePdfManager2) { 11425 _inherits(NetworkPdfManager, _BasePdfManager2); 11426 11427 function NetworkPdfManager(docId, pdfNetworkStream, args, evaluatorOptions, docBaseUrl) { 11428 var _this2; 11429 11430 _classCallCheck(this, NetworkPdfManager); 11431 11432 _this2 = _possibleConstructorReturn(this, _getPrototypeOf(NetworkPdfManager).call(this)); 11433 _this2._docId = docId; 11434 _this2._password = args.password; 11435 _this2._docBaseUrl = docBaseUrl; 11436 _this2.msgHandler = args.msgHandler; 11437 _this2.evaluatorOptions = evaluatorOptions; 11438 _this2.streamManager = new _chunked_stream.ChunkedStreamManager(pdfNetworkStream, { 11439 msgHandler: args.msgHandler, 11440 length: args.length, 11441 disableAutoFetch: args.disableAutoFetch, 11442 rangeChunkSize: args.rangeChunkSize 11443 }); 11444 _this2.pdfDocument = new _document.PDFDocument(_assertThisInitialized(_assertThisInitialized(_this2)), _this2.streamManager.getStream()); 11445 return _this2; 11446 } 11447 11448 _createClass(NetworkPdfManager, [{ 11449 key: "ensure", 11450 value: function () { 11451 var _ensure3 = _asyncToGenerator( 11452 /*#__PURE__*/ 11453 _regenerator.default.mark(function _callee3(obj, prop, args) { 11454 var value; 11455 return _regenerator.default.wrap(function _callee3$(_context3) { 11456 while (1) { 11457 switch (_context3.prev = _context3.next) { 11458 case 0: 11459 _context3.prev = 0; 11460 value = obj[prop]; 11461 11462 if (!(typeof value === 'function')) { 11463 _context3.next = 4; 11464 break; 11465 } 11466 11467 return _context3.abrupt("return", value.apply(obj, args)); 11468 11469 case 4: 11470 return _context3.abrupt("return", value); 11471 11472 case 7: 11473 _context3.prev = 7; 11474 _context3.t0 = _context3["catch"](0); 11475 11476 if (_context3.t0 instanceof _util.MissingDataException) { 11477 _context3.next = 11; 11478 break; 11479 } 11480 11481 throw _context3.t0; 11482 11483 case 11: 11484 _context3.next = 13; 11485 return this.requestRange(_context3.t0.begin, _context3.t0.end); 11486 11487 case 13: 11488 return _context3.abrupt("return", this.ensure(obj, prop, args)); 11489 11490 case 14: 11491 case "end": 11492 return _context3.stop(); 11493 } 11494 } 11495 }, _callee3, this, [[0, 7]]); 11496 })); 11497 11498 function ensure(_x7, _x8, _x9) { 11499 return _ensure3.apply(this, arguments); 11500 } 11501 11502 return ensure; 11503 }() 11504 }, { 11505 key: "requestRange", 11506 value: function requestRange(begin, end) { 11507 return this.streamManager.requestRange(begin, end); 11508 } 11509 }, { 11510 key: "requestLoadedStream", 11511 value: function requestLoadedStream() { 11512 this.streamManager.requestAllChunks(); 11513 } 11514 }, { 11515 key: "sendProgressiveData", 11516 value: function sendProgressiveData(chunk) { 11517 this.streamManager.onReceiveData({ 11518 chunk: chunk 11519 }); 11520 } 11521 }, { 11522 key: "onLoadedStream", 11523 value: function onLoadedStream() { 11524 return this.streamManager.onLoadedStream(); 11525 } 11526 }, { 11527 key: "terminate", 11528 value: function terminate() { 11529 this.streamManager.abort(); 11530 } 11531 }]); 11532 11533 return NetworkPdfManager; 11534}(BasePdfManager); 11535 11536exports.NetworkPdfManager = NetworkPdfManager; 11537 11538/***/ }), 11539/* 152 */ 11540/***/ (function(module, exports, __w_pdfjs_require__) { 11541 11542"use strict"; 11543 11544 11545Object.defineProperty(exports, "__esModule", { 11546 value: true 11547}); 11548exports.ChunkedStreamManager = exports.ChunkedStream = void 0; 11549 11550var _util = __w_pdfjs_require__(6); 11551 11552function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 11553 11554function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 11555 11556function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 11557 11558var ChunkedStream = 11559/*#__PURE__*/ 11560function () { 11561 function ChunkedStream(length, chunkSize, manager) { 11562 _classCallCheck(this, ChunkedStream); 11563 11564 this.bytes = new Uint8Array(length); 11565 this.start = 0; 11566 this.pos = 0; 11567 this.end = length; 11568 this.chunkSize = chunkSize; 11569 this.loadedChunks = []; 11570 this.numChunksLoaded = 0; 11571 this.numChunks = Math.ceil(length / chunkSize); 11572 this.manager = manager; 11573 this.progressiveDataLength = 0; 11574 this.lastSuccessfulEnsureByteChunk = -1; 11575 } 11576 11577 _createClass(ChunkedStream, [{ 11578 key: "getMissingChunks", 11579 value: function getMissingChunks() { 11580 var chunks = []; 11581 11582 for (var chunk = 0, n = this.numChunks; chunk < n; ++chunk) { 11583 if (!this.loadedChunks[chunk]) { 11584 chunks.push(chunk);
11585 } 11586 } 11587 11588 return chunks; 11589 } 11590 }, { 11591 key: "getBaseStreams", 11592 value: function getBaseStreams() { 11593 return [this]; 11594 } 11595 }, { 11596 key: "allChunksLoaded", 11597 value: function allChunksLoaded() { 11598 return this.numChunksLoaded === this.numChunks; 11599 } 11600 }, { 11601 key: "onReceiveData", 11602 value: function onReceiveData(begin, chunk) { 11603 var chunkSize = this.chunkSize; 11604 11605 if (begin % chunkSize !== 0) { 11606 throw new Error("Bad begin offset: ".concat(begin)); 11607 } 11608 11609 var end = begin + chunk.byteLength; 11610 11611 if (end % chunkSize !== 0 && end !== this.bytes.length) { 11612 throw new Error("Bad end offset: ".concat(end)); 11613 } 11614 11615 this.bytes.set(new Uint8Array(chunk), begin); 11616 var beginChunk = Math.floor(begin / chunkSize); 11617 var endChunk = Math.floor((end - 1) / chunkSize) + 1; 11618 11619 for (var curChunk = beginChunk; curChunk < endChunk; ++curChunk) { 11620 if (!this.loadedChunks[curChunk]) { 11621 this.loadedChunks[curChunk] = true; 11622 ++this.numChunksLoaded; 11623 } 11624 } 11625 } 11626 }, { 11627 key: "onReceiveProgressiveData", 11628 value: function onReceiveProgressiveData(data) { 11629 var position = this.progressiveDataLength; 11630 var beginChunk = Math.floor(position / this.chunkSize); 11631 this.bytes.set(new Uint8Array(data), position); 11632 position += data.byteLength; 11633 this.progressiveDataLength = position; 11634 var endChunk = position >= this.end ? this.numChunks : Math.floor(position / this.chunkSize); 11635 11636 for (var curChunk = beginChunk; curChunk < endChunk; ++curChunk) { 11637 if (!this.loadedChunks[curChunk]) { 11638 this.loadedChunks[curChunk] = true; 11639 ++this.numChunksLoaded; 11640 } 11641 } 11642 } 11643 }, { 11644 key: "ensureByte", 11645 value: function ensureByte(pos) { 11646 var chunk = Math.floor(pos / this.chunkSize); 11647 11648 if (chunk === this.lastSuccessfulEnsureByteChunk) { 11649 return; 11650 } 11651 11652 if (!this.loadedChunks[chunk]) { 11653 throw new _util.MissingDataException(pos, pos + 1); 11654 } 11655 11656 this.lastSuccessfulEnsureByteChunk = chunk; 11657 } 11658 }, { 11659 key: "ensureRange", 11660 value: function ensureRange(begin, end) { 11661 if (begin >= end) { 11662 return; 11663 } 11664 11665 if (end <= this.progressiveDataLength) { 11666 return; 11667 } 11668 11669 var chunkSize = this.chunkSize; 11670 var beginChunk = Math.floor(begin / chunkSize); 11671 var endChunk = Math.floor((end - 1) / chunkSize) + 1; 11672 11673 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 11674 if (!this.loadedChunks[chunk]) { 11675 throw new _util.MissingDataException(begin, end); 11676 } 11677 } 11678 } 11679 }, { 11680 key: "nextEmptyChunk", 11681 value: function nextEmptyChunk(beginChunk) { 11682 var numChunks = this.numChunks; 11683 11684 for (var i = 0; i < numChunks; ++i) { 11685 var chunk = (beginChunk + i) % numChunks; 11686 11687 if (!this.loadedChunks[chunk]) { 11688 return chunk; 11689 } 11690 } 11691 11692 return null; 11693 } 11694 }, { 11695 key: "hasChunk", 11696 value: function hasChunk(chunk) { 11697 return !!this.loadedChunks[chunk]; 11698 } 11699 }, { 11700 key: "getByte", 11701 value: function getByte() { 11702 var pos = this.pos; 11703 11704 if (pos >= this.end) { 11705 return -1; 11706 } 11707 11708 this.ensureByte(pos); 11709 return this.bytes[this.pos++]; 11710 } 11711 }, { 11712 key: "getUint16", 11713 value: function getUint16() { 11714 var b0 = this.getByte(); 11715 var b1 = this.getByte(); 11716 11717 if (b0 === -1 || b1 === -1) { 11718 return -1; 11719 } 11720 11721 return (b0 << 8) + b1; 11722 } 11723 }, { 11724 key: "getInt32", 11725 value: function getInt32() { 11726 var b0 = this.getByte(); 11727 var b1 = this.getByte(); 11728 var b2 = this.getByte(); 11729 var b3 = this.getByte(); 11730 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 11731 } 11732 }, { 11733 key: "getBytes", 11734 value: function getBytes(length) { 11735 var forceClamped = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 11736 var bytes = this.bytes; 11737 var pos = this.pos; 11738 var strEnd = this.end; 11739 11740 if (!length) { 11741 this.ensureRange(pos, strEnd); 11742 11743 var _subarray = bytes.subarray(pos, strEnd); 11744 11745 return forceClamped ? new Uint8ClampedArray(_subarray) : _subarray; 11746 } 11747 11748 var end = pos + length; 11749 11750 if (end > strEnd) { 11751 end = strEnd; 11752 } 11753 11754 this.ensureRange(pos, end); 11755 this.pos = end; 11756 var subarray = bytes.subarray(pos, end); 11757 return forceClamped ? new Uint8ClampedArray(subarray) : subarray; 11758 } 11759 }, { 11760 key: "peekByte", 11761 value: function peekByte() { 11762 var peekedByte = this.getByte(); 11763 this.pos--; 11764 return peekedByte; 11765 } 11766 }, { 11767 key: "peekBytes", 11768 value: function peekBytes(length) { 11769 var forceClamped = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 11770 var bytes = this.getBytes(length, forceClamped); 11771 this.pos -= bytes.length; 11772 return bytes; 11773 } 11774 }, { 11775 key: "getByteRange", 11776 value: function getByteRange(begin, end) { 11777 this.ensureRange(begin, end); 11778 return this.bytes.subarray(begin, end); 11779 } 11780 }, { 11781 key: "skip", 11782 value: function skip(n) { 11783 if (!n) { 11784 n = 1; 11785 } 11786 11787 this.pos += n; 11788 } 11789 }, { 11790 key: "reset", 11791 value: function reset() { 11792 this.pos = this.start; 11793 } 11794 }, { 11795 key: "moveStart", 11796 value: function moveStart() { 11797 this.start = this.pos; 11798 } 11799 }, { 11800 key: "makeSubStream", 11801 value: function makeSubStream(start, length, dict) { 11802 this.ensureRange(start, start + length); 11803 11804 function ChunkedStreamSubstream() {} 11805 11806 ChunkedStreamSubstream.prototype = Object.create(this); 11807 11808 ChunkedStreamSubstream.prototype.getMissingChunks = function () { 11809 var chunkSize = this.chunkSize; 11810 var beginChunk = Math.floor(this.start / chunkSize);
11811 var endChunk = Math.floor((this.end - 1) / chunkSize) + 1; 11812 var missingChunks = []; 11813 11814 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 11815 if (!this.loadedChunks[chunk]) { 11816 missingChunks.push(chunk); 11817 } 11818 } 11819 11820 return missingChunks; 11821 }; 11822 11823 var subStream = new ChunkedStreamSubstream(); 11824 subStream.pos = subStream.start = start; 11825 subStream.end = start + length || this.end; 11826 subStream.dict = dict; 11827 return subStream; 11828 } 11829 }, { 11830 key: "length", 11831 get: function get() { 11832 return this.end - this.start; 11833 } 11834 }, { 11835 key: "isEmpty", 11836 get: function get() { 11837 return this.length === 0; 11838 } 11839 }]); 11840 11841 return ChunkedStream; 11842}(); 11843 11844exports.ChunkedStream = ChunkedStream; 11845 11846var ChunkedStreamManager = 11847/*#__PURE__*/ 11848function () { 11849 function ChunkedStreamManager(pdfNetworkStream, args) { 11850 _classCallCheck(this, ChunkedStreamManager); 11851 11852 this.length = args.length; 11853 this.chunkSize = args.rangeChunkSize; 11854 this.stream = new ChunkedStream(this.length, this.chunkSize, this); 11855 this.pdfNetworkStream = pdfNetworkStream; 11856 this.disableAutoFetch = args.disableAutoFetch; 11857 this.msgHandler = args.msgHandler; 11858 this.currRequestId = 0; 11859 this.chunksNeededByRequest = Object.create(null); 11860 this.requestsByChunk = Object.create(null); 11861 this.promisesByRequest = Object.create(null); 11862 this.progressiveDataLength = 0; 11863 this.aborted = false; 11864 this._loadedStreamCapability = (0, _util.createPromiseCapability)(); 11865 } 11866 11867 _createClass(ChunkedStreamManager, [{ 11868 key: "onLoadedStream", 11869 value: function onLoadedStream() { 11870 return this._loadedStreamCapability.promise; 11871 } 11872 }, { 11873 key: "sendRequest", 11874 value: function sendRequest(begin, end) { 11875 var _this = this; 11876 11877 var rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); 11878 11879 if (!rangeReader.isStreamingSupported) { 11880 rangeReader.onProgress = this.onProgress.bind(this); 11881 } 11882 11883 var chunks = [], 11884 loaded = 0; 11885 var promise = new Promise(function (resolve, reject) { 11886 var readChunk = function readChunk(chunk) { 11887 try { 11888 if (!chunk.done) { 11889 var data = chunk.value; 11890 chunks.push(data); 11891 loaded += (0, _util.arrayByteLength)(data); 11892 11893 if (rangeReader.isStreamingSupported) { 11894 _this.onProgress({ 11895 loaded: loaded 11896 }); 11897 } 11898 11899 rangeReader.read().then(readChunk, reject); 11900 return; 11901 } 11902 11903 var chunkData = (0, _util.arraysToBytes)(chunks); 11904 chunks = null; 11905 resolve(chunkData); 11906 } catch (e) { 11907 reject(e); 11908 } 11909 }; 11910 11911 rangeReader.read().then(readChunk, reject); 11912 }); 11913 promise.then(function (data) { 11914 if (_this.aborted) { 11915 return; 11916 } 11917 11918 _this.onReceiveData({ 11919 chunk: data, 11920 begin: begin 11921 }); 11922 }); 11923 } 11924 }, { 11925 key: "requestAllChunks", 11926 value: function requestAllChunks() { 11927 var missingChunks = this.stream.getMissingChunks(); 11928 11929 this._requestChunks(missingChunks); 11930 11931 return this._loadedStreamCapability.promise; 11932 } 11933 }, { 11934 key: "_requestChunks", 11935 value: function _requestChunks(chunks) { 11936 var requestId = this.currRequestId++; 11937 var chunksNeeded = Object.create(null); 11938 this.chunksNeededByRequest[requestId] = chunksNeeded; 11939 var _iteratorNormalCompletion = true; 11940 var _didIteratorError = false; 11941 var _iteratorError = undefined; 11942 11943 try { 11944 for (var _iterator = chunks[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { 11945 var _chunk = _step.value; 11946 11947 if (!this.stream.hasChunk(_chunk)) { 11948 chunksNeeded[_chunk] = true; 11949 } 11950 } 11951 } catch (err) {
11952 _didIteratorError = true; 11953 _iteratorError = err; 11954 } finally { 11955 try { 11956 if (!_iteratorNormalCompletion && _iterator.return != null) { 11957 _iterator.return(); 11958 } 11959 } finally { 11960 if (_didIteratorError) { 11961 throw _iteratorError; 11962 } 11963 } 11964 } 11965 11966 if ((0, _util.isEmptyObj)(chunksNeeded)) { 11967 return Promise.resolve(); 11968 } 11969 11970 var capability = (0, _util.createPromiseCapability)(); 11971 this.promisesByRequest[requestId] = capability; 11972 var chunksToRequest = []; 11973 11974 for (var chunk in chunksNeeded) { 11975 chunk = chunk | 0; 11976 11977 if (!(chunk in this.requestsByChunk)) { 11978 this.requestsByChunk[chunk] = []; 11979 chunksToRequest.push(chunk); 11980 } 11981 11982 this.requestsByChunk[chunk].push(requestId); 11983 } 11984 11985 if (!chunksToRequest.length) { 11986 return capability.promise; 11987 } 11988 11989 var groupedChunksToRequest = this.groupChunks(chunksToRequest); 11990 var _iteratorNormalCompletion2 = true; 11991 var _didIteratorError2 = false; 11992 var _iteratorError2 = undefined; 11993 11994 try { 11995 for (var _iterator2 = groupedChunksToRequest[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { 11996 var groupedChunk = _step2.value; 11997 var begin = groupedChunk.beginChunk * this.chunkSize; 11998 var end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); 11999 this.sendRequest(begin, end); 12000 } 12001 } catch (err) { 12002 _didIteratorError2 = true; 12003 _iteratorError2 = err; 12004 } finally { 12005 try { 12006 if (!_iteratorNormalCompletion2 && _iterator2.return != null) { 12007 _iterator2.return(); 12008 } 12009 } finally { 12010 if (_didIteratorError2) { 12011 throw _iteratorError2; 12012 } 12013 } 12014 } 12015 12016 return capability.promise; 12017 } 12018 }, { 12019 key: "getStream", 12020 value: function getStream() { 12021 return this.stream; 12022 } 12023 }, { 12024 key: "requestRange", 12025 value: function requestRange(begin, end) { 12026 end = Math.min(end, this.length); 12027 var beginChunk = this.getBeginChunk(begin); 12028 var endChunk = this.getEndChunk(end); 12029 var chunks = []; 12030 12031 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 12032 chunks.push(chunk); 12033 } 12034 12035 return this._requestChunks(chunks); 12036 } 12037 }, { 12038 key: "requestRanges", 12039 value: function requestRanges() { 12040 var ranges = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 12041 var chunksToRequest = []; 12042 var _iteratorNormalCompletion3 = true; 12043 var _didIteratorError3 = false; 12044 var _iteratorError3 = undefined; 12045 12046 try { 12047 for (var _iterator3 = ranges[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { 12048 var range = _step3.value; 12049 var beginChunk = this.getBeginChunk(range.begin); 12050 var endChunk = this.getEndChunk(range.end); 12051 12052 for (var chunk = beginChunk; chunk < endChunk; ++chunk) { 12053 if (!chunksToRequest.includes(chunk)) { 12054 chunksToRequest.push(chunk); 12055 } 12056 } 12057 } 12058 } catch (err) { 12059 _didIteratorError3 = true; 12060 _iteratorError3 = err; 12061 } finally { 12062 try { 12063 if (!_iteratorNormalCompletion3 && _iterator3.return != null) { 12064 _iterator3.return(); 12065 } 12066 } finally { 12067 if (_didIteratorError3) { 12068 throw _iteratorError3; 12069 } 12070 } 12071 } 12072 12073 chunksToRequest.sort(function (a, b) { 12074 return a - b; 12075 }); 12076 return this._requestChunks(chunksToRequest); 12077 } 12078 }, { 12079 key: "groupChunks", 12080 value: function groupChunks(chunks) { 12081 var groupedChunks = []; 12082 var beginChunk = -1; 12083 var prevChunk = -1; 12084 12085 for (var i = 0, ii = chunks.length; i < ii; ++i) { 12086 var chunk = chunks[i]; 12087 12088 if (beginChunk < 0) { 12089 beginChunk = chunk; 12090 } 12091 12092 if (prevChunk >= 0 && prevChunk + 1 !== chunk) { 12093 groupedChunks.push({ 12094 beginChunk: beginChunk, 12095 endChunk: prevChunk + 1 12096 }); 12097 beginChunk = chunk; 12098 } 12099 12100 if (i + 1 === chunks.length) { 12101 groupedChunks.push({ 12102 beginChunk: beginChunk, 12103 endChunk: chunk + 1 12104 }); 12105 } 12106 12107 prevChunk = chunk; 12108 } 12109 12110 return groupedChunks; 12111 } 12112 }, { 12113 key: "onProgress", 12114 value: function onProgress(args) { 12115 this.msgHandler.send('DocProgress', { 12116 loaded: this.stream.numChunksLoaded * this.chunkSize + args.loaded, 12117 total: this.length 12118 }); 12119 } 12120 }, { 12121 key: "onReceiveData", 12122 value: function onReceiveData(args) { 12123 var chunk = args.chunk; 12124 var isProgressive = args.begin === undefined; 12125 var begin = isProgressive ? this.progressiveDataLength : args.begin; 12126 var end = begin + chunk.byteLength; 12127 var beginChunk = Math.floor(begin / this.chunkSize); 12128 var endChunk = end < this.length ? Math.floor(end / this.chunkSize) : Math.ceil(end / this.chunkSize); 12129 12130 if (isProgressive) { 12131 this.stream.onReceiveProgressiveData(chunk);
12132 this.progressiveDataLength = end; 12133 } else { 12134 this.stream.onReceiveData(begin, chunk); 12135 } 12136 12137 if (this.stream.allChunksLoaded()) { 12138 this._loadedStreamCapability.resolve(this.stream); 12139 } 12140 12141 var loadedRequests = []; 12142 12143 for (var _chunk2 = beginChunk; _chunk2 < endChunk; ++_chunk2) { 12144 var requestIds = this.requestsByChunk[_chunk2] || []; 12145 delete this.requestsByChunk[_chunk2]; 12146 var _iteratorNormalCompletion4 = true; 12147 var _didIteratorError4 = false; 12148 var _iteratorError4 = undefined; 12149 12150 try { 12151 for (var _iterator4 = requestIds[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { 12152 var requestId = _step4.value; 12153 var chunksNeeded = this.chunksNeededByRequest[requestId]; 12154 12155 if (_chunk2 in chunksNeeded) { 12156 delete chunksNeeded[_chunk2]; 12157 } 12158 12159 if (!(0, _util.isEmptyObj)(chunksNeeded)) { 12160 continue; 12161 } 12162 12163 loadedRequests.push(requestId); 12164 } 12165 } catch (err) { 12166 _didIteratorError4 = true; 12167 _iteratorError4 = err; 12168 } finally { 12169 try { 12170 if (!_iteratorNormalCompletion4 && _iterator4.return != null) { 12171 _iterator4.return(); 12172 } 12173 } finally { 12174 if (_didIteratorError4) { 12175 throw _iteratorError4; 12176 } 12177 } 12178 } 12179 } 12180 12181 if (!this.disableAutoFetch && (0, _util.isEmptyObj)(this.requestsByChunk)) { 12182 var nextEmptyChunk; 12183 12184 if (this.stream.numChunksLoaded === 1) { 12185 var lastChunk = this.stream.numChunks - 1; 12186 12187 if (!this.stream.hasChunk(lastChunk)) { 12188 nextEmptyChunk = lastChunk; 12189 } 12190 } else { 12191 nextEmptyChunk = this.stream.nextEmptyChunk(endChunk);
12192 } 12193 12194 if (Number.isInteger(nextEmptyChunk)) { 12195 this._requestChunks([nextEmptyChunk]); 12196 } 12197 } 12198 12199 for (var _i = 0; _i < loadedRequests.length; _i++) { 12200 var _requestId = loadedRequests[_i]; 12201 var capability = this.promisesByRequest[_requestId]; 12202 delete this.promisesByRequest[_requestId]; 12203 capability.resolve(); 12204 } 12205 12206 this.msgHandler.send('DocProgress', { 12207 loaded: this.stream.numChunksLoaded * this.chunkSize, 12208 total: this.length 12209 }); 12210 } 12211 }, { 12212 key: "onError", 12213 value: function onError(err) { 12214 this._loadedStreamCapability.reject(err); 12215 } 12216 }, { 12217 key: "getBeginChunk", 12218 value: function getBeginChunk(begin) { 12219 return Math.floor(begin / this.chunkSize); 12220 } 12221 }, { 12222 key: "getEndChunk", 12223 value: function getEndChunk(end) { 12224 return Math.floor((end - 1) / this.chunkSize) + 1; 12225 } 12226 }, { 12227 key: "abort", 12228 value: function abort() { 12229 this.aborted = true; 12230 12231 if (this.pdfNetworkStream) { 12232 this.pdfNetworkStream.cancelAllRequests('abort'); 12233 } 12234 12235 for (var requestId in this.promisesByRequest) { 12236 this.promisesByRequest[requestId].reject(new Error('Request was aborted')); 12237 } 12238 } 12239 }]); 12240 12241 return ChunkedStreamManager; 12242}(); 12243 12244exports.ChunkedStreamManager = ChunkedStreamManager; 12245 12246/***/ }), 12247/* 153 */ 12248/***/ (function(module, exports, __w_pdfjs_require__) { 12249 12250"use strict"; 12251 12252 12253Object.defineProperty(exports, "__esModule", { 12254 value: true 12255}); 12256exports.PDFDocument = exports.Page = void 0; 12257 12258var _util = __w_pdfjs_require__(6); 12259 12260var _obj = __w_pdfjs_require__(154); 12261 12262var _primitives = __w_pdfjs_require__(155); 12263 12264var _stream2 = __w_pdfjs_require__(157); 12265 12266var _annotation = __w_pdfjs_require__(169); 12267 12268var _crypto = __w_pdfjs_require__(167); 12269 12270var _parser = __w_pdfjs_require__(156); 12271 12272var _operator_list = __w_pdfjs_require__(170); 12273 12274var _evaluator = __w_pdfjs_require__(171); 12275 12276var _function = __w_pdfjs_require__(185); 12277 12278function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } 12279 12280function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } 12281 12282function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } 12283 12284function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 12285 12286function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 12287 12288function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 12289 12290function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 12291 12292var DEFAULT_USER_UNIT = 1.0; 12293var LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; 12294 12295function isAnnotationRenderable(annotation, intent) { 12296 return intent === 'display' && annotation.viewable || intent === 'print' && annotation.printable; 12297} 12298 12299var Page = 12300/*#__PURE__*/ 12301function () { 12302 function Page(_ref) { 12303 var pdfManager = _ref.pdfManager, 12304 xref = _ref.xref, 12305 pageIndex = _ref.pageIndex, 12306 pageDict = _ref.pageDict, 12307 ref = _ref.ref, 12308 fontCache = _ref.fontCache, 12309 builtInCMapCache = _ref.builtInCMapCache, 12310 pdfFunctionFactory = _ref.pdfFunctionFactory; 12311 12312 _classCallCheck(this, Page); 12313 12314 this.pdfManager = pdfManager; 12315 this.pageIndex = pageIndex; 12316 this.pageDict = pageDict; 12317 this.xref = xref; 12318 this.ref = ref; 12319 this.fontCache = fontCache; 12320 this.builtInCMapCache = builtInCMapCache; 12321 this.pdfFunctionFactory = pdfFunctionFactory;
12322 this.evaluatorOptions = pdfManager.evaluatorOptions; 12323 this.resourcesPromise = null; 12324 var uniquePrefix = "p".concat(this.pageIndex, "_"); 12325 var idCounters = { 12326 obj: 0 12327 }; 12328 this.idFactory = { 12329 createObjId: function createObjId() { 12330 return uniquePrefix + ++idCounters.obj; 12331 } 12332 }; 12333 } 12334 12335 _createClass(Page, [{ 12336 key: "_getInheritableProperty", 12337 value: function _getInheritableProperty(key) { 12338 var getArray = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 12339 var value = (0, _util.getInheritableProperty)({ 12340 dict: this.pageDict, 12341 key: key, 12342 getArray: getArray, 12343 stopWhenFound: false 12344 }); 12345 12346 if (!Array.isArray(value)) { 12347 return value; 12348 } 12349 12350 if (value.length === 1 || !(0, _primitives.isDict)(value[0])) { 12351 return value[0]; 12352 } 12353 12354 return _primitives.Dict.merge(this.xref, value); 12355 } 12356 }, { 12357 key: "getContentStream", 12358 value: function getContentStream() { 12359 var content = this.content; 12360 var stream; 12361 12362 if (Array.isArray(content)) { 12363 var xref = this.xref; 12364 var streams = []; 12365 var _iteratorNormalCompletion = true; 12366 var _didIteratorError = false; 12367 var _iteratorError = undefined; 12368 12369 try { 12370 for (var _iterator = content[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { 12371 var _stream = _step.value; 12372 streams.push(xref.fetchIfRef(_stream)); 12373 } 12374 } catch (err) { 12375 _didIteratorError = true; 12376 _iteratorError = err; 12377 } finally { 12378 try { 12379 if (!_iteratorNormalCompletion && _iterator.return != null) { 12380 _iterator.return(); 12381 } 12382 } finally { 12383 if (_didIteratorError) { 12384 throw _iteratorError; 12385 } 12386 } 12387 } 12388 12389 stream = new _stream2.StreamsSequenceStream(streams); 12390 } else if ((0, _primitives.isStream)(content)) { 12391 stream = content; 12392 } else { 12393 stream = new _stream2.NullStream(); 12394 } 12395 12396 return stream; 12397 } 12398 }, { 12399 key: "loadResources", 12400 value: function loadResources(keys) { 12401 var _this = this; 12402 12403 if (!this.resourcesPromise) { 12404 this.resourcesPromise = this.pdfManager.ensure(this, 'resources'); 12405 } 12406 12407 return this.resourcesPromise.then(function () { 12408 var objectLoader = new _obj.ObjectLoader(_this.resources, keys, _this.xref); 12409 return objectLoader.load(); 12410 }); 12411 } 12412 }, { 12413 key: "getOperatorList", 12414 value: function getOperatorList(_ref2) { 12415 var _this2 = this; 12416 12417 var handler = _ref2.handler, 12418 task = _ref2.task, 12419 intent = _ref2.intent, 12420 renderInteractiveForms = _ref2.renderInteractiveForms; 12421 var contentStreamPromise = this.pdfManager.ensure(this, 'getContentStream'); 12422 var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']); 12423 var partialEvaluator = new _evaluator.PartialEvaluator({ 12424 pdfManager: this.pdfManager, 12425 xref: this.xref, 12426 handler: handler, 12427 pageIndex: this.pageIndex, 12428 idFactory: this.idFactory, 12429 fontCache: this.fontCache, 12430 builtInCMapCache: this.builtInCMapCache, 12431 options: this.evaluatorOptions, 12432 pdfFunctionFactory: this.pdfFunctionFactory 12433 }); 12434 var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); 12435 var pageListPromise = dataPromises.then(function (_ref3) { 12436 var _ref4 = _slicedToArray(_ref3, 1), 12437 contentStream = _ref4[0]; 12438 12439 var opList = new _operator_list.OperatorList(intent, handler, _this2.pageIndex); 12440 handler.send('StartRenderPage', { 12441 transparency: partialEvaluator.hasBlendModes(_this2.resources), 12442 pageIndex: _this2.pageIndex, 12443 intent: intent 12444 }); 12445 return partialEvaluator.getOperatorList({ 12446 stream: contentStream, 12447 task: task, 12448 resources: _this2.resources, 12449 operatorList: opList 12450 }).then(function () { 12451 return opList; 12452 }); 12453 }); 12454 return Promise.all([pageListPromise, this._parsedAnnotations]).then(function (_ref5) { 12455 var _ref6 = _slicedToArray(_ref5, 2), 12456 pageOpList = _ref6[0], 12457 annotations = _ref6[1]; 12458 12459 if (annotations.length === 0) { 12460 pageOpList.flush(true); 12461 return pageOpList; 12462 } 12463 12464 var opListPromises = []; 12465 var _iteratorNormalCompletion2 = true; 12466 var _didIteratorError2 = false; 12467 var _iteratorError2 = undefined; 12468 12469 try { 12470 for (var _iterator2 = annotations[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { 12471 var annotation = _step2.value; 12472 12473 if (isAnnotationRenderable(annotation, intent)) { 12474 opListPromises.push(annotation.getOperatorList(partialEvaluator, task, renderInteractiveForms)); 12475 } 12476 } 12477 } catch (err) {
12478 _didIteratorError2 = true; 12479 _iteratorError2 = err; 12480 } finally { 12481 try { 12482 if (!_iteratorNormalCompletion2 && _iterator2.return != null) { 12483 _iterator2.return(); 12484 } 12485 } finally { 12486 if (_didIteratorError2) { 12487 throw _iteratorError2; 12488 } 12489 } 12490 } 12491 12492 return Promise.all(opListPromises).then(function (opLists) { 12493 pageOpList.addOp(_util.OPS.beginAnnotations, []); 12494 var _iteratorNormalCompletion3 = true; 12495 var _didIteratorError3 = false; 12496 var _iteratorError3 = undefined; 12497 12498 try { 12499 for (var _iterator3 = opLists[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { 12500 var opList = _step3.value; 12501 pageOpList.addOpList(opList); 12502 } 12503 } catch (err) { 12504 _didIteratorError3 = true; 12505 _iteratorError3 = err; 12506 } finally { 12507 try { 12508 if (!_iteratorNormalCompletion3 && _iterator3.return != null) { 12509 _iterator3.return(); 12510 } 12511 } finally { 12512 if (_didIteratorError3) { 12513 throw _iteratorError3; 12514 } 12515 } 12516 } 12517 12518 pageOpList.addOp(_util.OPS.endAnnotations, []); 12519 pageOpList.flush(true); 12520 return pageOpList; 12521 }); 12522 }); 12523 } 12524 }, { 12525 key: "extractTextContent", 12526 value: function extractTextContent(_ref7) { 12527 var _this3 = this; 12528 12529 var handler = _ref7.handler, 12530 task = _ref7.task, 12531 normalizeWhitespace = _ref7.normalizeWhitespace, 12532 sink = _ref7.sink, 12533 combineTextItems = _ref7.combineTextItems; 12534 var contentStreamPromise = this.pdfManager.ensure(this, 'getContentStream'); 12535 var resourcesPromise = this.loadResources(['ExtGState', 'XObject', 'Font']); 12536 var dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); 12537 return dataPromises.then(function (_ref8) { 12538 var _ref9 = _slicedToArray(_ref8, 1), 12539 contentStream = _ref9[0]; 12540 12541 var partialEvaluator = new _evaluator.PartialEvaluator({ 12542 pdfManager: _this3.pdfManager, 12543 xref: _this3.xref, 12544 handler: handler, 12545 pageIndex: _this3.pageIndex, 12546 idFactory: _this3.idFactory, 12547 fontCache: _this3.fontCache, 12548 builtInCMapCache: _this3.builtInCMapCache, 12549 options: _this3.evaluatorOptions, 12550 pdfFunctionFactory: _this3.pdfFunctionFactory 12551 }); 12552 return partialEvaluator.getTextContent({ 12553 stream: contentStream, 12554 task: task, 12555 resources: _this3.resources, 12556 normalizeWhitespace: normalizeWhitespace, 12557 combineTextItems: combineTextItems, 12558 sink: sink 12559 }); 12560 }); 12561 } 12562 }, { 12563 key: "getAnnotationsData", 12564 value: function getAnnotationsData(intent) { 12565 return this._parsedAnnotations.then(function (annotations) { 12566 var annotationsData = []; 12567 12568 for (var i = 0, ii = annotations.length; i < ii; i++) { 12569 if (!intent || isAnnotationRenderable(annotations[i], intent)) { 12570 annotationsData.push(annotations[i].data); 12571 } 12572 } 12573 12574 return annotationsData; 12575 }); 12576 } 12577 }, { 12578 key: "content", 12579 get: function get() { 12580 return this.pageDict.get('Contents'); 12581 } 12582 }, { 12583 key: "resources", 12584 get: function get() { 12585 return (0, _util.shadow)(this, 'resources', this._getInheritableProperty('Resources') || _primitives.Dict.empty); 12586 } 12587 }, { 12588 key: "mediaBox", 12589 get: function get() { 12590 var mediaBox = this._getInheritableProperty('MediaBox', true); 12591 12592 if (!Array.isArray(mediaBox) || mediaBox.length !== 4) { 12593 return (0, _util.shadow)(this, 'mediaBox', LETTER_SIZE_MEDIABOX); 12594 } 12595 12596 return (0, _util.shadow)(this, 'mediaBox', mediaBox); 12597 } 12598 }, { 12599 key: "cropBox", 12600 get: function get() { 12601 var cropBox = this._getInheritableProperty('CropBox', true); 12602 12603 if (!Array.isArray(cropBox) || cropBox.length !== 4) { 12604 return (0, _util.shadow)(this, 'cropBox', this.mediaBox); 12605 } 12606 12607 return (0, _util.shadow)(this, 'cropBox', cropBox); 12608 } 12609 }, { 12610 key: "userUnit", 12611 get: function get() { 12612 var obj = this.pageDict.get('UserUnit'); 12613 12614 if (!(0, _util.isNum)(obj) || obj <= 0) { 12615 obj = DEFAULT_USER_UNIT; 12616 } 12617 12618 return (0, _util.shadow)(this, 'userUnit', obj); 12619 } 12620 }, { 12621 key: "view", 12622 get: function get() { 12623 var mediaBox = this.mediaBox, 12624 cropBox = this.cropBox; 12625 12626 if (mediaBox === cropBox) { 12627 return (0, _util.shadow)(this, 'view', mediaBox); 12628 } 12629 12630 var intersection = _util.Util.intersect(cropBox, mediaBox); 12631 12632 return (0, _util.shadow)(this, 'view', intersection || mediaBox); 12633 } 12634 }, { 12635 key: "rotate", 12636 get: function get() { 12637 var rotate = this._getInheritableProperty('Rotate') || 0; 12638 12639 if (rotate % 90 !== 0) { 12640 rotate = 0; 12641 } else if (rotate >= 360) { 12642 rotate = rotate % 360; 12643 } else if (rotate < 0) { 12644 rotate = (rotate % 360 + 360) % 360; 12645 } 12646 12647 return (0, _util.shadow)(this, 'rotate', rotate); 12648 } 12649 }, { 12650 key: "annotations", 12651 get: function get() { 12652 return (0, _util.shadow)(this, 'annotations', this._getInheritableProperty('Annots') || []); 12653 } 12654 }, { 12655 key: "_parsedAnnotations", 12656 get: function get() { 12657 var _this4 = this; 12658 12659 var parsedAnnotations = this.pdfManager.ensure(this, 'annotations').then(function () { 12660 var annotationRefs = _this4.annotations; 12661 var annotationPromises = []; 12662 12663 for (var i = 0, ii = annotationRefs.length; i < ii; i++) { 12664 annotationPromises.push(_annotation.AnnotationFactory.create(_this4.xref, annotationRefs[i], _this4.pdfManager, _this4.idFactory)); 12665 } 12666 12667 return Promise.all(annotationPromises).then(function (annotations) { 12668 return annotations.filter(function isDefined(annotation) { 12669 return !!annotation; 12670 }); 12671 }, function (reason) { 12672 (0, _util.warn)("_parsedAnnotations: \"".concat(reason, "\".")); 12673 return []; 12674 }); 12675 }); 12676 return (0, _util.shadow)(this, '_parsedAnnotations', parsedAnnotations); 12677 } 12678 }]); 12679 12680 return Page; 12681}();
12682 12683exports.Page = Page; 12684var FINGERPRINT_FIRST_BYTES = 1024; 12685var EMPTY_FINGERPRINT = '\x00\x00\x00\x00\x00\x00\x00' + '\x00\x00\x00\x00\x00\x00\x00\x00\x00'; 12686 12687function find(stream, needle, limit, backwards) { 12688 var pos = stream.pos; 12689 var end = stream.end; 12690 12691 if (pos + limit > end) { 12692 limit = end - pos; 12693 } 12694 12695 var strBuf = []; 12696 12697 for (var i = 0; i < limit; ++i) { 12698 strBuf.push(String.fromCharCode(stream.getByte())); 12699 } 12700 12701 var str = strBuf.join(''); 12702 stream.pos = pos; 12703 var index = backwards ? str.lastIndexOf(needle) : str.indexOf(needle); 12704 12705 if (index === -1) { 12706 return false; 12707 } 12708 12709 stream.pos += index; 12710 return true; 12711} 12712 12713var PDFDocument = 12714/*#__PURE__*/ 12715function () { 12716 function PDFDocument(pdfManager, arg) { 12717 _classCallCheck(this, PDFDocument); 12718 12719 var stream; 12720 12721 if ((0, _primitives.isStream)(arg)) { 12722 stream = arg; 12723 } else if ((0, _util.isArrayBuffer)(arg)) { 12724 stream = new _stream2.Stream(arg); 12725 } else { 12726 throw new Error('PDFDocument: Unknown argument type'); 12727 } 12728 12729 if (stream.length <= 0) { 12730 throw new Error('PDFDocument: Stream must have data'); 12731 } 12732 12733 this.pdfManager = pdfManager; 12734 this.stream = stream; 12735 this.xref = new _obj.XRef(stream, pdfManager); 12736 this.pdfFunctionFactory = new _function.PDFFunctionFactory({ 12737 xref: this.xref, 12738 isEvalSupported: pdfManager.evaluatorOptions.isEvalSupported 12739 }); 12740 this._pagePromises = []; 12741 } 12742 12743 _createClass(PDFDocument, [{ 12744 key: "parse", 12745 value: function parse(recoveryMode) { 12746 this.setup(recoveryMode); 12747 var version = this.catalog.catDict.get('Version'); 12748 12749 if ((0, _primitives.isName)(version)) { 12750 this.pdfFormatVersion = version.name; 12751 } 12752 12753 try { 12754 this.acroForm = this.catalog.catDict.get('AcroForm'); 12755 12756 if (this.acroForm) { 12757 this.xfa = this.acroForm.get('XFA'); 12758 var fields = this.acroForm.get('Fields'); 12759 12760 if ((!fields || !Array.isArray(fields) || fields.length === 0) && !this.xfa) { 12761 this.acroForm = null; 12762 } 12763 } 12764 } catch (ex) { 12765 if (ex instanceof _util.MissingDataException) { 12766 throw ex; 12767 } 12768 12769 (0, _util.info)('Cannot fetch AcroForm entry; assuming no AcroForms are present'); 12770 this.acroForm = null; 12771 } 12772 } 12773 }, { 12774 key: "checkHeader", 12775 value: function checkHeader() { 12776 var stream = this.stream; 12777 stream.reset(); 12778 12779 if (!find(stream, '%PDF-', 1024)) { 12780 return; 12781 } 12782 12783 stream.moveStart(); 12784 var MAX_PDF_VERSION_LENGTH = 12; 12785 var version = '', 12786 ch; 12787 12788 while ((ch = stream.getByte()) > 0x20) { 12789 if (version.length >= MAX_PDF_VERSION_LENGTH) { 12790 break; 12791 } 12792 12793 version += String.fromCharCode(ch); 12794 } 12795 12796 if (!this.pdfFormatVersion) { 12797 this.pdfFormatVersion = version.substring(5); 12798 } 12799 } 12800 }, { 12801 key: "parseStartXRef", 12802 value: function parseStartXRef() { 12803 this.xref.setStartXRef(this.startXRef); 12804 } 12805 }, { 12806 key: "setup", 12807 value: function setup(recoveryMode) { 12808 this.xref.parse(recoveryMode); 12809 this.catalog = new _obj.Catalog(this.pdfManager, this.xref); 12810 } 12811 }, { 12812 key: "_getLinearizationPage", 12813 value: function _getLinearizationPage(pageIndex) { 12814 var catalog = this.catalog, 12815 linearization = this.linearization; 12816 (0, _util.assert)(linearization && linearization.pageFirst === pageIndex); 12817 var ref = new _primitives.Ref(linearization.objectNumberFirst, 0); 12818 return this.xref.fetchAsync(ref).then(function (obj) { 12819 if ((0, _primitives.isDict)(obj, 'Page') || (0, _primitives.isDict)(obj) && !obj.has('Type') && obj.has('Contents')) { 12820 if (ref && !catalog.pageKidsCountCache.has(ref)) { 12821 catalog.pageKidsCountCache.put(ref, 1); 12822 } 12823 12824 return [obj, ref]; 12825 } 12826 12827 throw new _util.FormatError('The Linearization dictionary doesn\'t point ' + 'to a valid Page dictionary.'); 12828 }).catch(function (reason) { 12829 (0, _util.info)(reason); 12830 return catalog.getPageDict(pageIndex); 12831 }); 12832 } 12833 }, { 12834 key: "getPage", 12835 value: function getPage(pageIndex) { 12836 var _this5 = this; 12837 12838 if (this._pagePromises[pageIndex] !== undefined) { 12839 return this._pagePromises[pageIndex]; 12840 } 12841 12842 var catalog = this.catalog, 12843 linearization = this.linearization; 12844 var promise = linearization && linearization.pageFirst === pageIndex ? this._getLinearizationPage(pageIndex) : catalog.getPageDict(pageIndex); 12845 return this._pagePromises[pageIndex] = promise.then(function (_ref10) { 12846 var _ref11 = _slicedToArray(_ref10, 2), 12847 pageDict = _ref11[0], 12848 ref = _ref11[1]; 12849 12850 return new Page({ 12851 pdfManager: _this5.pdfManager, 12852 xref: _this5.xref, 12853 pageIndex: pageIndex, 12854 pageDict: pageDict, 12855 ref: ref, 12856 fontCache: catalog.fontCache, 12857 builtInCMapCache: catalog.builtInCMapCache, 12858 pdfFunctionFactory: _this5.pdfFunctionFactory 12859 }); 12860 }); 12861 } 12862 }, { 12863 key: "checkFirstPage", 12864 value: function checkFirstPage() { 12865 var _this6 = this; 12866 12867 return this.getPage(0).catch(function (reason) {
12868 if (reason instanceof _util.XRefEntryException) { 12869 _this6._pagePromises.length = 0; 12870 12871 _this6.cleanup(); 12872 12873 throw new _util.XRefParseException(); 12874 } 12875 }); 12876 } 12877 }, { 12878 key: "fontFallback", 12879 value: function fontFallback(id, handler) { 12880 return this.catalog.fontFallback(id, handler); 12881 } 12882 }, { 12883 key: "cleanup", 12884 value: function cleanup() { 12885 return this.catalog.cleanup(); 12886 } 12887 }, { 12888 key: "linearization", 12889 get: function get() { 12890 var linearization = null; 12891 12892 try { 12893 linearization = _parser.Linearization.create(this.stream); 12894 } catch (err) { 12895 if (err instanceof _util.MissingDataException) { 12896 throw err; 12897 } 12898 12899 (0, _util.info)(err); 12900 } 12901 12902 return (0, _util.shadow)(this, 'linearization', linearization); 12903 } 12904 }, { 12905 key: "startXRef", 12906 get: function get() { 12907 var stream = this.stream; 12908 var startXRef = 0; 12909 12910 if (this.linearization) { 12911 stream.reset(); 12912 12913 if (find(stream, 'endobj', 1024)) { 12914 startXRef = stream.pos + 6; 12915 } 12916 } else { 12917 var step = 1024; 12918 var startXRefLength = 'startxref'.length; 12919 var found = false, 12920 pos = stream.end; 12921 12922 while (!found && pos > 0) { 12923 pos -= step - startXRefLength; 12924 12925 if (pos < 0) { 12926 pos = 0; 12927 } 12928 12929 stream.pos = pos; 12930 found = find(stream, 'startxref', step, true); 12931 } 12932 12933 if (found) { 12934 stream.skip(9); 12935 var ch; 12936 12937 do { 12938 ch = stream.getByte(); 12939 } while ((0, _util.isSpace)(ch)); 12940 12941 var str = ''; 12942 12943 while (ch >= 0x20 && ch <= 0x39) { 12944 str += String.fromCharCode(ch); 12945 ch = stream.getByte(); 12946 } 12947 12948 startXRef = parseInt(str, 10); 12949 12950 if (isNaN(startXRef)) { 12951 startXRef = 0; 12952 } 12953 } 12954 } 12955 12956 return (0, _util.shadow)(this, 'startXRef', startXRef); 12957 } 12958 }, { 12959 key: "numPages", 12960 get: function get() { 12961 var linearization = this.linearization; 12962 var num = linearization ? linearization.numPages : this.catalog.numPages; 12963 return (0, _util.shadow)(this, 'numPages', num); 12964 } 12965 }, { 12966 key: "documentInfo", 12967 get: function get() { 12968 var DocumentInfoValidators = { 12969 Title: _util.isString, 12970 Author: _util.isString, 12971 Subject: _util.isString, 12972 Keywords: _util.isString, 12973 Creator: _util.isString, 12974 Producer: _util.isString, 12975 CreationDate: _util.isString, 12976 ModDate: _util.isString, 12977 Trapped: _primitives.isName 12978 }; 12979 var docInfo = { 12980 PDFFormatVersion: this.pdfFormatVersion, 12981 IsLinearized: !!this.linearization, 12982 IsAcroFormPresent: !!this.acroForm, 12983 IsXFAPresent: !!this.xfa 12984 }; 12985 var infoDict; 12986 12987 try { 12988 infoDict = this.xref.trailer.get('Info'); 12989 } catch (err) { 12990 if (err instanceof _util.MissingDataException) { 12991 throw err; 12992 } 12993 12994 (0, _util.info)('The document information dictionary is invali
12994d.'); 12995 } 12996 12997 if ((0, _primitives.isDict)(infoDict)) { 12998 var _iteratorNormalCompletion4 = true; 12999 var _didIteratorError4 = false; 13000 var _iteratorError4 = undefined; 13001 13002 try { 13003 for (var _iterator4 = infoDict.getKeys()[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) { 13004 var key = _step4.value; 13005 var value = infoDict.get(key); 13006 13007 if (DocumentInfoValidators[key]) { 13008 if (DocumentInfoValidators[key](value)) { 13009 docInfo[key] = typeof value !== 'string' ? value : (0, _util.stringToPDFString)(value); 13010 } else { 13011 (0, _util.info)("Bad value in document info for \"".concat(key, "\".")); 13012 } 13013 } else if (typeof key === 'string') { 13014 var customValue = void 0; 13015 13016 if ((0, _util.isString)(value)) { 13017 customValue = (0, _util.stringToPDFString)(value); 13018 } else if ((0, _primitives.isName)(value) || (0, _util.isNum)(value) || (0, _util.isBool)(value)) { 13019 customValue = value; 13020 } else { 13021 (0, _util.info)("Unsupported value in document info for (custom) \"".concat(key, "\".")); 13022 continue; 13023 } 13024 13025 if (!docInfo['Custom']) { 13026 docInfo['Custom'] = Object.create(null); 13027 } 13028 13029 docInfo['Custom'][key] = customValue; 13030 } 13031 } 13032 } catch (err) { 13033 _didIteratorError4 = true; 13034 _iteratorError4 = err; 13035 } finally { 13036 try { 13037 if (!_iteratorNormalCompletion4 && _iterator4.return != null) { 13038 _iterator4.return(); 13039 } 13040 } finally { 13041 if (_didIteratorError4) { 13042 throw _iteratorError4; 13043 } 13044 } 13045 } 13046 } 13047 13048 return (0, _util.shadow)(this, 'documentInfo', docInfo); 13049 } 13050 }, { 13051 key: "fingerprint", 13052 get: function get() { 13053 var hash; 13054 var idArray = this.xref.trailer.get('ID'); 13055 13056 if (Array.isArray(idArray) && idArray[0] && (0, _util.isString)(idArray[0]) && idArray[0] !== EMPTY_FINGERPRINT) { 13057 hash = (0, _util.stringToBytes)(idArray[0]); 13058 } else { 13059 if (this.stream.ensureRange) { 13060 this.stream.ensureRange(0, Math.min(FINGERPRINT_FIRST_BYTES, this.stream.end)); 13061 } 13062 13063 hash = (0, _crypto.calculateMD5)(this.stream.bytes.subarray(0, FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES); 13064 } 13065 13066 var fingerprint = ''; 13067 13068 for (var i = 0, ii = hash.length; i < ii; i++) { 13069 var hex = hash[i].toString(16); 13070 fingerprint += hex.length === 1 ? '0' + hex : hex; 13071 } 13072 13073 return (0, _util.shadow)(this, 'fingerprint', fingerprint); 13074 } 13075 }]); 13076 13077 return PDFDocument; 13078}(); 13079 13080exports.PDFDocument = PDFDocument; 13081 13082/***/ }), 13083/* 154 */ 13084/***/ (function(module, exports, __w_pdfjs_require__) { 13085 13086"use strict"; 13087 13088 13089Object.defineProperty(exports, "__esModule", { 13090 value: true 13091}); 13092exports.FileSpec = exports.XRef = exports.ObjectLoader = exports.Catalog = void 0; 13093 13094var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2)); 13095 13096var _util = __w_pdfjs_require__(6); 13097 13098var _primitives = __w_pdfjs_require__(155); 13099 13100var _parser = __w_pdfjs_require__(156); 13101 13102var _chunked_stream = __w_pdfjs_require__(152); 13103 13104var _crypto = __w_pdfjs_require__(167); 13105 13106var _colorspace = __w_pdfjs_require__(168); 13107 13108function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 13109 13110function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 13111 13112function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 13113 13114function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o
13114) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 13115 13116function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 13117 13118function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 13119 13120function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } 13121 13122function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } 13123 13124function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } 13125 13126function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } 13127 13128function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } 13129 13130function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 13131 13132function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 13133 13134function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 13135 13136function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 13137 13138function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 13139 13140function fetchDestination(dest) { 13141 return (0, _primitives.isDict)(dest) ? dest.get('D') : dest; 13142} 13143 13144var Catalog = 13145/*#__PURE__*/ 13146function () { 13147 function Catalog(pdfManager, xref) { 13148 _classCallCheck(this, Catalog); 13149 13150 this.pdfManager = pdfManager; 13151 this.xref = xref; 13152 this.catDict = xref.getCatalogObj(); 13153 13154 if (!(0, _primitives.isDict)(this.catDict)) { 13155 throw new _util.FormatError('Catalog object is not a dictionary.'); 13156 } 13157 13158 this.fontCache = new _primitives.RefSetCache(); 13159 this.builtInCMapCache = new Map(); 13160 this.pageKidsCountCache = new _primitives.RefSetCache(); 13161 } 13162 13163 _createClass(Catalog, [{ 13164 key: "_readDocumentOutline", 13165 value: function _readDocumentOutline() { 13166 var obj = this.catDict.get('Outlines'); 13167 13168 if (!(0, _primitives.isDict)(obj)) { 13169 return null; 13170 } 13171 13172 obj = obj.getRaw('First'); 13173 13174 if (!(0, _primitives.isRef)(obj)) { 13175 return null; 13176 } 13177 13178 var root = { 13179 items: [] 13180 }; 13181 var queue = [{ 13182 obj: obj, 13183 parent: root 13184 }]; 13185 var processed = new _primitives.RefSet(); 13186 processed.put(obj); 13187 var xref = this.xref, 13188 blackColor = new Uint8ClampedArray(3); 13189 13190 while (queue.length > 0) { 13191 var i = queue.shift(); 13192 var outlineDict = xref.fetchIfRef(i.obj); 13193 13194 if (outlineDict === null) { 13195 continue; 13196 } 13197 13198 if (!outlineDict.has('Title')) { 13199 throw new _util.FormatError('Invalid outline item encountered.'); 13200 } 13201 13202 var data = { 13203 url: null, 13204 dest: null 13205 }; 13206 Catalog.parseDestDictionary({ 13207 destDict: outlineDict, 13208 resultObj: data, 13209 docBaseUrl: this.pdfManager.docBaseUrl 13210 }); 13211 var title = outlineDict.get('Title'); 13212 var flags = outlineDict.get('F') || 0; 13213 var color = outlineDict.getArray('C'); 13214 var rgbColor = blackColor; 13215 13216 if (Array.isArray(color) && color.length === 3 && (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) { 13217 rgbColor = _colorspace.ColorSpace.singletons.rgb.getRgb(color, 0); 13218 } 13219 13220 var outlineItem = { 13221 dest: data.dest, 13222 url: data.url, 13223 unsafeUrl: data.unsafeUrl, 13224 newWindow: data.newWindow, 13225 title: (0, _util.stringToPDFString)(title), 13226 color: rgbColor, 13227 count: outlineDict.get('Count'), 13228 bold: !!(flags & 2), 13229 italic: !!(flags & 1), 13230 items: [] 13231 }; 13232 i.parent.items.push(outlineItem); 13233 obj = outlineDict.getRaw('First'); 13234 13235 if ((0, _primitives.isRef)(obj) && !processed.has(obj)) { 13236 queue.push({ 13237 obj: obj, 13238 parent: outlineItem 13239 }); 13240 processed.put(obj); 13241 } 13242 13243 obj = outlineDict.getRaw('Next'); 13244 13245 if ((0, _primitives.isRef)(obj) && !processed.has(obj)) { 13246 queue.push({ 13247 obj: obj, 13248 parent: i.parent 13249 }); 13250 processed.put(obj); 13251 } 13252 } 13253 13254 return root.items.length > 0 ? root.items : null; 13255 } 13256 }, { 13257 key: "_readPermissions", 13258 value: function _readPermissions() { 13259 var encrypt = this.xref.trailer.get('Encrypt'); 13260 13261 if (!(0, _primitives.isDict)(encrypt)) { 13262 return null; 13263 } 13264 13265 var flags = encrypt.get('P'); 13266 13267 if (!(0, _util.isNum)(flags)) { 13268 return null; 13269 } 13270 13271 flags += Math.pow(2, 32); 13272 var permissions = []; 13273 13274 for (var key in _util.PermissionFlag) { 13275 var value = _util.PermissionFlag[key]; 13276 13277 if (flags & value) { 13278 permissions.push(value); 13279 } 13280 } 13281 13282 return permissions; 13283 } 13284 }, { 13285 key: "getDestination", 13286 value: function getDestination(destinationId) { 13287 var obj = this._readDests(); 13288 13289 if (obj instanceof NameTree || obj instanceof _primitives.Dict) { 13290 return fetchDestination(obj.get(destinationId) || null); 13291 } 13292 13293 return null; 13294 } 13295 }, { 13296 key: "_readDests", 13297 value: function _readDests() { 13298 var obj = this.catDict.get('Names'); 13299 13300 if (obj && obj.has('Dests')) { 13301 return new NameTree(obj.getRaw('Dests'), this.xref); 13302 } else if (this.catDict.has('Dests')) { 13303 return this.catDict.get('Dests'); 13304 } 13305 } 13306 }, { 13307 key: "_readPageLabels", 13308 value: function _readPageLabels() { 13309 var obj = this.catDict.getRaw('PageLabels'); 13310 13311 if (!obj) { 13312 return null; 13313 } 13314 13315 var pageLabels = new Array(this.numPages); 13316 var style = null, 13317 prefix = '';
13318 var numberTree = new NumberTree(obj, this.xref); 13319 var nums = numberTree.getAll(); 13320 var currentLabel = '', 13321 currentIndex = 1; 13322 13323 for (var i = 0, ii = this.numPages; i < ii; i++) { 13324 if (i in nums) { 13325 var labelDict = nums[i]; 13326 13327 if (!(0, _primitives.isDict)(labelDict)) { 13328 throw new _util.FormatError('PageLabel is not a dictionary.'); 13329 } 13330 13331 if (labelDict.has('Type') && !(0, _primitives.isName)(labelDict.get('Type'), 'PageLabel')) { 13332 throw new _util.FormatError('Invalid type in PageLabel dictionary.'); 13333 } 13334 13335 if (labelDict.has('S')) { 13336 var s = labelDict.get('S'); 13337 13338 if (!(0, _primitives.isName)(s)) { 13339 throw new _util.FormatError('Invalid style in PageLabel dictionary.'); 13340 } 13341 13342 style = s.name; 13343 } else { 13344 style = null; 13345 } 13346 13347 if (labelDict.has('P')) { 13348 var p = labelDict.get('P'); 13349 13350 if (!(0, _util.isString)(p)) { 13351 throw new _util.FormatError('Invalid prefix in PageLabel dictionary.'); 13352 } 13353 13354 prefix = (0, _util.stringToPDFString)(p); 13355 } else { 13356 prefix = ''; 13357 } 13358 13359 if (labelDict.has('St')) { 13360 var st = labelDict.get('St'); 13361 13362 if (!(Number.isInteger(st) && st >= 1)) { 13363 throw new _util.FormatError('Invalid start in PageLabel dictionary.'); 13364 } 13365 13366 currentIndex = st; 13367 } else { 13368 currentIndex = 1; 13369 } 13370 } 13371 13372 switch (style) { 13373 case 'D': 13374 currentLabel = currentIndex; 13375 break; 13376 13377 case 'R': 13378 case 'r': 13379 currentLabel = (0, _util.toRomanNumerals)(currentIndex, style === 'r'); 13380 break; 13381 13382 case 'A': 13383 case 'a': 13384 var LIMIT = 26; 13385 var A_UPPER_CASE = 0x41, 13386 A_LOWER_CASE = 0x61; 13387 var baseCharCode = style === 'a' ? A_LOWER_CASE : A_UPPER_CASE; 13388 var letterIndex = currentIndex - 1; 13389 var character = String.fromCharCode(baseCharCode + letterIndex % LIMIT); 13390 var charBuf = []; 13391 13392 for (var j = 0, jj = letterIndex / LIMIT | 0; j <= jj; j++) { 13393 charBuf.push(character); 13394 } 13395 13396 currentLabel = charBuf.join(''); 13397 break; 13398 13399 default: 13400 if (style) { 13401 throw new _util.FormatError("Invalid style \"".concat(style, "\" in PageLabel dictionary.")); 13402 } 13403 13404 currentLabel = ''; 13405 } 13406 13407 pageLabels[i] = prefix + currentLabel; 13408 currentIndex++; 13409 } 13410 13411 return pageLabels; 13412 } 13413 }, { 13414 key: "fontFallback", 13415 value: function fontFallback(id, handler) { 13416 var promises = []; 13417 this.fontCache.forEach(function (promise) { 13418 promises.push(promise); 13419 }); 13420 return Promise.all(promises).then(function (translatedFonts) { 13421 var _iteratorNormalCompletion = true; 13422 var _didIteratorError = false; 13423 var _iteratorError = undefined; 13424 13425 try { 13426 for (var _iterator = translatedFonts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { 13427 var translatedFont = _step.value; 13428 13429 if (translatedFont.loadedName === id) { 13430 translatedFont.fallback(handler); 13431 return; 13432 } 13433 } 13434 } catch (err) { 13435 _didIteratorError = true; 13436 _iteratorError = err; 13437 } finally { 13438 try { 13439 if (!_iteratorNormalCompletion && _iterator.return != null) { 13440 _iterator.return(); 13441 } 13442 } finally { 13443 if (_didIteratorError) { 13444 throw _iteratorError; 13445 } 13446 } 13447 } 13448 }); 13449 } 13450 }, { 13451 key: "cleanup", 13452 value: function cleanup() { 13453 var _this = this; 13454 13455 this.pageKidsCountCache.clear(); 13456 var promises = []; 13457 this.fontCache.forEach(function (promise) { 13458 promises.push(promise); 13459 }); 13460 return Promise.all(promises).then(function (translatedFonts) { 13461 for (var i = 0, ii = translatedFonts.length; i < ii; i++) { 13462 var font = translatedFonts[i].dict; 13463 delete font.translated; 13464 } 13465 13466 _this.fontCache.clear(); 13467 13468 _this.builtInCMapCache.clear(); 13469 }); 13470 } 13471 }, { 13472 key: "getPageDict", 13473 value: function getPageDict(pageIndex) { 13474 var capability = (0, _util.createPromiseCapability)(); 13475 var nodesToVisit = [this.catDict.getRaw('Pages')]; 13476 var xref = this.xref, 13477 pageKidsCountCache = this.pageKidsCountCache; 13478 var count, 13479 currentPageIndex = 0; 13480 13481 function next() { 13482 var _loop = function _loop() { 13483 var currentNode = nodesToVisit.pop();
13484 13485 if ((0, _primitives.isRef)(currentNode)) { 13486 count = pageKidsCountCache.get(currentNode); 13487 13488 if (count > 0 && currentPageIndex + count < pageIndex) { 13489 currentPageIndex += count; 13490 return "continue"; 13491 } 13492 13493 xref.fetchAsync(currentNode).then(function (obj) { 13494 if ((0, _primitives.isDict)(obj, 'Page') || (0, _primitives.isDict)(obj) && !obj.has('Kids')) { 13495 if (pageIndex === currentPageIndex) { 13496 if (currentNode && !pageKidsCountCache.has(currentNode)) { 13497 pageKidsCountCache.put(currentNode, 1); 13498 } 13499 13500 capability.resolve([obj, currentNode]); 13501 } else { 13502 currentPageIndex++; 13503 next(); 13504 } 13505 13506 return; 13507 } 13508 13509 nodesToVisit.push(obj); 13510 next(); 13511 }, capability.reject); 13512 return { 13513 v: void 0 13514 }; 13515 } 13516 13517 if (!(0, _primitives.isDict)(currentNode)) { 13518 capability.reject(new _util.FormatError('Page dictionary kid reference points to wrong type of object.')); 13519 return { 13520 v: void 0 13521 }; 13522 } 13523 13524 count = currentNode.get('Count'); 13525 13526 if (Number.isInteger(count) && count >= 0) { 13527 var objId = currentNode.objId; 13528 13529 if (objId && !pageKidsCountCache.has(objId)) { 13530 pageKidsCountCache.put(objId, count); 13531 } 13532 13533 if (currentPageIndex + count <= pageIndex) { 13534 currentPageIndex += count; 13535 return "continue"; 13536 } 13537 } 13538 13539 var kids = currentNode.get('Kids'); 13540 13541 if (!Array.isArray(kids)) { 13542 if ((0, _primitives.isName)(currentNode.get('Type'), 'Page') || !currentNode.has('Type') && currentNode.has('Contents')) { 13543 if (currentPageIndex === pageIndex) { 13544 capability.resolve([currentNode, null]); 13545 return { 13546 v: void 0 13547 }; 13548 } 13549 13550 currentPageIndex++; 13551 return "continue"; 13552 } 13553 13554 capability.reject(new _util.FormatError('Page dictionary kids object is not an array.')); 13555 return { 13556 v: void 0 13557 }; 13558 } 13559 13560 for (var last = kids.length - 1; last >= 0; last--) { 13561 nodesToVisit.push(kids[last]); 13562 } 13563 }; 13564 13565 while (nodesToVisit.length) { 13566 var _ret = _loop(); 13567 13568 switch (_ret) { 13569 case "continue": 13570 continue; 13571 13572 default: 13573 if (_typeof(_ret) === "object") return _ret.v; 13574 } 13575 } 13576 13577 capability.reject(new Error("Page index ".concat(pageIndex, " not found."))); 13578 } 13579 13580 next(); 13581 return capability.promise; 13582 } 13583 }, { 13584 key: "getPageIndex", 13585 value: function getPageIndex(pageRef) { 13586 var xref = this.xref; 13587 13588 function pagesBeforeRef(kidRef) { 13589 var total = 0, 13590 parentRef; 13591 return xref.fetchAsync(kidRef).then(function (node) { 13592 if ((0, _primitives.isRefsEqual)(kidRef, pageRef) && !(0, _primitives.isDict)(node, 'Page') && !((0, _primitives.isDict)(node) && !node.has('Type') && node.has('Contents'))) { 13593 throw new _util.FormatError('The reference does not point to a /Page dictionary.'); 13594 } 13595 13596 if (!node) { 13597 return null; 13598 } 13599 13600 if (!(0, _primitives.isDict)(node)) { 13601 throw new _util.FormatError('Node must be a dictionary.'); 13602 } 13603 13604 parentRef = node.getRaw('Parent'); 13605 return node.getAsync('Parent'); 13606 }).then(function (parent) { 13607 if (!parent) { 13608 return null; 13609 } 13610 13611 if (!(0, _primitives.isDict)(parent)) { 13612 throw new _util.FormatError('Parent must be a dictionary.'); 13613 } 13614 13615 return parent.getAsync('Kids'); 13616 }).then(function (kids) { 13617 if (!kids) { 13618 return null; 13619 } 13620 13621 var kidPromises = []; 13622 var found = false; 13623 13624 for (var i = 0, ii = kids.length; i < ii; i++) { 13625 var kid = kids[i]; 13626 13627 if (!(0, _primitives.isRef)(kid)) { 13628 throw new _util.FormatError('Kid must be a reference.'); 13629 } 13630 13631 if ((0, _primitives.isRefsEqual)(kid, kidRef)) { 13632 found = true; 13633 break; 13634 } 13635 13636 kidPromises.push(xref.fetchAsync(kid).then(function (kid) { 13637 if (!(0, _primitives.isDict)(kid)) { 13638 throw new _util.FormatError('Kid node must be a dictionary.'); 13639 } 13640 13641 if (kid.has('Count')) { 13642 total += kid.get('Count'); 13643 } else { 13644 total++; 13645 } 13646 })); 13647 } 13648 13649 if (!found) { 13650 throw new _util.FormatError('Kid reference not found in parent\'s kids.'); 13651 } 13652 13653 return Promise.all(kidPromises).then(function () { 13654 return [total, parentRef]; 13655 }); 13656 }); 13657 } 13658 13659 var total = 0; 13660 13661 function next(ref) { 13662 return pagesBeforeRef(ref).then(function (args) { 13663 if (!args) { 13664 return total; 13665 } 13666 13667 var _args = _slicedToArray(args, 2), 13668 count = _args[0], 13669 parentRef = _args[1]; 13670 13671 total += count; 13672 return next(parentRef); 13673 }); 13674 } 13675 13676 return next(pageRef); 13677 } 13678 }, { 13679 key: "metadata", 13680 get: function get() { 13681 var streamRef = this.catDict.getRaw('Metadata'); 13682 13683 if (!(0, _primitives.isRef)(streamRef)) { 13684 return (0, _util.shadow)(this, 'metadata', null); 13685 } 13686 13687 var suppressEncryption = !(this.xref.encrypt && this.xref.encrypt.encryptMetadata); 13688 var stream = this.xref.fetch(streamRef, suppressEncryption); 13689 var metadata; 13690 13691 if (stream && (0, _primitives.isDict)(stream.dict)) { 13692 var type = stream.dict.get('Type'); 13693 var subtype = stream.dict.get('Subtype'); 13694 13695 if ((0, _primitives.isName)(type, 'Metadata') && (0, _primitives.isName)(subtype, 'XML')) { 13696 try { 13697 metadata = (0, _util.stringToUTF8String)((0, _util.bytesToString)(stream.getBytes())); 13698 } catch (e) { 13699 if (e instanceof _util.MissingDataException) { 13700 throw e; 13701 } 13702 13703 (0, _util.info)('Skipping invalid metadata.'); 13704 } 13705 } 13706 } 13707 13708 return (0, _util.shadow)(this, 'metadata', metadata); 13709 } 13710 }, { 13711 key: "toplevelPagesDict", 13712 get: function get() { 13713 var pagesObj = this.catDict.get('Pages'); 13714 13715 if (!(0, _primitives.isDict)(pagesObj)) { 13716 throw new _util.FormatError('Invalid top-level pages dictionary.'); 13717 } 13718 13719 return (0, _util.shadow)(this, 'toplevelPagesDict', pagesObj); 13720 } 13721 }, { 13722 key: "documentOutline", 13723 get: function get() { 13724 var obj = null; 13725
13726 try { 13727 obj = this._readDocumentOutline(); 13728 } catch (ex) { 13729 if (ex instanceof _util.MissingDataException) { 13730 throw ex; 13731 } 13732 13733 (0, _util.warn)('Unable to read document outline.'); 13734 } 13735 13736 return (0, _util.shadow)(this, 'documentOutline', obj); 13737 } 13738 }, { 13739 key: "permissions", 13740 get: function get() { 13741 var permissions = null; 13742 13743 try { 13744 permissions = this._readPermissions(); 13745 } catch (ex) { 13746 if (ex instanceof _util.MissingDataException) { 13747 throw ex; 13748 } 13749 13750 (0, _util.warn)('Unable to read permissions.'); 13751 } 13752 13753 return (0, _util.shadow)(this, 'permissions', permissions); 13754 } 13755 }, { 13756 key: "numPages", 13757 get: function get() { 13758 var obj = this.toplevelPagesDict.get('Count'); 13759 13760 if (!Number.isInteger(obj)) { 13761 throw new _util.FormatError('Page count in top-level pages dictionary is not an integer.'); 13762 } 13763 13764 return (0, _util.shadow)(this, 'numPages', obj); 13765 } 13766 }, { 13767 key: "destinations", 13768 get: function get() { 13769 var obj = this._readDests(), 13770 dests = Object.create(null); 13771 13772 if (obj instanceof NameTree) { 13773 var names = obj.getAll(); 13774 13775 for (var name in names) { 13776 dests[name] = fetchDestination(names[name]); 13777 } 13778 } else if (obj instanceof _primitives.Dict) { 13779 obj.forEach(function (key, value) { 13780 if (value) { 13781 dests[key] = fetchDestination(value); 13782 } 13783 }); 13784 } 13785 13786 return (0, _util.shadow)(this, 'destinations', dests); 13787 } 13788 }, { 13789 key: "pageLabels", 13790 get: function get() { 13791 var obj = null; 13792 13793 try { 13794 obj = this._readPageLabels(); 13795 } catch (ex) { 13796 if (ex instanceof _util.MissingDataException) { 13797 throw ex; 13798 } 13799 13800 (0, _util.warn)('Unable to read page labels.'); 13801 } 13802 13803 return (0, _util.shadow)(this, 'pageLabels', obj); 13804 } 13805 }, { 13806 key: "pageMode", 13807 get: function get() { 13808 var obj = this.catDict.get('PageMode'); 13809 var pageMode = 'UseNone'; 13810 13811 if ((0, _primitives.isName)(obj)) { 13812 switch (obj.name) { 13813 case 'UseNone': 13814 case 'UseOutlines': 13815 case 'UseThumbs': 13816 case 'FullScreen': 13817 case 'UseOC': 13818 case 'UseAttachments': 13819 pageMode = obj.name; 13820 } 13821 } 13822 13823 return (0, _util.shadow)(this, 'pageMode', pageMode); 13824 } 13825 }, { 13826 key: "openActionDestination", 13827 get: function get() { 13828 var obj = this.catDict.get('OpenAction'); 13829 var openActionDest = null; 13830 13831 if ((0, _primitives.isDict)(obj)) { 13832 var destDict = new _primitives.Dict(this.xref); 13833 destDict.set('A', obj); 13834 var resultObj = { 13835 url: null, 13836 dest: null 13837 }; 13838 Catalog.parseDestDictionary({ 13839 destDict: destDict, 13840 resultObj: resultObj 13841 }); 13842 13843 if (Array.isArray(resultObj.dest)) { 13844 openActionDest = resultObj.dest; 13845 } 13846 } else if (Array.isArray(obj)) { 13847 openActionDest = obj; 13848 } 13849 13850 return (0, _util.shadow)(this, 'openActionDestination', openActionDest); 13851 } 13852 }, { 13853 key: "attachments", 13854 get: function get() { 13855 var obj = this.catDict.get('Names'); 13856 var attachments = null; 13857 13858 if (obj && obj.has('EmbeddedFiles')) { 13859 var nameTree = new NameTree(obj.getRaw('EmbeddedFiles'), this.xref); 13860 var names = nameTree.getAll(); 13861 13862 for (var name in names) { 13863 var fs = new FileSpec(names[name], this.xref); 13864 13865 if (!attachments) { 13866 attachments = Object.create(null); 13867 } 13868 13869 attachments[(0, _util.stringToPDFString)(name)] = fs.serializable; 13870 } 13871 } 13872 13873 return (0, _util.shadow)(this, 'attachments', attachments); 13874 } 13875 }, { 13876 key: "javaScript", 13877 get: function get() { 13878 var obj = this.catDict.get('Names'); 13879 var javaScript = null; 13880 13881 function appendIfJavaScriptDict(jsDict) { 13882 var type = jsDict.get('S'); 13883 13884 if (!(0, _primitives.isName)(type, 'JavaScript')) { 13885 return; 13886 } 13887 13888 var js = jsDict.get('JS'); 13889 13890 if ((0, _primitives.isStream)(js)) { 13891 js = (0, _util.bytesToString)(js.getBytes()); 13892 } else if (!(0, _util.isString)(js)) { 13893 return; 13894 } 13895 13896 if (!javaScript) { 13897 javaScript = []; 13898 } 13899 13900 javaScript.push((0, _util.stringToPDFString)(js)); 13901 } 13902 13903 if (obj && obj.has('JavaScript')) {
13904 var nameTree = new NameTree(obj.getRaw('JavaScript'), this.xref); 13905 var names = nameTree.getAll(); 13906 13907 for (var name in names) { 13908 var jsDict = names[name]; 13909 13910 if ((0, _primitives.isDict)(jsDict)) { 13911 appendIfJavaScriptDict(jsDict); 13912 } 13913 } 13914 } 13915 13916 var openActionDict = this.catDict.get('OpenAction'); 13917 13918 if ((0, _primitives.isDict)(openActionDict, 'Action')) { 13919 var actionType = openActionDict.get('S'); 13920 13921 if ((0, _primitives.isName)(actionType, 'Named')) { 13922 var action = openActionDict.get('N'); 13923 13924 if ((0, _primitives.isName)(action, 'Print')) { 13925 if (!javaScript) { 13926 javaScript = []; 13927 } 13928 13929 javaScript.push('print({});'); 13930 } 13931 } else { 13932 appendIfJavaScriptDict(openActionDict); 13933 } 13934 } 13935 13936 return (0, _util.shadow)(this, 'javaScript', javaScript); 13937 } 13938 }], [{ 13939 key: "parseDestDictionary", 13940 value: function parseDestDictionary(params) { 13941 function addDefaultProtocolToUrl(url) { 13942 return url.startsWith('www.') ? "http://".concat(url) : url; 13943 } 13944 13945 function tryConvertUrlEncoding(url) { 13946 try { 13947 return (0, _util.stringToUTF8String)(url); 13948 } catch (e) { 13949 return url; 13950 } 13951 } 13952 13953 var destDict = params.destDict; 13954 13955 if (!(0, _primitives.isDict)(destDict)) { 13956 (0, _util.warn)('parseDestDictionary: `destDict` must be a dictionary.'); 13957 return; 13958 } 13959 13960 var resultObj = params.resultObj; 13961 13962 if (_typeof(resultObj) !== 'object') { 13963 (0, _util.warn)('parseDestDictionary: `resultObj` must be an object.'); 13964 return; 13965 } 13966 13967 var docBaseUrl = params.docBaseUrl || null; 13968 var action = destDict.get('A'), 13969 url, 13970 dest; 13971 13972 if (!(0, _primitives.isDict)(action) && destDict.has('Dest')) { 13973 action = destDict.get('Dest'); 13974 } 13975 13976 if ((0, _primitives.isDict)(action)) { 13977 var actionType = action.get('S'); 13978 13979 if (!(0, _primitives.isName)(actionType)) { 13980 (0, _util.warn)('parseDestDictionary: Invalid type in Action dictionary.'); 13981 return; 13982 } 13983 13984 var actionName = actionType.name; 13985 13986 switch (actionName) { 13987 case 'URI': 13988 url = action.get('URI'); 13989 13990 if ((0, _primitives.isName)(url)) { 13991 url = '/' + url.name; 13992 } else if ((0, _util.isString)(url)) { 13993 url = addDefaultProtocolToUrl(url); 13994 } 13995 13996 break; 13997 13998 case 'GoTo': 13999 dest = action.get('D'); 14000 break; 14001 14002 case 'Launch': 14003 case 'GoToR': 14004 var urlDict = action.get('F'); 14005 14006 if ((0, _primitives.isDict)(urlDict)) { 14007 url = urlDict.get('F') || null; 14008 } else if ((0, _util.isString)(urlDict)) { 14009 url = urlDict; 14010 } 14011 14012 var remoteDest = action.get('D'); 14013 14014 if (remoteDest) { 14015 if ((0, _primitives.isName)(remoteDest)) { 14016 remoteDest = remoteDest.name; 14017 } 14018 14019 if ((0, _util.isString)(url)) { 14020 var baseUrl = url.split('#')[0]; 14021 14022 if ((0, _util.isString)(remoteDest)) { 14023 url = baseUrl + '#' + remoteDest; 14024 } else if (Array.isArray(remoteDest)) { 14025 url = baseUrl + '#' + JSON.stringify(remoteDest); 14026 } 14027 } 14028 } 14029 14030 var newWindow = action.get('NewWindow'); 14031 14032 if ((0, _util.isBool)(newWindow)) { 14033 resultObj.newWindow = newWindow; 14034 } 14035 14036 break; 14037 14038 case 'Named': 14039 var namedAction = action.get('N'); 14040 14041 if ((0, _primitives.isName)(namedAction)) { 14042 resultObj.action = namedAction.name; 14043 } 14044 14045 break; 14046 14047 case 'JavaScript': 14048 var jsAction = action.get('JS'); 14049 var js; 14050 14051 if ((0, _primitives.isStream)(jsAction)) { 14052 js = (0, _util.bytesToString)(jsAction.getBytes()); 14053 } else if ((0, _util.isString)(jsAction)) { 14054 js = jsAction; 14055 } 14056 14057 if (js) { 14058 var URL_OPEN_METHODS = ['app.launchURL', 'window.open']; 14059 var regex = new RegExp('^\\s*(' + URL_OPEN_METHODS.join('|').split('.').join('\\.') + ')\\((?:\'|\")([^\'\"]*)(?:\'|\")(?:,\\s*(\\w+)\\)|\\))', 'i'); 14060 var jsUrl = regex.exec((0, _util.stringToPDFString)(js)); 14061 14062 if (jsUrl && jsUrl[2]) { 14063 url = jsUrl[2]; 14064 14065 if (jsUrl[3] === 'true' && jsUrl[1] === 'app.launchURL') { 14066 resultObj.newWindow = true; 14067 } 14068 14069 break; 14070 } 14071 } 14072 14073 default: 14074 (0, _util.warn)("parseDestDictionary: unsupported action type \"".concat(actionName, "\".")); 14075 break; 14076 } 14077 } else if (destDict.has('Dest')) { 14078 dest = destDict.get('Dest'); 14079 } 14080 14081 if ((0, _util.isString)(url)) { 14082 url = tryConvertUrlEncoding(url); 14083 var absoluteUrl = (0, _util.createValidAbsoluteUrl)(url, docBaseUrl); 14084 14085 if (absoluteUrl) { 14086 resultObj.url = absoluteUrl.href; 14087 } 14088 14089 resultObj.unsafeUrl = url; 14090 } 14091 14092 if (dest) { 14093 if ((0, _primitives.isName)(dest)) { 14094 dest = dest.name; 14095 } 14096 14097 if ((0, _util.isString)(dest) || Array.isArray(dest)) { 14098 resultObj.dest = dest; 14099 } 14100 } 14101 } 14102 }]); 14103 14104 return Catalog; 14105}();
14106 14107exports.Catalog = Catalog; 14108 14109var XRef = function XRefClosure() { 14110 function XRef(stream, pdfManager) { 14111 this.stream = stream; 14112 this.pdfManager = pdfManager; 14113 this.entries = []; 14114 this.xrefstms = Object.create(null); 14115 this.cache = []; 14116 this.stats = { 14117 streamTypes: [], 14118 fontTypes: [] 14119 }; 14120 } 14121 14122 XRef.prototype = { 14123 setStartXRef: function XRef_setStartXRef(startXRef) { 14124 this.startXRefQueue = [startXRef]; 14125 }, 14126 parse: function XRef_parse(recoveryMode) { 14127 var trailerDict; 14128 14129 if (!recoveryMode) { 14130 trailerDict = this.readXRef(); 14131 } else { 14132 (0, _util.warn)('Indexing all PDF objects'); 14133 trailerDict = this.indexObjects(); 14134 } 14135 14136 trailerDict.assignXref(this); 14137 this.trailer = trailerDict; 14138 var encrypt; 14139 14140 try { 14141 encrypt = trailerDict.get('Encrypt'); 14142 } catch (ex) { 14143 if (ex instanceof _util.MissingDataException) { 14144 throw ex; 14145 } 14146 14147 (0, _util.warn)("XRef.parse - Invalid \"Encrypt\" reference: \"".concat(ex, "\".")); 14148 } 14149 14150 if ((0, _primitives.isDict)(encrypt)) { 14151 var ids = trailerDict.get('ID'); 14152 var fileId = ids && ids.length ? ids[0] : ''; 14153 encrypt.suppressEncryption = true; 14154 this.encrypt = new _crypto.CipherTransformFactory(encrypt, fileId, this.pdfManager.password); 14155 } 14156 14157 var root; 14158 14159 try { 14160 root = trailerDict.get('Root'); 14161 } catch (ex) { 14162 if (ex instanceof _util.MissingDataException) { 14163 throw ex; 14164 } 14165 14166 (0, _util.warn)("XRef.parse - Invalid \"Root\" reference: \"".concat(ex, "\".")); 14167 } 14168 14169 if ((0, _primitives.isDict)(root) && root.has('Pages')) { 14170 this.root = root; 14171 } else { 14172 if (!recoveryMode) { 14173 throw new _util.XRefParseException(); 14174 } 14175 14176 throw new _util.FormatError('Invalid root reference'); 14177 } 14178 }, 14179 processXRefTable: function XRef_processXRefTable(parser) { 14180 if (!('tableState' in this)) { 14181 this.tableState = { 14182 entryNum: 0, 14183 streamPos: parser.lexer.stream.pos, 14184 parserBuf1: parser.buf1, 14185 parserBuf2: parser.buf2 14186 }; 14187 } 14188 14189 var obj = this.readXRefTable(parser); 14190 14191 if (!(0, _primitives.isCmd)(obj, 'trailer')) { 14192 throw new _util.FormatError('Invalid XRef table: could not find trailer dictionary'); 14193 } 14194 14195 var dict = parser.getObj(); 14196 14197 if (!(0, _primitives.isDict)(dict) && dict.dict) { 14198 dict = dict.dict; 14199 } 14200 14201 if (!(0, _primitives.isDict)(dict)) { 14202 throw new _util.FormatError('Invalid XRef table: could not parse trailer dictionary'); 14203 } 14204 14205 delete this.tableState; 14206 return dict; 14207 }, 14208 readXRefTable: function XRef_readXRefTable(parser) { 14209 var stream = parser.lexer.stream; 14210 var tableState = this.tableState; 14211 stream.pos = tableState.streamPos; 14212 parser.buf1 = tableState.parserBuf1; 14213 parser.buf2 = tableState.parserBuf2; 14214 var obj; 14215 14216 while (true) { 14217 if (!('firstEntryNum' in tableState) || !('entryCount' in tableState)) { 14218 if ((0, _primitives.isCmd)(obj = parser.getObj(), 'trailer')) { 14219 break; 14220 } 14221 14222 tableState.firstEntryNum = obj; 14223 tableState.entryCount = parser.getObj(); 14224 } 14225 14226 var first = tableState.firstEntryNum; 14227 var count = tableState.entryCount; 14228 14229 if (!Number.isInteger(first) || !Number.isInteger(count)) { 14230 throw new _util.FormatError('Invalid XRef table: wrong types in subsection header'); 14231 } 14232 14233 for (var i = tableState.entryNum; i < count; i++) { 14234 tableState.streamPos = stream.pos; 14235 tableState.entryNum = i; 14236 tableState.parserBuf1 = parser.buf1; 14237 tableState.parserBuf2 = parser.buf2; 14238 var entry = {}; 14239 entry.offset = parser.getObj(); 14240 entry.gen = parser.getObj(); 14241 var type = parser.getObj(); 14242 14243 if ((0, _primitives.isCmd)(type, 'f')) { 14244 entry.free = true; 14245 } else if ((0, _primitives.isCmd)(type, 'n')) { 14246 entry.uncompressed = true; 14247 } 14248 14249 if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) { 14250 throw new _util.FormatError("Invalid entry in XRef subsection: ".concat(first, ", ").concat(count)); 14251 } 14252 14253 if (i === 0 && entry.free && first === 1) { 14254 first = 0; 14255 } 14256 14257 if (!this.entries[i + first]) { 14258 this.entries[i + first] = entry; 14259 } 14260 } 14261 14262 tableState.entryNum = 0; 14263 tableState.streamPos = stream.pos; 14264 tableState.parserBuf1 = parser.buf1; 14265 tableState.parserBuf2 = parser.buf2; 14266 delete tableState.firstEntryNum; 14267 delete tableState.entryCount; 14268 } 14269 14270 if (this.entries[0] && !this.entries[0].free) { 14271 throw new _util.FormatError('Invalid XRef table: unexpected first object'); 14272 } 14273 14274 return obj;
14275 }, 14276 processXRefStream: function XRef_processXRefStream(stream) { 14277 if (!('streamState' in this)) { 14278 var streamParameters = stream.dict; 14279 var byteWidths = streamParameters.get('W'); 14280 var range = streamParameters.get('Index'); 14281 14282 if (!range) { 14283 range = [0, streamParameters.get('Size')]; 14284 } 14285 14286 this.streamState = { 14287 entryRanges: range, 14288 byteWidths: byteWidths, 14289 entryNum: 0, 14290 streamPos: stream.pos 14291 }; 14292 } 14293 14294 this.readXRefStream(stream); 14295 delete this.streamState; 14296 return stream.dict; 14297 }, 14298 readXRefStream: function XRef_readXRefStream(stream) { 14299 var i, j; 14300 var streamState = this.streamState; 14301 stream.pos = streamState.streamPos; 14302 var byteWidths = streamState.byteWidths; 14303 var typeFieldWidth = byteWidths[0]; 14304 var offsetFieldWidth = byteWidths[1]; 14305 var generationFieldWidth = byteWidths[2]; 14306 var entryRanges = streamState.entryRanges; 14307 14308 while (entryRanges.length > 0) { 14309 var first = entryRanges[0]; 14310 var n = entryRanges[1]; 14311 14312 if (!Number.isInteger(first) || !Number.isInteger(n)) { 14313 throw new _util.FormatError("Invalid XRef range fields: ".concat(first, ", ").concat(n)); 14314 } 14315 14316 if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) { 14317 throw new _util.FormatError("Invalid XRef entry fields length: ".concat(first, ", ").concat(n)); 14318 } 14319 14320 for (i = streamState.entryNum; i < n; ++i) { 14321 streamState.entryNum = i; 14322 streamState.streamPos = stream.pos; 14323 var type = 0, 14324 offset = 0, 14325 generation = 0; 14326 14327 for (j = 0; j < typeFieldWidth; ++j) { 14328 type = type << 8 | stream.getByte(); 14329 } 14330 14331 if (typeFieldWidth === 0) { 14332 type = 1; 14333 } 14334 14335 for (j = 0; j < offsetFieldWidth; ++j) { 14336 offset = offset << 8 | stream.getByte(); 14337 } 14338 14339 for (j = 0; j < generationFieldWidth; ++j) { 14340 generation = generation << 8 | stream.getByte(); 14341 } 14342 14343 var entry = {}; 14344 entry.offset = offset; 14345 entry.gen = generation; 14346 14347 switch (type) { 14348 case 0: 14349 entry.free = true; 14350 break; 14351 14352 case 1: 14353 entry.uncompressed = true; 14354 break; 14355 14356 case 2: 14357 break; 14358 14359 default: 14360 throw new _util.FormatError("Invalid XRef entry type: ".concat(type)); 14361 } 14362 14363 if (!this.entries[first + i]) { 14364 this.entries[first + i] = entry; 14365 } 14366 } 14367 14368 streamState.entryNum = 0; 14369 streamState.streamPos = stream.pos; 14370 entryRanges.splice(0, 2); 14371 } 14372 }, 14373 indexObjects: function XRef_indexObjects() { 14374 var TAB = 0x9, 14375 LF = 0xA, 14376 CR = 0xD, 14377 SPACE = 0x20; 14378 var PERCENT = 0x25, 14379 LT = 0x3C; 14380 14381 function readToken(data, offset) { 14382 var token = '', 14383 ch = data[offset]; 14384 14385 while (ch !== LF && ch !== CR && ch !== LT) { 14386 if (++offset >= data.length) { 14387 break; 14388 } 14389 14390 token += String.fromCharCode(ch); 14391 ch = data[offset]; 14392 } 14393 14394 return token; 14395 } 14396 14397 function skipUntil(data, offset, what) { 14398 var length = what.length, 14399 dataLength = data.length; 14400 var skipped = 0; 14401 14402 while (offset < dataLength) { 14403 var i = 0; 14404 14405 while (i < length && data[offset + i] === what[i]) { 14406 ++i; 14407 } 14408 14409 if (i >= length) { 14410 break; 14411 } 14412 14413 offset++; 14414 skipped++; 14415 } 14416 14417 return skipped; 14418 } 14419 14420 var objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; 14421 var endobjRegExp = /\bendobj[\b\s]$/; 14422 var nestedObjRegExp = /\s+(\d+\s+\d+\s+obj[\b\s<])$/; 14423 var CHECK_CONTENT_LENGTH = 25; 14424 var trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]); 14425 var startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]);
14426 var objBytes = new Uint8Array([111, 98, 106]); 14427 var xrefBytes = new Uint8Array([47, 88, 82, 101, 102]); 14428 this.entries.length = 0; 14429 var stream = this.stream; 14430 stream.pos = 0; 14431 var buffer = stream.getBytes(); 14432 var position = stream.start, 14433 length = buffer.length; 14434 var trailers = [], 14435 xrefStms = []; 14436 14437 while (position < length) { 14438 var ch = buffer[position]; 14439 14440 if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { 14441 ++position; 14442 continue; 14443 } 14444 14445 if (ch === PERCENT) { 14446 do { 14447 ++position; 14448 14449 if (position >= length) { 14450 break; 14451 } 14452 14453 ch = buffer[position]; 14454 } while (ch !== LF && ch !== CR); 14455 14456 continue; 14457 } 14458 14459 var token = readToken(buffer, position); 14460 var m; 14461 14462 if (token.startsWith('xref') && (token.length === 4 || /\s/.test(token[4]))) { 14463 position += skipUntil(buffer, position, trailerBytes); 14464 trailers.push(position); 14465 position += skipUntil(buffer, position, startxrefBytes); 14466 } else if (m = objRegExp.exec(token)) { 14467 var num = m[1] | 0, 14468 gen = m[2] | 0; 14469 14470 if (typeof this.entries[num] === 'undefined') { 14471 this.entries[num] = { 14472 offset: position - stream.start, 14473 gen: gen, 14474 uncompressed: true 14475 }; 14476 } 14477 14478 var contentLength = void 0, 14479 startPos = position + token.length; 14480 14481 while (startPos < buffer.length) { 14482 var endPos = startPos + skipUntil(buffer, startPos, objBytes) + 4; 14483 contentLength = endPos - position; 14484 var checkPos = Math.max(endPos - CHECK_CONTENT_LENGTH, startPos); 14485 var tokenStr = (0, _util.bytesToString)(buffer.subarray(checkPos, endPos)); 14486 14487 if (endobjRegExp.test(tokenStr)) { 14488 break; 14489 } else { 14490 var objToken = nestedObjRegExp.exec(tokenStr); 14491 14492 if (objToken && objToken[1]) { 14493 (0, _util.warn)('indexObjects: Found new "obj" inside of another "obj", ' + 'caused by missing "endobj" -- trying to recover.'); 14494 contentLength -= objToken[1].length; 14495 break; 14496 } 14497 } 14498 14499 startPos = endPos; 14500 } 14501 14502 var content = buffer.subarray(position, position + contentLength); 14503 var xrefTagOffset = skipUntil(content, 0, xrefBytes); 14504 14505 if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) { 14506 xrefStms.push(position - stream.start); 14507 this.xrefstms[position - stream.start] = 1; 14508 } 14509 14510 position += contentLength; 14511 } else if (token.startsWith('trailer') && (token.length === 7 || /\s/.test(token[7]))) { 14512 trailers.push(position); 14513 position += skipUntil(buffer, position, startxrefBytes); 14514 } else { 14515 position += token.length + 1; 14516 } 14517 } 14518 14519 var i, ii; 14520 14521 for (i = 0, ii = xrefStms.length; i < ii; ++i) { 14522 this.startXRefQueue.push(xrefStms[i]); 14523 this.readXRef(true); 14524 } 14525 14526 var trailerDict; 14527 14528 for (i = 0, ii = trailers.length; i < ii; ++i) { 14529 stream.pos = trailers[i]; 14530 var parser = new _parser.Parser(new _parser.Lexer(stream), true, this, true); 14531 var obj = parser.getObj(); 14532 14533 if (!(0, _primitives.isCmd)(obj, 'trailer')) { 14534 continue; 14535 } 14536 14537 var dict = parser.getObj(); 14538 14539 if (!(0, _primitives.isDict)(dict)) { 14540 continue; 14541 } 14542 14543 var rootDict = void 0; 14544 14545 try { 14546 rootDict = dict.get('Root'); 14547 } catch (ex) { 14548 if (ex instanceof _util.MissingDataException) { 14549 throw ex; 14550 } 14551 14552 continue; 14553 } 14554 14555 if (!(0, _primitives.isDict)(rootDict) || !rootDict.has('Pages')) { 14556 continue; 14557 } 14558 14559 if (dict.has('ID')) { 14560 return dict; 14561 } 14562 14563 trailerDict = dict; 14564 } 14565 14566 if (trailerDict) { 14567 return trailerDict; 14568 } 14569 14570 throw new _util.InvalidPDFException('Invalid PDF structure'); 14571 }, 14572 readXRef: function XRef_readXRef(recoveryMode) { 14573 var stream = this.stream; 14574 var startXRefParsedCache = Object.create(null); 14575
14576 try { 14577 while (this.startXRefQueue.length) { 14578 var startXRef = this.startXRefQueue[0]; 14579 14580 if (startXRefParsedCache[startXRef]) { 14581 (0, _util.warn)('readXRef - skipping XRef table since it was already parsed.'); 14582 this.startXRefQueue.shift(); 14583 continue; 14584 } 14585 14586 startXRefParsedCache[startXRef] = true; 14587 stream.pos = startXRef + stream.start; 14588 var parser = new _parser.Parser(new _parser.Lexer(stream), true, this); 14589 var obj = parser.getObj(); 14590 var dict; 14591 14592 if ((0, _primitives.isCmd)(obj, 'xref')) { 14593 dict = this.processXRefTable(parser); 14594 14595 if (!this.topDict) { 14596 this.topDict = dict; 14597 } 14598 14599 obj = dict.get('XRefStm'); 14600 14601 if (Number.isInteger(obj)) { 14602 var pos = obj; 14603 14604 if (!(pos in this.xrefstms)) { 14605 this.xrefstms[pos] = 1; 14606 this.startXRefQueue.push(pos); 14607 } 14608 } 14609 } else if (Number.isInteger(obj)) { 14610 if (!Number.isInteger(parser.getObj()) || !(0, _primitives.isCmd)(parser.getObj(), 'obj') || !(0, _primitives.isStream)(obj = parser.getObj())) { 14611 throw new _util.FormatError('Invalid XRef stream'); 14612 } 14613 14614 dict = this.processXRefStream(obj); 14615 14616 if (!this.topDict) { 14617 this.topDict = dict; 14618 } 14619 14620 if (!dict) { 14621 throw new _util.FormatError('Failed to read XRef stream'); 14622 } 14623 } else { 14624 throw new _util.FormatError('Invalid XRef stream header'); 14625 } 14626 14627 obj = dict.get('Prev'); 14628 14629 if (Number.isInteger(obj)) { 14630 this.startXRefQueue.push(obj); 14631 } else if ((0, _primitives.isRef)(obj)) { 14632 this.startXRefQueue.push(obj.num); 14633 } 14634 14635 this.startXRefQueue.shift(); 14636 } 14637 14638 return this.topDict; 14639 } catch (e) { 14640 if (e instanceof _util.MissingDataException) { 14641 throw e; 14642 } 14643 14644 (0, _util.info)('(while reading XRef): ' + e); 14645 } 14646 14647 if (recoveryMode) { 14648 return; 14649 } 14650 14651 throw new _util.XRefParseException(); 14652 }, 14653 getEntry: function XRef_getEntry(i) { 14654 var xrefEntry = this.entries[i]; 14655 14656 if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { 14657 return xrefEntry; 14658 } 14659 14660 return null; 14661 }, 14662 fetchIfRef: function XRef_fetchIfRef(obj, suppressEncryption) { 14663 if (!(0, _primitives.isRef)(obj)) { 14664 return obj; 14665 } 14666 14667 return this.fetch(obj, suppressEncryption); 14668 }, 14669 fetch: function XRef_fetch(ref, suppressEncryption) { 14670 if (!(0, _primitives.isRef)(ref)) { 14671 throw new Error('ref object is not a reference'); 14672 } 14673 14674 var num = ref.num; 14675 14676 if (num in this.cache) { 14677 var cacheEntry = this.cache[num]; 14678 14679 if (cacheEntry instanceof _primitives.Dict && !cacheEntry.objId) { 14680 cacheEntry.objId = ref.toString(); 14681 } 14682 14683 return cacheEntry; 14684 } 14685 14686 var xrefEntry = this.getEntry(num); 14687 14688 if (xrefEntry === null) { 14689 return this.cache[num] = null; 14690 } 14691 14692 if (xrefEntry.uncompressed) { 14693 xrefEntry = this.fetchUncompressed(ref, xrefEntry, suppressEncryption); 14694 } else { 14695 xrefEntry = this.fetchCompressed(ref, xrefEntry, suppressEncryption); 14696 } 14697 14698 if ((0, _primitives.isDict)(xrefEntry)) { 14699 xrefEntry.objId = ref.toString(); 14700 } else if ((0, _primitives.isStream)(xrefEntry)) { 14701 xrefEntry.dict.objId = ref.toString(); 14702 } 14703 14704 return xrefEntry; 14705 }, 14706 fetchUncompressed: function fetchUncompressed(ref, xrefEntry) { 14707 var suppressEncryption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 14708 var gen = ref.gen; 14709 var num = ref.num; 14710 14711 if (xrefEntry.gen !== gen) { 14712 throw new _util.XRefEntryException("Inconsistent generation in XRef: ".concat(ref)); 14713 } 14714 14715 var stream = this.stream.makeSubStream(xrefEntry.offset + this.stream.start); 14716 var parser = new _parser.Parser(new _parser.Lexer(stream), true, this); 14717 var obj1 = parser.getObj(); 14718 var obj2 = parser.getObj(); 14719 var obj3 = parser.getObj(); 14720 14721 if (!Number.isInteger(obj1)) { 14722 obj1 = parseInt(obj1, 10); 14723 } 14724 14725 if (!Number.isInteger(obj2)) { 14726 obj2 = parseInt(obj2, 10); 14727 } 14728 14729 if (obj1 !== num || obj2 !== gen || !(0, _primitives.isCmd)(obj3)) {
14730 throw new _util.XRefEntryException("Bad (uncompressed) XRef entry: ".concat(ref)); 14731 } 14732 14733 if (obj3.cmd !== 'obj') { 14734 if (obj3.cmd.startsWith('obj')) { 14735 num = parseInt(obj3.cmd.substring(3), 10); 14736 14737 if (!Number.isNaN(num)) { 14738 return num; 14739 } 14740 } 14741 14742 throw new _util.XRefEntryException("Bad (uncompressed) XRef entry: ".concat(ref)); 14743 } 14744 14745 if (this.encrypt && !suppressEncryption) { 14746 xrefEntry = parser.getObj(this.encrypt.createCipherTransform(num, gen)); 14747 } else { 14748 xrefEntry = parser.getObj(); 14749 } 14750 14751 if (!(0, _primitives.isStream)(xrefEntry)) { 14752 this.cache[num] = xrefEntry; 14753 } 14754 14755 return xrefEntry; 14756 }, 14757 fetchCompressed: function fetchCompressed(ref, xrefEntry) { 14758 var suppressEncryption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 14759 var tableOffset = xrefEntry.offset; 14760 var stream = this.fetch(new _primitives.Ref(tableOffset, 0)); 14761 14762 if (!(0, _primitives.isStream)(stream)) { 14763 throw new _util.FormatError('bad ObjStm stream'); 14764 } 14765 14766 var first = stream.dict.get('First'); 14767 var n = stream.dict.get('N'); 14768 14769 if (!Number.isInteger(first) || !Number.isInteger(n)) { 14770 throw new _util.FormatError('invalid first and n parameters for ObjStm stream'); 14771 } 14772 14773 var parser = new _parser.Parser(new _parser.Lexer(stream), false, this); 14774 parser.allowStreams = true; 14775 var i, 14776 entries = [], 14777 num, 14778 nums = []; 14779 14780 for (i = 0; i < n; ++i) { 14781 num = parser.getObj(); 14782 14783 if (!Number.isInteger(num)) { 14784 throw new _util.FormatError("invalid object number in the ObjStm stream: ".concat(num)); 14785 } 14786 14787 nums.push(num); 14788 var offset = parser.getObj(); 14789 14790 if (!Number.isInteger(offset)) { 14791 throw new _util.FormatError("invalid object offset in the ObjStm stream: ".concat(offset)); 14792 } 14793 } 14794 14795 for (i = 0; i < n; ++i) { 14796 entries.push(parser.getObj()); 14797 14798 if ((0, _primitives.isCmd)(parser.buf1, 'endobj')) { 14799 parser.shift(); 14800 } 14801 14802 num = nums[i]; 14803 var entry = this.entries[num]; 14804 14805 if (entry && entry.offset === tableOffset && entry.gen === i) { 14806 this.cache[num] = entries[i]; 14807 } 14808 } 14809 14810 xrefEntry = entries[xrefEntry.gen]; 14811 14812 if (xrefEntry === undefined) { 14813 throw new _util.XRefEntryException("Bad (compressed) XRef entry: ".concat(ref)); 14814 } 14815 14816 return xrefEntry; 14817 }, 14818 fetchIfRefAsync: function () { 14819 var _fetchIfRefAsync = _asyncToGenerator( 14820 /*#__PURE__*/ 14821 _regenerator.default.mark(function _callee(obj, suppressEncryption) { 14822 return _regenerator.default.wrap(function _callee$(_context) { 14823 while (1) { 14824 switch (_context.prev = _context.next) { 14825 case 0: 14826 if ((0, _primitives.isRef)(obj)) { 14827 _context.next = 2; 14828 break; 14829 } 14830 14831 return _context.abrupt("return", obj); 14832 14833 case 2: 14834 return _context.abrupt("return", this.fetchAsync(obj, suppressEncryption)); 14835 14836 case 3: 14837 case "end": 14838 return _context.stop(); 14839 } 14840 } 14841 }, _callee, this); 14842 })); 14843 14844 function fetchIfRefAsync(_x, _x2) { 14845 return _fetchIfRefAsync.apply(this, arguments); 14846 } 14847 14848 return fetchIfRefAsync; 14849 }(), 14850 fetchAsync: function () { 14851 var _fetchAsync = _asyncToGenerator( 14852 /*#__PURE__*/ 14853 _regenerator.default.mark(function _callee2(ref, suppressEncryption) { 14854 return _regenerator.default.wrap(function _callee2$(_context2) { 14855 while (1) { 14856 switch (_context2.prev = _context2.next) { 14857 case 0: 14858 _context2.prev = 0; 14859 return _context2.abrupt("return", this.fetch(ref, suppressEncryption)); 14860 14861 case 4: 14862 _context2.prev = 4; 14863 _context2.t0 = _context2["catch"](0); 14864 14865 if (_context2.t0 instanceof _util.MissingDataException) { 14866 _context2.next = 8; 14867 break; 14868 } 14869 14870 throw _context2.t0; 14871 14872 case 8: 14873 _context2.next = 10; 14874 return this.pdfManager.requestRange(_context2.t0.begin, _context2.t0.end); 14875 14876 case 10: 14877 return _context2.abrupt("return", this.fetchAsync(ref, suppressEncryption)); 14878 14879 case 11: 14880 case "end": 14881 return _context2.stop(); 14882 } 14883 } 14884 }, _callee2, this, [[0, 4]]); 14885 })); 14886 14887 function fetchAsync(_x3, _x4) { 14888 return _fetchAsync.apply(this, arguments); 14889 } 14890 14891 return fetchAsync; 14892 }(), 14893 getCatalogObj: function XRef_getCatalogObj() { 14894 return this.root; 14895 } 14896 }; 14897 return XRef; 14898}();
14899 14900exports.XRef = XRef; 14901 14902var NameOrNumberTree = 14903/*#__PURE__*/ 14904function () { 14905 function NameOrNumberTree(root, xref, type) { 14906 _classCallCheck(this, NameOrNumberTree); 14907 14908 if (this.constructor === NameOrNumberTree) { 14909 (0, _util.unreachable)('Cannot initialize NameOrNumberTree.'); 14910 } 14911 14912 this.root = root; 14913 this.xref = xref; 14914 this._type = type; 14915 } 14916 14917 _createClass(NameOrNumberTree, [{ 14918 key: "getAll", 14919 value: function getAll() { 14920 var dict = Object.create(null); 14921 14922 if (!this.root) { 14923 return dict; 14924 } 14925 14926 var xref = this.xref; 14927 var processed = new _primitives.RefSet(); 14928 processed.put(this.root); 14929 var queue = [this.root]; 14930 14931 while (queue.length > 0) { 14932 var obj = xref.fetchIfRef(queue.shift()); 14933 14934 if (!(0, _primitives.isDict)(obj)) { 14935 continue; 14936 } 14937 14938 if (obj.has('Kids')) { 14939 var kids = obj.get('Kids'); 14940 14941 for (var i = 0, ii = kids.length; i < ii; i++) { 14942 var kid = kids[i]; 14943 14944 if (processed.has(kid)) { 14945 throw new _util.FormatError("Duplicate entry in \"".concat(this._type, "\" tree.")); 14946 } 14947 14948 queue.push(kid); 14949 processed.put(kid); 14950 } 14951 14952 continue; 14953 } 14954 14955 var entries = obj.get(this._type); 14956 14957 if (Array.isArray(entries)) { 14958 for (var _i2 = 0, _ii = entries.length; _i2 < _ii; _i2 += 2) { 14959 dict[xref.fetchIfRef(entries[_i2])] = xref.fetchIfRef(entries[_i2 + 1]); 14960 } 14961 } 14962 } 14963 14964 return dict; 14965 } 14966 }, { 14967 key: "get", 14968 value: function get(key) { 14969 if (!this.root) { 14970 return null; 14971 } 14972 14973 var xref = this.xref; 14974 var kidsOrEntries = xref.fetchIfRef(this.root); 14975 var loopCount = 0; 14976 var MAX_LEVELS = 10; 14977 14978 while (kidsOrEntries.has('Kids')) { 14979 if (++loopCount > MAX_LEVELS) { 14980 (0, _util.warn)("Search depth limit reached for \"".concat(this._type, "\" tree.")); 14981 return null; 14982 } 14983 14984 var kids = kidsOrEntries.get('Kids'); 14985 14986 if (!Array.isArray(kids)) { 14987 return null; 14988 } 14989 14990 var l = 0, 14991 r = kids.length - 1; 14992 14993 while (l <= r) { 14994 var m = l + r >> 1; 14995 var kid = xref.fetchIfRef(kids[m]); 14996 var limits = kid.get('Limits'); 14997 14998 if (key < xref.fetchIfRef(limits[0])) { 14999 r = m - 1; 15000 } else if (key > xref.fetchIfRef(limits[1])) { 15001 l = m + 1; 15002 } else { 15003 kidsOrEntries = xref.fetchIfRef(kids[m]); 15004 break; 15005 } 15006 } 15007 15008 if (l > r) { 15009 return null; 15010 } 15011 } 15012 15013 var entries = kidsOrEntries.get(this._type); 15014 15015 if (Array.isArray(entries)) { 15016 var _l = 0, 15017 _r = entries.length - 2; 15018 15019 while (_l <= _r) { 15020 var tmp = _l + _r >> 1, 15021 _m = tmp + (tmp & 1); 15022 15023 var currentKey = xref.fetchIfRef(entries[_m]); 15024 15025 if (key < currentKey) { 15026 _r = _m - 2; 15027 } else if (key > currentKey) { 15028 _l = _m + 2; 15029 } else { 15030 return xref.fetchIfRef(entries[_m + 1]); 15031 } 15032 } 15033 15034 (0, _util.info)("Falling back to an exhaustive search, for key \"".concat(key, "\", ") + "in \"".concat(this._type, "\" tree.")); 15035 15036 for (var _m2 = 0, mm = entries.length; _m2 < mm; _m2 += 2) { 15037 var _currentKey = xref.fetchIfRef(entries[_m2]); 15038 15039 if (_currentKey === key) { 15040 (0, _util.warn)("The \"".concat(key, "\" key was found at an incorrect, ") + "i.e. out-of-order, position in \"".concat(this._type, "\" tree.")); 15041 return xref.fetchIfRef(entries[_m2 + 1]); 15042 } 15043 } 15044 } 15045 15046 return null; 15047 } 15048 }]); 15049 15050 return NameOrNumberTree; 15051}(); 15052 15053var NameTree = 15054/*#__PURE__*/ 15055function (_NameOrNumberTree) { 15056 _inherits(NameTree, _NameOrNumberTree); 15057 15058 function NameTree(root, xref) { 15059 _classCallCheck(this, NameTree); 15060 15061 return _possibleConstructorReturn(this, _getPrototypeOf(NameTree).call(this, root, xref, 'Names')); 15062 } 15063 15064 return NameTree; 15065}(NameOrNumberTree); 15066 15067var NumberTree = 15068/*#__PURE__*/ 15069function (_NameOrNumberTree2) { 15070 _inherits(NumberTree, _NameOrNumberTree2); 15071 15072 function NumberTree(root, xref) { 15073 _classCallCheck(this, NumberTree); 15074 15075 return _possibleConstructorReturn(this, _getPrototypeOf(NumberTree).call(this, root, xref, 'Nums')); 15076 } 15077 15078 return NumberTree; 15079}(NameOrNumberTree); 15080 15081var FileSpec = function FileSpecClosure() { 15082 function FileSpec(root, xref) { 15083 if (!root || !(0, _primitives.isDict)(root)) { 15084 return; 15085 } 15086 15087 this.xref = xref; 15088 this.root = root; 15089 15090 if (root.has('FS')) { 15091 this.fs = root.get('FS'); 15092 } 15093 15094 this.description = root.has('Desc') ? (0, _util.stringToPDFString)(root.get('Desc')) : ''; 15095 15096 if (root.has('RF')) { 15097 (0, _util.warn)('Related file specifications are not supported'); 15098 } 15099 15100 this.contentAvailable = true; 15101 15102 if (!root.has('EF')) { 15103 this.contentAvailable = false; 15104 (0, _util.warn)('Non-embedded file specifications are not supported'); 15105 } 15106 } 15107 15108 function pickPlatformItem(dict) { 15109 if (dict.has('UF')) { 15110 return dict.get('UF'); 15111 } else if (dict.has('F')) { 15112 return dict.get('F'); 15113 } else if (dict.has('Unix')) { 15114 return dict.get('Unix'); 15115 } else if (dict.has('Mac')) { 15116 return dict.get('Mac'); 15117 } else if (dict.has('DOS')) { 15118 return dict.get('DOS'); 15119 } 15120 15121 return null; 15122 } 15123 15124 FileSpec.prototype = { 15125 get filename() { 15126 if (!this._filename && this.root) { 15127 var filename = pickPlatformItem(this.root) || 'unnamed'; 15128 this._filename = (0, _util.stringToPDFString)(filename).replace(/\\\\/g, '\\').replace(/\\\//g, '/').replace(/\\/g, '/'); 15129 } 15130 15131 return this._filename; 15132 }, 15133 15134 get content() { 15135 if (!this.contentAvailable) { 15136 return null; 15137 } 15138 15139 if (!this.contentRef && this.root) { 15140 this.contentRef = pickPlatformItem(this.root.get('EF')); 15141 } 15142 15143 var content = null; 15144 15145 if (this.contentRef) { 15146 var xref = this.xref; 15147 var fileObj = xref.fetchIfRef(this.contentRef); 15148 15149 if (fileObj && (0, _primitives.isStream)(fileObj)) { 15150 content = fileObj.getBytes(); 15151 } else { 15152 (0, _util.warn)('Embedded file specification points to non-existing/invalid ' + 'content'); 15153 } 15154 } else { 15155 (0, _util.warn)('Embedded file specification does not have a content'); 15156 } 15157 15158 return content; 15159 }, 15160 15161 get serializable() { 15162 return { 15163 filename: this.filename, 15164 content: this.content 15165 }; 15166 } 15167 15168 }; 15169 return FileSpec; 15170}(); 15171 15172exports.FileSpec = FileSpec; 15173 15174var ObjectLoader = function () { 15175 function mayHaveChildren(value) { 15176 return (0, _primitives.isRef)(value) || (0, _primitives.isDict)(value) || Array.isArray(value) || (0, _primitives.isStream)(value); 15177 } 15178 15179 function addChildren(node, nodesToVisit) { 15180 if ((0, _primitives.isDict)(node) || (0, _primitives.isStream)(node)) { 15181 var dict = (0, _primitives.isDict)(node) ? node : node.dict; 15182 var dictKeys = dict.getKeys(); 15183 15184 for (var i = 0, ii = dictKeys.length; i < ii; i++) { 15185 var rawValue = dict.getRaw(dictKeys[i]); 15186 15187 if (mayHaveChildren(rawValue)) { 15188 nodesToVisit.push(rawValue); 15189 } 15190 } 15191 } else if (Array.isArray(node)) { 15192 for (var _i3 = 0, _ii2 = node.length; _i3 < _ii2; _i3++) { 15193 var value = node[_i3]; 15194 15195 if (mayHaveChildren(value)) { 15196 nodesToVisit.push(value); 15197 } 15198 } 15199 } 15200 } 15201 15202 function ObjectLoader(dict, keys, xref) { 15203 this.dict = dict; 15204 this.keys = keys; 15205 this.xref = xref; 15206 this.refSet = null; 15207 this.capability = null; 15208 } 15209 15210 ObjectLoader.prototype = { 15211 load: function load() { 15212 this.capability = (0, _util.createPromiseCapability)(); 15213 15214 if (!(this.xref.stream instanceof _chunked_stream.ChunkedStream) || this.xref.stream.getMissingChunks().length === 0) { 15215 this.capability.resolve(); 15216 return this.capability.promise; 15217 } 15218 15219 var keys = this.keys, 15220 dict = this.dict; 15221 this.refSet = new _primitives.RefSet(); 15222 var nodesToVisit = []; 15223 15224 for (var i = 0, ii = keys.length; i < ii; i++) { 15225 var rawValue = dict.getRaw(keys[i]); 15226 15227 if (rawValue !== undefined) { 15228 nodesToVisit.push(rawValue); 15229 } 15230 } 15231 15232 this._walk(nodesToVisit); 15233 15234 return this.capability.promise; 15235 }, 15236 _walk: function _walk(nodesToVisit) { 15237 var _this2 = this; 15238 15239 var nodesToRevisit = []; 15240 var pendingRequests = []; 15241 15242 while (nodesToVisit.length) { 15243 var currentNode = nodesToVisit.pop();
15244 15245 if ((0, _primitives.isRef)(currentNode)) { 15246 if (this.refSet.has(currentNode)) { 15247 continue; 15248 } 15249 15250 try { 15251 this.refSet.put(currentNode); 15252 currentNode = this.xref.fetch(currentNode); 15253 } catch (ex) { 15254 if (!(ex instanceof _util.MissingDataException)) { 15255 throw ex; 15256 } 15257 15258 nodesToRevisit.push(currentNode); 15259 pendingRequests.push({ 15260 begin: ex.begin, 15261 end: ex.end 15262 }); 15263 } 15264 } 15265 15266 if (currentNode && currentNode.getBaseStreams) { 15267 var baseStreams = currentNode.getBaseStreams(); 15268 var foundMissingData = false; 15269 15270 for (var i = 0, ii = baseStreams.length; i < ii; i++) { 15271 var stream = baseStreams[i]; 15272 15273 if (stream.getMissingChunks && stream.getMissingChunks().length) { 15274 foundMissingData = true; 15275 pendingRequests.push({ 15276 begin: stream.start, 15277 end: stream.end 15278 }); 15279 } 15280 } 15281 15282 if (foundMissingData) { 15283 nodesToRevisit.push(currentNode); 15284 } 15285 } 15286 15287 addChildren(currentNode, nodesToVisit); 15288 } 15289 15290 if (pendingRequests.length) { 15291 this.xref.stream.manager.requestRanges(pendingRequests).then(function () { 15292 for (var _i4 = 0, _ii3 = nodesToRevisit.length; _i4 < _ii3; _i4++) { 15293 var node = nodesToRevisit[_i4]; 15294 15295 if ((0, _primitives.isRef)(node)) { 15296 _this2.refSet.remove(node); 15297 } 15298 } 15299 15300 _this2._walk(nodesToRevisit); 15301 }, this.capability.reject); 15302 return; 15303 } 15304 15305 this.refSet = null; 15306 this.capability.resolve(); 15307 } 15308 }; 15309 return ObjectLoader; 15310}(); 15311 15312exports.ObjectLoader = ObjectLoader; 15313 15314/***/ }), 15315/* 155 */ 15316/***/ (function(module, exports, __w_pdfjs_require__) { 15317 15318"use strict"; 15319 15320 15321Object.defineProperty(exports, "__esModule", { 15322 value: true 15323}); 15324exports.isEOF = isEOF; 15325exports.isCmd = isCmd; 15326exports.isDict = isDict; 15327exports.isName = isName; 15328exports.isRef = isRef; 15329exports.isRefsEqual = isRefsEqual; 15330exports.isStream = isStream; 15331exports.RefSetCache = exports.RefSet = exports.Ref = exports.Name = exports.Dict = exports.Cmd = exports.EOF = void 0; 15332 15333function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 15334 15335var EOF = {}; 15336exports.EOF = EOF; 15337 15338var Name = function NameClosure() { 15339 function Name(name) { 15340 this.name = name; 15341 } 15342 15343 Name.prototype = {}; 15344 var nameCache = Object.create(null); 15345 15346 Name.get = function Name_get(name) { 15347 var nameValue = nameCache[name]; 15348 return nameValue ? nameValue : nameCache[name] = new Name(name); 15349 }; 15350 15351 return Name; 15352}(); 15353 15354exports.Name = Name; 15355 15356var Cmd = function CmdClosure() { 15357 function Cmd(cmd) { 15358 this.cmd = cmd; 15359 } 15360 15361 Cmd.prototype = {}; 15362 var cmdCache = Object.create(null); 15363 15364 Cmd.get = function Cmd_get(cmd) { 15365 var cmdValue = cmdCache[cmd]; 15366 return cmdValue ? cmdValue : cmdCache[cmd] = new Cmd(cmd); 15367 }; 15368 15369 return Cmd; 15370}(); 15371 15372exports.Cmd = Cmd; 15373 15374var Dict = function DictClosure() { 15375 var nonSerializable = function nonSerializableClosure() { 15376 return nonSerializable; 15377 }; 15378 15379 function Dict(xref) { 15380 this._map = Object.create(null); 15381 this.xref = xref; 15382 this.objId = null; 15383 this.suppressEncryption = false; 15384 this.__nonSerializable__ = nonSerializable; 15385 } 15386 15387 Dict.prototype = { 15388 assignXref: function Dict_assignXref(newXref) { 15389 this.xref = newXref; 15390 }, 15391 get: function Dict_get(key1, key2, key3) { 15392 var value; 15393 var xref = this.xref, 15394 suppressEncryption = this.suppressEncryption; 15395
15396 if (typeof (value = this._map[key1]) !== 'undefined' || key1 in this._map || typeof key2 === 'undefined') { 15397 return xref ? xref.fetchIfRef(value, suppressEncryption) : value; 15398 } 15399 15400 if (typeof (value = this._map[key2]) !== 'undefined' || key2 in this._map || typeof key3 === 'undefined') { 15401 return xref ? xref.fetchIfRef(value, suppressEncryption) : value; 15402 } 15403 15404 value = this._map[key3] || null; 15405 return xref ? xref.fetchIfRef(value, suppressEncryption) : value; 15406 }, 15407 getAsync: function Dict_getAsync(key1, key2, key3) { 15408 var value; 15409 var xref = this.xref, 15410 suppressEncryption = this.suppressEncryption; 15411 15412 if (typeof (value = this._map[key1]) !== 'undefined' || key1 in this._map || typeof key2 === 'undefined') { 15413 if (xref) { 15414 return xref.fetchIfRefAsync(value, suppressEncryption); 15415 } 15416 15417 return Promise.resolve(value); 15418 } 15419 15420 if (typeof (value = this._map[key2]) !== 'undefined' || key2 in this._map || typeof key3 === 'undefined') { 15421 if (xref) { 15422 return xref.fetchIfRefAsync(value, suppressEncryption); 15423 } 15424 15425 return Promise.resolve(value); 15426 } 15427 15428 value = this._map[key3] || null; 15429 15430 if (xref) { 15431 return xref.fetchIfRefAsync(value, suppressEncryption); 15432 } 15433 15434 return Promise.resolve(value); 15435 }, 15436 getArray: function Dict_getArray(key1, key2, key3) { 15437 var value = this.get(key1, key2, key3); 15438 var xref = this.xref, 15439 suppressEncryption = this.suppressEncryption; 15440 15441 if (!Array.isArray(value) || !xref) { 15442 return value; 15443 } 15444 15445 value = value.slice(); 15446 15447 for (var i = 0, ii = value.length; i < ii; i++) { 15448 if (!isRef(value[i])) { 15449 continue; 15450 } 15451 15452 value[i] = xref.fetch(value[i], suppressEncryption); 15453 } 15454 15455 return value; 15456 }, 15457 getRaw: function Dict_getRaw(key) { 15458 return this._map[key]; 15459 }, 15460 getKeys: function Dict_getKeys() { 15461 return Object.keys(this._map); 15462 }, 15463 set: function Dict_set(key, value) { 15464 this._map[key] = value; 15465 }, 15466 has: function Dict_has(key) { 15467 return key in this._map; 15468 }, 15469 forEach: function Dict_forEach(callback) { 15470 for (var key in this._map) { 15471 callback(key, this.get(key)); 15472 } 15473 } 15474 }; 15475 Dict.empty = new Dict(null); 15476 15477 Dict.merge = function (xref, dictArray) { 15478 var mergedDict = new Dict(xref); 15479 15480 for (var i = 0, ii = dictArray.length; i < ii; i++) { 15481 var dict = dictArray[i]; 15482 15483 if (!isDict(dict)) { 15484 continue; 15485 } 15486 15487 for (var keyName in dict._map) { 15488 if (mergedDict._map[keyName] !== undefined) { 15489 continue; 15490 } 15491 15492 mergedDict._map[keyName] = dict._map[keyName]; 15493 } 15494 } 15495 15496 return mergedDict; 15497 }; 15498 15499 return Dict; 15500}();
15501 15502exports.Dict = Dict; 15503 15504var Ref = function RefClosure() { 15505 function Ref(num, gen) { 15506 this.num = num; 15507 this.gen = gen; 15508 } 15509 15510 Ref.prototype = { 15511 toString: function Ref_toString() { 15512 if (this.gen !== 0) { 15513 return "".concat(this.num, "R").concat(this.gen); 15514 } 15515 15516 return "".concat(this.num, "R"); 15517 } 15518 }; 15519 return Ref; 15520}(); 15521 15522exports.Ref = Ref; 15523 15524var RefSet = function RefSetClosure() { 15525 function RefSet() { 15526 this.dict = Object.create(null); 15527 } 15528 15529 RefSet.prototype = { 15530 has: function RefSet_has(ref) { 15531 return ref.toString() in this.dict; 15532 }, 15533 put: function RefSet_put(ref) { 15534 this.dict[ref.toString()] = true; 15535 }, 15536 remove: function RefSet_remove(ref) { 15537 delete this.dict[ref.toString()]; 15538 } 15539 }; 15540 return RefSet; 15541}(); 15542 15543exports.RefSet = RefSet; 15544 15545var RefSetCache = function RefSetCacheClosure() { 15546 function RefSetCache() { 15547 this.dict = Object.create(null); 15548 } 15549 15550 RefSetCache.prototype = { 15551 get: function RefSetCache_get(ref) { 15552 return this.dict[ref.toString()]; 15553 }, 15554 has: function RefSetCache_has(ref) { 15555 return ref.toString() in this.dict; 15556 }, 15557 put: function RefSetCache_put(ref, obj) { 15558 this.dict[ref.toString()] = obj; 15559 }, 15560 putAlias: function RefSetCache_putAlias(ref, aliasRef) { 15561 this.dict[ref.toString()] = this.get(aliasRef); 15562 }, 15563 forEach: function RefSetCache_forEach(fn, thisArg) { 15564 for (var i in this.dict) { 15565 fn.call(thisArg, this.dict[i]); 15566 } 15567 }, 15568 clear: function RefSetCache_clear() { 15569 this.dict = Object.create(null); 15570 } 15571 }; 15572 return RefSetCache; 15573}(); 15574 15575exports.RefSetCache = RefSetCache; 15576 15577function isEOF(v) { 15578 return v === EOF; 15579} 15580 15581function isName(v, name) { 15582 return v instanceof Name && (name === undefined || v.name === name); 15583} 15584 15585function isCmd(v, cmd) { 15586 return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); 15587} 15588 15589function isDict(v, type) { 15590 return v instanceof Dict && (type === undefined || isName(v.get('Type'), type)); 15591} 15592 15593function isRef(v) { 15594 return v instanceof Ref; 15595} 15596 15597function isRefsEqual(v1, v2) { 15598 return v1.num === v2.num && v1.gen === v2.gen; 15599} 15600 15601function isStream(v) { 15602 return _typeof(v) === 'object' && v !== null && v.getBytes !== undefined; 15603} 15604 15605/***/ }), 15606/* 156 */ 15607/***/ (function(module, exports, __w_pdfjs_require__) { 15608 15609"use strict"; 15610 15611 15612Object.defineProperty(exports, "__esModule", { 15613 value: true 15614}); 15615exports.Parser = exports.Linearization = exports.Lexer = void 0; 15616 15617var _stream = __w_pdfjs_require__(157); 15618 15619var _util = __w_pdfjs_require__(6); 15620 15621var _primitives = __w_pdfjs_require__(155); 15622 15623var _ccitt_stream = __w_pdfjs_require__(158); 15624 15625var _jbig2_stream = __w_pdfjs_require__(160); 15626 15627var _jpeg_stream = __w_pdfjs_require__(163); 15628 15629var _jpx_stream = __w_pdfjs_require__(165); 15630 15631var MAX_LENGTH_TO_CACHE = 1000; 15632var MAX_ADLER32_LENGTH = 5552; 15633 15634function computeAdler32(bytes) { 15635 var bytesLength = bytes.length; 15636 var a = 1, 15637 b = 0; 15638 15639 for (var i = 0; i < bytesLength; ++i) { 15640 a += bytes[i] & 0xFF; 15641 b += a; 15642 } 15643 15644 return b % 65521 << 16 | a % 65521; 15645} 15646 15647var Parser = function ParserClosure() { 15648 function Parser(lexer, allowStreams, xref, recoveryMode) { 15649 this.lexer = lexer; 15650 this.allowStreams = allowStreams; 15651 this.xref = xref; 15652 this.recoveryMode = recoveryMode || false; 15653 this.imageCache = Object.create(null); 15654 this.refill(); 15655 } 15656 15657 Parser.prototype = { 15658 refill: function Parser_refill() { 15659 this.buf1 = this.lexer.getObj(); 15660 this.buf2 = this.lexer.getObj(); 15661 }, 15662 shift: function Parser_shift() { 15663 if ((0, _primitives.isCmd)(this.buf2, 'ID')) { 15664 this.buf1 = this.buf2; 15665 this.buf2 = null; 15666 } else { 15667 this.buf1 = this.buf2; 15668 this.buf2 = this.lexer.getObj(); 15669 } 15670 }, 15671 tryShift: function Parser_tryShift() { 15672 try { 15673 this.shift(); 15674 return true; 15675 } catch (e) { 15676 if (e instanceof _util.MissingDataException) { 15677 throw e; 15678 } 15679 15680 return false; 15681 } 15682 }, 15683 getObj: function Parser_getObj(cipherTransform) { 15684 var buf1 = this.buf1; 15685 this.shift(); 15686 15687 if (buf1 instanceof _primitives.Cmd) { 15688 switch (buf1.cmd) { 15689 case 'BI': 15690 return this.makeInlineImage(cipherTransform); 15691 15692 case '[': 15693 var array = []; 15694 15695 while (!(0, _primitives.isCmd)(this.buf1, ']') && !(0, _primitives.isEOF)(this.buf1)) { 15696 array.push(this.getObj(cipherTransform)); 15697 } 15698 15699 if ((0, _primitives.isEOF)(this.buf1)) { 15700 if (!this.recoveryMode) { 15701 throw new _util.FormatError('End of file inside array'); 15702 } 15703 15704 return array; 15705 } 15706 15707 this.shift(); 15708 return array; 15709 15710 case '<<': 15711 var dict = new _primitives.Dict(this.xref); 15712 15713 while (!(0, _primitives.isCmd)(this.buf1, '>>') && !(0, _primitives.isEOF)(this.buf1)) { 15714 if (!(0, _primitives.isName)(this.buf1)) { 15715 (0, _util.info)('Malformed dictionary: key must be a name object'); 15716 this.shift(); 15717 continue; 15718 } 15719 15720 var key = this.buf1.name; 15721 this.shift(); 15722 15723 if ((0, _primitives.isEOF)(this.buf1)) { 15724 break; 15725 } 15726 15727 dict.set(key, this.getObj(cipherTransform)); 15728 } 15729 15730 if ((0, _primitives.isEOF)(this.buf1)) { 15731 if (!this.recoveryMode) { 15732 throw new _util.FormatError('End of file inside dictionary'); 15733 } 15734 15735 return dict; 15736 } 15737 15738 if ((0, _primitives.isCmd)(this.buf2, 'stream')) { 15739 return this.allowStreams ? this.makeStream(dict, cipherTransform) : dict; 15740 } 15741 15742 this.shift(); 15743 return dict; 15744 15745 default: 15746 return buf1; 15747 } 15748 } 15749 15750 if (Number.isInteger(buf1)) { 15751 var num = buf1; 15752 15753 if (Number.isInteger(this.buf1) && (0, _primitives.isCmd)(this.buf2, 'R')) { 15754 var ref = new _primitives.Ref(num, this.buf1); 15755 this.shift(); 15756 this.shift(); 15757 return ref; 15758 } 15759 15760 return num; 15761 } 15762 15763 if ((0, _util.isString)(buf1)) { 15764 var str = buf1; 15765 15766 if (cipherTransform) { 15767 str = cipherTransform.decryptString(str); 15768 } 15769 15770 return str; 15771 } 15772 15773 return buf1; 15774 }, 15775 findDefaultInlineStreamEnd: function findDefaultInlineStreamEnd(stream) { 15776 var E = 0x45, 15777 I = 0x49, 15778 SPACE = 0x20, 15779 LF = 0xA, 15780 CR = 0xD; 15781 var n = 10, 15782 NUL = 0x0; 15783 var startPos = stream.pos, 15784 state = 0, 15785 ch, 15786 maybeEIPos; 15787 15788 while ((ch = stream.getByte()) !== -1) { 15789 if (state === 0) { 15790 state = ch === E ? 1 : 0; 15791 } else if (state === 1) { 15792 state = ch === I ? 2 : 0; 15793 } else { 15794 (0, _util.assert)(state === 2); 15795 15796 if (ch === SPACE || ch === LF || ch === CR) { 15797 maybeEIPos = stream.pos; 15798 var followingBytes = stream.peekBytes(n); 15799 15800 for (var i = 0, ii = followingBytes.length; i < ii; i++) { 15801 ch = followingBytes[i]; 15802 15803 if (ch === NUL && followingBytes[i + 1] !== NUL) { 15804 continue; 15805 } 15806 15807 if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7F)) { 15808 state = 0; 15809 break; 15810 } 15811 } 15812 15813 if (state === 2) { 15814 break; 15815 } 15816 } else { 15817 state = 0; 15818 } 15819 } 15820 } 15821 15822 if (ch === -1) { 15823 (0, _util.warn)('findDefaultInlineStreamEnd: ' + 'Reached the end of the stream without finding a valid EI marker'); 15824 15825 if (maybeEIPos) {
15826 (0, _util.warn)('... trying to recover by using the last "EI" occurrence.'); 15827 stream.skip(-(stream.pos - maybeEIPos)); 15828 } 15829 } 15830 15831 var endOffset = 4; 15832 stream.skip(-endOffset); 15833 ch = stream.peekByte(); 15834 stream.skip(endOffset); 15835 15836 if (!(0, _util.isSpace)(ch)) { 15837 endOffset--; 15838 } 15839 15840 return stream.pos - endOffset - startPos; 15841 }, 15842 findDCTDecodeInlineStreamEnd: function Parser_findDCTDecodeInlineStreamEnd(stream) { 15843 var startPos = stream.pos, 15844 foundEOI = false, 15845 b, 15846 markerLength, 15847 length; 15848 15849 while ((b = stream.getByte()) !== -1) { 15850 if (b !== 0xFF) { 15851 continue; 15852 } 15853 15854 switch (stream.getByte()) { 15855 case 0x00: 15856 break; 15857 15858 case 0xFF: 15859 stream.skip(-1); 15860 break; 15861 15862 case 0xD9: 15863 foundEOI = true; 15864 break; 15865 15866 case 0xC0: 15867 case 0xC1: 15868 case 0xC2: 15869 case 0xC3: 15870 case 0xC5: 15871 case 0xC6: 15872 case 0xC7: 15873 case 0xC9: 15874 case 0xCA: 15875 case 0xCB: 15876 case 0xCD: 15877 case 0xCE: 15878 case 0xCF: 15879 case 0xC4: 15880 case 0xCC: 15881 case 0xDA: 15882 case 0xDB: 15883 case 0xDC: 15884 case 0xDD: 15885 case 0xDE: 15886 case 0xDF: 15887 case 0xE0: 15888 case 0xE1: 15889 case 0xE2: 15890 case 0xE3: 15891 case 0xE4: 15892 case 0xE5: 15893 case 0xE6: 15894 case 0xE7: 15895 case 0xE8: 15896 case 0xE9: 15897 case 0xEA: 15898 case 0xEB: 15899 case 0xEC: 15900 case 0xED: 15901 case 0xEE: 15902 case 0xEF: 15903 case 0xFE: 15904 markerLength = stream.getUint16(); 15905 15906 if (markerLength > 2) { 15907 stream.skip(markerLength - 2); 15908 } else { 15909 stream.skip(-2); 15910 } 15911 15912 break; 15913 } 15914 15915 if (foundEOI) { 15916 break; 15917 } 15918 } 15919 15920 length = stream.pos - startPos; 15921 15922 if (b === -1) { 15923 (0, _util.warn)('Inline DCTDecode image stream: ' + 'EOI marker not found, searching for /EI/ instead.'); 15924 stream.skip(-length); 15925 return this.findDefaultInlineStreamEnd(stream); 15926 } 15927 15928 this.inlineStreamSkipEI(stream); 15929 return length; 15930 }, 15931 findASCII85DecodeInlineStreamEnd: function Parser_findASCII85DecodeInlineStreamEnd(stream) { 15932 var TILDE = 0x7E, 15933 GT = 0x3E; 15934 var startPos = stream.pos, 15935 ch, 15936 length; 15937 15938 while ((ch = stream.getByte()) !== -1) { 15939 if (ch === TILDE && stream.peekByte() === GT) { 15940 stream.skip(); 15941 break; 15942 } 15943 } 15944 15945 length = stream.pos - startPos; 15946 15947 if (ch === -1) { 15948 (0, _util.warn)('Inline ASCII85Decode image stream: ' + 'EOD marker not found, searching for /EI/ instead.'); 15949 stream.skip(-length); 15950 return this.findDefaultInlineStreamEnd(stream); 15951 } 15952 15953 this.inlineStreamSkipEI(stream); 15954 return length; 15955 }, 15956 findASCIIHexDecodeInlineStreamEnd: function Parser_findASCIIHexDecodeInlineStreamEnd(stream) { 15957 var GT = 0x3E; 15958 var startPos = stream.pos, 15959 ch, 15960 length; 15961 15962 while ((ch = stream.getByte()) !== -1) { 15963 if (ch === GT) { 15964 break; 15965 } 15966 } 15967 15968 length = stream.pos - startPos; 15969 15970 if (ch === -1) { 15971 (0, _util.warn)('Inline ASCIIHexDecode image stream: ' + 'EOD marker not found, searching for /EI/ instead.'); 15972 stream.skip(-length); 15973 return this.findDefaultInlineStreamEnd(stream); 15974 } 15975 15976 this.inlineStreamSkipEI(stream); 15977 return length; 15978 }, 15979 inlineStreamSkipEI: function Parser_inlineStreamSkipEI(stream) { 15980 var E = 0x45, 15981 I = 0x49; 15982 var state = 0, 15983 ch; 15984 15985 while ((ch = stream.getByte()) !== -1) { 15986 if (state === 0) { 15987 state = ch === E ? 1 : 0; 15988 } else if (state === 1) { 15989 state = ch === I ? 2 : 0; 15990 } else if (state === 2) { 15991 break; 15992 } 15993 } 15994 }, 15995 makeInlineImage: function Parser_makeInlineImage(cipherTransform) { 15996 var lexer = this.lexer; 15997 var stream = lexer.stream; 15998 var dict = new _primitives.Dict(this.xref), 15999 dictLength; 16000 16001 while (!(0, _primitives.isCmd)(this.buf1, 'ID') && !(0, _primitives.isEOF)(this.buf1)) { 16002 if (!(0, _primitives.isName)(this.buf1)) { 16003 throw new _util.FormatError('Dictionary key must be a name object'); 16004 } 16005 16006 var key = this.buf1.name; 16007 this.shift(); 16008 16009 if ((0, _primitives.isEOF)(this.buf1)) { 16010 break; 16011 } 16012 16013 dict.set(key, this.getObj(cipherTransform)); 16014 } 16015 16016 if (lexer.beginInlineImagePos !== -1) { 16017 dictLength = stream.pos - lexer.beginInlineImagePos; 16018 } 16019 16020 var filter = dict.get('Filter', 'F'), 16021 filterName; 16022 16023 if ((0, _primitives.isName)(filter)) { 16024 filterName = filter.name; 16025 } else if (Array.isArray(filter)) { 16026 var filterZero = this.xref.fetchIfRef(filter[0]); 16027 16028 if ((0, _primitives.isName)(filterZero)) { 16029 filterName = filterZero.name; 16030 } 16031 } 16032 16033 var startPos = stream.pos, 16034 length; 16035 16036 if (filterName === 'DCTDecode' || filterName === 'DCT') { 16037 length = this.findDCTDecodeInlineStreamEnd(stream); 16038 } else if (filterName === 'ASCII85Decode' || filterName === 'A85') { 16039 length = this.findASCII85DecodeInlineStreamEnd(stream); 16040 } else if (filterName === 'ASCIIHexDecode' || filterName === 'AHx') { 16041 length = this.findASCIIHexDecodeInlineStreamEnd(stream); 16042 } else { 16043 length = this.findDefaultInlineStreamEnd(stream); 16044 } 16045 16046 var imageStream = stream.makeSubStream(startPos, length, dict); 16047 var cacheKey; 16048 16049 if (length < MAX_LENGTH_TO_CACHE && dictLength < MAX_ADLER32_LENGTH) { 16050 var imageBytes = imageStream.getBytes(); 16051 imageStream.reset(); 16052 var initialStreamPos = stream.pos; 16053 stream.pos = lexer.beginInlineImagePos; 16054 var dictBytes = stream.getBytes(dictLength); 16055 stream.pos = initialStreamPos; 16056 cacheKey = computeAdler32(imageBytes) + '_' + computeAdler32(dictBytes); 16057 var cacheEntry = this.imageCache[cacheKey]; 16058 16059 if (cacheEntry !== undefined) { 16060 this.buf2 = _primitives.Cmd.get('EI'); 16061 this.shift(); 16062 cacheEntry.reset(); 16063 return cacheEntry; 16064 } 16065 } 16066 16067 if (cipherTransform) { 16068 imageStream = cipherTransform.createStream(imageStream, length); 16069 } 16070 16071 imageStream = this.filter(imageStream, dict, length); 16072 imageStream.dict = dict; 16073 16074 if (cacheKey !== undefined) { 16075 imageStream.cacheKey = 'inline_' + length + '_' + cacheKey; 16076 this.imageCache[cacheKey] = imageStream; 16077 } 16078 16079 this.buf2 = _primitives.Cmd.get('EI'); 16080 this.shift(); 16081 return imageStream; 16082 },
16083 _findStreamLength: function _findStreamLength(startPos, signature) { 16084 var stream = this.lexer.stream; 16085 stream.pos = startPos; 16086 var SCAN_BLOCK_LENGTH = 2048; 16087 var signatureLength = signature.length; 16088 16089 while (stream.pos < stream.end) { 16090 var scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); 16091 var scanLength = scanBytes.length - signatureLength; 16092 16093 if (scanLength <= 0) { 16094 break; 16095 } 16096 16097 var pos = 0; 16098 16099 while (pos < scanLength) { 16100 var j = 0; 16101 16102 while (j < signatureLength && scanBytes[pos + j] === signature[j]) { 16103 j++; 16104 } 16105 16106 if (j >= signatureLength) { 16107 stream.pos += pos; 16108 return stream.pos - startPos; 16109 } 16110 16111 pos++; 16112 } 16113 16114 stream.pos += scanLength; 16115 } 16116 16117 return -1; 16118 }, 16119 makeStream: function Parser_makeStream(dict, cipherTransform) { 16120 var lexer = this.lexer; 16121 var stream = lexer.stream; 16122 lexer.skipToNextLine(); 16123 var startPos = stream.pos - 1; 16124 var length = dict.get('Length'); 16125 16126 if (!Number.isInteger(length)) { 16127 (0, _util.info)('Bad ' + length + ' attribute in stream'); 16128 length = 0; 16129 } 16130 16131 stream.pos = startPos + length; 16132 lexer.nextChar(); 16133 16134 if (this.tryShift() && (0, _primitives.isCmd)(this.buf2, 'endstream')) { 16135 this.shift(); 16136 } else { 16137 var ENDSTREAM_SIGNATURE = new Uint8Array([0x65, 0x6E, 0x64, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6D]); 16138 16139 var actualLength = this._findStreamLength(startPos, ENDSTREAM_SIGNATURE); 16140 16141 if (actualLength < 0) { 16142 var MAX_TRUNCATION = 1; 16143 16144 for (var i = 1; i <= MAX_TRUNCATION; i++) { 16145 var end = ENDSTREAM_SIGNATURE.length - i; 16146 var TRUNCATED_SIGNATURE = ENDSTREAM_SIGNATURE.slice(0, end); 16147 16148 var maybeLength = this._findStreamLength(startPos, TRUNCATED_SIGNATURE); 16149 16150 if (maybeLength >= 0) { 16151 var lastByte = stream.peekBytes(end + 1)[end]; 16152 16153 if (!(0, _util.isSpace)(lastByte)) { 16154 break; 16155 } 16156 16157 (0, _util.info)("Found \"".concat((0, _util.bytesToString)(TRUNCATED_SIGNATURE), "\" when ") + 'searching for endstream command.'); 16158 actualLength = maybeLength; 16159 break; 16160 } 16161 } 16162 16163 if (actualLength < 0) { 16164 throw new _util.FormatError('Missing endstream command.'); 16165 } 16166 } 16167 16168 length = actualLength; 16169 lexer.nextChar(); 16170 this.shift(); 16171 this.shift(); 16172 } 16173 16174 this.shift(); 16175 stream = stream.makeSubStream(startPos, length, dict); 16176 16177 if (cipherTransform) { 16178 stream = cipherTransform.createStream(stream, length); 16179 } 16180 16181 stream = this.filter(stream, dict, length); 16182 stream.dict = dict; 16183 return stream; 16184 }, 16185 filter: function Parser_filter(stream, dict, length) { 16186 var filter = dict.get('Filter', 'F'); 16187 var params = dict.get('DecodeParms', 'DP'); 16188 16189 if ((0, _primitives.isName)(filter)) { 16190 if (Array.isArray(params)) { 16191 (0, _util.warn)('/DecodeParms should not contain an Array, ' + 'when /Filter contains a Name.'); 16192 } 16193 16194 return this.makeFilter(stream, filter.name, length, params); 16195 } 16196 16197 var maybeLength = length; 16198 16199 if (Array.isArray(filter)) { 16200 var filterArray = filter; 16201 var paramsArray = params; 16202 16203 for (var i = 0, ii = filterArray.length; i < ii; ++i) { 16204 filter = this.xref.fetchIfRef(filterArray[i]); 16205 16206 if (!(0, _primitives.isName)(filter)) { 16207 throw new _util.FormatError('Bad filter name: ' + filter); 16208 } 16209 16210 params = null; 16211 16212 if (Array.isArray(paramsArray) && i in paramsArray) { 16213 params = this.xref.fetchIfRef(paramsArray[i]); 16214 } 16215 16216 stream = this.makeFilter(stream, filter.name, maybeLength, params); 16217 maybeLength = null; 16218 } 16219 } 16220 16221 return stream; 16222 }, 16223 makeFilter: function Parser_makeFilter(stream, name, maybeLength, params) { 16224 if (maybeLength === 0) {
16225 (0, _util.warn)('Empty "' + name + '" stream.'); 16226 return new _stream.NullStream(); 16227 } 16228 16229 try { 16230 var xrefStreamStats = this.xref.stats.streamTypes; 16231 16232 if (name === 'FlateDecode' || name === 'Fl') { 16233 xrefStreamStats[_util.StreamType.FLATE] = true; 16234 16235 if (params) { 16236 return new _stream.PredictorStream(new _stream.FlateStream(stream, maybeLength), maybeLength, params); 16237 } 16238 16239 return new _stream.FlateStream(stream, maybeLength); 16240 } 16241 16242 if (name === 'LZWDecode' || name === 'LZW') { 16243 xrefStreamStats[_util.StreamType.LZW] = true; 16244 var earlyChange = 1; 16245 16246 if (params) { 16247 if (params.has('EarlyChange')) { 16248 earlyChange = params.get('EarlyChange'); 16249 } 16250 16251 return new _stream.PredictorStream(new _stream.LZWStream(stream, maybeLength, earlyChange), maybeLength, params); 16252 } 16253 16254 return new _stream.LZWStream(stream, maybeLength, earlyChange); 16255 } 16256 16257 if (name === 'DCTDecode' || name === 'DCT') { 16258 xrefStreamStats[_util.StreamType.DCT] = true; 16259 return new _jpeg_stream.JpegStream(stream, maybeLength, stream.dict, params); 16260 } 16261 16262 if (name === 'JPXDecode' || name === 'JPX') { 16263 xrefStreamStats[_util.StreamType.JPX] = true; 16264 return new _jpx_stream.JpxStream(stream, maybeLength, stream.dict, params); 16265 } 16266 16267 if (name === 'ASCII85Decode' || name === 'A85') { 16268 xrefStreamStats[_util.StreamType.A85] = true; 16269 return new _stream.Ascii85Stream(stream, maybeLength); 16270 } 16271 16272 if (name === 'ASCIIHexDecode' || name === 'AHx') { 16273 xrefStreamStats[_util.StreamType.AHX] = true; 16274 return new _stream.AsciiHexStream(stream, maybeLength); 16275 } 16276 16277 if (name === 'CCITTFaxDecode' || name === 'CCF') { 16278 xrefStreamStats[_util.StreamType.CCF] = true; 16279 return new _ccitt_stream.CCITTFaxStream(stream, maybeLength, params); 16280 } 16281 16282 if (name === 'RunLengthDecode' || name === 'RL') { 16283 xrefStreamStats[_util.StreamType.RL] = true; 16284 return new _stream.RunLengthStream(stream, maybeLength); 16285 } 16286 16287 if (name === 'JBIG2Decode') { 16288 xrefStreamStats[_util.StreamType.JBIG] = true; 16289 return new _jbig2_stream.Jbig2Stream(stream, maybeLength, stream.dict, params); 16290 } 16291 16292 (0, _util.warn)('filter "' + name + '" not supported yet'); 16293 return stream; 16294 } catch (ex) { 16295 if (ex instanceof _util.MissingDataException) { 16296 throw ex; 16297 } 16298 16299 (0, _util.warn)('Invalid stream: \"' + ex + '\"'); 16300 return new _stream.NullStream(); 16301 } 16302 } 16303 }; 16304 return Parser; 16305}(); 16306 16307exports.Parser = Parser; 16308 16309var Lexer = function LexerClosure() { 16310 function Lexer(stream, knownCommands) { 16311 this.stream = stream; 16312 this.nextChar(); 16313 this.strBuf = []; 16314 this.knownCommands = knownCommands; 16315 this.beginInlineImagePos = -1; 16316 } 16317 16318 var specialChars = [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; 16319 16320 function toHexDigit(ch) { 16321 if (ch >= 0x30 && ch <= 0x39) { 16322 return ch & 0x0F; 16323 } 16324 16325 if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { 16326 return (ch & 0x0F) + 9; 16327 } 16328 16329 return -1; 16330 } 16331 16332 Lexer.prototype = { 16333 nextChar: function Lexer_nextChar() { 16334 return this.currentChar = this.stream.getByte(); 16335 }, 16336 peekChar: function Lexer_peekChar() { 16337 return this.stream.peekByte(); 16338 }, 16339 getNumber: function Lexer_getNumber() { 16340 var ch = this.currentChar; 16341 var eNotation = false; 16342 var divideBy = 0; 16343 var sign = 0; 16344 16345 if (ch === 0x2D) { 16346 sign = -1; 16347 ch = this.nextChar(); 16348 16349 if (ch === 0x2D) { 16350 ch = this.nextChar(); 16351 } 16352 } else if (ch === 0x2B) { 16353 sign = 1; 16354 ch = this.nextChar(); 16355 } 16356 16357 if (ch === 0x0A || ch === 0x0D) { 16358 do { 16359 ch = this.nextChar(); 16360 } while (ch === 0x0A || ch === 0x0D); 16361 } 16362 16363 if (ch === 0x2E) { 16364 divideBy = 10; 16365 ch = this.nextChar(); 16366 } 16367 16368 if (ch < 0x30 || ch > 0x39) { 16369 if (divideBy === 10 && sign === 0 && ((0, _util.isSpace)(ch) || ch === -1)) { 16370 (0, _util.warn)('Lexer.getNumber - treating a single decimal point as zero.'); 16371 return 0; 16372 } 16373 16374 throw new _util.FormatError("Invalid number: ".concat(String.fromCharCode(ch), " (char
vendor: 10,371 bytes, lines 16374-16792
16374Code ").concat(ch, ")")); 16375 } 16376 16377 sign = sign || 1; 16378 var baseValue = ch - 0x30; 16379 var powerValue = 0; 16380 var powerValueSign = 1; 16381 16382 while ((ch = this.nextChar()) >= 0) { 16383 if (0x30 <= ch && ch <= 0x39) { 16384 var currentDigit = ch - 0x30; 16385 16386 if (eNotation) { 16387 powerValue = powerValue * 10 + currentDigit; 16388 } else { 16389 if (divideBy !== 0) { 16390 divideBy *= 10; 16391 } 16392 16393 baseValue = baseValue * 10 + currentDigit; 16394 } 16395 } else if (ch === 0x2E) { 16396 if (divideBy === 0) { 16397 divideBy = 1; 16398 } else { 16399 break; 16400 } 16401 } else if (ch === 0x2D) { 16402 (0, _util.warn)('Badly formatted number'); 16403 } else if (ch === 0x45 || ch === 0x65) { 16404 ch = this.peekChar(); 16405 16406 if (ch === 0x2B || ch === 0x2D) { 16407 powerValueSign = ch === 0x2D ? -1 : 1; 16408 this.nextChar(); 16409 } else if (ch < 0x30 || ch > 0x39) { 16410 break; 16411 } 16412 16413 eNotation = true; 16414 } else { 16415 break; 16416 } 16417 } 16418 16419 if (divideBy !== 0) { 16420 baseValue /= divideBy; 16421 } 16422 16423 if (eNotation) { 16424 baseValue *= Math.pow(10, powerValueSign * powerValue); 16425 } 16426 16427 return sign * baseValue; 16428 }, 16429 getString: function Lexer_getString() { 16430 var numParen = 1; 16431 var done = false; 16432 var strBuf = this.strBuf; 16433 strBuf.length = 0; 16434 var ch = this.nextChar(); 16435 16436 while (true) { 16437 var charBuffered = false; 16438 16439 switch (ch | 0) { 16440 case -1: 16441 (0, _util.warn)('Unterminated string'); 16442 done = true; 16443 break; 16444 16445 case 0x28: 16446 ++numParen; 16447 strBuf.push('('); 16448 break; 16449 16450 case 0x29: 16451 if (--numParen === 0) { 16452 this.nextChar(); 16453 done = true; 16454 } else { 16455 strBuf.push(')'); 16456 } 16457 16458 break; 16459 16460 case 0x5C: 16461 ch = this.nextChar(); 16462 16463 switch (ch) { 16464 case -1: 16465 (0, _util.warn)('Unterminated string'); 16466 done = true; 16467 break; 16468 16469 case 0x6E: 16470 strBuf.push('\n'); 16471 break; 16472 16473 case 0x72: 16474 strBuf.push('\r'); 16475 break; 16476 16477 case 0x74: 16478 strBuf.push('\t'); 16479 break; 16480 16481 case 0x62: 16482 strBuf.push('\b'); 16483 break; 16484 16485 case 0x66: 16486 strBuf.push('\f'); 16487 break; 16488 16489 case 0x5C: 16490 case 0x28: 16491 case 0x29: 16492 strBuf.push(String.fromCharCode(ch)); 16493 break; 16494 16495 case 0x30: 16496 case 0x31: 16497 case 0x32: 16498 case 0x33: 16499 case 0x34: 16500 case 0x35: 16501 case 0x36: 16502 case 0x37: 16503 var x = ch & 0x0F; 16504 ch = this.nextChar(); 16505 charBuffered = true; 16506 16507 if (ch >= 0x30 && ch <= 0x37) { 16508 x = (x << 3) + (ch & 0x0F); 16509 ch = this.nextChar(); 16510 16511 if (ch >= 0x30 && ch <= 0x37) { 16512 charBuffered = false; 16513 x = (x << 3) + (ch & 0x0F); 16514 } 16515 } 16516 16517 strBuf.push(String.fromCharCode(x)); 16518 break; 16519 16520 case 0x0D: 16521 if (this.peekChar() === 0x0A) { 16522 this.nextChar(); 16523 } 16524 16525 break; 16526 16527 case 0x0A: 16528 break; 16529 16530 default: 16531 strBuf.push(String.fromCharCode(ch)); 16532 break; 16533 } 16534 16535 break; 16536 16537 default: 16538 strBuf.push(String.fromCharCode(ch)); 16539 break; 16540 } 16541 16542 if (done) { 16543 break; 16544 } 16545 16546 if (!charBuffered) { 16547 ch = this.nextChar(); 16548 } 16549 } 16550 16551 return strBuf.join(''); 16552 }, 16553 getName: function Lexer_getName() { 16554 var ch, previousCh; 16555 var strBuf = this.strBuf; 16556 strBuf.length = 0; 16557 16558 while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { 16559 if (ch === 0x23) { 16560 ch = this.nextChar(); 16561 16562 if (specialChars[ch]) { 16563 (0, _util.warn)('Lexer_getName: ' + 'NUMBER SIGN (#) should be followed by a hexadecimal number.'); 16564 strBuf.push('#'); 16565 break; 16566 } 16567 16568 var x = toHexDigit(ch); 16569 16570 if (x !== -1) { 16571 previousCh = ch; 16572 ch = this.nextChar(); 16573 var x2 = toHexDigit(ch); 16574 16575 if (x2 === -1) { 16576 (0, _util.warn)('Lexer_getName: Illegal digit (' + String.fromCharCode(ch) + ') in hexadecimal number.'); 16577 strBuf.push('#', String.fromCharCode(previousCh)); 16578 16579 if (specialChars[ch]) { 16580 break; 16581 } 16582 16583 strBuf.push(String.fromCharCode(ch)); 16584 continue; 16585 } 16586 16587 strBuf.push(String.fromCharCode(x << 4 | x2)); 16588 } else { 16589 strBuf.push('#', String.fromCharCode(ch)); 16590 } 16591 } else { 16592 strBuf.push(String.fromCharCode(ch)); 16593 } 16594 } 16595 16596 if (strBuf.length > 127) { 16597 (0, _util.warn)('name token is longer than allowed by the spec: ' + strBuf.length); 16598 } 16599 16600 return _primitives.Name.get(strBuf.join('')); 16601 }, 16602 getHexString: function Lexer_getHexString() { 16603 var strBuf = this.strBuf; 16604 strBuf.length = 0; 16605 var ch = this.currentChar; 16606 var isFirstHex = true; 16607 var firstDigit; 16608 var secondDigit; 16609 16610 while (true) { 16611 if (ch < 0) { 16612 (0, _util.warn)('Unterminated hex string'); 16613 break; 16614 } else if (ch === 0x3E) { 16615 this.nextChar(); 16616 break; 16617 } else if (specialChars[ch] === 1) { 16618 ch = this.nextChar(); 16619 continue; 16620 } else { 16621 if (isFirstHex) { 16622 firstDigit = toHexDigit(ch); 16623 16624 if (firstDigit === -1) { 16625 (0, _util.warn)('Ignoring invalid character "' + ch + '" in hex string'); 16626 ch = this.nextChar(); 16627 continue; 16628 } 16629 } else { 16630 secondDigit = toHexDigit(ch); 16631 16632 if (secondDigit === -1) { 16633 (0, _util.warn)('Ignoring invalid character "' + ch + '" in hex string'); 16634 ch = this.nextChar(); 16635 continue; 16636 } 16637 16638 strBuf.push(String.fromCharCode(firstDigit << 4 | secondDigit)); 16639 } 16640 16641 isFirstHex = !isFirstHex; 16642 ch = this.nextChar(); 16643 } 16644 } 16645 16646 return strBuf.join(''); 16647 }, 16648 getObj: function Lexer_getObj() { 16649 var comment = false; 16650 var ch = this.currentChar; 16651 16652 while (true) { 16653 if (ch < 0) { 16654 return _primitives.EOF; 16655 } 16656 16657 if (comment) { 16658 if (ch === 0x0A || ch === 0x0D) { 16659 comment = false; 16660 } 16661 } else if (ch === 0x25) { 16662 comment = true; 16663 } else if (specialChars[ch] !== 1) { 16664 break; 16665 } 16666 16667 ch = this.nextChar(); 16668 } 16669 16670 switch (ch | 0) { 16671 case 0x30: 16672 case 0x31: 16673 case 0x32: 16674 case 0x33: 16675 case 0x34: 16676 case 0x35: 16677 case 0x36: 16678 case 0x37: 16679 case 0x38: 16680 case 0x39: 16681 case 0x2B: 16682 case 0x2D: 16683 case 0x2E: 16684 return this.getNumber(); 16685 16686 case 0x28: 16687 return this.getString(); 16688 16689 case 0x2F: 16690 return this.getName(); 16691 16692 case 0x5B: 16693 this.nextChar(); 16694 return _primitives.Cmd.get('['); 16695 16696 case 0x5D: 16697 this.nextChar(); 16698 return _primitives.Cmd.get(']'); 16699 16700 case 0x3C: 16701 ch = this.nextChar(); 16702 16703 if (ch === 0x3C) { 16704 this.nextChar(); 16705 return _primitives.Cmd.get('<<'); 16706 } 16707 16708 return this.getHexString(); 16709 16710 case 0x3E: 16711 ch = this.nextChar(); 16712 16713 if (ch === 0x3E) { 16714 this.nextChar(); 16715 return _primitives.Cmd.get('>>'); 16716 } 16717 16718 return _primitives.Cmd.get('>'); 16719 16720 case 0x7B: 16721 this.nextChar(); 16722 return _primitives.Cmd.get('{'); 16723 16724 case 0x7D: 16725 this.nextChar(); 16726 return _primitives.Cmd.get('}'); 16727 16728 case 0x29: 16729 this.nextChar(); 16730 throw new _util.FormatError("Illegal character: ".concat(ch)); 16731 } 16732 16733 var str = String.fromCharCode(ch); 16734 var knownCommands = this.knownCommands; 16735 var knownCommandFound = knownCommands && knownCommands[str] !== undefined; 16736 16737 while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { 16738 var possibleCommand = str + String.fromCharCode(ch); 16739 16740 if (knownCommandFound && knownCommands[possibleCommand] === undefined) { 16741 break; 16742 } 16743 16744 if (str.length === 128) { 16745 throw new _util.FormatError("Command token too long: ".concat(str.length)); 16746 } 16747 16748 str = possibleCommand; 16749 knownCommandFound = knownCommands && knownCommands[str] !== undefined; 16750 } 16751 16752 if (str === 'true') { 16753 return true; 16754 } 16755 16756 if (str === 'false') { 16757 return false; 16758 } 16759 16760 if (str === 'null') { 16761 return null; 16762 } 16763 16764 if (str === 'BI') { 16765 this.beginInlineImagePos = this.stream.pos; 16766 } 16767 16768 return _primitives.Cmd.get(str); 16769 }, 16770 skipToNextLine: function Lexer_skipToNextLine() { 16771 var ch = this.currentChar; 16772 16773 while (ch >= 0) { 16774 if (ch === 0x0D) { 16775 ch = this.nextChar(); 16776 16777 if (ch === 0x0A) { 16778 this.nextChar(); 16779 } 16780 16781 break; 16782 } else if (ch === 0x0A) { 16783 this.nextChar(); 16784 break; 16785 } 16786 16787 ch = this.nextChar(); 16788 } 16789 } 16790 }; 16791 return Lexer; 16792}();
16793 16794exports.Lexer = Lexer; 16795var Linearization = { 16796 create: function LinearizationCreate(stream) { 16797 function getInt(name, allowZeroValue) { 16798 var obj = linDict.get(name); 16799 16800 if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) { 16801 return obj; 16802 } 16803 16804 throw new Error('The "' + name + '" parameter in the linearization ' + 'dictionary is invalid.'); 16805 } 16806 16807 function getHints() { 16808 var hints = linDict.get('H'), 16809 hintsLength, 16810 item; 16811 16812 if (Array.isArray(hints) && ((hintsLength = hints.length) === 2 || hintsLength === 4)) { 16813 for (var index = 0; index < hintsLength; index++) { 16814 if (!(Number.isInteger(item = hints[index]) && item > 0)) { 16815 throw new Error('Hint (' + index + ') in the linearization dictionary is invalid.'); 16816 } 16817 } 16818 16819 return hints; 16820 } 16821 16822 throw new Error('Hint array in the linearization dictionary is invalid.'); 16823 } 16824 16825 var parser = new Parser(new Lexer(stream), false, null); 16826 var obj1 = parser.getObj(); 16827 var obj2 = parser.getObj(); 16828 var obj3 = parser.getObj(); 16829 var linDict = parser.getObj(); 16830 var obj, length; 16831 16832 if (!(Number.isInteger(obj1) && Number.isInteger(obj2) && (0, _primitives.isCmd)(obj3, 'obj') && (0, _primitives.isDict)(linDict) && (0, _util.isNum)(obj = linDict.get('Linearized')) && obj > 0)) { 16833 return null; 16834 } else if ((length = getInt('L')) !== stream.length) { 16835 throw new Error('The "L" parameter in the linearization dictionary ' + 'does not equal the stream length.'); 16836 } 16837 16838 return { 16839 length: length, 16840 hints: getHints(), 16841 objectNumberFirst: getInt('O'), 16842 endFirst: getInt('E'), 16843 numPages: getInt('N'), 16844 mainXRefEntriesOffset: getInt('T'), 16845 pageFirst: linDict.has('P') ? getInt('P', true) : 0 16846 }; 16847 } 16848}; 16849exports.Linearization = Linearization; 16850 16851/***/ }), 16852/* 157 */ 16853/***/ (function(module, exports, __w_pdfjs_require__) { 16854 16855"use strict"; 16856 16857 16858Object.defineProperty(exports, "__esModule", { 16859 value: true 16860}); 16861exports.LZWStream = exports.StringStream = exports.StreamsSequenceStream = exports.Stream = exports.RunLengthStream = exports.PredictorStream = exports.NullStream = exports.FlateStream = exports.DecodeStream = exports.DecryptStream = exports.AsciiHexStream = exports.Ascii85Stream = void 0; 16862 16863var _util = __w_pdfjs_require__(6); 16864 16865var _primitives = __w_pdfjs_require__(155); 16866 16867function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); } 16868 16869function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); } 16870 16871function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); } 16872 16873function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } } 16874 16875var Stream = function StreamClosure() { 16876 function Stream(arrayBuffer, start, length, dict) { 16877 this.bytes = arrayBuffer instanceof Uint8Array ? arrayBuffer : new Uint8Array(arrayBuffer); 16878 this.start = start || 0; 16879 this.pos = this.start; 16880 this.end = start + length || this.bytes.length; 16881 this.dict = dict; 16882 } 16883 16884 Stream.prototype = { 16885 get length() { 16886 return this.end - this.start; 16887 }, 16888 16889 get isEmpty() { 16890 return this.length === 0; 16891 }, 16892 16893 getByte: function Stream_getByte() { 16894 if (this.pos >= this.end) { 16895 return -1; 16896 } 16897 16898 return this.bytes[this.pos++]; 16899 }, 16900 getUint16: function Stream_getUint16() { 16901 var b0 = this.getByte(); 16902 var b1 = this.getByte(); 16903 16904 if (b0 === -1 || b1 === -1) { 16905 return -1; 16906 } 16907 16908 return (b0 << 8) + b1; 16909 }, 16910 getInt32: function Stream_getInt32() { 16911 var b0 = this.getByte(); 16912 var b1 = this.getByte(); 16913 var b2 = this.getByte(); 16914 var b3 = this.getByte(); 16915 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 16916 }, 16917 getBytes: function getBytes(length) { 16918 var forceClamped = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 16919 var bytes = this.bytes; 16920 var pos = this.pos; 16921 var strEnd = this.end; 16922 16923 if (!length) { 16924 var _subarray = bytes.subarray(pos, strEnd); 16925 16926 return forceClamped ? new Uint8ClampedArray(_subarray) : _subarray; 16927 } 16928 16929 var end = pos + length; 16930 16931 if (end > strEnd) { 16932 end = strEnd; 16933 } 16934 16935 this.pos = end; 16936 var subarray = bytes.subarray(pos, end); 16937 return forceClamped ? new Uint8ClampedArray(subarray) : subarray; 16938 }, 16939 peekByte: function Stream_peekByte() { 16940 var peekedByte = this.getByte(); 16941 this.pos--; 16942 return peekedByte; 16943 }, 16944 peekBytes: function peekBytes(length) { 16945 var forceClamped = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 16946 var bytes = this.getBytes(length, forceClamped); 16947 this.pos -= bytes.length; 16948 return bytes; 16949 }, 16950 skip: function Stream_skip(n) { 16951 if (!n) { 16952 n = 1; 16953 } 16954 16955 this.pos += n; 16956 }, 16957 reset: function Stream_reset() { 16958 this.pos = this.start; 16959 }, 16960 moveStart: function Stream_moveStart() { 16961 this.start = this.pos; 16962 }, 16963 makeSubStream: function Stream_makeSubStream(start, length, dict) { 16964 return new Stream(this.bytes.buffer, start, length, dict); 16965 } 16966 }; 16967 return Stream; 16968}();
16969 16970exports.Stream = Stream; 16971 16972var StringStream = function StringStreamClosure() { 16973 function StringStream(str) { 16974 var bytes = (0, _util.stringToBytes)(str); 16975 Stream.call(this, bytes); 16976 } 16977 16978 StringStream.prototype = Stream.prototype; 16979 return StringStream; 16980}(); 16981 16982exports.StringStream = StringStream; 16983 16984var DecodeStream = function DecodeStreamClosure() { 16985 var emptyBuffer = new Uint8Array(0); 16986 16987 function DecodeStream(maybeMinBufferLength) { 16988 this._rawMinBufferLength = maybeMinBufferLength || 0; 16989 this.pos = 0; 16990 this.bufferLength = 0; 16991 this.eof = false; 16992 this.buffer = emptyBuffer; 16993 this.minBufferLength = 512; 16994 16995 if (maybeMinBufferLength) { 16996 while (this.minBufferLength < maybeMinBufferLength) { 16997 this.minBufferLength *= 2; 16998 } 16999 } 17000 } 17001 17002 DecodeStream.prototype = { 17003 get isEmpty() { 17004 while (!this.eof && this.bufferLength === 0) { 17005 this.readBlock(); 17006 } 17007 17008 return this.bufferLength === 0; 17009 }, 17010 17011 ensureBuffer: function DecodeStream_ensureBuffer(requested) { 17012 var buffer = this.buffer; 17013 17014 if (requested <= buffer.byteLength) { 17015 return buffer; 17016 } 17017 17018 var size = this.minBufferLength; 17019 17020 while (size < requested) { 17021 size *= 2; 17022 } 17023 17024 var buffer2 = new Uint8Array(size); 17025 buffer2.set(buffer); 17026 return this.buffer = buffer2; 17027 }, 17028 getByte: function DecodeStream_getByte() { 17029 var pos = this.pos; 17030 17031 while (this.bufferLength <= pos) { 17032 if (this.eof) { 17033 return -1; 17034 } 17035 17036 this.readBlock(); 17037 } 17038 17039 return this.buffer[this.pos++]; 17040 }, 17041 getUint16: function DecodeStream_getUint16() { 17042 var b0 = this.getByte(); 17043 var b1 = this.getByte(); 17044 17045 if (b0 === -1 || b1 === -1) { 17046 return -1; 17047 } 17048 17049 return (b0 << 8) + b1; 17050 }, 17051 getInt32: function DecodeStream_getInt32() { 17052 var b0 = this.getByte(); 17053 var b1 = this.getByte(); 17054 var b2 = this.getByte(); 17055 var b3 = this.getByte(); 17056 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 17057 }, 17058 getBytes: function getBytes(length) { 17059 var forceClamped = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 17060 var end, 17061 pos = this.pos; 17062 17063 if (length) { 17064 this.ensureBuffer(pos + length); 17065 end = pos + length; 17066 17067 while (!this.eof && this.bufferLength < end) { 17068 this.readBlock(); 17069 } 17070 17071 var bufEnd = this.bufferLength; 17072 17073 if (end > bufEnd) { 17074 end = bufEnd; 17075 } 17076 } else { 17077 while (!this.eof) { 17078 this.readBlock(); 17079 } 17080 17081 end = this.bufferLength; 17082 } 17083 17084 this.pos = end; 17085 var subarray = this.buffer.subarray(pos, end); 17086 return forceClamped && !(subarray instanceof Uint8ClampedArray) ? new Uint8ClampedArray(subarray) : subarray; 17087 }, 17088 peekByte: function DecodeStream_peekByte() { 17089 var peekedByte = this.getByte(); 17090 this.pos--; 17091 return peekedByte; 17092 }, 17093 peekBytes: function peekBytes(length) { 17094 var forceClamped = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 17095 var bytes = this.getBytes(length, forceClamped); 17096 this.pos -= bytes.length; 17097 return bytes; 17098 }, 17099 makeSubStream: function DecodeStream_makeSubStream(start, length, dict) { 17100 var end = start + length; 17101 17102 while (this.bufferLength <= end && !this.eof) { 17103 this.readBlock(); 17104 } 17105 17106 return new Stream(this.buffer, start, length, dict); 17107 }, 17108 skip: function DecodeStream_skip(n) { 17109 if (!n) { 17110 n = 1; 17111 } 17112 17113 this.pos += n; 17114 }, 17115 reset: function DecodeStream_reset() { 17116 this.pos = 0; 17117 }, 17118 getBaseStreams: function DecodeStream_getBaseStreams() { 17119 if (this.str && this.str.getBaseStreams) { 17120 return this.str.getBaseStreams(); 17121 } 17122 17123 return []; 17124 } 17125 }; 17126 return DecodeStream; 17127}(); 17128 17129exports.DecodeStream = DecodeStream; 17130 17131var StreamsSequenceStream = function StreamsSequenceStreamClosure() { 17132 function StreamsSequenceStream(streams) { 17133 this.streams = streams; 17134 var maybeLength = 0; 17135 17136 for (var i = 0, ii = streams.length; i < ii; i++) { 17137 var stream = streams[i]; 17138 17139 if (stream instanceof DecodeStream) { 17140 maybeLength += stream._rawMinBufferLength; 17141 } else { 17142 maybeLength += stream.length; 17143 } 17144 } 17145 17146 DecodeStream.call(this, maybeLength); 17147 } 17148 17149 StreamsSequenceStream.prototype = Object.create(DecodeStream.prototype); 17150 17151 StreamsSequenceStream.prototype.readBlock = function streamSequenceStreamReadBlock() { 17152 var streams = this.streams; 17153 17154 if (streams.length === 0) { 17155 this.eof = true; 17156 return; 17157 } 17158 17159 var stream = streams.shift(); 17160 var chunk = stream.getBytes(); 17161 var bufferLength = this.bufferLength; 17162 var newLength = bufferLength + chunk.length; 17163 var buffer = this.ensureBuffer(newLength); 17164 buffer.set(chunk, bufferLength); 17165 this.bufferLength = newLength; 17166 }; 17167 17168 StreamsSequenceStream.prototype.getBaseStreams = function StreamsSequenceStream_getBaseStreams() { 17169 var baseStreams = []; 17170 17171 for (var i = 0, ii = this.streams.length; i < ii; i++) { 17172 var stream = this.streams[i]; 17173 17174 if (stream.getBaseStreams) { 17175 baseStreams.push.apply(baseStreams, _toConsumableArray(stream.getBaseStreams())); 17176 } 17177 } 17178 17179 return baseStreams; 17180 }; 17181 17182 return StreamsSequenceStream; 17183}();
17184 17185exports.StreamsSequenceStream = StreamsSequenceStream; 17186 17187var FlateStream = function FlateStreamClosure() { 17188 var codeLenCodeMap = new Int32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); 17189 var lengthDecode = new Int32Array([0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102]); 17190 var distDecode = new Int32Array([0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001]); 17191 var fixedLitCodeTab = [new Int32Array([0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b,
vendor: 5,420 bytes, lines 17191-17381
171910x900f7, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff]), 9]; 17192 var fixedDistCodeTab = [new Int32Array([0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000]), 5]; 17193 17194 function FlateStream(str, maybeLength) { 17195 this.str = str; 17196 this.dict = str.dict; 17197 var cmf = str.getByte(); 17198 var flg = str.getByte(); 17199 17200 if (cmf === -1 || flg === -1) { 17201 throw new _util.FormatError("Invalid header in flate stream: ".concat(cmf, ", ").concat(flg)); 17202 } 17203 17204 if ((cmf & 0x0f) !== 0x08) { 17205 throw new _util.FormatError("Unknown compression method in flate stream: ".concat(cmf, ", ").concat(flg)); 17206 } 17207 17208 if (((cmf << 8) + flg) % 31 !== 0) { 17209 throw new _util.FormatError("Bad FCHECK in flate stream: ".concat(cmf, ", ").concat(flg)); 17210 } 17211 17212 if (flg & 0x20) { 17213 throw new _util.FormatError("FDICT bit set in flate stream: ".concat(cmf, ", ").concat(flg)); 17214 } 17215 17216 this.codeSize = 0; 17217 this.codeBuf = 0; 17218 DecodeStream.call(this, maybeLength); 17219 } 17220 17221 FlateStream.prototype = Object.create(DecodeStream.prototype); 17222 17223 FlateStream.prototype.getBits = function FlateStream_getBits(bits) { 17224 var str = this.str; 17225 var codeSize = this.codeSize; 17226 var codeBuf = this.codeBuf; 17227 var b; 17228 17229 while (codeSize < bits) { 17230 if ((b = str.getByte()) === -1) { 17231 throw new _util.FormatError('Bad encoding in flate stream'); 17232 } 17233 17234 codeBuf |= b << codeSize; 17235 codeSize += 8; 17236 } 17237 17238 b = codeBuf & (1 << bits) - 1; 17239 this.codeBuf = codeBuf >> bits; 17240 this.codeSize = codeSize -= bits; 17241 return b; 17242 }; 17243 17244 FlateStream.prototype.getCode = function FlateStream_getCode(table) { 17245 var str = this.str; 17246 var codes = table[0]; 17247 var maxLen = table[1]; 17248 var codeSize = this.codeSize; 17249 var codeBuf = this.codeBuf; 17250 var b; 17251 17252 while (codeSize < maxLen) { 17253 if ((b = str.getByte()) === -1) { 17254 break; 17255 } 17256 17257 codeBuf |= b << codeSize; 17258 codeSize += 8; 17259 } 17260 17261 var code = codes[codeBuf & (1 << maxLen) - 1]; 17262 var codeLen = code >> 16; 17263 var codeVal = code & 0xffff; 17264 17265 if (codeLen < 1 || codeSize < codeLen) { 17266 throw new _util.FormatError('Bad encoding in flate stream'); 17267 } 17268 17269 this.codeBuf = codeBuf >> codeLen; 17270 this.codeSize = codeSize - codeLen; 17271 return codeVal; 17272 }; 17273 17274 FlateStream.prototype.generateHuffmanTable = function flateStreamGenerateHuffmanTable(lengths) { 17275 var n = lengths.length; 17276 var maxLen = 0; 17277 var i; 17278 17279 for (i = 0; i < n; ++i) { 17280 if (lengths[i] > maxLen) { 17281 maxLen = lengths[i]; 17282 } 17283 } 17284 17285 var size = 1 << maxLen; 17286 var codes = new Int32Array(size); 17287 17288 for (var len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) { 17289 for (var val = 0; val < n; ++val) { 17290 if (lengths[val] === len) { 17291 var code2 = 0; 17292 var t = code; 17293 17294 for (i = 0; i < len; ++i) { 17295 code2 = code2 << 1 | t & 1; 17296 t >>= 1; 17297 } 17298 17299 for (i = code2; i < size; i += skip) { 17300 codes[i] = len << 16 | val; 17301 } 17302 17303 ++code; 17304 } 17305 } 17306 } 17307 17308 return [codes, maxLen]; 17309 }; 17310 17311 FlateStream.prototype.readBlock = function FlateStream_readBlock() { 17312 var buffer, len; 17313 var str = this.str; 17314 var hdr = this.getBits(3); 17315 17316 if (hdr & 1) { 17317 this.eof = true; 17318 } 17319 17320 hdr >>= 1; 17321 17322 if (hdr === 0) { 17323 var b; 17324 17325 if ((b = str.getByte()) === -1) { 17326 throw new _util.FormatError('Bad block header in flate stream'); 17327 } 17328 17329 var blockLen = b; 17330 17331 if ((b = str.getByte()) === -1) { 17332 throw new _util.FormatError('Bad block header in flate stream'); 17333 } 17334 17335 blockLen |= b << 8; 17336 17337 if ((b = str.getByte()) === -1) { 17338 throw new _util.FormatError('Bad block header in flate stream'); 17339 } 17340 17341 var check = b; 17342 17343 if ((b = str.getByte()) === -1) { 17344 throw new _util.FormatError('Bad block header in flate stream'); 17345 } 17346 17347 check |= b << 8; 17348 17349 if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) { 17350 throw new _util.FormatError('Bad uncompressed block length in flate stream'); 17351 } 17352 17353 this.codeBuf = 0; 17354 this.codeSize = 0; 17355 var bufferLength = this.bufferLength; 17356 buffer = this.ensureBuffer(bufferLength + blockLen); 17357 var end = bufferLength + blockLen; 17358 this.bufferLength = end; 17359 17360 if (blockLen === 0) { 17361 if (str.peekByte() === -1) { 17362 this.eof = true; 17363 } 17364 } else { 17365 for (var n = bufferLength; n < end; ++n) { 17366 if ((b = str.getByte()) === -1) { 17367 this.eof = true; 17368 break; 17369 } 17370 17371 buffer[n] = b; 17372 } 17373 } 17374 17375 return; 17376 } 17377 17378 var litCodeTable; 17379 var distCodeTable; 17380 17381 if (hdr === 1) {
17382 litCodeTable = fixedLitCodeTab; 17383 distCodeTable = fixedDistCodeTab; 17384 } else if (hdr === 2) { 17385 var numLitCodes = this.getBits(5) + 257; 17386 var numDistCodes = this.getBits(5) + 1; 17387 var numCodeLenCodes = this.getBits(4) + 4; 17388 var codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length); 17389 var i; 17390 17391 for (i = 0; i < numCodeLenCodes; ++i) { 17392 codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3); 17393 } 17394 17395 var codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); 17396 len = 0; 17397 i = 0; 17398 var codes = numLitCodes + numDistCodes; 17399 var codeLengths = new Uint8Array(codes); 17400 var bitsLength, bitsOffset, what; 17401 17402 while (i < codes) { 17403 var code = this.getCode(codeLenCodeTab); 17404 17405 if (code === 16) { 17406 bitsLength = 2; 17407 bitsOffset = 3; 17408 what = len; 17409 } else if (code === 17) { 17410 bitsLength = 3; 17411 bitsOffset = 3; 17412 what = len = 0; 17413 } else if (code === 18) { 17414 bitsLength = 7; 17415 bitsOffset = 11; 17416 what = len = 0; 17417 } else { 17418 codeLengths[i++] = len = code; 17419 continue; 17420 } 17421 17422 var repeatLength = this.getBits(bitsLength) + bitsOffset; 17423 17424 while (repeatLength-- > 0) { 17425 codeLengths[i++] = what; 17426 } 17427 } 17428 17429 litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes)); 17430 distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes)); 17431 } else { 17432 throw new _util.FormatError('Unknown block type in flate stream'); 17433 } 17434 17435 buffer = this.buffer; 17436 var limit = buffer ? buffer.length : 0; 17437 var pos = this.bufferLength; 17438 17439 while (true) { 17440 var code1 = this.getCode(litCodeTable); 17441 17442 if (code1 < 256) { 17443 if (pos + 1 >= limit) { 17444 buffer = this.ensureBuffer(pos + 1); 17445 limit = buffer.length; 17446 } 17447 17448 buffer[pos++] = code1; 17449 continue; 17450 } 17451 17452 if (code1 === 256) { 17453 this.bufferLength = pos; 17454 return; 17455 } 17456 17457 code1 -= 257; 17458 code1 = lengthDecode[code1]; 17459 var code2 = code1 >> 16; 17460 17461 if (code2 > 0) { 17462 code2 = this.getBits(code2); 17463 } 17464 17465 len = (code1 & 0xffff) + code2; 17466 code1 = this.getCode(distCodeTable); 17467 code1 = distDecode[code1]; 17468 code2 = code1 >> 16; 17469 17470 if (code2 > 0) { 17471 code2 = this.getBits(code2); 17472 } 17473 17474 var dist = (code1 & 0xffff) + code2; 17475 17476 if (pos + len >= limit) { 17477 buffer = this.ensureBuffer(pos + len); 17478 limit = buffer.length; 17479 } 17480 17481 for (var k = 0; k < len; ++k, ++pos) { 17482 buffer[pos] = buffer[pos - dist]; 17483 } 17484 } 17485 }; 17486 17487 return FlateStream; 17488}(); 17489 17490exports.FlateStream = FlateStream; 17491 17492var PredictorStream = function PredictorStreamClosure() { 17493 function PredictorStream(str, maybeLength, params) { 17494 if (!(0, _primitives.isDict)(params)) { 17495 return str; 17496 } 17497 17498 var predictor = this.predictor = params.get('Predictor') || 1; 17499 17500 if (predictor <= 1) { 17501 return str; 17502 } 17503 17504 if (predictor !== 2 && (predictor < 10 || predictor > 15)) { 17505 throw new _util.FormatError("Unsupported predictor: ".concat(predictor)); 17506 } 17507 17508 if (predictor === 2) { 17509 this.readBlock = this.readBlockTiff; 17510 } else { 17511 this.readBlock = this.readBlockPng; 17512 } 17513 17514 this.str = str; 17515 this.dict = str.dict; 17516 var colors = this.colors = params.get('Colors') || 1; 17517 var bits = this.bits = params.get('BitsPerComponent') || 8; 17518 var columns = this.columns = params.get('Columns') || 1; 17519 this.pixBytes = colors * bits + 7 >> 3; 17520 this.rowBytes = columns * colors * bits + 7 >> 3; 17521 DecodeStream.call(this, maybeLength); 17522 return this; 17523 } 17524 17525 PredictorStream.prototype = Object.create(DecodeStream.prototype); 17526 17527 PredictorStream.prototype.readBlockTiff = function predictorStreamReadBlockTiff() { 17528 var rowBytes = this.rowBytes; 17529 var bufferLength = this.bufferLength; 17530 var buffer = this.ensureBuffer(bufferLength + rowBytes); 17531 var bits = this.bits; 17532 var colors = this.colors; 17533 var rawBytes = this.str.getBytes(rowBytes); 17534 this.eof = !rawBytes.length; 17535 17536 if (this.eof) { 17537 return; 17538 } 17539 17540 var inbuf = 0, 17541 outbuf = 0; 17542 var inbits = 0, 17543 outbits = 0; 17544 var pos = bufferLength; 17545 var i; 17546 17547 if (bits === 1 && colors === 1) { 17548 for (i = 0; i < rowBytes; ++i) { 17549 var c = rawBytes[i] ^ inbuf; 17550 c ^= c >> 1; 17551 c ^= c >> 2; 17552 c ^= c >> 4; 17553 inbuf = (c & 1) << 7; 17554 buffer[pos++] = c; 17555 } 17556 } else if (bits === 8) { 17557 for (i = 0; i < colors; ++i) { 17558 buffer[pos++] = rawBytes[i]; 17559 } 17560 17561 for (; i < rowBytes; ++i) { 17562 buffer[pos] = buffer[pos - colors] + rawBytes[i]; 17563 pos++; 17564 } 17565 } else if (bits === 16) { 17566 var bytesPerPixel = colors * 2; 17567 17568 for (i = 0; i < bytesPerPixel; ++i) { 17569 buffer[pos++] = rawBytes[i]; 17570 } 17571 17572 for (; i < rowBytes; i += 2) { 17573 var sum = ((rawBytes[i] & 0xFF) << 8) + (rawBytes[i + 1] & 0xFF) + ((buffer[pos - bytesPerPixel] & 0xFF) << 8) + (buffer[pos - bytesPerPixel + 1] & 0xFF); 17574 buffer[pos++] = sum >> 8 & 0xFF; 17575 buffer[pos++] = sum & 0xFF; 17576 } 17577 } else { 17578 var compArray = new Uint8Array(colors + 1); 17579 var bitMask = (1 << bits) - 1; 17580 var j = 0, 17581 k = bufferLength; 17582 var columns = this.columns; 17583 17584 for (i = 0; i < columns; ++i) { 17585 for (var kk = 0; kk < colors; ++kk) { 17586 if (inbits < bits) { 17587 inbuf = inbuf << 8 | rawBytes[j++] & 0xFF; 17588 inbits += 8; 17589 } 17590 17591 compArray[kk] = compArray[kk] + (inbuf >> inbits - bits) & bitMask; 17592 inbits -= bits; 17593 outbuf = outbuf << bits | compArray[kk]; 17594 outbits += bits; 17595 17596 if (outbits >= 8) { 17597 buffer[k++] = outbuf >> outbits - 8 & 0xFF; 17598 outbits -= 8; 17599 } 17600 } 17601 } 17602 17603 if (outbits > 0) { 17604 buffer[k++] = (outbuf << 8 - outbits) + (inbuf & (1 << 8 - outbits) - 1); 17605 } 17606 } 17607 17608 this.bufferLength += rowBytes; 17609 }; 17610 17611 PredictorStream.prototype.readBlockPng = function predictorStreamReadBlockPng() { 17612 var rowBytes = this.rowBytes; 17613 var pixBytes = this.pixBytes; 17614 var predictor = this.str.getByte(); 17615 var rawBytes = this.str.getBytes(rowBytes); 17616 this.eof = !rawBytes.length; 17617 17618 if (this.eof) { 17619 return; 17620 } 17621 17622 var bufferLength = this.bufferLength; 17623 var buffer = this.ensureBuffer(bufferLength + rowBytes); 17624 var prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); 17625 17626 if (prevRow.length === 0) { 17627 prevRow = new Uint8Array(rowBytes); 17628 } 17629 17630 var i, 17631 j = bufferLength, 17632 up, 17633 c; 17634 17635 switch (predictor) { 17636 case 0: 17637 for (i = 0; i < rowBytes; ++i) { 17638 buffer[j++] = rawBytes[i]; 17639 } 17640 17641 break; 17642 17643 case 1: 17644 for (i = 0; i < pixBytes; ++i) { 17645 buffer[j++] = rawBytes[i]; 17646 } 17647 17648 for (; i < rowBytes; ++i) { 17649 buffer[j] = buffer[j - pixBytes] + rawBytes[i] & 0xFF; 17650 j++; 17651 } 17652 17653 break; 17654 17655 case 2: 17656 for (i = 0; i < rowBytes; ++i) { 17657 buffer[j++] = prevRow[i] + rawBytes[i] & 0xFF; 17658 } 17659 17660 break; 17661 17662 case 3: 17663 for (i = 0; i < pixBytes; ++i) { 17664 buffer[j++] = (prevRow[i] >> 1) + rawBytes[i]; 17665 } 17666 17667 for (; i < rowBytes; ++i) { 17668 buffer[j] = (prevRow[i] + buffer[j - pixBytes] >> 1) + rawBytes[i] & 0xFF; 17669 j++; 17670 } 17671 17672 break; 17673 17674 case 4: 17675 for (i = 0; i < pixBytes; ++i) { 17676 up = prevRow[i]; 17677 c = rawBytes[i]; 17678 buffer[j++] = up + c; 17679 } 17680 17681 for (; i < rowBytes; ++i) { 17682 up = prevRow[i]; 17683 var upLeft = prevRow[i - pixBytes]; 17684 var left = buffer[j - pixBytes]; 17685 var p = left + up - upLeft; 17686 var pa = p - left; 17687 17688 if (pa < 0) { 17689 pa = -pa; 17690 } 17691 17692 var pb = p - up; 17693 17694 if (pb < 0) { 17695 pb = -pb; 17696 } 17697 17698 var pc = p - upLeft; 17699 17700 if (pc < 0) { 17701 pc = -pc; 17702 } 17703 17704 c = rawBytes[i]; 17705 17706 if (pa <= pb && pa <= pc) { 17707 buffer[j++] = left + c; 17708 } else if (pb <= pc) { 17709 buffer[j++] = up + c; 17710 } else { 17711 buffer[j++] = upLeft + c; 17712 } 17713 } 17714 17715 break; 17716 17717 default: 17718 throw new _util.FormatError("Unsupported predictor: ".concat(predictor)); 17719 } 17720 17721 this.bufferLength += rowBytes; 17722 }; 17723 17724 return PredictorStream; 17725}();
vendor: 8,738 bytes, lines 17726-18064
17726 17727exports.PredictorStream = PredictorStream; 17728 17729var DecryptStream = function DecryptStreamClosure() { 17730 function DecryptStream(str, maybeLength, decrypt) { 17731 this.str = str; 17732 this.dict = str.dict; 17733 this.decrypt = decrypt; 17734 this.nextChunk = null; 17735 this.initialized = false; 17736 DecodeStream.call(this, maybeLength); 17737 } 17738 17739 var chunkSize = 512; 17740 DecryptStream.prototype = Object.create(DecodeStream.prototype); 17741 17742 DecryptStream.prototype.readBlock = function DecryptStream_readBlock() { 17743 var chunk; 17744 17745 if (this.initialized) { 17746 chunk = this.nextChunk; 17747 } else { 17748 chunk = this.str.getBytes(chunkSize); 17749 this.initialized = true; 17750 } 17751 17752 if (!chunk || chunk.length === 0) { 17753 this.eof = true; 17754 return; 17755 } 17756 17757 this.nextChunk = this.str.getBytes(chunkSize); 17758 var hasMoreData = this.nextChunk && this.nextChunk.length > 0; 17759 var decrypt = this.decrypt; 17760 chunk = decrypt(chunk, !hasMoreData); 17761 var bufferLength = this.bufferLength; 17762 var i, 17763 n = chunk.length; 17764 var buffer = this.ensureBuffer(bufferLength + n); 17765 17766 for (i = 0; i < n; i++) { 17767 buffer[bufferLength++] = chunk[i]; 17768 } 17769 17770 this.bufferLength = bufferLength; 17771 }; 17772 17773 return DecryptStream; 17774}(); 17775 17776exports.DecryptStream = DecryptStream; 17777 17778var Ascii85Stream = function Ascii85StreamClosure() { 17779 function Ascii85Stream(str, maybeLength) { 17780 this.str = str; 17781 this.dict = str.dict; 17782 this.input = new Uint8Array(5); 17783 17784 if (maybeLength) { 17785 maybeLength = 0.8 * maybeLength; 17786 } 17787 17788 DecodeStream.call(this, maybeLength); 17789 } 17790 17791 Ascii85Stream.prototype = Object.create(DecodeStream.prototype); 17792 17793 Ascii85Stream.prototype.readBlock = function Ascii85Stream_readBlock() { 17794 var TILDA_CHAR = 0x7E; 17795 var Z_LOWER_CHAR = 0x7A; 17796 var EOF = -1; 17797 var str = this.str; 17798 var c = str.getByte(); 17799 17800 while ((0, _util.isSpace)(c)) { 17801 c = str.getByte(); 17802 } 17803 17804 if (c === EOF || c === TILDA_CHAR) { 17805 this.eof = true; 17806 return; 17807 } 17808 17809 var bufferLength = this.bufferLength, 17810 buffer; 17811 var i; 17812 17813 if (c === Z_LOWER_CHAR) { 17814 buffer = this.ensureBuffer(bufferLength + 4); 17815 17816 for (i = 0; i < 4; ++i) { 17817 buffer[bufferLength + i] = 0; 17818 } 17819 17820 this.bufferLength += 4; 17821 } else { 17822 var input = this.input; 17823 input[0] = c; 17824 17825 for (i = 1; i < 5; ++i) { 17826 c = str.getByte(); 17827 17828 while ((0, _util.isSpace)(c)) { 17829 c = str.getByte(); 17830 } 17831 17832 input[i] = c; 17833 17834 if (c === EOF || c === TILDA_CHAR) { 17835 break; 17836 } 17837 } 17838 17839 buffer = this.ensureBuffer(bufferLength + i - 1); 17840 this.bufferLength += i - 1; 17841 17842 if (i < 5) { 17843 for (; i < 5; ++i) { 17844 input[i] = 0x21 + 84; 17845 } 17846 17847 this.eof = true; 17848 } 17849 17850 var t = 0; 17851 17852 for (i = 0; i < 5; ++i) { 17853 t = t * 85 + (input[i] - 0x21); 17854 } 17855 17856 for (i = 3; i >= 0; --i) { 17857 buffer[bufferLength + i] = t & 0xFF; 17858 t >>= 8; 17859 } 17860 } 17861 }; 17862 17863 return Ascii85Stream; 17864}(); 17865 17866exports.Ascii85Stream = Ascii85Stream; 17867 17868var AsciiHexStream = function AsciiHexStreamClosure() { 17869 function AsciiHexStream(str, maybeLength) { 17870 this.str = str; 17871 this.dict = str.dict; 17872 this.firstDigit = -1; 17873 17874 if (maybeLength) { 17875 maybeLength = 0.5 * maybeLength; 17876 } 17877 17878 DecodeStream.call(this, maybeLength); 17879 } 17880 17881 AsciiHexStream.prototype = Object.create(DecodeStream.prototype); 17882 17883 AsciiHexStream.prototype.readBlock = function AsciiHexStream_readBlock() { 17884 var UPSTREAM_BLOCK_SIZE = 8000; 17885 var bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); 17886 17887 if (!bytes.length) { 17888 this.eof = true; 17889 return; 17890 } 17891 17892 var maxDecodeLength = bytes.length + 1 >> 1; 17893 var buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); 17894 var bufferLength = this.bufferLength; 17895 var firstDigit = this.firstDigit; 17896 17897 for (var i = 0, ii = bytes.length; i < ii; i++) { 17898 var ch = bytes[i], 17899 digit; 17900 17901 if (ch >= 0x30 && ch <= 0x39) { 17902 digit = ch & 0x0F; 17903 } else if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { 17904 digit = (ch & 0x0F) + 9; 17905 } else if (ch === 0x3E) { 17906 this.eof = true; 17907 break; 17908 } else { 17909 continue; 17910 } 17911 17912 if (firstDigit < 0) { 17913 firstDigit = digit; 17914 } else { 17915 buffer[bufferLength++] = firstDigit << 4 | digit; 17916 firstDigit = -1; 17917 } 17918 } 17919 17920 if (firstDigit >= 0 && this.eof) { 17921 buffer[bufferLength++] = firstDigit << 4; 17922 firstDigit = -1; 17923 } 17924 17925 this.firstDigit = firstDigit; 17926 this.bufferLength = bufferLength; 17927 }; 17928 17929 return AsciiHexStream; 17930}(); 17931 17932exports.AsciiHexStream = AsciiHexStream; 17933 17934var RunLengthStream = function RunLengthStreamClosure() { 17935 function RunLengthStream(str, maybeLength) { 17936 this.str = str; 17937 this.dict = str.dict; 17938 DecodeStream.call(this, maybeLength); 17939 } 17940 17941 RunLengthStream.prototype = Object.create(DecodeStream.prototype); 17942 17943 RunLengthStream.prototype.readBlock = function RunLengthStream_readBlock() { 17944 var repeatHeader = this.str.getBytes(2); 17945 17946 if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { 17947 this.eof = true; 17948 return; 17949 } 17950 17951 var buffer; 17952 var bufferLength = this.bufferLength; 17953 var n = repeatHeader[0]; 17954 17955 if (n < 128) { 17956 buffer = this.ensureBuffer(bufferLength + n + 1); 17957 buffer[bufferLength++] = repeatHeader[1]; 17958 17959 if (n > 0) { 17960 var source = this.str.getBytes(n); 17961 buffer.set(source, bufferLength); 17962 bufferLength += n; 17963 } 17964 } else { 17965 n = 257 - n; 17966 var b = repeatHeader[1]; 17967 buffer = this.ensureBuffer(bufferLength + n + 1); 17968 17969 for (var i = 0; i < n; i++) { 17970 buffer[bufferLength++] = b; 17971 } 17972 } 17973 17974 this.bufferLength = bufferLength; 17975 }; 17976 17977 return RunLengthStream; 17978}(); 17979 17980exports.RunLengthStream = RunLengthStream; 17981 17982var LZWStream = function LZWStreamClosure() { 17983 function LZWStream(str, maybeLength, earlyChange) { 17984 this.str = str; 17985 this.dict = str.dict; 17986 this.cachedData = 0; 17987 this.bitsCached = 0; 17988 var maxLzwDictionarySize = 4096; 17989 var lzwState = { 17990 earlyChange: earlyChange, 17991 codeLength: 9, 17992 nextCode: 258, 17993 dictionaryValues: new Uint8Array(maxLzwDictionarySize), 17994 dictionaryLengths: new Uint16Array(maxLzwDictionarySize), 17995 dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize), 17996 currentSequence: new Uint8Array(maxLzwDictionarySize), 17997 currentSequenceLength: 0 17998 }; 17999 18000 for (var i = 0; i < 256; ++i) { 18001 lzwState.dictionaryValues[i] = i; 18002 lzwState.dictionaryLengths[i] = 1; 18003 } 18004 18005 this.lzwState = lzwState; 18006 DecodeStream.call(this, maybeLength); 18007 } 18008 18009 LZWStream.prototype = Object.create(DecodeStream.prototype); 18010 18011 LZWStream.prototype.readBits = function LZWStream_readBits(n) { 18012 var bitsCached = this.bitsCached; 18013 var cachedData = this.cachedData; 18014 18015 while (bitsCached < n) { 18016 var c = this.str.getByte(); 18017 18018 if (c === -1) { 18019 this.eof = true; 18020 return null; 18021 } 18022 18023 cachedData = cachedData << 8 | c; 18024 bitsCached += 8; 18025 } 18026 18027 this.bitsCached = bitsCached -= n; 18028 this.cachedData = cachedData; 18029 this.lastCode = null; 18030 return cachedData >>> bitsCached & (1 << n) - 1; 18031 }; 18032 18033 LZWStream.prototype.readBlock = function LZWStream_readBlock() { 18034 var blockSize = 512; 18035 var estimatedDecodedSize = blockSize * 2, 18036 decodedSizeDelta = blockSize; 18037 var i, j, q; 18038 var lzwState = this.lzwState; 18039 18040 if (!lzwState) { 18041 return; 18042 } 18043 18044 var earlyChange = lzwState.earlyChange; 18045 var nextCode = lzwState.nextCode; 18046 var dictionaryValues = lzwState.dictionaryValues; 18047 var dictionaryLengths = lzwState.dictionaryLengths; 18048 var dictionaryPrevCodes = lzwState.dictionaryPrevCodes; 18049 var codeLength = lzwState.codeLength; 18050 var prevCode = lzwState.prevCode; 18051 var currentSequence = lzwState.currentSequence; 18052 var currentSequenceLength = lzwState.currentSequenceLength; 18053 var decodedLength = 0; 18054 var currentBufferLength = this.bufferLength; 18055 var buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); 18056 18057 for (i = 0; i < blockSize; i++) { 18058 var code = this.readBits(codeLength); 18059 var hasPrev = currentSequenceLength > 0; 18060 18061 if (code < 256) { 18062 currentSequence[0] = code; 18063 currentSequenceLength = 1; 18064 } else if (code >= 258) {
18065 if (code < nextCode) { 18066 currentSequenceLength = dictionaryLengths[code]; 18067 18068 for (j = currentSequenceLength - 1, q = code; j >= 0; j--) { 18069 currentSequence[j] = dictionaryValues[q]; 18070 q = dictionaryPrevCodes[q]; 18071 } 18072 } else { 18073 currentSequence[currentSequenceLength++] = currentSequence[0]; 18074 } 18075 } else if (code === 256) { 18076 codeLength = 9; 18077 nextCode = 258; 18078 currentSequenceLength = 0; 18079 continue; 18080 } else { 18081 this.eof = true; 18082 delete this.lzwState; 18083 break; 18084 } 18085 18086 if (hasPrev) { 18087 dictionaryPrevCodes[nextCode] = prevCode; 18088 dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1; 18089 dictionaryValues[nextCode] = currentSequence[0]; 18090 nextCode++; 18091 codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0; 18092 } 18093 18094 prevCode = code; 18095 decodedLength += currentSequenceLength; 18096 18097 if (estimatedDecodedSize < decodedLength) { 18098 do { 18099 estimatedDecodedSize += decodedSizeDelta; 18100 } while (estimatedDecodedSize < decodedLength); 18101 18102 buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); 18103 } 18104 18105 for (j = 0; j < currentSequenceLength; j++) { 18106 buffer[currentBufferLength++] = currentSequence[j]; 18107 } 18108 } 18109 18110 lzwState.nextCode = nextCode; 18111 lzwState.codeLength = codeLength; 18112 lzwState.prevCode = prevCode; 18113 lzwState.currentSequenceLength = currentSequenceLength; 18114 this.bufferLength = currentBufferLength; 18115 }; 18116 18117 return LZWStream; 18118}(); 18119 18120exports.LZWStream = LZWStream; 18121 18122var NullStream = function NullStreamClosure() { 18123 function NullStream() { 18124 Stream.call(this, new Uint8Array(0)); 18125 } 18126 18127 NullStream.prototype = Stream.prototype; 18128 return NullStream; 18129}(); 18130 18131exports.NullStream = NullStream; 18132 18133/***/ }), 18134/* 158 */ 18135/***/ (function(module, exports, __w_pdfjs_require__) { 18136 18137"use strict"; 18138 18139 18140Object.defineProperty(exports, "__esModule", { 18141 value: true 18142}); 18143exports.CCITTFaxStream = void 0; 18144 18145var _primitives = __w_pdfjs_require__(155); 18146 18147var _ccitt = __w_pdfjs_require__(159); 18148 18149var _stream = __w_pdfjs_require__(157); 18150 18151var CCITTFaxStream = function CCITTFaxStreamClosure() { 18152 function CCITTFaxStream(str, maybeLength, params) { 18153 this.str = str; 18154 this.dict = str.dict; 18155 18156 if (!(0, _primitives.isDict)(params)) { 18157 params = _primitives.Dict.empty; 18158 } 18159 18160 var source = { 18161 next: function next() { 18162 return str.getByte(); 18163 } 18164 }; 18165 this.ccittFaxDecoder = new _ccitt.CCITTFaxDecoder(source, { 18166 K: params.get('K'), 18167 EndOfLine: params.get('EndOfLine'), 18168 EncodedByteAlign: params.get('EncodedByteAlign'), 18169 Columns: params.get('Columns'), 18170 Rows: params.get('Rows'), 18171 EndOfBlock: params.get('EndOfBlock'), 18172 BlackIs1: params.get('BlackIs1') 18173 }); 18174 18175 _stream.DecodeStream.call(this, maybeLength); 18176 } 18177 18178 CCITTFaxStream.prototype = Object.create(_stream.DecodeStream.prototype); 18179 18180 CCITTFaxStream.prototype.readBlock = function () { 18181 while (!this.eof) { 18182 var c = this.ccittFaxDecoder.readNextChar(); 18183 18184 if (c === -1) { 18185 this.eof = true; 18186 return; 18187 } 18188 18189 this.ensureBuffer(this.bufferLength + 1); 18190 this.buffer[this.bufferLength++] = c; 18191 } 18192 }; 18193 18194 return CCITTFaxStream; 18195}(); 18196 18197exports.CCITTFaxStream = CCITTFaxStream; 18198 18199/***/ }), 18200/* 159 */ 18201/***/ (function(module, exports, __w_pdfjs_require__) { 18202 18203"use strict"; 18204 18205 18206Object.defineProperty(exports, "__esModule", { 18207 value: true 18208}); 18209exports.CCITTFaxDecoder = void 0; 18210 18211var _util = __w_pdfjs_require__(6); 18212 18213var CCITTFaxDecoder = function CCITTFaxDecoder() { 18214 var ccittEOL = -2; 18215 var ccittEOF = -1; 18216 var twoDimPass = 0; 18217 var twoDimHoriz = 1; 18218 var twoDimVert0 = 2; 18219 var twoDimVertR1 = 3; 18220 var twoDimVertL1 = 4; 18221 var twoDimVertR2 = 5; 18222 var twoDimVertL2 = 6; 18223 var twoDimVertR3 = 7; 18224 var twoDimVertL3 = 8;
18225 var twoDimTable = [[-1, -1], [-1, -1], [7, twoDimVertL3], [7, twoDimVertR3], [6, twoDimVertL2], [6, twoDimVertL2], [6, twoDimVertR2], [6, twoDimVertR2], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0]]; 18226 var whiteTable1 = [[-1, -1], [12, ccittEOL], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [12, 1984], [12, 2048], [12, 2112], [12, 2176], [12, 2240], [12, 2304], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [12, 2368], [12, 2432], [12, 2496], [12, 2560]]; 18227 var whiteTable2 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [8, 29], [8, 29], [8, 30], [8, 30], [8, 45], [8, 45], [8, 46], [8, 46], [7, 22], [7, 22], [7, 22], [7, 22], [7, 23], [7, 23], [7, 23], [7, 23], [8, 47], [8, 47], [8, 48], [8, 48], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [7, 20], [7, 20], [7, 20], [7, 20], [8, 33], [8, 33], [8, 34], [8, 34], [8, 35], [8, 35], [8, 36], [8, 36], [8, 37], [8, 37], [8, 38], [8, 38], [7, 19], [7, 19], [7, 19], [7, 19], [8, 31], [8, 31], [8, 32], [8, 32], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [8, 53], [8, 53], [8, 54], [8, 54], [7, 26], [7, 26], [7, 26], [7, 26], [8, 39], [8, 39], [8, 40], [8, 40], [8, 41], [8, 41], [8, 42], [8, 42], [8, 43], [8, 43], [8, 44], [8, 44], [7, 21], [7, 21], [7, 21], [7, 21], [7, 28], [7, 28], [7, 28], [7, 28], [8, 61], [8, 61], [8, 62], [8, 62], [8, 63], [8, 63], [8, 0], [8, 0], [8, 320], [8, 320], [8, 384], [8, 384], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [7, 27], [7, 27], [7, 27], [7, 27], [8, 59], [8, 59], [8, 60], [8, 60], [9, 1472], [9, 1536], [9, 1600], [9, 1728], [7, 18], [7, 18], [7, 18], [7, 18], [7, 24], [7, 24], [7, 24], [7, 24], [8, 49], [8, 49], [8, 50], [8, 50], [8, 51], [8, 51], [8, 52], [8, 52], [7, 25], [7, 25], [7, 25], [7, 25], [8, 55], [8, 55], [8, 56], [8, 56], [8, 57], [8, 57], [8, 58], [8, 58], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [8, 448], [8, 448], [8, 512], [8, 512], [9, 704], [9, 768], [8, 640], [8, 640], [8, 576], [8, 576], [9, 832], [9, 896], [9, 960], [9, 1024], [9, 1088], [9, 1152], [9, 1216], [9, 1280], [9, 1344], [9, 1408], [7, 256], [7, 256], [7, 256], [7, 256], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7]];
vendor: 5,318 bytes, lines 18228-18287
18228 var blackTable1 = [[-1, -1], [-1, -1], [12, ccittEOL], [12, ccittEOL], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [11, 1792], [11, 1792], [12, 1984], [12, 1984], [12, 2048], [12, 2048], [12, 2112], [12, 2112], [12, 2176], [12, 2176], [12, 2240], [12, 2240], [12, 2304], [12, 2304], [11, 1856], [11, 1856], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [11, 1920], [11, 1920], [12, 2368], [12, 2368], [12, 2432], [12, 2432], [12, 2496], [12, 2496], [12, 2560], [12, 2560], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [12, 52], [12, 52], [13, 640], [13, 704], [13, 768], [13, 832], [12, 55], [12, 55], [12, 56], [12, 56], [13, 1280], [13, 1344], [13, 1408], [13, 1472], [12, 59], [12, 59], [12, 60], [12, 60], [13, 1536], [13, 1600], [11, 24], [11, 24], [11, 24], [11, 24], [11, 25], [11, 25], [11, 25], [11, 25], [13, 1664], [13, 1728], [12, 320], [12, 320], [12, 384], [12, 384], [12, 448], [12, 448], [13, 512], [13, 576], [12, 53], [12, 53], [12, 54], [12, 54], [13, 896], [13, 960], [13, 1024], [13, 1088], [13, 1152], [13, 1216], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64]]; 18229 var blackTable2 = [[8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [11, 23], [11, 23], [12, 50], [12, 51], [12, 44], [12, 45], [12, 46], [12, 47], [12, 57], [12, 58], [12, 61], [12, 256], [10, 16], [10, 16], [10, 16], [10, 16], [10, 17], [10, 17], [10, 17], [10, 17], [12, 48], [12, 49], [12, 62], [12, 63], [12, 30], [12, 31], [12, 32], [12, 33], [12, 40], [12, 41], [11, 22], [11, 22], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [12, 128], [12, 192], [12, 26], [12, 27], [12, 28], [12, 29], [11, 19], [11, 19], [11, 20], [11, 20], [12, 34], [12, 35], [12, 36], [12, 37], [12, 38], [12, 39], [11, 21], [11, 21], [12, 42], [12, 43], [10, 0], [10, 0], [10, 0], [10, 0], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12]]; 18230 var blackTable3 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [6, 9], [6, 8], [5, 7], [5, 7], [4, 6], [4, 6], [4, 6], [4, 6], [4, 5], [4, 5], [4, 5], [4, 5], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2]]; 18231 18232 function CCITTFaxDecoder(source) { 18233 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 18234 18235 if (!source || typeof source.next !== 'function') { 18236 throw new Error('CCITTFaxDecoder - invalid "source" parameter.'); 18237 } 18238 18239 this.source = source; 18240 this.eof = false; 18241 this.encoding = options['K'] || 0; 18242 this.eoline = options['EndOfLine'] || false; 18243 this.byteAlign = options['EncodedByteAlign'] || false; 18244 this.columns = options['Columns'] || 1728; 18245 this.rows = options['Rows'] || 0; 18246 var eoblock = options['EndOfBlock']; 18247 18248 if (eoblock === null || eoblock === undefined) { 18249 eoblock = true; 18250 } 18251 18252 this.eoblock = eoblock; 18253 this.black = options['BlackIs1'] || false; 18254 this.codingLine = new Uint32Array(this.columns + 1); 18255 this.refLine = new Uint32Array(this.columns + 2); 18256 this.codingLine[0] = this.columns; 18257 this.codingPos = 0; 18258 this.row = 0; 18259 this.nextLine2D = this.encoding < 0; 18260 this.inputBits = 0; 18261 this.inputBuf = 0; 18262 this.outputBits = 0; 18263 this.rowsDone = false; 18264 var code1; 18265 18266 while ((code1 = this._lookBits(12)) === 0) { 18267 this._eatBits(1); 18268 } 18269 18270 if (code1 === 1) { 18271 this._eatBits(12); 18272 } 18273 18274 if (this.encoding > 0) { 18275 this.nextLine2D = !this._lookBits(1); 18276 18277 this._eatBits(1); 18278 } 18279 } 18280 18281 CCITTFaxDecoder.prototype = { 18282 readNextChar: function readNextChar() { 18283 if (this.eof) { 18284 return -1; 18285 } 18286 18287 var refLine = this.refLine;
vendor: 4,248 bytes, lines 18288-18433
18288 var codingLine = this.codingLine; 18289 var columns = this.columns; 18290 var refPos, blackPixels, bits, i; 18291 18292 if (this.outputBits === 0) { 18293 if (this.rowsDone) { 18294 this.eof = true; 18295 } 18296 18297 if (this.eof) { 18298 return -1; 18299 } 18300 18301 this.err = false; 18302 var code1, code2, code3; 18303 18304 if (this.nextLine2D) { 18305 for (i = 0; codingLine[i] < columns; ++i) { 18306 refLine[i] = codingLine[i]; 18307 } 18308 18309 refLine[i++] = columns; 18310 refLine[i] = columns; 18311 codingLine[0] = 0; 18312 this.codingPos = 0; 18313 refPos = 0; 18314 blackPixels = 0; 18315 18316 while (codingLine[this.codingPos] < columns) { 18317 code1 = this._getTwoDimCode(); 18318 18319 switch (code1) { 18320 case twoDimPass: 18321 this._addPixels(refLine[refPos + 1], blackPixels); 18322 18323 if (refLine[refPos + 1] < columns) { 18324 refPos += 2; 18325 } 18326 18327 break; 18328 18329 case twoDimHoriz: 18330 code1 = code2 = 0; 18331 18332 if (blackPixels) { 18333 do { 18334 code1 += code3 = this._getBlackCode(); 18335 } while (code3 >= 64); 18336 18337 do { 18338 code2 += code3 = this._getWhiteCode(); 18339 } while (code3 >= 64); 18340 } else { 18341 do { 18342 code1 += code3 = this._getWhiteCode(); 18343 } while (code3 >= 64); 18344 18345 do { 18346 code2 += code3 = this._getBlackCode(); 18347 } while (code3 >= 64); 18348 } 18349 18350 this._addPixels(codingLine[this.codingPos] + code1, blackPixels); 18351 18352 if (codingLine[this.codingPos] < columns) { 18353 this._addPixels(codingLine[this.codingPos] + code2, blackPixels ^ 1); 18354 } 18355 18356 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 18357 refPos += 2; 18358 } 18359 18360 break; 18361 18362 case twoDimVertR3: 18363 this._addPixels(refLine[refPos] + 3, blackPixels); 18364 18365 blackPixels ^= 1; 18366 18367 if (codingLine[this.codingPos] < columns) { 18368 ++refPos; 18369 18370 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 18371 refPos += 2; 18372 } 18373 } 18374 18375 break; 18376 18377 case twoDimVertR2: 18378 this._addPixels(refLine[refPos] + 2, blackPixels); 18379 18380 blackPixels ^= 1; 18381 18382 if (codingLine[this.codingPos] < columns) { 18383 ++refPos; 18384 18385 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 18386 refPos += 2; 18387 } 18388 } 18389 18390 break; 18391 18392 case twoDimVertR1: 18393 this._addPixels(refLine[refPos] + 1, blackPixels); 18394 18395 blackPixels ^= 1; 18396 18397 if (codingLine[this.codingPos] < columns) { 18398 ++refPos; 18399 18400 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 18401 refPos += 2; 18402 } 18403 } 18404 18405 break; 18406 18407 case twoDimVert0: 18408 this._addPixels(refLine[refPos], blackPixels); 18409 18410 blackPixels ^= 1; 18411 18412 if (codingLine[this.codingPos] < columns) { 18413 ++refPos; 18414 18415 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 18416 refPos += 2; 18417 } 18418 } 18419 18420 break; 18421 18422 case twoDimVertL3: 18423 this._addPixelsNeg(refLine[refPos] - 3, blackPixels); 18424 18425 blackPixels ^= 1; 18426 18427 if (codingLine[this.codingPos] < columns) { 18428 if (refPos > 0) { 18429 --refPos; 18430 } else { 18431 ++refPos; 18432 } 18433
vendor: 11,054 bytes, lines 18434-18893
18434 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 18435 refPos += 2; 18436 } 18437 } 18438 18439 break; 18440 18441 case twoDimVertL2: 18442 this._addPixelsNeg(refLine[refPos] - 2, blackPixels); 18443 18444 blackPixels ^= 1; 18445 18446 if (codingLine[this.codingPos] < columns) { 18447 if (refPos > 0) { 18448 --refPos; 18449 } else { 18450 ++refPos; 18451 } 18452 18453 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 18454 refPos += 2; 18455 } 18456 } 18457 18458 break; 18459 18460 case twoDimVertL1: 18461 this._addPixelsNeg(refLine[refPos] - 1, blackPixels); 18462 18463 blackPixels ^= 1; 18464 18465 if (codingLine[this.codingPos] < columns) { 18466 if (refPos > 0) { 18467 --refPos; 18468 } else { 18469 ++refPos; 18470 } 18471 18472 while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { 18473 refPos += 2; 18474 } 18475 } 18476 18477 break; 18478 18479 case ccittEOF: 18480 this._addPixels(columns, 0); 18481 18482 this.eof = true; 18483 break; 18484 18485 default: 18486 (0, _util.info)('bad 2d code'); 18487 18488 this._addPixels(columns, 0); 18489 18490 this.err = true; 18491 } 18492 } 18493 } else { 18494 codingLine[0] = 0; 18495 this.codingPos = 0; 18496 blackPixels = 0; 18497 18498 while (codingLine[this.codingPos] < columns) { 18499 code1 = 0; 18500 18501 if (blackPixels) { 18502 do { 18503 code1 += code3 = this._getBlackCode(); 18504 } while (code3 >= 64); 18505 } else { 18506 do { 18507 code1 += code3 = this._getWhiteCode(); 18508 } while (code3 >= 64); 18509 } 18510 18511 this._addPixels(codingLine[this.codingPos] + code1, blackPixels); 18512 18513 blackPixels ^= 1; 18514 } 18515 } 18516 18517 var gotEOL = false; 18518 18519 if (this.byteAlign) { 18520 this.inputBits &= ~7; 18521 } 18522 18523 if (!this.eoblock && this.row === this.rows - 1) { 18524 this.rowsDone = true; 18525 } else { 18526 code1 = this._lookBits(12); 18527 18528 if (this.eoline) { 18529 while (code1 !== ccittEOF && code1 !== 1) { 18530 this._eatBits(1); 18531 18532 code1 = this._lookBits(12); 18533 } 18534 } else { 18535 while (code1 === 0) { 18536 this._eatBits(1); 18537 18538 code1 = this._lookBits(12); 18539 } 18540 } 18541 18542 if (code1 === 1) { 18543 this._eatBits(12); 18544 18545 gotEOL = true; 18546 } else if (code1 === ccittEOF) { 18547 this.eof = true; 18548 } 18549 } 18550 18551 if (!this.eof && this.encoding > 0 && !this.rowsDone) { 18552 this.nextLine2D = !this._lookBits(1); 18553 18554 this._eatBits(1); 18555 } 18556 18557 if (this.eoblock && gotEOL && this.byteAlign) { 18558 code1 = this._lookBits(12); 18559 18560 if (code1 === 1) { 18561 this._eatBits(12); 18562 18563 if (this.encoding > 0) { 18564 this._lookBits(1); 18565 18566 this._eatBits(1); 18567 } 18568 18569 if (this.encoding >= 0) { 18570 for (i = 0; i < 4; ++i) { 18571 code1 = this._lookBits(12); 18572 18573 if (code1 !== 1) { 18574 (0, _util.info)('bad rtc code: ' + code1); 18575 } 18576 18577 this._eatBits(12); 18578 18579 if (this.encoding > 0) { 18580 this._lookBits(1); 18581 18582 this._eatBits(1); 18583 } 18584 } 18585 } 18586 18587 this.eof = true; 18588 } 18589 } else if (this.err && this.eoline) { 18590 while (true) { 18591 code1 = this._lookBits(13); 18592 18593 if (code1 === ccittEOF) { 18594 this.eof = true; 18595 return -1; 18596 } 18597 18598 if (code1 >> 1 === 1) { 18599 break; 18600 } 18601 18602 this._eatBits(1); 18603 } 18604 18605 this._eatBits(12); 18606 18607 if (this.encoding > 0) { 18608 this._eatBits(1); 18609 18610 this.nextLine2D = !(code1 & 1); 18611 } 18612 } 18613 18614 if (codingLine[0] > 0) { 18615 this.outputBits = codingLine[this.codingPos = 0]; 18616 } else { 18617 this.outputBits = codingLine[this.codingPos = 1]; 18618 } 18619 18620 this.row++; 18621 } 18622 18623 var c; 18624 18625 if (this.outputBits >= 8) { 18626 c = this.codingPos & 1 ? 0 : 0xFF; 18627 this.outputBits -= 8; 18628 18629 if (this.outputBits === 0 && codingLine[this.codingPos] < columns) { 18630 this.codingPos++; 18631 this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; 18632 } 18633 } else { 18634 bits = 8; 18635 c = 0; 18636 18637 do { 18638 if (this.outputBits > bits) { 18639 c <<= bits; 18640 18641 if (!(this.codingPos & 1)) { 18642 c |= 0xFF >> 8 - bits; 18643 } 18644 18645 this.outputBits -= bits; 18646 bits = 0; 18647 } else { 18648 c <<= this.outputBits; 18649 18650 if (!(this.codingPos & 1)) { 18651 c |= 0xFF >> 8 - this.outputBits; 18652 } 18653 18654 bits -= this.outputBits; 18655 this.outputBits = 0; 18656 18657 if (codingLine[this.codingPos] < columns) { 18658 this.codingPos++; 18659 this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; 18660 } else if (bits > 0) { 18661 c <<= bits; 18662 bits = 0; 18663 } 18664 } 18665 } while (bits); 18666 } 18667 18668 if (this.black) { 18669 c ^= 0xFF; 18670 } 18671 18672 return c; 18673 }, 18674 _addPixels: function _addPixels(a1, blackPixels) { 18675 var codingLine = this.codingLine; 18676 var codingPos = this.codingPos; 18677 18678 if (a1 > codingLine[codingPos]) { 18679 if (a1 > this.columns) { 18680 (0, _util.info)('row is wrong length'); 18681 this.err = true; 18682 a1 = this.columns; 18683 } 18684 18685 if (codingPos & 1 ^ blackPixels) { 18686 ++codingPos; 18687 } 18688 18689 codingLine[codingPos] = a1; 18690 } 18691 18692 this.codingPos = codingPos; 18693 }, 18694 _addPixelsNeg: function _addPixelsNeg(a1, blackPixels) { 18695 var codingLine = this.codingLine; 18696 var codingPos = this.codingPos; 18697 18698 if (a1 > codingLine[codingPos]) { 18699 if (a1 > this.columns) { 18700 (0, _util.info)('row is wrong length'); 18701 this.err = true; 18702 a1 = this.columns; 18703 } 18704 18705 if (codingPos & 1 ^ blackPixels) { 18706 ++codingPos; 18707 } 18708 18709 codingLine[codingPos] = a1; 18710 } else if (a1 < codingLine[codingPos]) { 18711 if (a1 < 0) { 18712 (0, _util.info)('invalid code'); 18713 this.err = true; 18714 a1 = 0; 18715 } 18716 18717 while (codingPos > 0 && a1 < codingLine[codingPos - 1]) { 18718 --codingPos; 18719 } 18720 18721 codingLine[codingPos] = a1; 18722 } 18723 18724 this.codingPos = codingPos; 18725 }, 18726 _findTableCode: function _findTableCode(start, end, table, limit) { 18727 var limitValue = limit || 0; 18728 18729 for (var i = start; i <= end; ++i) { 18730 var code = this._lookBits(i); 18731 18732 if (code === ccittEOF) { 18733 return [true, 1, false]; 18734 } 18735 18736 if (i < end) { 18737 code <<= end - i; 18738 } 18739 18740 if (!limitValue || code >= limitValue) { 18741 var p = table[code - limitValue]; 18742 18743 if (p[0] === i) { 18744 this._eatBits(i); 18745 18746 return [true, p[1], true]; 18747 } 18748 } 18749 } 18750 18751 return [false, 0, false]; 18752 }, 18753 _getTwoDimCode: function _getTwoDimCode() { 18754 var code = 0; 18755 var p; 18756 18757 if (this.eoblock) { 18758 code = this._lookBits(7); 18759 p = twoDimTable[code]; 18760 18761 if (p && p[0] > 0) { 18762 this._eatBits(p[0]); 18763 18764 return p[1]; 18765 } 18766 } else { 18767 var result = this._findTableCode(1, 7, twoDimTable); 18768 18769 if (result[0] && result[2]) { 18770 return result[1]; 18771 } 18772 } 18773 18774 (0, _util.info)('Bad two dim code'); 18775 return ccittEOF; 18776 }, 18777 _getWhiteCode: function _getWhiteCode() { 18778 var code = 0; 18779 var p; 18780 18781 if (this.eoblock) { 18782 code = this._lookBits(12); 18783 18784 if (code === ccittEOF) { 18785 return 1; 18786 } 18787 18788 if (code >> 5 === 0) { 18789 p = whiteTable1[code]; 18790 } else { 18791 p = whiteTable2[code >> 3]; 18792 } 18793 18794 if (p[0] > 0) { 18795 this._eatBits(p[0]); 18796 18797 return p[1]; 18798 } 18799 } else { 18800 var result = this._findTableCode(1, 9, whiteTable2); 18801 18802 if (result[0]) { 18803 return result[1]; 18804 } 18805 18806 result = this._findTableCode(11, 12, whiteTable1); 18807 18808 if (result[0]) { 18809 return result[1]; 18810 } 18811 } 18812 18813 (0, _util.info)('bad white code'); 18814 18815 this._eatBits(1); 18816 18817 return 1; 18818 }, 18819 _getBlackCode: function _getBlackCode() { 18820 var code, p; 18821 18822 if (this.eoblock) { 18823 code = this._lookBits(13); 18824 18825 if (code === ccittEOF) { 18826 return 1; 18827 } 18828 18829 if (code >> 7 === 0) { 18830 p = blackTable1[code]; 18831 } else if (code >> 9 === 0 && code >> 7 !== 0) { 18832 p = blackTable2[(code >> 1) - 64]; 18833 } else { 18834 p = blackTable3[code >> 7]; 18835 } 18836 18837 if (p[0] > 0) { 18838 this._eatBits(p[0]); 18839 18840 return p[1]; 18841 } 18842 } else { 18843 var result = this._findTableCode(2, 6, blackTable3); 18844 18845 if (result[0]) { 18846 return result[1]; 18847 } 18848 18849 result = this._findTableCode(7, 12, blackTable2, 64); 18850 18851 if (result[0]) { 18852 return result[1]; 18853 } 18854 18855 result = this._findTableCode(10, 13, blackTable1); 18856 18857 if (result[0]) { 18858 return result[1]; 18859 } 18860 } 18861 18862 (0, _util.info)('bad black code'); 18863 18864 this._eatBits(1); 18865 18866 return 1; 18867 }, 18868 _lookBits: function _lookBits(n) { 18869 var c; 18870 18871 while (this.inputBits < n) { 18872 if ((c = this.source.next()) === -1) { 18873 if (this.inputBits === 0) { 18874 return ccittEOF; 18875 } 18876 18877 return this.inputBuf << n - this.inputBits & 0xFFFF >> 16 - n; 18878 } 18879 18880 this.inputBuf = this.inputBuf << 8 | c; 18881 this.inputBits += 8; 18882 } 18883 18884 return this.inputBuf >> this.inputBits - n & 0xFFFF >> 16 - n; 18885 }, 18886 _eatBits: function _eatBits(n) { 18887 if ((this.inputBits -= n) < 0) { 18888 this.inputBits = 0; 18889 } 18890 } 18891 }; 18892 return CCITTFaxDecoder; 18893}();
18894 18895exports.CCITTFaxDecoder = CCITTFaxDecoder; 18896 18897/***/ }), 18898/* 160 */ 18899/***/ (function(module, exports, __w_pdfjs_require__) { 18900 18901"use strict"; 18902 18903 18904Object.defineProperty(exports, "__esModule", { 18905 value: true 18906}); 18907exports.Jbig2Stream = void 0; 18908 18909var _primitives = __w_pdfjs_require__(155); 18910 18911var _stream = __w_pdfjs_require__(157); 18912 18913var _jbig = __w_pdfjs_require__(161); 18914 18915var _util = __w_pdfjs_require__(6); 18916 18917var Jbig2Stream = function Jbig2StreamClosure() { 18918 function Jbig2Stream(stream, maybeLength, dict, params) { 18919 this.stream = stream; 18920 this.maybeLength = maybeLength; 18921 this.dict = dict; 18922 this.params = params; 18923 18924 _stream.DecodeStream.call(this, maybeLength); 18925 } 18926 18927 Jbig2Stream.prototype = Object.create(_stream.DecodeStream.prototype); 18928 Object.defineProperty(Jbig2Stream.prototype, 'bytes', { 18929 get: function get() { 18930 return (0, _util.shadow)(this, 'bytes', this.stream.getBytes(this.maybeLength)); 18931 }, 18932 configurable: true 18933 }); 18934 18935 Jbig2Stream.prototype.ensureBuffer = function (requested) {}; 18936 18937 Jbig2Stream.prototype.readBlock = function () { 18938 if (this.eof) { 18939 return; 18940 } 18941 18942 var jbig2Image = new _jbig.Jbig2Image(); 18943 var chunks = []; 18944 18945 if ((0, _primitives.isDict)(this.params)) { 18946 var globalsStream = this.params.get('JBIG2Globals'); 18947 18948 if ((0, _primitives.isStream)(globalsStream)) { 18949 var globals = globalsStream.getBytes(); 18950 chunks.push({ 18951 data: globals, 18952 start: 0, 18953 end: globals.length 18954 }); 18955 } 18956 } 18957 18958 chunks.push({ 18959 data: this.bytes, 18960 start: 0, 18961 end: this.bytes.length 18962 }); 18963 var data = jbig2Image.parseChunks(chunks); 18964 var dataLength = data.length; 18965 18966 for (var i = 0; i < dataLength; i++) { 18967 data[i] ^= 0xFF; 18968 } 18969 18970 this.buffer = data; 18971 this.bufferLength = dataLength; 18972 this.eof = true; 18973 }; 18974 18975 return Jbig2Stream; 18976}(); 18977 18978exports.Jbig2Stream = Jbig2Stream; 18979 18980/***/ }), 18981/* 161 */ 18982/***/ (function(module, exports, __w_pdfjs_require__) { 18983 18984"use strict"; 18985 18986 18987Object.defineProperty(exports, "__esModule", { 18988 value: true 18989}); 18990exports.Jbig2Image = void 0; 18991 18992var _util = __w_pdfjs_require__(6); 18993 18994var _arithmetic_decoder = __w_pdfjs_require__(162); 18995 18996var _ccitt = __w_pdfjs_require__(159); 18997 18998var Jbig2Error = function Jbig2ErrorClosure() { 18999 function Jbig2Error(msg) { 19000 this.message = 'JBIG2 error: ' + msg; 19001 } 19002 19003 Jbig2Error.prototype = new Error(); 19004 Jbig2Error.prototype.name = 'Jbig2Error'; 19005 Jbig2Error.constructor = Jbig2Error; 19006 return Jbig2Error; 19007}(); 19008 19009var Jbig2Image = function Jbig2ImageClosure() { 19010 function ContextCache() {} 19011 19012 ContextCache.prototype = { 19013 getContexts: function getContexts(id) { 19014 if (id in this) { 19015 return this[id]; 19016 } 19017 19018 return this[id] = new Int8Array(1 << 16); 19019 } 19020 }; 19021 19022 function DecodingContext(data, start, end) { 19023 this.data = data; 19024 this.start = start; 19025 this.end = end; 19026 } 19027 19028 DecodingContext.prototype = { 19029 get decoder() { 19030 var decoder = new _arithmetic_decoder.ArithmeticDecoder(this.data, this.start, this.end); 19031 return (0, _util.shadow)(this, 'decoder', decoder); 19032 }, 19033 19034 get contextCache() { 19035 var cache = new ContextCache(); 19036 return (0, _util.shadow)(this, 'contextCache', cache); 19037 } 19038 19039 }; 19040 19041 function decodeInteger(contextCache, procedure, decoder) { 19042 var contexts = contextCache.getContexts(procedure); 19043 var prev = 1; 19044 19045 function readBits(length) { 19046 var v = 0; 19047 19048 for (var i = 0; i < length; i++) { 19049 var bit = decoder.readBit(contexts, prev); 19050 prev = prev < 256 ? prev << 1 | bit : (prev << 1 | bit) & 511 | 256; 19051 v = v << 1 | bit; 19052 } 19053 19054 return v >>> 0; 19055 } 19056 19057 var sign = readBits(1); 19058 var value = readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(32) + 4436 : readBits(12) + 340 : readBits(8) + 84 : readBits(6) + 20 : readBits(4) + 4 : readBits(2); 19059 return sign === 0 ? value : value > 0 ? -value : null; 19060 } 19061
vendor: 5,159 bytes, lines 19062-19321
19062 function decodeIAID(contextCache, decoder, codeLength) { 19063 var contexts = contextCache.getContexts('IAID'); 19064 var prev = 1; 19065 19066 for (var i = 0; i < codeLength; i++) { 19067 var bit = decoder.readBit(contexts, prev); 19068 prev = prev << 1 | bit; 19069 } 19070 19071 if (codeLength < 31) { 19072 return prev & (1 << codeLength) - 1; 19073 } 19074 19075 return prev & 0x7FFFFFFF; 19076 } 19077 19078 var SegmentTypes = ['SymbolDictionary', null, null, null, 'IntermediateTextRegion', null, 'ImmediateTextRegion', 'ImmediateLosslessTextRegion', null, null, null, null, null, null, null, null, 'PatternDictionary', null, null, null, 'IntermediateHalftoneRegion', null, 'ImmediateHalftoneRegion', 'ImmediateLosslessHalftoneRegion', null, null, null, null, null, null, null, null, null, null, null, null, 'IntermediateGenericRegion', null, 'ImmediateGenericRegion', 'ImmediateLosslessGenericRegion', 'IntermediateGenericRefinementRegion', null, 'ImmediateGenericRefinementRegion', 'ImmediateLosslessGenericRefinementRegion', null, null, null, null, 'PageInformation', 'EndOfPage', 'EndOfStripe', 'EndOfFile', 'Profiles', 'Tables', null, null, null, null, null, null, null, null, 'Extension']; 19079 var CodingTemplates = [[{ 19080 x: -1, 19081 y: -2 19082 }, { 19083 x: 0, 19084 y: -2 19085 }, { 19086 x: 1, 19087 y: -2 19088 }, { 19089 x: -2, 19090 y: -1 19091 }, { 19092 x: -1, 19093 y: -1 19094 }, { 19095 x: 0, 19096 y: -1 19097 }, { 19098 x: 1, 19099 y: -1 19100 }, { 19101 x: 2, 19102 y: -1 19103 }, { 19104 x: -4, 19105 y: 0 19106 }, { 19107 x: -3, 19108 y: 0 19109 }, { 19110 x: -2, 19111 y: 0 19112 }, { 19113 x: -1, 19114 y: 0 19115 }], [{ 19116 x: -1, 19117 y: -2 19118 }, { 19119 x: 0, 19120 y: -2 19121 }, { 19122 x: 1, 19123 y: -2 19124 }, { 19125 x: 2, 19126 y: -2 19127 }, { 19128 x: -2, 19129 y: -1 19130 }, { 19131 x: -1, 19132 y: -1 19133 }, { 19134 x: 0, 19135 y: -1 19136 }, { 19137 x: 1, 19138 y: -1 19139 }, { 19140 x: 2, 19141 y: -1 19142 }, { 19143 x: -3, 19144 y: 0 19145 }, { 19146 x: -2, 19147 y: 0 19148 }, { 19149 x: -1, 19150 y: 0 19151 }], [{ 19152 x: -1, 19153 y: -2 19154 }, { 19155 x: 0, 19156 y: -2 19157 }, { 19158 x: 1, 19159 y: -2 19160 }, { 19161 x: -2, 19162 y: -1 19163 }, { 19164 x: -1, 19165 y: -1 19166 }, { 19167 x: 0, 19168 y: -1 19169 }, { 19170 x: 1, 19171 y: -1 19172 }, { 19173 x: -2, 19174 y: 0 19175 }, { 19176 x: -1, 19177 y: 0 19178 }], [{ 19179 x: -3, 19180 y: -1 19181 }, { 19182 x: -2, 19183 y: -1 19184 }, { 19185 x: -1, 19186 y: -1 19187 }, { 19188 x: 0, 19189 y: -1 19190 }, { 19191 x: 1, 19192 y: -1 19193 }, { 19194 x: -4, 19195 y: 0 19196 }, { 19197 x: -3, 19198 y: 0 19199 }, { 19200 x: -2, 19201 y: 0 19202 }, { 19203 x: -1, 19204 y: 0 19205 }]]; 19206 var RefinementTemplates = [{ 19207 coding: [{ 19208 x: 0, 19209 y: -1 19210 }, { 19211 x: 1, 19212 y: -1 19213 }, { 19214 x: -1, 19215 y: 0 19216 }], 19217 reference: [{ 19218 x: 0, 19219 y: -1 19220 }, { 19221 x: 1, 19222 y: -1 19223 }, { 19224 x: -1, 19225 y: 0 19226 }, { 19227 x: 0, 19228 y: 0 19229 }, { 19230 x: 1, 19231 y: 0 19232 }, { 19233 x: -1, 19234 y: 1 19235 }, { 19236 x: 0, 19237 y: 1 19238 }, { 19239 x: 1, 19240 y: 1 19241 }] 19242 }, { 19243 coding: [{ 19244 x: -1, 19245 y: -1 19246 }, { 19247 x: 0, 19248 y: -1 19249 }, { 19250 x: 1, 19251 y: -1 19252 }, { 19253 x: -1, 19254 y: 0 19255 }], 19256 reference: [{ 19257 x: 0, 19258 y: -1 19259 }, { 19260 x: -1, 19261 y: 0 19262 }, { 19263 x: 0, 19264 y: 0 19265 }, { 19266 x: 1, 19267 y: 0 19268 }, { 19269 x: 0, 19270 y: 1 19271 }, { 19272 x: 1, 19273 y: 1 19274 }] 19275 }]; 19276 var ReusedContexts = [0x9B25, 0x0795, 0x00E5, 0x0195]; 19277 var RefinementReusedContexts = [0x0020, 0x0008]; 19278 19279 function decodeBitmapTemplate0(width, height, decodingContext) { 19280 var decoder = decodingContext.decoder; 19281 var contexts = decodingContext.contextCache.getContexts('GB'); 19282 var contextLabel, 19283 i, 19284 j, 19285 pixel, 19286 row, 19287 row1, 19288 row2, 19289 bitmap = []; 19290 var OLD_PIXEL_MASK = 0x7BF7; 19291 19292 for (i = 0; i < height; i++) { 19293 row = bitmap[i] = new Uint8Array(width); 19294 row1 = i < 1 ? row : bitmap[i - 1]; 19295 row2 = i < 2 ? row : bitmap[i - 2]; 19296 contextLabel = row2[0] << 13 | row2[1] << 12 | row2[2] << 11 | row1[0] << 7 | row1[1] << 6 | row1[2] << 5 | row1[3] << 4; 19297 19298 for (j = 0; j < width; j++) { 19299 row[j] = pixel = decoder.readBit(contexts, contextLabel); 19300 contextLabel = (contextLabel & OLD_PIXEL_MASK) << 1 | (j + 3 < width ? row2[j + 3] << 11 : 0) | (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel; 19301 } 19302 } 19303 19304 return bitmap; 19305 } 19306 19307 function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, decodingContext) { 19308 if (mmr) { 19309 var input = new Reader(decodingContext.data, decodingContext.start, decodingContext.end); 19310 return decodeMMRBitmap(input, width, height, false); 19311 } 19312 19313 if (templateIndex === 0 && !skip && !prediction && at.length === 4 && at[0].x === 3 && at[0].y === -1 && at[1].x === -3 && at[1].y === -1 && at[2].x === 2 && at[2].y === -2 && at[3].x === -2 && at[3].y === -2) { 19314 return decodeBitmapTemplate0(width, height, decodingContext); 19315 } 19316 19317 var useskip = !!skip; 19318 var template = CodingTemplates[templateIndex].concat(at); 19319 template.sort(function (a, b) { 19320 return a.y - b.y || a.x - b.x; 19321 });
vendor: 5,447 bytes, lines 19322-19499
19322 var templateLength = template.length; 19323 var templateX = new Int8Array(templateLength); 19324 var templateY = new Int8Array(templateLength); 19325 var changingTemplateEntries = []; 19326 var reuseMask = 0, 19327 minX = 0, 19328 maxX = 0, 19329 minY = 0; 19330 var c, k; 19331 19332 for (k = 0; k < templateLength; k++) { 19333 templateX[k] = template[k].x; 19334 templateY[k] = template[k].y; 19335 minX = Math.min(minX, template[k].x); 19336 maxX = Math.max(maxX, template[k].x); 19337 minY = Math.min(minY, template[k].y); 19338 19339 if (k < templateLength - 1 && template[k].y === template[k + 1].y && template[k].x === template[k + 1].x - 1) { 19340 reuseMask |= 1 << templateLength - 1 - k; 19341 } else { 19342 changingTemplateEntries.push(k); 19343 } 19344 } 19345 19346 var changingEntriesLength = changingTemplateEntries.length; 19347 var changingTemplateX = new Int8Array(changingEntriesLength); 19348 var changingTemplateY = new Int8Array(changingEntriesLength); 19349 var changingTemplateBit = new Uint16Array(changingEntriesLength); 19350 19351 for (c = 0; c < changingEntriesLength; c++) { 19352 k = changingTemplateEntries[c]; 19353 changingTemplateX[c] = template[k].x; 19354 changingTemplateY[c] = template[k].y; 19355 changingTemplateBit[c] = 1 << templateLength - 1 - k; 19356 } 19357 19358 var sbb_left = -minX; 19359 var sbb_top = -minY; 19360 var sbb_right = width - maxX; 19361 var pseudoPixelContext = ReusedContexts[templateIndex]; 19362 var row = new Uint8Array(width); 19363 var bitmap = []; 19364 var decoder = decodingContext.decoder; 19365 var contexts = decodingContext.contextCache.getContexts('GB'); 19366 var ltp = 0, 19367 j, 19368 i0, 19369 j0, 19370 contextLabel = 0, 19371 bit, 19372 shift; 19373 19374 for (var i = 0; i < height; i++) { 19375 if (prediction) { 19376 var sltp = decoder.readBit(contexts, pseudoPixelContext); 19377 ltp ^= sltp; 19378 19379 if (ltp) { 19380 bitmap.push(row); 19381 continue; 19382 } 19383 } 19384 19385 row = new Uint8Array(row); 19386 bitmap.push(row); 19387 19388 for (j = 0; j < width; j++) { 19389 if (useskip && skip[i][j]) { 19390 row[j] = 0; 19391 continue; 19392 } 19393 19394 if (j >= sbb_left && j < sbb_right && i >= sbb_top) { 19395 contextLabel = contextLabel << 1 & reuseMask; 19396 19397 for (k = 0; k < changingEntriesLength; k++) { 19398 i0 = i + changingTemplateY[k]; 19399 j0 = j + changingTemplateX[k]; 19400 bit = bitmap[i0][j0]; 19401 19402 if (bit) { 19403 bit = changingTemplateBit[k]; 19404 contextLabel |= bit; 19405 } 19406 } 19407 } else { 19408 contextLabel = 0; 19409 shift = templateLength - 1; 19410 19411 for (k = 0; k < templateLength; k++, shift--) { 19412 j0 = j + templateX[k]; 19413 19414 if (j0 >= 0 && j0 < width) { 19415 i0 = i + templateY[k]; 19416 19417 if (i0 >= 0) { 19418 bit = bitmap[i0][j0]; 19419 19420 if (bit) { 19421 contextLabel |= bit << shift; 19422 } 19423 } 19424 } 19425 } 19426 } 19427 19428 var pixel = decoder.readBit(contexts, contextLabel); 19429 row[j] = pixel; 19430 } 19431 } 19432 19433 return bitmap; 19434 } 19435 19436 function decodeRefinement(width, height, templateIndex, referenceBitmap, offsetX, offsetY, prediction, at, decodingContext) { 19437 var codingTemplate = RefinementTemplates[templateIndex].coding; 19438 19439 if (templateIndex === 0) { 19440 codingTemplate = codingTemplate.concat([at[0]]); 19441 } 19442 19443 var codingTemplateLength = codingTemplate.length; 19444 var codingTemplateX = new Int32Array(codingTemplateLength); 19445 var codingTemplateY = new Int32Array(codingTemplateLength); 19446 var k; 19447 19448 for (k = 0; k < codingTemplateLength; k++) { 19449 codingTemplateX[k] = codingTemplate[k].x; 19450 codingTemplateY[k] = codingTemplate[k].y; 19451 } 19452 19453 var referenceTemplate = RefinementTemplates[templateIndex].reference; 19454 19455 if (templateIndex === 0) { 19456 referenceTemplate = referenceTemplate.concat([at[1]]); 19457 } 19458 19459 var referenceTemplateLength = referenceTemplate.length; 19460 var referenceTemplateX = new Int32Array(referenceTemplateLength); 19461 var referenceTemplateY = new Int32Array(referenceTemplateLength); 19462 19463 for (k = 0; k < referenceTemplateLength; k++) { 19464 referenceTemplateX[k] = referenceTemplate[k].x; 19465 referenceTemplateY[k] = referenceTemplate[k].y; 19466 } 19467 19468 var referenceWidth = referenceBitmap[0].length; 19469 var referenceHeight = referenceBitmap.length; 19470 var pseudoPixelContext = RefinementReusedContexts[templateIndex]; 19471 var bitmap = []; 19472 var decoder = decodingContext.decoder; 19473 var contexts = decodingContext.contextCache.getContexts('GR'); 19474 var ltp = 0; 19475 19476 for (var i = 0; i < height; i++) { 19477 if (prediction) { 19478 var sltp = decoder.readBit(contexts, pseudoPixelContext); 19479 ltp ^= sltp; 19480 19481 if (ltp) { 19482 throw new Jbig2Error('prediction is not supported'); 19483 } 19484 } 19485 19486 var row = new Uint8Array(width); 19487 bitmap.push(row); 19488 19489 for (var j = 0; j < width; j++) { 19490 var i0, j0; 19491 var contextLabel = 0; 19492 19493 for (k = 0; k < codingTemplateLength; k++) { 19494 i0 = i + codingTemplateY[k]; 19495 j0 = j + codingTemplateX[k]; 19496 19497 if (i0 < 0 || j0 < 0 || j0 >= width) { 19498 contextLabel <<= 1; 19499 } else {
19500 contextLabel = contextLabel << 1 | bitmap[i0][j0]; 19501 } 19502 } 19503 19504 for (k = 0; k < referenceTemplateLength; k++) { 19505 i0 = i + referenceTemplateY[k] - offsetY; 19506 j0 = j + referenceTemplateX[k] - offsetX; 19507 19508 if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || j0 >= referenceWidth) { 19509 contextLabel <<= 1; 19510 } else { 19511 contextLabel = contextLabel << 1 | referenceBitmap[i0][j0]; 19512 } 19513 } 19514 19515 var pixel = decoder.readBit(contexts, contextLabel); 19516 row[j] = pixel; 19517 } 19518 } 19519 19520 return bitmap; 19521 } 19522 19523 function decodeSymbolDictionary(huffman, refinement, symbols, numberOfNewSymbols, numberOfExportedSymbols, huffmanTables, templateIndex, at, refinementTemplateIndex, refinementAt, decodingContext, huffmanInput) { 19524 if (huffman && refinement) { 19525 throw new Jbig2Error('symbol refinement with Huffman is not supported'); 19526 } 19527 19528 var newSymbols = []; 19529 var currentHeight = 0; 19530 var symbolCodeLength = (0, _util.log2)(symbols.length + numberOfNewSymbols); 19531 var decoder = decodingContext.decoder; 19532 var contextCache = decodingContext.contextCache;
19533 var tableB1, symbolWidths; 19534 19535 if (huffman) { 19536 tableB1 = getStandardTable(1); 19537 symbolWidths = []; 19538 symbolCodeLength = Math.max(symbolCodeLength, 1); 19539 } 19540 19541 while (newSymbols.length < numberOfNewSymbols) { 19542 var deltaHeight = huffman ? huffmanTables.tableDeltaHeight.decode(huffmanInput) : decodeInteger(contextCache, 'IADH', decoder); 19543 currentHeight += deltaHeight; 19544 var currentWidth = 0, 19545 totalWidth = 0; 19546 var firstSymbol = huffman ? symbolWidths.length : 0; 19547 19548 while (true) { 19549 var deltaWidth = huffman ? huffmanTables.tableDeltaWidth.decode(huffmanInput) : decodeInteger(contextCache, 'IADW', decoder); 19550 19551 if (deltaWidth === null) { 19552 break; 19553 } 19554 19555 currentWidth += deltaWidth; 19556 totalWidth += currentWidth; 19557 var bitmap; 19558 19559 if (refinement) { 19560 var numberOfInstances = decodeInteger(contextCache, 'IAAI', decoder); 19561 19562 if (numberOfInstances > 1) { 19563 bitmap = decodeTextRegion(huffman, refinement, currentWidth, currentHeight, 0, numberOfInstances, 1, symbols.concat(newSymbols), symbolCodeLength, 0, 0, 1, 0, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext, 0, huffmanInput); 19564 } else { 19565 var symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); 19566 var rdx = decodeInteger(contextCache, 'IARDX', decoder); 19567 var rdy = decodeInteger(contextCache, 'IARDY', decoder); 19568 var symbol = symbolId < symbols.length ? symbols[symbolId] : newSymbols[symbolId - symbols.length]; 19569 bitmap = decodeRefinement(currentWidth, currentHeight, refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, decodingContext); 19570 } 19571 19572 newSymbols.push(bitmap); 19573 } else if (huffman) { 19574 symbolWidths.push(currentWidth); 19575 } else { 19576 bitmap = decodeBitmap(false, currentWidth, currentHeight, templateIndex, false, null, at, decodingContext); 19577 newSymbols.push(bitmap); 19578 } 19579 } 19580 19581 if (huffman && !refinement) { 19582 var bitmapSize = huffmanTables.tableBitmapSize.decode(huffmanInput); 19583 huffmanInput.byteAlign(); 19584 var collectiveBitmap = void 0; 19585 19586 if (bitmapSize === 0) { 19587 collectiveBitmap = readUncompressedBitmap(huffmanInput, totalWidth, currentHeight); 19588 } else { 19589 var originalEnd = huffmanInput.end; 19590 var bitmapEnd = huffmanInput.position + bitmapSize; 19591 huffmanInput.end = bitmapEnd; 19592 collectiveBitmap = decodeMMRBitmap(huffmanInput, totalWidth, currentHeight, false); 19593 huffmanInput.end = originalEnd; 19594 huffmanInput.position = bitmapEnd; 19595 } 19596 19597 var numberOfSymbolsDecoded = symbolWidths.length; 19598 19599 if (firstSymbol === numberOfSymbolsDecoded - 1) { 19600 newSymbols.push(collectiveBitmap); 19601 } else { 19602 var _i = void 0, 19603 y = void 0, 19604 xMin = 0, 19605 xMax = void 0, 19606 bitmapWidth = void 0, 19607 symbolBitmap = void 0; 19608 19609 for (_i = firstSymbol; _i < numberOfSymbolsDecoded; _i++) { 19610 bitmapWidth = symbolWidths[_i]; 19611 xMax = xMin + bitmapWidth; 19612 symbolBitmap = []; 19613 19614 for (y = 0; y < currentHeight; y++) { 19615 symbolBitmap.push(collectiveBitmap[y].subarray(xMin, xMax)); 19616 } 19617 19618 newSymbols.push(symbolBitmap); 19619 xMin = xMax; 19620 } 19621 } 19622 } 19623 } 19624 19625 var exportedSymbols = []; 19626 var flags = [], 19627 currentFlag = false; 19628 var totalSymbolsLength = symbols.length + numberOfNewSymbols; 19629 19630 while (flags.length < totalSymbolsLength) { 19631 var runLength = huffman ? tableB1.decode(huffmanInput) : decodeInteger(contextCache, 'IAEX', decoder); 19632 19633 while (runLength--) { 19634 flags.push(currentFlag); 19635 } 19636 19637 currentFlag = !currentFlag; 19638 } 19639 19640 for (var i = 0, ii = symbols.length; i < ii; i++) { 19641 if (flags[i]) { 19642 exportedSymbols.push(symbols[i]); 19643 } 19644 } 19645 19646 for (var j = 0; j < numberOfNewSymbols; i++, j++) { 19647 if (flags[i]) { 19648 exportedSymbols.push(newSymbols[j]); 19649 } 19650 } 19651 19652 return exportedSymbols; 19653 } 19654 19655 function decodeTextRegion(huffman, refinement, width, height, defaultPixelValue, numberOfSymbolInstances, stripSize, inputSymbols, symbolCodeLength, transposed, dsOffset, referenceCorner, combinationOperator, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext, logStripSize, huffmanInput) { 19656 if (huffman && refinement) { 19657 throw new Jbig2Error('refinement with Huffman is not supported'); 19658 } 19659 19660 var bitmap = []; 19661 var i, row; 19662 19663 for (i = 0; i < height; i++) { 19664 row = new Uint8Array(width); 19665 19666 if (defaultPixelValue) { 19667 for (var j = 0; j < width; j++) { 19668 row[j] = defaultPixelValue; 19669 } 19670 } 19671 19672 bitmap.push(row); 19673 } 19674 19675 var decoder = decodingContext.decoder; 19676 var contextCache = decodingContext.contextCache; 19677 var stripT = huffman ? -huffmanTables.tableDeltaT.decode(huffmanInput) : -decodeInteger(contextCache, 'IADT', decoder); 19678 var firstS = 0; 19679 i = 0; 19680 19681 while (i < numberOfSymbolInstances) { 19682 var deltaT = huffman ? huffmanTables.tableDeltaT.decode(huffmanInput) : decodeInteger(contextCache, 'IADT', decoder);
19683 stripT += deltaT; 19684 var deltaFirstS = huffman ? huffmanTables.tableFirstS.decode(huffmanInput) : decodeInteger(contextCache, 'IAFS', decoder); 19685 firstS += deltaFirstS; 19686 var currentS = firstS; 19687 19688 do { 19689 var currentT = 0; 19690 19691 if (stripSize > 1) { 19692 currentT = huffman ? huffmanInput.readBits(logStripSize) : decodeInteger(contextCache, 'IAIT', decoder); 19693 } 19694 19695 var t = stripSize * stripT + currentT; 19696 var symbolId = huffman ? huffmanTables.symbolIDTable.decode(huffmanInput) : decodeIAID(contextCache, decoder, symbolCodeLength); 19697 var applyRefinement = refinement && (huffman ? huffmanInput.readBit() : decodeInteger(contextCache, 'IARI', decoder)); 19698 var symbolBitmap = inputSymbols[symbolId]; 19699 var symbolWidth = symbolBitmap[0].length; 19700 var symbolHeight = symbolBitmap.length; 19701 19702 if (applyRefinement) { 19703 var rdw = decodeInteger(contextCache, 'IARDW', decoder); 19704 var rdh = decodeInteger(contextCache, 'IARDH', decoder); 19705 var rdx = decodeInteger(contextCache, 'IARDX', decoder); 19706 var rdy = decodeInteger(contextCache, 'IARDY', decoder); 19707 symbolWidth += rdw; 19708 symbolHeight += rdh; 19709 symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, (rdh >> 1) + rdy, false, refinementAt, decodingContext); 19710 } 19711 19712 var offsetT = t - (referenceCorner & 1 ? 0 : symbolHeight - 1); 19713 var offsetS = currentS - (referenceCorner & 2 ? symbolWidth - 1 : 0); 19714 var s2, t2, symbolRow; 19715 19716 if (transposed) { 19717 for (s2 = 0; s2 < symbolHeight; s2++) { 19718 row = bitmap[offsetS + s2]; 19719 19720 if (!row) { 19721 continue; 19722 } 19723 19724 symbolRow = symbolBitmap[s2]; 19725 var maxWidth = Math.min(width - offsetT, symbolWidth); 19726 19727 switch (combinationOperator) { 19728 case 0: 19729 for (t2 = 0; t2 < maxWidth; t2++) { 19730 row[offsetT + t2] |= symbolRow[t2]; 19731 } 19732 19733 break; 19734 19735 case 2: 19736 for (t2 = 0; t2 < maxWidth; t2++) { 19737 row[offsetT + t2] ^= symbolRow[t2]; 19738 } 19739 19740 break; 19741 19742 default: 19743 throw new Jbig2Error("operator ".concat(combinationOperator, " is not supported")); 19744 } 19745 } 19746 19747 currentS += symbolHeight - 1; 19748 } else { 19749 for (t2 = 0; t2 < symbolHeight; t2++) { 19750 row = bitmap[offsetT + t2]; 19751 19752 if (!row) { 19753 continue; 19754 } 19755 19756 symbolRow = symbolBitmap[t2]; 19757 19758 switch (combinationOperator) { 19759 case 0: 19760 for (s2 = 0; s2 < symbolWidth; s2++) { 19761 row[offsetS + s2] |= symbolRow[s2]; 19762 } 19763 19764 break; 19765 19766 case 2: 19767 for (s2 = 0; s2 < symbolWidth; s2++) { 19768 row[offsetS + s2] ^= symbolRow[s2]; 19769 } 19770 19771 break; 19772 19773 default: 19774 throw new Jbig2Error("operator ".concat(combinationOperator, " is not supported")); 19775 } 19776 } 19777 19778 currentS += symbolWidth - 1; 19779 } 19780 19781 i++; 19782 var deltaS = huffman ? huffmanTables.tableDeltaS.decode(huffmanInput) : decodeInteger(contextCache, 'IADS', decoder); 19783 19784 if (deltaS === null) { 19785 break; 19786 } 19787 19788 currentS += deltaS + dsOffset; 19789 } while (true); 19790 } 19791 19792 return bitmap; 19793 } 19794 19795 function decodePatternDictionary(mmr, patternWidth, patternHeight, maxPatternIndex, template, decodingContext) { 19796 var at = []; 19797 19798 if (!mmr) { 19799 at.push({ 19800 x: -patternWidth, 19801 y: 0 19802 }); 19803 19804 if (template === 0) { 19805 at.push({ 19806 x: -3, 19807 y: -1 19808 }); 19809 at.push({ 19810 x: 2, 19811 y: -2 19812 }); 19813 at.push({ 19814 x: -2, 19815 y: -2 19816 }); 19817 } 19818 } 19819 19820 var collectiveWidth = (maxPatternIndex + 1) * patternWidth;
19821 var collectiveBitmap = decodeBitmap(mmr, collectiveWidth, patternHeight, template, false, null, at, decodingContext); 19822 var patterns = [], 19823 i = 0, 19824 patternBitmap, 19825 xMin, 19826 xMax, 19827 y; 19828 19829 while (i <= maxPatternIndex) { 19830 patternBitmap = []; 19831 xMin = patternWidth * i; 19832 xMax = xMin + patternWidth; 19833 19834 for (y = 0; y < patternHeight; y++) { 19835 patternBitmap.push(collectiveBitmap[y].subarray(xMin, xMax)); 19836 } 19837 19838 patterns.push(patternBitmap); 19839 i++; 19840 } 19841 19842 return patterns; 19843 } 19844 19845 function decodeHalftoneRegion(mmr, patterns, template, regionWidth, regionHeight, defaultPixelValue, enableSkip, combinationOperator, gridWidth, gridHeight, gridOffsetX, gridOffsetY, gridVectorX, gridVectorY, decodingContext) { 19846 var skip = null; 19847 19848 if (enableSkip) { 19849 throw new Jbig2Error('skip is not supported'); 19850 } 19851 19852 if (combinationOperator !== 0) { 19853 throw new Jbig2Error('operator ' + combinationOperator + ' is not supported in halftone region'); 19854 } 19855 19856 var regionBitmap = []; 19857 var i, j, row; 19858 19859 for (i = 0; i < regionHeight; i++) { 19860 row = new Uint8Array(regionWidth); 19861 19862 if (defaultPixelValue) { 19863 for (j = 0; j < regionWidth; j++) { 19864 row[j] = defaultPixelValue; 19865 } 19866 } 19867 19868 regionBitmap.push(row); 19869 } 19870 19871 var numberOfPatterns = patterns.length; 19872 var pattern0 = patterns[0]; 19873 var patternWidth = pattern0[0].length, 19874 patternHeight = pattern0.length; 19875 var bitsPerValue = (0, _util.log2)(numberOfPatterns); 19876 var at = []; 19877 19878 if (!mmr) { 19879 at.push({ 19880 x: template <= 1 ? 3 : 2, 19881 y: -1 19882 }); 19883 19884 if (template === 0) { 19885 at.push({ 19886 x: -3, 19887 y: -1 19888 }); 19889 at.push({ 19890 x: 2, 19891 y: -2 19892 }); 19893 at.push({ 19894 x: -2, 19895 y: -2 19896 }); 19897 } 19898 } 19899 19900 var grayScaleBitPlanes = [], 19901 mmrInput, 19902 bitmap; 19903 19904 if (mmr) { 19905 mmrInput = new Reader(decodingContext.data, decodingContext.start, decodingContext.end); 19906 } 19907 19908 for (i = bitsPerValue - 1; i >= 0; i--) { 19909 if (mmr) { 19910 bitmap = decodeMMRBitmap(mmrInput, gridWidth, gridHeight, true); 19911 } else { 19912 bitmap = decodeBitmap(false, gridWidth, gridHeight, template, false, skip, at, decodingContext); 19913 } 19914 19915 grayScaleBitPlanes[i] = bitmap; 19916 } 19917 19918 var mg, ng, bit, patternIndex, patternBitmap, x, y, patternRow, regionRow; 19919 19920 for (mg = 0; mg < gridHeight; mg++) { 19921 for (ng = 0; ng < gridWidth; ng++) { 19922 bit = 0; 19923 patternIndex = 0; 19924 19925 for (j = bitsPerValue - 1; j >= 0; j--) { 19926 bit = grayScaleBitPlanes[j][mg][ng] ^ bit; 19927 patternIndex |= bit << j; 19928 } 19929 19930 patternBitmap = patterns[patternIndex]; 19931 x = gridOffsetX + mg * gridVectorY + ng * gridVectorX >> 8; 19932 y = gridOffsetY + mg * gridVectorX - ng * gridVectorY >> 8; 19933 19934 if (x >= 0 && x + patternWidth <= regionWidth && y >= 0 && y + patternHeight <= regionHeight) { 19935 for (i = 0; i < patternHeight; i++) { 19936 regionRow = regionBitmap[y + i]; 19937 patternRow = patternBitmap[i];
vendor: 16,075 bytes, lines 19938-20399
19938 19939 for (j = 0; j < patternWidth; j++) { 19940 regionRow[x + j] |= patternRow[j]; 19941 } 19942 } 19943 } else { 19944 var regionX = void 0, 19945 regionY = void 0; 19946 19947 for (i = 0; i < patternHeight; i++) { 19948 regionY = y + i; 19949 19950 if (regionY < 0 || regionY >= regionHeight) { 19951 continue; 19952 } 19953 19954 regionRow = regionBitmap[regionY]; 19955 patternRow = patternBitmap[i]; 19956 19957 for (j = 0; j < patternWidth; j++) { 19958 regionX = x + j; 19959 19960 if (regionX >= 0 && regionX < regionWidth) { 19961 regionRow[regionX] |= patternRow[j]; 19962 } 19963 } 19964 } 19965 } 19966 } 19967 } 19968 19969 return regionBitmap; 19970 } 19971 19972 function readSegmentHeader(data, start) { 19973 var segmentHeader = {}; 19974 segmentHeader.number = (0, _util.readUint32)(data, start); 19975 var flags = data[start + 4]; 19976 var segmentType = flags & 0x3F; 19977 19978 if (!SegmentTypes[segmentType]) { 19979 throw new Jbig2Error('invalid segment type: ' + segmentType); 19980 } 19981 19982 segmentHeader.type = segmentType; 19983 segmentHeader.typeName = SegmentTypes[segmentType]; 19984 segmentHeader.deferredNonRetain = !!(flags & 0x80); 19985 var pageAssociationFieldSize = !!(flags & 0x40); 19986 var referredFlags = data[start + 5]; 19987 var referredToCount = referredFlags >> 5 & 7; 19988 var retainBits = [referredFlags & 31]; 19989 var position = start + 6; 19990 19991 if (referredFlags === 7) { 19992 referredToCount = (0, _util.readUint32)(data, position - 1) & 0x1FFFFFFF; 19993 position += 3; 19994 var bytes = referredToCount + 7 >> 3; 19995 retainBits[0] = data[position++]; 19996 19997 while (--bytes > 0) { 19998 retainBits.push(data[position++]); 19999 } 20000 } else if (referredFlags === 5 || referredFlags === 6) { 20001 throw new Jbig2Error('invalid referred-to flags'); 20002 } 20003 20004 segmentHeader.retainBits = retainBits; 20005 var referredToSegmentNumberSize = segmentHeader.number <= 256 ? 1 : segmentHeader.number <= 65536 ? 2 : 4; 20006 var referredTo = []; 20007 var i, ii; 20008 20009 for (i = 0; i < referredToCount; i++) { 20010 var number = referredToSegmentNumberSize === 1 ? data[position] : referredToSegmentNumberSize === 2 ? (0, _util.readUint16)(data, position) : (0, _util.readUint32)(data, position); 20011 referredTo.push(number); 20012 position += referredToSegmentNumberSize; 20013 } 20014 20015 segmentHeader.referredTo = referredTo; 20016 20017 if (!pageAssociationFieldSize) { 20018 segmentHeader.pageAssociation = data[position++]; 20019 } else { 20020 segmentHeader.pageAssociation = (0, _util.readUint32)(data, position); 20021 position += 4; 20022 } 20023 20024 segmentHeader.length = (0, _util.readUint32)(data, position); 20025 position += 4; 20026 20027 if (segmentHeader.length === 0xFFFFFFFF) { 20028 if (segmentType === 38) { 20029 var genericRegionInfo = readRegionSegmentInformation(data, position); 20030 var genericRegionSegmentFlags = data[position + RegionSegmentInformationFieldLength]; 20031 var genericRegionMmr = !!(genericRegionSegmentFlags & 1); 20032 var searchPatternLength = 6; 20033 var searchPattern = new Uint8Array(searchPatternLength); 20034 20035 if (!genericRegionMmr) { 20036 searchPattern[0] = 0xFF; 20037 searchPattern[1] = 0xAC; 20038 } 20039 20040 searchPattern[2] = genericRegionInfo.height >>> 24 & 0xFF; 20041 searchPattern[3] = genericRegionInfo.height >> 16 & 0xFF; 20042 searchPattern[4] = genericRegionInfo.height >> 8 & 0xFF; 20043 searchPattern[5] = genericRegionInfo.height & 0xFF; 20044 20045 for (i = position, ii = data.length; i < ii; i++) { 20046 var j = 0; 20047 20048 while (j < searchPatternLength && searchPattern[j] === data[i + j]) { 20049 j++; 20050 } 20051 20052 if (j === searchPatternLength) { 20053 segmentHeader.length = i + searchPatternLength; 20054 break; 20055 } 20056 } 20057 20058 if (segmentHeader.length === 0xFFFFFFFF) { 20059 throw new Jbig2Error('segment end was not found'); 20060 } 20061 } else { 20062 throw new Jbig2Error('invalid unknown segment length'); 20063 } 20064 } 20065 20066 segmentHeader.headerEnd = position; 20067 return segmentHeader; 20068 } 20069 20070 function readSegments(header, data, start, end) { 20071 var segments = []; 20072 var position = start; 20073 20074 while (position < end) { 20075 var segmentHeader = readSegmentHeader(data, position); 20076 position = segmentHeader.headerEnd; 20077 var segment = { 20078 header: segmentHeader, 20079 data: data 20080 }; 20081 20082 if (!header.randomAccess) { 20083 segment.start = position; 20084 position += segmentHeader.length; 20085 segment.end = position; 20086 } 20087 20088 segments.push(segment); 20089 20090 if (segmentHeader.type === 51) { 20091 break; 20092 } 20093 } 20094 20095 if (header.randomAccess) { 20096 for (var i = 0, ii = segments.length; i < ii; i++) { 20097 segments[i].start = position; 20098 position += segments[i].header.length; 20099 segments[i].end = position; 20100 } 20101 } 20102 20103 return segments; 20104 } 20105 20106 function readRegionSegmentInformation(data, start) { 20107 return { 20108 width: (0, _util.readUint32)(data, start), 20109 height: (0, _util.readUint32)(data, start + 4), 20110 x: (0, _util.readUint32)(data, start + 8), 20111 y: (0, _util.readUint32)(data, start + 12), 20112 combinationOperator: data[start + 16] & 7 20113 }; 20114 } 20115 20116 var RegionSegmentInformationFieldLength = 17; 20117 20118 function processSegment(segment, visitor) { 20119 var header = segment.header; 20120 var data = segment.data, 20121 position = segment.start, 20122 end = segment.end; 20123 var args, at, i, atLength; 20124 20125 switch (header.type) { 20126 case 0: 20127 var dictionary = {}; 20128 var dictionaryFlags = (0, _util.readUint16)(data, position); 20129 dictionary.huffman = !!(dictionaryFlags & 1); 20130 dictionary.refinement = !!(dictionaryFlags & 2); 20131 dictionary.huffmanDHSelector = dictionaryFlags >> 2 & 3; 20132 dictionary.huffmanDWSelector = dictionaryFlags >> 4 & 3; 20133 dictionary.bitmapSizeSelector = dictionaryFlags >> 6 & 1; 20134 dictionary.aggregationInstancesSelector = dictionaryFlags >> 7 & 1; 20135 dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256); 20136 dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512); 20137 dictionary.template = dictionaryFlags >> 10 & 3; 20138 dictionary.refinementTemplate = dictionaryFlags >> 12 & 1; 20139 position += 2; 20140 20141 if (!dictionary.huffman) { 20142 atLength = dictionary.template === 0 ? 4 : 1; 20143 at = []; 20144 20145 for (i = 0; i < atLength; i++) { 20146 at.push({ 20147 x: (0, _util.readInt8)(data, position), 20148 y: (0, _util.readInt8)(data, position + 1) 20149 }); 20150 position += 2; 20151 } 20152 20153 dictionary.at = at; 20154 } 20155 20156 if (dictionary.refinement && !dictionary.refinementTemplate) { 20157 at = []; 20158 20159 for (i = 0; i < 2; i++) { 20160 at.push({ 20161 x: (0, _util.readInt8)(data, position), 20162 y: (0, _util.readInt8)(data, position + 1) 20163 }); 20164 position += 2; 20165 } 20166 20167 dictionary.refinementAt = at; 20168 } 20169 20170 dictionary.numberOfExportedSymbols = (0, _util.readUint32)(data, position); 20171 position += 4; 20172 dictionary.numberOfNewSymbols = (0, _util.readUint32)(data, position); 20173 position += 4; 20174 args = [dictionary, header.number, header.referredTo, data, position, end]; 20175 break; 20176 20177 case 6: 20178 case 7: 20179 var textRegion = {}; 20180 textRegion.info = readRegionSegmentInformation(data, position); 20181 position += RegionSegmentInformationFieldLength; 20182 var textRegionSegmentFlags = (0, _util.readUint16)(data, position); 20183 position += 2; 20184 textRegion.huffman = !!(textRegionSegmentFlags & 1); 20185 textRegion.refinement = !!(textRegionSegmentFlags & 2); 20186 textRegion.logStripSize = textRegionSegmentFlags >> 2 & 3; 20187 textRegion.stripSize = 1 << textRegion.logStripSize; 20188 textRegion.referenceCorner = textRegionSegmentFlags >> 4 & 3; 20189 textRegion.transposed = !!(textRegionSegmentFlags & 64); 20190 textRegion.combinationOperator = textRegionSegmentFlags >> 7 & 3; 20191 textRegion.defaultPixelValue = textRegionSegmentFlags >> 9 & 1; 20192 textRegion.dsOffset = textRegionSegmentFlags << 17 >> 27; 20193 textRegion.refinementTemplate = textRegionSegmentFlags >> 15 & 1; 20194 20195 if (textRegion.huffman) { 20196 var textRegionHuffmanFlags = (0, _util.readUint16)(data, position); 20197 position += 2; 20198 textRegion.huffmanFS = textRegionHuffmanFlags & 3; 20199 textRegion.huffmanDS = textRegionHuffmanFlags >> 2 & 3; 20200 textRegion.huffmanDT = textRegionHuffmanFlags >> 4 & 3; 20201 textRegion.huffmanRefinementDW = textRegionHuffmanFlags >> 6 & 3; 20202 textRegion.huffmanRefinementDH = textRegionHuffmanFlags >> 8 & 3; 20203 textRegion.huffmanRefinementDX = textRegionHuffmanFlags >> 10 & 3; 20204 textRegion.huffmanRefinementDY = textRegionHuffmanFlags >> 12 & 3; 20205 textRegion.huffmanRefinementSizeSelector = !!(textRegionHuffmanFlags & 0x4000); 20206 } 20207 20208 if (textRegion.refinement && !textRegion.refinementTemplate) { 20209 at = []; 20210 20211 for (i = 0; i < 2; i++) { 20212 at.push({ 20213 x: (0, _util.readInt8)(data, position), 20214 y: (0, _util.readInt8)(data, position + 1) 20215 }); 20216 position += 2; 20217 } 20218 20219 textRegion.refinementAt = at; 20220 } 20221 20222 textRegion.numberOfSymbolInstances = (0, _util.readUint32)(data, position); 20223 position += 4; 20224 args = [textRegion, header.referredTo, data, position, end]; 20225 break; 20226 20227 case 16: 20228 var patternDictionary = {}; 20229 var patternDictionaryFlags = data[position++]; 20230 patternDictionary.mmr = !!(patternDictionaryFlags & 1); 20231 patternDictionary.template = patternDictionaryFlags >> 1 & 3; 20232 patternDictionary.patternWidth = data[position++]; 20233 patternDictionary.patternHeight = data[position++]; 20234 patternDictionary.maxPatternIndex = (0, _util.readUint32)(data, position); 20235 position += 4; 20236 args = [patternDictionary, header.number, data, position, end]; 20237 break; 20238 20239 case 22: 20240 case 23: 20241 var halftoneRegion = {}; 20242 halftoneRegion.info = readRegionSegmentInformation(data, position); 20243 position += RegionSegmentInformationFieldLength; 20244 var halftoneRegionFlags = data[position++]; 20245 halftoneRegion.mmr = !!(halftoneRegionFlags & 1); 20246 halftoneRegion.template = halftoneRegionFlags >> 1 & 3; 20247 halftoneRegion.enableSkip = !!(halftoneRegionFlags & 8); 20248 halftoneRegion.combinationOperator = halftoneRegionFlags >> 4 & 7; 20249 halftoneRegion.defaultPixelValue = halftoneRegionFlags >> 7 & 1; 20250 halftoneRegion.gridWidth = (0, _util.readUint32)(data, position); 20251 position += 4; 20252 halftoneRegion.gridHeight = (0, _util.readUint32)(data, position); 20253 position += 4; 20254 halftoneRegion.gridOffsetX = (0, _util.readUint32)(data, position) & 0xFFFFFFFF; 20255 position += 4; 20256 halftoneRegion.gridOffsetY = (0, _util.readUint32)(data, position) & 0xFFFFFFFF; 20257 position += 4; 20258 halftoneRegion.gridVectorX = (0, _util.readUint16)(data, position); 20259 position += 2; 20260 halftoneRegion.gridVectorY = (0, _util.readUint16)(data, position); 20261 position += 2; 20262 args = [halftoneRegion, header.referredTo, data, position, end]; 20263 break; 20264 20265 case 38: 20266 case 39: 20267 var genericRegion = {}; 20268 genericRegion.info = readRegionSegmentInformation(data, position); 20269 position += RegionSegmentInformationFieldLength; 20270 var genericRegionSegmentFlags = data[position++]; 20271 genericRegion.mmr = !!(genericRegionSegmentFlags & 1); 20272 genericRegion.template = genericRegionSegmentFlags >> 1 & 3; 20273 genericRegion.prediction = !!(genericRegionSegmentFlags & 8); 20274 20275 if (!genericRegion.mmr) { 20276 atLength = genericRegion.template === 0 ? 4 : 1; 20277 at = []; 20278 20279 for (i = 0; i < atLength; i++) { 20280 at.push({ 20281 x: (0, _util.readInt8)(data, position), 20282 y: (0, _util.readInt8)(data, position + 1) 20283 }); 20284 position += 2; 20285 } 20286 20287 genericRegion.at = at; 20288 } 20289 20290 args = [genericRegion, data, position, end]; 20291 break; 20292 20293 case 48: 20294 var pageInfo = { 20295 width: (0, _util.readUint32)(data, position), 20296 height: (0, _util.readUint32)(data, position + 4), 20297 resolutionX: (0, _util.readUint32)(data, position + 8), 20298 resolutionY: (0, _util.readUint32)(data, position + 12) 20299 }; 20300 20301 if (pageInfo.height === 0xFFFFFFFF) { 20302 delete pageInfo.height; 20303 } 20304 20305 var pageSegmentFlags = data[position + 16]; 20306 (0, _util.readUint16)(data, position + 17); 20307 pageInfo.lossless = !!(pageSegmentFlags & 1); 20308 pageInfo.refinement = !!(pageSegmentFlags & 2); 20309 pageInfo.defaultPixelValue = pageSegmentFlags >> 2 & 1; 20310 pageInfo.combinationOperator = pageSegmentFlags >> 3 & 3; 20311 pageInfo.requiresBuffer = !!(pageSegmentFlags & 32); 20312 pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64); 20313 args = [pageInfo]; 20314 break; 20315 20316 case 49: 20317 break; 20318 20319 case 50: 20320 break; 20321 20322 case 51: 20323 break; 20324 20325 case 53: 20326 args = [header.number, data, position, end]; 20327 break; 20328 20329 case 62: 20330 break; 20331 20332 default: 20333 throw new Jbig2Error("segment type ".concat(header.typeName, "(").concat(header.type, ")") + ' is not implemented'); 20334 } 20335 20336 var callbackName = 'on' + header.typeName; 20337 20338 if (callbackName in visitor) { 20339 visitor[callbackName].apply(visitor, args); 20340 } 20341 } 20342 20343 function processSegments(segments, visitor) { 20344 for (var i = 0, ii = segments.length; i < ii; i++) { 20345 processSegment(segments[i], visitor); 20346 } 20347 } 20348 20349 function parseJbig2Chunks(chunks) { 20350 var visitor = new SimpleSegmentVisitor(); 20351 20352 for (var i = 0, ii = chunks.length; i < ii; i++) { 20353 var chunk = chunks[i]; 20354 var segments = readSegments({}, chunk.data, chunk.start, chunk.end); 20355 processSegments(segments, visitor); 20356 } 20357 20358 return visitor.buffer; 20359 } 20360 20361 function parseJbig2(data) { 20362 var position = 0, 20363 end = data.length; 20364 20365 if (data[position] !== 0x97 || data[position + 1] !== 0x4A || data[position + 2] !== 0x42 || data[position + 3] !== 0x32 || data[position + 4] !== 0x0D || data[position + 5] !== 0x0A || data[position + 6] !== 0x1A || data[position + 7] !== 0x0A) { 20366 throw new Jbig2Error('parseJbig2 - invalid header.'); 20367 } 20368 20369 var header = Object.create(null); 20370 position += 8; 20371 var flags = data[position++]; 20372 header.randomAccess = !(flags & 1); 20373 20374 if (!(flags & 2)) { 20375 header.numberOfPages = (0, _util.readUint32)(data, position); 20376 position += 4; 20377 } 20378 20379 var segments = readSegments(header, data, position, end); 20380 var visitor = new SimpleSegmentVisitor(); 20381 processSegments(segments, visitor); 20382 var _visitor$currentPageI = visitor.currentPageInfo, 20383 width = _visitor$currentPageI.width, 20384 height = _visitor$currentPageI.height; 20385 var bitPacked = visitor.buffer; 20386 var imgData = new Uint8ClampedArray(width * height); 20387 var q = 0, 20388 k = 0; 20389 20390 for (var i = 0; i < height; i++) { 20391 var mask = 0, 20392 buffer = void 0; 20393 20394 for (var j = 0; j < width; j++) { 20395 if (!mask) { 20396 mask = 128; 20397 buffer = bitPacked[k++]; 20398 } 20399
20400 imgData[q++] = buffer & mask ? 0 : 255; 20401 mask >>= 1; 20402 } 20403 } 20404 20405 return { 20406 imgData: imgData, 20407 width: width, 20408 height: height 20409 }; 20410 } 20411 20412 function SimpleSegmentVisitor() {} 20413 20414 SimpleSegmentVisitor.prototype = { 20415 onPageInformation: function SimpleSegmentVisitor_onPageInformation(info) { 20416 this.currentPageInfo = info; 20417 var rowSize = info.width + 7 >> 3; 20418 var buffer = new Uint8ClampedArray(rowSize * info.height); 20419 20420 if (info.defaultPixelValue) { 20421 for (var i = 0, ii = buffer.length; i < ii; i++) { 20422 buffer[i] = 0xFF; 20423 } 20424 } 20425 20426 this.buffer = buffer; 20427 }, 20428 drawBitmap: function SimpleSegmentVisitor_drawBitmap(regionInfo, bitmap) { 20429 var pageInfo = this.currentPageInfo; 20430 var width = regionInfo.width, 20431 height = regionInfo.height; 20432 var rowSize = pageInfo.width + 7 >> 3; 20433 var combinationOperator = pageInfo.combinationOperatorOverride ? regionInfo.combinationOperator : pageInfo.combinationOperator; 20434 var buffer = this.buffer; 20435 var mask0 = 128 >> (regionInfo.x & 7); 20436 var offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3); 20437 var i, j, mask, offset; 20438 20439 switch (combinationOperator) { 20440 case 0: 20441 for (i = 0; i < height; i++) { 20442 mask = mask0; 20443 offset = offset0; 20444 20445 for (j = 0; j < width; j++) { 20446 if (bitmap[i][j]) { 20447 buffer[offset] |= mask; 20448 } 20449 20450 mask >>= 1; 20451 20452 if (!mask) { 20453 mask = 128; 20454 offset++; 20455 } 20456 } 20457 20458 offset0 += rowSize; 20459 } 20460 20461 break; 20462 20463 case 2: 20464 for (i = 0; i < height; i++) { 20465 mask = mask0; 20466 offset = offset0; 20467 20468 for (j = 0; j < width; j++) { 20469 if (bitmap[i][j]) { 20470 buffer[offset] ^= mask; 20471 } 20472 20473 mask >>= 1; 20474 20475 if (!mask) { 20476 mask = 128; 20477 offset++; 20478 } 20479 } 20480 20481 offset0 += rowSize; 20482 } 20483 20484 break; 20485 20486 default: 20487 throw new Jbig2Error("operator ".concat(combinationOperator, " is not supported")); 20488 } 20489 }, 20490 onImmediateGenericRegion: function SimpleSegmentVisitor_onImmediateGenericRegion(region, data, start, end) { 20491 var regionInfo = region.info; 20492 var decodingContext = new DecodingContext(data, start, end); 20493 var bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, region.template, region.prediction, null, region.at, decodingContext); 20494 this.drawBitmap(regionInfo, bitmap); 20495 }, 20496 onImmediateLosslessGenericRegion: function SimpleSegmentVisitor_onImmediateLosslessGenericRegion() { 20497 this.onImmediateGenericRegion.apply(this, arguments); 20498 }, 20499 onSymbolDictionary: function SimpleSegmentVisitor_onSymbolDictionary(dictionary, currentSegment, referredSegments, data, start, end) { 20500 var huffmanTables, huffmanInput; 20501 20502 if (dictionary.huffman) { 20503 huffmanTables = getSymbolDictionaryHuffmanTables(dictionary, referredSegments, this.customTables); 20504 huffmanInput = new Reader(data, start, end); 20505 } 20506 20507 var symbols = this.symbols; 20508 20509 if (!symbols) { 20510 this.symbols = symbols = {}; 20511 } 20512 20513 var inputSymbols = []; 20514 20515 for (var i = 0, ii = referredSegments.length; i < ii; i++) { 20516 var referredSymbols = symbols[referredSegments[i]]; 20517 20518 if (referredSymbols) { 20519 inputSymbols = inputSymbols.concat(referredSymbols); 20520 } 20521 } 20522 20523 var decodingContext = new DecodingContext(data, start, end); 20524 symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, dictionary.numberOfExportedSymbols, huffmanTables, dictionary.template, dictionary.at, dictionary.refinementTemplate, dictionary.refinementAt, decodingContext, huffmanInput); 20525 }, 20526 onImmediateTextRegion: function SimpleSegmentVisitor_onImmediateTextRegion(region, referredSegments, data, start, end) { 20527 var regionInfo = region.info; 20528 var huffmanTables, huffmanInput; 20529 var symbols = this.symbols; 20530 var inputSymbols = []; 20531 20532 for (var i = 0, ii = referredSegments.length; i < ii; i++) { 20533 var referredSymbols = symbols[referredSegments[i]]; 20534 20535 if (referredSymbols) { 20536 inputSymbols = inputSymbols.concat(referredSymbols); 20537 } 20538 } 20539 20540 var symbolCodeLength = (0, _util.log2)(inputSymbols.length); 20541 20542 if (region.huffman) { 20543 huffmanInput = new Reader(data, start, end); 20544 huffmanTables = getTextRegionHuffmanTables(region, referredSegments, this.customTables, inputSymbols.length, huffmanInput); 20545 } 20546 20547 var decodingContext = new DecodingContext(data, start, end); 20548 var bitmap = decodeTextRegion(region.huffman, region.refinement, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.numberOfSymbolInstances, region.stripSize, inputSymbols, symbolCodeLength, region.transposed, region.dsOffset, region.referenceCorner, region.combinationOperator, huffmanTables, region.refinementTemplate, region.refinementAt, decodingContext, region.logStripSize, huffmanInput); 20549 this.drawBitmap(regionInfo, bitmap); 20550 }, 20551 onImmediateLosslessTextRegion: function SimpleSegmentVisitor_onImmediateLosslessTextRegion() { 20552 this.onImmediateTextRegion.apply(this, arguments); 20553 }, 20554 onPatternDictionary: function onPatternDictionary(dictionary, currentSegment, data, start, end) { 20555 var patterns = this.patterns; 20556 20557 if (!patterns) { 20558 this.patterns = patterns = {}; 20559 } 20560 20561 var decodingContext = new DecodingContext(data, start, end); 20562 patterns[currentSegment] = decodePatternDictionary(dictionary.mmr, dictionary.patternWidth, dictionary.patternHeight, dictionary.maxPatternIndex, dictionary.template, decodingContext); 20563 }, 20564 onImmediateHalftoneRegion: function onImmediateHalftoneRegion(region, referredSegments, data, start, end) { 20565 var patterns = this.patterns[referredSegments[0]]; 20566 var regionInfo = region.info; 20567 var decodingContext = new DecodingContext(data, start, end); 20568 var bitmap = decodeHalftoneRegion(region.mmr, patterns, region.template, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.enableSkip, region.combinationOperator, region.gridWidth, region.gridHeight, region.gridOffsetX, region.gridOffsetY, region.gridVectorX, region.gridVectorY, decodingContext); 20569 this.drawBitmap(regionInfo, bitmap); 20570 }, 20571 onImmediateLosslessHalftoneRegion: function onImmediateLosslessHalftoneRegion() { 20572 this.onImmediateHalftoneRegion.apply(this, arguments); 20573 }, 20574 onTables: function onTables(currentSegment, data, start, end) { 20575 var customTables = this.customTables; 20576 20577 if (!customTables) { 20578 this.customTables = customTables = {}; 20579 } 20580 20581 customTables[currentSegment] = decodeTablesSegment(data, start, end); 20582 } 20583 }; 20584 20585 function HuffmanLine(lineData) { 20586 if (lineData.length === 2) { 20587 this.isOOB = true; 20588 this.rangeLow = 0; 20589 this.prefixLength = lineData[0]; 20590 this.rangeLength = 0; 20591 this.prefixCode = lineData[1]; 20592 this.isLowerRange = false; 20593 } else { 20594 this.isOOB = false; 20595 this.rangeLow = lineData[0]; 20596 this.prefixLength = lineData[1]; 20597 this.rangeLength = lineData[2]; 20598 this.prefixCode = lineData[3]; 20599 this.isLowerRange = lineData[4] === 'lower'; 20600 } 20601 } 20602 20603 function HuffmanTreeNode(line) { 20604 this.children = []; 20605 20606 if (line) { 20607 this.isLeaf = true; 20608 this.rangeLength = line.rangeLength; 20609 this.rangeLow = line.rangeLow; 20610 this.isLowerRange = line.isLowerRange; 20611 this.isOOB = line.isOOB; 20612 } else { 20613 this.isLeaf = false; 20614 } 20615 } 20616 20617 HuffmanTreeNode.prototype = { 20618 buildTree: function buildTree(line, shift) { 20619 var bit = line.prefixCode >> shift & 1; 20620 20621 if (shift <= 0) { 20622 this.children[bit] = new HuffmanTreeNode(line); 20623 } else { 20624 var node = this.children[bit]; 20625 20626 if (!node) { 20627 this.children[bit] = node = new HuffmanTreeNode(null); 20628 } 20629 20630 node.buildTree(line, shift - 1); 20631 } 20632 },
20633 decodeNode: function decodeNode(reader) { 20634 if (this.isLeaf) { 20635 if (this.isOOB) { 20636 return null; 20637 } 20638 20639 var htOffset = reader.readBits(this.rangeLength); 20640 return this.rangeLow + (this.isLowerRange ? -htOffset : htOffset); 20641 } 20642 20643 var node = this.children[reader.readBit()]; 20644 20645 if (!node) { 20646 throw new Jbig2Error('invalid Huffman data'); 20647 } 20648 20649 return node.decodeNode(reader); 20650 } 20651 }; 20652 20653 function HuffmanTable(lines, prefixCodesDone) { 20654 if (!prefixCodesDone) { 20655 this.assignPrefixCodes(lines); 20656 } 20657 20658 this.rootNode = new HuffmanTreeNode(null); 20659 var i, 20660 ii = lines.length, 20661 line; 20662 20663 for (i = 0; i < ii; i++) { 20664 line = lines[i]; 20665 20666 if (line.prefixLength > 0) { 20667 this.rootNode.buildTree(line, line.prefixLength - 1); 20668 } 20669 } 20670 } 20671 20672 HuffmanTable.prototype = { 20673 decode: function decode(reader) { 20674 return this.rootNode.decodeNode(reader); 20675 }, 20676 assignPrefixCodes: function assignPrefixCodes(lines) { 20677 var linesLength = lines.length, 20678 prefixLengthMax = 0, 20679 i; 20680 20681 for (i = 0; i < linesLength; i++) { 20682 prefixLengthMax = Math.max(prefixLengthMax, lines[i].prefixLength); 20683 } 20684 20685 var histogram = new Uint32Array(prefixLengthMax + 1); 20686 20687 for (i = 0; i < linesLength; i++) { 20688 histogram[lines[i].prefixLength]++; 20689 } 20690 20691 var currentLength = 1, 20692 firstCode = 0, 20693 currentCode, 20694 currentTemp, 20695 line; 20696 histogram[0] = 0; 20697 20698 while (currentLength <= prefixLengthMax) { 20699 firstCode = firstCode + histogram[currentLength - 1] << 1; 20700 currentCode = firstCode; 20701 currentTemp = 0; 20702 20703 while (currentTemp < linesLength) { 20704 line = lines[currentTemp]; 20705 20706 if (line.prefixLength === currentLength) { 20707 line.prefixCode = currentCode; 20708 currentCode++; 20709 } 20710 20711 currentTemp++; 20712 } 20713 20714 currentLength++; 20715 } 20716 } 20717 }; 20718 20719 function decodeTablesSegment(data, start, end) { 20720 var flags = data[start]; 20721 var lowestValue = (0, _util.readUint32)(data, start + 1) & 0xFFFFFFFF; 20722 var highestValue = (0, _util.readUint32)(data, start + 5) & 0xFFFFFFFF; 20723 var reader = new Reader(data, start + 9, end); 20724 var prefixSizeBits = (flags >> 1 & 7) + 1; 20725 var rangeSizeBits = (flags >> 4 & 7) + 1; 20726 var lines = []; 20727 var prefixLength, 20728 rangeLength, 20729 currentRangeLow = lowestValue; 20730 20731 do { 20732 prefixLength = reader.readBits(prefixSizeBits); 20733 rangeLength = reader.readBits(rangeSizeBits); 20734 lines.push(new HuffmanLine([currentRangeLow, prefixLength, rangeLength, 0])); 20735 currentRangeLow += 1 << rangeLength; 20736 } while (currentRangeLow < highestValue); 20737 20738 prefixLength = reader.readBits(prefixSizeBits); 20739 lines.push(new HuffmanLine([lowestValue - 1, prefixLength, 32, 0, 'lower'])); 20740 prefixLength = reader.readBits(prefixSizeBits); 20741 lines.push(new HuffmanLine([highestValue, prefixLength, 32, 0])); 20742 20743 if (flags & 1) { 20744 prefixLength = reader.readBits(prefixSizeBits); 20745 lines.push(new HuffmanLine([prefixLength, 0])); 20746 } 20747 20748 return new HuffmanTable(lines, false); 20749 } 20750 20751 var standardTablesCache = {}; 20752 20753 function getStandardTable(number) { 20754 var table = standardTablesCache[number]; 20755 20756 if (table) { 20757 return table; 20758 } 20759 20760 var lines; 20761 20762 switch (number) { 20763 case 1: 20764 lines = [[0, 1, 4, 0x0], [16, 2, 8, 0x2], [272, 3, 16, 0x6], [65808, 3, 32, 0x7]]; 20765 break; 20766 20767 case 2: 20768 lines = [[0, 1, 0, 0x0], [1, 2, 0, 0x2], [2, 3, 0, 0x6], [3, 4, 3, 0xE], [11, 5, 6, 0x1E], [75, 6, 32, 0x3E], [6, 0x3F]]; 20769 break; 20770 20771 case 3: 20772 lines = [[-256, 8, 8, 0xFE], [0, 1, 0, 0x0], [1, 2, 0, 0x2], [2, 3, 0, 0x6], [3, 4, 3, 0xE], [11, 5, 6, 0x1E], [-25
207727, 8, 32, 0xFF, 'lower'], [75, 7, 32, 0x7E], [6, 0x3E]]; 20773 break; 20774 20775 case 4: 20776 lines = [[1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 0, 0x6], [4, 4, 3, 0xE], [12, 5, 6, 0x1E], [76, 5, 32, 0x1F]]; 20777 break; 20778 20779 case 5: 20780 lines = [[-255, 7, 8, 0x7E], [1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 0, 0x6], [4, 4, 3, 0xE], [12, 5, 6, 0x1E], [-256, 7, 32, 0x7F, 'lower'], [76, 6, 32, 0x3E]]; 20781 break; 20782 20783 case 6: 20784 lines = [[-2048, 5, 10, 0x1C], [-1024, 4, 9, 0x8], [-512, 4, 8, 0x9], [-256, 4, 7, 0xA], [-128, 5, 6, 0x1D], [-64, 5, 5, 0x1E], [-32, 4, 5, 0xB], [0, 2, 7, 0x0], [128, 3, 7, 0x2], [256, 3, 8, 0x3], [512, 4, 9, 0xC], [1024, 4, 10, 0xD], [-2049, 6, 32, 0x3E, 'lower'], [2048, 6, 32, 0x3F]]; 20785 break; 20786 20787 case 7: 20788 lines = [[-1024, 4, 9, 0x8], [-512, 3, 8, 0x0], [-256, 4, 7, 0x9], [-128, 5, 6, 0x1A], [-64, 5, 5, 0x1B], [-32, 4, 5, 0xA], [0, 4, 5, 0xB], [32, 5, 5, 0x1C], [64, 5, 6, 0x1D], [128, 4, 7, 0xC], [256, 3, 8, 0x1], [512, 3, 9, 0x2], [1024, 3, 10, 0x3], [-1025, 5, 32, 0x1E, 'lower'], [2048, 5, 32, 0x1F]]; 20789 break; 20790 20791 case 8: 20792 lines = [[-15, 8, 3, 0xFC], [-7, 9, 1, 0x1FC], [-5, 8, 1, 0xFD], [-3, 9, 0, 0x1FD], [-2, 7, 0, 0x7C], [-1, 4, 0, 0xA], [0, 2, 1, 0x0], [2, 5, 0, 0x1A], [3, 6, 0, 0x3A], [4, 3, 4, 0x4], [20, 6, 1, 0x3B], [22, 4, 4, 0xB], [38, 4, 5, 0xC], [70, 5, 6, 0x1B], [134, 5, 7, 0x1C], [262, 6, 7, 0x3C], [390, 7, 8, 0x7D], [646, 6, 10, 0x3D], [-16, 9, 32, 0x1FE, 'lower'], [1670, 9, 32, 0x1FF], [2, 0x1]]; 20793 break; 20794 20795 case 9: 20796 lines = [[-31, 8, 4, 0xFC], [-15, 9, 2, 0x1FC], [-11, 8, 2, 0xFD], [-7, 9, 1, 0x1FD], [-5, 7, 1, 0x7C], [-3, 4, 1, 0xA], [-1, 3, 1, 0x2], [1, 3, 1, 0x3], [3, 5, 1, 0x1A], [5, 6, 1, 0x3A], [7, 3, 5, 0x4], [39, 6, 2, 0x3B], [43, 4, 5, 0xB], [75, 4, 6, 0xC], [139, 5, 7, 0x1B], [267, 5, 8, 0x1C], [523, 6, 8, 0x3C], [779, 7, 9, 0x7D], [1291, 6, 11, 0x3D], [-32, 9, 32, 0x1FE, 'lower'], [3339, 9, 32, 0x1FF], [2, 0x0]]; 20797 break; 20798 20799 case 10: 20800 lines = [[-21, 7, 4, 0x7A], [-5, 8, 0, 0xFC], [-4, 7, 0, 0x7B], [-3, 5, 0, 0x18], [-2, 2, 2, 0x0], [2, 5, 0, 0x19], [3, 6, 0, 0x36], [4, 7, 0, 0x7C], [5, 8, 0, 0xFD], [6, 2, 6, 0x1], [70, 5, 5, 0x1A], [102, 6, 5, 0x37], [134, 6, 6, 0x38], [198, 6, 7, 0x39], [326, 6, 8, 0x3A], [582, 6, 9, 0x3B], [1094, 6, 10, 0x3C], [2118, 7, 11, 0x7D], [-22, 8, 32, 0xFE, 'lower'], [4166, 8, 32, 0xFF], [2, 0x2]]; 20801 break; 20802 20803 case 11: 20804 lines = [[1, 1, 0, 0x0], [2, 2, 1, 0x2], [4, 4, 0, 0xC], [5, 4, 1, 0xD], [7, 5, 1, 0x1C], [9, 5, 2, 0x1D], [13, 6, 2, 0x3C], [17, 7, 2, 0x7A], [21, 7, 3, 0x7B], [29, 7, 4, 0x7C], [45, 7, 5, 0x7D], [77, 7, 6, 0x7E], [141, 7, 32, 0x7F]]; 20805 break; 20806 20807 case 12: 20808 lines = [[1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 1, 0x6], [5, 5, 0, 0x1C], [6, 5, 1, 0x1D], [8, 6, 1, 0x3C], [10, 7, 0, 0x7A], [11, 7, 1, 0x7B], [13, 7, 2, 0x7C], [17, 7, 3, 0x7D], [25, 7, 4, 0x7E], [41, 8, 5, 0xFE], [73, 8, 32, 0xFF]]; 20809 break; 20810 20811 case 13: 20812 lines = [[1, 1, 0, 0x0], [2, 3, 0, 0x4], [3, 4, 0, 0xC], [4, 5, 0, 0x1C], [5, 4, 1, 0xD], [7, 3, 3, 0x5], [15, 6, 1, 0x3A], [17, 6, 2, 0x3B], [21, 6, 3, 0x3C], [29, 6, 4, 0x3D], [45, 6, 5, 0x3E], [77, 7, 6, 0x7E], [141, 7, 32, 0x7F]]; 20813 break; 20814 20815 case 14: 20816 lines = [[-2, 3, 0, 0x4], [-1, 3, 0, 0x5], [0, 1, 0, 0x0], [1, 3, 0, 0x6], [2, 3, 0, 0x7]]; 20817 break; 20818 20819 case 15: 20820 lines = [[-24, 7, 4, 0x7C], [-8, 6, 2, 0x3C], [-4, 5, 1, 0x1C], [-2, 4, 0, 0xC], [-1, 3, 0, 0x4], [0, 1, 0, 0x0], [1, 3, 0, 0x5], [2, 4, 0, 0xD], [3, 5, 1, 0x1D], [5, 6, 2, 0x3D], [9, 7, 4, 0x7D], [-25, 7, 32, 0x7E, 'lower'], [25, 7, 32, 0x7F]]; 20821 break; 20822 20823 default: 20824 throw new Jbig2Error("standard table B.".concat(number, " does not exist")); 20825 } 20826 20827 var length = lines.length, 20828 i; 20829 20830 for (i = 0; i < length; i++) { 20831 lines[i] = new HuffmanLine(lines[i]); 20832 } 20833 20834 table = new HuffmanTable(lines, true); 20835 standardTablesCache[number] = table; 20836 return table; 20837 } 20838 20839 function Reader(data, start, end) { 20840 this.data = data; 20841 this.start = start; 20842 this.end = end; 20843 this.position = start; 20844 this.shift = -1; 20845 this.currentByte = 0; 20846 } 20847 20848 Reader.prototype = { 20849 readBit: function readBit() { 20850 if (this.shift < 0) { 20851 if (this.position >= this.end) { 20852 throw new Jbig2Error('end of data while reading bit'); 20853 } 20854 20855 this.currentByte = this.data[this.position++]; 20856 this.shift = 7; 20857 } 20858 20859 var bit = this.currentByte >> this.shift & 1; 20860 this.shift--; 20861 return bit; 20862 }, 20863 readBits: function readBits(numBits) { 20864 var result = 0, 20865 i; 20866 20867 for (i = numBits - 1; i >= 0; i--) { 20868 result |= this.readBit() << i; 20869 } 20870 20871 return result; 20872 }, 20873 byteAlign: function byteAlign() { 20874 this.shift = -1; 20875 }, 20876 next: function next() { 20877 if (this.position >= this.end) { 20878 return -1; 20879 } 20880 20881 return this.data[this.position++]; 20882 } 20883 }; 20884 20885 function getCustomHuffmanTable(index, referredTo, customTables) { 20886 var currentIndex = 0, 20887 i, 20888 ii = referredTo.length, 20889 table; 20890 20891 for (i = 0; i < ii; i++) { 20892 table = customTables[referredTo[i]]; 20893 20894 if (table) { 20895 if (index === currentIndex) { 20896 return table; 20897 } 20898 20899 currentIndex++; 20900 } 20901 } 20902 20903 throw new Jbig2Error('can\'t find custom Huffman table'); 20904 } 20905 20906 function getTextRegionHuffmanTables(textRegion, referredTo, customTables, numberOfSymbols, reader) { 20907 var codes = [], 20908 i, 20909 codeLength; 20910 20911 for (i = 0; i <= 34; i++) { 20912 codeLength = reader.readBits(4); 20913 codes.push(new HuffmanLine([i, codeLength, 0, 0])); 20914 } 20915 20916 var runCodesTable = new HuffmanTable(codes, false); 20917 codes.length = 0; 20918 20919 for (i = 0; i < numberOfSymbols;) { 20920 codeLength = runCodesTable.decode(reader); 20921 20922 if (codeLength >= 32) { 20923 var repeatedLength = void 0, 20924 numberOfRepeats = void 0, 20925 j = void 0; 20926 20927 switch (codeLength) { 20928 case 32: 20929 if (i === 0) { 20930 throw new Jbig2Error('no previous value in symbol ID table'); 20931 } 20932 20933 numberOfRepeats = reader.readBits(2) + 3; 20934 repeatedLength = codes[i - 1].prefixLength; 20935 break; 20936 20937 case 33: 20938 numberOfRepeats = reader.readBits(3) + 3; 20939 repeatedLength = 0; 20940 break; 20941 20942 case 34: 20943 numberOfRepeats = reader.readBits(7) + 11; 20944 repeatedLength = 0; 20945 break; 20946 20947 default: 20948 throw new Jbig2Error('invalid code length in symbol ID table'); 20949 } 20950 20951 for (j = 0; j < numberOfRepeats; j++) { 20952 codes.push(new HuffmanLine([i, repeatedLength, 0, 0])); 20953 i++; 20954 } 20955 } else { 20956 codes.push(new HuffmanLine([i, codeLength, 0, 0])); 20957 i++; 20958 } 20959 } 20960 20961 reader.byteAlign(); 20962 var symbolIDTable = new HuffmanTable(codes, false); 20963 var customIndex = 0, 20964 tableFirstS, 20965 tableDeltaS, 20966 tableDeltaT; 20967 20968 switch (textRegion.huffmanFS) { 20969 case 0: 20970 case 1: 20971 tableFirstS = getStandardTable(textRegion.huffmanFS + 6); 20972 break; 20973 20974 case 3: 20975 tableFirstS = getCustomHuffmanTable(customIndex, referredTo, customTables); 20976 customIndex++; 20977 break; 20978 20979 default: 20980 throw new Jbig2Error('invalid Huffman FS selector'); 20981 } 20982 20983 switch (textRegion.huffmanDS) { 20984 case 0: 20985 case 1: 20986 case 2: 20987 tableDeltaS = getStandardTable(textRegion.huffmanDS + 8); 20988 break; 20989 20990 case 3: 20991 tableDeltaS = getCustomHuffmanTable(customIndex, referredTo, customTables); 20992 customIndex++; 20993 break; 20994 20995 default: 20996 throw new Jbig2Error('invalid Huffman DS selector'); 20997 } 20998 20999 switch (textRegion.huffmanDT) { 21000 case 0: 21001 case 1: 21002 case 2: 21003 tableDeltaT = getStandardTable(textRegion.huffmanDT + 11);
21004 break; 21005 21006 case 3: 21007 tableDeltaT = getCustomHuffmanTable(customIndex, referredTo, customTables); 21008 customIndex++; 21009 break; 21010 21011 default: 21012 throw new Jbig2Error('invalid Huffman DT selector'); 21013 } 21014 21015 if (textRegion.refinement) { 21016 throw new Jbig2Error('refinement with Huffman is not supported'); 21017 } 21018 21019 return { 21020 symbolIDTable: symbolIDTable, 21021 tableFirstS: tableFirstS, 21022 tableDeltaS: tableDeltaS, 21023 tableDeltaT: tableDeltaT 21024 }; 21025 } 21026 21027 function getSymbolDictionaryHuffmanTables(dictionary, referredTo, customTables) { 21028 var customIndex = 0, 21029 tableDeltaHeight, 21030 tableDeltaWidth; 21031 21032 switch (dictionary.huffmanDHSelector) { 21033 case 0: 21034 case 1: 21035 tableDeltaHeight = getStandardTable(dictionary.huffmanDHSelector + 4); 21036 break; 21037 21038 case 3: 21039 tableDeltaHeight = getCustomHuffmanTable(customIndex, referredTo, customTables); 21040 customIndex++; 21041 break; 21042 21043 default: 21044 throw new Jbig2Error('invalid Huffman DH selector'); 21045 } 21046 21047 switch (dictionary.huffmanDWSelector) { 21048 case 0: 21049 case 1: 21050 tableDeltaWidth = getStandardTable(dictionary.huffmanDWSelector + 2); 21051 break; 21052 21053 case 3: 21054 tableDeltaWidth = getCustomHuffmanTable(customIndex, referredTo, customTables); 21055 customIndex++; 21056 break; 21057 21058 default: 21059 throw new Jbig2Error('invalid Huffman DW selector'); 21060 } 21061 21062 var tableBitmapSize, tableAggregateInstances; 21063 21064 if (dictionary.bitmapSizeSelector) { 21065 tableBitmapSize = getCustomHuffmanTable(customIndex, referredTo, customTables); 21066 customIndex++; 21067 } else { 21068 tableBitmapSize = getStandardTable(1); 21069 } 21070 21071 if (dictionary.aggregationInstancesSelector) { 21072 tableAggregateInstances = getCustomHuffmanTable(customIndex, referredTo, customTables); 21073 } else { 21074 tableAggregateInstances = getStandardTable(1); 21075 } 21076 21077 return { 21078 tableDeltaHeight: tableDeltaHeight, 21079 tableDeltaWidth: tableDeltaWidth, 21080 tableBitmapSize: tableBitmapSize, 21081 tableAggregateInstances: tableAggregateInstances 21082 }; 21083 } 21084 21085 function readUncompressedBitmap(reader, width, height) { 21086 var bitmap = [], 21087 x, 21088 y, 21089 row; 21090 21091 for (y = 0; y < height; y++) { 21092 row = new Uint8Array(width); 21093 bitmap.push(row); 21094 21095 for (x = 0; x < width; x++) { 21096 row[x] = reader.readBit(); 21097 } 21098 21099 reader.byteAlign(); 21100 } 21101 21102 return bitmap; 21103 } 21104 21105 function decodeMMRBitmap(input, width, height, endOfBlock) { 21106 var params = { 21107 K: -1, 21108 Columns: width, 21109 Rows: height, 21110 BlackIs1: true, 21111 EndOfBlock: endOfBlock 21112 }; 21113 var decoder = new _ccitt.CCITTFaxDecoder(input, params); 21114 var bitmap = [], 21115 x, 21116 y, 21117 row, 21118 currentByte, 21119 shift, 21120 eof = false; 21121 21122 for (y = 0; y < height; y++) { 21123 row = new Uint8Array(width); 21124 bitmap.push(row); 21125 shift = -1; 21126 21127 for (x = 0; x < width; x++) { 21128 if (shift < 0) { 21129 currentByte = decoder.readNextChar(); 21130 21131 if (currentByte === -1) { 21132 currentByte = 0; 21133 eof = true; 21134 } 21135 21136 shift = 7; 21137 } 21138 21139 row[x] = currentByte >> shift & 1; 21140 shift--; 21141 } 21142 } 21143 21144 if (endOfBlock && !eof) { 21145 var lookForEOFLimit = 5; 21146 21147 for (var i = 0; i < lookForEOFLimit; i++) { 21148 if (decoder.readNextChar() === -1) { 21149 break; 21150 } 21151 } 21152 } 21153 21154 return bitmap; 21155 } 21156 21157 function Jbig2Image() {} 21158 21159 Jbig2Image.prototype = { 21160 parseChunks: function parseChunks(chunks) { 21161 return parseJbig2Chunks(chunks); 21162 }, 21163 parse: function parse(data) { 21164 var _parseJbig = parseJbig2(data), 21165 imgData = _parseJbig.imgData, 21166 width = _parseJbig.width, 21167 height = _parseJbig.height; 21168 21169 this.width = width; 21170 this.height = height; 21171 return imgData; 21172 } 21173 }; 21174 return Jbig2Image; 21175}();
21176 21177exports.Jbig2Image = Jbig2Image; 21178 21179/***/ }), 21180/* 162 */ 21181/***/ (function(module, exports, __w_pdfjs_require__) { 21182 21183"use strict"; 21184 21185 21186Object.defineProperty(exports, "__esModule", { 21187 value: true 21188}); 21189exports.ArithmeticDecoder = void 0; 21190 21191function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 21192 21193function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 21194 21195function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 21196 21197var QeTable = [{ 21198 qe: 0x5601, 21199 nmps: 1, 21200 nlps: 1, 21201 switchFlag: 1 21202}, { 21203 qe: 0x3401, 21204 nmps: 2, 21205 nlps: 6, 21206 switchFlag: 0 21207}, { 21208 qe: 0x1801, 21209 nmps: 3, 21210 nlps: 9, 21211 switchFlag: 0 21212}, { 21213 qe: 0x0AC1, 21214 nmps: 4, 21215 nlps: 12, 21216 switchFlag: 0 21217}, { 21218 qe: 0x0521, 21219 nmps: 5, 21220 nlps: 29, 21221 switchFlag: 0 21222}, { 21223 qe: 0x0221, 21224 nmps: 38, 21225 nlps: 33, 21226 switchFlag: 0 21227}, { 21228 qe: 0x5601, 21229 nmps: 7, 21230 nlps: 6, 21231 switchFlag: 1 21232}, { 21233 qe: 0x5401, 21234 nmps: 8, 21235 nlps: 14, 21236 switchFlag: 0 21237}, { 21238 qe: 0x4801, 21239 nmps: 9, 21240 nlps: 14, 21241 switchFlag: 0 21242}, { 21243 qe: 0x3801, 21244 nmps: 10, 21245 nlps: 14, 21246 switchFlag: 0 21247}, { 21248 qe: 0x3001, 21249 nmps: 11, 21250 nlps: 17, 21251 switchFlag: 0 21252}, { 21253 qe: 0x2401, 21254 nmps: 12, 21255 nlps: 18, 21256 switchFlag: 0 21257}, { 21258 qe: 0x1C01, 21259 nmps: 13, 21260 nlps: 20, 21261 switchFlag: 0 21262}, { 21263 qe: 0x1601, 21264 nmps: 29, 21265 nlps: 21, 21266 switchFlag: 0 21267}, { 21268 qe: 0x5601, 21269 nmps: 15, 21270 nlps: 14, 21271 switchFlag: 1 21272}, { 21273 qe: 0x5401, 21274 nmps: 16, 21275 nlps: 14, 21276 switchFlag: 0 21277}, { 21278 qe: 0x5101, 21279 nmps: 17, 21280 nlps: 15, 21281 switchFlag: 0 21282}, { 21283 qe: 0x4801, 21284 nmps: 18, 21285 nlps: 16, 21286 switchFlag: 0 21287}, { 21288 qe: 0x3801, 21289 nmps: 19, 21290 nlps: 17, 21291 switchFlag: 0 21292}, { 21293 qe: 0x3401, 21294 nmps: 20, 21295 nlps: 18, 21296 switchFlag: 0 21297}, { 21298 qe: 0x3001, 21299 nmps: 21, 21300 nlps: 19, 21301 switchFlag: 0 21302}, { 21303 qe: 0x2801, 21304 nmps: 22, 21305 nlps: 19, 21306 switchFlag: 0 21307}, { 21308 qe: 0x2401, 21309 nmps: 23, 21310 nlps: 20, 21311 switchFlag: 0 21312}, { 21313 qe: 0x2201, 21314 nmps: 24, 21315 nlps: 21, 21316 switchFlag: 0 21317}, { 21318 qe: 0x1C01, 21319 nmps: 25, 21320 nlps: 22, 21321 switchFlag: 0 21322}, { 21323 qe: 0x1801, 21324 nmps: 26, 21325 nlps: 23, 21326 switchFlag: 0 21327}, { 21328 qe: 0x1601, 21329 nmps: 27, 21330 nlps: 24, 21331 switchFlag: 0 21332}, { 21333 qe: 0x1401, 21334 nmps: 28, 21335 nlps: 25, 21336 switchFlag: 0 21337}, { 21338 qe: 0x1201, 21339 nmps: 29, 21340 nlps: 26, 21341 switchFlag: 0 21342}, { 21343 qe: 0x1101, 21344 nmps: 30, 21345 nlps: 27, 21346 switchFlag: 0 21347}, { 21348 qe: 0x0AC1, 21349 nmps: 31, 21350 nlps: 28, 21351 switchFlag: 0 21352}, { 21353 qe: 0x09C1, 21354 nmps: 32, 21355 nlps: 29, 21356 switchFlag: 0 21357}, { 21358 qe: 0x08A1, 21359 nmps: 33, 21360 nlps: 30, 21361 switchFlag: 0 21362}, { 21363 qe: 0x0521, 21364 nmps: 34, 21365 nlps: 31, 21366 switchFlag: 0 21367}, { 21368 qe: 0x0441, 21369 nmps: 35, 21370 nlps: 32, 21371 switchFlag: 0 21372}, { 21373 qe: 0x02A1, 21374 nmps: 36, 21375 nlps: 33, 21376 switchFlag: 0 21377}, { 21378 qe: 0x0221, 21379 nmps: 37, 21380 nlps: 34, 21381 switchFlag: 0 21382}, { 21383 qe: 0x0141, 21384 nmps: 38, 21385 nlps: 35, 21386 switchFlag: 0 21387}, { 21388 qe: 0x0111, 21389 nmps: 39, 21390 nlps: 36, 21391 switchFlag: 0 21392}, { 21393 qe: 0x0085, 21394 nmps: 40, 21395 nlps: 37, 21396 switchFlag: 0 21397}, { 21398 qe: 0x0049, 21399 nmps: 41, 21400 nlps: 38, 21401 switchFlag: 0 21402}, { 21403 qe: 0x0025, 21404 nmps: 42, 21405 nlps: 39, 21406 switchFlag: 0 21407}, { 21408 qe: 0x0015, 21409 nmps: 43, 21410 nlps: 40, 21411 switchFlag: 0 21412}, { 21413 qe: 0x0009, 21414 nmps: 44, 21415 nlps: 41, 21416 switchFlag: 0 21417}, { 21418 qe: 0x0005, 21419 nmps: 45, 21420 nlps: 42, 21421 switchFlag: 0 21422}, { 21423 qe: 0x0001, 21424 nmps: 45, 21425 nlps: 43, 21426 switchFlag: 0 21427}, { 21428 qe: 0x5601, 21429 nmps: 46, 21430 nlps: 46, 21431 switchFlag: 0 21432}]; 21433 21434var ArithmeticDecoder = 21435/*#__PURE__*/ 21436function () { 21437 function ArithmeticDecoder(data, start, end) { 21438 _classCallCheck(this, ArithmeticDecoder); 21439 21440 this.data = data; 21441 this.bp = start; 21442 this.dataEnd = end;
21443 this.chigh = data[start]; 21444 this.clow = 0; 21445 this.byteIn(); 21446 this.chigh = this.chigh << 7 & 0xFFFF | this.clow >> 9 & 0x7F; 21447 this.clow = this.clow << 7 & 0xFFFF; 21448 this.ct -= 7; 21449 this.a = 0x8000; 21450 } 21451 21452 _createClass(ArithmeticDecoder, [{ 21453 key: "byteIn", 21454 value: function byteIn() { 21455 var data = this.data; 21456 var bp = this.bp; 21457 21458 if (data[bp] === 0xFF) { 21459 if (data[bp + 1] > 0x8F) { 21460 this.clow += 0xFF00; 21461 this.ct = 8; 21462 } else { 21463 bp++; 21464 this.clow += data[bp] << 9; 21465 this.ct = 7; 21466 this.bp = bp; 21467 } 21468 } else { 21469 bp++; 21470 this.clow += bp < this.dataEnd ? data[bp] << 8 : 0xFF00; 21471 this.ct = 8; 21472 this.bp = bp; 21473 } 21474 21475 if (this.clow > 0xFFFF) { 21476 this.chigh += this.clow >> 16; 21477 this.clow &= 0xFFFF; 21478 } 21479 } 21480 }, { 21481 key: "readBit", 21482 value: function readBit(contexts, pos) { 21483 var cx_index = contexts[pos] >> 1, 21484 cx_mps = contexts[pos] & 1; 21485 var qeTableIcx = QeTable[cx_index]; 21486 var qeIcx = qeTableIcx.qe; 21487 var d; 21488 var a = this.a - qeIcx; 21489 21490 if (this.chigh < qeIcx) { 21491 if (a < qeIcx) { 21492 a = qeIcx; 21493 d = cx_mps; 21494 cx_index = qeTableIcx.nmps; 21495 } else { 21496 a = qeIcx; 21497 d = 1 ^ cx_mps; 21498 21499 if (qeTableIcx.switchFlag === 1) { 21500 cx_mps = d; 21501 } 21502 21503 cx_index = qeTableIcx.nlps; 21504 } 21505 } else { 21506 this.chigh -= qeIcx; 21507 21508 if ((a & 0x8000) !== 0) { 21509 this.a = a; 21510 return cx_mps; 21511 } 21512 21513 if (a < qeIcx) { 21514 d = 1 ^ cx_mps; 21515 21516 if (qeTableIcx.switchFlag === 1) { 21517 cx_mps = d; 21518 } 21519 21520 cx_index = qeTableIcx.nlps; 21521 } else { 21522 d = cx_mps; 21523 cx_index = qeTableIcx.nmps; 21524 } 21525 } 21526 21527 do { 21528 if (this.ct === 0) { 21529 this.byteIn(); 21530 } 21531 21532 a <<= 1; 21533 this.chigh = this.chigh << 1 & 0xFFFF | this.clow >> 15 & 1; 21534 this.clow = this.clow << 1 & 0xFFFF; 21535 this.ct--; 21536 } while ((a & 0x8000) === 0); 21537 21538 this.a = a; 21539 contexts[pos] = cx_index << 1 | cx_mps; 21540 return d; 21541 } 21542 }]); 21543 21544 return ArithmeticDecoder; 21545}(); 21546 21547exports.ArithmeticDecoder = ArithmeticDecoder; 21548 21549/***/ }), 21550/* 163 */ 21551/***/ (function(module, exports, __w_pdfjs_require__) { 21552 21553"use strict"; 21554 21555 21556Object.defineProperty(exports, "__esModule", { 21557 value: true 21558}); 21559exports.JpegStream = void 0; 21560 21561var _util = __w_pdfjs_require__(6); 21562 21563var _stream = __w_pdfjs_require__(157); 21564 21565var _primitives = __w_pdfjs_require__(155); 21566 21567var _jpg = __w_pdfjs_require__(164); 21568 21569var JpegStream = function JpegStreamClosure() { 21570 function JpegStream(stream, maybeLength, dict, params) { 21571 var ch; 21572 21573 while ((ch = stream.getByte()) !== -1) { 21574 if (ch === 0xFF) { 21575 stream.skip(-1); 21576 break; 21577 } 21578 } 21579 21580 this.stream = stream; 21581 this.maybeLength = maybeLength; 21582 this.dict = dict; 21583 this.params = params; 21584 21585 _stream.DecodeStream.call(this, maybeLength); 21586 } 21587 21588 JpegStream.prototype = Object.create(_stream.DecodeStream.prototype); 21589 Object.defineProperty(JpegStream.prototype, 'bytes', { 21590 get: function JpegStream_bytes() { 21591 return (0, _util.shadow)(this, 'bytes', this.stream.getBytes(this.maybeLength)); 21592 }, 21593 configurable: true 21594 }); 21595 21596 JpegStream.prototype.ensureBuffer = function (requested) {}; 21597 21598 JpegStream.prototype.readBlock = function () { 21599 if (this.eof) { 21600 return; 21601 } 21602 21603 var jpegOptions = { 21604 decodeTransform: undefined, 21605 colorTransform: undefined 21606 }; 21607 var decodeArr = this.dict.getArray('Decode', 'D'); 21608 21609 if (this.forceRGB && Array.isArray(decodeArr)) { 21610 var bitsPerComponent = this.dict.get('BitsPerComponent') || 8; 21611 var decodeArrLength = decodeArr.length; 21612 var transform = new Int32Array(decodeArrLength); 21613 var transformNeeded = false; 21614 var maxValue = (1 << bitsPerComponent) - 1; 21615 21616 for (var i = 0; i < decodeArrLength; i += 2) { 21617 transform[i] = (decodeArr[i + 1] - decodeArr[i]) * 256 | 0; 21618 transform[i + 1] = decodeArr[i] * maxValue | 0; 21619 21620 if (transform[i] !== 256 || transform[i + 1] !== 0) { 21621 transformNeeded = true; 21622 } 21623 } 21624 21625 if (transformNeeded) { 21626 jpegOptions.decodeTransform = transform; 21627 } 21628 } 21629 21630 if ((0, _primitives.isDict)(this.params)) { 21631 var colorTransform = this.params.get('ColorTransform'); 21632 21633 if (Number.isInteger(colorTransform)) { 21634 jpegOptions.colorTransform = colorTransform; 21635 } 21636 } 21637 21638 var jpegImage = new _jpg.JpegImage(jpegOptions); 21639 jpegImage.parse(this.bytes); 21640 var data = jpegImage.getData({ 21641 width: this.drawWidth, 21642 height: this.drawHeight, 21643 forceRGB: this.forceRGB, 21644 isSourcePDF: true 21645 });
21646 this.buffer = data; 21647 this.bufferLength = data.length; 21648 this.eof = true; 21649 }; 21650 21651 JpegStream.prototype.getIR = function () { 21652 var forceDataSchema = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 21653 return (0, _util.createObjectURL)(this.bytes, 'image/jpeg', forceDataSchema); 21654 }; 21655 21656 return JpegStream; 21657}(); 21658 21659exports.JpegStream = JpegStream; 21660 21661/***/ }), 21662/* 164 */ 21663/***/ (function(module, exports, __w_pdfjs_require__) { 21664 21665"use strict"; 21666 21667 21668Object.defineProperty(exports, "__esModule", { 21669 value: true 21670}); 21671exports.JpegImage = void 0; 21672 21673var _util = __w_pdfjs_require__(6); 21674 21675function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 21676 21677var JpegError = function JpegErrorClosure() { 21678 function JpegError(msg) { 21679 this.message = 'JPEG error: ' + msg; 21680 } 21681 21682 JpegError.prototype = new Error(); 21683 JpegError.prototype.name = 'JpegError'; 21684 JpegError.constructor = JpegError; 21685 return JpegError; 21686}(); 21687 21688var DNLMarkerError = function DNLMarkerErrorClosure() { 21689 function DNLMarkerError(message, scanLines) { 21690 this.message = message; 21691 this.scanLines = scanLines; 21692 } 21693 21694 DNLMarkerError.prototype = new Error(); 21695 DNLMarkerError.prototype.name = 'DNLMarkerError'; 21696 DNLMarkerError.constructor = DNLMarkerError; 21697 return DNLMarkerError; 21698}(); 21699 21700var EOIMarkerError = function EOIMarkerErrorClosure() { 21701 function EOIMarkerError(message) { 21702 this.message = message; 21703 } 21704 21705 EOIMarkerError.prototype = new Error(); 21706 EOIMarkerError.prototype.name = 'EOIMarkerError'; 21707 EOIMarkerError.constructor = EOIMarkerError; 21708 return EOIMarkerError; 21709}(); 21710 21711var JpegImage = function JpegImageClosure() { 21712 var dctZigZag = new Uint8Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]); 21713 var dctCos1 = 4017; 21714 var dctSin1 = 799; 21715 var dctCos3 = 3406; 21716 var dctSin3 = 2276; 21717 var dctCos6 = 1567; 21718 var dctSin6 = 3784; 21719 var dctSqrt2 = 5793; 21720 var dctSqrt1d2 = 2896; 21721 21722 function JpegImage() { 21723 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, 21724 _ref$decodeTransform = _ref.decodeTransform, 21725 decodeTransform = _ref$decodeTransform === void 0 ? null : _ref$decodeTransform, 21726 _ref$colorTransform = _ref.colorTransform, 21727 colorTransform = _ref$colorTransform === void 0 ? -1 : _ref$colorTransform; 21728 21729 this._decodeTransform = decodeTransform; 21730 this._colorTransform = colorTransform; 21731 } 21732 21733 function buildHuffmanTable(codeLengths, values) { 21734 var k = 0, 21735 code = [], 21736 i, 21737 j, 21738 length = 16; 21739 21740 while (length > 0 && !codeLengths[length - 1]) { 21741 length--; 21742 } 21743 21744 code.push({ 21745 children: [], 21746 index: 0 21747 }); 21748 var p = code[0], 21749 q; 21750 21751 for (i = 0; i < length; i++) { 21752 for (j = 0; j < codeLengths[i]; j++) { 21753 p = code.pop();
21754 p.children[p.index] = values[k]; 21755 21756 while (p.index > 0) { 21757 p = code.pop(); 21758 } 21759 21760 p.index++; 21761 code.push(p); 21762 21763 while (code.length <= i) { 21764 code.push(q = { 21765 children: [], 21766 index: 0 21767 }); 21768 p.children[p.index] = q.children; 21769 p = q; 21770 } 21771 21772 k++; 21773 } 21774 21775 if (i + 1 < length) { 21776 code.push(q = { 21777 children: [], 21778 index: 0 21779 }); 21780 p.children[p.index] = q.children; 21781 p = q; 21782 } 21783 } 21784 21785 return code[0].children; 21786 } 21787 21788 function getBlockBufferOffset(component, row, col) { 21789 return 64 * ((component.blocksPerLine + 1) * row + col); 21790 } 21791 21792 function decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive) { 21793 var parseDNLMarker = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : false; 21794 var mcusPerLine = frame.mcusPerLine; 21795 var progressive = frame.progressive; 21796 var startOffset = offset, 21797 bitsData = 0, 21798 bitsCount = 0; 21799 21800 function readBit() { 21801 if (bitsCount > 0) { 21802 bitsCount--; 21803 return bitsData >> bitsCount & 1; 21804 } 21805 21806 bitsData = data[offset++]; 21807 21808 if (bitsData === 0xFF) { 21809 var nextByte = data[offset++]; 21810 21811 if (nextByte) { 21812 if (nextByte === 0xDC && parseDNLMarker) { 21813 offset += 2; 21814 var scanLines = data[offset++] << 8 | data[offset++]; 21815 21816 if (scanLines > 0 && scanLines !== frame.scanLines) { 21817 throw new DNLMarkerError('Found DNL marker (0xFFDC) while parsing scan data', scanLines); 21818 } 21819 } else if (nextByte === 0xD9) { 21820 throw new EOIMarkerError('Found EOI marker (0xFFD9) while parsing scan data'); 21821 } 21822 21823 throw new JpegError("unexpected marker ".concat((bitsData << 8 | nextByte).toString(16))); 21824 } 21825 } 21826 21827 bitsCount = 7; 21828 return bitsData >>> 7; 21829 } 21830 21831 function decodeHuffman(tree) { 21832 var node = tree; 21833 21834 while (true) { 21835 node = node[readBit()]; 21836 21837 if (typeof node === 'number') { 21838 return node; 21839 } 21840 21841 if (_typeof(node) !== 'object') { 21842 throw new JpegError('invalid huffman sequence'); 21843 } 21844 } 21845 } 21846 21847 function receive(length) { 21848 var n = 0; 21849 21850 while (length > 0) { 21851 n = n << 1 | readBit(); 21852 length--; 21853 } 21854 21855 return n; 21856 } 21857 21858 function receiveAndExtend(length) { 21859 if (length === 1) { 21860 return readBit() === 1 ? 1 : -1; 21861 } 21862 21863 var n = receive(length); 21864 21865 if (n >= 1 << length - 1) { 21866 return n; 21867 } 21868 21869 return n + (-1 << length) + 1; 21870 } 21871 21872 function decodeBaseline(component, offset) { 21873 var t = decodeHuffman(component.huffmanTableDC); 21874 var diff = t === 0 ? 0 : receiveAndExtend(t); 21875 component.blockData[offset] = component.pred += diff; 21876 var k = 1; 21877 21878 while (k < 64) { 21879 var rs = decodeHuffman(component.huffmanTableAC); 21880 var s = rs & 15, 21881 r = rs >> 4; 21882 21883 if (s === 0) { 21884 if (r < 15) { 21885 break; 21886 } 21887 21888 k += 16; 21889 continue; 21890 } 21891 21892 k += r; 21893 var z = dctZigZag[k]; 21894 component.blockData[offset + z] = receiveAndExtend(s); 21895 k++; 21896 } 21897 } 21898 21899 function decodeDCFirst(component, offset) { 21900 var t = decodeHuffman(component.huffmanTableDC); 21901 var diff = t === 0 ? 0 : receiveAndExtend(t) << successive; 21902 component.blockData[offset] = component.pred += diff; 21903 } 21904 21905 function decodeDCSuccessive(component, offset) { 21906 component.blockData[offset] |= readBit() << successive; 21907 } 21908 21909 var eobrun = 0; 21910 21911 function decodeACFirst(component, offset) { 21912 if (eobrun > 0) { 21913 eobrun--; 21914 return; 21915 } 21916 21917 var k = spectralStart, 21918 e = spectralEnd; 21919 21920 while (k <= e) { 21921 var rs = decodeHuffman(component.huffmanTableAC); 21922 var s = rs & 15, 21923 r = rs >> 4; 21924 21925 if (s === 0) { 21926 if (r < 15) { 21927 eobrun = receive(r) + (1 << r) - 1; 21928 break; 21929 } 21930 21931 k += 16; 21932 continue; 21933 } 21934 21935 k += r; 21936 var z = dctZigZag[k]; 21937 component.blockData[offset + z] = receiveAndExtend(s) * (1 << successive); 21938 k++; 21939 } 21940 } 21941 21942 var successiveACState = 0, 21943 successiveACNextValue; 21944 21945 function decodeACSuccessive(component, offset) { 21946 var k = spectralStart; 21947 var e = spectralEnd; 21948 var r = 0; 21949 var s; 21950 var rs; 21951 21952 while (k <= e) { 21953 var offsetZ = offset + dctZigZag[k]; 21954 var sign = component.blockData[offsetZ] < 0 ? -1 : 1; 21955 21956 switch (successiveACState) { 21957 case 0: 21958 rs = decodeHuffman(component.huffmanTableAC); 21959 s = rs & 15; 21960 r = rs >> 4; 21961 21962 if (s === 0) { 21963 if (r < 15) { 21964 eobrun = receive(r) + (1 << r); 21965 successiveACState = 4; 21966 } else { 21967 r = 16; 21968 successiveACState = 1; 21969 } 21970 } else { 21971 if (s !== 1) { 21972 throw new JpegError('invalid ACn encoding'); 21973 } 21974 21975 successiveACNextValue = receiveAndExtend(s); 21976 successiveACState = r ? 2 : 3; 21977 } 21978 21979 continue; 21980 21981 case 1: 21982 case 2: 21983 if (component.blockData[offsetZ]) { 21984 component.blockData[offsetZ] += sign * (readBit() << successive); 21985 } else { 21986 r--; 21987 21988 if (r === 0) { 21989 successiveACState = successiveACState === 2 ? 3 : 0; 21990 } 21991 } 21992 21993 break; 21994 21995 case 3: 21996 if (component.blockData[offsetZ]) { 21997 component.blockData[offsetZ] += sign * (readBit() << successive); 21998 } else { 21999 component.blockData[offsetZ] = successiveACNextValue << successive; 22000 successiveACState = 0; 22001 } 22002 22003 break; 22004 22005 case 4: 22006 if (component.blockData[offsetZ]) { 22007 component.blockData[offsetZ] += sign * (readBit() << successive); 22008 } 22009 22010 break; 22011 } 22012 22013 k++; 22014 } 22015 22016 if (successiveACState === 4) { 22017 eobrun--; 22018 22019 if (eobrun === 0) { 22020 successiveACState = 0; 22021 } 22022 } 22023 } 22024 22025 function decodeMcu(component, decode, mcu, row, col) { 22026 var mcuRow = mcu / mcusPerLine | 0; 22027 var mcuCol = mcu % mcusPerLine; 22028 var blockRow = mcuRow * component.v + row; 22029 var blockCol = mcuCol * component.h + col; 22030 var offset = getBlockBufferOffset(component, blockRow, blockCol); 22031 decode(component, offset); 22032 } 22033 22034 function decodeBlock(component, decode, mcu) { 22035 var blockRow = mcu / component.blocksPerLine | 0; 22036 var blockCol = mcu % component.blocksPerLine; 22037 var offset = getBlockBufferOffset(component, blockRow, blockCol); 22038 decode(component, offset); 22039 } 22040 22041 var componentsLength = components.length; 22042 var component, i, j, k, n;
22043 var decodeFn; 22044 22045 if (progressive) { 22046 if (spectralStart === 0) { 22047 decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; 22048 } else { 22049 decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; 22050 } 22051 } else { 22052 decodeFn = decodeBaseline; 22053 } 22054 22055 var mcu = 0, 22056 fileMarker; 22057 var mcuExpected; 22058 22059 if (componentsLength === 1) { 22060 mcuExpected = components[0].blocksPerLine * components[0].blocksPerColumn; 22061 } else { 22062 mcuExpected = mcusPerLine * frame.mcusPerColumn; 22063 } 22064 22065 var h, v; 22066 22067 while (mcu < mcuExpected) { 22068 var mcuToRead = resetInterval ? Math.min(mcuExpected - mcu, resetInterval) : mcuExpected; 22069 22070 for (i = 0; i < componentsLength; i++) { 22071 components[i].pred = 0; 22072 } 22073 22074 eobrun = 0; 22075 22076 if (componentsLength === 1) { 22077 component = components[0]; 22078 22079 for (n = 0; n < mcuToRead; n++) { 22080 decodeBlock(component, decodeFn, mcu); 22081 mcu++; 22082 } 22083 } else { 22084 for (n = 0; n < mcuToRead; n++) { 22085 for (i = 0; i < componentsLength; i++) { 22086 component = components[i]; 22087 h = component.h; 22088 v = component.v; 22089 22090 for (j = 0; j < v; j++) { 22091 for (k = 0; k < h; k++) { 22092 decodeMcu(component, decodeFn, mcu, j, k); 22093 } 22094 } 22095 } 22096 22097 mcu++; 22098 } 22099 } 22100 22101 bitsCount = 0; 22102 fileMarker = findNextFileMarker(data, offset); 22103 22104 if (fileMarker && fileMarker.invalid) { 22105 (0, _util.warn)('decodeScan - unexpected MCU data, current marker is: ' + fileMarker.invalid); 22106 offset = fileMarker.offset; 22107 } 22108 22109 var marker = fileMarker && fileMarker.marker; 22110 22111 if (!marker || marker <= 0xFF00) { 22112 throw new JpegError('marker was not found'); 22113 } 22114 22115 if (marker >= 0xFFD0 && marker <= 0xFFD7) { 22116 offset += 2; 22117 } else { 22118 break; 22119 } 22120 } 22121 22122 fileMarker = findNextFileMarker(data, offset); 22123 22124 if (fileMarker && fileMarker.invalid) { 22125 (0, _util.warn)('decodeScan - unexpected Scan data, current marker is: ' + fileMarker.invalid); 22126 offset = fileMarker.offset; 22127 } 22128 22129 return offset - startOffset; 22130 } 22131 22132 function quantizeAndInverse(component, blockBufferOffset, p) { 22133 var qt = component.quantizationTable, 22134 blockData = component.blockData; 22135 var v0, v1, v2, v3, v4, v5, v6, v7; 22136 var p0, p1, p2, p3, p4, p5, p6, p7; 22137 var t; 22138 22139 if (!qt) { 22140 throw new JpegError('missing required Quantization Table.'); 22141 } 22142 22143 for (var row = 0; row < 64; row += 8) { 22144 p0 = blockData[blockBufferOffset + row]; 22145 p1 = blockData[blockBufferOffset + row + 1]; 22146 p2 = blockData[blockBufferOffset + row + 2]; 22147 p3 = blockData[blockBufferOffset + row + 3]; 22148 p4 = blockData[blockBufferOffset + row + 4]; 22149 p5 = blockData[blockBufferOffset + row + 5]; 22150 p6 = blockData[blockBufferOffset + row + 6]; 22151 p7 = blockData[blockBufferOffset + row + 7]; 22152 p0 *= qt[row]; 22153 22154 if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { 22155 t = dctSqrt2 * p0 + 512 >> 10; 22156 p[row] = t; 22157 p[row + 1] = t; 22158 p[row + 2] = t; 22159 p[row + 3] = t; 22160 p[row + 4] = t; 22161 p[row + 5] = t; 22162 p[row + 6] = t; 22163 p[row + 7] = t; 22164 continue; 22165 } 22166 22167 p1 *= qt[row + 1]; 22168 p2 *= qt[row + 2]; 22169 p3 *= qt[row + 3]; 22170 p4 *= qt[row + 4]; 22171 p5 *= qt[row + 5]; 22172 p6 *= qt[row + 6]; 22173 p7 *= qt[row + 7]; 22174 v0 = dctSqrt2 * p0 + 128 >> 8; 22175 v1 = dctSqrt2 * p4 + 128 >> 8; 22176 v2 = p2; 22177 v3 = p6; 22178 v4 = dctSqrt1d2 * (p1 - p7) + 128 >> 8; 22179 v7 = dctSqrt1d2 * (p1 + p7) + 128 >> 8; 22180 v5 = p3 << 4; 22181 v6 = p5 << 4; 22182 v0 = v0 + v1 + 1 >> 1; 22183 v1 = v0 - v1; 22184 t = v2 * dctSin6 + v3 * dctCos6 + 128 >> 8; 22185 v2 = v2 * dctCos6 - v3 * dctSin6 + 128 >> 8; 22186 v3 = t; 22187 v4 = v4 + v6 + 1 >> 1; 22188 v6 = v4 - v6; 22189 v7 = v7 + v5 + 1 >> 1; 22190 v5 = v7 - v5; 22191 v0 = v0 + v3 + 1 >> 1;
vendor: 6,299 bytes, lines 22192-22379
22192 v3 = v0 - v3; 22193 v1 = v1 + v2 + 1 >> 1; 22194 v2 = v1 - v2; 22195 t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12; 22196 v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; 22197 v7 = t; 22198 t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; 22199 v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; 22200 v6 = t; 22201 p[row] = v0 + v7; 22202 p[row + 7] = v0 - v7; 22203 p[row + 1] = v1 + v6; 22204 p[row + 6] = v1 - v6; 22205 p[row + 2] = v2 + v5; 22206 p[row + 5] = v2 - v5; 22207 p[row + 3] = v3 + v4; 22208 p[row + 4] = v3 - v4; 22209 } 22210 22211 for (var col = 0; col < 8; ++col) { 22212 p0 = p[col]; 22213 p1 = p[col + 8]; 22214 p2 = p[col + 16]; 22215 p3 = p[col + 24]; 22216 p4 = p[col + 32]; 22217 p5 = p[col + 40]; 22218 p6 = p[col + 48]; 22219 p7 = p[col + 56]; 22220 22221 if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { 22222 t = dctSqrt2 * p0 + 8192 >> 14; 22223 t = t < -2040 ? 0 : t >= 2024 ? 255 : t + 2056 >> 4; 22224 blockData[blockBufferOffset + col] = t; 22225 blockData[blockBufferOffset + col + 8] = t; 22226 blockData[blockBufferOffset + col + 16] = t; 22227 blockData[blockBufferOffset + col + 24] = t; 22228 blockData[blockBufferOffset + col + 32] = t; 22229 blockData[blockBufferOffset + col + 40] = t; 22230 blockData[blockBufferOffset + col + 48] = t; 22231 blockData[blockBufferOffset + col + 56] = t; 22232 continue; 22233 } 22234 22235 v0 = dctSqrt2 * p0 + 2048 >> 12; 22236 v1 = dctSqrt2 * p4 + 2048 >> 12; 22237 v2 = p2; 22238 v3 = p6; 22239 v4 = dctSqrt1d2 * (p1 - p7) + 2048 >> 12; 22240 v7 = dctSqrt1d2 * (p1 + p7) + 2048 >> 12; 22241 v5 = p3; 22242 v6 = p5; 22243 v0 = (v0 + v1 + 1 >> 1) + 4112; 22244 v1 = v0 - v1; 22245 t = v2 * dctSin6 + v3 * dctCos6 + 2048 >> 12; 22246 v2 = v2 * dctCos6 - v3 * dctSin6 + 2048 >> 12; 22247 v3 = t; 22248 v4 = v4 + v6 + 1 >> 1; 22249 v6 = v4 - v6; 22250 v7 = v7 + v5 + 1 >> 1; 22251 v5 = v7 - v5; 22252 v0 = v0 + v3 + 1 >> 1; 22253 v3 = v0 - v3; 22254 v1 = v1 + v2 + 1 >> 1; 22255 v2 = v1 - v2; 22256 t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12; 22257 v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; 22258 v7 = t; 22259 t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; 22260 v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; 22261 v6 = t; 22262 p0 = v0 + v7; 22263 p7 = v0 - v7; 22264 p1 = v1 + v6; 22265 p6 = v1 - v6; 22266 p2 = v2 + v5; 22267 p5 = v2 - v5; 22268 p3 = v3 + v4; 22269 p4 = v3 - v4; 22270 p0 = p0 < 16 ? 0 : p0 >= 4080 ? 255 : p0 >> 4; 22271 p1 = p1 < 16 ? 0 : p1 >= 4080 ? 255 : p1 >> 4; 22272 p2 = p2 < 16 ? 0 : p2 >= 4080 ? 255 : p2 >> 4; 22273 p3 = p3 < 16 ? 0 : p3 >= 4080 ? 255 : p3 >> 4; 22274 p4 = p4 < 16 ? 0 : p4 >= 4080 ? 255 : p4 >> 4; 22275 p5 = p5 < 16 ? 0 : p5 >= 4080 ? 255 : p5 >> 4; 22276 p6 = p6 < 16 ? 0 : p6 >= 4080 ? 255 : p6 >> 4; 22277 p7 = p7 < 16 ? 0 : p7 >= 4080 ? 255 : p7 >> 4; 22278 blockData[blockBufferOffset + col] = p0; 22279 blockData[blockBufferOffset + col + 8] = p1; 22280 blockData[blockBufferOffset + col + 16] = p2; 22281 blockData[blockBufferOffset + col + 24] = p3; 22282 blockData[blockBufferOffset + col + 32] = p4; 22283 blockData[blockBufferOffset + col + 40] = p5; 22284 blockData[blockBufferOffset + col + 48] = p6; 22285 blockData[blockBufferOffset + col + 56] = p7; 22286 } 22287 } 22288 22289 function buildComponentData(frame, component) { 22290 var blocksPerLine = component.blocksPerLine; 22291 var blocksPerColumn = component.blocksPerColumn; 22292 var computationBuffer = new Int16Array(64); 22293 22294 for (var blockRow = 0; blockRow < blocksPerColumn; blockRow++) { 22295 for (var blockCol = 0; blockCol < blocksPerLine; blockCol++) { 22296 var offset = getBlockBufferOffset(component, blockRow, blockCol); 22297 quantizeAndInverse(component, offset, computationBuffer); 22298 } 22299 } 22300 22301 return component.blockData; 22302 } 22303 22304 function findNextFileMarker(data, currentPos) { 22305 var startPos = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : currentPos; 22306 22307 function peekUint16(pos) { 22308 return data[pos] << 8 | data[pos + 1]; 22309 } 22310 22311 var maxPos = data.length - 1; 22312 var newPos = startPos < currentPos ? startPos : currentPos; 22313 22314 if (currentPos >= maxPos) { 22315 return null; 22316 } 22317 22318 var currentMarker = peekUint16(currentPos); 22319 22320 if (currentMarker >= 0xFFC0 && currentMarker <= 0xFFFE) { 22321 return { 22322 invalid: null, 22323 marker: currentMarker, 22324 offset: currentPos 22325 }; 22326 } 22327 22328 var newMarker = peekUint16(newPos); 22329 22330 while (!(newMarker >= 0xFFC0 && newMarker <= 0xFFFE)) { 22331 if (++newPos >= maxPos) { 22332 return null; 22333 } 22334 22335 newMarker = peekUint16(newPos); 22336 } 22337 22338 return { 22339 invalid: currentMarker.toString(16), 22340 marker: newMarker, 22341 offset: newPos 22342 }; 22343 } 22344 22345 JpegImage.prototype = { 22346 parse: function parse(data) { 22347 var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, 22348 _ref2$dnlScanLines = _ref2.dnlScanLines, 22349 dnlScanLines = _ref2$dnlScanLines === void 0 ? null : _ref2$dnlScanLines; 22350 22351 function readUint16() { 22352 var value = data[offset] << 8 | data[offset + 1]; 22353 offset += 2; 22354 return value; 22355 } 22356 22357 function readDataBlock() { 22358 var length = readUint16(); 22359 var endOffset = offset + length - 2; 22360 var fileMarker = findNextFileMarker(data, endOffset, offset); 22361 22362 if (fileMarker && fileMarker.invalid) { 22363 (0, _util.warn)('readDataBlock - incorrect length, current marker is: ' + fileMarker.invalid); 22364 endOffset = fileMarker.offset; 22365 } 22366 22367 var array = data.subarray(offset, endOffset); 22368 offset += array.length; 22369 return array; 22370 } 22371 22372 function prepareComponents(frame) { 22373 var mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); 22374 var mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); 22375 22376 for (var i = 0; i < frame.components.length; i++) { 22377 component = frame.components[i]; 22378 var blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * component.h / frame.maxH); 22379 var blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * component.v / frame.maxV);
22380 var blocksPerLineForMcu = mcusPerLine * component.h; 22381 var blocksPerColumnForMcu = mcusPerColumn * component.v; 22382 var blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1); 22383 component.blockData = new Int16Array(blocksBufferSize); 22384 component.blocksPerLine = blocksPerLine; 22385 component.blocksPerColumn = blocksPerColumn; 22386 } 22387 22388 frame.mcusPerLine = mcusPerLine; 22389 frame.mcusPerColumn = mcusPerColumn; 22390 } 22391 22392 var offset = 0; 22393 var jfif = null; 22394 var adobe = null; 22395 var frame, resetInterval; 22396 var numSOSMarkers = 0; 22397 var quantizationTables = []; 22398 var huffmanTablesAC = [], 22399 huffmanTablesDC = []; 22400 var fileMarker = readUint16(); 22401 22402 if (fileMarker !== 0xFFD8) { 22403 throw new JpegError('SOI not found'); 22404 } 22405 22406 fileMarker = readUint16(); 22407 22408 markerLoop: while (fileMarker !== 0xFFD9) { 22409 var i, j, l; 22410 22411 switch (fileMarker) { 22412 case 0xFFE0: 22413 case 0xFFE1: 22414 case 0xFFE2: 22415 case 0xFFE3: 22416 case 0xFFE4: 22417 case 0xFFE5: 22418 case 0xFFE6: 22419 case 0xFFE7: 22420 case 0xFFE8: 22421 case 0xFFE9: 22422 case 0xFFEA: 22423 case 0xFFEB: 22424 case 0xFFEC: 22425 case 0xFFED: 22426 case 0xFFEE: 22427 case 0xFFEF: 22428 case 0xFFFE: 22429 var appData = readDataBlock(); 22430 22431 if (fileMarker === 0xFFE0) { 22432 if (appData[0] === 0x4A && appData[1] === 0x46 && appData[2] === 0x49 && appData[3] === 0x46 && appData[4] === 0) { 22433 jfif = { 22434 version: { 22435 major: appData[5], 22436 minor: appData[6] 22437 }, 22438 densityUnits: appData[7], 22439 xDensity: appData[8] << 8 | appData[9], 22440 yDensity: appData[10] << 8 | appData[11], 22441 thumbWidth: appData[12], 22442 thumbHeight: appData[13], 22443 thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13]) 22444 }; 22445 } 22446 } 22447 22448 if (fileMarker === 0xFFEE) { 22449 if (appData[0] === 0x41 && appData[1] === 0x64 && appData[2] === 0x6F && appData[3] === 0x62 && appData[4] === 0x65) { 22450 adobe = { 22451 version: appData[5] << 8 | appData[6], 22452 flags0: appData[7] << 8 | appData[8], 22453 flags1: appData[9] << 8 | appData[10], 22454 transformCode: appData[11] 22455 }; 22456 } 22457 } 22458 22459 break; 22460 22461 case 0xFFDB: 22462 var quantizationTablesLength = readUint16(); 22463 var quantizationTablesEnd = quantizationTablesLength + offset - 2; 22464 var z; 22465 22466 while (offset < quantizationTablesEnd) { 22467 var quantizationTableSpec = data[offset++]; 22468 var tableData = new Uint16Array(64); 22469 22470 if (quantizationTableSpec >> 4 === 0) { 22471 for (j = 0; j < 64; j++) { 22472 z = dctZigZag[j]; 22473 tableData[z] = data[offset++]; 22474 } 22475 } else if (quantizationTableSpec >> 4 === 1) { 22476 for (j = 0; j < 64; j++) { 22477 z = dctZigZag[j]; 22478 tableData[z] = readUint16(); 22479 } 22480 } else { 22481 throw new JpegError('DQT - invalid table spec'); 22482 } 22483 22484 quantizationTables[quantizationTableSpec & 15] = tableData; 22485 } 22486 22487 break; 22488 22489 case 0xFFC0: 22490 case 0xFFC1: 22491 case 0xFFC2: 22492 if (frame) { 22493 throw new JpegError('Only single frame JPEGs supported'); 22494 } 22495 22496 readUint16(); 22497 frame = {}; 22498 frame.extended = fileMarker === 0xFFC1; 22499 frame.progressive = fileMarker === 0xFFC2; 22500 frame.precision = data[offset++]; 22501 var sofScanLines = readUint16(); 22502 frame.scanLines = dnlScanLines || sofScanLines; 22503 frame.samplesPerLine = readUint16(); 22504 frame.components = []; 22505 frame.componentIds = {}; 22506 var componentsCount = data[offset++], 22507 componentId; 22508 var maxH = 0, 22509 maxV = 0; 22510 22511 for (i = 0; i < componentsCount; i++) { 22512 componentId = data[offset]; 22513 var h = data[offset + 1] >> 4; 22514 var v = data[offset + 1] & 15; 22515 22516 if (maxH < h) { 22517 maxH = h; 22518 } 22519 22520 if (maxV < v) { 22521 maxV = v; 22522 } 22523 22524 var qId = data[offset + 2]; 22525 l = frame.components.push({ 22526 h: h, 22527 v: v, 22528 quantizationId: qId, 22529 quantizationTable: null 22530 }); 22531 frame.componentIds[componentId] = l - 1; 22532 offset += 3; 22533 } 22534 22535 frame.maxH = maxH; 22536 frame.maxV = maxV; 22537 prepareComponents(frame); 22538 break; 22539 22540 case 0xFFC4: 22541 var huffmanLength = readUint16(); 22542 22543 for (i = 2; i < huffmanLength;) { 22544 var huffmanTableSpec = data[offset++]; 22545 var codeLengths = new Uint8Array(16); 22546 var codeLengthSum = 0; 22547 22548 for (j = 0; j < 16; j++, offset++) { 22549 codeLengthSum += codeLengths[j] = data[offset]; 22550 } 22551 22552 var huffmanValues = new Uint8Array(codeLengthSum); 22553 22554 for (j = 0; j < codeLengthSum; j++, offset++) { 22555 huffmanValues[j] = data[offset]; 22556 } 22557 22558 i += 17 + codeLengthSum; 22559 (huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = buildHuffmanTable(codeLengths, huffmanValues); 22560 } 22561 22562 break; 22563
vendor: 4,524 bytes, lines 22564-22688
22564 case 0xFFDD: 22565 readUint16(); 22566 resetInterval = readUint16(); 22567 break; 22568 22569 case 0xFFDA: 22570 var parseDNLMarker = ++numSOSMarkers === 1 && !dnlScanLines; 22571 readUint16(); 22572 var selectorsCount = data[offset++]; 22573 var components = [], 22574 component; 22575 22576 for (i = 0; i < selectorsCount; i++) { 22577 var componentIndex = frame.componentIds[data[offset++]]; 22578 component = frame.components[componentIndex]; 22579 var tableSpec = data[offset++]; 22580 component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; 22581 component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; 22582 components.push(component); 22583 } 22584 22585 var spectralStart = data[offset++]; 22586 var spectralEnd = data[offset++]; 22587 var successiveApproximation = data[offset++]; 22588 22589 try { 22590 var processed = decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successiveApproximation >> 4, successiveApproximation & 15, parseDNLMarker); 22591 offset += processed; 22592 } catch (ex) { 22593 if (ex instanceof DNLMarkerError) { 22594 (0, _util.warn)("".concat(ex.message, " -- attempting to re-parse the JPEG image.")); 22595 return this.parse(data, { 22596 dnlScanLines: ex.scanLines 22597 }); 22598 } else if (ex instanceof EOIMarkerError) { 22599 (0, _util.warn)("".concat(ex.message, " -- ignoring the rest of the image data.")); 22600 break markerLoop; 22601 } 22602 22603 throw ex; 22604 } 22605 22606 break; 22607 22608 case 0xFFDC: 22609 offset += 4; 22610 break; 22611 22612 case 0xFFFF: 22613 if (data[offset] !== 0xFF) { 22614 offset--; 22615 } 22616 22617 break; 22618 22619 default: 22620 if (data[offset - 3] === 0xFF && data[offset - 2] >= 0xC0 && data[offset - 2] <= 0xFE) { 22621 offset -= 3; 22622 break; 22623 } 22624 22625 var nextFileMarker = findNextFileMarker(data, offset - 2); 22626 22627 if (nextFileMarker && nextFileMarker.invalid) { 22628 (0, _util.warn)('JpegImage.parse - unexpected data, current marker is: ' + nextFileMarker.invalid); 22629 offset = nextFileMarker.offset; 22630 break; 22631 } 22632 22633 throw new JpegError('unknown marker ' + fileMarker.toString(16)); 22634 } 22635 22636 fileMarker = readUint16(); 22637 } 22638 22639 this.width = frame.samplesPerLine; 22640 this.height = frame.scanLines; 22641 this.jfif = jfif; 22642 this.adobe = adobe; 22643 this.components = []; 22644 22645 for (i = 0; i < frame.components.length; i++) { 22646 component = frame.components[i]; 22647 var quantizationTable = quantizationTables[component.quantizationId]; 22648 22649 if (quantizationTable) { 22650 component.quantizationTable = quantizationTable; 22651 } 22652 22653 this.components.push({ 22654 output: buildComponentData(frame, component), 22655 scaleX: component.h / frame.maxH, 22656 scaleY: component.v / frame.maxV, 22657 blocksPerLine: component.blocksPerLine, 22658 blocksPerColumn: component.blocksPerColumn 22659 }); 22660 } 22661 22662 this.numComponents = this.components.length; 22663 }, 22664 _getLinearizedBlockData: function _getLinearizedBlockData(width, height) { 22665 var isSourcePDF = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 22666 var scaleX = this.width / width, 22667 scaleY = this.height / height; 22668 var component, componentScaleX, componentScaleY, blocksPerScanline; 22669 var x, y, i, j, k; 22670 var index; 22671 var offset = 0; 22672 var output; 22673 var numComponents = this.components.length; 22674 var dataLength = width * height * numComponents; 22675 var data = new Uint8ClampedArray(dataLength); 22676 var xScaleBlockOffset = new Uint32Array(width); 22677 var mask3LSB = 0xfffffff8; 22678 22679 for (i = 0; i < numComponents; i++) { 22680 component = this.components[i]; 22681 componentScaleX = component.scaleX * scaleX; 22682 componentScaleY = component.scaleY * scaleY; 22683 offset = i; 22684 output = component.output; 22685 blocksPerScanline = component.blocksPerLine + 1 << 3; 22686 22687 for (x = 0; x < width; x++) { 22688 j = 0 | x * componentScaleX;
vendor: 6,721 bytes, lines 22689-22846
22689 xScaleBlockOffset[x] = (j & mask3LSB) << 3 | j & 7; 22690 } 22691 22692 for (y = 0; y < height; y++) { 22693 j = 0 | y * componentScaleY; 22694 index = blocksPerScanline * (j & mask3LSB) | (j & 7) << 3; 22695 22696 for (x = 0; x < width; x++) { 22697 data[offset] = output[index + xScaleBlockOffset[x]]; 22698 offset += numComponents; 22699 } 22700 } 22701 } 22702 22703 var transform = this._decodeTransform; 22704 22705 if (!isSourcePDF && numComponents === 4 && !transform) { 22706 transform = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255]); 22707 } 22708 22709 if (transform) { 22710 for (i = 0; i < dataLength;) { 22711 for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) { 22712 data[i] = (data[i] * transform[k] >> 8) + transform[k + 1]; 22713 } 22714 } 22715 } 22716 22717 return data; 22718 }, 22719 22720 get _isColorConversionNeeded() { 22721 if (this.adobe) { 22722 return !!this.adobe.transformCode; 22723 } 22724 22725 if (this.numComponents === 3) { 22726 if (this._colorTransform === 0) { 22727 return false; 22728 } 22729 22730 return true; 22731 } 22732 22733 if (this._colorTransform === 1) { 22734 return true; 22735 } 22736 22737 return false; 22738 }, 22739 22740 _convertYccToRgb: function convertYccToRgb(data) { 22741 var Y, Cb, Cr; 22742 22743 for (var i = 0, length = data.length; i < length; i += 3) { 22744 Y = data[i]; 22745 Cb = data[i + 1]; 22746 Cr = data[i + 2]; 22747 data[i] = Y - 179.456 + 1.402 * Cr; 22748 data[i + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr; 22749 data[i + 2] = Y - 226.816 + 1.772 * Cb; 22750 } 22751 22752 return data; 22753 }, 22754 _convertYcckToRgb: function convertYcckToRgb(data) { 22755 var Y, Cb, Cr, k; 22756 var offset = 0; 22757 22758 for (var i = 0, length = data.length; i < length; i += 4) { 22759 Y = data[i]; 22760 Cb = data[i + 1]; 22761 Cr = data[i + 2]; 22762 k = data[i + 3]; 22763 data[offset++] = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776); 22764 data[offset++] = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665); 22765 data[offset++] = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407); 22766 } 22767 22768 return data.subarray(0, offset); 22769 }, 22770 _convertYcckToCmyk: function convertYcckToCmyk(data) { 22771 var Y, Cb, Cr; 22772 22773 for (var i = 0, length = data.length; i < length; i += 4) { 22774 Y = data[i]; 22775 Cb = data[i + 1]; 22776 Cr = data[i + 2]; 22777 data[i] = 434.456 - Y - 1.402 * Cr; 22778 data[i + 1] = 119.541 - Y + 0.344 * Cb + 0.714 * Cr; 22779 data[i + 2] = 481.816 - Y - 1.772 * Cb; 22780 } 22781 22782 return data; 22783 }, 22784 _convertCmykToRgb: function convertCmykToRgb(data) { 22785 var c, m, y, k; 22786 var offset = 0; 22787 var scale = 1 / 255; 22788 22789 for (var i = 0, length = data.length; i < length; i += 4) { 22790 c = data[i] * scale; 22791 m = data[i + 1] * scale; 22792 y = data[i + 2] * scale; 22793 k = data[i + 3] * scale; 22794 data[offset++] = 255 + c * (-4.387332384609988 * c + 54.48615194189176 * m + 18.82290502165302 * y + 212.25662451639585 * k - 285.2331026137004) + m * (1.7149763477362134 * m - 5.6096736904047315 * y - 17.873870861415444 * k - 5.497006427196366) + y * (-2.5217340131683033 * y - 21.248923337353073 * k + 17.5119270841813) - k * (21.86122147463605 * k + 189.48180835922747); 22795 data[offset++] = 255 + c * (8.841041422036149 * c + 60.118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k - 79.2970844816548) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 190.9453302588951) + y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) - k * (20.737325471181034 * k + 187.80453709719578); 22796 data[offset++] = 255 + c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k - 14.183576799673286) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 112.23884253719248) + y * (0.03296041114873217 * y + 115.60384449646641 * k - 193.58209356861505) - k * (22.33816807309886 * k + 180.12613974708367); 22797 } 22798 22799 return data.subarray(0, offset); 22800 }, 22801 getData: function getData(_ref3) { 22802 var width = _ref3.width, 22803 height = _ref3.height, 22804 _ref3$forceRGB = _ref3.forceRGB, 22805 forceRGB = _ref3$forceRGB === void 0 ? false : _ref3$forceRGB, 22806 _ref3$isSourcePDF = _ref3.isSourcePDF, 22807 isSourcePDF = _ref3$isSourcePDF === void 0 ? false : _ref3$isSourcePDF; 22808 22809 if (this.numComponents > 4) { 22810 throw new JpegError('Unsupported color mode'); 22811 } 22812 22813 var data = this._getLinearizedBlockData(width, height, isSourcePDF); 22814 22815 if (this.numComponents === 1 && forceRGB) { 22816 var dataLength = data.length; 22817 var rgbData = new Uint8ClampedArray(dataLength * 3); 22818 var offset = 0; 22819 22820 for (var i = 0; i < dataLength; i++) { 22821 var grayColor = data[i]; 22822 rgbData[offset++] = grayColor; 22823 rgbData[offset++] = grayColor; 22824 rgbData[offset++] = grayColor; 22825 } 22826 22827 return rgbData; 22828 } else if (this.numComponents === 3 && this._isColorConversionNeeded) { 22829 return this._convertYccToRgb(data); 22830 } else if (this.numComponents === 4) { 22831 if (this._isColorConversionNeeded) { 22832 if (forceRGB) { 22833 return this._convertYcckToRgb(data); 22834 } 22835 22836 return this._convertYcckToCmyk(data); 22837 } else if (forceRGB) { 22838 return this._convertCmykToRgb(data); 22839 } 22840 } 22841 22842 return data; 22843 } 22844 }; 22845 return JpegImage; 22846}();
22847 22848exports.JpegImage = JpegImage; 22849 22850/***/ }), 22851/* 165 */ 22852/***/ (function(module, exports, __w_pdfjs_require__) { 22853 22854"use strict"; 22855 22856 22857Object.defineProperty(exports, "__esModule", { 22858 value: true 22859}); 22860exports.JpxStream = void 0; 22861 22862var _stream = __w_pdfjs_require__(157); 22863 22864var _jpx = __w_pdfjs_require__(166); 22865 22866var _util = __w_pdfjs_require__(6); 22867 22868var JpxStream = function JpxStreamClosure() { 22869 function JpxStream(stream, maybeLength, dict, params) { 22870 this.stream = stream; 22871 this.maybeLength = maybeLength; 22872 this.dict = dict; 22873 this.params = params; 22874 22875 _stream.DecodeStream.call(this, maybeLength); 22876 } 22877 22878 JpxStream.prototype = Object.create(_stream.DecodeStream.prototype); 22879 Object.defineProperty(JpxStream.prototype, 'bytes', { 22880 get: function JpxStream_bytes() { 22881 return (0, _util.shadow)(this, 'bytes', this.stream.getBytes(this.maybeLength)); 22882 }, 22883 configurable: true 22884 }); 22885 22886 JpxStream.prototype.ensureBuffer = function (requested) {}; 22887 22888 JpxStream.prototype.readBlock = function () { 22889 if (this.eof) { 22890 return; 22891 } 22892 22893 var jpxImage = new _jpx.JpxImage(); 22894 jpxImage.parse(this.bytes); 22895 var width = jpxImage.width; 22896 var height = jpxImage.height; 22897 var componentsCount = jpxImage.componentsCount; 22898 var tileCount = jpxImage.tiles.length; 22899 22900 if (tileCount === 1) { 22901 this.buffer = jpxImage.tiles[0].items; 22902 } else { 22903 var data = new Uint8ClampedArray(width * height * componentsCount); 22904 22905 for (var k = 0; k < tileCount; k++) { 22906 var tileComponents = jpxImage.tiles[k]; 22907 var tileWidth = tileComponents.width; 22908 var tileHeight = tileComponents.height; 22909 var tileLeft = tileComponents.left; 22910 var tileTop = tileComponents.top; 22911 var src = tileComponents.items; 22912 var srcPosition = 0; 22913 var dataPosition = (width * tileTop + tileLeft) * componentsCount; 22914 var imgRowSize = width * componentsCount; 22915 var tileRowSize = tileWidth * componentsCount; 22916 22917 for (var j = 0; j < tileHeight; j++) { 22918 var rowBytes = src.subarray(srcPosition, srcPosition + tileRowSize); 22919 data.set(rowBytes, dataPosition); 22920 srcPosition += tileRowSize; 22921 dataPosition += imgRowSize; 22922 } 22923 } 22924 22925 this.buffer = data; 22926 } 22927 22928 this.bufferLength = this.buffer.length; 22929 this.eof = true; 22930 }; 22931 22932 return JpxStream; 22933}(); 22934 22935exports.JpxStream = JpxStream; 22936 22937/***/ }), 22938/* 166 */ 22939/***/ (function(module, exports, __w_pdfjs_require__) { 22940 22941"use strict"; 22942 22943 22944Object.defineProperty(exports, "__esModule", { 22945 value: true 22946}); 22947exports.JpxImage = void 0; 22948 22949var _util = __w_pdfjs_require__(6); 22950 22951var _arithmetic_decoder = __w_pdfjs_require__(162); 22952 22953var JpxError = function JpxErrorClosure() { 22954 function JpxError(msg) { 22955 this.message = 'JPX error: ' + msg; 22956 } 22957 22958 JpxError.prototype = new Error(); 22959 JpxError.prototype.name = 'JpxError'; 22960 JpxError.constructor = JpxError; 22961 return JpxError; 22962}(); 22963 22964var JpxImage = function JpxImageClosure() { 22965 var SubbandsGainLog2 = { 22966 'LL': 0, 22967 'LH': 1, 22968 'HL': 1, 22969 'HH': 2 22970 }; 22971 22972 function JpxImage() { 22973 this.failOnCorruptedImage = false; 22974 } 22975 22976 JpxImage.prototype = { 22977 parse: function JpxImage_parse(data) { 22978 var head = (0, _util.readUint16)(data, 0); 22979 22980 if (head === 0xFF4F) { 22981 this.parseCodestream(data, 0, data.length); 22982 return; 22983 } 22984 22985 var position = 0, 22986 length = data.length; 22987 22988 while (position < length) { 22989 var headerSize = 8; 22990 var lbox = (0, _util.readUint32)(data, position); 22991 var tbox = (0, _util.readUint32)(data, position + 4); 22992 position += headerSize; 22993 22994 if (lbox === 1) { 22995 lbox = (0, _util.readUint32)(data, position) * 4294967296 + (0, _util.readUint32)(data, position + 4); 22996 position += 8; 22997 headerSize += 8; 22998 } 22999 23000 if (lbox === 0) { 23001 lbox = length - position + headerSize; 23002 } 23003 23004 if (lbox < headerSize) { 23005 throw new JpxError('Invalid box field size'); 23006 } 23007 23008 var dataLength = lbox - headerSize; 23009 var jumpDataLength = true; 23010 23011 switch (tbox) { 23012 case 0x6A703268: 23013 jumpDataLength = false; 23014 break; 23015 23016 case 0x636F6C72: 23017 var method = data[position]; 23018 23019 if (method === 1) { 23020 var colorspace = (0, _util.readUint32)(data, position + 3); 23021 23022 switch (colorspace) { 23023 case 16: 23024 case 17: 23025 case 18: 23026 break; 23027 23028 default: 23029 (0, _util.warn)('Unknown colorspace ' + colorspace); 23030 break; 23031 } 23032 } else if (method === 2) { 23033 (0, _util.info)('ICC profile not supported'); 23034 } 23035 23036 break; 23037 23038 case 0x6A703263: 23039 this.parseCodestream(data, position, position + dataLength); 23040 break; 23041 23042 case 0x6A502020: 23043 if ((0, _util.readUint32)(data, position) !== 0x0d0a870a) { 23044 (0, _util.warn)('Invalid JP2 signature'); 23045 } 23046 23047 break; 23048 23049 case 0x6A501A1A: 23050 case 0x66747970: 23051 case 0x72726571: 23052 case 0x72657320: 23053 case 0x69686472: 23054 break; 23055 23056 default: 23057 var headerType = String.fromCharCode(tbox >> 24 & 0xFF, tbox >> 16 & 0xFF, tbox >> 8 & 0xFF, tbox & 0xFF); 23058 (0, _util.warn)('Unsupported header type ' + tbox + ' (' + headerType + ')'); 23059 break; 23060 } 23061 23062 if (jumpDataLength) { 23063 position += dataLength; 23064 } 23065 } 23066 }, 23067 parseImageProperties: function JpxImage_parseImageProperties(stream) { 23068 var newByte = stream.getByte(); 23069 23070 while (newByte >= 0) { 23071 var oldByte = newByte; 23072 newByte = stream.getByte(); 23073 var code = oldByte << 8 | newByte; 23074 23075 if (code === 0xFF51) { 23076 stream.skip(4); 23077 var Xsiz = stream.getInt32() >>> 0; 23078 var Ysiz = stream.getInt32() >>> 0; 23079 var XOsiz = stream.getInt32() >>> 0; 23080 var YOsiz = stream.getInt32() >>> 0; 23081 stream.skip(16); 23082 var Csiz = stream.getUint16(); 23083 this.width = Xsiz - XOsiz; 23084 this.height = Ysiz - YOsiz; 23085 this.componentsCount = Csiz; 23086 this.bitsPerComponent = 8; 23087 return; 23088 } 23089 } 23090 23091 throw new JpxError('No size marker found in JPX stream'); 23092 }, 23093 parseCodestream: function JpxImage_parseCodestream(data, start, end) { 23094 var context = {}; 23095 var doNotRecover = false; 23096
vendor: 5,178 bytes, lines 23097-23259
23097 try { 23098 var position = start; 23099 23100 while (position + 1 < end) { 23101 var code = (0, _util.readUint16)(data, position); 23102 position += 2; 23103 var length = 0, 23104 j, 23105 sqcd, 23106 spqcds, 23107 spqcdSize, 23108 scalarExpounded, 23109 tile; 23110 23111 switch (code) { 23112 case 0xFF4F: 23113 context.mainHeader = true; 23114 break; 23115 23116 case 0xFFD9: 23117 break; 23118 23119 case 0xFF51: 23120 length = (0, _util.readUint16)(data, position); 23121 var siz = {}; 23122 siz.Xsiz = (0, _util.readUint32)(data, position + 4); 23123 siz.Ysiz = (0, _util.readUint32)(data, position + 8); 23124 siz.XOsiz = (0, _util.readUint32)(data, position + 12); 23125 siz.YOsiz = (0, _util.readUint32)(data, position + 16); 23126 siz.XTsiz = (0, _util.readUint32)(data, position + 20); 23127 siz.YTsiz = (0, _util.readUint32)(data, position + 24); 23128 siz.XTOsiz = (0, _util.readUint32)(data, position + 28); 23129 siz.YTOsiz = (0, _util.readUint32)(data, position + 32); 23130 var componentsCount = (0, _util.readUint16)(data, position + 36); 23131 siz.Csiz = componentsCount; 23132 var components = []; 23133 j = position + 38; 23134 23135 for (var i = 0; i < componentsCount; i++) { 23136 var component = { 23137 precision: (data[j] & 0x7F) + 1, 23138 isSigned: !!(data[j] & 0x80), 23139 XRsiz: data[j + 1], 23140 YRsiz: data[j + 2] 23141 }; 23142 j += 3; 23143 calculateComponentDimensions(component, siz); 23144 components.push(component); 23145 } 23146 23147 context.SIZ = siz; 23148 context.components = components; 23149 calculateTileGrids(context, components); 23150 context.QCC = []; 23151 context.COC = []; 23152 break; 23153 23154 case 0xFF5C: 23155 length = (0, _util.readUint16)(data, position); 23156 var qcd = {}; 23157 j = position + 2; 23158 sqcd = data[j++]; 23159 23160 switch (sqcd & 0x1F) { 23161 case 0: 23162 spqcdSize = 8; 23163 scalarExpounded = true; 23164 break; 23165 23166 case 1: 23167 spqcdSize = 16; 23168 scalarExpounded = false; 23169 break; 23170 23171 case 2: 23172 spqcdSize = 16; 23173 scalarExpounded = true; 23174 break; 23175 23176 default: 23177 throw new Error('Invalid SQcd value ' + sqcd); 23178 } 23179 23180 qcd.noQuantization = spqcdSize === 8; 23181 qcd.scalarExpounded = scalarExpounded; 23182 qcd.guardBits = sqcd >> 5; 23183 spqcds = []; 23184 23185 while (j < length + position) { 23186 var spqcd = {}; 23187 23188 if (spqcdSize === 8) { 23189 spqcd.epsilon = data[j++] >> 3; 23190 spqcd.mu = 0; 23191 } else { 23192 spqcd.epsilon = data[j] >> 3; 23193 spqcd.mu = (data[j] & 0x7) << 8 | data[j + 1]; 23194 j += 2; 23195 } 23196 23197 spqcds.push(spqcd); 23198 } 23199 23200 qcd.SPqcds = spqcds; 23201 23202 if (context.mainHeader) { 23203 context.QCD = qcd; 23204 } else { 23205 context.currentTile.QCD = qcd; 23206 context.currentTile.QCC = []; 23207 } 23208 23209 break; 23210 23211 case 0xFF5D: 23212 length = (0, _util.readUint16)(data, position); 23213 var qcc = {}; 23214 j = position + 2; 23215 var cqcc; 23216 23217 if (context.SIZ.Csiz < 257) { 23218 cqcc = data[j++]; 23219 } else { 23220 cqcc = (0, _util.readUint16)(data, j); 23221 j += 2; 23222 } 23223 23224 sqcd = data[j++]; 23225 23226 switch (sqcd & 0x1F) { 23227 case 0: 23228 spqcdSize = 8; 23229 scalarExpounded = true; 23230 break; 23231 23232 case 1: 23233 spqcdSize = 16; 23234 scalarExpounded = false; 23235 break; 23236 23237 case 2: 23238 spqcdSize = 16; 23239 scalarExpounded = true; 23240 break; 23241 23242 default: 23243 throw new Error('Invalid SQcd value ' + sqcd); 23244 } 23245 23246 qcc.noQuantization = spqcdSize === 8; 23247 qcc.scalarExpounded = scalarExpounded; 23248 qcc.guardBits = sqcd >> 5; 23249 spqcds = []; 23250 23251 while (j < length + position) { 23252 spqcd = {}; 23253 23254 if (spqcdSize === 8) { 23255 spqcd.epsilon = data[j++] >> 3; 23256 spqcd.mu = 0; 23257 } else { 23258 spqcd.epsilon = data[j] >> 3; 23259 spqcd.mu = (data[j] & 0x7) << 8 | data[j + 1];
vendor: 4,888 bytes, lines 23260-23401
23260 j += 2; 23261 } 23262 23263 spqcds.push(spqcd); 23264 } 23265 23266 qcc.SPqcds = spqcds; 23267 23268 if (context.mainHeader) { 23269 context.QCC[cqcc] = qcc; 23270 } else { 23271 context.currentTile.QCC[cqcc] = qcc; 23272 } 23273 23274 break; 23275 23276 case 0xFF52: 23277 length = (0, _util.readUint16)(data, position); 23278 var cod = {}; 23279 j = position + 2; 23280 var scod = data[j++]; 23281 cod.entropyCoderWithCustomPrecincts = !!(scod & 1); 23282 cod.sopMarkerUsed = !!(scod & 2); 23283 cod.ephMarkerUsed = !!(scod & 4); 23284 cod.progressionOrder = data[j++]; 23285 cod.layersCount = (0, _util.readUint16)(data, j); 23286 j += 2; 23287 cod.multipleComponentTransform = data[j++]; 23288 cod.decompositionLevelsCount = data[j++]; 23289 cod.xcb = (data[j++] & 0xF) + 2; 23290 cod.ycb = (data[j++] & 0xF) + 2; 23291 var blockStyle = data[j++]; 23292 cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1); 23293 cod.resetContextProbabilities = !!(blockStyle & 2); 23294 cod.terminationOnEachCodingPass = !!(blockStyle & 4); 23295 cod.verticallyStripe = !!(blockStyle & 8); 23296 cod.predictableTermination = !!(blockStyle & 16); 23297 cod.segmentationSymbolUsed = !!(blockStyle & 32); 23298 cod.reversibleTransformation = data[j++]; 23299 23300 if (cod.entropyCoderWithCustomPrecincts) { 23301 var precinctsSizes = []; 23302 23303 while (j < length + position) { 23304 var precinctsSize = data[j++]; 23305 precinctsSizes.push({ 23306 PPx: precinctsSize & 0xF, 23307 PPy: precinctsSize >> 4 23308 }); 23309 } 23310 23311 cod.precinctsSizes = precinctsSizes; 23312 } 23313 23314 var unsupported = []; 23315 23316 if (cod.selectiveArithmeticCodingBypass) { 23317 unsupported.push('selectiveArithmeticCodingBypass'); 23318 } 23319 23320 if (cod.resetContextProbabilities) { 23321 unsupported.push('resetContextProbabilities'); 23322 } 23323 23324 if (cod.terminationOnEachCodingPass) { 23325 unsupported.push('terminationOnEachCodingPass'); 23326 } 23327 23328 if (cod.verticallyStripe) { 23329 unsupported.push('verticallyStripe'); 23330 } 23331 23332 if (cod.predictableTermination) { 23333 unsupported.push('predictableTermination'); 23334 } 23335 23336 if (unsupported.length > 0) { 23337 doNotRecover = true; 23338 throw new Error('Unsupported COD options (' + unsupported.join(', ') + ')'); 23339 } 23340 23341 if (context.mainHeader) { 23342 context.COD = cod; 23343 } else { 23344 context.currentTile.COD = cod; 23345 context.currentTile.COC = []; 23346 } 23347 23348 break; 23349 23350 case 0xFF90: 23351 length = (0, _util.readUint16)(data, position); 23352 tile = {}; 23353 tile.index = (0, _util.readUint16)(data, position + 2); 23354 tile.length = (0, _util.readUint32)(data, position + 4); 23355 tile.dataEnd = tile.length + position - 2; 23356 tile.partIndex = data[position + 8]; 23357 tile.partsCount = data[position + 9]; 23358 context.mainHeader = false; 23359 23360 if (tile.partIndex === 0) { 23361 tile.COD = context.COD; 23362 tile.COC = context.COC.slice(0); 23363 tile.QCD = context.QCD; 23364 tile.QCC = context.QCC.slice(0); 23365 } 23366 23367 context.currentTile = tile; 23368 break; 23369 23370 case 0xFF93: 23371 tile = context.currentTile; 23372 23373 if (tile.partIndex === 0) { 23374 initializeTile(context, tile.index); 23375 buildPackets(context); 23376 } 23377 23378 length = tile.dataEnd - position; 23379 parseTilePackets(context, data, position, length); 23380 break; 23381 23382 case 0xFF55: 23383 case 0xFF57: 23384 case 0xFF58: 23385 case 0xFF64: 23386 length = (0, _util.readUint16)(data, position); 23387 break; 23388 23389 case 0xFF53: 23390 throw new Error('Codestream code 0xFF53 (COC) is ' + 'not implemented'); 23391 23392 default: 23393 throw new Error('Unknown codestream code: ' + code.toString(16)); 23394 } 23395 23396 position += length; 23397 } 23398 } catch (e) { 23399 if (doNotRecover || this.failOnCorruptedImage) { 23400 throw new JpxError(e.message); 23401 } else {
vendor: 6,092 bytes, lines 23402-23551
23402 (0, _util.warn)('JPX: Trying to recover from: ' + e.message); 23403 } 23404 } 23405 23406 this.tiles = transformComponents(context); 23407 this.width = context.SIZ.Xsiz - context.SIZ.XOsiz; 23408 this.height = context.SIZ.Ysiz - context.SIZ.YOsiz; 23409 this.componentsCount = context.SIZ.Csiz; 23410 } 23411 }; 23412 23413 function calculateComponentDimensions(component, siz) { 23414 component.x0 = Math.ceil(siz.XOsiz / component.XRsiz); 23415 component.x1 = Math.ceil(siz.Xsiz / component.XRsiz); 23416 component.y0 = Math.ceil(siz.YOsiz / component.YRsiz); 23417 component.y1 = Math.ceil(siz.Ysiz / component.YRsiz); 23418 component.width = component.x1 - component.x0; 23419 component.height = component.y1 - component.y0; 23420 } 23421 23422 function calculateTileGrids(context, components) { 23423 var siz = context.SIZ; 23424 var tile, 23425 tiles = []; 23426 var numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz); 23427 var numYtiles = Math.ceil((siz.Ysiz - siz.YTOsiz) / siz.YTsiz); 23428 23429 for (var q = 0; q < numYtiles; q++) { 23430 for (var p = 0; p < numXtiles; p++) { 23431 tile = {}; 23432 tile.tx0 = Math.max(siz.XTOsiz + p * siz.XTsiz, siz.XOsiz); 23433 tile.ty0 = Math.max(siz.YTOsiz + q * siz.YTsiz, siz.YOsiz); 23434 tile.tx1 = Math.min(siz.XTOsiz + (p + 1) * siz.XTsiz, siz.Xsiz); 23435 tile.ty1 = Math.min(siz.YTOsiz + (q + 1) * siz.YTsiz, siz.Ysiz); 23436 tile.width = tile.tx1 - tile.tx0; 23437 tile.height = tile.ty1 - tile.ty0; 23438 tile.components = []; 23439 tiles.push(tile); 23440 } 23441 } 23442 23443 context.tiles = tiles; 23444 var componentsCount = siz.Csiz; 23445 23446 for (var i = 0, ii = componentsCount; i < ii; i++) { 23447 var component = components[i]; 23448 23449 for (var j = 0, jj = tiles.length; j < jj; j++) { 23450 var tileComponent = {}; 23451 tile = tiles[j]; 23452 tileComponent.tcx0 = Math.ceil(tile.tx0 / component.XRsiz); 23453 tileComponent.tcy0 = Math.ceil(tile.ty0 / component.YRsiz); 23454 tileComponent.tcx1 = Math.ceil(tile.tx1 / component.XRsiz); 23455 tileComponent.tcy1 = Math.ceil(tile.ty1 / component.YRsiz); 23456 tileComponent.width = tileComponent.tcx1 - tileComponent.tcx0; 23457 tileComponent.height = tileComponent.tcy1 - tileComponent.tcy0; 23458 tile.components[i] = tileComponent; 23459 } 23460 } 23461 } 23462 23463 function getBlocksDimensions(context, component, r) { 23464 var codOrCoc = component.codingStyleParameters; 23465 var result = {}; 23466 23467 if (!codOrCoc.entropyCoderWithCustomPrecincts) { 23468 result.PPx = 15; 23469 result.PPy = 15; 23470 } else { 23471 result.PPx = codOrCoc.precinctsSizes[r].PPx; 23472 result.PPy = codOrCoc.precinctsSizes[r].PPy; 23473 } 23474 23475 result.xcb_ = r > 0 ? Math.min(codOrCoc.xcb, result.PPx - 1) : Math.min(codOrCoc.xcb, result.PPx); 23476 result.ycb_ = r > 0 ? Math.min(codOrCoc.ycb, result.PPy - 1) : Math.min(codOrCoc.ycb, result.PPy); 23477 return result; 23478 } 23479 23480 function buildPrecincts(context, resolution, dimensions) { 23481 var precinctWidth = 1 << dimensions.PPx; 23482 var precinctHeight = 1 << dimensions.PPy; 23483 var isZeroRes = resolution.resLevel === 0; 23484 var precinctWidthInSubband = 1 << dimensions.PPx + (isZeroRes ? 0 : -1); 23485 var precinctHeightInSubband = 1 << dimensions.PPy + (isZeroRes ? 0 : -1); 23486 var numprecinctswide = resolution.trx1 > resolution.trx0 ? Math.ceil(resolution.trx1 / precinctWidth) - Math.floor(resolution.trx0 / precinctWidth) : 0; 23487 var numprecinctshigh = resolution.try1 > resolution.try0 ? Math.ceil(resolution.try1 / precinctHeight) - Math.floor(resolution.try0 / precinctHeight) : 0; 23488 var numprecincts = numprecinctswide * numprecinctshigh; 23489 resolution.precinctParameters = { 23490 precinctWidth: precinctWidth, 23491 precinctHeight: precinctHeight, 23492 numprecinctswide: numprecinctswide, 23493 numprecinctshigh: numprecinctshigh, 23494 numprecincts: numprecincts, 23495 precinctWidthInSubband: precinctWidthInSubband, 23496 precinctHeightInSubband: precinctHeightInSubband 23497 }; 23498 } 23499 23500 function buildCodeblocks(context, subband, dimensions) { 23501 var xcb_ = dimensions.xcb_; 23502 var ycb_ = dimensions.ycb_; 23503 var codeblockWidth = 1 << xcb_; 23504 var codeblockHeight = 1 << ycb_; 23505 var cbx0 = subband.tbx0 >> xcb_; 23506 var cby0 = subband.tby0 >> ycb_; 23507 var cbx1 = subband.tbx1 + codeblockWidth - 1 >> xcb_; 23508 var cby1 = subband.tby1 + codeblockHeight - 1 >> ycb_; 23509 var precinctParameters = subband.resolution.precinctParameters; 23510 var codeblocks = []; 23511 var precincts = []; 23512 var i, j, codeblock, precinctNumber; 23513 23514 for (j = cby0; j < cby1; j++) { 23515 for (i = cbx0; i < cbx1; i++) { 23516 codeblock = { 23517 cbx: i, 23518 cby: j, 23519 tbx0: codeblockWidth * i, 23520 tby0: codeblockHeight * j, 23521 tbx1: codeblockWidth * (i + 1), 23522 tby1: codeblockHeight * (j + 1) 23523 }; 23524 codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0); 23525 codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0); 23526 codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1); 23527 codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1); 23528 var pi = Math.floor((codeblock.tbx0_ - subband.tbx0) / precinctParameters.precinctWidthInSubband); 23529 var pj = Math.floor((codeblock.tby0_ - subband.tby0) / precinctParameters.precinctHeightInSubband); 23530 precinctNumber = pi + pj * precinctParameters.numprecinctswide; 23531 codeblock.precinctNumber = precinctNumber; 23532 codeblock.subbandType = subband.type; 23533 codeblock.Lblock = 3; 23534 23535 if (codeblock.tbx1_ <= codeblock.tbx0_ || codeblock.tby1_ <= codeblock.tby0_) { 23536 continue; 23537 } 23538 23539 codeblocks.push(codeblock); 23540 var precinct = precincts[precinctNumber]; 23541 23542 if (precinct !== undefined) { 23543 if (i < precinct.cbxMin) { 23544 precinct.cbxMin = i; 23545 } else if (i > precinct.cbxMax) { 23546 precinct.cbxMax = i; 23547 } 23548 23549 if (j < precinct.cbyMin) { 23550 precinct.cbxMin = j; 23551 } else if (j >
vendor: 26,231 bytes, lines 23551-24379
23551 precinct.cbyMax) { 23552 precinct.cbyMax = j; 23553 } 23554 } else { 23555 precincts[precinctNumber] = precinct = { 23556 cbxMin: i, 23557 cbyMin: j, 23558 cbxMax: i, 23559 cbyMax: j 23560 }; 23561 } 23562 23563 codeblock.precinct = precinct; 23564 } 23565 } 23566 23567 subband.codeblockParameters = { 23568 codeblockWidth: xcb_, 23569 codeblockHeight: ycb_, 23570 numcodeblockwide: cbx1 - cbx0 + 1, 23571 numcodeblockhigh: cby1 - cby0 + 1 23572 }; 23573 subband.codeblocks = codeblocks; 23574 subband.precincts = precincts; 23575 } 23576 23577 function createPacket(resolution, precinctNumber, layerNumber) { 23578 var precinctCodeblocks = []; 23579 var subbands = resolution.subbands; 23580 23581 for (var i = 0, ii = subbands.length; i < ii; i++) { 23582 var subband = subbands[i]; 23583 var codeblocks = subband.codeblocks; 23584 23585 for (var j = 0, jj = codeblocks.length; j < jj; j++) { 23586 var codeblock = codeblocks[j]; 23587 23588 if (codeblock.precinctNumber !== precinctNumber) { 23589 continue; 23590 } 23591 23592 precinctCodeblocks.push(codeblock); 23593 } 23594 } 23595 23596 return { 23597 layerNumber: layerNumber, 23598 codeblocks: precinctCodeblocks 23599 }; 23600 } 23601 23602 function LayerResolutionComponentPositionIterator(context) { 23603 var siz = context.SIZ; 23604 var tileIndex = context.currentTile.index; 23605 var tile = context.tiles[tileIndex]; 23606 var layersCount = tile.codingStyleDefaultParameters.layersCount; 23607 var componentsCount = siz.Csiz; 23608 var maxDecompositionLevelsCount = 0; 23609 23610 for (var q = 0; q < componentsCount; q++) { 23611 maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, tile.components[q].codingStyleParameters.decompositionLevelsCount); 23612 } 23613 23614 var l = 0, 23615 r = 0, 23616 i = 0, 23617 k = 0; 23618 23619 this.nextPacket = function JpxImage_nextPacket() { 23620 for (; l < layersCount; l++) { 23621 for (; r <= maxDecompositionLevelsCount; r++) { 23622 for (; i < componentsCount; i++) { 23623 var component = tile.components[i]; 23624 23625 if (r > component.codingStyleParameters.decompositionLevelsCount) { 23626 continue; 23627 } 23628 23629 var resolution = component.resolutions[r]; 23630 var numprecincts = resolution.precinctParameters.numprecincts; 23631 23632 for (; k < numprecincts;) { 23633 var packet = createPacket(resolution, k, l); 23634 k++; 23635 return packet; 23636 } 23637 23638 k = 0; 23639 } 23640 23641 i = 0; 23642 } 23643 23644 r = 0; 23645 } 23646 23647 throw new JpxError('Out of packets'); 23648 }; 23649 } 23650 23651 function ResolutionLayerComponentPositionIterator(context) { 23652 var siz = context.SIZ; 23653 var tileIndex = context.currentTile.index; 23654 var tile = context.tiles[tileIndex]; 23655 var layersCount = tile.codingStyleDefaultParameters.layersCount; 23656 var componentsCount = siz.Csiz; 23657 var maxDecompositionLevelsCount = 0; 23658 23659 for (var q = 0; q < componentsCount; q++) { 23660 maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, tile.components[q].codingStyleParameters.decompositionLevelsCount); 23661 } 23662 23663 var r = 0, 23664 l = 0, 23665 i = 0, 23666 k = 0; 23667 23668 this.nextPacket = function JpxImage_nextPacket() { 23669 for (; r <= maxDecompositionLevelsCount; r++) { 23670 for (; l < layersCount; l++) { 23671 for (; i < componentsCount; i++) { 23672 var component = tile.components[i]; 23673 23674 if (r > component.codingStyleParameters.decompositionLevelsCount) { 23675 continue; 23676 } 23677 23678 var resolution = component.resolutions[r]; 23679 var numprecincts = resolution.precinctParameters.numprecincts; 23680 23681 for (; k < numprecincts;) { 23682 var packet = createPacket(resolution, k, l); 23683 k++; 23684 return packet; 23685 } 23686 23687 k = 0; 23688 } 23689 23690 i = 0; 23691 } 23692 23693 l = 0; 23694 } 23695 23696 throw new JpxError('Out of packets'); 23697 }; 23698 } 23699 23700 function ResolutionPositionComponentLayerIterator(context) { 23701 var siz = context.SIZ; 23702 var tileIndex = context.currentTile.index; 23703 var tile = context.tiles[tileIndex]; 23704 var layersCount = tile.codingStyleDefaultParameters.layersCount; 23705 var componentsCount = siz.Csiz; 23706 var l, r, c, p; 23707 var maxDecompositionLevelsCount = 0; 23708 23709 for (c = 0; c < componentsCount; c++) { 23710 var component = tile.components[c]; 23711 maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, component.codingStyleParameters.decompositionLevelsCount); 23712 } 23713 23714 var maxNumPrecinctsInLevel = new Int32Array(maxDecompositionLevelsCount + 1); 23715 23716 for (r = 0; r <= maxDecompositionLevelsCount; ++r) { 23717 var maxNumPrecincts = 0; 23718 23719 for (c = 0; c < componentsCount; ++c) { 23720 var resolutions = tile.components[c].resolutions; 23721 23722 if (r < resolutions.length) { 23723 maxNumPrecincts = Math.max(maxNumPrecincts, resolutions[r].precinctParameters.numprecincts); 23724 } 23725 } 23726 23727 maxNumPrecinctsInLevel[r] = maxNumPrecincts; 23728 } 23729 23730 l = 0; 23731 r = 0; 23732 c = 0; 23733 p = 0; 23734 23735 this.nextPacket = function JpxImage_nextPacket() { 23736 for (; r <= maxDecompositionLevelsCount; r++) { 23737 for (; p < maxNumPrecinctsInLevel[r]; p++) { 23738 for (; c < componentsCount; c++) { 23739 var component = tile.components[c]; 23740 23741 if (r > component.codingStyleParameters.decompositionLevelsCount) { 23742 continue; 23743 } 23744 23745 var resolution = component.resolutions[r]; 23746 var numprecincts = resolution.precinctParameters.numprecincts; 23747 23748 if (p >= numprecincts) { 23749 continue; 23750 } 23751 23752 for (; l < layersCount;) { 23753 var packet = createPacket(resolution, p, l); 23754 l++; 23755 return packet; 23756 } 23757 23758 l = 0; 23759 } 23760 23761 c = 0; 23762 } 23763 23764 p = 0; 23765 } 23766 23767 throw new JpxError('Out of packets'); 23768 }; 23769 } 23770 23771 function PositionComponentResolutionLayerIterator(context) { 23772 var siz = context.SIZ; 23773 var tileIndex = context.currentTile.index; 23774 var tile = context.tiles[tileIndex]; 23775 var layersCount = tile.codingStyleDefaultParameters.layersCount; 23776 var componentsCount = siz.Csiz; 23777 var precinctsSizes = getPrecinctSizesInImageScale(tile); 23778 var precinctsIterationSizes = precinctsSizes; 23779 var l = 0, 23780 r = 0, 23781 c = 0, 23782 px = 0, 23783 py = 0; 23784 23785 this.nextPacket = function JpxImage_nextPacket() { 23786 for (; py < precinctsIterationSizes.maxNumHigh; py++) { 23787 for (; px < precinctsIterationSizes.maxNumWide; px++) { 23788 for (; c < componentsCount; c++) { 23789 var component = tile.components[c]; 23790 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 23791 23792 for (; r <= decompositionLevelsCount; r++) { 23793 var resolution = component.resolutions[r]; 23794 var sizeInImageScale = precinctsSizes.components[c].resolutions[r]; 23795 var k = getPrecinctIndexIfExist(px, py, sizeInImageScale, precinctsIterationSizes, resolution); 23796 23797 if (k === null) { 23798 continue; 23799 } 23800 23801 for (; l < layersCount;) { 23802 var packet = createPacket(resolution, k, l); 23803 l++; 23804 return packet; 23805 } 23806 23807 l = 0; 23808 } 23809 23810 r = 0; 23811 } 23812 23813 c = 0; 23814 } 23815 23816 px = 0; 23817 } 23818 23819 throw new JpxError('Out of packets'); 23820 }; 23821 } 23822 23823 function ComponentPositionResolutionLayerIterator(context) { 23824 var siz = context.SIZ; 23825 var tileIndex = context.currentTile.index; 23826 var tile = context.tiles[tileIndex]; 23827 var layersCount = tile.codingStyleDefaultParameters.layersCount; 23828 var componentsCount = siz.Csiz; 23829 var precinctsSizes = getPrecinctSizesInImageScale(tile); 23830 var l = 0, 23831 r = 0, 23832 c = 0, 23833 px = 0, 23834 py = 0; 23835 23836 this.nextPacket = function JpxImage_nextPacket() { 23837 for (; c < componentsCount; ++c) { 23838 var component = tile.components[c]; 23839 var precinctsIterationSizes = precinctsSizes.components[c]; 23840 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 23841 23842 for (; py < precinctsIterationSizes.maxNumHigh; py++) { 23843 for (; px < precinctsIterationSizes.maxNumWide; px++) { 23844 for (; r <= decompositionLevelsCount; r++) { 23845 var resolution = component.resolutions[r]; 23846 var sizeInImageScale = precinctsIterationSizes.resolutions[r]; 23847 var k = getPrecinctIndexIfExist(px, py, sizeInImageScale, precinctsIterationSizes, resolution); 23848 23849 if (k === null) { 23850 continue; 23851 } 23852 23853 for (; l < layersCount;) { 23854 var packet = createPacket(resolution, k, l); 23855 l++; 23856 return packet; 23857 } 23858 23859 l = 0; 23860 } 23861 23862 r = 0; 23863 } 23864 23865 px = 0; 23866 } 23867 23868 py = 0; 23869 } 23870 23871 throw new JpxError('Out of packets'); 23872 }; 23873 } 23874 23875 function getPrecinctIndexIfExist(pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) { 23876 var posX = pxIndex * precinctIterationSizes.minWidth; 23877 var posY = pyIndex * precinctIterationSizes.minHeight; 23878 23879 if (posX % sizeInImageScale.width !== 0 || posY % sizeInImageScale.height !== 0) { 23880 return null; 23881 } 23882 23883 var startPrecinctRowIndex = posY / sizeInImageScale.width * resolution.precinctParameters.numprecinctswide; 23884 return posX / sizeInImageScale.height + startPrecinctRowIndex; 23885 } 23886 23887 function getPrecinctSizesInImageScale(tile) { 23888 var componentsCount = tile.components.length; 23889 var minWidth = Number.MAX_VALUE; 23890 var minHeight = Number.MAX_VALUE; 23891 var maxNumWide = 0; 23892 var maxNumHigh = 0; 23893 var sizePerComponent = new Array(componentsCount); 23894 23895 for (var c = 0; c < componentsCount; c++) { 23896 var component = tile.components[c]; 23897 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 23898 var sizePerResolution = new Array(decompositionLevelsCount + 1); 23899 var minWidthCurrentComponent = Number.MAX_VALUE; 23900 var minHeightCurrentComponent = Number.MAX_VALUE; 23901 var maxNumWideCurrentComponent = 0; 23902 var maxNumHighCurrentComponent = 0; 23903 var scale = 1; 23904 23905 for (var r = decompositionLevelsCount; r >= 0; --r) { 23906 var resolution = component.resolutions[r]; 23907 var widthCurrentResolution = scale * resolution.precinctParameters.precinctWidth; 23908 var heightCurrentResolution = scale * resolution.precinctParameters.precinctHeight; 23909 minWidthCurrentComponent = Math.min(minWidthCurrentComponent, widthCurrentResolution); 23910 minHeightCurrentComponent = Math.min(minHeightCurrentComponent, heightCurrentResolution); 23911 maxNumWideCurrentComponent = Math.max(maxNumWideCurrentComponent, resolution.precinctParameters.numprecinctswide); 23912 maxNumHighCurrentComponent = Math.max(maxNumHighCurrentComponent, resolution.precinctParameters.numprecinctshigh); 23913 sizePerResolution[r] = { 23914 width: widthCurrentResolution, 23915 height: heightCurrentResolution 23916 }; 23917 scale <<= 1; 23918 } 23919 23920 minWidth = Math.min(minWidth, minWidthCurrentComponent); 23921 minHeight = Math.min(minHeight, minHeightCurrentComponent); 23922 maxNumWide = Math.max(maxNumWide, maxNumWideCurrentComponent); 23923 maxNumHigh = Math.max(maxNumHigh, maxNumHighCurrentComponent); 23924 sizePerComponent[c] = { 23925 resolutions: sizePerResolution, 23926 minWidth: minWidthCurrentComponent, 23927 minHeight: minHeightCurrentComponent, 23928 maxNumWide: maxNumWideCurrentComponent, 23929 maxNumHigh: maxNumHighCurrentComponent 23930 }; 23931 } 23932 23933 return { 23934 components: sizePerComponent, 23935 minWidth: minWidth, 23936 minHeight: minHeight, 23937 maxNumWide: maxNumWide, 23938 maxNumHigh: maxNumHigh 23939 }; 23940 } 23941 23942 function buildPackets(context) { 23943 var siz = context.SIZ; 23944 var tileIndex = context.currentTile.index; 23945 var tile = context.tiles[tileIndex]; 23946 var componentsCount = siz.Csiz; 23947 23948 for (var c = 0; c < componentsCount; c++) { 23949 var component = tile.components[c]; 23950 var decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; 23951 var resolutions = []; 23952 var subbands = []; 23953 23954 for (var r = 0; r <= decompositionLevelsCount; r++) { 23955 var blocksDimensions = getBlocksDimensions(context, component, r); 23956 var resolution = {}; 23957 var scale = 1 << decompositionLevelsCount - r; 23958 resolution.trx0 = Math.ceil(component.tcx0 / scale); 23959 resolution.try0 = Math.ceil(component.tcy0 / scale); 23960 resolution.trx1 = Math.ceil(component.tcx1 / scale); 23961 resolution.try1 = Math.ceil(component.tcy1 / scale); 23962 resolution.resLevel = r; 23963 buildPrecincts(context, resolution, blocksDimensions); 23964 resolutions.push(resolution); 23965 var subband; 23966 23967 if (r === 0) { 23968 subband = {}; 23969 subband.type = 'LL'; 23970 subband.tbx0 = Math.ceil(component.tcx0 / scale); 23971 subband.tby0 = Math.ceil(component.tcy0 / scale); 23972 subband.tbx1 = Math.ceil(component.tcx1 / scale); 23973 subband.tby1 = Math.ceil(component.tcy1 / scale); 23974 subband.resolution = resolution; 23975 buildCodeblocks(context, subband, blocksDimensions); 23976 subbands.push(subband); 23977 resolution.subbands = [subband]; 23978 } else { 23979 var bscale = 1 << decompositionLevelsCount - r + 1; 23980 var resolutionSubbands = []; 23981 subband = {}; 23982 subband.type = 'HL'; 23983 subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); 23984 subband.tby0 = Math.ceil(component.tcy0 / bscale); 23985 subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); 23986 subband.tby1 = Math.ceil(component.tcy1 / bscale); 23987 subband.resolution = resolution; 23988 buildCodeblocks(context, subband, blocksDimensions); 23989 subbands.push(subband); 23990 resolutionSubbands.push(subband); 23991 subband = {}; 23992 subband.type = 'LH'; 23993 subband.tbx0 = Math.ceil(component.tcx0 / bscale); 23994 subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); 23995 subband.tbx1 = Math.ceil(component.tcx1 / bscale); 23996 subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); 23997 subband.resolution = resolution; 23998 buildCodeblocks(context, subband, blocksDimensions); 23999 subbands.push(subband); 24000 resolutionSubbands.push(subband); 24001 subband = {}; 24002 subband.type = 'HH'; 24003 subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); 24004 subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); 24005 subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); 24006 subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); 24007 subband.resolution = resolution; 24008 buildCodeblocks(context, subband, blocksDimensions); 24009 subbands.push(subband); 24010 resolutionSubbands.push(subband); 24011 resolution.subbands = resolutionSubbands; 24012 } 24013 } 24014 24015 component.resolutions = resolutions; 24016 component.subbands = subbands; 24017 } 24018 24019 var progressionOrder = tile.codingStyleDefaultParameters.progressionOrder; 24020 24021 switch (progressionOrder) { 24022 case 0: 24023 tile.packetsIterator = new LayerResolutionComponentPositionIterator(context); 24024 break; 24025 24026 case 1: 24027 tile.packetsIterator = new ResolutionLayerComponentPositionIterator(context); 24028 break; 24029 24030 case 2: 24031 tile.packetsIterator = new ResolutionPositionComponentLayerIterator(context); 24032 break; 24033 24034 case 3: 24035 tile.packetsIterator = new PositionComponentResolutionLayerIterator(context); 24036 break; 24037 24038 case 4: 24039 tile.packetsIterator = new ComponentPositionResolutionLayerIterator(context); 24040 break; 24041 24042 default: 24043 throw new JpxError("Unsupported progression order ".concat(progressionOrder)); 24044 } 24045 } 24046 24047 function parseTilePackets(context, data, offset, dataLength) { 24048 var position = 0; 24049 var buffer, 24050 bufferSize = 0, 24051 skipNextBit = false; 24052 24053 function readBits(count) { 24054 while (bufferSize < count) { 24055 var b = data[offset + position]; 24056 position++; 24057 24058 if (skipNextBit) { 24059 buffer = buffer << 7 | b; 24060 bufferSize += 7; 24061 skipNextBit = false; 24062 } else { 24063 buffer = buffer << 8 | b; 24064 bufferSize += 8; 24065 } 24066 24067 if (b === 0xFF) { 24068 skipNextBit = true; 24069 } 24070 } 24071 24072 bufferSize -= count; 24073 return buffer >>> bufferSize & (1 << count) - 1; 24074 } 24075 24076 function skipMarkerIfEqual(value) { 24077 if (data[offset + position - 1] === 0xFF && data[offset + position] === value) { 24078 skipBytes(1); 24079 return true; 24080 } else if (data[offset + position] === 0xFF && data[offset + position + 1] === value) { 24081 skipBytes(2); 24082 return true; 24083 } 24084 24085 return false; 24086 } 24087 24088 function skipBytes(count) { 24089 position += count; 24090 } 24091 24092 function alignToByte() { 24093 bufferSize = 0; 24094 24095 if (skipNextBit) { 24096 position++; 24097 skipNextBit = false; 24098 } 24099 } 24100 24101 function readCodingpasses() { 24102 if (readBits(1) === 0) { 24103 return 1; 24104 } 24105 24106 if (readBits(1) === 0) { 24107 return 2; 24108 } 24109 24110 var value = readBits(2); 24111 24112 if (value < 3) { 24113 return value + 3; 24114 } 24115 24116 value = readBits(5); 24117 24118 if (value < 31) { 24119 return value + 6; 24120 } 24121 24122 value = readBits(7); 24123 return value + 37; 24124 } 24125 24126 var tileIndex = context.currentTile.index; 24127 var tile = context.tiles[tileIndex]; 24128 var sopMarkerUsed = context.COD.sopMarkerUsed; 24129 var ephMarkerUsed = context.COD.ephMarkerUsed; 24130 var packetsIterator = tile.packetsIterator; 24131 24132 while (position < dataLength) { 24133 alignToByte(); 24134 24135 if (sopMarkerUsed && skipMarkerIfEqual(0x91)) { 24136 skipBytes(4); 24137 } 24138 24139 var packet = packetsIterator.nextPacket(); 24140 24141 if (!readBits(1)) { 24142 continue; 24143 } 24144 24145 var layerNumber = packet.layerNumber; 24146 var queue = [], 24147 codeblock; 24148 24149 for (var i = 0, ii = packet.codeblocks.length; i < ii; i++) { 24150 codeblock = packet.codeblocks[i]; 24151 var precinct = codeblock.precinct; 24152 var codeblockColumn = codeblock.cbx - precinct.cbxMin; 24153 var codeblockRow = codeblock.cby - precinct.cbyMin; 24154 var codeblockIncluded = false; 24155 var firstTimeInclusion = false; 24156 var valueReady; 24157 24158 if (codeblock['included'] !== undefined) { 24159 codeblockIncluded = !!readBits(1); 24160 } else { 24161 precinct = codeblock.precinct; 24162 var inclusionTree, zeroBitPlanesTree; 24163 24164 if (precinct['inclusionTree'] !== undefined) { 24165 inclusionTree = precinct.inclusionTree; 24166 } else { 24167 var width = precinct.cbxMax - precinct.cbxMin + 1; 24168 var height = precinct.cbyMax - precinct.cbyMin + 1; 24169 inclusionTree = new InclusionTree(width, height, layerNumber); 24170 zeroBitPlanesTree = new TagTree(width, height); 24171 precinct.inclusionTree = inclusionTree; 24172 precinct.zeroBitPlanesTree = zeroBitPlanesTree; 24173 } 24174 24175 if (inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber)) { 24176 while (true) { 24177 if (readBits(1)) { 24178 valueReady = !inclusionTree.nextLevel(); 24179 24180 if (valueReady) { 24181 codeblock.included = true; 24182 codeblockIncluded = firstTimeInclusion = true; 24183 break; 24184 } 24185 } else { 24186 inclusionTree.incrementValue(layerNumber); 24187 break; 24188 } 24189 } 24190 } 24191 } 24192 24193 if (!codeblockIncluded) { 24194 continue; 24195 } 24196 24197 if (firstTimeInclusion) { 24198 zeroBitPlanesTree = precinct.zeroBitPlanesTree; 24199 zeroBitPlanesTree.reset(codeblockColumn, codeblockRow); 24200 24201 while (true) { 24202 if (readBits(1)) { 24203 valueReady = !zeroBitPlanesTree.nextLevel(); 24204 24205 if (valueReady) { 24206 break; 24207 } 24208 } else { 24209 zeroBitPlanesTree.incrementValue(); 24210 } 24211 } 24212 24213 codeblock.zeroBitPlanes = zeroBitPlanesTree.value; 24214 } 24215 24216 var codingpasses = readCodingpasses(); 24217 24218 while (readBits(1)) { 24219 codeblock.Lblock++; 24220 } 24221 24222 var codingpassesLog2 = (0, _util.log2)(codingpasses); 24223 var bits = (codingpasses < 1 << codingpassesLog2 ? codingpassesLog2 - 1 : codingpassesLog2) + codeblock.Lblock; 24224 var codedDataLength = readBits(bits); 24225 queue.push({ 24226 codeblock: codeblock, 24227 codingpasses: codingpasses, 24228 dataLength: codedDataLength 24229 }); 24230 } 24231 24232 alignToByte(); 24233 24234 if (ephMarkerUsed) { 24235 skipMarkerIfEqual(0x92); 24236 } 24237 24238 while (queue.length > 0) { 24239 var packetItem = queue.shift(); 24240 codeblock = packetItem.codeblock; 24241 24242 if (codeblock['data'] === undefined) { 24243 codeblock.data = []; 24244 } 24245 24246 codeblock.data.push({ 24247 data: data, 24248 start: offset + position, 24249 end: offset + position + packetItem.dataLength, 24250 codingpasses: packetItem.codingpasses 24251 }); 24252 position += packetItem.dataLength; 24253 } 24254 } 24255 24256 return position; 24257 } 24258 24259 function copyCoefficients(coefficients, levelWidth, levelHeight, subband, delta, mb, reversible, segmentationSymbolUsed) { 24260 var x0 = subband.tbx0; 24261 var y0 = subband.tby0; 24262 var width = subband.tbx1 - subband.tbx0; 24263 var codeblocks = subband.codeblocks; 24264 var right = subband.type.charAt(0) === 'H' ? 1 : 0; 24265 var bottom = subband.type.charAt(1) === 'H' ? levelWidth : 0; 24266 24267 for (var i = 0, ii = codeblocks.length; i < ii; ++i) { 24268 var codeblock = codeblocks[i]; 24269 var blockWidth = codeblock.tbx1_ - codeblock.tbx0_; 24270 var blockHeight = codeblock.tby1_ - codeblock.tby0_; 24271 24272 if (blockWidth === 0 || blockHeight === 0) { 24273 continue; 24274 } 24275 24276 if (codeblock['data'] === undefined) { 24277 continue; 24278 } 24279 24280 var bitModel, currentCodingpassType; 24281 bitModel = new BitModel(blockWidth, blockHeight, codeblock.subbandType, codeblock.zeroBitPlanes, mb); 24282 currentCodingpassType = 2; 24283 var data = codeblock.data, 24284 totalLength = 0, 24285 codingpasses = 0; 24286 var j, jj, dataItem; 24287 24288 for (j = 0, jj = data.length; j < jj; j++) { 24289 dataItem = data[j]; 24290 totalLength += dataItem.end - dataItem.start; 24291 codingpasses += dataItem.codingpasses; 24292 } 24293 24294 var encodedData = new Uint8Array(totalLength); 24295 var position = 0; 24296 24297 for (j = 0, jj = data.length; j < jj; j++) { 24298 dataItem = data[j]; 24299 var chunk = dataItem.data.subarray(dataItem.start, dataItem.end); 24300 encodedData.set(chunk, position); 24301 position += chunk.length; 24302 } 24303 24304 var decoder = new _arithmetic_decoder.ArithmeticDecoder(encodedData, 0, totalLength); 24305 bitModel.setDecoder(decoder); 24306 24307 for (j = 0; j < codingpasses; j++) { 24308 switch (currentCodingpassType) { 24309 case 0: 24310 bitModel.runSignificancePropagationPass(); 24311 break; 24312 24313 case 1: 24314 bitModel.runMagnitudeRefinementPass(); 24315 break; 24316 24317 case 2: 24318 bitModel.runCleanupPass(); 24319 24320 if (segmentationSymbolUsed) { 24321 bitModel.checkSegmentationSymbol(); 24322 } 24323 24324 break; 24325 } 24326 24327 currentCodingpassType = (currentCodingpassType + 1) % 3; 24328 } 24329 24330 var offset = codeblock.tbx0_ - x0 + (codeblock.tby0_ - y0) * width; 24331 var sign = bitModel.coefficentsSign; 24332 var magnitude = bitModel.coefficentsMagnitude; 24333 var bitsDecoded = bitModel.bitsDecoded; 24334 var magnitudeCorrection = reversible ? 0 : 0.5; 24335 var k, n, nb; 24336 position = 0; 24337 var interleave = subband.type !== 'LL'; 24338 24339 for (j = 0; j < blockHeight; j++) { 24340 var row = offset / width | 0; 24341 var levelOffset = 2 * row * (levelWidth - width) + right + bottom; 24342 24343 for (k = 0; k < blockWidth; k++) { 24344 n = magnitude[position]; 24345 24346 if (n !== 0) { 24347 n = (n + magnitudeCorrection) * delta; 24348 24349 if (sign[position] !== 0) { 24350 n = -n; 24351 } 24352 24353 nb = bitsDecoded[position]; 24354 var pos = interleave ? levelOffset + (offset << 1) : offset; 24355 24356 if (reversible && nb >= mb) { 24357 coefficients[pos] = n; 24358 } else { 24359 coefficients[pos] = n * (1 << mb - nb); 24360 } 24361 } 24362 24363 offset++; 24364 position++; 24365 } 24366 24367 offset += width - blockWidth; 24368 } 24369 } 24370 } 24371 24372 function transformTile(context, tile, c) { 24373 var component = tile.components[c]; 24374 var codingStyleParameters = component.codingStyleParameters; 24375 var quantizationParameters = component.quantizationParameters; 24376 var decompositionLevelsCount = codingStyleParameters.decompositionLevelsCount; 24377 var spqcds = quantizationParameters.SPqcds; 24378 var scalarExpounded = quantizationParameters.scalarExpounded; 24379 var guardBits = quantizationParameters.guardBits;
vendor: 5,649 bytes, lines 24380-24546
24380 var segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed; 24381 var precision = context.components[c].precision; 24382 var reversible = codingStyleParameters.reversibleTransformation; 24383 var transform = reversible ? new ReversibleTransform() : new IrreversibleTransform(); 24384 var subbandCoefficients = []; 24385 var b = 0; 24386 24387 for (var i = 0; i <= decompositionLevelsCount; i++) { 24388 var resolution = component.resolutions[i]; 24389 var width = resolution.trx1 - resolution.trx0; 24390 var height = resolution.try1 - resolution.try0; 24391 var coefficients = new Float32Array(width * height); 24392 24393 for (var j = 0, jj = resolution.subbands.length; j < jj; j++) { 24394 var mu, epsilon; 24395 24396 if (!scalarExpounded) { 24397 mu = spqcds[0].mu; 24398 epsilon = spqcds[0].epsilon + (i > 0 ? 1 - i : 0); 24399 } else { 24400 mu = spqcds[b].mu; 24401 epsilon = spqcds[b].epsilon; 24402 b++; 24403 } 24404 24405 var subband = resolution.subbands[j]; 24406 var gainLog2 = SubbandsGainLog2[subband.type]; 24407 var delta = reversible ? 1 : Math.pow(2, precision + gainLog2 - epsilon) * (1 + mu / 2048); 24408 var mb = guardBits + epsilon - 1; 24409 copyCoefficients(coefficients, width, height, subband, delta, mb, reversible, segmentationSymbolUsed); 24410 } 24411 24412 subbandCoefficients.push({ 24413 width: width, 24414 height: height, 24415 items: coefficients 24416 }); 24417 } 24418 24419 var result = transform.calculate(subbandCoefficients, component.tcx0, component.tcy0); 24420 return { 24421 left: component.tcx0, 24422 top: component.tcy0, 24423 width: result.width, 24424 height: result.height, 24425 items: result.items 24426 }; 24427 } 24428 24429 function transformComponents(context) { 24430 var siz = context.SIZ; 24431 var components = context.components; 24432 var componentsCount = siz.Csiz; 24433 var resultImages = []; 24434 24435 for (var i = 0, ii = context.tiles.length; i < ii; i++) { 24436 var tile = context.tiles[i]; 24437 var transformedTiles = []; 24438 var c; 24439 24440 for (c = 0; c < componentsCount; c++) { 24441 transformedTiles[c] = transformTile(context, tile, c); 24442 } 24443 24444 var tile0 = transformedTiles[0]; 24445 var out = new Uint8ClampedArray(tile0.items.length * componentsCount); 24446 var result = { 24447 left: tile0.left, 24448 top: tile0.top, 24449 width: tile0.width, 24450 height: tile0.height, 24451 items: out 24452 }; 24453 var shift, offset; 24454 var pos = 0, 24455 j, 24456 jj, 24457 y0, 24458 y1, 24459 y2; 24460 24461 if (tile.codingStyleDefaultParameters.multipleComponentTransform) { 24462 var fourComponents = componentsCount === 4; 24463 var y0items = transformedTiles[0].items; 24464 var y1items = transformedTiles[1].items; 24465 var y2items = transformedTiles[2].items; 24466 var y3items = fourComponents ? transformedTiles[3].items : null; 24467 shift = components[0].precision - 8; 24468 offset = (128 << shift) + 0.5; 24469 var component0 = tile.components[0]; 24470 var alpha01 = componentsCount - 3; 24471 jj = y0items.length; 24472 24473 if (!component0.codingStyleParameters.reversibleTransformation) { 24474 for (j = 0; j < jj; j++, pos += alpha01) { 24475 y0 = y0items[j] + offset; 24476 y1 = y1items[j]; 24477 y2 = y2items[j]; 24478 out[pos++] = y0 + 1.402 * y2 >> shift; 24479 out[pos++] = y0 - 0.34413 * y1 - 0.71414 * y2 >> shift; 24480 out[pos++] = y0 + 1.772 * y1 >> shift; 24481 } 24482 } else { 24483 for (j = 0; j < jj; j++, pos += alpha01) { 24484 y0 = y0items[j] + offset; 24485 y1 = y1items[j]; 24486 y2 = y2items[j]; 24487 var g = y0 - (y2 + y1 >> 2); 24488 out[pos++] = g + y2 >> shift; 24489 out[pos++] = g >> shift; 24490 out[pos++] = g + y1 >> shift; 24491 } 24492 } 24493 24494 if (fourComponents) { 24495 for (j = 0, pos = 3; j < jj; j++, pos += 4) { 24496 out[pos] = y3items[j] + offset >> shift; 24497 } 24498 } 24499 } else { 24500 for (c = 0; c < componentsCount; c++) { 24501 var items = transformedTiles[c].items; 24502 shift = components[c].precision - 8; 24503 offset = (128 << shift) + 0.5; 24504 24505 for (pos = c, j = 0, jj = items.length; j < jj; j++) { 24506 out[pos] = items[j] + offset >> shift; 24507 pos += componentsCount; 24508 } 24509 } 24510 } 24511 24512 resultImages.push(result); 24513 } 24514 24515 return resultImages; 24516 } 24517 24518 function initializeTile(context, tileIndex) { 24519 var siz = context.SIZ; 24520 var componentsCount = siz.Csiz; 24521 var tile = context.tiles[tileIndex]; 24522 24523 for (var c = 0; c < componentsCount; c++) { 24524 var component = tile.components[c]; 24525 var qcdOrQcc = context.currentTile.QCC[c] !== undefined ? context.currentTile.QCC[c] : context.currentTile.QCD; 24526 component.quantizationParameters = qcdOrQcc; 24527 var codOrCoc = context.currentTile.COC[c] !== undefined ? context.currentTile.COC[c] : context.currentTile.COD; 24528 component.codingStyleParameters = codOrCoc; 24529 } 24530 24531 tile.codingStyleDefaultParameters = context.currentTile.COD; 24532 } 24533 24534 var TagTree = function TagTreeClosure() { 24535 function TagTree(width, height) { 24536 var levelsLength = (0, _util.log2)(Math.max(width, height)) + 1; 24537 this.levels = []; 24538 24539 for (var i = 0; i < levelsLength; i++) { 24540 var level = { 24541 width: width, 24542 height: height, 24543 items: [] 24544 }; 24545 this.levels.push(level); 24546 width = Math.ceil(width / 2);
vendor: 21,199 bytes, lines 24547-25160
24547 height = Math.ceil(height / 2); 24548 } 24549 } 24550 24551 TagTree.prototype = { 24552 reset: function TagTree_reset(i, j) { 24553 var currentLevel = 0, 24554 value = 0, 24555 level; 24556 24557 while (currentLevel < this.levels.length) { 24558 level = this.levels[currentLevel]; 24559 var index = i + j * level.width; 24560 24561 if (level.items[index] !== undefined) { 24562 value = level.items[index]; 24563 break; 24564 } 24565 24566 level.index = index; 24567 i >>= 1; 24568 j >>= 1; 24569 currentLevel++; 24570 } 24571 24572 currentLevel--; 24573 level = this.levels[currentLevel]; 24574 level.items[level.index] = value; 24575 this.currentLevel = currentLevel; 24576 delete this.value; 24577 }, 24578 incrementValue: function TagTree_incrementValue() { 24579 var level = this.levels[this.currentLevel]; 24580 level.items[level.index]++; 24581 }, 24582 nextLevel: function TagTree_nextLevel() { 24583 var currentLevel = this.currentLevel; 24584 var level = this.levels[currentLevel]; 24585 var value = level.items[level.index]; 24586 currentLevel--; 24587 24588 if (currentLevel < 0) { 24589 this.value = value; 24590 return false; 24591 } 24592 24593 this.currentLevel = currentLevel; 24594 level = this.levels[currentLevel]; 24595 level.items[level.index] = value; 24596 return true; 24597 } 24598 }; 24599 return TagTree; 24600 }(); 24601 24602 var InclusionTree = function InclusionTreeClosure() { 24603 function InclusionTree(width, height, defaultValue) { 24604 var levelsLength = (0, _util.log2)(Math.max(width, height)) + 1; 24605 this.levels = []; 24606 24607 for (var i = 0; i < levelsLength; i++) { 24608 var items = new Uint8Array(width * height); 24609 24610 for (var j = 0, jj = items.length; j < jj; j++) { 24611 items[j] = defaultValue; 24612 } 24613 24614 var level = { 24615 width: width, 24616 height: height, 24617 items: items 24618 }; 24619 this.levels.push(level); 24620 width = Math.ceil(width / 2); 24621 height = Math.ceil(height / 2); 24622 } 24623 } 24624 24625 InclusionTree.prototype = { 24626 reset: function InclusionTree_reset(i, j, stopValue) { 24627 var currentLevel = 0; 24628 24629 while (currentLevel < this.levels.length) { 24630 var level = this.levels[currentLevel]; 24631 var index = i + j * level.width; 24632 level.index = index; 24633 var value = level.items[index]; 24634 24635 if (value === 0xFF) { 24636 break; 24637 } 24638 24639 if (value > stopValue) { 24640 this.currentLevel = currentLevel; 24641 this.propagateValues(); 24642 return false; 24643 } 24644 24645 i >>= 1; 24646 j >>= 1; 24647 currentLevel++; 24648 } 24649 24650 this.currentLevel = currentLevel - 1; 24651 return true; 24652 }, 24653 incrementValue: function InclusionTree_incrementValue(stopValue) { 24654 var level = this.levels[this.currentLevel]; 24655 level.items[level.index] = stopValue + 1; 24656 this.propagateValues(); 24657 }, 24658 propagateValues: function InclusionTree_propagateValues() { 24659 var levelIndex = this.currentLevel; 24660 var level = this.levels[levelIndex]; 24661 var currentValue = level.items[level.index]; 24662 24663 while (--levelIndex >= 0) { 24664 level = this.levels[levelIndex]; 24665 level.items[level.index] = currentValue; 24666 } 24667 }, 24668 nextLevel: function InclusionTree_nextLevel() { 24669 var currentLevel = this.currentLevel; 24670 var level = this.levels[currentLevel]; 24671 var value = level.items[level.index]; 24672 level.items[level.index] = 0xFF; 24673 currentLevel--; 24674 24675 if (currentLevel < 0) { 24676 return false; 24677 } 24678 24679 this.currentLevel = currentLevel; 24680 level = this.levels[currentLevel]; 24681 level.items[level.index] = value; 24682 return true; 24683 } 24684 }; 24685 return InclusionTree; 24686 }(); 24687 24688 var BitModel = function BitModelClosure() { 24689 var UNIFORM_CONTEXT = 17; 24690 var RUNLENGTH_CONTEXT = 18; 24691 var LLAndLHContextsLabel = new Uint8Array([0, 5, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 1, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8]); 24692 var HLContextLabel = new Uint8Array([0, 3, 4, 0, 5, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 1, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8]); 24693 var HHContextLabel = new Uint8Array([0, 1, 2, 0, 1, 2, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 3, 4, 5, 0, 4, 5, 5, 0, 5, 5, 5, 0, 0, 0, 0, 0, 6, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8]); 24694 24695 function BitModel(width, height, subband, zeroBitPlanes, mb) { 24696 this.width = width; 24697 this.height = height; 24698 this.contextLabelTable = subband === 'HH' ? HHContextLabel : subband === 'HL' ? HLContextLabel : LLAndLHContextsLabel; 24699 var coefficientCount = width * height; 24700 this.neighborsSignificance = new Uint8Array(coefficientCount); 24701 this.coefficentsSign = new Uint8Array(coefficientCount); 24702 this.coefficentsMagnitude = mb > 14 ? new Uint32Array(coefficientCount) : mb > 6 ? new Uint16Array(coefficientCount) : new Uint8Array(coefficientCount); 24703 this.processingFlags = new Uint8Array(coefficientCount); 24704 var bitsDecoded = new Uint8Array(coefficientCount); 24705 24706 if (zeroBitPlanes !== 0) { 24707 for (var i = 0; i < coefficientCount; i++) { 24708 bitsDecoded[i] = zeroBitPlanes; 24709 } 24710 } 24711 24712 this.bitsDecoded = bitsDecoded; 24713 this.reset(); 24714 } 24715 24716 BitModel.prototype = { 24717 setDecoder: function BitModel_setDecoder(decoder) { 24718 this.decoder = decoder; 24719 }, 24720 reset: function BitModel_reset() { 24721 this.contexts = new Int8Array(19); 24722 this.contexts[0] = 4 << 1 | 0; 24723 this.contexts[UNIFORM_CONTEXT] = 46 << 1 | 0; 24724 this.contexts[RUNLENGTH_CONTEXT] = 3 << 1 | 0; 24725 }, 24726 setNeighborsSignificance: function BitModel_setNeighborsSignificance(row, column, index) { 24727 var neighborsSignificance = this.neighborsSignificance; 24728 var width = this.width, 24729 height = this.height; 24730 var left = column > 0; 24731 var right = column + 1 < width; 24732 var i; 24733 24734 if (row > 0) { 24735 i = index - width; 24736 24737 if (left) { 24738 neighborsSignificance[i - 1] += 0x10; 24739 } 24740 24741 if (right) { 24742 neighborsSignificance[i + 1] += 0x10; 24743 } 24744 24745 neighborsSignificance[i] += 0x04; 24746 } 24747 24748 if (row + 1 < height) { 24749 i = index + width; 24750 24751 if (left) { 24752 neighborsSignificance[i - 1] += 0x10; 24753 } 24754 24755 if (right) { 24756 neighborsSignificance[i + 1] += 0x10; 24757 } 24758 24759 neighborsSignificance[i] += 0x04; 24760 } 24761 24762 if (left) { 24763 neighborsSignificance[index - 1] += 0x01; 24764 } 24765 24766 if (right) { 24767 neighborsSignificance[index + 1] += 0x01; 24768 } 24769 24770 neighborsSignificance[index] |= 0x80; 24771 }, 24772 runSignificancePropagationPass: function BitModel_runSignificancePropagationPass() { 24773 var decoder = this.decoder; 24774 var width = this.width, 24775 height = this.height; 24776 var coefficentsMagnitude = this.coefficentsMagnitude; 24777 var coefficentsSign = this.coefficentsSign; 24778 var neighborsSignificance = this.neighborsSignificance; 24779 var processingFlags = this.processingFlags; 24780 var contexts = this.contexts; 24781 var labels = this.contextLabelTable; 24782 var bitsDecoded = this.bitsDecoded; 24783 var processedInverseMask = ~1; 24784 var processedMask = 1; 24785 var firstMagnitudeBitMask = 2; 24786 24787 for (var i0 = 0; i0 < height; i0 += 4) { 24788 for (var j = 0; j < width; j++) { 24789 var index = i0 * width + j; 24790 24791 for (var i1 = 0; i1 < 4; i1++, index += width) { 24792 var i = i0 + i1; 24793 24794 if (i >= height) { 24795 break; 24796 } 24797 24798 processingFlags[index] &= processedInverseMask; 24799 24800 if (coefficentsMagnitude[index] || !neighborsSignificance[index]) { 24801 continue; 24802 } 24803 24804 var contextLabel = labels[neighborsSignificance[index]]; 24805 var decision = decoder.readBit(contexts, contextLabel); 24806 24807 if (decision) { 24808 var sign = this.decodeSignBit(i, j, index); 24809 coefficentsSign[index] = sign; 24810 coefficentsMagnitude[index] = 1; 24811 this.setNeighborsSignificance(i, j, index); 24812 processingFlags[index] |= firstMagnitudeBitMask; 24813 } 24814 24815 bitsDecoded[index]++; 24816 processingFlags[index] |= processedMask; 24817 } 24818 } 24819 } 24820 }, 24821 decodeSignBit: function BitModel_decodeSignBit(row, column, index) { 24822 var width = this.width, 24823 height = this.height; 24824 var coefficentsMagnitude = this.coefficentsMagnitude; 24825 var coefficentsSign = this.coefficentsSign; 24826 var contribution, sign0, sign1, significance1; 24827 var contextLabel, decoded; 24828 significance1 = column > 0 && coefficentsMagnitude[index - 1] !== 0; 24829 24830 if (column + 1 < width && coefficentsMagnitude[index + 1] !== 0) { 24831 sign1 = coefficentsSign[index + 1]; 24832 24833 if (significance1) { 24834 sign0 = coefficentsSign[index - 1]; 24835 contribution = 1 - sign1 - sign0; 24836 } else { 24837 contribution = 1 - sign1 - sign1; 24838 } 24839 } else if (significance1) { 24840 sign0 = coefficentsSign[index - 1]; 24841 contribution = 1 - sign0 - sign0; 24842 } else { 24843 contribution = 0; 24844 } 24845 24846 var horizontalContribution = 3 * contribution; 24847 significance1 = row > 0 && coefficentsMagnitude[index - width] !== 0; 24848 24849 if (row + 1 < height && coefficentsMagnitude[index + width] !== 0) { 24850 sign1 = coefficentsSign[index + width]; 24851 24852 if (significance1) { 24853 sign0 = coefficentsSign[index - width]; 24854 contribution = 1 - sign1 - sign0 + horizontalContribution; 24855 } else { 24856 contribution = 1 - sign1 - sign1 + horizontalContribution; 24857 } 24858 } else if (significance1) { 24859 sign0 = coefficentsSign[index - width]; 24860 contribution = 1 - sign0 - sign0 + horizontalContribution; 24861 } else { 24862 contribution = horizontalContribution; 24863 } 24864 24865 if (contribution >= 0) { 24866 contextLabel = 9 + contribution; 24867 decoded = this.decoder.readBit(this.contexts, contextLabel); 24868 } else { 24869 contextLabel = 9 - contribution; 24870 decoded = this.decoder.readBit(this.contexts, contextLabel) ^ 1; 24871 } 24872 24873 return decoded; 24874 }, 24875 runMagnitudeRefinementPass: function BitModel_runMagnitudeRefinementPass() { 24876 var decoder = this.decoder; 24877 var width = this.width, 24878 height = this.height; 24879 var coefficentsMagnitude = this.coefficentsMagnitude; 24880 var neighborsSignificance = this.neighborsSignificance; 24881 var contexts = this.contexts; 24882 var bitsDecoded = this.bitsDecoded; 24883 var processingFlags = this.processingFlags; 24884 var processedMask = 1; 24885 var firstMagnitudeBitMask = 2; 24886 var length = width * height; 24887 var width4 = width * 4; 24888 24889 for (var index0 = 0, indexNext; index0 < length; index0 = indexNext) { 24890 indexNext = Math.min(length, index0 + width4); 24891 24892 for (var j = 0; j < width; j++) { 24893 for (var index = index0 + j; index < indexNext; index += width) { 24894 if (!coefficentsMagnitude[index] || (processingFlags[index] & processedMask) !== 0) { 24895 continue; 24896 } 24897 24898 var contextLabel = 16; 24899 24900 if ((processingFlags[index] & firstMagnitudeBitMask) !== 0) { 24901 processingFlags[index] ^= firstMagnitudeBitMask; 24902 var significance = neighborsSignificance[index] & 127; 24903 contextLabel = significance === 0 ? 15 : 14; 24904 } 24905 24906 var bit = decoder.readBit(contexts, contextLabel); 24907 coefficentsMagnitude[index] = coefficentsMagnitude[index] << 1 | bit; 24908 bitsDecoded[index]++; 24909 processingFlags[index] |= processedMask; 24910 } 24911 } 24912 } 24913 }, 24914 runCleanupPass: function BitModel_runCleanupPass() { 24915 var decoder = this.decoder; 24916 var width = this.width, 24917 height = this.height; 24918 var neighborsSignificance = this.neighborsSignificance; 24919 var coefficentsMagnitude = this.coefficentsMagnitude; 24920 var coefficentsSign = this.coefficentsSign; 24921 var contexts = this.contexts; 24922 var labels = this.contextLabelTable; 24923 var bitsDecoded = this.bitsDecoded; 24924 var processingFlags = this.processingFlags; 24925 var processedMask = 1; 24926 var firstMagnitudeBitMask = 2; 24927 var oneRowDown = width; 24928 var twoRowsDown = width * 2; 24929 var threeRowsDown = width * 3; 24930 var iNext; 24931 24932 for (var i0 = 0; i0 < height; i0 = iNext) { 24933 iNext = Math.min(i0 + 4, height); 24934 var indexBase = i0 * width; 24935 var checkAllEmpty = i0 + 3 < height; 24936 24937 for (var j = 0; j < width; j++) { 24938 var index0 = indexBase + j; 24939 var allEmpty = checkAllEmpty && processingFlags[index0] === 0 && processingFlags[index0 + oneRowDown] === 0 && processingFlags[index0 + twoRowsDown] === 0 && processingFlags[index0 + threeRowsDown] === 0 && neighborsSignificance[index0] === 0 && neighborsSignificance[index0 + oneRowDown] === 0 && neighborsSignificance[index0 + twoRowsDown] === 0 && neighborsSignificance[index0 + threeRowsDown] === 0; 24940 var i1 = 0, 24941 index = index0; 24942 var i = i0, 24943 sign; 24944 24945 if (allEmpty) { 24946 var hasSignificantCoefficent = decoder.readBit(contexts, RUNLENGTH_CONTEXT); 24947 24948 if (!hasSignificantCoefficent) { 24949 bitsDecoded[index0]++; 24950 bitsDecoded[index0 + oneRowDown]++; 24951 bitsDecoded[index0 + twoRowsDown]++; 24952 bitsDecoded[index0 + threeRowsDown]++; 24953 continue; 24954 } 24955 24956 i1 = decoder.readBit(contexts, UNIFORM_CONTEXT) << 1 | decoder.readBit(contexts, UNIFORM_CONTEXT); 24957 24958 if (i1 !== 0) { 24959 i = i0 + i1; 24960 index += i1 * width; 24961 } 24962 24963 sign = this.decodeSignBit(i, j, index); 24964 coefficentsSign[index] = sign; 24965 coefficentsMagnitude[index] = 1; 24966 this.setNeighborsSignificance(i, j, index); 24967 processingFlags[index] |= firstMagnitudeBitMask; 24968 index = index0; 24969 24970 for (var i2 = i0; i2 <= i; i2++, index += width) { 24971 bitsDecoded[index]++; 24972 } 24973 24974 i1++; 24975 } 24976 24977 for (i = i0 + i1; i < iNext; i++, index += width) { 24978 if (coefficentsMagnitude[index] || (processingFlags[index] & processedMask) !== 0) { 24979 continue; 24980 } 24981 24982 var contextLabel = labels[neighborsSignificance[index]]; 24983 var decision = decoder.readBit(contexts, contextLabel); 24984 24985 if (decision === 1) { 24986 sign = this.decodeSignBit(i, j, index); 24987 coefficentsSign[index] = sign; 24988 coefficentsMagnitude[index] = 1; 24989 this.setNeighborsSignificance(i, j, index); 24990 processingFlags[index] |= firstMagnitudeBitMask; 24991 } 24992 24993 bitsDecoded[index]++; 24994 } 24995 } 24996 } 24997 }, 24998 checkSegmentationSymbol: function BitModel_checkSegmentationSymbol() { 24999 var decoder = this.decoder; 25000 var contexts = this.contexts; 25001 var symbol = decoder.readBit(contexts, UNIFORM_CONTEXT) << 3 | decoder.readBit(contexts, UNIFORM_CONTEXT) << 2 | decoder.readBit(contexts, UNIFORM_CONTEXT) << 1 | decoder.readBit(contexts, UNIFORM_CONTEXT); 25002 25003 if (symbol !== 0xA) { 25004 throw new JpxError('Invalid segmentation symbol'); 25005 } 25006 } 25007 }; 25008 return BitModel; 25009 }(); 25010 25011 var Transform = function TransformClosure() { 25012 function Transform() {} 25013 25014 Transform.prototype.calculate = function transformCalculate(subbands, u0, v0) { 25015 var ll = subbands[0]; 25016 25017 for (var i = 1, ii = subbands.length; i < ii; i++) { 25018 ll = this.iterate(ll, subbands[i], u0, v0); 25019 } 25020 25021 return ll; 25022 }; 25023 25024 Transform.prototype.extend = function extend(buffer, offset, size) { 25025 var i1 = offset - 1, 25026 j1 = offset + 1; 25027 var i2 = offset + size - 2, 25028 j2 = offset + size; 25029 buffer[i1--] = buffer[j1++]; 25030 buffer[j2++] = buffer[i2--]; 25031 buffer[i1--] = buffer[j1++]; 25032 buffer[j2++] = buffer[i2--]; 25033 buffer[i1--] = buffer[j1++]; 25034 buffer[j2++] = buffer[i2--]; 25035 buffer[i1] = buffer[j1]; 25036 buffer[j2] = buffer[i2]; 25037 }; 25038 25039 Transform.prototype.iterate = function Transform_iterate(ll, hl_lh_hh, u0, v0) { 25040 var llWidth = ll.width, 25041 llHeight = ll.height, 25042 llItems = ll.items; 25043 var width = hl_lh_hh.width; 25044 var height = hl_lh_hh.height; 25045 var items = hl_lh_hh.items; 25046 var i, j, k, l, u, v; 25047 25048 for (k = 0, i = 0; i < llHeight; i++) { 25049 l = i * 2 * width; 25050 25051 for (j = 0; j < llWidth; j++, k++, l += 2) { 25052 items[l] = llItems[k]; 25053 } 25054 } 25055 25056 llItems = ll.items = null; 25057 var bufferPadding = 4; 25058 var rowBuffer = new Float32Array(width + 2 * bufferPadding); 25059 25060 if (width === 1) { 25061 if ((u0 & 1) !== 0) { 25062 for (v = 0, k = 0; v < height; v++, k += width) { 25063 items[k] *= 0.5; 25064 } 25065 } 25066 } else { 25067 for (v = 0, k = 0; v < height; v++, k += width) { 25068 rowBuffer.set(items.subarray(k, k + width), bufferPadding); 25069 this.extend(rowBuffer, bufferPadding, width); 25070 this.filter(rowBuffer, bufferPadding, width); 25071 items.set(rowBuffer.subarray(bufferPadding, bufferPadding + width), k); 25072 } 25073 } 25074 25075 var numBuffers = 16; 25076 var colBuffers = []; 25077 25078 for (i = 0; i < numBuffers; i++) { 25079 colBuffers.push(new Float32Array(height + 2 * bufferPadding)); 25080 } 25081 25082 var b, 25083 currentBuffer = 0; 25084 ll = bufferPadding + height; 25085 25086 if (height === 1) { 25087 if ((v0 & 1) !== 0) { 25088 for (u = 0; u < width; u++) { 25089 items[u] *= 0.5; 25090 } 25091 } 25092 } else { 25093 for (u = 0; u < width; u++) { 25094 if (currentBuffer === 0) { 25095 numBuffers = Math.min(width - u, numBuffers); 25096 25097 for (k = u, l = bufferPadding; l < ll; k += width, l++) { 25098 for (b = 0; b < numBuffers; b++) { 25099 colBuffers[b][l] = items[k + b]; 25100 } 25101 } 25102 25103 currentBuffer = numBuffers; 25104 } 25105 25106 currentBuffer--; 25107 var buffer = colBuffers[currentBuffer]; 25108 this.extend(buffer, bufferPadding, height); 25109 this.filter(buffer, bufferPadding, height); 25110 25111 if (currentBuffer === 0) { 25112 k = u - numBuffers + 1; 25113 25114 for (l = bufferPadding; l < ll; k += width, l++) { 25115 for (b = 0; b < numBuffers; b++) { 25116 items[k + b] = colBuffers[b][l]; 25117 } 25118 } 25119 } 25120 } 25121 } 25122 25123 return { 25124 width: width, 25125 height: height, 25126 items: items 25127 }; 25128 }; 25129 25130 return Transform; 25131 }(); 25132 25133 var IrreversibleTransform = function IrreversibleTransformClosure() { 25134 function IrreversibleTransform() { 25135 Transform.call(this); 25136 } 25137 25138 IrreversibleTransform.prototype = Object.create(Transform.prototype); 25139 25140 IrreversibleTransform.prototype.filter = function irreversibleTransformFilter(x, offset, length) { 25141 var len = length >> 1; 25142 offset = offset | 0; 25143 var j, n, current, next; 25144 var alpha = -1.586134342059924; 25145 var beta = -0.052980118572961; 25146 var gamma = 0.882911075530934; 25147 var delta = 0.443506852043971; 25148 var K = 1.230174104914001; 25149 var K_ = 1 / K; 25150 j = offset - 3; 25151 25152 for (n = len + 4; n--; j += 2) { 25153 x[j] *= K_; 25154 } 25155 25156 j = offset - 2; 25157 current = delta * x[j - 1]; 25158 25159 for (n = len + 3; n--; j += 2) { 25160 next = delta * x[j + 1];
25161 x[j] = K * x[j] - current - next; 25162 25163 if (n--) { 25164 j += 2; 25165 current = delta * x[j + 1]; 25166 x[j] = K * x[j] - current - next; 25167 } else { 25168 break; 25169 } 25170 } 25171 25172 j = offset - 1; 25173 current = gamma * x[j - 1]; 25174 25175 for (n = len + 2; n--; j += 2) { 25176 next = gamma * x[j + 1]; 25177 x[j] -= current + next; 25178 25179 if (n--) { 25180 j += 2; 25181 current = gamma * x[j + 1]; 25182 x[j] -= current + next; 25183 } else { 25184 break; 25185 } 25186 } 25187 25188 j = offset; 25189 current = beta * x[j - 1]; 25190 25191 for (n = len + 1; n--; j += 2) { 25192 next = beta * x[j + 1]; 25193 x[j] -= current + next; 25194 25195 if (n--) { 25196 j += 2; 25197 current = beta * x[j + 1]; 25198 x[j] -= current + next; 25199 } else { 25200 break; 25201 } 25202 } 25203 25204 if (len !== 0) { 25205 j = offset + 1; 25206 current = alpha * x[j - 1]; 25207 25208 for (n = len; n--; j += 2) { 25209 next = alpha * x[j + 1]; 25210 x[j] -= current + next; 25211 25212 if (n--) { 25213 j += 2; 25214 current = alpha * x[j + 1]; 25215 x[j] -= current + next; 25216 } else { 25217 break; 25218 } 25219 } 25220 } 25221 }; 25222 25223 return IrreversibleTransform; 25224 }(); 25225 25226 var ReversibleTransform = function ReversibleTransformClosure() { 25227 function ReversibleTransform() { 25228 Transform.call(this); 25229 } 25230 25231 ReversibleTransform.prototype = Object.create(Transform.prototype); 25232 25233 ReversibleTransform.prototype.filter = function reversibleTransformFilter(x, offset, length) { 25234 var len = length >> 1; 25235 offset = offset | 0; 25236 var j, n; 25237 25238 for (j = offset, n = len + 1; n--; j += 2) { 25239 x[j] -= x[j - 1] + x[j + 1] + 2 >> 2; 25240 } 25241 25242 for (j = offset + 1, n = len; n--; j += 2) { 25243 x[j] += x[j - 1] + x[j + 1] >> 1; 25244 } 25245 }; 25246 25247 return ReversibleTransform; 25248 }(); 25249 25250 return JpxImage; 25251}();
25252 25253exports.JpxImage = JpxImage; 25254 25255/***/ }), 25256/* 167 */ 25257/***/ (function(module, exports, __w_pdfjs_require__) { 25258 25259"use strict"; 25260 25261 25262Object.defineProperty(exports, "__esModule", { 25263 value: true 25264}); 25265exports.calculateSHA512 = exports.calculateSHA384 = exports.calculateSHA256 = exports.calculateMD5 = exports.PDF20 = exports.PDF17 = exports.CipherTransformFactory = exports.ARCFourCipher = exports.AES256Cipher = exports.AES128Cipher = void 0; 25266 25267var _util = __w_pdfjs_require__(6); 25268 25269var _primitives = __w_pdfjs_require__(155); 25270 25271var _stream = __w_pdfjs_require__(157); 25272 25273function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 25274 25275function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 25276 25277function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 25278 25279function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 25280 25281function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 25282 25283function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 25284 25285function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 25286 25287function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 25288 25289function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 25290 25291var ARCFourCipher = function ARCFourCipherClosure() { 25292 function ARCFourCipher(key) { 25293 this.a = 0; 25294 this.b = 0; 25295 var s = new Uint8Array(256); 25296 var i, 25297 j = 0, 25298 tmp, 25299 keyLength = key.length; 25300 25301 for (i = 0; i < 256; ++i) { 25302 s[i] = i; 25303 } 25304 25305 for (i = 0; i < 256; ++i) { 25306 tmp = s[i]; 25307 j = j + tmp + key[i % keyLength] & 0xFF; 25308 s[i] = s[j]; 25309 s[j] = tmp; 25310 } 25311 25312 this.s = s; 25313 } 25314 25315 ARCFourCipher.prototype = { 25316 encryptBlock: function ARCFourCipher_encryptBlock(data) { 25317 var i, 25318 n = data.length, 25319 tmp, 25320 tmp2; 25321 var a = this.a, 25322 b = this.b, 25323 s = this.s; 25324 var output = new Uint8Array(n); 25325 25326 for (i = 0; i < n; ++i) { 25327 a = a + 1 & 0xFF; 25328 tmp = s[a]; 25329 b = b + tmp & 0xFF; 25330 tmp2 = s[b]; 25331 s[a] = tmp2; 25332 s[b] = tmp; 25333 output[i] = data[i] ^ s[tmp + tmp2 & 0xFF]; 25334 } 25335 25336 this.a = a; 25337 this.b = b; 25338 return output; 25339 } 25340 }; 25341 ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock; 25342 return ARCFourCipher; 25343}(); 25344 25345exports.ARCFourCipher = ARCFourCipher; 25346 25347var calculateMD5 = function calculateMD5Closure() { 25348 var r = new Uint8Array([7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]); 25349 var k = new Int32Array([-680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, -722521979, 76029189, -64
253490364487, -421815835, 530742520, -995338651, -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, -145523070, -1120210379, 718787259, -343485551]); 25350 25351 function hash(data, offset, length) { 25352 var h0 = 1732584193, 25353 h1 = -271733879, 25354 h2 = -1732584194, 25355 h3 = 271733878; 25356 var paddedLength = length + 72 & ~63; 25357 var padded = new Uint8Array(paddedLength); 25358 var i, j, n; 25359 25360 for (i = 0; i < length; ++i) { 25361 padded[i] = data[offset++]; 25362 } 25363 25364 padded[i++] = 0x80; 25365 n = paddedLength - 8; 25366 25367 while (i < n) { 25368 padded[i++] = 0; 25369 } 25370 25371 padded[i++] = length << 3 & 0xFF; 25372 padded[i++] = length >> 5 & 0xFF; 25373 padded[i++] = length >> 13 & 0xFF; 25374 padded[i++] = length >> 21 & 0xFF; 25375 padded[i++] = length >>> 29 & 0xFF; 25376 padded[i++] = 0; 25377 padded[i++] = 0; 25378 padded[i++] = 0; 25379 var w = new Int32Array(16); 25380 25381 for (i = 0; i < paddedLength;) { 25382 for (j = 0; j < 16; ++j, i += 4) { 25383 w[j] = padded[i] | padded[i + 1] << 8 | padded[i + 2] << 16 | padded[i + 3] << 24; 25384 } 25385 25386 var a = h0, 25387 b = h1, 25388 c = h2, 25389 d = h3, 25390 f, 25391 g; 25392 25393 for (j = 0; j < 64; ++j) { 25394 if (j < 16) { 25395 f = b & c | ~b & d; 25396 g = j; 25397 } else if (j < 32) { 25398 f = d & b | ~d & c; 25399 g = 5 * j + 1 & 15; 25400 } else if (j < 48) { 25401 f = b ^ c ^ d; 25402 g = 3 * j + 5 & 15; 25403 } else { 25404 f = c ^ (b | ~d); 25405 g = 7 * j & 15; 25406 } 25407 25408 var tmp = d, 25409 rotateArg = a + f + k[j] + w[g] | 0, 25410 rotate = r[j]; 25411 d = c; 25412 c = b; 25413 b = b + (rotateArg << rotate | rotateArg >>> 32 - rotate) | 0; 25414 a = tmp; 25415 } 25416 25417 h0 = h0 + a | 0; 25418 h1 = h1 + b | 0; 25419 h2 = h2 + c | 0; 25420 h3 = h3 + d | 0; 25421 } 25422 25423 return new Uint8Array([h0 & 0xFF, h0 >> 8 & 0xFF, h0 >> 16 & 0xFF, h0 >>> 24 & 0xFF, h1 & 0xFF, h1 >> 8 & 0xFF, h1 >> 16 & 0xFF, h1 >>> 24 & 0xFF, h2 & 0xFF, h2 >> 8 & 0xFF, h2 >> 16 & 0xFF, h2 >>> 24 & 0xFF, h3 & 0xFF, h3 >> 8 & 0xFF, h3 >> 16 & 0xFF, h3 >>> 24 & 0xFF]); 25424 } 25425 25426 return hash; 25427}(); 25428 25429exports.calculateMD5 = calculateMD5; 25430 25431var Word64 = function Word64Closure() { 25432 function Word64(highInteger, lowInteger) { 25433 this.high = highInteger | 0; 25434 this.low = lowInteger | 0; 25435 } 25436 25437 Word64.prototype = { 25438 and: function Word64_and(word) { 25439 this.high &= word.high; 25440 this.low &= word.low; 25441 }, 25442 xor: function Word64_xor(word) { 25443 this.high ^= word.high; 25444 this.low ^= word.low; 25445 }, 25446 or: function Word64_or(word) { 25447 this.high |= word.high; 25448 this.low |= word.low; 25449 }, 25450 shiftRight: function Word64_shiftRight(places) { 25451 if (places >= 32) { 25452 this.low = this.high >>> places - 32 | 0; 25453 this.high = 0; 25454 } else { 25455 this.low = this.low >>> places | this.high << 32 - places; 25456 this.high = this.high >>> places | 0; 25457 } 25458 }, 25459 shiftLeft: function Word64_shiftLeft(places) { 25460 if (places >= 32) { 25461 this.high = this.low << places - 32; 25462 this.low = 0; 25463 } else { 25464 this.high = this.high << places | this.low >>> 32 - places; 25465 this.low = this.low << places; 25466 } 25467 }, 25468 rotateRight: function Word64_rotateRight(places) { 25469 var low, high; 25470 25471 if (places & 32) { 25472 high = this.low; 25473 low = this.high; 25474 } else { 25475 low = this.low; 25476 high = this.high; 25477 } 25478 25479 places &= 31; 25480 this.low = low >>> places | high << 32 - places; 25481 this.high = high >>> places | low << 32 - places; 25482 }, 25483 not: function Word64_not() { 25484 this.high = ~this.high; 25485 this.low = ~this.low; 25486 }, 25487 add: function Word64_add(word) { 25488 var lowAdd = (this.low >>> 0) + (word.low >>> 0); 25489 var highAdd = (this.high >>> 0) + (word.high >>> 0); 25490 25491 if (lowAdd > 0xFFFFFFFF) { 25492 highAdd += 1; 25493 } 25494 25495 this.low = lowAdd | 0; 25496 this.high = highAdd | 0; 25497 }, 25498 copyTo: function Word64_copyTo(bytes, offset) { 25499 bytes[offset] = this.high >>> 24 & 0xFF; 25500 bytes[offset + 1] = this.high >> 16 & 0xFF; 25501 bytes[offset + 2] = this.high >> 8 & 0xFF; 25502 bytes[offset + 3] = this.high & 0xFF; 25503 bytes[offset + 4] = this.low >>> 24 & 0xFF; 25504 bytes[offset + 5] = this.low >> 16 & 0xFF; 25505 bytes[offset + 6] = this.low >> 8 & 0xFF; 25506 bytes[offset + 7] = this.low & 0xFF; 25507 }, 25508 assign: function Word64_assign(word) { 25509 this.high = word.high; 25510 this.low = word.low; 25511 } 25512 }; 25513 return Word64; 25514}();
vendor: 5,444 bytes, lines 25515-25698
25515 25516var calculateSHA256 = function calculateSHA256Closure() { 25517 function rotr(x, n) { 25518 return x >>> n | x << 32 - n; 25519 } 25520 25521 function ch(x, y, z) { 25522 return x & y ^ ~x & z; 25523 } 25524 25525 function maj(x, y, z) { 25526 return x & y ^ x & z ^ y & z; 25527 } 25528 25529 function sigma(x) { 25530 return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); 25531 } 25532 25533 function sigmaPrime(x) { 25534 return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); 25535 } 25536 25537 function littleSigma(x) { 25538 return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3; 25539 } 25540 25541 function littleSigmaPrime(x) { 25542 return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10; 25543 } 25544 25545 var k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; 25546 25547 function hash(data, offset, length) { 25548 var h0 = 0x6a09e667, 25549 h1 = 0xbb67ae85, 25550 h2 = 0x3c6ef372, 25551 h3 = 0xa54ff53a, 25552 h4 = 0x510e527f, 25553 h5 = 0x9b05688c, 25554 h6 = 0x1f83d9ab, 25555 h7 = 0x5be0cd19; 25556 var paddedLength = Math.ceil((length + 9) / 64) * 64; 25557 var padded = new Uint8Array(paddedLength); 25558 var i, j, n; 25559 25560 for (i = 0; i < length; ++i) { 25561 padded[i] = data[offset++]; 25562 } 25563 25564 padded[i++] = 0x80; 25565 n = paddedLength - 8; 25566 25567 while (i < n) { 25568 padded[i++] = 0; 25569 } 25570 25571 padded[i++] = 0; 25572 padded[i++] = 0; 25573 padded[i++] = 0; 25574 padded[i++] = length >>> 29 & 0xFF; 25575 padded[i++] = length >> 21 & 0xFF; 25576 padded[i++] = length >> 13 & 0xFF; 25577 padded[i++] = length >> 5 & 0xFF; 25578 padded[i++] = length << 3 & 0xFF; 25579 var w = new Uint32Array(64); 25580 25581 for (i = 0; i < paddedLength;) { 25582 for (j = 0; j < 16; ++j) { 25583 w[j] = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; 25584 i += 4; 25585 } 25586 25587 for (j = 16; j < 64; ++j) { 25588 w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + littleSigma(w[j - 15]) + w[j - 16] | 0; 25589 } 25590 25591 var a = h0, 25592 b = h1, 25593 c = h2, 25594 d = h3, 25595 e = h4, 25596 f = h5, 25597 g = h6, 25598 h = h7, 25599 t1, 25600 t2; 25601 25602 for (j = 0; j < 64; ++j) { 25603 t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j]; 25604 t2 = sigma(a) + maj(a, b, c); 25605 h = g; 25606 g = f; 25607 f = e; 25608 e = d + t1 | 0; 25609 d = c; 25610 c = b; 25611 b = a; 25612 a = t1 + t2 | 0; 25613 } 25614 25615 h0 = h0 + a | 0; 25616 h1 = h1 + b | 0; 25617 h2 = h2 + c | 0; 25618 h3 = h3 + d | 0; 25619 h4 = h4 + e | 0; 25620 h5 = h5 + f | 0; 25621 h6 = h6 + g | 0; 25622 h7 = h7 + h | 0; 25623 } 25624 25625 return new Uint8Array([h0 >> 24 & 0xFF, h0 >> 16 & 0xFF, h0 >> 8 & 0xFF, h0 & 0xFF, h1 >> 24 & 0xFF, h1 >> 16 & 0xFF, h1 >> 8 & 0xFF, h1 & 0xFF, h2 >> 24 & 0xFF, h2 >> 16 & 0xFF, h2 >> 8 & 0xFF, h2 & 0xFF, h3 >> 24 & 0xFF, h3 >> 16 & 0xFF, h3 >> 8 & 0xFF, h3 & 0xFF, h4 >> 24 & 0xFF, h4 >> 16 & 0xFF, h4 >> 8 & 0xFF, h4 & 0xFF, h5 >> 24 & 0xFF, h5 >> 16 & 0xFF, h5 >> 8 & 0xFF, h5 & 0xFF, h6 >> 24 & 0xFF, h6 >> 16 & 0xFF, h6 >> 8 & 0xFF, h6 & 0xFF, h7 >> 24 & 0xFF, h7 >> 16 & 0xFF, h7 >> 8 & 0xFF, h7 & 0xFF]); 25626 } 25627 25628 return hash; 25629}(); 25630 25631exports.calculateSHA256 = calculateSHA256; 25632 25633var calculateSHA512 = function calculateSHA512Closure() { 25634 function ch(result, x, y, z, tmp) { 25635 result.assign(x); 25636 result.and(y); 25637 tmp.assign(x); 25638 tmp.not(); 25639 tmp.and(z); 25640 result.xor(tmp); 25641 } 25642 25643 function maj(result, x, y, z, tmp) { 25644 result.assign(x); 25645 result.and(y); 25646 tmp.assign(x); 25647 tmp.and(z); 25648 result.xor(tmp); 25649 tmp.assign(y); 25650 tmp.and(z); 25651 result.xor(tmp); 25652 } 25653 25654 function sigma(result, x, tmp) { 25655 result.assign(x); 25656 result.rotateRight(28); 25657 tmp.assign(x); 25658 tmp.rotateRight(34); 25659 result.xor(tmp); 25660 tmp.assign(x); 25661 tmp.rotateRight(39); 25662 result.xor(tmp); 25663 } 25664 25665 function sigmaPrime(result, x, tmp) { 25666 result.assign(x); 25667 result.rotateRight(14); 25668 tmp.assign(x); 25669 tmp.rotateRight(18); 25670 result.xor(tmp); 25671 tmp.assign(x); 25672 tmp.rotateRight(41); 25673 result.xor(tmp); 25674 } 25675 25676 function littleSigma(result, x, tmp) { 25677 result.assign(x); 25678 result.rotateRight(1); 25679 tmp.assign(x); 25680 tmp.rotateRight(8); 25681 result.xor(tmp); 25682 tmp.assign(x); 25683 tmp.shiftRight(7); 25684 result.xor(tmp); 25685 } 25686 25687 function littleSigmaPrime(result, x, tmp) { 25688 result.assign(x); 25689 result.rotateRight(19); 25690 tmp.assign(x); 25691 tmp.rotateRight(61); 25692 result.xor(tmp); 25693 tmp.assign(x); 25694 tmp.shiftRight(6); 25695 result.xor(tmp); 25696 } 25697 25698 var k = [new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd), new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc), new Word64(0x3956c25b, 0xf348b538), new Word64(0x59f111f1, 0xb
vendor: 7,381 bytes, lines 25698-25884
25698605d019), new Word64(0x923f82a4, 0xaf194f9b), new Word64(0xab1c5ed5, 0xda6d8118), new Word64(0xd807aa98, 0xa3030242), new Word64(0x12835b01, 0x45706fbe), new Word64(0x243185be, 0x4ee4b28c), new Word64(0x550c7dc3, 0xd5ffb4e2), new Word64(0x72be5d74, 0xf27b896f), new Word64(0x80deb1fe, 0x3b1696b1), new Word64(0x9bdc06a7, 0x25c71235), new Word64(0xc19bf174, 0xcf692694), new Word64(0xe49b69c1, 0x9ef14ad2), new Word64(0xefbe4786, 0x384f25e3), new Word64(0x0fc19dc6, 0x8b8cd5b5), new Word64(0x240ca1cc, 0x77ac9c65), new Word64(0x2de92c6f, 0x592b0275), new Word64(0x4a7484aa, 0x6ea6e483), new Word64(0x5cb0a9dc, 0xbd41fbd4), new Word64(0x76f988da, 0x831153b5), new Word64(0x983e5152, 0xee66dfab), new Word64(0xa831c66d, 0x2db43210), new Word64(0xb00327c8, 0x98fb213f), new Word64(0xbf597fc7, 0xbeef0ee4), new Word64(0xc6e00bf3, 0x3da88fc2), new Word64(0xd5a79147, 0x930aa725), new Word64(0x06ca6351, 0xe003826f), new Word64(0x14292967, 0x0a0e6e70), new Word64(0x27b70a85, 0x46d22ffc), new Word64(0x2e1b2138, 0x5c26c926), new Word64(0x4d2c6dfc, 0x5ac42aed), new Word64(0x53380d13, 0x9d95b3df), new Word64(0x650a7354, 0x8baf63de), new Word64(0x766a0abb, 0x3c77b2a8), new Word64(0x81c2c92e, 0x47edaee6), new Word64(0x92722c85, 0x1482353b), new Word64(0xa2bfe8a1, 0x4cf10364), new Word64(0xa81a664b, 0xbc423001), new Word64(0xc24b8b70, 0xd0f89791), new Word64(0xc76c51a3, 0x0654be30), new Word64(0xd192e819, 0xd6ef5218), new Word64(0xd6990624, 0x5565a910), new Word64(0xf40e3585, 0x5771202a), new Word64(0x106aa070, 0x32bbd1b8), new Word64(0x19a4c116, 0xb8d2d0c8), new Word64(0x1e376c08, 0x5141ab53), new Word64(0x2748774c, 0xdf8eeb99), new Word64(0x34b0bcb5, 0xe19b48a8), new Word64(0x391c0cb3, 0xc5c95a63), new Word64(0x4ed8aa4a, 0xe3418acb), new Word64(0x5b9cca4f, 0x7763e373), new Word64(0x682e6ff3, 0xd6b2b8a3), new Word64(0x748f82ee, 0x5defb2fc), new Word64(0x78a5636f, 0x43172f60), new Word64(0x84c87814, 0xa1f0ab72), new Word64(0x8cc70208, 0x1a6439ec), new Word64(0x90befffa, 0x23631e28), new Word64(0xa4506ceb, 0xde82bde9), new Word64(0xbef9a3f7, 0xb2c67915), new Word64(0xc67178f2, 0xe372532b), new Word64(0xca273ece, 0xea26619c), new Word64(0xd186b8c7, 0x21c0c207), new Word64(0xeada7dd6, 0xcde0eb1e), new Word64(0xf57d4f7f, 0xee6ed178), new Word64(0x06f067aa, 0x72176fba), new Word64(0x0a637dc5, 0xa2c898a6), new Word64(0x113f9804, 0xbef90dae), new Word64(0x1b710b35, 0x131c471b), new Word64(0x28db77f5, 0x23047d84), new Word64(0x32caab7b, 0x40c72493), new Word64(0x3c9ebe0a, 0x15c9bebc), new Word64(0x431d67c4, 0x9c100d4c), new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a), new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)]; 25699 25700 function hash(data, offset, length, mode384) { 25701 mode384 = !!mode384; 25702 var h0, h1, h2, h3, h4, h5, h6, h7; 25703 25704 if (!mode384) { 25705 h0 = new Word64(0x6a09e667, 0xf3bcc908); 25706 h1 = new Word64(0xbb67ae85, 0x84caa73b); 25707 h2 = new Word64(0x3c6ef372, 0xfe94f82b); 25708 h3 = new Word64(0xa54ff53a, 0x5f1d36f1); 25709 h4 = new Word64(0x510e527f, 0xade682d1); 25710 h5 = new Word64(0x9b05688c, 0x2b3e6c1f); 25711 h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); 25712 h7 = new Word64(0x5be0cd19, 0x137e2179); 25713 } else { 25714 h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); 25715 h1 = new Word64(0x629a292a, 0x367cd507); 25716 h2 = new Word64(0x9159015a, 0x3070dd17); 25717 h3 = new Word64(0x152fecd8, 0xf70e5939); 25718 h4 = new Word64(0x67332667, 0xffc00b31); 25719 h5 = new Word64(0x8eb44a87, 0x68581511); 25720 h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); 25721 h7 = new Word64(0x47b5481d, 0xbefa4fa4); 25722 } 25723 25724 var paddedLength = Math.ceil((length + 17) / 128) * 128; 25725 var padded = new Uint8Array(paddedLength); 25726 var i, j, n; 25727 25728 for (i = 0; i < length; ++i) { 25729 padded[i] = data[offset++]; 25730 } 25731 25732 padded[i++] = 0x80; 25733 n = paddedLength - 16; 25734 25735 while (i < n) { 25736 padded[i++] = 0; 25737 } 25738 25739 padded[i++] = 0; 25740 padded[i++] = 0; 25741 padded[i++] = 0; 25742 padded[i++] = 0; 25743 padded[i++] = 0; 25744 padded[i++] = 0; 25745 padded[i++] = 0; 25746 padded[i++] = 0; 25747 padded[i++] = 0; 25748 padded[i++] = 0; 25749 padded[i++] = 0; 25750 padded[i++] = length >>> 29 & 0xFF; 25751 padded[i++] = length >> 21 & 0xFF; 25752 padded[i++] = length >> 13 & 0xFF; 25753 padded[i++] = length >> 5 & 0xFF; 25754 padded[i++] = length << 3 & 0xFF; 25755 var w = new Array(80); 25756 25757 for (i = 0; i < 80; i++) { 25758 w[i] = new Word64(0, 0); 25759 } 25760 25761 var a = new Word64(0, 0), 25762 b = new Word64(0, 0), 25763 c = new Word64(0, 0); 25764 var d = new Word64(0, 0), 25765 e = new Word64(0, 0), 25766 f = new Word64(0, 0); 25767 var g = new Word64(0, 0), 25768 h = new Word64(0, 0); 25769 var t1 = new Word64(0, 0), 25770 t2 = new Word64(0, 0); 25771 var tmp1 = new Word64(0, 0), 25772 tmp2 = new Word64(0, 0), 25773 tmp3; 25774 25775 for (i = 0; i < paddedLength;) { 25776 for (j = 0; j < 16; ++j) { 25777 w[j].high = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; 25778 w[j].low = padded[i + 4] << 24 | padded[i + 5] << 16 | padded[i + 6] << 8 | padded[i + 7]; 25779 i += 8; 25780 } 25781 25782 for (j = 16; j < 80; ++j) { 25783 tmp3 = w[j]; 25784 littleSigmaPrime(tmp3, w[j - 2], tmp2); 25785 tmp3.add(w[j - 7]); 25786 littleSigma(tmp1, w[j - 15], tmp2); 25787 tmp3.add(tmp1); 25788 tmp3.add(w[j - 16]); 25789 } 25790 25791 a.assign(h0); 25792 b.assign(h1); 25793 c.assign(h2); 25794 d.assign(h3); 25795 e.assign(h4); 25796 f.assign(h5); 25797 g.assign(h6); 25798 h.assign(h7); 25799 25800 for (j = 0; j < 80; ++j) { 25801 t1.assign(h); 25802 sigmaPrime(tmp1, e, tmp2); 25803 t1.add(tmp1); 25804 ch(tmp1, e, f, g, tmp2); 25805 t1.add(tmp1); 25806 t1.add(k[j]); 25807 t1.add(w[j]); 25808 sigma(t2, a, tmp2); 25809 maj(tmp1, a, b, c, tmp2); 25810 t2.add(tmp1); 25811 tmp3 = h; 25812 h = g; 25813 g = f; 25814 f = e; 25815 d.add(t1); 25816 e = d; 25817 d = c; 25818 c = b; 25819 b = a; 25820 tmp3.assign(t1); 25821 tmp3.add(t2); 25822 a = tmp3; 25823 } 25824 25825 h0.add(a); 25826 h1.add(b); 25827 h2.add(c); 25828 h3.add(d); 25829 h4.add(e); 25830 h5.add(f); 25831 h6.add(g); 25832 h7.add(h); 25833 } 25834 25835 var result; 25836 25837 if (!mode384) { 25838 result = new Uint8Array(64); 25839 h0.copyTo(result, 0); 25840 h1.copyTo(result, 8); 25841 h2.copyTo(result, 16); 25842 h3.copyTo(result, 24); 25843 h4.copyTo(result, 32); 25844 h5.copyTo(result, 40); 25845 h6.copyTo(result, 48); 25846 h7.copyTo(result, 56); 25847 } else { 25848 result = new Uint8Array(48); 25849 h0.copyTo(result, 0); 25850 h1.copyTo(result, 8); 25851 h2.copyTo(result, 16); 25852 h3.copyTo(result, 24); 25853 h4.copyTo(result, 32); 25854 h5.copyTo(result, 40); 25855 } 25856 25857 return result; 25858 } 25859 25860 return hash; 25861}(); 25862 25863exports.calculateSHA512 = calculateSHA512; 25864 25865var calculateSHA384 = function calculateSHA384Closure() { 25866 function hash(data, offset, length) { 25867 return calculateSHA512(data, offset, length, true); 25868 } 25869 25870 return hash; 25871}(); 25872 25873exports.calculateSHA384 = calculateSHA384; 25874 25875var NullCipher = function NullCipherClosure() { 25876 function NullCipher() {} 25877 25878 NullCipher.prototype = { 25879 decryptBlock: function NullCipher_decryptBlock(data) { 25880 return data; 25881 } 25882 }; 25883 return NullCipher; 25884}();
25885 25886var AESBaseCipher = 25887/*#__PURE__*/ 25888function () { 25889 function AESBaseCipher() { 25890 _classCallCheck(this, AESBaseCipher); 25891 25892 if (this.constructor === AESBaseCipher) { 25893 (0, _util.unreachable)('Cannot initialize AESBaseCipher.'); 25894 } 25895 25896 this._s = new Uint8Array([0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16]); 25897 this._inv_s = new Uint8Array([0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]); 25898 this._mix = new Uint32Array([0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a
25898750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); 25899 this._mixCol = new Uint8Array(256); 25900 25901 for (var i = 0; i < 256; i++) { 25902 if (i < 128) { 25903 this._mixCol[i] = i << 1; 25904 } else { 25905 this._mixCol[i] = i << 1 ^ 0x1b; 25906 } 25907 } 25908 25909 this.buffer = new Uint8Array(16); 25910 this.bufferPosition = 0; 25911 } 25912 25913 _createClass(AESBaseCipher, [{ 25914 key: "_expandKey", 25915 value: function _expandKey(cipherKey) { 25916 (0, _util.unreachable)('Cannot call `_expandKey` on the base class'); 25917 } 25918 }, { 25919 key: "_decrypt", 25920 value: function _decrypt(input, key) { 25921 var t, u, v; 25922 var state = new Uint8Array(16); 25923 state.set(input); 25924 25925 for (var j = 0, k = this._keySize; j < 16; ++j, ++k) { 25926 state[j] ^= key[k]; 25927 } 25928 25929 for (var i = this._cyclesOfRepetition - 1; i >= 1; --i) { 25930 t = state[13]; 25931 state[13] = state[9]; 25932 state[9] = state[5]; 25933 state[5] = state[1]; 25934 state[1] = t; 25935 t = state[14]; 25936 u = state[10]; 25937 state[14] = state[6]; 25938 state[10] = state[2]; 25939 state[6] = t; 25940 state[2] = u; 25941 t = state[15]; 25942 u = state[11]; 25943 v = state[7]; 25944 state[15] = state[3]; 25945 state[11] = t; 25946 state[7] = u; 25947 state[3] = v; 25948 25949 for (var _j = 0; _j < 16; ++_j) { 25950 state[_j] = this._inv_s[state[_j]]; 25951 } 25952 25953 for (var _j2 = 0, _k = i * 16; _j2 < 16; ++_j2, ++_k) { 25954 state[_j2] ^= key[_k]; 25955 } 25956 25957 for (var _j3 = 0; _j3 < 16; _j3 += 4) { 25958 var s0 = this._mix[state[_j3]]; 25959 var s1 = this._mix[state[_j3 + 1]]; 25960 var s2 = this._mix[state[_j3 + 2]]; 25961 var s3 = this._mix[state[_j3 + 3]]; 25962 t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8; 25963 state[_j3] = t >>> 24 & 0xFF; 25964 state[_j3 + 1] = t >> 16 & 0xFF; 25965 state[_j3 + 2] = t >> 8 & 0xFF; 25966 state[_j3 + 3] = t & 0xFF; 25967 } 25968 } 25969 25970 t = state[13]; 25971 state[13] = state[9]; 25972 state[9] = state[5]; 25973 state[5] = state[1]; 25974 state[1] = t; 25975 t = state[14]; 25976 u = state[10]; 25977 state[14] = state[6]; 25978 state[10] = state[2]; 25979 state[6] = t; 25980 state[2] = u; 25981 t = state[15]; 25982 u = state[11]; 25983 v = state[7]; 25984 state[15] = state[3]; 25985 state[11] = t; 25986 state[7] = u; 25987 state[3] = v; 25988 25989 for (var _j4 = 0; _j4 < 16; ++_j4) { 25990 state[_j4] = this._inv_s[state[_j4]];
25991 state[_j4] ^= key[_j4]; 25992 } 25993 25994 return state; 25995 } 25996 }, { 25997 key: "_encrypt", 25998 value: function _encrypt(input, key) { 25999 var s = this._s; 26000 var t, u, v; 26001 var state = new Uint8Array(16); 26002 state.set(input); 26003 26004 for (var j = 0; j < 16; ++j) { 26005 state[j] ^= key[j]; 26006 } 26007 26008 for (var i = 1; i < this._cyclesOfRepetition; i++) { 26009 for (var _j5 = 0; _j5 < 16; ++_j5) { 26010 state[_j5] = s[state[_j5]]; 26011 } 26012 26013 v = state[1]; 26014 state[1] = state[5]; 26015 state[5] = state[9]; 26016 state[9] = state[13]; 26017 state[13] = v; 26018 v = state[2]; 26019 u = state[6]; 26020 state[2] = state[10]; 26021 state[6] = state[14]; 26022 state[10] = v; 26023 state[14] = u; 26024 v = state[3]; 26025 u = state[7]; 26026 t = state[11]; 26027 state[3] = state[15]; 26028 state[7] = v; 26029 state[11] = u; 26030 state[15] = t; 26031 26032 for (var _j6 = 0; _j6 < 16; _j6 += 4) { 26033 var s0 = state[_j6 + 0]; 26034 var s1 = state[_j6 + 1]; 26035 var s2 = state[_j6 + 2]; 26036 var s3 = state[_j6 + 3]; 26037 t = s0 ^ s1 ^ s2 ^ s3; 26038 state[_j6 + 0] ^= t ^ this._mixCol[s0 ^ s1]; 26039 state[_j6 + 1] ^= t ^ this._mixCol[s1 ^ s2]; 26040 state[_j6 + 2] ^= t ^ this._mixCol[s2 ^ s3]; 26041 state[_j6 + 3] ^= t ^ this._mixCol[s3 ^ s0]; 26042 } 26043 26044 for (var _j7 = 0, k = i * 16; _j7 < 16; ++_j7, ++k) { 26045 state[_j7] ^= key[k]; 26046 } 26047 } 26048 26049 for (var _j8 = 0; _j8 < 16; ++_j8) { 26050 state[_j8] = s[state[_j8]]; 26051 } 26052 26053 v = state[1]; 26054 state[1] = state[5]; 26055 state[5] = state[9]; 26056 state[9] = state[13]; 26057 state[13] = v; 26058 v = state[2]; 26059 u = state[6]; 26060 state[2] = state[10]; 26061 state[6] = state[14]; 26062 state[10] = v; 26063 state[14] = u; 26064 v = state[3]; 26065 u = state[7]; 26066 t = state[11]; 26067 state[3] = state[15]; 26068 state[7] = v; 26069 state[11] = u; 26070 state[15] = t; 26071 26072 for (var _j9 = 0, _k2 = this._keySize; _j9 < 16; ++_j9, ++_k2) { 26073 state[_j9] ^= key[_k2]; 26074 } 26075 26076 return state; 26077 } 26078 }, { 26079 key: "_decryptBlock2", 26080 value: function _decryptBlock2(data, finalize) { 26081 var sourceLength = data.length; 26082 var buffer = this.buffer, 26083 bufferLength = this.bufferPosition; 26084 var result = [], 26085 iv = this.iv; 26086 26087 for (var i = 0; i < sourceLength; ++i) { 26088 buffer[bufferLength] = data[i]; 26089 ++bufferLength; 26090 26091 if (bufferLength < 16) { 26092 continue; 26093 } 26094 26095 var plain = this._decrypt(buffer, this._key); 26096 26097 for (var j = 0; j < 16; ++j) { 26098 plain[j] ^= iv[j]; 26099 } 26100 26101 iv = buffer; 26102 result.push(plain); 26103 buffer = new Uint8Array(16); 26104 bufferLength = 0; 26105 } 26106 26107 this.buffer = buffer; 26108 this.bufferLength = bufferLength; 26109 this.iv = iv; 26110 26111 if (result.length === 0) { 26112 return new Uint8Array(0); 26113 } 26114 26115 var outputLength = 16 * result.length; 26116 26117 if (finalize) { 26118 var lastBlock = result[result.length - 1]; 26119 var psLen = lastBlock[15]; 26120 26121 if (psLen <= 16) { 26122 for (var _i = 15, ii = 16 - psLen; _i >= ii; --_i) { 26123 if (lastBlock[_i] !== psLen) { 26124 psLen = 0; 26125 break; 26126 } 26127 } 26128 26129 outputLength -= psLen; 26130 result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); 26131 } 26132 } 26133 26134 var output = new Uint8Array(outputLength); 26135 26136 for (var _i2 = 0, _j10 = 0, _ii = result.length; _i2 < _ii; ++_i2, _j10 += 16) { 26137 output.set(result[_i2], _j10); 26138 } 26139 26140 return output; 26141 } 26142 }, { 26143 key: "decryptBlock", 26144 value: function decryptBlock(data, finalize) { 26145 var iv = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; 26146 var sourceLength = data.length; 26147 var buffer = this.buffer, 26148 bufferLength = this.bufferPosition; 26149 26150 if (iv) { 26151 this.iv = iv; 26152 } else { 26153 for (var i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { 26154 buffer[bufferLength] = data[i]; 26155 } 26156 26157 if (bufferLength < 16) { 26158 this.bufferLength = bufferLength; 26159 return new Uint8Array(0); 26160 } 26161 26162 this.iv = buffer; 26163 data = data.subarray(16); 26164 } 26165 26166 this.buffer = new Uint8Array(16); 26167 this.bufferLength = 0; 26168 this.decryptBlock = this._decryptBlock2; 26169 return this.decryptBlock(data, finalize); 26170 } 26171 }, { 26172 key: "encrypt", 26173 value: function encrypt(data, iv) { 26174 var sourceLength = data.length; 26175 var buffer = this.buffer, 26176 bufferLength = this.bufferPosition; 26177 var result = []; 26178 26179 if (!iv) { 26180 iv = new Uint8Array(16); 26181 } 26182 26183 for (var i = 0; i < sourceLength; ++i) { 26184 buffer[bufferLength] = data[i]; 26185 ++bufferLength; 26186 26187 if (bufferLength < 16) { 26188 continue; 26189 } 26190 26191 for (var j = 0; j < 16; ++j) { 26192 buffer[j] ^= iv[j]; 26193 } 26194
26195 var cipher = this._encrypt(buffer, this._key); 26196 26197 iv = cipher; 26198 result.push(cipher); 26199 buffer = new Uint8Array(16); 26200 bufferLength = 0; 26201 } 26202 26203 this.buffer = buffer; 26204 this.bufferLength = bufferLength; 26205 this.iv = iv; 26206 26207 if (result.length === 0) { 26208 return new Uint8Array(0); 26209 } 26210 26211 var outputLength = 16 * result.length; 26212 var output = new Uint8Array(outputLength); 26213 26214 for (var _i3 = 0, _j11 = 0, ii = result.length; _i3 < ii; ++_i3, _j11 += 16) { 26215 output.set(result[_i3], _j11); 26216 } 26217 26218 return output; 26219 } 26220 }]); 26221 26222 return AESBaseCipher; 26223}(); 26224 26225var AES128Cipher = 26226/*#__PURE__*/ 26227function (_AESBaseCipher) { 26228 _inherits(AES128Cipher, _AESBaseCipher); 26229 26230 function AES128Cipher(key) { 26231 var _this; 26232 26233 _classCallCheck(this, AES128Cipher); 26234 26235 _this = _possibleConstructorReturn(this, _getPrototypeOf(AES128Cipher).call(this)); 26236 _this._cyclesOfRepetition = 10; 26237 _this._keySize = 160; 26238 _this._rcon = new Uint8Array([0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d]); 26239 _this._key = _this._expandKey(key); 26240 return _this; 26241 } 26242 26243 _createClass(AES128Cipher, [{ 26244 key: "_expandKey", 26245 value: function _expandKey(cipherKey) { 26246 var b = 176; 26247 var s = this._s; 26248 var rcon = this._rcon; 26249 var result = new Uint8Array(b); 26250 result.set(cipherKey); 26251 26252 for (var j = 16, i = 1; j < b; ++i) { 26253 var t1 = result[j - 3]; 26254 var t2 = result[j - 2]; 26255 var t3 = result[j - 1]; 26256 var t4 = result[j - 4]; 26257 t1 = s[t1]; 26258 t2 = s[t2]; 26259 t3 = s[t3]; 26260 t4 = s[t4]; 26261 t1 = t1 ^ rcon[i]; 26262 26263 for (var n = 0; n < 4; ++n) { 26264 result[j] = t1 ^= result[j - 16]; 26265 j++; 26266 result[j] = t2 ^= result[j - 16]; 26267 j++; 26268 result[j] = t3 ^= result[j - 16]; 26269 j++; 26270 result[j] = t4 ^= result[j - 16]; 26271 j++; 26272 } 26273 } 26274 26275 return result; 26276 } 26277 }]); 26278 26279 return AES128Cipher; 26280}(AESBaseCipher); 26281 26282exports.AES128Cipher = AES128Cipher; 26283 26284var AES256Cipher = 26285/*#__PURE__*/ 26286function (_AESBaseCipher2) { 26287 _inherits(AES256Cipher, _AESBaseCipher2); 26288 26289 function AES256Cipher(key) { 26290 var _this2; 26291 26292 _classCallCheck(this, AES256Cipher); 26293 26294 _this2 = _possibleConstructorReturn(this, _getPrototypeOf(AES256Cipher).call(this)); 26295 _this2._cyclesOfRepetition = 14; 26296 _this2._keySize = 224; 26297 _this2._key = _this2._expandKey(key); 26298 return _this2; 26299 } 26300 26301 _createClass(AES256Cipher, [{ 26302 key: "_expandKey", 26303 value: function _expandKey(cipherKey) { 26304 var b = 240; 26305 var s = this._s; 26306 var result = new Uint8Array(b); 26307 result.set(cipherKey); 26308 var r = 1; 26309 var t1, t2, t3, t4; 26310 26311 for (var j = 32, i = 1; j < b; ++i) { 26312 if (j % 32 === 16) { 26313 t1 = s[t1];
vendor: 10,881 bytes, lines 26314-26637
26314 t2 = s[t2]; 26315 t3 = s[t3]; 26316 t4 = s[t4]; 26317 } else if (j % 32 === 0) { 26318 t1 = result[j - 3]; 26319 t2 = result[j - 2]; 26320 t3 = result[j - 1]; 26321 t4 = result[j - 4]; 26322 t1 = s[t1]; 26323 t2 = s[t2]; 26324 t3 = s[t3]; 26325 t4 = s[t4]; 26326 t1 = t1 ^ r; 26327 26328 if ((r <<= 1) >= 256) { 26329 r = (r ^ 0x1b) & 0xFF; 26330 } 26331 } 26332 26333 for (var n = 0; n < 4; ++n) { 26334 result[j] = t1 ^= result[j - 32]; 26335 j++; 26336 result[j] = t2 ^= result[j - 32]; 26337 j++; 26338 result[j] = t3 ^= result[j - 32]; 26339 j++; 26340 result[j] = t4 ^= result[j - 32]; 26341 j++; 26342 } 26343 } 26344 26345 return result; 26346 } 26347 }]); 26348 26349 return AES256Cipher; 26350}(AESBaseCipher); 26351 26352exports.AES256Cipher = AES256Cipher; 26353 26354var PDF17 = function PDF17Closure() { 26355 function compareByteArrays(array1, array2) { 26356 if (array1.length !== array2.length) { 26357 return false; 26358 } 26359 26360 for (var i = 0; i < array1.length; i++) { 26361 if (array1[i] !== array2[i]) { 26362 return false; 26363 } 26364 } 26365 26366 return true; 26367 } 26368 26369 function PDF17() {} 26370 26371 PDF17.prototype = { 26372 checkOwnerPassword: function PDF17_checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { 26373 var hashData = new Uint8Array(password.length + 56); 26374 hashData.set(password, 0); 26375 hashData.set(ownerValidationSalt, password.length); 26376 hashData.set(userBytes, password.length + ownerValidationSalt.length); 26377 var result = calculateSHA256(hashData, 0, hashData.length); 26378 return compareByteArrays(result, ownerPassword); 26379 }, 26380 checkUserPassword: function PDF17_checkUserPassword(password, userValidationSalt, userPassword) { 26381 var hashData = new Uint8Array(password.length + 8); 26382 hashData.set(password, 0); 26383 hashData.set(userValidationSalt, password.length); 26384 var result = calculateSHA256(hashData, 0, hashData.length); 26385 return compareByteArrays(result, userPassword); 26386 }, 26387 getOwnerKey: function PDF17_getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { 26388 var hashData = new Uint8Array(password.length + 56); 26389 hashData.set(password, 0); 26390 hashData.set(ownerKeySalt, password.length); 26391 hashData.set(userBytes, password.length + ownerKeySalt.length); 26392 var key = calculateSHA256(hashData, 0, hashData.length); 26393 var cipher = new AES256Cipher(key); 26394 return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); 26395 }, 26396 getUserKey: function PDF17_getUserKey(password, userKeySalt, userEncryption) { 26397 var hashData = new Uint8Array(password.length + 8); 26398 hashData.set(password, 0); 26399 hashData.set(userKeySalt, password.length); 26400 var key = calculateSHA256(hashData, 0, hashData.length); 26401 var cipher = new AES256Cipher(key); 26402 return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); 26403 } 26404 }; 26405 return PDF17; 26406}(); 26407 26408exports.PDF17 = PDF17; 26409 26410var PDF20 = function PDF20Closure() { 26411 function concatArrays(array1, array2) { 26412 var t = new Uint8Array(array1.length + array2.length); 26413 t.set(array1, 0); 26414 t.set(array2, array1.length); 26415 return t; 26416 } 26417 26418 function calculatePDF20Hash(password, input, userBytes) { 26419 var k = calculateSHA256(input, 0, input.length).subarray(0, 32); 26420 var e = [0]; 26421 var i = 0; 26422 26423 while (i < 64 || e[e.length - 1] > i - 32) { 26424 var arrayLength = password.length + k.length + userBytes.length; 26425 var k1 = new Uint8Array(arrayLength * 64); 26426 var array = concatArrays(password, k); 26427 array = concatArrays(array, userBytes); 26428 26429 for (var j = 0, pos = 0; j < 64; j++, pos += arrayLength) { 26430 k1.set(array, pos); 26431 } 26432 26433 var cipher = new AES128Cipher(k.subarray(0, 16)); 26434 e = cipher.encrypt(k1, k.subarray(16, 32)); 26435 var remainder = 0; 26436 26437 for (var z = 0; z < 16; z++) { 26438 remainder *= 256 % 3; 26439 remainder %= 3; 26440 remainder += (e[z] >>> 0) % 3; 26441 remainder %= 3; 26442 } 26443 26444 if (remainder === 0) { 26445 k = calculateSHA256(e, 0, e.length); 26446 } else if (remainder === 1) { 26447 k = calculateSHA384(e, 0, e.length); 26448 } else if (remainder === 2) { 26449 k = calculateSHA512(e, 0, e.length); 26450 } 26451 26452 i++; 26453 } 26454 26455 return k.subarray(0, 32); 26456 } 26457 26458 function PDF20() {} 26459 26460 function compareByteArrays(array1, array2) { 26461 if (array1.length !== array2.length) { 26462 return false; 26463 } 26464 26465 for (var i = 0; i < array1.length; i++) { 26466 if (array1[i] !== array2[i]) { 26467 return false; 26468 } 26469 } 26470 26471 return true; 26472 } 26473 26474 PDF20.prototype = { 26475 hash: function PDF20_hash(password, concatBytes, userBytes) { 26476 return calculatePDF20Hash(password, concatBytes, userBytes); 26477 }, 26478 checkOwnerPassword: function PDF20_checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { 26479 var hashData = new Uint8Array(password.length + 56); 26480 hashData.set(password, 0); 26481 hashData.set(ownerValidationSalt, password.length); 26482 hashData.set(userBytes, password.length + ownerValidationSalt.length); 26483 var result = calculatePDF20Hash(password, hashData, userBytes); 26484 return compareByteArrays(result, ownerPassword); 26485 }, 26486 checkUserPassword: function PDF20_checkUserPassword(password, userValidationSalt, userPassword) { 26487 var hashData = new Uint8Array(password.length + 8); 26488 hashData.set(password, 0); 26489 hashData.set(userValidationSalt, password.length); 26490 var result = calculatePDF20Hash(password, hashData, []); 26491 return compareByteArrays(result, userPassword); 26492 }, 26493 getOwnerKey: function PDF20_getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { 26494 var hashData = new Uint8Array(password.length + 56); 26495 hashData.set(password, 0); 26496 hashData.set(ownerKeySalt, password.length); 26497 hashData.set(userBytes, password.length + ownerKeySalt.length); 26498 var key = calculatePDF20Hash(password, hashData, userBytes); 26499 var cipher = new AES256Cipher(key); 26500 return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); 26501 }, 26502 getUserKey: function PDF20_getUserKey(password, userKeySalt, userEncryption) { 26503 var hashData = new Uint8Array(password.length + 8); 26504 hashData.set(password, 0); 26505 hashData.set(userKeySalt, password.length); 26506 var key = calculatePDF20Hash(password, hashData, []); 26507 var cipher = new AES256Cipher(key); 26508 return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); 26509 } 26510 }; 26511 return PDF20; 26512}(); 26513 26514exports.PDF20 = PDF20; 26515 26516var CipherTransform = function CipherTransformClosure() { 26517 function CipherTransform(stringCipherConstructor, streamCipherConstructor) { 26518 this.StringCipherConstructor = stringCipherConstructor; 26519 this.StreamCipherConstructor = streamCipherConstructor; 26520 } 26521 26522 CipherTransform.prototype = { 26523 createStream: function CipherTransform_createStream(stream, length) { 26524 var cipher = new this.StreamCipherConstructor(); 26525 return new _stream.DecryptStream(stream, length, function cipherTransformDecryptStream(data, finalize) { 26526 return cipher.decryptBlock(data, finalize); 26527 }); 26528 }, 26529 decryptString: function CipherTransform_decryptString(s) { 26530 var cipher = new this.StringCipherConstructor(); 26531 var data = (0, _util.stringToBytes)(s); 26532 data = cipher.decryptBlock(data, true); 26533 return (0, _util.bytesToString)(data); 26534 } 26535 }; 26536 return CipherTransform; 26537}(); 26538 26539var CipherTransformFactory = function CipherTransformFactoryClosure() { 26540 var defaultPasswordBytes = new Uint8Array([0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41, 0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08, 0x2E, 0x2E, 0x00, 0xB6, 0xD0, 0x68, 0x3E, 0x80, 0x2F, 0x0C, 0xA9, 0xFE, 0x64, 0x53, 0x69, 0x7A]); 26541 26542 function createEncryptionKey20(revision, password, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms) { 26543 if (password) { 26544 var passwordLength = Math.min(127, password.length); 26545 password = password.subarray(0, passwordLength); 26546 } else { 26547 password = []; 26548 } 26549 26550 var pdfAlgorithm; 26551 26552 if (revision === 6) { 26553 pdfAlgorithm = new PDF20(); 26554 } else { 26555 pdfAlgorithm = new PDF17(); 26556 } 26557 26558 if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, userPassword)) { 26559 return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); 26560 } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, ownerValidationSalt, uBytes, ownerPassword)) { 26561 return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, ownerEncryption); 26562 } 26563 26564 return null; 26565 } 26566 26567 function prepareKeyData(fileId, password, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata) { 26568 var hashDataSize = 40 + ownerPassword.length + fileId.length; 26569 var hashData = new Uint8Array(hashDataSize), 26570 i = 0, 26571 j, 26572 n; 26573 26574 if (password) { 26575 n = Math.min(32, password.length); 26576 26577 for (; i < n; ++i) { 26578 hashData[i] = password[i]; 26579 } 26580 } 26581 26582 j = 0; 26583 26584 while (i < 32) { 26585 hashData[i++] = defaultPasswordBytes[j++]; 26586 } 26587 26588 for (j = 0, n = ownerPassword.length; j < n; ++j) { 26589 hashData[i++] = ownerPassword[j]; 26590 } 26591 26592 hashData[i++] = flags & 0xFF; 26593 hashData[i++] = flags >> 8 & 0xFF; 26594 hashData[i++] = flags >> 16 & 0xFF; 26595 hashData[i++] = flags >>> 24 & 0xFF; 26596 26597 for (j = 0, n = fileId.length; j < n; ++j) { 26598 hashData[i++] = fileId[j]; 26599 } 26600 26601 if (revision >= 4 && !encryptMetadata) { 26602 hashData[i++] = 0xFF; 26603 hashData[i++] = 0xFF; 26604 hashData[i++] = 0xFF; 26605 hashData[i++] = 0xFF; 26606 } 26607 26608 var hash = calculateMD5(hashData, 0, i); 26609 var keyLengthInBytes = keyLength >> 3; 26610 26611 if (revision >= 3) { 26612 for (j = 0; j < 50; ++j) { 26613 hash = calculateMD5(hash, 0, keyLengthInBytes); 26614 } 26615 } 26616 26617 var encryptionKey = hash.subarray(0, keyLengthInBytes); 26618 var cipher, checkData; 26619 26620 if (revision >= 3) { 26621 for (i = 0; i < 32; ++i) { 26622 hashData[i] = defaultPasswordBytes[i]; 26623 } 26624 26625 for (j = 0, n = fileId.length; j < n; ++j) { 26626 hashData[i++] = fileId[j]; 26627 } 26628 26629 cipher = new ARCFourCipher(encryptionKey); 26630 checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); 26631 n = encryptionKey.length; 26632 var derivedKey = new Uint8Array(n), 26633 k; 26634 26635 for (j = 1; j <= 19; ++j) { 26636 for (k = 0; k < n; ++k) { 26637 derivedKey[k] = encryptionKey[k] ^ j;
26638 } 26639 26640 cipher = new ARCFourCipher(derivedKey); 26641 checkData = cipher.encryptBlock(checkData); 26642 } 26643 26644 for (j = 0, n = checkData.length; j < n; ++j) { 26645 if (userPassword[j] !== checkData[j]) { 26646 return null; 26647 } 26648 } 26649 } else { 26650 cipher = new ARCFourCipher(encryptionKey); 26651 checkData = cipher.encryptBlock(defaultPasswordBytes); 26652 26653 for (j = 0, n = checkData.length; j < n; ++j) { 26654 if (userPassword[j] !== checkData[j]) { 26655 return null; 26656 } 26657 } 26658 } 26659 26660 return encryptionKey; 26661 } 26662 26663 function decodeUserPassword(password, ownerPassword, revision, keyLength) { 26664 var hashData = new Uint8Array(32), 26665 i = 0, 26666 j, 26667 n; 26668 n = Math.min(32, password.length); 26669 26670 for (; i < n; ++i) { 26671 hashData[i] = password[i]; 26672 } 26673 26674 j = 0; 26675 26676 while (i < 32) { 26677 hashData[i++] = defaultPasswordBytes[j++]; 26678 } 26679 26680 var hash = calculateMD5(hashData, 0, i); 26681 var keyLengthInBytes = keyLength >> 3; 26682 26683 if (revision >= 3) { 26684 for (j = 0; j < 50; ++j) { 26685 hash = calculateMD5(hash, 0, hash.length); 26686 } 26687 } 26688 26689 var cipher, userPassword; 26690 26691 if (revision >= 3) { 26692 userPassword = ownerPassword; 26693 var derivedKey = new Uint8Array(keyLengthInBytes), 26694 k; 26695 26696 for (j = 19; j >= 0; j--) { 26697 for (k = 0; k < keyLengthInBytes; ++k) { 26698 derivedKey[k] = hash[k] ^ j; 26699 } 26700 26701 cipher = new ARCFourCipher(derivedKey); 26702 userPassword = cipher.encryptBlock(userPassword); 26703 } 26704 } else { 26705 cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); 26706 userPassword = cipher.encryptBlock(ownerPassword); 26707 } 26708 26709 return userPassword; 26710 } 26711 26712 var identityName = _primitives.Name.get('Identity'); 26713 26714 function CipherTransformFactory(dict, fileId, password) { 26715 var filter = dict.get('Filter'); 26716 26717 if (!(0, _primitives.isName)(filter, 'Standard')) { 26718 throw new _util.FormatError('unknown encryption method'); 26719 } 26720 26721 this.dict = dict; 26722 var algorithm = dict.get('V'); 26723 26724 if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) { 26725 throw new _util.FormatError('unsupported encryption algorithm'); 26726 } 26727 26728 this.algorithm = algorithm; 26729 var keyLength = dict.get('Length'); 26730 26731 if (!keyLength) { 26732 if (algorithm <= 3) { 26733 keyLength = 40; 26734 } else { 26735 var cfDict = dict.get('CF'); 26736 var streamCryptoName = dict.get('StmF'); 26737 26738 if ((0, _primitives.isDict)(cfDict) && (0, _primitives.isName)(streamCryptoName)) { 26739 cfDict.suppressEncryption = true; 26740 var handlerDict = cfDict.get(streamCryptoName.name); 26741 keyLength = handlerDict && handlerDict.get('Length') || 128; 26742 26743 if (keyLength < 40) { 26744 keyLength <<= 3; 26745 } 26746 } 26747 } 26748 } 26749 26750 if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) { 26751 throw new _util.FormatError('invalid key length'); 26752 } 26753 26754 var ownerPassword = (0, _util.stringToBytes)(dict.get('O')).subarray(0, 32); 26755 var userPassword = (0, _util.stringToBytes)(dict.get('U')).subarray(0, 32); 26756 var flags = dict.get('P'); 26757 var revision = dict.get('R'); 26758 var encryptMetadata = (algorithm === 4 || algorithm === 5) && dict.get('EncryptMetadata') !== false; 26759 this.encryptMetadata = encryptMetadata; 26760 var fileIdBytes = (0, _util.stringToBytes)(fileId); 26761 var passwordBytes; 26762 26763 if (password) { 26764 if (revision === 6) { 26765 try { 26766 password = (0, _util.utf8StringToString)(password); 26767 } catch (ex) { 26768 (0, _util.warn)('CipherTransformFactory: ' + 'Unable to convert UTF8 encoded password.'); 26769 } 26770 } 26771 26772 passwordBytes = (0, _util.stringToBytes)(password); 26773 } 26774 26775 var encryptionKey; 26776 26777 if (algorithm !== 5) { 26778 encryptionKey = prepareKeyData(fileIdBytes, passwordBytes, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); 26779 } else { 26780 var ownerValidationSalt = (0, _util.stringToBytes)(dict.get('O')).subarray(32, 40);
26781 var ownerKeySalt = (0, _util.stringToBytes)(dict.get('O')).subarray(40, 48); 26782 var uBytes = (0, _util.stringToBytes)(dict.get('U')).subarray(0, 48); 26783 var userValidationSalt = (0, _util.stringToBytes)(dict.get('U')).subarray(32, 40); 26784 var userKeySalt = (0, _util.stringToBytes)(dict.get('U')).subarray(40, 48); 26785 var ownerEncryption = (0, _util.stringToBytes)(dict.get('OE')); 26786 var userEncryption = (0, _util.stringToBytes)(dict.get('UE')); 26787 var perms = (0, _util.stringToBytes)(dict.get('Perms')); 26788 encryptionKey = createEncryptionKey20(revision, passwordBytes, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms); 26789 } 26790 26791 if (!encryptionKey && !password) { 26792 throw new _util.PasswordException('No password given', _util.PasswordResponses.NEED_PASSWORD); 26793 } else if (!encryptionKey && password) { 26794 var decodedPassword = decodeUserPassword(passwordBytes, ownerPassword, revision, keyLength); 26795 encryptionKey = prepareKeyData(fileIdBytes, decodedPassword, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); 26796 } 26797 26798 if (!encryptionKey) { 26799 throw new _util.PasswordException('Incorrect Password', _util.PasswordResponses.INCORRECT_PASSWORD); 26800 } 26801 26802 this.encryptionKey = encryptionKey; 26803 26804 if (algorithm >= 4) { 26805 var cf = dict.get('CF'); 26806 26807 if ((0, _primitives.isDict)(cf)) { 26808 cf.suppressEncryption = true; 26809 } 26810 26811 this.cf = cf; 26812 this.stmf = dict.get('StmF') || identityName; 26813 this.strf = dict.get('StrF') || identityName; 26814 this.eff = dict.get('EFF') || this.stmf; 26815 } 26816 } 26817 26818 function buildObjectKey(num, gen, encryptionKey, isAes) { 26819 var key = new Uint8Array(encryptionKey.length + 9), 26820 i, 26821 n; 26822 26823 for (i = 0, n = encryptionKey.length; i < n; ++i) { 26824 key[i] = encryptionKey[i]; 26825 } 26826 26827 key[i++] = num & 0xFF; 26828 key[i++] = num >> 8 & 0xFF; 26829 key[i++] = num >> 16 & 0xFF; 26830 key[i++] = gen & 0xFF; 26831 key[i++] = gen >> 8 & 0xFF; 26832 26833 if (isAes) { 26834 key[i++] = 0x73; 26835 key[i++] = 0x41; 26836 key[i++] = 0x6C; 26837 key[i++] = 0x54; 26838 } 26839 26840 var hash = calculateMD5(key, 0, i); 26841 return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); 26842 } 26843 26844 function buildCipherConstructor(cf, name, num, gen, key) { 26845 if (!(0, _primitives.isName)(name)) { 26846 throw new _util.FormatError('Invalid crypt filter name.'); 26847 } 26848 26849 var cryptFilter = cf.get(name.name); 26850 var cfm; 26851
26852 if (cryptFilter !== null && cryptFilter !== undefined) { 26853 cfm = cryptFilter.get('CFM'); 26854 } 26855 26856 if (!cfm || cfm.name === 'None') { 26857 return function cipherTransformFactoryBuildCipherConstructorNone() { 26858 return new NullCipher(); 26859 }; 26860 } 26861 26862 if (cfm.name === 'V2') { 26863 return function cipherTransformFactoryBuildCipherConstructorV2() { 26864 return new ARCFourCipher(buildObjectKey(num, gen, key, false)); 26865 }; 26866 } 26867 26868 if (cfm.name === 'AESV2') { 26869 return function cipherTransformFactoryBuildCipherConstructorAESV2() { 26870 return new AES128Cipher(buildObjectKey(num, gen, key, true)); 26871 }; 26872 } 26873 26874 if (cfm.name === 'AESV3') { 26875 return function cipherTransformFactoryBuildCipherConstructorAESV3() { 26876 return new AES256Cipher(key); 26877 }; 26878 } 26879 26880 throw new _util.FormatError('Unknown crypto method'); 26881 } 26882 26883 CipherTransformFactory.prototype = { 26884 createCipherTransform: function CipherTransformFactory_createCipherTransform(num, gen) { 26885 if (this.algorithm === 4 || this.algorithm === 5) { 26886 return new CipherTransform(buildCipherConstructor(this.cf, this.stmf, num, gen, this.encryptionKey), buildCipherConstructor(this.cf, this.strf, num, gen, this.encryptionKey)); 26887 } 26888 26889 var key = buildObjectKey(num, gen, this.encryptionKey, false); 26890 26891 var cipherConstructor = function buildCipherCipherConstructor() { 26892 return new ARCFourCipher(key); 26893 }; 26894 26895 return new CipherTransform(cipherConstructor, cipherConstructor); 26896 } 26897 }; 26898 return CipherTransformFactory; 26899}(); 26900 26901exports.CipherTransformFactory = CipherTransformFactory; 26902 26903/***/ }), 26904/* 168 */ 26905/***/ (function(module, exports, __w_pdfjs_require__) { 26906 26907"use strict"; 26908 26909 26910Object.defineProperty(exports, "__esModule", { 26911 value: true 26912}); 26913exports.ColorSpace = void 0; 26914 26915var _util = __w_pdfjs_require__(6); 26916 26917var _primitives = __w_pdfjs_require__(155); 26918 26919function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 26920 26921function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 26922 26923function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 26924 26925function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 26926 26927function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 26928 26929function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 26930 26931function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 26932 26933function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 26934 26935function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 26936 26937function resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) { 26938 var COMPONENTS = 3; 26939 alpha01 = alpha01 !== 1 ? 0 : alpha01; 26940 var xRatio = w1 / w2; 26941 var yRatio = h1 / h2; 26942 var newIndex = 0, 26943 oldIndex; 26944 var xScaled = new Uint16Array(w2); 26945 var w1Scanline = w1 * COMPONENTS; 26946 26947 for (var i = 0; i < w2; i++) { 26948 xScaled[i] = Math.floor(i * xRatio) * COMPONENTS; 26949 } 26950 26951 for (var _i = 0; _i < h2; _i++) { 26952 var py = Math.floor(_i * yRatio) * w1Scanline; 26953 26954 for (var j = 0; j < w2; j++) { 26955 oldIndex = py + xScaled[j]; 26956 dest[newIndex++] = src[oldIndex++]; 26957 dest[newIndex++] = src[oldIndex++]; 26958 dest[newIndex++] = src[oldIndex++]; 26959 newIndex += alpha01; 26960 } 26961 } 26962} 26963 26964var ColorSpace = 26965/*#__PURE__*/ 26966function () { 26967 function ColorSpace(name, numComps) { 26968 _classCallCheck(this, ColorSpace); 26969 26970 if (this.constructor === ColorSpace) { 26971 (0, _util.unreachable)('Cannot initialize ColorSpace.'); 26972 } 26973 26974 this.name = name; 26975 this.numComps = numComps; 26976 } 26977 26978 _createClass(ColorSpace, [{ 26979 key: "getRgb", 26980 value: function getRgb(src, srcOffset) { 26981 var rgb = new Uint8ClampedArray(3); 26982 this.getRgbItem(src, srcOffset, rgb, 0); 26983 return rgb; 26984 } 26985 }, { 26986 key: "getRgbItem",
26987 value: function getRgbItem(src, srcOffset, dest, destOffset) { 26988 (0, _util.unreachable)('Should not call ColorSpace.getRgbItem'); 26989 } 26990 }, { 26991 key: "getRgbBuffer", 26992 value: function getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 26993 (0, _util.unreachable)('Should not call ColorSpace.getRgbBuffer'); 26994 } 26995 }, { 26996 key: "getOutputLength", 26997 value: function getOutputLength(inputLength, alpha01) { 26998 (0, _util.unreachable)('Should not call ColorSpace.getOutputLength'); 26999 } 27000 }, { 27001 key: "isPassthrough", 27002 value: function isPassthrough(bits) { 27003 return false; 27004 } 27005 }, { 27006 key: "isDefaultDecode", 27007 value: function isDefaultDecode(decodeMap, bpc) { 27008 return ColorSpace.isDefaultDecode(decodeMap, this.numComps); 27009 } 27010 }, { 27011 key: "fillRgb", 27012 value: function fillRgb(dest, originalWidth, originalHeight, width, height, actualHeight, bpc, comps, alpha01) { 27013 var count = originalWidth * originalHeight; 27014 var rgbBuf = null; 27015 var numComponentColors = 1 << bpc; 27016 var needsResizing = originalHeight !== height || originalWidth !== width; 27017 27018 if (this.isPassthrough(bpc)) { 27019 rgbBuf = comps; 27020 } else if (this.numComps === 1 && count > numComponentColors && this.name !== 'DeviceGray' && this.name !== 'DeviceRGB') { 27021 var allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : new Uint16Array(numComponentColors); 27022 27023 for (var i = 0; i < numComponentColors; i++) { 27024 allColors[i] = i; 27025 } 27026 27027 var colorMap = new Uint8ClampedArray(numComponentColors * 3); 27028 this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, 0); 27029 27030 if (!needsResizing) { 27031 var destPos = 0; 27032 27033 for (var _i2 = 0; _i2 < count; ++_i2) { 27034 var key = comps[_i2] * 3; 27035 dest[destPos++] = colorMap[key]; 27036 dest[destPos++] = colorMap[key + 1]; 27037 dest[destPos++] = colorMap[key + 2]; 27038 destPos += alpha01; 27039 } 27040 } else { 27041 rgbBuf = new Uint8Array(count * 3); 27042 var rgbPos = 0; 27043 27044 for (var _i3 = 0; _i3 < count; ++_i3) { 27045 var _key = comps[_i3] * 3; 27046 27047 rgbBuf[rgbPos++] = colorMap[_key]; 27048 rgbBuf[rgbPos++] = colorMap[_key + 1]; 27049 rgbBuf[rgbPos++] = colorMap[_key + 2]; 27050 } 27051 } 27052 } else { 27053 if (!needsResizing) { 27054 this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, alpha01); 27055 } else { 27056 rgbBuf = new Uint8ClampedArray(count * 3); 27057 this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, 0); 27058 } 27059 } 27060 27061 if (rgbBuf) { 27062 if (needsResizing) { 27063 resizeRgbImage(rgbBuf, dest, originalWidth, originalHeight, width, height, alpha01); 27064 } else { 27065 var _destPos = 0, 27066 _rgbPos = 0; 27067 27068 for (var _i4 = 0, ii = width * actualHeight; _i4 < ii; _i4++) { 27069 dest[_destPos++] = rgbBuf[_rgbPos++]; 27070 dest[_destPos++] = rgbBuf[_rgbPos++]; 27071 dest[_destPos++] = rgbBuf[_rgbPos++]; 27072 _destPos += alpha01; 27073 } 27074 } 27075 } 27076 } 27077 }, { 27078 key: "usesZeroToOneRange", 27079 get: function get() { 27080 return (0, _util.shadow)(this, 'usesZeroToOneRange', true); 27081 } 27082 }], [{ 27083 key: "parse", 27084 value: function parse(cs, xref, res, pdfFunctionFactory) { 27085 var IR = this.parseToIR(cs, xref, res, pdfFunctionFactory); 27086 return this.fromIR(IR); 27087 } 27088 }, { 27089 key: "fromIR", 27090 value: function fromIR(IR) { 27091 var name = Array.isArray(IR) ? IR[0] : IR; 27092 var whitePoint, blackPoint, gamma; 27093 27094 switch (name) { 27095 case 'DeviceGrayCS': 27096 return this.singletons.gray; 27097 27098 case 'DeviceRgbCS': 27099 return this.singletons.rgb; 27100 27101 case 'DeviceCmykCS': 27102 return this.singletons.cmyk; 27103 27104 case 'CalGrayCS': 27105 whitePoint = IR[1]; 27106 blackPoint = IR[2]; 27107 gamma = IR[3]; 27108 return new CalGrayCS(whitePoint, blackPoint, gamma); 27109 27110 case 'CalRGBCS': 27111 whitePoint = IR[1]; 27112 blackPoint = IR[2]; 27113 gamma = IR[3]; 27114 var matrix = IR[4]; 27115 return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); 27116 27117 case 'PatternCS': 27118 var basePatternCS = IR[1]; 27119 27120 if (basePatternCS) { 27121 basePatternCS = this.fromIR(basePatternCS); 27122 } 27123 27124 return new PatternCS(basePatternCS); 27125 27126 case 'IndexedCS': 27127 var baseIndexedCS = IR[1]; 27128 var hiVal = IR[2]; 27129 var lookup = IR[3]; 27130 return new IndexedCS(this.fromIR(baseIndexedCS), hiVal, lookup); 27131 27132 case 'AlternateCS': 27133 var numComps = IR[1]; 27134 var alt = IR[2]; 27135 var tintFn = IR[3]; 27136 return new AlternateCS(numComps, this.fromIR(alt), tintFn); 27137 27138 case 'LabCS': 27139 whitePoint = IR[1]; 27140 blackPoint = IR[2]; 27141 var range = IR[3];
27142 return new LabCS(whitePoint, blackPoint, range); 27143 27144 default: 27145 throw new _util.FormatError("Unknown colorspace name: ".concat(name)); 27146 } 27147 } 27148 }, { 27149 key: "parseToIR", 27150 value: function parseToIR(cs, xref) { 27151 var res = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; 27152 var pdfFunctionFactory = arguments.length > 3 ? arguments[3] : undefined; 27153 cs = xref.fetchIfRef(cs); 27154 27155 if ((0, _primitives.isName)(cs)) { 27156 switch (cs.name) { 27157 case 'DeviceGray': 27158 case 'G': 27159 return 'DeviceGrayCS'; 27160 27161 case 'DeviceRGB': 27162 case 'RGB': 27163 return 'DeviceRgbCS'; 27164 27165 case 'DeviceCMYK': 27166 case 'CMYK': 27167 return 'DeviceCmykCS'; 27168 27169 case 'Pattern': 27170 return ['PatternCS', null]; 27171 27172 default: 27173 if ((0, _primitives.isDict)(res)) { 27174 var colorSpaces = res.get('ColorSpace'); 27175 27176 if ((0, _primitives.isDict)(colorSpaces)) { 27177 var resCS = colorSpaces.get(cs.name); 27178 27179 if (resCS) { 27180 if ((0, _primitives.isName)(resCS)) { 27181 return this.parseToIR(resCS, xref, res, pdfFunctionFactory); 27182 } 27183 27184 cs = resCS; 27185 break; 27186 } 27187 } 27188 } 27189 27190 throw new _util.FormatError("unrecognized colorspace ".concat(cs.name)); 27191 } 27192 } 27193 27194 if (Array.isArray(cs)) { 27195 var mode = xref.fetchIfRef(cs[0]).name; 27196 var numComps, params, alt, whitePoint, blackPoint, gamma; 27197 27198 switch (mode) { 27199 case 'DeviceGray': 27200 case 'G': 27201 return 'DeviceGrayCS'; 27202 27203 case 'DeviceRGB': 27204 case 'RGB': 27205 return 'DeviceRgbCS'; 27206 27207 case 'DeviceCMYK': 27208 case 'CMYK': 27209 return 'DeviceCmykCS'; 27210 27211 case 'CalGray': 27212 params = xref.fetchIfRef(cs[1]); 27213 whitePoint = params.getArray('WhitePoint'); 27214 blackPoint = params.getArray('BlackPoint'); 27215 gamma = params.get('Gamma'); 27216 return ['CalGrayCS', whitePoint, blackPoint, gamma]; 27217 27218 case 'CalRGB': 27219 params = xref.fetchIfRef(cs[1]); 27220 whitePoint = params.getArray('WhitePoint'); 27221 blackPoint = params.getArray('BlackPoint'); 27222 gamma = params.getArray('Gamma'); 27223 var matrix = params.getArray('Matrix'); 27224 return ['CalRGBCS', whitePoint, blackPoint, gamma, matrix]; 27225 27226 case 'ICCBased': 27227 var stream = xref.fetchIfRef(cs[1]); 27228 var dict = stream.dict; 27229 numComps = dict.get('N'); 27230 alt = dict.get('Alternate'); 27231 27232 if (alt) { 27233 var altIR = this.parseToIR(alt, xref, res, pdfFunctionFactory); 27234 var altCS = this.fromIR(altIR, pdfFunctionFactory); 27235 27236 if (altCS.numComps === numComps) { 27237 return altIR; 27238 } 27239 27240 (0, _util.warn)('ICCBased color space: Ignoring incorrect /Alternate entry.'); 27241 } 27242 27243 if (numComps === 1) { 27244 return 'DeviceGrayCS'; 27245 } else if (numComps === 3) { 27246 return 'DeviceRgbCS'; 27247 } else if (numComps === 4) { 27248 return 'DeviceCmykCS'; 27249 } 27250 27251 break; 27252 27253 case 'Pattern': 27254 var basePatternCS = cs[1] || null; 27255 27256 if (basePatternCS) { 27257 basePatternCS = this.parseToIR(basePatternCS, xref, res, pdfFunctionFactory); 27258 } 27259 27260 return ['PatternCS', basePatternCS]; 27261 27262 case 'Indexed': 27263 case 'I': 27264 var baseIndexedCS = this.parseToIR(cs[1], xref, res, pdfFunctionFactory); 27265 var hiVal = xref.fetchIfRef(cs[2]) + 1; 27266 var lookup = xref.fetchIfRef(cs[3]); 27267 27268 if ((0, _primitives.isStream)(lookup)) { 27269 lookup = lookup.getBytes(); 27270 } 27271 27272 return ['IndexedCS', baseIndexedCS, hiVal, lookup]; 27273 27274 case 'Separation': 27275 case 'DeviceN': 27276 var name = xref.fetchIfRef(cs[1]); 27277 numComps = Array.isArray(name) ? name.length : 1; 27278 alt = this.parseToIR(cs[2], xref, res, pdfFunctionFactory); 27279 var tintFn = pdfFunctionFactory.create(xref.fetchIfRef(cs[3])); 27280 return ['AlternateCS', numComps, alt, tintFn]; 27281 27282 case 'Lab': 27283 params = xref.fetchIfRef(cs[1]); 27284 whitePoint = params.getArray('WhitePoint'); 27285 blackPoint = params.getArray('BlackPoint'); 27286 var range = params.getArray('Range'); 27287 return ['LabCS', whitePoint, blackPoint, range]; 27288 27289 default: 27290 throw new _util.FormatError("unimplemented color space object \"".concat(mode, "\"")); 27291 } 27292 } 27293 27294 throw new _util.FormatError("unrecognized color space object: \"".concat(cs, "\"")); 27295 } 27296 }, { 27297 key: "isDefaultDecode", 27298 value: function isDefaultDecode(decode, numComps) { 27299 if (!Array.isArray(decode)) { 27300 return true; 27301 } 27302 27303 if (numComps * 2 !== decode.length) { 27304 (0, _util.warn)('The decode map is not the correct length'); 27305 return true; 27306 } 27307 27308 for (var i = 0, ii = decode.length; i < ii; i += 2) { 27309 if (decode[i] !== 0 || decode[i + 1] !== 1) { 27310 return false; 27311 } 27312 } 27313 27314 return true; 27315 } 27316 }, { 27317 key: "singletons", 27318 get: function get() { 27319 return (0, _util.shadow)(this, 'singletons', { 27320 get gray() { 27321 return (0, _util.shadow)(this, 'gray', new DeviceGrayCS()); 27322 }, 27323 27324 get rgb() { 27325 return (0, _util.shadow)(this, 'rgb', new DeviceRgbCS()); 27326 }, 27327 27328 get cmyk() { 27329 return (0, _util.shadow)(this, 'cmyk', new DeviceCmykCS()); 27330 } 27331 27332 }); 27333 } 27334 }]); 27335 27336 return ColorSpace; 27337}();
27338 27339exports.ColorSpace = ColorSpace; 27340 27341var AlternateCS = 27342/*#__PURE__*/ 27343function (_ColorSpace) { 27344 _inherits(AlternateCS, _ColorSpace); 27345 27346 function AlternateCS(numComps, base, tintFn) { 27347 var _this; 27348 27349 _classCallCheck(this, AlternateCS); 27350 27351 _this = _possibleConstructorReturn(this, _getPrototypeOf(AlternateCS).call(this, 'Alternate', numComps)); 27352 _this.base = base; 27353 _this.tintFn = tintFn; 27354 _this.tmpBuf = new Float32Array(base.numComps); 27355 return _this; 27356 } 27357 27358 _createClass(AlternateCS, [{ 27359 key: "getRgbItem", 27360 value: function getRgbItem(src, srcOffset, dest, destOffset) { 27361 var tmpBuf = this.tmpBuf; 27362 this.tintFn(src, srcOffset, tmpBuf, 0); 27363 this.base.getRgbItem(tmpBuf, 0, dest, destOffset); 27364 } 27365 }, { 27366 key: "getRgbBuffer", 27367 value: function getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 27368 var tintFn = this.tintFn; 27369 var base = this.base; 27370 var scale = 1 / ((1 << bits) - 1); 27371 var baseNumComps = base.numComps; 27372 var usesZeroToOneRange = base.usesZeroToOneRange; 27373 var isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && alpha01 === 0; 27374 var pos = isPassthrough ? destOffset : 0; 27375 var baseBuf = isPassthrough ? dest : new Uint8ClampedArray(baseNumComps * count); 27376 var numComps = this.numComps; 27377 var scaled = new Float32Array(numComps); 27378 var tinted = new Float32Array(baseNumComps); 27379 var i, j; 27380 27381 for (i = 0; i < count; i++) { 27382 for (j = 0; j < numComps; j++) { 27383 scaled[j] = src[srcOffset++] * scale; 27384 } 27385 27386 tintFn(scaled, 0, tinted, 0); 27387 27388 if (usesZeroToOneRange) { 27389 for (j = 0; j < baseNumComps; j++) { 27390 baseBuf[pos++] = tinted[j] * 255; 27391 } 27392 } else { 27393 base.getRgbItem(tinted, 0, baseBuf, pos); 27394 pos += baseNumComps; 27395 } 27396 } 27397 27398 if (!isPassthrough) { 27399 base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01); 27400 } 27401 } 27402 }, { 27403 key: "getOutputLength", 27404 value: function getOutputLength(inputLength, alpha01) { 27405 return this.base.getOutputLength(inputLength * this.base.numComps / this.numComps, alpha01); 27406 } 27407 }]); 27408 27409 return AlternateCS; 27410}(ColorSpace); 27411 27412var PatternCS = 27413/*#__PURE__*/ 27414function (_ColorSpace2) { 27415 _inherits(PatternCS, _ColorSpace2); 27416 27417 function PatternCS(baseCS) { 27418 var _this2; 27419 27420 _classCallCheck(this, PatternCS); 27421 27422 _this2 = _possibleConstructorReturn(this, _getPrototypeOf(PatternCS).call(this, 'Pattern', null)); 27423 _this2.base = baseCS; 27424 return _this2; 27425 } 27426 27427 _createClass(PatternCS, [{ 27428 key: "isDefaultDecode", 27429 value: function isDefaultDecode(decodeMap, bpc) { 27430 (0, _util.unreachable)('Should not call PatternCS.isDefaultDecode'); 27431 } 27432 }]); 27433 27434 return PatternCS; 27435}(ColorSpace); 27436 27437var IndexedCS = 27438/*#__PURE__*/ 27439function (_ColorSpace3) { 27440 _inherits(IndexedCS, _ColorSpace3); 27441 27442 function IndexedCS(base, highVal, lookup) { 27443 var _this3; 27444 27445 _classCallCheck(this, IndexedCS); 27446 27447 _this3 = _possibleConstructorReturn(this, _getPrototypeOf(IndexedCS).call(this, 'Indexed', 1)); 27448 _this3.base = base; 27449 _this3.highVal = highVal; 27450 var baseNumComps = base.numComps; 27451 var length = baseNumComps * highVal; 27452 27453 if ((0, _primitives.isStream)(lookup)) { 27454 _this3.lookup = new Uint8Array(length); 27455 var bytes = lookup.getBytes(length); 27456 27457 _this3.lookup.set(bytes); 27458 } else if ((0, _util.isString)(lookup)) { 27459 _this3.lookup = new Uint8Array(length); 27460 27461 for (var i = 0; i < length; ++i) { 27462 _this3.lookup[i] = lookup.charCodeAt(i); 27463 } 27464 } else if (lookup instanceof Uint8Array) { 27465 _this3.lookup = lookup; 27466 } else { 27467 throw new _util.FormatError("Unrecognized lookup table: ".concat(lookup)); 27468 } 27469 27470 return _this3; 27471 } 27472 27473 _createClass(IndexedCS, [{ 27474 key: "getRgbItem", 27475 value: function getRgbItem(src, srcOffset, dest, destOffset) { 27476 var numComps = this.base.numComps; 27477 var start = src[srcOffset] * numComps; 27478 this.base.getRgbBuffer(this.lookup, start, 1, dest, destOff
27478set, 8, 0); 27479 } 27480 }, { 27481 key: "getRgbBuffer", 27482 value: function getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 27483 var base = this.base; 27484 var numComps = base.numComps; 27485 var outputDelta = base.getOutputLength(numComps, alpha01); 27486 var lookup = this.lookup; 27487 27488 for (var i = 0; i < count; ++i) { 27489 var lookupPos = src[srcOffset++] * numComps; 27490 base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01); 27491 destOffset += outputDelta; 27492 } 27493 } 27494 }, { 27495 key: "getOutputLength", 27496 value: function getOutputLength(inputLength, alpha01) { 27497 return this.base.getOutputLength(inputLength * this.base.numComps, alpha01); 27498 } 27499 }, { 27500 key: "isDefaultDecode", 27501 value: function isDefaultDecode(decodeMap, bpc) { 27502 if (!Array.isArray(decodeMap)) { 27503 return true; 27504 } 27505 27506 if (decodeMap.length !== 2) { 27507 (0, _util.warn)('Decode map length is not correct'); 27508 return true; 27509 } 27510 27511 if (!Number.isInteger(bpc) || bpc < 1) { 27512 (0, _util.warn)('Bits per component is not correct'); 27513 return true; 27514 } 27515 27516 return decodeMap[0] === 0 && decodeMap[1] === (1 << bpc) - 1; 27517 } 27518 }]); 27519 27520 return IndexedCS; 27521}(ColorSpace); 27522 27523var DeviceGrayCS = 27524/*#__PURE__*/ 27525function (_ColorSpace4) { 27526 _inherits(DeviceGrayCS, _ColorSpace4); 27527 27528 function DeviceGrayCS() { 27529 _classCallCheck(this, DeviceGrayCS); 27530 27531 return _possibleConstructorReturn(this, _getPrototypeOf(DeviceGrayCS).call(this, 'DeviceGray', 1)); 27532 } 27533 27534 _createClass(DeviceGrayCS, [{ 27535 key: "getRgbItem", 27536 value: function getRgbItem(src, srcOffset, dest, destOffset) { 27537 var c = src[srcOffset] * 255; 27538 dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c; 27539 } 27540 }, { 27541 key: "getRgbBuffer", 27542 value: function getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 27543 var scale = 255 / ((1 << bits) - 1); 27544 var j = srcOffset, 27545 q = destOffset; 27546 27547 for (var i = 0; i < count; ++i) { 27548 var c = scale * src[j++]; 27549 dest[q++] = c; 27550 dest[q++] = c; 27551 dest[q++] = c; 27552 q += alpha01; 27553 } 27554 } 27555 }, { 27556 key: "getOutputLength", 27557 value: function getOutputLength(inputLength, alpha01) { 27558 return inputLength * (3 + alpha01); 27559 } 27560 }]); 27561 27562 return DeviceGrayCS; 27563}(ColorSpace); 27564 27565var DeviceRgbCS = 27566/*#__PURE__*/ 27567function (_ColorSpace5) { 27568 _inherits(DeviceRgbCS, _ColorSpace5); 27569 27570 function DeviceRgbCS() { 27571 _classCallCheck(this, DeviceRgbCS); 27572 27573 return _possibleConstructorReturn(this, _getPrototypeOf(DeviceRgbCS).call(this, 'DeviceRGB', 3)); 27574 } 27575 27576 _createClass(DeviceRgbCS, [{ 27577 key: "getRgbItem", 27578 value: function getRgbItem(src, srcOffset, dest, destOffset) { 27579 dest[destOffset] = src[srcOffset] * 255; 27580 dest[destOffset + 1] = src[srcOffset + 1] * 255; 27581 dest[destOffset + 2] = src[srcOffset + 2] * 255; 27582 } 27583 }, { 27584 key: "getRgbBuffer", 27585 value: function getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 27586 if (bits === 8 && alpha01 === 0) { 27587 dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset); 27588 return; 27589 } 27590 27591 var scale = 255 / ((1 << bits) - 1); 27592 var j = srcOffset, 27593 q = destOffset; 27594 27595 for (var i = 0; i < count; ++i) { 27596 dest[q++] = scale * src[j++]; 27597 dest[q++] = scale * src[j++]; 27598 dest[q++] = scale * src[j++]; 27599 q += alpha01; 27600 } 27601 } 27602 }, { 27603 key: "getOutputLength", 27604 value: function getOutputLength(inputLength, alpha01) { 27605 return inputLength * (3 + alpha01) / 3 | 0; 27606 } 27607 }, { 27608 key: "isPassthrough", 27609 value: function isPassthrough(bits) { 27610 return bits === 8; 27611 } 27612 }]); 27613 27614 return DeviceRgbCS; 27615}(ColorSpace); 27616 27617var DeviceCmykCS = function DeviceCmykCSClosure() { 27618 function convertToRgb(src, srcOffset, srcScale, dest, destOffset) { 27619 var c = src[srcOffset] * srcScale; 27620 var m = src[srcOffset + 1] * srcScale; 27621 var y = src[srcOffset + 2] * srcScale; 27622 var k = src[srcOffset + 3] * srcScale; 27623 dest[destOffset] = 255 + c * (-4.387332384609988 * c + 54.48615194189176 * m + 18.82290502165302 * y + 212.25662451639585 * k + -285.2331026137004) + m * (1.7149763477362134 * m - 5.6096736904047315 * y + -17.873870861415444 * k - 5.497006427196366) + y * (-2.5217340131683033 * y - 21.248923337353073 * k + 17.5119270841813) + k * (-21.86122147463605 * k - 189.48180835922747); 27624 dest[destOffset + 1] = 255 + c * (8.841041422036149 * c + 60.
vendor: 4,054 bytes, lines 27624-27728
27624118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k + -79.2970844816548) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 190.9453302588951) + y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) + k * (-20.737325471181034 * k - 187.80453709719578); 27625 dest[destOffset + 2] = 255 + c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k + -14.183576799673286) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 112.23884253719248) + y * (0.03296041114873217 * y + 115.60384449646641 * k + -193.58209356861505) + k * (-22.33816807309886 * k - 180.12613974708367); 27626 } 27627 27628 var DeviceCmykCS = 27629 /*#__PURE__*/ 27630 function (_ColorSpace6) { 27631 _inherits(DeviceCmykCS, _ColorSpace6); 27632 27633 function DeviceCmykCS() { 27634 _classCallCheck(this, DeviceCmykCS); 27635 27636 return _possibleConstructorReturn(this, _getPrototypeOf(DeviceCmykCS).call(this, 'DeviceCMYK', 4)); 27637 } 27638 27639 _createClass(DeviceCmykCS, [{ 27640 key: "getRgbItem", 27641 value: function getRgbItem(src, srcOffset, dest, destOffset) { 27642 convertToRgb(src, srcOffset, 1, dest, destOffset); 27643 } 27644 }, { 27645 key: "getRgbBuffer", 27646 value: function getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 27647 var scale = 1 / ((1 << bits) - 1); 27648 27649 for (var i = 0; i < count; i++) { 27650 convertToRgb(src, srcOffset, scale, dest, destOffset); 27651 srcOffset += 4; 27652 destOffset += 3 + alpha01; 27653 } 27654 } 27655 }, { 27656 key: "getOutputLength", 27657 value: function getOutputLength(inputLength, alpha01) { 27658 return inputLength / 4 * (3 + alpha01) | 0; 27659 } 27660 }]); 27661 27662 return DeviceCmykCS; 27663 }(ColorSpace); 27664 27665 return DeviceCmykCS; 27666}(); 27667 27668var CalGrayCS = function CalGrayCSClosure() { 27669 function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { 27670 var A = src[srcOffset] * scale; 27671 var AG = Math.pow(A, cs.G); 27672 var L = cs.YW * AG; 27673 var val = Math.max(295.8 * Math.pow(L, 0.333333333333333333) - 40.8, 0); 27674 dest[destOffset] = val; 27675 dest[destOffset + 1] = val; 27676 dest[destOffset + 2] = val; 27677 } 27678 27679 var CalGrayCS = 27680 /*#__PURE__*/ 27681 function (_ColorSpace7) { 27682 _inherits(CalGrayCS, _ColorSpace7); 27683 27684 function CalGrayCS(whitePoint, blackPoint, gamma) { 27685 var _this4; 27686 27687 _classCallCheck(this, CalGrayCS); 27688 27689 _this4 = _possibleConstructorReturn(this, _getPrototypeOf(CalGrayCS).call(this, 'CalGray', 1)); 27690 27691 if (!whitePoint) { 27692 throw new _util.FormatError('WhitePoint missing - required for color space CalGray'); 27693 } 27694 27695 blackPoint = blackPoint || [0, 0, 0]; 27696 gamma = gamma || 1; 27697 _this4.XW = whitePoint[0]; 27698 _this4.YW = whitePoint[1]; 27699 _this4.ZW = whitePoint[2]; 27700 _this4.XB = blackPoint[0]; 27701 _this4.YB = blackPoint[1]; 27702 _this4.ZB = blackPoint[2]; 27703 _this4.G = gamma; 27704 27705 if (_this4.XW < 0 || _this4.ZW < 0 || _this4.YW !== 1) { 27706 throw new _util.FormatError("Invalid WhitePoint components for ".concat(_this4.name) + ', no fallback available'); 27707 } 27708 27709 if (_this4.XB < 0 || _this4.YB < 0 || _this4.ZB < 0) { 27710 (0, _util.info)("Invalid BlackPoint for ".concat(_this4.name, ", falling back to default.")); 27711 _this4.XB = _this4.YB = _this4.ZB = 0; 27712 } 27713 27714 if (_this4.XB !== 0 || _this4.YB !== 0 || _this4.ZB !== 0) { 27715 (0, _util.warn)("".concat(_this4.name, ", BlackPoint: XB: ").concat(_this4.XB, ", YB: ").concat(_this4.YB, ", ") + "ZB: ".concat(_this4.ZB, ", only default values are supported.")); 27716 } 27717 27718 if (_this4.G < 1) { 27719 (0, _util.info)("Invalid Gamma: ".concat(_this4.G, " for ").concat(_this4.name, ", ") + 'falling back to default.'); 27720 _this4.G = 1; 27721 } 27722 27723 return _this4; 27724 } 27725 27726 _createClass(CalGrayCS, [{ 27727 key: "getRgbItem", 27728 value: function getRgbItem(src, srcOffset, dest, destOffset) {
vendor: 3,310 bytes, lines 27729-27825
27729 convertToRgb(this, src, srcOffset, dest, destOffset, 1); 27730 } 27731 }, { 27732 key: "getRgbBuffer", 27733 value: function getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 27734 var scale = 1 / ((1 << bits) - 1); 27735 27736 for (var i = 0; i < count; ++i) { 27737 convertToRgb(this, src, srcOffset, dest, destOffset, scale); 27738 srcOffset += 1; 27739 destOffset += 3 + alpha01; 27740 } 27741 } 27742 }, { 27743 key: "getOutputLength", 27744 value: function getOutputLength(inputLength, alpha01) { 27745 return inputLength * (3 + alpha01); 27746 } 27747 }]); 27748 27749 return CalGrayCS; 27750 }(ColorSpace); 27751 27752 return CalGrayCS; 27753}(); 27754 27755var CalRGBCS = function CalRGBCSClosure() { 27756 var BRADFORD_SCALE_MATRIX = new Float32Array([0.8951, 0.2664, -0.1614, -0.7502, 1.7135, 0.0367, 0.0389, -0.0685, 1.0296]); 27757 var BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([0.9869929, -0.1470543, 0.1599627, 0.4323053, 0.5183603, 0.0492912, -0.0085287, 0.0400428, 0.9684867]); 27758 var SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([3.2404542, -1.5371385, -0.4985314, -0.9692660, 1.8760108, 0.0415560, 0.0556434, -0.2040259, 1.0572252]); 27759 var FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]); 27760 var tempNormalizeMatrix = new Float32Array(3); 27761 var tempConvertMatrix1 = new Float32Array(3); 27762 var tempConvertMatrix2 = new Float32Array(3); 27763 var DECODE_L_CONSTANT = Math.pow((8 + 16) / 116, 3) / 8.0; 27764 27765 function matrixProduct(a, b, result) { 27766 result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; 27767 result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2]; 27768 result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2]; 27769 } 27770 27771 function convertToFlat(sourceWhitePoint, LMS, result) { 27772 result[0] = LMS[0] * 1 / sourceWhitePoint[0]; 27773 result[1] = LMS[1] * 1 / sourceWhitePoint[1]; 27774 result[2] = LMS[2] * 1 / sourceWhitePoint[2]; 27775 } 27776 27777 function convertToD65(sourceWhitePoint, LMS, result) { 27778 var D65X = 0.95047; 27779 var D65Y = 1; 27780 var D65Z = 1.08883; 27781 result[0] = LMS[0] * D65X / sourceWhitePoint[0]; 27782 result[1] = LMS[1] * D65Y / sourceWhitePoint[1]; 27783 result[2] = LMS[2] * D65Z / sourceWhitePoint[2]; 27784 } 27785 27786 function sRGBTransferFunction(color) { 27787 if (color <= 0.0031308) { 27788 return adjustToRange(0, 1, 12.92 * color); 27789 } 27790 27791 return adjustToRange(0, 1, (1 + 0.055) * Math.pow(color, 1 / 2.4) - 0.055); 27792 } 27793 27794 function adjustToRange(min, max, value) { 27795 return Math.max(min, Math.min(max, value)); 27796 } 27797 27798 function decodeL(L) { 27799 if (L < 0) { 27800 return -decodeL(-L); 27801 } 27802 27803 if (L > 8.0) { 27804 return Math.pow((L + 16) / 116, 3); 27805 } 27806 27807 return L * DECODE_L_CONSTANT; 27808 } 27809 27810 function compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) { 27811 if (sourceBlackPoint[0] === 0 && sourceBlackPoint[1] === 0 && sourceBlackPoint[2] === 0) { 27812 result[0] = XYZ_Flat[0]; 27813 result[1] = XYZ_Flat[1]; 27814 result[2] = XYZ_Flat[2]; 27815 return; 27816 } 27817 27818 var zeroDecodeL = decodeL(0); 27819 var X_DST = zeroDecodeL; 27820 var X_SRC = decodeL(sourceBlackPoint[0]); 27821 var Y_DST = zeroDecodeL; 27822 var Y_SRC = decodeL(sourceBlackPoint[1]); 27823 var Z_DST = zeroDecodeL; 27824 var Z_SRC = decodeL(sourceBlackPoint[2]); 27825 var X_Scale = (1 - X_DST) / (1 - X_SRC);
vendor: 8,608 bytes, lines 27826-28081
27826 var X_Offset = 1 - X_Scale; 27827 var Y_Scale = (1 - Y_DST) / (1 - Y_SRC); 27828 var Y_Offset = 1 - Y_Scale; 27829 var Z_Scale = (1 - Z_DST) / (1 - Z_SRC); 27830 var Z_Offset = 1 - Z_Scale; 27831 result[0] = XYZ_Flat[0] * X_Scale + X_Offset; 27832 result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset; 27833 result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset; 27834 } 27835 27836 function normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) { 27837 if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) { 27838 result[0] = XYZ_In[0]; 27839 result[1] = XYZ_In[1]; 27840 result[2] = XYZ_In[2]; 27841 return; 27842 } 27843 27844 var LMS = result; 27845 matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); 27846 var LMS_Flat = tempNormalizeMatrix; 27847 convertToFlat(sourceWhitePoint, LMS, LMS_Flat); 27848 matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result); 27849 } 27850 27851 function normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) { 27852 var LMS = result; 27853 matrixProduct(BRADFORD_SCALE_MATRIX, XYZ_In, LMS); 27854 var LMS_D65 = tempNormalizeMatrix; 27855 convertToD65(sourceWhitePoint, LMS, LMS_D65); 27856 matrixProduct(BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result); 27857 } 27858 27859 function convertToRgb(cs, src, srcOffset, dest, destOffset, scale) { 27860 var A = adjustToRange(0, 1, src[srcOffset] * scale); 27861 var B = adjustToRange(0, 1, src[srcOffset + 1] * scale); 27862 var C = adjustToRange(0, 1, src[srcOffset + 2] * scale); 27863 var AGR = Math.pow(A, cs.GR); 27864 var BGG = Math.pow(B, cs.GG); 27865 var CGB = Math.pow(C, cs.GB); 27866 var X = cs.MXA * AGR + cs.MXB * BGG + cs.MXC * CGB; 27867 var Y = cs.MYA * AGR + cs.MYB * BGG + cs.MYC * CGB; 27868 var Z = cs.MZA * AGR + cs.MZB * BGG + cs.MZC * CGB; 27869 var XYZ = tempConvertMatrix1; 27870 XYZ[0] = X; 27871 XYZ[1] = Y; 27872 XYZ[2] = Z; 27873 var XYZ_Flat = tempConvertMatrix2; 27874 normalizeWhitePointToFlat(cs.whitePoint, XYZ, XYZ_Flat); 27875 var XYZ_Black = tempConvertMatrix1; 27876 compensateBlackPoint(cs.blackPoint, XYZ_Flat, XYZ_Black); 27877 var XYZ_D65 = tempConvertMatrix2; 27878 normalizeWhitePointToD65(FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65); 27879 var SRGB = tempConvertMatrix1; 27880 matrixProduct(SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB); 27881 dest[destOffset] = sRGBTransferFunction(SRGB[0]) * 255; 27882 dest[destOffset + 1] = sRGBTransferFunction(SRGB[1]) * 255; 27883 dest[destOffset + 2] = sRGBTransferFunction(SRGB[2]) * 255; 27884 } 27885 27886 var CalRGBCS = 27887 /*#__PURE__*/ 27888 function (_ColorSpace8) { 27889 _inherits(CalRGBCS, _ColorSpace8); 27890 27891 function CalRGBCS(whitePoint, blackPoint, gamma, matrix) { 27892 var _this5; 27893 27894 _classCallCheck(this, CalRGBCS); 27895 27896 _this5 = _possibleConstructorReturn(this, _getPrototypeOf(CalRGBCS).call(this, 'CalRGB', 3)); 27897 27898 if (!whitePoint) { 27899 throw new _util.FormatError('WhitePoint missing - required for color space CalRGB'); 27900 } 27901 27902 blackPoint = blackPoint || new Float32Array(3); 27903 gamma = gamma || new Float32Array([1, 1, 1]); 27904 matrix = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); 27905 var XW = whitePoint[0]; 27906 var YW = whitePoint[1]; 27907 var ZW = whitePoint[2]; 27908 _this5.whitePoint = whitePoint; 27909 var XB = blackPoint[0]; 27910 var YB = blackPoint[1]; 27911 var ZB = blackPoint[2]; 27912 _this5.blackPoint = blackPoint; 27913 _this5.GR = gamma[0]; 27914 _this5.GG = gamma[1]; 27915 _this5.GB = gamma[2]; 27916 _this5.MXA = matrix[0]; 27917 _this5.MYA = matrix[1]; 27918 _this5.MZA = matrix[2]; 27919 _this5.MXB = matrix[3]; 27920 _this5.MYB = matrix[4]; 27921 _this5.MZB = matrix[5]; 27922 _this5.MXC = matrix[6]; 27923 _this5.MYC = matrix[7]; 27924 _this5.MZC = matrix[8]; 27925 27926 if (XW < 0 || ZW < 0 || YW !== 1) { 27927 throw new _util.FormatError("Invalid WhitePoint components for ".concat(_this5.name) + ', no fallback available'); 27928 } 27929 27930 if (XB < 0 || YB < 0 || ZB < 0) { 27931 (0, _util.info)("Invalid BlackPoint for ".concat(_this5.name, " [").concat(XB, ", ").concat(YB, ", ").concat(ZB, "], ") + 'falling back to default.'); 27932 _this5.blackPoint = new Float32Array(3); 27933 } 27934 27935 if (_this5.GR < 0 || _this5.GG < 0 || _this5.GB < 0) { 27936 (0, _util.info)("Invalid Gamma [".concat(_this5.GR, ", ").concat(_this5.GG, ", ").concat(_this5.GB, "] for ") + "".concat(_this5.name, ", falling back to default.")); 27937 _this5.GR = _this5.GG = _this5.GB = 1; 27938 } 27939 27940 return _this5; 27941 } 27942 27943 _createClass(CalRGBCS, [{ 27944 key: "getRgbItem", 27945 value: function getRgbItem(src, srcOffset, dest, destOffset) { 27946 convertToRgb(this, src, srcOffset, dest, destOffset, 1); 27947 } 27948 }, { 27949 key: "getRgbBuffer", 27950 value: function getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { 27951 var scale = 1 / ((1 << bits) - 1); 27952 27953 for (var i = 0; i < count; ++i) { 27954 convertToRgb(this, src, srcOffset, dest, destOffset, scale); 27955 srcOffset += 3; 27956 destOffset += 3 + alpha01; 27957 } 27958 } 27959 }, { 27960 key: "getOutputLength", 27961 value: function getOutputLength(inputLength, alpha01) { 27962 return inputLength * (3 + alpha01) / 3 | 0; 27963 } 27964 }]); 27965 27966 return CalRGBCS; 27967 }(ColorSpace); 27968 27969 return CalRGBCS; 27970}(); 27971 27972var LabCS = function LabCSClosure() { 27973 function fn_g(x) { 27974 var result; 27975 27976 if (x >= 6 / 29) { 27977 result = x * x * x; 27978 } else { 27979 result = 108 / 841 * (x - 4 / 29); 27980 } 27981 27982 return result; 27983 } 27984 27985 function decode(value, high1, low2, high2) { 27986 return low2 + value * (high2 - low2) / high1; 27987 } 27988 27989 function convertToRgb(cs, src, srcOffset, maxVal, dest, destOffset) { 27990 var Ls = src[srcOffset]; 27991 var as = src[srcOffset + 1]; 27992 var bs = src[srcOffset + 2]; 27993 27994 if (maxVal !== false) { 27995 Ls = decode(Ls, maxVal, 0, 100); 27996 as = decode(as, maxVal, cs.amin, cs.amax); 27997 bs = decode(bs, maxVal, cs.bmin, cs.bmax); 27998 } 27999 28000 as = as > cs.amax ? cs.amax : as < cs.amin ? cs.amin : as; 28001 bs = bs > cs.bmax ? cs.bmax : bs < cs.bmin ? cs.bmin : bs; 28002 var M = (Ls + 16) / 116; 28003 var L = M + as / 500; 28004 var N = M - bs / 200; 28005 var X = cs.XW * fn_g(L); 28006 var Y = cs.YW * fn_g(M); 28007 var Z = cs.ZW * fn_g(N); 28008 var r, g, b; 28009 28010 if (cs.ZW < 1) { 28011 r = X * 3.1339 + Y * -1.6170 + Z * -0.4906; 28012 g = X * -0.9785 + Y * 1.9160 + Z * 0.0333; 28013 b = X * 0.0720 + Y * -0.2290 + Z * 1.4057; 28014 } else { 28015 r = X * 3.2406 + Y * -1.5372 + Z * -0.4986; 28016 g = X * -0.9689 + Y * 1.8758 + Z * 0.0415; 28017 b = X * 0.0557 + Y * -0.2040 + Z * 1.0570; 28018 } 28019 28020 dest[destOffset] = Math.sqrt(r) * 255; 28021 dest[destOffset + 1] = Math.sqrt(g) * 255; 28022 dest[destOffset + 2] = Math.sqrt(b) * 255; 28023 } 28024 28025 var LabCS = 28026 /*#__PURE__*/ 28027 function (_ColorSpace9) { 28028 _inherits(LabCS, _ColorSpace9); 28029 28030 function LabCS(whitePoint, blackPoint, range) { 28031 var _this6; 28032 28033 _classCallCheck(this, LabCS); 28034 28035 _this6 = _possibleConstructorReturn(this, _getPrototypeOf(LabCS).call(this, 'Lab', 3)); 28036 28037 if (!whitePoint) { 28038 throw new _util.FormatError('WhitePoint missing - required for color space Lab'); 28039 } 28040 28041 blackPoint = blackPoint || [0, 0, 0]; 28042 range = range || [-100, 100, -100, 100]; 28043 _this6.XW = whitePoint[0]; 28044 _this6.YW = whitePoint[1]; 28045 _this6.ZW = whitePoint[2]; 28046 _this6.amin = range[0]; 28047 _this6.amax = range[1]; 28048 _this6.bmin = range[2]; 28049 _this6.bmax = range[3]; 28050 _this6.XB = blackPoint[0]; 28051 _this6.YB = blackPoint[1]; 28052 _this6.ZB = blackPoint[2]; 28053 28054 if (_this6.XW < 0 || _this6.ZW < 0 || _this6.YW !== 1) { 28055 throw new _util.FormatError('Invalid WhitePoint components, no fallback available'); 28056 } 28057 28058 if (_this6.XB < 0 || _this6.YB < 0 || _this6.ZB < 0) { 28059 (0, _util.info)('Invalid BlackPoint, falling back to default'); 28060 _this6.XB = _this6.YB = _this6.ZB = 0; 28061 } 28062 28063 if (_this6.amin > _this6.amax || _this6.bmin > _this6.bmax) { 28064 (0, _util.info)('Invalid Range, falling back to defaults'); 28065 _this6.amin = -100; 28066 _this6.amax = 100; 28067 _this6.bmin = -100; 28068 _this6.bmax = 100; 28069 } 28070 28071 return _this6; 28072 } 28073 28074 _createClass(LabCS, [{ 28075 key: "getRgbItem", 28076 value: function getRgbItem(src, srcOffset, dest, destOffset) { 28077 convertToRgb(this, src, srcOffset, false, dest, destOffset); 28078 } 28079 }, { 28080 key: "getRgbBuffer", 28081 value: function getRgbBuffer(src, srcOffset, count, dest, destOff
28081set, bits, alpha01) { 28082 var maxVal = (1 << bits) - 1; 28083 28084 for (var i = 0; i < count; i++) { 28085 convertToRgb(this, src, srcOffset, maxVal, dest, destOffset); 28086 srcOffset += 3; 28087 destOffset += 3 + alpha01; 28088 } 28089 } 28090 }, { 28091 key: "getOutputLength", 28092 value: function getOutputLength(inputLength, alpha01) { 28093 return inputLength * (3 + alpha01) / 3 | 0; 28094 } 28095 }, { 28096 key: "isDefaultDecode", 28097 value: function isDefaultDecode(decodeMap, bpc) { 28098 return true; 28099 } 28100 }, { 28101 key: "usesZeroToOneRange", 28102 get: function get() { 28103 return (0, _util.shadow)(this, 'usesZeroToOneRange', false); 28104 } 28105 }]); 28106 28107 return LabCS; 28108 }(ColorSpace); 28109 28110 return LabCS; 28111}(); 28112 28113/***/ }), 28114/* 169 */ 28115/***/ (function(module, exports, __w_pdfjs_require__) { 28116 28117"use strict"; 28118 28119 28120Object.defineProperty(exports, "__esModule", { 28121 value: true 28122}); 28123exports.AnnotationFactory = exports.AnnotationBorderStyle = exports.Annotation = void 0; 28124 28125var _util = __w_pdfjs_require__(6); 28126 28127var _obj = __w_pdfjs_require__(154); 28128 28129var _primitives = __w_pdfjs_require__(155); 28130 28131var _colorspace = __w_pdfjs_require__(168); 28132 28133var _operator_list = __w_pdfjs_require__(170); 28134 28135var _stream = __w_pdfjs_require__(157); 28136 28137function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 28138 28139function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 28140 28141function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 28142 28143function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); } 28144 28145function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } 28146 28147function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 28148 28149function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 28150 28151function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 28152 28153function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 28154 28155function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 28156 28157function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 28158 28159var AnnotationFactory = 28160/*#__PURE__*/ 28161function () { 28162 function AnnotationFactory() { 28163 _classCallCheck(this, AnnotationFactory); 28164 } 28165 28166 _createClass(AnnotationFactory, null, [{ 28167 key: "create", 28168 value: function create(xref, ref, pdfManager, idFactory) { 28169 return pdfManager.ensure(this, '_create', [xref, ref, pdfManager, idFactory]); 28170 } 28171 }, { 28172 key: "_create", 28173 value: function _create(xref, ref, pdfManager, idFactory) { 28174 var dict = xref.fetchIfRef(ref); 28175 28176 if (!(0, _primitives.isDict)(dict)) { 28177 return; 28178 } 28179 28180 var id = (0, _primitives.isRef)(ref) ? ref.toString() : 'annot_' + idFactory.createObjId(); 28181 var subtype = dict.get('Subtype'); 28182 subtype = (0, _primitives.isName)(subtype) ? subtype.name : null; 28183 var parameters = { 28184 xref: xref, 28185 dict: dict, 28186 ref: (0, _primitives.isRef)(ref) ? ref : null, 28187 subtype: subtype, 28188 id: id, 28189 pdfManager: pdfManager 28190 }; 28191 28192 switch (subtype) { 28193 case 'Link': 28194 return new LinkAnnotation(parameters); 28195 28196 case 'Text': 28197 return new TextAnnotation(parameters); 28198 28199 case 'Widget': 28200 var fieldType = (0, _util.getInheritableProperty)({ 28201 dict: dict, 28202 key: 'FT' 28203 }); 28204 fieldType = (0, _primitives.isName)(fieldType) ? fieldType.n
28204ame : null; 28205 28206 switch (fieldType) { 28207 case 'Tx': 28208 return new TextWidgetAnnotation(parameters); 28209 28210 case 'Btn': 28211 return new ButtonWidgetAnnotation(parameters); 28212 28213 case 'Ch': 28214 return new ChoiceWidgetAnnotation(parameters); 28215 } 28216 28217 (0, _util.warn)('Unimplemented widget field type "' + fieldType + '", ' + 'falling back to base field type.'); 28218 return new WidgetAnnotation(parameters); 28219 28220 case 'Popup': 28221 return new PopupAnnotation(parameters); 28222 28223 case 'Line': 28224 return new LineAnnotation(parameters); 28225 28226 case 'Square': 28227 return new SquareAnnotation(parameters); 28228 28229 case 'Circle': 28230 return new CircleAnnotation(parameters); 28231 28232 case 'PolyLine': 28233 return new PolylineAnnotation(parameters); 28234 28235 case 'Polygon': 28236 return new PolygonAnnotation(parameters); 28237 28238 case 'Ink': 28239 return new InkAnnotation(parameters); 28240 28241 case 'Highlight': 28242 return new HighlightAnnotation(parameters); 28243 28244 case 'Underline': 28245 return new UnderlineAnnotation(parameters); 28246 28247 case 'Squiggly': 28248 return new SquigglyAnnotation(parameters); 28249 28250 case 'StrikeOut': 28251 return new StrikeOutAnnotation(parameters); 28252 28253 case 'Stamp': 28254 return new StampAnnotation(parameters); 28255 28256 case 'FileAttachment': 28257 return new FileAttachmentAnnotation(parameters); 28258 28259 default: 28260 if (!subtype) { 28261 (0, _util.warn)('Annotation is missing the required /Subtype.'); 28262 } else { 28263 (0, _util.warn)('Unimplemented annotation type "' + subtype + '", ' + 'falling back to base annotation.'); 28264 } 28265 28266 return new Annotation(parameters); 28267 } 28268 } 28269 }]); 28270 28271 return AnnotationFactory; 28272}(); 28273 28274exports.AnnotationFactory = AnnotationFactory; 28275 28276function getTransformMatrix(rect, bbox, matrix) { 28277 var bounds = _util.Util.getAxialAlignedBoundingBox(bbox, matrix); 28278 28279 var minX = bounds[0]; 28280 var minY = bounds[1]; 28281 var maxX = bounds[2]; 28282 var maxY = bounds[3]; 28283 28284 if (minX === maxX || minY === maxY) { 28285 return [1, 0, 0, 1, rect[0], rect[1]]; 28286 } 28287 28288 var xRatio = (rect[2] - rect[0]) / (maxX - minX); 28289 var yRatio = (rect[3] - rect[1]) / (maxY - minY); 28290 return [xRatio, 0, 0, yRatio, rect[0] - minX * xRatio, rect[1] - minY * yRatio]; 28291} 28292 28293var Annotation = 28294/*#__PURE__*/ 28295function () { 28296 function Annotation(params) { 28297 _classCallCheck(this, Annotation); 28298 28299 var dict = params.dict; 28300 this.setFlags(dict.get('F')); 28301 this.setRectangle(dict.getArray('Rect')); 28302 this.setColor(dict.getArray('C')); 28303 this.setBorderStyle(dict); 28304 this.setAppearance(dict); 28305 this.data = { 28306 annotationFlags: this.flags, 28307 borderStyle: this.borderStyle, 28308 color: this.color, 28309 hasAppearance: !!this.appearance, 28310 id: params.id, 28311 rect: this.rectangle, 28312 subtype: params.subtype 28313 }; 28314 } 28315 28316 _createClass(Annotation, [{ 28317 key: "_hasFlag", 28318 value: function _hasFlag(flags, flag) { 28319 return !!(flags & flag); 28320 } 28321 }, { 28322 key: "_isViewable", 28323 value: function _isViewable(flags) { 28324 return !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN) && !this._hasFlag(flags, _util.AnnotationFlag.NOVIEW); 28325 } 28326 }, { 28327 key: "_isPrintable", 28328 value: function _isPrintable(flags) { 28329 return this._hasFlag(flags, _util.AnnotationFlag.PRINT) && !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN); 28330 } 28331 }, { 28332 key: "setFlags", 28333 value: function setFlags(flags) { 28334 this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0; 28335 } 28336 }, { 28337 key: "hasFlag", 28338 value: function hasFlag(flag) { 28339 return this._hasFlag(this.flags, flag); 28340 } 28341 }, { 28342 key: "setRectangle", 28343 value: function setRectangle(rectangle) { 28344 if (Array.isArray(rectangle) && rectangle.length === 4) { 28345 this.rectangle = _util.Util.normalizeRect(rectangle); 28346 } else { 28347 this.rectangle = [0, 0, 0, 0]; 28348 } 28349 } 28350 }, { 28351 key: "setColor", 28352 value: function setColor(color) { 28353 var rgbColor = new Uint8ClampedArray(3); 28354 28355 if (!Array.isArray(color)) { 28356 this.color = rgbColor; 28357 return; 28358 } 28359 28360 switch (color.length) { 28361 case 0: 28362 this.color = null; 28363 break; 28364 28365 case 1: 28366 _colorspace.ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0); 28367 28368 this.color = rgbColor; 28369 break; 28370 28371 case 3: 28372 _colorspace.ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0); 28373 28374 this.color = rgbColor; 28375 break; 28376 28377 case 4: 28378 _colorspace.ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0); 28379 28380 this.color = rgbColor; 28381 break; 28382 28383 default: 28384 this.color = rgbColor; 28385 break; 28386 } 28387 } 28388 }, { 28389 key: "setBorderStyle", 28390 value: function setBorderStyle(borderStyle) { 28391 this.borderStyle = new AnnotationBorderStyle(); 28392 28393 if (!(0, _primitives.isDict)(borderStyle)) { 28394 return; 28395 } 28396 28397 if (borderStyle.has('BS')) { 28398 var dict = borderStyle.get('BS'); 28399 var dictType = dict.get('Type'); 28400 28401 if (!dictType || (0, _primitives.isName)(dictType, 'Border')) { 28402 this.borderStyle.setWidth(dict.get('W')); 28403 this.borderStyle.setStyle(dict.get('S')); 28404 this.borderStyle.setDashArray(dict.getArray('D')); 28405 } 28406 } else if (borderStyle.has('Border')) { 28407 var array = borderStyle.getArray('Border'); 28408 28409 if (Array.isArray(array) && array.length >= 3) { 28410 this.borderStyle.setHorizontalCornerRadius(array[0]); 28411 this.borderStyle.setVerticalCornerRadius(array[1]); 28412 this.borderStyle.setWidth(array[2]); 28413 28414 if (array.length === 4) { 28415 this.borderStyle.setDashArray(array[3]); 28416 } 28417 } 28418 } else { 28419 this.borderStyle.setWidth(0); 28420 } 28421 } 28422 }, { 28423 key: "setAppearance", 28424 value: function setAppearance(dict) { 28425 this.appearance = null; 28426 var appearanceStates = dict.get('AP'); 28427 28428 if (!(0, _primitives.isDict)(appearanceStates)) { 28429 return; 28430 } 28431 28432 var normalAppearanceState = appearanceStates.get('N'); 28433 28434 if ((0, _primitives.isStream)(normalAppearanceState)) { 28435 this.appearance = normalAppearanceState; 28436 return; 28437 } 28438 28439 if (!(0, _primitives.isDict)(normalAppearanceState)) { 28440 return; 28441 } 28442 28443 var as = dict.get('AS'); 28444 28445 if (!(0, _primitives.isName)(as) || !normalAppearanceState.has(as.name)) { 28446 return; 28447 } 28448 28449 this.appearance = normalAppearanceState.get(as.name); 28450 } 28451 }, { 28452 key: "_preparePopup", 28453 value: function _preparePopup(dict) { 28454 if (!dict.has('C')) { 28455 this.data.color = null; 28456 } 28457 28458 this.data.hasPopup = dict.has('Popup'); 28459 this.data.title = (0, _util.stringToPDFString)(dict.get('T') || ''); 28460 this.data.contents = (0, _util.stringToPDFString)(dict.get('Contents') || ''); 28461 } 28462 }, { 28463 key: "loadResources", 28464 value: function loadResources(keys) { 28465 return this.appearance.dict.getAsync('Resources').then(function (resources) { 28466 if (!resources) { 28467 return; 28468 } 28469 28470 var objectLoader = new _obj.ObjectLoader(resources, keys, resources.xref); 28471 return objectLoader.load().then(function () { 28472 return resources; 28473 }); 28474 }); 28475 } 28476 }, { 28477 key: "getOperatorList", 28478 value: function getOperatorList(evaluator, task, renderForms) { 28479 var _this = this; 28480 28481 if (!this.appearance) { 28482 return Promise.resolve(new _operator_list.OperatorList()); 28483 } 28484 28485 var data = this.data; 28486 var appearanceDict = this.appearance.dict; 28487 var resourcesPromise = this.loadResources(['ExtGState', 'ColorSpace', 'Pattern', 'Shading', 'XObject', 'Font']); 28488 var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1]; 28489 var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0, 0]; 28490 var transform = getTransformMatrix(data.rect, bbox, matrix); 28491 return resourcesPromise.then(function (resources) { 28492 var opList = new _operator_list.OperatorList(); 28493 opList.addOp(_util.OPS.beginAnnotation, [data.rect, transform, matrix]); 28494 return evaluator.getOperatorList({ 28495 stream: _this.appearance, 28496 task: task, 28497 resources: resources, 28498 operatorList: opList 28499 }).then(function () { 28500 opList.addOp(_util.OPS.endAnnotation, []); 28501 28502 _this.appearance.reset(); 28503 28504 return opList; 28505 }); 28506 }); 28507 } 28508 }, {
28509 key: "viewable", 28510 get: function get() { 28511 if (this.flags === 0) { 28512 return true; 28513 } 28514 28515 return this._isViewable(this.flags); 28516 } 28517 }, { 28518 key: "printable", 28519 get: function get() { 28520 if (this.flags === 0) { 28521 return false; 28522 } 28523 28524 return this._isPrintable(this.flags); 28525 } 28526 }]); 28527 28528 return Annotation; 28529}(); 28530 28531exports.Annotation = Annotation; 28532 28533var AnnotationBorderStyle = 28534/*#__PURE__*/ 28535function () { 28536 function AnnotationBorderStyle() { 28537 _classCallCheck(this, AnnotationBorderStyle); 28538 28539 this.width = 1; 28540 this.style = _util.AnnotationBorderStyleType.SOLID; 28541 this.dashArray = [3]; 28542 this.horizontalCornerRadius = 0; 28543 this.verticalCornerRadius = 0; 28544 } 28545 28546 _createClass(AnnotationBorderStyle, [{ 28547 key: "setWidth", 28548 value: function setWidth(width) { 28549 if ((0, _primitives.isName)(width)) { 28550 this.width = 0; 28551 return; 28552 } 28553 28554 if (Number.isInteger(width)) { 28555 this.width = width; 28556 } 28557 } 28558 }, { 28559 key: "setStyle", 28560 value: function setStyle(style) { 28561 if (!(0, _primitives.isName)(style)) { 28562 return; 28563 } 28564 28565 switch (style.name) { 28566 case 'S': 28567 this.style = _util.AnnotationBorderStyleType.SOLID; 28568 break; 28569 28570 case 'D': 28571 this.style = _util.AnnotationBorderStyleType.DASHED; 28572 break; 28573 28574 case 'B': 28575 this.style = _util.AnnotationBorderStyleType.BEVELED; 28576 break; 28577 28578 case 'I': 28579 this.style = _util.AnnotationBorderStyleType.INSET; 28580 break; 28581 28582 case 'U': 28583 this.style = _util.AnnotationBorderStyleType.UNDERLINE; 28584 break; 28585 28586 default: 28587 break; 28588 } 28589 } 28590 }, { 28591 key: "setDashArray", 28592 value: function setDashArray(dashArray) { 28593 if (Array.isArray(dashArray) && dashArray.length > 0) { 28594 var isValid = true; 28595 var allZeros = true; 28596 28597 for (var i = 0, len = dashArray.length; i < len; i++) { 28598 var element = dashArray[i]; 28599 var validNumber = +element >= 0; 28600 28601 if (!validNumber) { 28602 isValid = false; 28603 break; 28604 } else if (element > 0) { 28605 allZeros = false; 28606 } 28607 } 28608 28609 if (isValid && !allZeros) { 28610 this.dashArray = dashArray; 28611 } else { 28612 this.width = 0; 28613 } 28614 } else if (dashArray) { 28615 this.width = 0; 28616 } 28617 } 28618 }, { 28619 key: "setHorizontalCornerRadius", 28620 value: function setHorizontalCornerRadius(radius) { 28621 if (Number.isInteger(radius)) { 28622 this.horizontalCornerRadius = radius; 28623 } 28624 } 28625 }, { 28626 key: "setVerticalCornerRadius", 28627 value: function setVerticalCornerRadius(radius) { 28628 if (Number.isInteger(radius)) { 28629 this.verticalCornerRadius = radius; 28630 } 28631 } 28632 }]); 28633 28634 return AnnotationBorderStyle; 28635}(); 28636 28637exports.AnnotationBorderStyle = AnnotationBorderStyle; 28638 28639var WidgetAnnotation = 28640/*#__PURE__*/ 28641function (_Annotation) { 28642 _inherits(WidgetAnnotation, _Annotation); 28643 28644 function WidgetAnnotation(params) { 28645 var _this2; 28646 28647 _classCallCheck(this, WidgetAnnotation); 28648 28649 _this2 = _possibleConstructorReturn(this, _getPrototypeOf(WidgetAnnotation).call(this, params)); 28650 var dict = params.dict; 28651 var data = _this2.data; 28652 data.annotationType = _util.AnnotationType.WIDGET; 28653 data.fieldName = _this2._constructFieldName(dict); 28654 data.fieldValue = (0, _util.getInheritableProperty)({ 28655 dict: dict, 28656 key: 'V', 28657 getArray: true 28658 }); 28659 data.alternativeText = (0, _util.stringToPDFString)(dict.get('TU') || ''); 28660 data.defaultAppearance = (0, _util.getInheritableProperty)({ 28661 dict: dict, 28662 key: 'DA' 28663 }) || ''; 28664 var fieldType = (0, _util.getInheritableProperty)({ 28665 dict: dict, 28666 key: 'FT' 28667 }); 28668 data.fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null; 28669 _this2.fieldResources = (0, _util.getInheritableProperty)({ 28670 dict: dict, 28671 key: 'DR' 28672 }) || _primitives.Dict.empty; 28673 data.fieldFlags = (0, _util.getInheritableProperty)({ 28674 dict: dict, 28675 key: 'Ff' 28676 });
28677 28678 if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) { 28679 data.fieldFlags = 0; 28680 } 28681 28682 data.readOnly = _this2.hasFieldFlag(_util.AnnotationFieldFlag.READONLY); 28683 28684 if (data.fieldType === 'Sig') { 28685 data.fieldValue = null; 28686 28687 _this2.setFlags(_util.AnnotationFlag.HIDDEN); 28688 } 28689 28690 return _this2; 28691 } 28692 28693 _createClass(WidgetAnnotation, [{ 28694 key: "_constructFieldName", 28695 value: function _constructFieldName(dict) { 28696 if (!dict.has('T') && !dict.has('Parent')) { 28697 (0, _util.warn)('Unknown field name, falling back to empty field name.'); 28698 return ''; 28699 } 28700 28701 if (!dict.has('Parent')) { 28702 return (0, _util.stringToPDFString)(dict.get('T')); 28703 } 28704 28705 var fieldName = []; 28706 28707 if (dict.has('T')) { 28708 fieldName.unshift((0, _util.stringToPDFString)(dict.get('T'))); 28709 } 28710 28711 var loopDict = dict; 28712 28713 while (loopDict.has('Parent')) { 28714 loopDict = loopDict.get('Parent'); 28715 28716 if (!(0, _primitives.isDict)(loopDict)) { 28717 break; 28718 } 28719 28720 if (loopDict.has('T')) { 28721 fieldName.unshift((0, _util.stringToPDFString)(loopDict.get('T'))); 28722 } 28723 } 28724 28725 return fieldName.join('.'); 28726 } 28727 }, { 28728 key: "hasFieldFlag", 28729 value: function hasFieldFlag(flag) { 28730 return !!(this.data.fieldFlags & flag); 28731 } 28732 }, { 28733 key: "getOperatorList", 28734 value: function getOperatorList(evaluator, task, renderForms) { 28735 if (renderForms) { 28736 return Promise.resolve(new _operator_list.OperatorList()); 28737 } 28738 28739 return _get(_getPrototypeOf(WidgetAnnotation.prototype), "getOperatorList", this).call(this, evaluator, task, renderForms); 28740 } 28741 }]); 28742 28743 return WidgetAnnotation; 28744}(Annotation); 28745 28746var TextWidgetAnnotation = 28747/*#__PURE__*/ 28748function (_WidgetAnnotation) { 28749 _inherits(TextWidgetAnnotation, _WidgetAnnotation); 28750 28751 function TextWidgetAnnotation(params) { 28752 var _this3; 28753 28754 _classCallCheck(this, TextWidgetAnnotation); 28755 28756 _this3 = _possibleConstructorReturn(this, _getPrototypeOf(TextWidgetAnnotation).call(this, params)); 28757 var dict = params.dict; 28758 _this3.data.fieldValue = (0, _util.stringToPDFString)(_this3.data.fieldValue || ''); 28759 var alignment = (0, _util.getInheritableProperty)({ 28760 dict: dict, 28761 key: 'Q' 28762 }); 28763 28764 if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) { 28765 alignment = null; 28766 } 28767 28768 _this3.data.textAlignment = alignment; 28769 var maximumLength = (0, _util.getInheritableProperty)({ 28770 dict: dict, 28771 key: 'MaxLen' 28772 }); 28773 28774 if (!Number.isInteger(maximumLength) || maximumLength < 0) { 28775 maximumLength = null; 28776 } 28777 28778 _this3.data.maxLen = maximumLength; 28779 _this3.data.multiLine = _this3.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE); 28780 _this3.data.comb = _this3.hasFieldFlag(_util.AnnotationFieldFlag.COMB) && !_this3.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE) && !_this3.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD) && !_this3.hasFieldFlag(_util.AnnotationFieldFlag.FILESELECT) && _this3.data.maxLen !== null; 28781 return _this3; 28782 } 28783 28784 _createClass(TextWidgetAnnotation, [{ 28785 key: "getOperatorList", 28786 value: function getOperatorList(evaluator, task, renderForms) { 28787 if (renderForms || this.appearance) { 28788 return _get(_getPrototypeOf(TextWidgetAnnotation.prototype), "getOperatorList", this).call(this, evaluator, task, renderForms); 28789 } 28790 28791 var operatorList = new _operator_list.OperatorList(); 28792 28793 if (!this.data.defaultAppearance) { 28794 return Promise.resolve(operatorList); 28795 } 28796 28797 var stream = new _stream.Stream((0, _util.stringToBytes)(this.data.defaultAppearance)); 28798 return evaluator.getOperatorList({ 28799 stream: stream, 28800 task: task, 28801 resources: this.fieldResources, 28802 operatorList: operatorList 28803 }).then(function () { 28804 return operatorList; 28805 }); 28806 } 28807 }]); 28808 28809 return TextWidgetAnnotation; 28810}(WidgetAnnotation); 28811 28812var ButtonWidgetAnnotation = 28813/*#__PURE__*/ 28814function (_WidgetAnnotation2) { 28815 _inherits(ButtonWidgetAnnotation, _WidgetAnnotation2); 28816 28817 function ButtonWidgetAnnotation(params) { 28818 var _this4; 28819 28820 _classCallCheck(this, ButtonWidgetAnnotation); 28821 28822 _this4 = _possibleConstructorReturn(this, _getPrototypeOf(ButtonWidgetAnnotation).call(this, params)); 28823 _this4.data.checkBox = !_this4.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); 28824 _this4.data.radioButton = _this4.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); 28825 _this4.data.pushButton = _this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON); 28826 28827 if (_this4.data.checkBox) { 28828 _this4._processCheckBox(params); 28829 } else if (_this4.data.radioButton) { 28830 _this4._processRadioButton(params); 28831 } else if (_this4.data.pushButton) { 28832 _this4._processPushButton(params); 28833 } else { 28834 (0, _util.warn)('Invalid field flags for button widget annotation'); 28835 } 28836 28837 return _this4; 28838 } 28839 28840 _createClass(ButtonWidgetAnnotation, [{ 28841 key: "_processCheckBox", 28842 value: function _processCheckBox(params) { 28843 if ((0, _primitives.isName)(this.data.fieldValue)) { 28844 this.data.fieldValue = this.data.fieldValue.name; 28845 } 28846 28847 var customAppearance = params.dict.get('AP'); 28848 28849 if (!(0, _primitives.isDict)(customAppearance)) { 28850 return; 28851 } 28852 28853 var exportValueOptionsDict = customAppearance.get('D'); 28854 28855 if (!(0, _primitives.isDict)(exportValueOptionsDict)) { 28856 return; 28857 } 28858
28859 var exportValues = exportValueOptionsDict.getKeys(); 28860 var hasCorrectOptionCount = exportValues.length === 2; 28861 28862 if (!hasCorrectOptionCount) { 28863 return; 28864 } 28865 28866 this.data.exportValue = exportValues[0] === 'Off' ? exportValues[1] : exportValues[0]; 28867 } 28868 }, { 28869 key: "_processRadioButton", 28870 value: function _processRadioButton(params) { 28871 this.data.fieldValue = this.data.buttonValue = null; 28872 var fieldParent = params.dict.get('Parent'); 28873 28874 if ((0, _primitives.isDict)(fieldParent) && fieldParent.has('V')) { 28875 var fieldParentValue = fieldParent.get('V'); 28876 28877 if ((0, _primitives.isName)(fieldParentValue)) { 28878 this.data.fieldValue = fieldParentValue.name; 28879 } 28880 } 28881 28882 var appearanceStates = params.dict.get('AP'); 28883 28884 if (!(0, _primitives.isDict)(appearanceStates)) { 28885 return; 28886 } 28887 28888 var normalAppearanceState = appearanceStates.get('N'); 28889 28890 if (!(0, _primitives.isDict)(normalAppearanceState)) { 28891 return; 28892 } 28893 28894 var keys = normalAppearanceState.getKeys(); 28895 28896 for (var i = 0, ii = keys.length; i < ii; i++) { 28897 if (keys[i] !== 'Off') { 28898 this.data.buttonValue = keys[i]; 28899 break; 28900 } 28901 } 28902 } 28903 }, { 28904 key: "_processPushButton", 28905 value: function _processPushButton(params) { 28906 if (!params.dict.has('A')) { 28907 (0, _util.warn)('Push buttons without action dictionaries are not supported'); 28908 return; 28909 } 28910 28911 _obj.Catalog.parseDestDictionary({ 28912 destDict: params.dict, 28913 resultObj: this.data, 28914 docBaseUrl: params.pdfManager.docBaseUrl 28915 }); 28916 } 28917 }]); 28918 28919 return ButtonWidgetAnnotation; 28920}(WidgetAnnotation); 28921 28922var ChoiceWidgetAnnotation = 28923/*#__PURE__*/ 28924function (_WidgetAnnotation3) { 28925 _inherits(ChoiceWidgetAnnotation, _WidgetAnnotation3); 28926 28927 function ChoiceWidgetAnnotation(params) { 28928 var _this5; 28929 28930 _classCallCheck(this, ChoiceWidgetAnnotation); 28931 28932 _this5 = _possibleConstructorReturn(this, _getPrototypeOf(ChoiceWidgetAnnotation).call(this, params)); 28933 _this5.data.options = []; 28934 var options = (0, _util.getInheritableProperty)({ 28935 dict: params.dict, 28936 key: 'Opt' 28937 }); 28938 28939 if (Array.isArray(options)) { 28940 var xref = params.xref; 28941 28942 for (var i = 0, ii = options.length; i < ii; i++) { 28943 var option = xref.fetchIfRef(options[i]); 28944 var isOptionArray = Array.isArray(option); 28945 _this5.data.options[i] = { 28946 exportValue: isOptionArray ? xref.fetchIfRef(option[0]) : option, 28947 displayValue: (0, _util.stringToPDFString)(isOptionArray ? xref.fetchIfRef(option[1]) : option) 28948 }; 28949 } 28950 } 28951 28952 if (!Array.isArray(_this5.data.fieldValue)) { 28953 _this5.data.fieldValue = [_this5.data.fieldValue]; 28954 } 28955 28956 _this5.data.combo = _this5.hasFieldFlag(_util.AnnotationFieldFlag.COMBO); 28957 _this5.data.multiSelect = _this5.hasFieldFlag(_util.AnnotationFieldFlag.MULTISELECT); 28958 return _this5; 28959 } 28960 28961 return ChoiceWidgetAnnotation; 28962}(WidgetAnnotation); 28963 28964var TextAnnotation = 28965/*#__PURE__*/ 28966function (_Annotation2) { 28967 _inherits(TextAnnotation, _Annotation2); 28968 28969 function TextAnnotation(parameters) { 28970 var _this6; 28971 28972 _classCallCheck(this, TextAnnotation); 28973 28974 var DEFAULT_ICON_SIZE = 22; 28975 _this6 = _possibleConstructorReturn(this, _getPrototypeOf(TextAnnotation).call(this, parameters)); 28976 _this6.data.annotationType = _util.AnnotationType.TEXT; 28977 28978 if (_this6.data.hasAppearance) { 28979 _this6.data.name = 'NoIcon'; 28980 } else { 28981 _this6.data.rect[1] = _this6.data.rect[3] - DEFAULT_ICON_SIZE; 28982 _this6.data.rect[2] = _this6.data.rect[0] + DEFAULT_ICON_SIZE; 28983 _this6.data.name = parameters.dict.has('Name') ? parameters.dict.get('Name').name : 'Note'; 28984 } 28985 28986 _this6._preparePopup(parameters.dict); 28987 28988 return _this6; 28989 } 28990 28991 return TextAnnotation; 28992}(Annotation); 28993 28994var LinkAnnotation = 28995/*#__PURE__*/ 28996function (_Annotation3) { 28997 _inherits(LinkAnnotation, _Annotation3); 28998 28999 function LinkAnnotation(params) { 29000 var _this7; 29001 29002 _classCallCheck(this, LinkAnnotation); 29003 29004 _this7 = _possibleConstructorReturn(this, _getPrototypeOf(LinkAnnotation).call(this, params)); 29005 _this7.data.annotationType = _util.AnnotationType.LINK; 29006 29007 _obj.Catalog.parseDestDictionary({ 29008 destDict: params.dict, 29009 resultObj: _this7.data, 29010 docBaseUrl: params.pdfManager.docBaseUrl 29011 });
vendor: 17,355 bytes, lines 29012-29597
29012 29013 return _this7; 29014 } 29015 29016 return LinkAnnotation; 29017}(Annotation); 29018 29019var PopupAnnotation = 29020/*#__PURE__*/ 29021function (_Annotation4) { 29022 _inherits(PopupAnnotation, _Annotation4); 29023 29024 function PopupAnnotation(parameters) { 29025 var _this8; 29026 29027 _classCallCheck(this, PopupAnnotation); 29028 29029 _this8 = _possibleConstructorReturn(this, _getPrototypeOf(PopupAnnotation).call(this, parameters)); 29030 _this8.data.annotationType = _util.AnnotationType.POPUP; 29031 var dict = parameters.dict; 29032 var parentItem = dict.get('Parent'); 29033 29034 if (!parentItem) { 29035 (0, _util.warn)('Popup annotation has a missing or invalid parent annotation.'); 29036 return _possibleConstructorReturn(_this8); 29037 } 29038 29039 var parentSubtype = parentItem.get('Subtype'); 29040 _this8.data.parentType = (0, _primitives.isName)(parentSubtype) ? parentSubtype.name : null; 29041 _this8.data.parentId = dict.getRaw('Parent').toString(); 29042 _this8.data.title = (0, _util.stringToPDFString)(parentItem.get('T') || ''); 29043 _this8.data.contents = (0, _util.stringToPDFString)(parentItem.get('Contents') || ''); 29044 29045 if (!parentItem.has('C')) { 29046 _this8.data.color = null; 29047 } else { 29048 _this8.setColor(parentItem.getArray('C')); 29049 29050 _this8.data.color = _this8.color; 29051 } 29052 29053 if (!_this8.viewable) { 29054 var parentFlags = parentItem.get('F'); 29055 29056 if (_this8._isViewable(parentFlags)) { 29057 _this8.setFlags(parentFlags); 29058 } 29059 } 29060 29061 return _this8; 29062 } 29063 29064 return PopupAnnotation; 29065}(Annotation); 29066 29067var LineAnnotation = 29068/*#__PURE__*/ 29069function (_Annotation5) { 29070 _inherits(LineAnnotation, _Annotation5); 29071 29072 function LineAnnotation(parameters) { 29073 var _this9; 29074 29075 _classCallCheck(this, LineAnnotation); 29076 29077 _this9 = _possibleConstructorReturn(this, _getPrototypeOf(LineAnnotation).call(this, parameters)); 29078 _this9.data.annotationType = _util.AnnotationType.LINE; 29079 var dict = parameters.dict; 29080 _this9.data.lineCoordinates = _util.Util.normalizeRect(dict.getArray('L')); 29081 29082 _this9._preparePopup(dict); 29083 29084 return _this9; 29085 } 29086 29087 return LineAnnotation; 29088}(Annotation); 29089 29090var SquareAnnotation = 29091/*#__PURE__*/ 29092function (_Annotation6) { 29093 _inherits(SquareAnnotation, _Annotation6); 29094 29095 function SquareAnnotation(parameters) { 29096 var _this10; 29097 29098 _classCallCheck(this, SquareAnnotation); 29099 29100 _this10 = _possibleConstructorReturn(this, _getPrototypeOf(SquareAnnotation).call(this, parameters)); 29101 _this10.data.annotationType = _util.AnnotationType.SQUARE; 29102 29103 _this10._preparePopup(parameters.dict); 29104 29105 return _this10; 29106 } 29107 29108 return SquareAnnotation; 29109}(Annotation); 29110 29111var CircleAnnotation = 29112/*#__PURE__*/ 29113function (_Annotation7) { 29114 _inherits(CircleAnnotation, _Annotation7); 29115 29116 function CircleAnnotation(parameters) { 29117 var _this11; 29118 29119 _classCallCheck(this, CircleAnnotation); 29120 29121 _this11 = _possibleConstructorReturn(this, _getPrototypeOf(CircleAnnotation).call(this, parameters)); 29122 _this11.data.annotationType = _util.AnnotationType.CIRCLE; 29123 29124 _this11._preparePopup(parameters.dict); 29125 29126 return _this11; 29127 } 29128 29129 return CircleAnnotation; 29130}(Annotation); 29131 29132var PolylineAnnotation = 29133/*#__PURE__*/ 29134function (_Annotation8) { 29135 _inherits(PolylineAnnotation, _Annotation8); 29136 29137 function PolylineAnnotation(parameters) { 29138 var _this12; 29139 29140 _classCallCheck(this, PolylineAnnotation); 29141 29142 _this12 = _possibleConstructorReturn(this, _getPrototypeOf(PolylineAnnotation).call(this, parameters)); 29143 _this12.data.annotationType = _util.AnnotationType.POLYLINE; 29144 var dict = parameters.dict; 29145 var rawVertices = dict.getArray('Vertices'); 29146 _this12.data.vertices = []; 29147 29148 for (var i = 0, ii = rawVertices.length; i < ii; i += 2) { 29149 _this12.data.vertices.push({ 29150 x: rawVertices[i], 29151 y: rawVertices[i + 1] 29152 }); 29153 } 29154 29155 _this12._preparePopup(dict); 29156 29157 return _this12; 29158 } 29159 29160 return PolylineAnnotation; 29161}(Annotation); 29162 29163var PolygonAnnotation = 29164/*#__PURE__*/ 29165function (_PolylineAnnotation) { 29166 _inherits(PolygonAnnotation, _PolylineAnnotation); 29167 29168 function PolygonAnnotation(parameters) { 29169 var _this13; 29170 29171 _classCallCheck(this, PolygonAnnotation); 29172 29173 _this13 = _possibleConstructorReturn(this, _getPrototypeOf(PolygonAnnotation).call(this, parameters)); 29174 _this13.data.annotationType = _util.AnnotationType.POLYGON; 29175 return _this13; 29176 } 29177 29178 return PolygonAnnotation; 29179}(PolylineAnnotation); 29180 29181var InkAnnotation = 29182/*#__PURE__*/ 29183function (_Annotation9) { 29184 _inherits(InkAnnotation, _Annotation9); 29185 29186 function InkAnnotation(parameters) { 29187 var _this14; 29188 29189 _classCallCheck(this, InkAnnotation); 29190 29191 _this14 = _possibleConstructorReturn(this, _getPrototypeOf(InkAnnotation).call(this, parameters)); 29192 _this14.data.annotationType = _util.AnnotationType.INK; 29193 var dict = parameters.dict; 29194 var xref = parameters.xref; 29195 var originalInkLists = dict.getArray('InkList'); 29196 _this14.data.inkLists = []; 29197 29198 for (var i = 0, ii = originalInkLists.length; i < ii; ++i) { 29199 _this14.data.inkLists.push([]); 29200 29201 for (var j = 0, jj = originalInkLists[i].length; j < jj; j += 2) { 29202 _this14.data.inkLists[i].push({ 29203 x: xref.fetchIfRef(originalInkLists[i][j]), 29204 y: xref.fetchIfRef(originalInkLists[i][j + 1]) 29205 }); 29206 } 29207 } 29208 29209 _this14._preparePopup(dict); 29210 29211 return _this14; 29212 } 29213 29214 return InkAnnotation; 29215}(Annotation); 29216 29217var HighlightAnnotation = 29218/*#__PURE__*/ 29219function (_Annotation10) { 29220 _inherits(HighlightAnnotation, _Annotation10); 29221 29222 function HighlightAnnotation(parameters) { 29223 var _this15; 29224 29225 _classCallCheck(this, HighlightAnnotation); 29226 29227 _this15 = _possibleConstructorReturn(this, _getPrototypeOf(HighlightAnnotation).call(this, parameters)); 29228 _this15.data.annotationType = _util.AnnotationType.HIGHLIGHT; 29229 29230 _this15._preparePopup(parameters.dict); 29231 29232 return _this15; 29233 } 29234 29235 return HighlightAnnotation; 29236}(Annotation); 29237 29238var UnderlineAnnotation = 29239/*#__PURE__*/ 29240function (_Annotation11) { 29241 _inherits(UnderlineAnnotation, _Annotation11); 29242 29243 function UnderlineAnnotation(parameters) { 29244 var _this16; 29245 29246 _classCallCheck(this, UnderlineAnnotation); 29247 29248 _this16 = _possibleConstructorReturn(this, _getPrototypeOf(UnderlineAnnotation).call(this, parameters)); 29249 _this16.data.annotationType = _util.AnnotationType.UNDERLINE; 29250 29251 _this16._preparePopup(parameters.dict); 29252 29253 return _this16; 29254 } 29255 29256 return UnderlineAnnotation; 29257}(Annotation); 29258 29259var SquigglyAnnotation = 29260/*#__PURE__*/ 29261function (_Annotation12) { 29262 _inherits(SquigglyAnnotation, _Annotation12); 29263 29264 function SquigglyAnnotation(parameters) { 29265 var _this17; 29266 29267 _classCallCheck(this, SquigglyAnnotation); 29268 29269 _this17 = _possibleConstructorReturn(this, _getPrototypeOf(SquigglyAnnotation).call(this, parameters)); 29270 _this17.data.annotationType = _util.AnnotationType.SQUIGGLY; 29271 29272 _this17._preparePopup(parameters.dict); 29273 29274 return _this17; 29275 } 29276 29277 return SquigglyAnnotation; 29278}(Annotation); 29279 29280var StrikeOutAnnotation = 29281/*#__PURE__*/ 29282function (_Annotation13) { 29283 _inherits(StrikeOutAnnotation, _Annotation13); 29284 29285 function StrikeOutAnnotation(parameters) { 29286 var _this18; 29287 29288 _classCallCheck(this, StrikeOutAnnotation); 29289 29290 _this18 = _possibleConstructorReturn(this, _getPrototypeOf(StrikeOutAnnotation).call(this, parameters)); 29291 _this18.data.annotationType = _util.AnnotationType.STRIKEOUT; 29292 29293 _this18._preparePopup(parameters.dict); 29294 29295 return _this18; 29296 } 29297 29298 return StrikeOutAnnotation; 29299}(Annotation); 29300 29301var StampAnnotation = 29302/*#__PURE__*/ 29303function (_Annotation14) { 29304 _inherits(StampAnnotation, _Annotation14); 29305 29306 function StampAnnotation(parameters) { 29307 var _this19; 29308 29309 _classCallCheck(this, StampAnnotation); 29310 29311 _this19 = _possibleConstructorReturn(this, _getPrototypeOf(StampAnnotation).call(this, parameters)); 29312 _this19.data.annotationType = _util.AnnotationType.STAMP; 29313 29314 _this19._preparePopup(parameters.dict); 29315 29316 return _this19; 29317 } 29318 29319 return StampAnnotation; 29320}(Annotation); 29321 29322var FileAttachmentAnnotation = 29323/*#__PURE__*/ 29324function (_Annotation15) { 29325 _inherits(FileAttachmentAnnotation, _Annotation15); 29326 29327 function FileAttachmentAnnotation(parameters) { 29328 var _this20; 29329 29330 _classCallCheck(this, FileAttachmentAnnotation); 29331 29332 _this20 = _possibleConstructorReturn(this, _getPrototypeOf(FileAttachmentAnnotation).call(this, parameters)); 29333 var file = new _obj.FileSpec(parameters.dict.get('FS'), parameters.xref); 29334 _this20.data.annotationType = _util.AnnotationType.FILEATTACHMENT; 29335 _this20.data.file = file.serializable; 29336 29337 _this20._preparePopup(parameters.dict); 29338 29339 return _this20; 29340 } 29341 29342 return FileAttachmentAnnotation; 29343}(Annotation); 29344 29345/***/ }), 29346/* 170 */ 29347/***/ (function(module, exports, __w_pdfjs_require__) { 29348 29349"use strict"; 29350 29351 29352Object.defineProperty(exports, "__esModule", { 29353 value: true 29354}); 29355exports.OperatorList = void 0; 29356 29357var _util = __w_pdfjs_require__(6); 29358 29359var QueueOptimizer = function QueueOptimizerClosure() { 29360 function addState(parentState, pattern, checkFn, iterateFn, processFn) { 29361 var state = parentState; 29362 29363 for (var i = 0, ii = pattern.length - 1; i < ii; i++) { 29364 var item = pattern[i]; 29365 state = state[item] || (state[item] = []); 29366 } 29367 29368 state[pattern[pattern.length - 1]] = { 29369 checkFn: checkFn, 29370 iterateFn: iterateFn, 29371 processFn: processFn 29372 }; 29373 } 29374 29375 function handlePaintSolidColorImageMask(iFirstSave, count, fnArray, argsArray) { 29376 var iFirstPIMXO = iFirstSave + 2; 29377 29378 for (var i = 0; i < count; i++) { 29379 var arg = argsArray[iFirstPIMXO + 4 * i]; 29380 var imageMask = arg.length === 1 && arg[0]; 29381 29382 if (imageMask && imageMask.width === 1 && imageMask.height === 1 && (!imageMask.data.length || imageMask.data.length === 1 && imageMask.data[0] === 0)) { 29383 fnArray[iFirstPIMXO + 4 * i] = _util.OPS.paintSolidColorImageMask; 29384 continue; 29385 } 29386 29387 break; 29388 } 29389 29390 return count - i; 29391 } 29392 29393 var InitialState = []; 29394 addState(InitialState, [_util.OPS.save, _util.OPS.transform, _util.OPS.paintInlineImageXObject, _util.OPS.restore], null, function iterateInlineImageGroup(context, i) { 29395 var fnArray = context.fnArray; 29396 var iFirstSave = context.iCurr - 3; 29397 var pos = (i - iFirstSave) % 4; 29398 29399 switch (pos) { 29400 case 0: 29401 return fnArray[i] === _util.OPS.save; 29402 29403 case 1: 29404 return fnArray[i] === _util.OPS.transform; 29405 29406 case 2: 29407 return fnArray[i] === _util.OPS.paintInlineImageXObject; 29408 29409 case 3: 29410 return fnArray[i] === _util.OPS.restore; 29411 } 29412 }, function foundInlineImageGroup(context, i) { 29413 var MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10; 29414 var MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200; 29415 var MAX_WIDTH = 1000; 29416 var IMAGE_PADDING = 1; 29417 var fnArray = context.fnArray, 29418 argsArray = context.argsArray; 29419 var curr = context.iCurr; 29420 var iFirstSave = curr - 3; 29421 var iFirstTransform = curr - 2; 29422 var iFirstPIIXO = curr - 1; 29423 var count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_INLINE_IMAGES_BLOCK); 29424 29425 if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) { 29426 return i - (i - iFirstSave) % 4; 29427 } 29428 29429 var maxX = 0; 29430 var map = [], 29431 maxLineHeight = 0; 29432 var currentX = IMAGE_PADDING, 29433 currentY = IMAGE_PADDING; 29434 var q; 29435 29436 for (q = 0; q < count; q++) { 29437 var transform = argsArray[iFirstTransform + (q << 2)]; 29438 var img = argsArray[iFirstPIIXO + (q << 2)][0]; 29439 29440 if (currentX + img.width > MAX_WIDTH) { 29441 maxX = Math.max(maxX, currentX); 29442 currentY += maxLineHeight + 2 * IMAGE_PADDING; 29443 currentX = 0; 29444 maxLineHeight = 0; 29445 } 29446 29447 map.push({ 29448 transform: transform, 29449 x: currentX, 29450 y: currentY, 29451 w: img.width, 29452 h: img.height 29453 }); 29454 currentX += img.width + 2 * IMAGE_PADDING; 29455 maxLineHeight = Math.max(maxLineHeight, img.height); 29456 } 29457 29458 var imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING; 29459 var imgHeight = currentY + maxLineHeight + IMAGE_PADDING; 29460 var imgData = new Uint8ClampedArray(imgWidth * imgHeight * 4); 29461 var imgRowSize = imgWidth << 2; 29462 29463 for (q = 0; q < count; q++) { 29464 var data = argsArray[iFirstPIIXO + (q << 2)][0].data; 29465 var rowSize = map[q].w << 2; 29466 var dataOffset = 0; 29467 var offset = map[q].x + map[q].y * imgWidth << 2; 29468 imgData.set(data.subarray(0, rowSize), offset - imgRowSize); 29469 29470 for (var k = 0, kk = map[q].h; k < kk; k++) { 29471 imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset); 29472 dataOffset += rowSize; 29473 offset += imgRowSize; 29474 } 29475 29476 imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset); 29477 29478 while (offset >= 0) { 29479 data[offset - 4] = data[offset]; 29480 data[offset - 3] = data[offset + 1]; 29481 data[offset - 2] = data[offset + 2]; 29482 data[offset - 1] = data[offset + 3]; 29483 data[offset + rowSize] = data[offset + rowSize - 4]; 29484 data[offset + rowSize + 1] = data[offset + rowSize - 3]; 29485 data[offset + rowSize + 2] = data[offset + rowSize - 2]; 29486 data[offset + rowSize + 3] = data[offset + rowSize - 1]; 29487 offset -= imgRowSize; 29488 } 29489 } 29490 29491 fnArray.splice(iFirstSave, count * 4, _util.OPS.paintInlineImageXObjectGroup); 29492 argsArray.splice(iFirstSave, count * 4, [{ 29493 width: imgWidth, 29494 height: imgHeight, 29495 kind: _util.ImageKind.RGBA_32BPP, 29496 data: imgData 29497 }, map]); 29498 return iFirstSave + 1; 29499 }); 29500 addState(InitialState, [_util.OPS.save, _util.OPS.transform, _util.OPS.paintImageMaskXObject, _util.OPS.restore], null, function iterateImageMaskGroup(context, i) { 29501 var fnArray = context.fnArray; 29502 var iFirstSave = context.iCurr - 3; 29503 var pos = (i - iFirstSave) % 4; 29504 29505 switch (pos) { 29506 case 0: 29507 return fnArray[i] === _util.OPS.save; 29508 29509 case 1: 29510 return fnArray[i] === _util.OPS.transform; 29511 29512 case 2: 29513 return fnArray[i] === _util.OPS.paintImageMaskXObject; 29514 29515 case 3: 29516 return fnArray[i] === _util.OPS.restore; 29517 } 29518 }, function foundImageMaskGroup(context, i) { 29519 var MIN_IMAGES_IN_MASKS_BLOCK = 10; 29520 var MAX_IMAGES_IN_MASKS_BLOCK = 100; 29521 var MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000; 29522 var fnArray = context.fnArray, 29523 argsArray = context.argsArray; 29524 var curr = context.iCurr; 29525 var iFirstSave = curr - 3; 29526 var iFirstTransform = curr - 2; 29527 var iFirstPIMXO = curr - 1; 29528 var count = Math.floor((i - iFirstSave) / 4); 29529 count = handlePaintSolidColorImageMask(iFirstSave, count, fnArray, argsArray); 29530 29531 if (count < MIN_IMAGES_IN_MASKS_BLOCK) { 29532 return i - (i - iFirstSave) % 4; 29533 } 29534 29535 var q; 29536 var isSameImage = false; 29537 var iTransform, transformArgs; 29538 var firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; 29539 29540 if (argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0) { 29541 isSameImage = true; 29542 var firstTransformArg0 = argsArray[iFirstTransform][0]; 29543 var firstTransformArg3 = argsArray[iFirstTransform][3]; 29544 iTransform = iFirstTransform + 4; 29545 var iPIMXO = iFirstPIMXO + 4; 29546 29547 for (q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { 29548 transformArgs = argsArray[iTransform]; 29549 29550 if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== 0 || transformArgs[2] !== 0 || transformArgs[3] !== firstTransformArg3) { 29551 if (q < MIN_IMAGES_IN_MASKS_BLOCK) { 29552 isSameImage = false; 29553 } else { 29554 count = q; 29555 } 29556 29557 break; 29558 } 29559 } 29560 } 29561 29562 if (isSameImage) { 29563 count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK); 29564 var positions = new Float32Array(count * 2); 29565 iTransform = iFirstTransform; 29566 29567 for (q = 0; q < count; q++, iTransform += 4) { 29568 transformArgs = argsArray[iTransform]; 29569 positions[q << 1] = transformArgs[4]; 29570 positions[(q << 1) + 1] = transformArgs[5]; 29571 } 29572 29573 fnArray.splice(iFirstSave, count * 4, _util.OPS.paintImageMaskXObjectRepeat); 29574 argsArray.splice(iFirstSave, count * 4, [firstPIMXOArg0, firstTransformArg0, firstTransformArg3, positions]); 29575 } else { 29576 count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); 29577 var images = []; 29578 29579 for (q = 0; q < count; q++) { 29580 transformArgs = argsArray[iFirstTransform + (q << 2)]; 29581 var maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; 29582 images.push({ 29583 data: maskParams.data, 29584 width: maskParams.width, 29585 height: maskParams.height, 29586 transform: transformArgs 29587 }); 29588 } 29589 29590 fnArray.splice(iFirstSave, count * 4, _util.OPS.paintImageMaskXObjectGroup); 29591 argsArray.splice(iFirstSave, count * 4, [images]); 29592 } 29593 29594 return iFirstSave + 1; 29595 }); 29596 addState(InitialState, [_util.OPS.save, _util.OPS.transform, _util.OPS.paintImageXObject, _util.OPS.restore], function (context) { 29597 var argsArray = context.argsArray;
29598 var iFirstTransform = context.iCurr - 2; 29599 return argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0; 29600 }, function (context, i) { 29601 var fnArray = context.fnArray, 29602 argsArray = context.argsArray; 29603 var iFirstSave = context.iCurr - 3; 29604 var pos = (i - iFirstSave) % 4; 29605 29606 switch (pos) { 29607 case 0: 29608 return fnArray[i] === _util.OPS.save; 29609 29610 case 1: 29611 if (fnArray[i] !== _util.OPS.transform) { 29612 return false; 29613 } 29614 29615 var iFirstTransform = context.iCurr - 2; 29616 var firstTransformArg0 = argsArray[iFirstTransform][0]; 29617 var firstTransformArg3 = argsArray[iFirstTransform][3]; 29618 29619 if (argsArray[i][0] !== firstTransformArg0 || argsArray[i][1] !== 0 || argsArray[i][2] !== 0 || argsArray[i][3] !== firstTransformArg3) { 29620 return false; 29621 } 29622 29623 return true; 29624 29625 case 2: 29626 if (fnArray[i] !== _util.OPS.paintImageXObject) { 29627 return false; 29628 } 29629 29630 var iFirstPIXO = context.
29630iCurr - 1; 29631 var firstPIXOArg0 = argsArray[iFirstPIXO][0]; 29632 29633 if (argsArray[i][0] !== firstPIXOArg0) { 29634 return false; 29635 } 29636 29637 return true; 29638 29639 case 3: 29640 return fnArray[i] === _util.OPS.restore; 29641 } 29642 }, function (context, i) { 29643 var MIN_IMAGES_IN_BLOCK = 3; 29644 var MAX_IMAGES_IN_BLOCK = 1000; 29645 var fnArray = context.fnArray, 29646 argsArray = context.argsArray; 29647 var curr = context.iCurr; 29648 var iFirstSave = curr - 3; 29649 var iFirstTransform = curr - 2; 29650 var iFirstPIXO = curr - 1; 29651 var firstPIXOArg0 = argsArray[iFirstPIXO][0]; 29652 var firstTransformArg0 = argsArray[iFirstTransform][0]; 29653 var firstTransformArg3 = argsArray[iFirstTransform][3]; 29654 var count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_BLOCK); 29655 29656 if (count < MIN_IMAGES_IN_BLOCK) { 29657 return i - (i - iFirstSave) % 4; 29658 } 29659 29660 var positions = new Float32Array(count * 2); 29661 var iTransform = iFirstTransform; 29662 29663 for (var q = 0; q < count; q++, iTransform += 4) { 29664 var transformArgs = argsArray[iTransform]; 29665 positions[q << 1] = transformArgs[4]; 29666 positions[(q << 1) + 1] = transformArgs[5]; 29667 } 29668 29669 var args = [firstPIXOArg0, firstTransformArg0, firstTransformArg3, positions]; 29670 fnArray.splice(iFirstSave, count * 4, _util.OPS.paintImageXObjectRepeat); 29671 argsArray.splice(iFirstSave, count * 4, args); 29672 return iFirstSave + 1; 29673 }); 29674 addState(InitialState, [_util.OPS.beginText, _util.OPS.setFont, _util.OPS.setTextMatrix, _util.OPS.showText, _util.OPS.endText], null, function (context, i) { 29675 var fnArray = context.fnArray, 29676 argsArray = context.argsArray;
29677 var iFirstSave = context.iCurr - 4; 29678 var pos = (i - iFirstSave) % 5; 29679 29680 switch (pos) { 29681 case 0: 29682 return fnArray[i] === _util.OPS.beginText; 29683 29684 case 1: 29685 return fnArray[i] === _util.OPS.setFont; 29686 29687 case 2: 29688 return fnArray[i] === _util.OPS.setTextMatrix; 29689 29690 case 3: 29691 if (fnArray[i] !== _util.OPS.showText) { 29692 return false; 29693 } 29694 29695 var iFirstSetFont = context.iCurr - 3; 29696 var firstSetFontArg0 = argsArray[iFirstSetFont][0]; 29697 var firstSetFontArg1 = argsArray[iFirstSetFont][1]; 29698 29699 if (argsArray[i][0] !== firstSetFontArg0 || argsArray[i][1] !== firstSetFontArg1) { 29700 return false; 29701 } 29702 29703 return true; 29704 29705 case 4: 29706 return fnArray[i] === _util.OPS.endText; 29707 } 29708 }, function (context, i) { 29709 var MIN_CHARS_IN_BLOCK = 3; 29710 var MAX_CHARS_IN_BLOCK = 1000; 29711 var fnArray = context.fnArray, 29712 argsArray = context.argsArray; 29713 var curr = context.iCurr; 29714 var iFirstBeginText = curr - 4; 29715 var iFirstSetFont = curr - 3; 29716 var iFirstSetTextMatrix = curr - 2; 29717 var iFirstShowText = curr - 1; 29718 var iFirstEndText = curr; 29719 var firstSetFontArg0 = argsArray[iFirstSetFont][0]; 29720 var firstSetFontArg1 = argsArray[iFirstSetFont][1]; 29721 var count = Math.min(Math.floor((i - iFirstBeginText) / 5), MAX_CHARS_IN_BLOCK); 29722 29723 if (count < MIN_CHARS_IN_BLOCK) { 29724 return i - (i - iFirstBeginText) % 5; 29725 } 29726 29727 var iFirst = iFirstBeginText; 29728 29729 if (iFirstBeginText >= 4 && fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] && fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] && fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] && fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] && argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 && argsArray[iFirstBeginText - 4][1] === firstSetFontArg1) { 29730 count++; 29731 iFirst -= 5; 29732 } 29733 29734 var iEndText = iFirst + 4; 29735 29736 for (var q = 1; q < count; q++) { 29737 fnArray.splice(iEndText, 3); 29738 argsArray.splice(iEndText, 3); 29739 iEndText += 2; 29740 } 29741 29742 return iEndText + 1; 29743 }); 29744 29745 function QueueOptimizer(queue) { 29746 this.queue = queue; 29747 this.state = null; 29748 this.context = { 29749 iCurr: 0, 29750 fnArray: queue.fnArray, 29751 argsArray: queue.argsArray 29752 }; 29753 this.match = null; 29754 this.lastProcessed = 0; 29755 } 29756 29757 QueueOptimizer.prototype = { 29758 _optimize: function _optimize() { 29759 var fnArray = this.queue.fnArray; 29760 var i = this.lastProcessed, 29761 ii = fnArray.length; 29762 var state = this.state; 29763 var match = this.match; 29764 29765 if (!state && !match && i + 1 === ii && !InitialState[fnArray[i]]) { 29766 this.lastProcessed = ii; 29767 return; 29768 } 29769 29770 var context = this.context; 29771 29772 while (i < ii) { 29773 if (match) { 29774 var iterate = (0, match.iterateFn)(context, i); 29775 29776 if (iterate) { 29777 i++; 29778 continue; 29779 } 29780 29781 i = (0, match.processFn)(context, i + 1); 29782 ii = fnArray.length; 29783 match = null; 29784 state = null; 29785 29786 if (i >= ii) { 29787 break; 29788 } 29789 } 29790 29791 state = (state || InitialState)[fnArray[i]]; 29792 29793 if (!state || Array.isArray(state)) { 29794 i++; 29795 continue; 29796 } 29797 29798 context.iCurr = i; 29799 i++; 29800 29801 if (state.checkFn && !(0, state.checkFn)(context)) { 29802 state = null; 29803 continue; 29804 } 29805 29806 match = state; 29807 state = null; 29808 } 29809 29810 this.state = state; 29811 this.match = match; 29812 this.lastProcessed = i; 29813 }, 29814 push: function push(fn, args) { 29815 this.queue.fnArray.push(fn); 29816 this.queue.argsArray.push(args); 29817 29818 this._optimize(); 29819 }, 29820 flush: function flush() { 29821 while (this.match) { 29822 var length = this.queue.fnArray.length; 29823 this.lastProcessed = (0, this.match.processFn)(this.context, length); 29824 this.match = null; 29825 this.state = null; 29826 29827 this._optimize(); 29828 } 29829 }, 29830 reset: function reset() { 29831 this.state = null; 29832 this.match = null; 29833 this.lastProcessed = 0; 29834 } 29835 }; 29836 return QueueOptimizer; 29837}();
29838 29839var NullOptimizer = function NullOptimizerClosure() { 29840 function NullOptimizer(queue) { 29841 this.queue = queue; 29842 } 29843 29844 NullOptimizer.prototype = { 29845 push: function push(fn, args) { 29846 this.queue.fnArray.push(fn); 29847 this.queue.argsArray.push(args); 29848 }, 29849 flush: function flush() {} 29850 }; 29851 return NullOptimizer; 29852}(); 29853 29854var OperatorList = function OperatorListClosure() { 29855 var CHUNK_SIZE = 1000; 29856 var CHUNK_SIZE_ABOUT = CHUNK_SIZE - 5; 29857 29858 function getTransfers(queue) { 29859 var transfers = []; 29860 var fnArray = queue.fnArray, 29861 argsArray = queue.argsArray; 29862 29863 for (var i = 0, ii = queue.length; i < ii; i++) { 29864 switch (fnArray[i]) { 29865 case _util.OPS.paintInlineImageXObject: 29866 case _util.OPS.paintInlineImageXObjectGroup: 29867 case _util.OPS.paintImageMaskXObject: 29868 var arg = argsArray[i][0]; 29869 ; 29870 29871 if (!arg.cached) { 29872 transfers.push(arg.data.buffer); 29873 } 29874 29875 break; 29876 } 29877 } 29878 29879 return transfers; 29880 } 29881 29882 function OperatorList(intent, messageHandler, pageIndex) { 29883 this.messageHandler = messageHandler; 29884 this.fnArray = []; 29885 this.argsArray = []; 29886 29887 if (messageHandler && this.intent !== 'oplist') { 29888 this.optimizer = new QueueOptimizer(this); 29889 } else { 29890 this.optimizer = new NullOptimizer(this); 29891 } 29892 29893 this.dependencies = Object.create(null); 29894 this._totalLength = 0; 29895 this.pageIndex = pageIndex; 29896 this.intent = intent; 29897 this.weight = 0; 29898 } 29899 29900 OperatorList.prototype = { 29901 get length() { 29902 return this.argsArray.length; 29903 }, 29904 29905 get totalLength() { 29906 return this._totalLength + this.length; 29907 }, 29908 29909 addOp: function addOp(fn, args) { 29910 this.optimizer.push(fn, args); 29911 this.weight++; 29912 29913 if (this.messageHandler) { 29914 if (this.weight >= CHUNK_SIZE) { 29915 this.flush(); 29916 } else if (this.weight >= CHUNK_SIZE_ABOUT && (fn === _util.OPS.restore || fn === _util.OPS.endText)) { 29917 this.flush(); 29918 } 29919 } 29920 }, 29921 addDependency: function addDependency(dependency) { 29922 if (dependency in this.dependencies) { 29923 return; 29924 } 29925 29926 this.dependencies[dependency] = true; 29927 this.addOp(_util.OPS.dependency, [dependency]); 29928 }, 29929 addDependencies: function addDependencies(dependencies) { 29930 for (var key in dependencies) { 29931 this.addDependency(key); 29932 } 29933 }, 29934 addOpList: function addOpList(opList) { 29935 Object.assign(this.dependencies, opList.dependencies); 29936 29937 for (var i = 0, ii = opList.length; i < ii; i++) { 29938 this.addOp(opList.fnArray[i], opList.argsArray[i]); 29939 } 29940 }, 29941 getIR: function getIR() { 29942 return { 29943 fnArray: this.fnArray, 29944 argsArray: this.argsArray, 29945 length: this.length 29946 }; 29947 }, 29948 flush: function flush(lastChunk) { 29949 this.optimizer.flush(); 29950 var transfers = getTransfers(this); 29951 var length = this.length; 29952 this._totalLength += length; 29953 this.messageHandler.send('RenderPageChunk', { 29954 operatorList: { 29955 fnArray: this.fnArray, 29956 argsArray: this.argsArray, 29957 lastChunk: lastChunk, 29958 length: length 29959 }, 29960 pageIndex: this.pageIndex, 29961 intent: this.intent 29962 }, transfers); 29963 this.dependencies = Object.create(null); 29964 this.fnArray.length = 0; 29965 this.argsArray.length = 0; 29966 this.weight = 0; 29967 this.optimizer.reset(); 29968 } 29969 }; 29970 return OperatorList; 29971}(); 29972 29973exports.OperatorList = OperatorList; 29974 29975/***/ }), 29976/* 171 */ 29977/***/ (function(module, exports, __w_pdfjs_require__) { 29978 29979"use strict"; 29980 29981 29982Object.defineProperty(exports, "__esModule", { 29983 value: true 29984}); 29985exports.PartialEvaluator = void 0; 29986 29987var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2)); 29988 29989var _util = __w_pdfjs_require__(6); 29990 29991var _cmap = __w_pdfjs_require__(172); 29992 29993var _stream = __w_pdfjs_require__(157); 29994 29995var _primitives = __w_pdfjs_require__(155); 29996 29997var _fonts = __w_pdfjs_require__(173); 29998 29999var _encodings = __w_pdfjs_require__(176); 30000 30001var _unicode = __w_pdfjs_require__(179); 30002 30003var _standard_fonts = __w_pdfjs_require__(178); 30004 30005var _pattern = __w_pdfjs_require__(182); 30006 30007var _parser = __w_pdfjs_require__(156); 30008 30009var _bidi = __w_pdfjs_require__(183); 30010 30011var _colorspace = __w_pdfjs_require__(168); 30012 30013var _glyphlist = __w_pdfjs_require__(177); 30014 30015var _metrics = __w_pdfjs_require__(184); 30016 30017var _function = __w_pdfjs_require__(185); 30018 30019var _jpeg_stream = __w_pdfjs_require__(163); 30020 30021var _murmurhash = __w_pdfjs_require__(187); 30022 30023var _operator_list = __w_pdfjs_require__(170); 30024 30025var _image = __w_pdfjs_require__(188); 30026 30027function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 30028 30029function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { tr
30029y { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } 30030 30031function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } 30032 30033var PartialEvaluator = function PartialEvaluatorClosure() { 30034 var DefaultPartialEvaluatorOptions = { 30035 forceDataSchema: false, 30036 maxImageSize: -1, 30037 disableFontFace: false, 30038 nativeImageDecoderSupport: _util.NativeImageDecoding.DECODE, 30039 ignoreErrors: false, 30040 isEvalSupported: true 30041 }; 30042 30043 function NativeImageDecoder(_ref) { 30044 var xref = _ref.xref, 30045 resources = _ref.resources, 30046 handler = _ref.handler, 30047 _ref$forceDataSchema = _ref.forceDataSchema, 30048 forceDataSchema = _ref$forceDataSchema === void 0 ? false : _ref$forceDataSchema, 30049 pdfFunctionFactory = _ref.pdfFunctionFactory; 30050 this.xref = xref; 30051 this.resources = resources; 30052 this.handler = handler; 30053 this.forceDataSchema = forceDataSchema; 30054 this.pdfFunctionFactory = pdfFunctionFactory; 30055 } 30056 30057 NativeImageDecoder.prototype = { 30058 canDecode: function canDecode(image) { 30059 return image instanceof _jpeg_stream.JpegStream && NativeImageDecoder.isDecodable(image, this.xref, this.resources, this.pdfFunctionFactory); 30060 }, 30061 decode: function decode(image) { 30062 var dict = image.dict; 30063 var colorSpace = dict.get('ColorSpace', 'CS'); 30064 colorSpace = _colorspace.ColorSpace.parse(colorSpace, this.xref, this.resources, this.pdfFunctionFactory); 30065 return this.handler.sendWithPromise('JpegDecode', [image.getIR(this.forceDataSchema), colorSpace.numComps]).then(function (_ref2) { 30066 var data = _ref2.data, 30067 width = _ref2.width, 30068 height = _ref2.height; 30069 return new _stream.Stream(data, 0, data.length, image.dict); 30070 }); 30071 } 30072 }; 30073 30074 NativeImageDecoder.isSupported = function (image, xref, res, pdfFunctionFactory) { 30075 var dict = image.dict; 30076 30077 if (dict.has('DecodeParms') || dict.has('DP')) { 30078 return false; 30079 } 30080 30081 var cs = _colorspace.ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res, pdfFunctionFactory); 30082 30083 return (cs.name === 'DeviceGray' || cs.name === 'DeviceRGB') && cs.isDefaultDecode(dict.getArray('Decode', 'D')); 30084 }; 30085 30086 NativeImageDecoder.isDecodable = function (image, xref, res, pdfFunctionFactory) { 30087 var dict = image.dict; 30088 30089 if (dict.has('DecodeParms') || dict.has('DP')) { 30090 return false; 30091 } 30092 30093 var cs = _colorspace.ColorSpace.parse(dict.get('ColorSpace', 'CS'), xref, res, pdfFunctionFactory); 30094 30095 var bpc = dict.get('BitsPerComponent', 'BPC') || 1; 30096 return (cs.numComps === 1 || cs.numComps === 3) && cs.isDefaultDecode(dict.getArray('Decode', 'D'), bpc); 30097 }; 30098 30099 function PartialEvaluator(_ref3) { 30100 var _this = this; 30101 30102 var pdfManager = _ref3.pdfManager, 30103 xref = _ref3.xref, 30104 handler = _ref3.handler, 30105 pageIndex = _ref3.pageIndex, 30106 idFactory = _ref3.idFactory, 30107 fontCache = _ref3.fontCache, 30108 builtInCMapCache = _ref3.builtInCMapCache, 30109 _ref3$options = _ref3.options, 30110 options = _ref3$options === void 0 ? null : _ref3$options, 30111 pdfFunctionFactory = _ref3.pdfFunctionFactory; 30112 this.pdfManager = pdfManager; 30113 this.xref = xref; 30114 this.handler = handler; 30115 this.pageIndex = pageIndex; 30116 this.idFactory = idFactory; 30117 this.fontCache = fontCache; 30118 this.builtInCMapCache = builtInCMapCache; 30119 this.options = options || DefaultPartialEvaluatorOptions; 30120 this.pdfFunctionFactory = pdfFunctionFactory; 30121 30122 this.fetchBuiltInCMap = 30123 /*#__PURE__*/ 30124 function () { 30125 var _ref4 = _asyncToGenerator( 30126 /*#__PURE__*/ 30127 _regenerator.default.mark(function _callee(name) { 30128 var data; 30129 return _regenerator.default.wrap(function _callee$(_context) { 30130 while (1) { 30131 switch (_context.prev = _context.next) { 30132 case 0: 30133 if (!_this.builtInCMapCache.has(name)) { 30134 _context.next = 2; 30135 break; 30136 } 30137 30138 return _context.abrupt("return", _this.builtInCMapCache.get(name)); 30139 30140 case 2: 30141 _context.next = 4;
30142 return _this.handler.sendWithPromise('FetchBuiltInCMap', { 30143 name: name 30144 }); 30145 30146 case 4: 30147 data = _context.sent; 30148 30149 if (data.compressionType !== _util.CMapCompressionType.NONE) { 30150 _this.builtInCMapCache.set(name, data); 30151 } 30152 30153 return _context.abrupt("return", data); 30154 30155 case 7: 30156 case "end": 30157 return _context.stop(); 30158 } 30159 } 30160 }, _callee, this); 30161 })); 30162 30163 return function (_x) { 30164 return _ref4.apply(this, arguments); 30165 }; 30166 }(); 30167 } 30168 30169 var TIME_SLOT_DURATION_MS = 20; 30170 var CHECK_TIME_EVERY = 100; 30171 30172 function TimeSlotManager() { 30173 this.reset(); 30174 } 30175 30176 TimeSlotManager.prototype = { 30177 check: function TimeSlotManager_check() { 30178 if (++this.checked < CHECK_TIME_EVERY) { 30179 return false; 30180 } 30181 30182 this.checked = 0; 30183 return this.endTime <= Date.now(); 30184 }, 30185 reset: function TimeSlotManager_reset() { 30186 this.endTime = Date.now() + TIME_SLOT_DURATION_MS; 30187 this.checked = 0; 30188 } 30189 }; 30190 30191 function normalizeBlendMode(value) { 30192 if (!(0, _primitives.isName)(value)) { 30193 return 'source-over'; 30194 } 30195 30196 switch (value.name) { 30197 case 'Normal': 30198 case 'Compatible': 30199 return 'source-over'; 30200 30201 case 'Multiply': 30202 return 'multiply'; 30203 30204 case 'Screen': 30205 return 'screen'; 30206 30207 case 'Overlay': 30208 return 'overlay'; 30209 30210 case 'Darken': 30211 return 'darken'; 30212 30213 case 'Lighten': 30214 return 'lighten'; 30215 30216 case 'ColorDodge': 30217 return 'color-dodge'; 30218 30219 case 'ColorBurn': 30220 return 'color-burn'; 30221 30222 case 'HardLight': 30223 return 'hard-light'; 30224 30225 case 'SoftLight': 30226 return 'soft-light'; 30227 30228 case 'Difference': 30229 return 'difference'; 30230 30231 case 'Exclusion': 30232 return 'exclusion'; 30233 30234 case 'Hue': 30235 return 'hue'; 30236 30237 case 'Saturation': 30238 return 'saturation'; 30239 30240 case 'Color': 30241 return 'color'; 30242 30243 case 'Luminosity': 30244 return 'luminosity'; 30245 } 30246 30247 (0, _util.warn)('Unsupported blend mode: ' + value.name); 30248 return 'source-over'; 30249 } 30250 30251 var deferred = Promise.resolve(); 30252 var TILING_PATTERN = 1, 30253 SHADING_PATTERN = 2; 30254 PartialEvaluator.prototype = { 30255 clone: function clone() { 30256 var newOptions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DefaultPartialEvaluatorOptions; 30257 var newEvaluator = Object.create(this); 30258 newEvaluator.options = newOptions; 30259 return newEvaluator; 30260 }, 30261 hasBlendModes: function PartialEvaluator_hasBlendModes(resources) { 30262 if (!(0, _primitives.isDict)(resources)) { 30263 return false; 30264 } 30265 30266 var processed = Object.create(null); 30267 30268 if (resources.objId) { 30269 processed[resources.objId] = true; 30270 } 30271 30272 var nodes = [resources], 30273 xref = this.xref; 30274 30275 while (nodes.length) { 30276 var key, i, ii; 30277 var node = nodes.shift(); 30278 var graphicStates = node.get('ExtGState'); 30279 30280 if ((0, _primitives.isDict)(graphicStates)) { 30281 var graphicStatesKeys = graphicStates.getKeys(); 30282 30283 for (i = 0, ii = graphicStatesKeys.length; i < ii; i++) { 30284 key = graphicStatesKeys[i]; 30285 var graphicState = graphicStates.get(key); 30286 var bm = graphicState.get('BM'); 30287 30288 if ((0, _primitives.isName)(bm) && bm.name !== 'Normal') { 30289 return true; 30290 } 30291 } 30292 } 30293 30294 var xObjects = node.get('XObject'); 30295 30296 if (!(0, _primitives.isDict)(xObjects)) { 30297 continue; 30298 } 30299 30300 var xObjectsKeys = xObjects.getKeys(); 30301 30302 for (i = 0, ii = xObjectsKeys.length; i < ii; i++) { 30303 key = xObjectsKeys[i]; 30304 var xObject = xObjects.getRaw(key); 30305 30306 if ((0, _primitives.isRef)(xObject)) { 30307 if (processed[xObject.toString()]) { 30308 continue; 30309 } 30310 30311 xObject = xref.fetch(xObject); 30312 } 30313 30314 if (!(0, _primitives.isStream)(xObject)) { 30315 continue; 30316 } 30317 30318 if (xObject.dict.objId) { 30319 if (processed[xObject.dict.objId]) { 30320 continue; 30321 } 30322 30323 processed[xObject.dict.objId] = true; 30324 } 30325 30326 var xResources = xObject.dict.get('Resources'); 30327 30328 if ((0, _primitives.isDict)(xResources) && (!xResources.objId || !processed[xResources.objId])) { 30329 nodes.push(xResources); 30330 30331 if (xResources.objId) { 30332 processed[xResources.objId] = true; 30333 } 30334 } 30335 } 30336 } 30337 30338 return false; 30339 }, 30340 buildFormXObject: function PartialEvaluator_buildFormXObject(resources, xobj, smask, operatorList, task, initialState) { 30341 var dict = xobj.dict; 30342 var matrix = dict.getArray('Matrix'); 30343 var bbox = dict.getArray('BBox'); 30344 30345 if (Array.isArray(bbox) && bbox.length === 4) { 30346 bbox = _util.Util.normalizeRect(bbox); 30347 } else { 30348 bbox = null; 30349 } 30350 30351 var group = dict.get('Group'); 30352 30353 if (group) { 30354 var groupOptions = { 30355 matrix: matrix, 30356 bbox: bbox, 30357 smask: smask, 30358 isolated: false, 30359 knockout: false 30360 }; 30361 var groupSubtype = group.get('S'); 30362 var colorSpace = null; 30363 30364 if ((0, _primitives.isName)(groupSubtype, 'Transparency')) { 30365 groupOptions.isolated = group.get('I') || false; 30366 groupOptions.knockout = group.get('K') || false; 30367 30368 if (group.has('CS')) { 30369 colorSpace = _colorspace.ColorSpace.parse(group.get('CS'), this.xref, resources, this.pdfFunctionFactory); 30370 } 30371 } 30372 30373 if (smask && smask.backdrop) { 30374 colorSpace = colorSpace || _colorspace.ColorSpace.singletons.rgb; 30375 smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); 30376 } 30377 30378 operatorList.addOp(_util.OPS.beginGroup, [groupOptions]); 30379 } 30380 30381 operatorList.addOp(_util.OPS.paintFormXObjectBegin, [matrix, bbox]); 30382 return this.getOperatorList({ 30383 stream: xobj, 30384 task: task, 30385 resources: dict.get('Resources') || resources, 30386 operatorList: operatorList, 30387 initialState: initialState 30388 }).then(function () { 30389 operatorList.addOp(_util.OPS.paintFormXObjectEnd, []); 30390 30391 if (group) { 30392 operatorList.addOp(_util.OPS.endGroup, [groupOptions]); 30393 } 30394 }); 30395 }, 30396 buildPaintImageXObject: function buildPaintImageXObject(_ref5) { 30397 var _this2 = this; 30398 30399 var resources = _ref5.resources, 30400 image = _ref5.image, 30401 _ref5$isInline = _ref5.isInline, 30402 isInline = _ref5$isInline === void 0 ? false : _ref5$isInline, 30403 operatorList = _ref5.operatorList, 30404 cacheKey = _ref5.cacheKey, 30405 imageCache = _ref5.imageCache, 30406 _ref5$forceDisableNat = _ref5.forceDisableNativeImageDecoder, 30407 forceDisableNativeImageDecoder = _ref5$forceDisableNat === void 0 ? false : _ref5$forceDisableNat; 30408 var dict = image.dict; 30409 var w = dict.get('Width', 'W'); 30410 var h = dict.get('Height', 'H'); 30411 30412 if (!(w && (0, _util.isNum)(w)) || !(h && (0, _util.isNum)(h))) { 30413 (0, _util.warn)('Image dimensions are missing, or not numbers.'); 30414 return Promise.resolve(); 30415 } 30416 30417 var maxImageSize = this.options.maxImageSize; 30418 30419 if (maxImageSize !== -1 && w * h > maxImageSize) { 30420 (0, _util.warn)('Image exceeded maximum allowed size and was removed.'); 30421 return Promise.resolve(); 30422 } 30423 30424 var imageMask = dict.get('ImageMask', 'IM') || false; 30425 var imgData, args; 30426 30427 if (imageMask) { 30428 var width = dict.get('Width', 'W'); 30429 var height = dict.get('Height', 'H'); 30430 var bitStrideLength = width + 7 >> 3; 30431 var imgArray = image.getBytes(bitStrideLength * height, true); 30432 var decode = dict.getArray('Decode', 'D'); 30433 imgData = _image.PDFImage.createMask({ 30434 imgArray: imgArray, 30435 width: width, 30436 height: height,
30437 imageIsFromDecodeStream: image instanceof _stream.DecodeStream, 30438 inverseDecode: !!decode && decode[0] > 0 30439 }); 30440 imgData.cached = true; 30441 args = [imgData]; 30442 operatorList.addOp(_util.OPS.paintImageMaskXObject, args); 30443 30444 if (cacheKey) { 30445 imageCache[cacheKey] = { 30446 fn: _util.OPS.paintImageMaskXObject, 30447 args: args 30448 }; 30449 } 30450 30451 return Promise.resolve(); 30452 } 30453 30454 var softMask = dict.get('SMask', 'SM') || false; 30455 var mask = dict.get('Mask') || false; 30456 var SMALL_IMAGE_DIMENSIONS = 200; 30457 30458 if (isInline && !softMask && !mask && !(image instanceof _jpeg_stream.JpegStream) && w + h < SMALL_IMAGE_DIMENSIONS) { 30459 var imageObj = new _image.PDFImage({ 30460 xref: this.xref, 30461 res: resources, 30462 image: image, 30463 isInline: isInline, 30464 pdfFunctionFactory: this.pdfFunctionFactory 30465 }); 30466 imgData = imageObj.createImageData(true); 30467 operatorList.addOp(_util.OPS.paintInlineImageXObject, [imgData]); 30468 return Promise.resolve(); 30469 } 30470 30471 var nativeImageDecoderSupport = forceDisableNativeImageDecoder ? _util.NativeImageDecoding.NONE : this.options.nativeImageDecoderSupport; 30472 var objId = 'img_' + this.idFactory.createObjId(); 30473 30474 if (nativeImageDecoderSupport !== _util.NativeImageDecoding.NONE && !softMask && !mask && image instanceof _jpeg_stream.JpegStream && NativeImageDecoder.isSupported(image, this.xref, resources, this.pdfFunctionFactory)) { 30475 return this.handler.sendWithPromise('obj', [objId, this.pageIndex, 'JpegStream', image.getIR(this.options.forceDataSchema)]).then(function () { 30476 operatorList.addDependency(objId); 30477 args = [objId, w, h]; 30478 operatorList.addOp(_util.OPS.paintJpegXObject, args); 30479 30480 if (cacheKey) { 30481 imageCache[cacheKey] = { 30482 fn: _util.OPS.paintJpegXObject, 30483 args: args 30484 }; 30485 } 30486 }, function (reason) { 30487 (0, _util.warn)('Native JPEG decoding failed -- trying to recover: ' + (reason && reason.message)); 30488 return _this2.buildPaintImageXObject({ 30489 resources: resources, 30490 image: image, 30491 isInline: isInline, 30492 operatorList: operatorList, 30493 cacheKey: cacheKey, 30494 imageCache: imageCache, 30495 forceDisableNativeImageDecoder: true 30496 }); 30497 }); 30498 } 30499 30500 var nativeImageDecoder = null; 30501 30502 if (nativeImageDecoderSupport === _util.NativeImageDecoding.DECODE && (image instanceof _jpeg_stream.JpegStream || mask instanceof _jpeg_stream.JpegStream || softMask instanceof _jpeg_stream.JpegStream)) { 30503 nativeImageDecoder = new NativeImageDecoder({ 30504 xref: this.xref, 30505 resources: resources, 30506 handler: this.handler, 30507 forceDataSchema: this.options.forceDataSchema, 30508 pdfFunctionFactory: this.pdfFunctionFactory 30509 }); 30510 } 30511 30512 operatorList.addDependency(objId); 30513 args = [objId, w, h]; 30514 30515 _image.PDFImage.buildImage({ 30516 handler: this.handler, 30517 xref: this.xref, 30518 res: resources, 30519 image: image, 30520 isInline: isInline, 30521 nativeDecoder: nativeImageDecoder, 30522 pdfFunctionFactory: this.pdfFunctionFactory 30523 }).then(function (imageObj) { 30524 var imgData = imageObj.createImageData(false); 30525 30526 _this2.handler.send('obj', [objId, _this2.pageIndex, 'Image', imgData], [imgData.data.buffer]); 30527 }).catch(function (reason) { 30528 (0, _util.warn)('Unable to decode image: ' + reason); 30529 30530 _this2.handler.send('obj', [objId, _this2.pageIndex, 'Image', null]); 30531 }); 30532 30533 operatorList.addOp(_util.OPS.paintImageXObject, args); 30534 30535 if (cacheKey) { 30536 imageCache[cacheKey] = { 30537 fn: _util.OPS.paintImageXObject, 30538 args: args 30539 }; 30540 } 30541 30542 return Promise.resolve(); 30543 }, 30544 handleSMask: function PartialEvaluator_handleSmask(smask, resources, operatorList, task, stateManager) { 30545 var smaskContent = smask.get('G'); 30546 var smaskOptions = { 30547 subtype: smask.get('S').name, 30548 backdrop: smask.get('BC') 30549 }; 30550 var transferObj = smask.get('TR'); 30551 30552 if ((0, _function.isPDFFunction)(transferObj)) { 30553 var transferFn = this.pdfFunctionFactory.create(transferObj); 30554 var transferMap = new Uint8Array(256); 30555 var tmp = new Float32Array(1); 30556 30557 for (var i = 0; i < 256; i++) { 30558 tmp[0] = i / 255; 30559 transferFn(tmp, 0, tmp, 0); 30560 transferMap[i] = tmp[0] * 255 | 0; 30561 } 30562 30563 smaskOptions.transferMap = transferMap; 30564 } 30565 30566 return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone()); 30567 }, 30568 handleTilingType: function handleTilingType(fn, args, resources, pattern, patternDict, operatorList, task) { 30569 var _this3 = this; 30570 30571 var tilingOpList = new _operator_list.OperatorList(); 30572 var resourcesArray = [patternDict.get('Resources'), resources]; 30573 30574 var patternResources = _primitives.Dict.merge(this.xref, resourcesArray);
30575 30576 return this.getOperatorList({ 30577 stream: pattern, 30578 task: task, 30579 resources: patternResources, 30580 operatorList: tilingOpList 30581 }).then(function () { 30582 return (0, _pattern.getTilingPatternIR)({ 30583 fnArray: tilingOpList.fnArray, 30584 argsArray: tilingOpList.argsArray 30585 }, patternDict, args); 30586 }).then(function (tilingPatternIR) { 30587 operatorList.addDependencies(tilingOpList.dependencies); 30588 operatorList.addOp(fn, tilingPatternIR); 30589 }, function (reason) { 30590 if (_this3.options.ignoreErrors) { 30591 _this3.handler.send('UnsupportedFeature', { 30592 featureId: _util.UNSUPPORTED_FEATURES.unknown 30593 }); 30594 30595 (0, _util.warn)("handleTilingType - ignoring pattern: \"".concat(reason, "\".")); 30596 return; 30597 } 30598 30599 throw reason; 30600 }); 30601 }, 30602 handleSetFont: function PartialEvaluator_handleSetFont(resources, fontArgs, fontRef, operatorList, task, state) { 30603 var _this4 = this; 30604 30605 var fontName; 30606 30607 if (fontArgs) { 30608 fontArgs = fontArgs.slice(); 30609 fontName = fontArgs[0].name; 30610 } 30611 30612 return this.loadFont(fontName, fontRef, resources).then(function (translated) { 30613 if (!translated.font.isType3Font) { 30614 return translated; 30615 } 30616 30617 return translated.loadType3Data(_this4, resources, operatorList, task).then(function () { 30618 return translated; 30619 }).catch(function (reason) { 30620 _this4.handler.send('UnsupportedFeature', { 30621 featureId: _util.UNSUPPORTED_FEATURES.font 30622 }); 30623 30624 return new TranslatedFont('g_font_error', new _fonts.ErrorFont('Type3 font load error: ' + reason), translated.font); 30625 }); 30626 }).then(function (translated) { 30627 state.font = translated.font; 30628 translated.send(_this4.handler); 30629 return translated.loadedName; 30630 }); 30631 },
30632 handleText: function handleText(chars, state) { 30633 var font = state.font; 30634 var glyphs = font.charsToGlyphs(chars); 30635 30636 if (font.data) { 30637 var isAddToPathSet = !!(state.textRenderingMode & _util.TextRenderingMode.ADD_TO_PATH_FLAG); 30638 30639 if (isAddToPathSet || state.fillColorSpace.name === 'Pattern' || font.disableFontFace || this.options.disableFontFace) { 30640 PartialEvaluator.buildFontPaths(font, glyphs, this.handler); 30641 } 30642 } 30643 30644 return glyphs; 30645 }, 30646 setGState: function PartialEvaluator_setGState(resources, gState, operatorList, task, stateManager) { 30647 var _this5 = this; 30648 30649 var gStateObj = []; 30650 var gStateKeys = gState.getKeys(); 30651 var promise = Promise.resolve(); 30652 30653 var _loop = function _loop() { 30654 var key = gStateKeys[i]; 30655 var value = gState.get(key); 30656 30657 switch (key) { 30658 case 'Type': 30659 break; 30660 30661 case 'LW': 30662 case 'LC': 30663 case 'LJ': 30664 case 'ML': 30665 case 'D': 30666 case 'RI': 30667 case 'FL': 30668 case 'CA': 30669 case 'ca': 30670 gStateObj.push([key, value]); 30671 break; 30672 30673 case 'Font': 30674 promise = promise.then(function () { 30675 return _this5.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) { 30676 operatorList.addDependency(loadedName); 30677 gStateObj.push([key, [loadedName, value[1]]]); 30678 }); 30679 }); 30680 break; 30681 30682 case 'BM': 30683 gStateObj.push([key, normalizeBlendMode(value)]); 30684 break; 30685 30686 case 'SMask': 30687 if ((0, _primitives.isName)(value, 'None')) { 30688 gStateObj.push([key, false]); 30689 break; 30690 } 30691 30692 if ((0, _primitives.isDict)(value)) { 30693 promise = promise.then(function () { 30694 return _this5.handleSMask(value, resources, operatorList, task, stateManager); 30695 }); 30696 gStateObj.push([key, true]); 30697 } else { 30698 (0, _util.warn)('Unsupported SMask type'); 30699 } 30700 30701 break; 30702 30703 case 'OP': 30704 case 'op': 30705 case 'OPM': 30706 case 'BG': 30707 case 'BG2': 30708 case 'UCR': 30709 case 'UCR2': 30710 case 'TR': 30711 case 'TR2': 30712 case 'HT': 30713 case 'SM': 30714 case 'SA': 30715 case 'AIS': 30716 case 'TK': 30717 (0, _util.info)('graphic state operator ' + key); 30718 break; 30719 30720 default: 30721 (0, _util.info)('Unknown graphic state operator ' + key); 30722 break; 30723 } 30724 }; 30725 30726 for (var i = 0, ii = gStateKeys.length; i < ii; i++) { 30727 _loop();
30728 } 30729 30730 return promise.then(function () { 30731 if (gStateObj.length > 0) { 30732 operatorList.addOp(_util.OPS.setGState, [gStateObj]); 30733 } 30734 }); 30735 }, 30736 loadFont: function PartialEvaluator_loadFont(fontName, font, resources) { 30737 var _this6 = this; 30738 30739 function errorFont() { 30740 return Promise.resolve(new TranslatedFont('g_font_error', new _fonts.ErrorFont('Font ' + fontName + ' is not available'), font)); 30741 } 30742 30743 var fontRef, 30744 xref = this.xref; 30745 30746 if (font) { 30747 if (!(0, _primitives.isRef)(font)) { 30748 throw new Error('The "font" object should be a reference.'); 30749 } 30750 30751 fontRef = font; 30752 } else { 30753 var fontRes = resources.get('Font'); 30754 30755 if (fontRes) { 30756 fontRef = fontRes.getRaw(fontName); 30757 } else { 30758 (0, _util.warn)('fontRes not available'); 30759 return errorFont(); 30760 } 30761 } 30762 30763 if (!fontRef) { 30764 (0, _util.warn)('fontRef not available'); 30765 return errorFont(); 30766 } 30767 30768 if (this.fontCache.has(fontRef)) { 30769 return this.fontCache.get(fontRef); 30770 } 30771 30772 font = xref.fetchIfRef(fontRef); 30773 30774 if (!(0, _primitives.isDict)(font)) { 30775 return errorFont(); 30776 } 30777 30778 if (font.translated) { 30779 return font.translated; 30780 } 30781 30782 var fontCapability = (0, _util.createPromiseCapability)(); 30783 var preEvaluatedFont = this.preEvaluateFont(font); 30784 var descriptor = preEvaluatedFont.descriptor; 30785 var fontRefIsRef = (0, _primitives.isRef)(fontRef), 30786 fontID; 30787 30788 if (fontRefIsRef) { 30789 fontID = fontRef.toString(); 30790 } 30791 30792 if ((0, _primitives.isDict)(descriptor)) { 30793 if (!descriptor.fontAliases) { 30794 descriptor.fontAliases = Object.create(null); 30795 } 30796 30797 var fontAliases = descriptor.fontAliases; 30798 var hash = preEvaluatedFont.hash; 30799 30800 if (fontAliases[hash]) { 30801 var aliasFontRef = fontAliases[hash].aliasRef; 30802 30803 if (fontRefIsRef && aliasFontRef && this.fontCache.has(ali
30803asFontRef)) { 30804 this.fontCache.putAlias(fontRef, aliasFontRef); 30805 return this.fontCache.get(fontRef); 30806 } 30807 } else { 30808 fontAliases[hash] = { 30809 fontID: _fonts.Font.getFontID() 30810 }; 30811 } 30812 30813 if (fontRefIsRef) { 30814 fontAliases[hash].aliasRef = fontRef; 30815 } 30816 30817 fontID = fontAliases[hash].fontID; 30818 } 30819 30820 if (fontRefIsRef) { 30821 this.fontCache.put(fontRef, fontCapability.promise); 30822 } else { 30823 if (!fontID) { 30824 fontID = this.idFactory.createObjId(); 30825 } 30826 30827 this.fontCache.put('id_' + fontID, fontCapability.promise); 30828 } 30829 30830 (0, _util.assert)(fontID, 'The "fontID" must be defined.'); 30831 font.loadedName = 'g_' + this.pdfManager.docId + '_f' + fontID; 30832 font.translated = fontCapability.promise; 30833 var translatedPromise; 30834 30835 try { 30836 translatedPromise = this.translateFont(preEvaluatedFont); 30837 } catch (e) { 30838 translatedPromise = Promise.reject(e); 30839 } 30840 30841 translatedPromise.then(function (translatedFont) { 30842 if (translatedFont.fontType !== undefined) { 30843 var xrefFontStats = xref.stats.fontTypes; 30844 xrefFontStats[translatedFont.fontType] = true; 30845 } 30846 30847 fontCapability.resolve(new TranslatedFont(font.loadedName, translatedFont, font)); 30848 }).catch(function (reason) { 30849 _this6.handler.send('UnsupportedFeature', { 30850 featureId: _util.UNSUPPORTED_FEATURES.font 30851 }); 30852 30853 try { 30854 var descriptor = preEvaluatedFont.descriptor; 30855 var fontFile3 = descriptor && descriptor.get('FontFile3'); 30856 var subtype = fontFile3 && fontFile3.get('Subtype'); 30857 var fontType = (0, _fonts.getFontType)(preEvaluatedFont.type, subtype && subtype.name); 30858 var xrefFontStats = xref.stats.fontTypes; 30859 xrefFontStats[fontType] = true; 30860 } catch (ex) {} 30861 30862 fontCapability.resolve(new TranslatedFont(font.loadedName, new _fonts.ErrorFont(reason instanceof Error ? reason.message : reason), font)); 30863 }); 30864 return fontCapability.promise; 30865 }, 30866 buildPath: function PartialEvaluator_buildPath(operatorList, fn, args) { 30867 var lastIndex = operatorList.length - 1; 30868 30869 if (!args) { 30870 args = []; 30871 } 30872 30873 if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== _util.OPS.constructPath) { 30874 operatorList.addOp(_util.OPS.constructPath, [[fn], args]); 30875 } else { 30876 var opArgs = operatorList.argsArray[lastIndex]; 30877 opArgs[0].push(fn); 30878 Array.prototype.push.apply(opArgs[1], args); 30879 } 30880 }, 30881 handleColorN: function PartialEvaluator_handleColorN(operatorList, fn, args, cs, patterns, resources, task) { 30882 var patternName = args[args.length - 1]; 30883 var pattern; 30884 30885 if ((0, _primitives.isName)(patternName) && (pattern = patterns.get(patternName.name))) { 30886 var dict = (0, _primitives.isStream)(pattern) ? pattern.dict : pattern; 30887 var typeNum = dict.get('PatternType'); 30888 30889 if (typeNum === TILING_PATTERN) { 30890 var color = cs.base ? cs.base.getRgb(args, 0) : null; 30891 return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task); 30892 } else if (typeNum === SHADING_PATTERN) { 30893 var shading = dict.get('Shading'); 30894 var matrix = dict.getArray('Matrix'); 30895 pattern = _pattern.Pattern.parseShading(shading, matrix, this.xref, resources, this.handler, this.pdfFunctionFactory); 30896 operatorList.addOp(fn, pattern.getIR()); 30897 return Promise.resolve(); 30898 } 30899 30900 return Promise.reject(new Error('Unknown PatternType: ' + typeNum)); 30901 } 30902 30903 operatorList.addOp(fn, args); 30904 return Promise.resolve(); 30905 }, 30906 getOperatorList: function getOperatorList(_ref6) { 30907 var _this7 = this; 30908 30909 var stream = _ref6.stream, 30910 task = _ref6.task, 30911 resources = _ref6.resources, 30912 operatorList = _ref6.operatorList, 30913 _ref6$initialState = _ref6.initialState, 30914 initialState = _ref6$initialState === void 0 ? null : _ref6$initialState; 30915 resources = resources || _primitives.Dict.empty; 30916 initialState = initialState || new EvalState(); 30917 30918 if (!operatorList) { 30919 throw new Error('getOperatorList: missing "operatorList" parameter'); 30920 } 30921 30922 var self = this; 30923 var xref = this.xref; 30924 var imageCache = Object.create(null); 30925 30926 var xobjs = resources.get('XObject') || _primitives.Dict.empty; 30927 30928 var patterns = resources.get('Pattern') || _primitives.Dict.empty; 30929 30930 var stateManager = new StateManager(initialState); 30931 var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); 30932 var timeSlotManager = new TimeSlotManager(); 30933 30934 function closePendingRestoreOPS(argument) { 30935 for (var i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { 30936 operatorList.addOp(_util.OPS.restore, []); 30937 } 30938 } 30939 30940 return new Promise(function promiseBody(resolve, reject) { 30941 var next = function next(promise) { 30942 promise.then(function () { 30943 try { 30944 promiseBody(resolve, reject); 30945 } catch (ex) { 30946 reject(ex); 30947 } 30948 }, reject); 30949 }; 30950 30951 task.ensureNotTerminated(); 30952 timeSlotManager.reset(); 30953 var stop, 30954 operation = {}, 30955 i, 30956 ii, 30957 cs; 30958 30959 while (!(stop = timeSlotManager.check())) { 30960 operation.args = null; 30961 30962 if (!preprocessor.read(operation)) { 30963 break; 30964 } 30965 30966 var args = operation.args; 30967 var fn = operation.fn; 30968 30969 switch (fn | 0) { 30970 case _util.OPS.paintXObject: 30971 var name = args[0].name; 30972 30973 if (name && imageCache[name] !== undefined) { 30974 operatorList.addOp(imageCache[name].fn, imageCache[name].args); 30975 args = null; 30976 continue; 30977 } 30978 30979 next(new Promise(function (resolveXObject, rejectXObject) { 30980 if (!name) { 30981 throw new _util.FormatError('XObject must be referred to by name.'); 30982 } 30983 30984 var xobj = xobjs.get(name); 30985 30986 if (!xobj) { 30987 operatorList.addOp(fn, args); 30988 resolveXObject(); 30989 return; 30990 } 30991 30992 if (!(0, _primitives.isStream)(xobj)) { 30993 throw new _util.FormatError('XObject should be a stream'); 30994 } 30995 30996 var type = xobj.dict.get('Subtype'); 30997 30998 if (!(0, _primitives.isName)(type)) { 30999 throw new _util.FormatError('XObject should have a Name subtype'); 31000 } 31001 31002 if (type.name === 'Form') { 31003 stateManager.save(); 31004 self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone()).then(function () {
vendor: 11,773 bytes, lines 31005-31317
31005 stateManager.restore(); 31006 resolveXObject(); 31007 }, rejectXObject); 31008 return; 31009 } else if (type.name === 'Image') { 31010 self.buildPaintImageXObject({ 31011 resources: resources, 31012 image: xobj, 31013 operatorList: operatorList, 31014 cacheKey: name, 31015 imageCache: imageCache 31016 }).then(resolveXObject, rejectXObject); 31017 return; 31018 } else if (type.name === 'PS') { 31019 (0, _util.info)('Ignored XObject subtype PS'); 31020 } else { 31021 throw new _util.FormatError("Unhandled XObject subtype ".concat(type.name)); 31022 } 31023 31024 resolveXObject(); 31025 }).catch(function (reason) { 31026 if (self.options.ignoreErrors) { 31027 self.handler.send('UnsupportedFeature', { 31028 featureId: _util.UNSUPPORTED_FEATURES.unknown 31029 }); 31030 (0, _util.warn)("getOperatorList - ignoring XObject: \"".concat(reason, "\".")); 31031 return; 31032 } 31033 31034 throw reason; 31035 })); 31036 return; 31037 31038 case _util.OPS.setFont: 31039 var fontSize = args[1]; 31040 next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state).then(function (loadedName) { 31041 operatorList.addDependency(loadedName); 31042 operatorList.addOp(_util.OPS.setFont, [loadedName, fontSize]); 31043 })); 31044 return; 31045 31046 case _util.OPS.endInlineImage: 31047 var cacheKey = args[0].cacheKey; 31048 31049 if (cacheKey) { 31050 var cacheEntry = imageCache[cacheKey]; 31051 31052 if (cacheEntry !== undefined) { 31053 operatorList.addOp(cacheEntry.fn, cacheEntry.args); 31054 args = null; 31055 continue; 31056 } 31057 } 31058 31059 next(self.buildPaintImageXObject({ 31060 resources: resources, 31061 image: args[0], 31062 isInline: true, 31063 operatorList: operatorList, 31064 cacheKey: cacheKey, 31065 imageCache: imageCache 31066 })); 31067 return; 31068 31069 case _util.OPS.showText: 31070 args[0] = self.handleText(args[0], stateManager.state); 31071 break; 31072 31073 case _util.OPS.showSpacedText: 31074 var arr = args[0]; 31075 var combinedGlyphs = []; 31076 var arrLength = arr.length; 31077 var state = stateManager.state; 31078 31079 for (i = 0; i < arrLength; ++i) { 31080 var arrItem = arr[i]; 31081 31082 if ((0, _util.isString)(arrItem)) { 31083 Array.prototype.push.apply(combinedGlyphs, self.handleText(arrItem, state)); 31084 } else if ((0, _util.isNum)(arrItem)) { 31085 combinedGlyphs.push(arrItem); 31086 } 31087 } 31088 31089 args[0] = combinedGlyphs; 31090 fn = _util.OPS.showText; 31091 break; 31092 31093 case _util.OPS.nextLineShowText: 31094 operatorList.addOp(_util.OPS.nextLine); 31095 args[0] = self.handleText(args[0], stateManager.state); 31096 fn = _util.OPS.showText; 31097 break; 31098 31099 case _util.OPS.nextLineSetSpacingShowText: 31100 operatorList.addOp(_util.OPS.nextLine); 31101 operatorList.addOp(_util.OPS.setWordSpacing, [args.shift()]); 31102 operatorList.addOp(_util.OPS.setCharSpacing, [args.shift()]); 31103 args[0] = self.handleText(args[0], stateManager.state); 31104 fn = _util.OPS.showText; 31105 break; 31106 31107 case _util.OPS.setTextRenderingMode: 31108 stateManager.state.textRenderingMode = args[0]; 31109 break; 31110 31111 case _util.OPS.setFillColorSpace: 31112 stateManager.state.fillColorSpace = _colorspace.ColorSpace.parse(args[0], xref, resources, self.pdfFunctionFactory); 31113 continue; 31114 31115 case _util.OPS.setStrokeColorSpace: 31116 stateManager.state.strokeColorSpace = _colorspace.ColorSpace.parse(args[0], xref, resources, self.pdfFunctionFactory); 31117 continue; 31118 31119 case _util.OPS.setFillColor: 31120 cs = stateManager.state.fillColorSpace; 31121 args = cs.getRgb(args, 0); 31122 fn = _util.OPS.setFillRGBColor; 31123 break; 31124 31125 case _util.OPS.setStrokeColor: 31126 cs = stateManager.state.strokeColorSpace; 31127 args = cs.getRgb(args, 0); 31128 fn = _util.OPS.setStrokeRGBColor; 31129 break; 31130 31131 case _util.OPS.setFillGray: 31132 stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.gray; 31133 args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); 31134 fn = _util.OPS.setFillRGBColor; 31135 break; 31136 31137 case _util.OPS.setStrokeGray: 31138 stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.gray; 31139 args = _colorspace.ColorSpace.singletons.gray.getRgb(args, 0); 31140 fn = _util.OPS.setStrokeRGBColor; 31141 break; 31142 31143 case _util.OPS.setFillCMYKColor: 31144 stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.cmyk; 31145 args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); 31146 fn = _util.OPS.setFillRGBColor; 31147 break; 31148 31149 case _util.OPS.setStrokeCMYKColor: 31150 stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.cmyk; 31151 args = _colorspace.ColorSpace.singletons.cmyk.getRgb(args, 0); 31152 fn = _util.OPS.setStrokeRGBColor; 31153 break; 31154 31155 case _util.OPS.setFillRGBColor: 31156 stateManager.state.fillColorSpace = _colorspace.ColorSpace.singletons.rgb; 31157 args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); 31158 break; 31159 31160 case _util.OPS.setStrokeRGBColor: 31161 stateManager.state.strokeColorSpace = _colorspace.ColorSpace.singletons.rgb; 31162 args = _colorspace.ColorSpace.singletons.rgb.getRgb(args, 0); 31163 break; 31164 31165 case _util.OPS.setFillColorN: 31166 cs = stateManager.state.fillColorSpace; 31167 31168 if (cs.name === 'Pattern') { 31169 next(self.handleColorN(operatorList, _util.OPS.setFillColorN, args, cs, patterns, resources, task)); 31170 return; 31171 } 31172 31173 args = cs.getRgb(args, 0); 31174 fn = _util.OPS.setFillRGBColor; 31175 break; 31176 31177 case _util.OPS.setStrokeColorN: 31178 cs = stateManager.state.strokeColorSpace; 31179 31180 if (cs.name === 'Pattern') { 31181 next(self.handleColorN(operatorList, _util.OPS.setStrokeColorN, args, cs, patterns, resources, task)); 31182 return; 31183 } 31184 31185 args = cs.getRgb(args, 0); 31186 fn = _util.OPS.setStrokeRGBColor; 31187 break; 31188 31189 case _util.OPS.shadingFill: 31190 var shadingRes = resources.get('Shading'); 31191 31192 if (!shadingRes) { 31193 throw new _util.FormatError('No shading resource found'); 31194 } 31195 31196 var shading = shadingRes.get(args[0].name); 31197 31198 if (!shading) { 31199 throw new _util.FormatError('No shading object found'); 31200 } 31201 31202 var shadingFill = _pattern.Pattern.parseShading(shading, null, xref, resources, self.handler, self.pdfFunctionFactory); 31203 31204 var patternIR = shadingFill.getIR(); 31205 args = [patternIR]; 31206 fn = _util.OPS.shadingFill; 31207 break; 31208 31209 case _util.OPS.setGState: 31210 var dictName = args[0]; 31211 var extGState = resources.get('ExtGState'); 31212 31213 if (!(0, _primitives.isDict)(extGState) || !extGState.has(dictName.name)) { 31214 break; 31215 } 31216 31217 var gState = extGState.get(dictName.name); 31218 next(self.setGState(resources, gState, operatorList, task, stateManager)); 31219 return; 31220 31221 case _util.OPS.moveTo: 31222 case _util.OPS.lineTo: 31223 case _util.OPS.curveTo: 31224 case _util.OPS.curveTo2: 31225 case _util.OPS.curveTo3: 31226 case _util.OPS.closePath: 31227 self.buildPath(operatorList, fn, args); 31228 continue; 31229 31230 case _util.OPS.rectangle: 31231 self.buildPath(operatorList, fn, args); 31232 continue; 31233 31234 case _util.OPS.markPoint: 31235 case _util.OPS.markPointProps: 31236 case _util.OPS.beginMarkedContent: 31237 case _util.OPS.beginMarkedContentProps: 31238 case _util.OPS.endMarkedContent: 31239 case _util.OPS.beginCompat: 31240 case _util.OPS.endCompat: 31241 continue; 31242 31243 default: 31244 if (args !== null) { 31245 for (i = 0, ii = args.length; i < ii; i++) { 31246 if (args[i] instanceof _primitives.Dict) { 31247 break; 31248 } 31249 } 31250 31251 if (i < ii) { 31252 (0, _util.warn)('getOperatorList - ignoring operator: ' + fn); 31253 continue; 31254 } 31255 } 31256 31257 } 31258 31259 operatorList.addOp(fn, args); 31260 } 31261 31262 if (stop) { 31263 next(deferred); 31264 return; 31265 } 31266 31267 closePendingRestoreOPS(); 31268 resolve(); 31269 }).catch(function (reason) { 31270 if (_this7.options.ignoreErrors) { 31271 _this7.handler.send('UnsupportedFeature', { 31272 featureId: _util.UNSUPPORTED_FEATURES.unknown 31273 }); 31274 31275 (0, _util.warn)("getOperatorList - ignoring errors during \"".concat(task.name, "\" ") + "task: \"".concat(reason, "\".")); 31276 closePendingRestoreOPS(); 31277 return; 31278 } 31279 31280 throw reason; 31281 }); 31282 }, 31283 getTextContent: function getTextContent(_ref7) { 31284 var _this8 = this; 31285 31286 var stream = _ref7.stream, 31287 task = _ref7.task, 31288 resources = _ref7.resources, 31289 _ref7$stateManager = _ref7.stateManager, 31290 stateManager = _ref7$stateManager === void 0 ? null : _ref7$stateManager, 31291 _ref7$normalizeWhites = _ref7.normalizeWhitespace, 31292 normalizeWhitespace = _ref7$normalizeWhites === void 0 ? false : _ref7$normalizeWhites, 31293 _ref7$combineTextItem = _ref7.combineTextItems, 31294 combineTextItems = _ref7$combineTextItem === void 0 ? false : _ref7$combineTextItem, 31295 sink = _ref7.sink, 31296 _ref7$seenStyles = _ref7.seenStyles, 31297 seenStyles = _ref7$seenStyles === void 0 ? Object.create(null) : _ref7$seenStyles; 31298 resources = resources || _primitives.Dict.empty; 31299 stateManager = stateManager || new StateManager(new TextState()); 31300 var WhitespaceRegexp = /\s/g; 31301 var textContent = { 31302 items: [], 31303 styles: Object.create(null) 31304 }; 31305 var textContentItem = { 31306 initialized: false, 31307 str: [], 31308 width: 0, 31309 height: 0, 31310 vertical: false, 31311 lastAdvanceWidth: 0, 31312 lastAdvanceHeight: 0, 31313 textAdvanceScale: 0, 31314 spaceWidth: 0, 31315 fakeSpaceMin: Infinity, 31316 fakeMultiSpaceMin: Infinity, 31317 fakeMultiSpaceMax: -0,
31318 textRunBreakAllowed: false, 31319 transform: null, 31320 fontName: null 31321 }; 31322 var SPACE_FACTOR = 0.3; 31323 var MULTI_SPACE_FACTOR = 1.5; 31324 var MULTI_SPACE_FACTOR_MAX = 4; 31325 var self = this; 31326 var xref = this.xref; 31327 var xobjs = null; 31328 var skipEmptyXObjs = Object.create(null); 31329 var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); 31330 var textState; 31331 31332 function ensureTextContentItem() { 31333 if (textContentItem.initialized) { 31334 return textContentItem; 31335 } 31336 31337 var font = textState.font; 31338 31339 if (!(font.loadedName in seenStyles)) { 31340 seenStyles[font.loadedName] = true; 31341 textContent.styles[font.loadedName] = { 31342 fontFamily: font.fallbackName, 31343 ascent: font.ascent, 31344 descent: font.descent, 31345 vertical: !!font.vertical 31346 }; 31347 } 31348 31349 textContentItem.fontName = font.loadedName; 31350 var tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise]; 31351 31352 if (font.isType3Font && textState.fontMatrix !== _util.FONT_IDENTITY_MATRIX && textState.fontSize === 1) { 31353 var glyphHeight = font.bbox[3] - font.bbox[1]; 31354 31355 if (glyphHeight > 0) { 31356 glyphHeight = glyphHeight * textState.fontMatrix[3]; 31357 tsm[3] *= glyphHeight; 31358 } 31359 } 31360 31361 var trm = _util.Util.transform(textState.ctm, _util.Util.transform(textState.textMatrix, tsm)); 31362 31363 textContentItem.transform = trm; 31364 31365 if (!font.vertical) { 31366 textContentItem.width = 0; 31367 textContentItem.height = Math.sqrt(trm[2] * trm[2] + trm[3] * trm[3]); 31368 textContentItem.vertical = false; 31369 } else { 31370 textContentItem.width = Math.sqrt(trm[0] * trm[0] + trm[1] * trm[1]); 31371 textContentItem.height = 0; 31372 textContentItem.vertical = true; 31373 } 31374
31375 var a = textState.textLineMatrix[0]; 31376 var b = textState.textLineMatrix[1]; 31377 var scaleLineX = Math.sqrt(a * a + b * b); 31378 a = textState.ctm[0]; 31379 b = textState.ctm[1]; 31380 var scaleCtmX = Math.sqrt(a * a + b * b); 31381 textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; 31382 textContentItem.lastAdvanceWidth = 0; 31383 textContentItem.lastAdvanceHeight = 0; 31384 var spaceWidth = font.spaceWidth / 1000 * textState.fontSize; 31385 31386 if (spaceWidth) { 31387 textContentItem.spaceWidth = spaceWidth; 31388 textContentItem.fakeSpaceMin = spaceWidth * SPACE_FACTOR; 31389 textContentItem.fakeMultiSpaceMin = spaceWidth * MULTI_SPACE_FACTOR; 31390 textContentItem.fakeMultiSpaceMax = spaceWidth * MULTI_SPACE_FACTOR_MAX; 31391 textContentItem.textRunBreakAllowed = !font.isMonospace; 31392 } else { 31393 textContentItem.spaceWidth = 0; 31394 textContentItem.fakeSpaceMin = Infinity; 31395 textContentItem.fakeMultiSpaceMin = Infinity; 31396 textContentItem.fakeMultiSpaceMax = 0; 31397 textContentItem.textRunBreakAllowed = false; 31398 } 31399 31400 textContentItem.initialized = true; 31401 return textContentItem; 31402 } 31403 31404 function replaceWhitespace(str) { 31405 var i = 0, 31406 ii = str.length, 31407 code; 31408 31409 while (i < ii && (code = str.charCodeAt(i)) >= 0x20 && code <= 0x7F) { 31410 i++; 31411 } 31412 31413 return i < ii ? str.replace(WhitespaceRegexp, ' ') : str; 31414 } 31415 31416 function runBidiTransform(textChunk) { 31417 var str = textChunk.str.join(''); 31418 var bidiResult = (0, _bidi.bidi)(str, -1, textChunk.vertical); 31419 return { 31420 str: normalizeWhitespace ? replaceWhitespace(bidiResult.str) : bidiResult.str, 31421 dir: bidiResult.dir, 31422 width: textChunk.width, 31423 height: textChunk.height, 31424 transform: textChunk.transform, 31425 fontName: textChunk.fontName 31426 }; 31427 } 31428 31429 function handleSetFont(fontName, fontRef) { 31430 return self.loadFont(fontName, fontRef, resources).then(function (translated) { 31431 textState.font = translated.font; 31432 textState.fontMatrix = translated.font.fontMatrix || _util.FONT_IDENTITY_MATRIX; 31433 }); 31434 } 31435 31436 function buildTextContentItem(chars) { 31437 var font = textState.font; 31438 var textChunk = ensureTextContentItem(); 31439 var width = 0; 31440 var height = 0; 31441 var glyphs = font.charsToGlyphs(chars); 31442 31443 for (var i = 0; i < glyphs.length; i++) { 31444 var glyph = glyphs[i]; 31445 var glyphWidth = null; 31446 31447 if (font.vertical && glyph.vmetric) { 31448 glyphWidth = glyph.vmetric[0]; 31449 } else { 31450 glyphWidth = glyph.width; 31451 } 31452 31453 var glyphUnicode = glyph.unicode; 31454 var NormalizedUnicodes = (0, _unicode.getNormalizedUnicodes)(); 31455 31456 if (NormalizedUnicodes[glyphUnicode] !== undefined) { 31457 glyphUnicode = NormalizedUnicodes[glyphUnicode]; 31458 } 31459 31460 glyphUnicode = (0, _unicode.reverseIfRtl)(glyphUnicode); 31461 var charSpacing = textState.charSpacing; 31462 31463 if (glyph.isSpace) { 31464 var wordSpacing = textState.wordSpacing; 31465 charSpacing += wordSpacing; 31466 31467 if (wordSpacing > 0) { 31468 addFakeSpaces(wordSpacing, textChunk.str); 31469 } 31470 } 31471 31472 var tx = 0; 31473 var ty = 0; 31474 31475 if (!font.vertical) { 31476 var w0 = glyphWidth * textState.fontMatrix[0]; 31477 tx = (w0 * textState.fontSize + charSpacing) * textState.textHScale; 31478 width += tx; 31479 } else { 31480 var w1 = glyphWidth * textState.fontMatrix[0]; 31481 ty = w1 * textState.fontSize + charSpacing; 31482 height += ty; 31483 } 31484 31485 textState.translateTextMatrix(tx, ty); 31486 textChunk.str.push(glyphUnicode); 31487 } 31488 31489 if (!font.vertical) { 31490 textChunk.lastAdvanceWidth = width; 31491 textChunk.width += width; 31492 } else { 31493 textChunk.lastAdvanceHeight = height; 31494 textChunk.height += Math.abs(height); 31495 } 31496 31497 return textChunk; 31498 } 31499 31500 function addFakeSpaces(width, strBuf) { 31501 if (width < textContentItem.fakeSpaceMin) { 31502 return; 31503 } 31504 31505 if (width < textContentItem.fakeMultiSpaceMin) { 31506 strBuf.push(' '); 31507 return; 31508 } 31509 31510 var fakeSpaces = Math.round(width / textContentItem.spaceWi
31510dth); 31511 31512 while (fakeSpaces-- > 0) { 31513 strBuf.push(' '); 31514 } 31515 } 31516 31517 function flushTextContentItem() { 31518 if (!textContentItem.initialized) { 31519 return; 31520 } 31521 31522 if (!textContentItem.vertical) { 31523 textContentItem.width *= textContentItem.textAdvanceScale; 31524 } else { 31525 textContentItem.height *= textContentItem.textAdvanceScale; 31526 } 31527 31528 textContent.items.push(runBidiTransform(textContentItem)); 31529 textContentItem.initialized = false; 31530 textContentItem.str.length = 0; 31531 } 31532 31533 function enqueueChunk() { 31534 var length = textContent.items.length; 31535 31536 if (length > 0) { 31537 sink.enqueue(textContent, length); 31538 textContent.items = []; 31539 textContent.styles = Object.create(null); 31540 } 31541 } 31542 31543 var timeSlotManager = new TimeSlotManager(); 31544 return new Promise(function promiseBody(resolve, reject) { 31545 var next = function next(promise) { 31546 enqueueChunk(); 31547 Promise.all([promise, sink.ready]).then(function () { 31548 try { 31549 promiseBody(resolve, reject); 31550 } catch (ex) { 31551 reject(ex); 31552 } 31553 }, reject); 31554 }; 31555 31556 task.ensureNotTerminated(); 31557 timeSlotManager.reset(); 31558 var stop, 31559 operation = {}, 31560 args = []; 31561 31562 while (!(stop = timeSlotManager.check())) { 31563 args.length = 0; 31564 operation.args = args; 31565 31566 if (!preprocessor.read(operation)) { 31567 break; 31568 } 31569 31570 textState = stateManager.state; 31571 var fn = operation.fn; 31572 args = operation.args; 31573 var advance, diff; 31574 31575 switch (fn | 0) { 31576 case _util.OPS.setFont: 31577 var fontNameArg = args[0].name, 31578 fontSizeArg = args[1]; 31579 31580 if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) { 31581 break; 31582 } 31583 31584 flushTextContentItem(); 31585 textState.fontName = fontNameArg; 31586 textState.fontSize = fontSizeArg; 31587 next(handleSetFont(fontNameArg, null)); 31588 return; 31589 31590 case _util.OPS.setTextRise: 31591 flushTextContentItem(); 31592 textState.textRise = args[0]; 31593 break; 31594 31595 case _util.OPS.setHScale: 31596 flushTextContentItem(); 31597 textState.textHScale = args[0] / 100; 31598 break; 31599 31600 case _util.OPS.setLeading: 31601 flushTextContentItem(); 31602 textState.leading = args[0]; 31603 break; 31604 31605 case _util.OPS.moveText: 31606 var isSameTextLine = !textState.font ? false : (textState.font.vertical ? args[0] : args[1]) === 0; 31607 advance = args[0] - args[1]; 31608 31609 if (combineTextItems && isSameTextLine && textContentItem.initialized && advance > 0 && advance <= textContentItem.fakeMultiSpaceMax) { 31610 textState.translateTextLineMatrix(args[0], args[1]); 31611 textContentItem.width += args[0] - textContentItem.lastAdvanceWidth; 31612 textContentItem.height += args[1] - textContentItem.lastAdvanceHeight; 31613 diff = args[0] - textContentItem.lastAdvanceWidth - (args[1] - textContentItem.lastAdvanceHeight); 31614 addFakeSpaces(diff, textContentItem.str); 31615 break; 31616 } 31617 31618 flushTextContentItem(); 31619 textState.translateTextLineMatrix(args[0], args[1]);
vendor: 1,997 bytes, lines 31620-31662
31620 textState.textMatrix = textState.textLineMatrix.slice(); 31621 break; 31622 31623 case _util.OPS.setLeadingMoveText: 31624 flushTextContentItem(); 31625 textState.leading = -args[1]; 31626 textState.translateTextLineMatrix(args[0], args[1]); 31627 textState.textMatrix = textState.textLineMatrix.slice(); 31628 break; 31629 31630 case _util.OPS.nextLine: 31631 flushTextContentItem(); 31632 textState.carriageReturn(); 31633 break; 31634 31635 case _util.OPS.setTextMatrix: 31636 advance = textState.calcTextLineMatrixAdvance(args[0], args[1], args[2], args[3], args[4], args[5]); 31637 31638 if (combineTextItems && advance !== null && textContentItem.initialized && advance.value > 0 && advance.value <= textContentItem.fakeMultiSpaceMax) { 31639 textState.translateTextLineMatrix(advance.width, advance.height); 31640 textContentItem.width += advance.width - textContentItem.lastAdvanceWidth; 31641 textContentItem.height += advance.height - textContentItem.lastAdvanceHeight; 31642 diff = advance.width - textContentItem.lastAdvanceWidth - (advance.height - textContentItem.lastAdvanceHeight); 31643 addFakeSpaces(diff, textContentItem.str); 31644 break; 31645 } 31646 31647 flushTextContentItem(); 31648 textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); 31649 textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); 31650 break; 31651 31652 case _util.OPS.setCharSpacing: 31653 textState.charSpacing = args[0]; 31654 break; 31655 31656 case _util.OPS.setWordSpacing: 31657 textState.wordSpacing = args[0]; 31658 break; 31659 31660 case _util.OPS.beginText: 31661 flushTextContentItem(); 31662 textState.textMatrix = _util.IDENTITY_MATRIX.slice();
31663 textState.textLineMatrix = _util.IDENTITY_MATRIX.slice(); 31664 break; 31665 31666 case _util.OPS.showSpacedText: 31667 var items = args[0]; 31668 var offset; 31669 31670 for (var j = 0, jj = items.length; j < jj; j++) { 31671 if (typeof items[j] === 'string') { 31672 buildTextContentItem(items[j]); 31673 } else if ((0, _util.isNum)(items[j])) { 31674 ensureTextContentItem(); 31675 advance = items[j] * textState.fontSize / 1000; 31676 var breakTextRun = false; 31677 31678 if (textState.font.vertical) { 31679 offset = advance; 31680 textState.translateTextMatrix(0, offset); 31681 breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; 31682 31683 if (!breakTextRun) { 31684 textContentItem.height += offset; 31685 } 31686 } else { 31687 advance = -advance; 31688 offset = advance * textState.textHScale; 31689 textState.translateTextMatrix(offset, 0); 31690 breakTextRun = textContentItem.textRunBreakAllowed && advance > textContentItem.fakeMultiSpaceMax; 31691 31692 if (!breakTextRun) { 31693 textContentItem.width += offset; 31694 } 31695 } 31696 31697 if (breakTextRun) { 31698 flushTextContentItem(); 31699 } else if (advance > 0) { 31700 addFakeSpaces(advance, textContentItem.str); 31701 } 31702 } 31703 } 31704 31705 break; 31706 31707 case _util.OPS.showText: 31708 buildTextContentItem(args[0]); 31709 break; 31710 31711 case _util.OPS.nextLineShowText: 31712 flushTextContentItem(); 31713 textState.carriageReturn(); 31714 buildTextContentItem(args[0]); 31715 break; 31716 31717 case _util.OPS.nextLineSetSpacingShowText: 31718 flushTextContentItem(); 31719 textState.wordSpacing = args[0]; 31720 textState.charSpacing = args[1]; 31721 textState.carriageReturn(); 31722 buildTextContentItem(args[2]); 31723 break; 31724 31725 case _util.OPS.paintXObject: 31726 flushTextContentItem(); 31727 31728 if (!xobjs) { 31729 xobjs = resources.get('XObject') || _primitives.Dict.empty; 31730 } 31731 31732 var name = args[0].name; 31733 31734 if (name && skipEmptyXObjs[name] !== undefined) { 31735 break; 31736 } 31737 31738 next(new Promise(function (resolveXObject, rejectXObject) { 31739 if (!name) { 31740 throw new _util.FormatError('XObject must be referred to by name.'); 31741 } 31742 31743 var xobj = xobjs.get(name); 31744 31745 if (!xobj) { 31746 resolveXObject(); 31747 return; 31748 } 31749 31750 if (!(0, _primitives.isStream)(xobj)) { 31751 throw new _util.FormatError('XObject should be a stream'); 31752 } 31753 31754 var type = xobj.dict.get('Subtype'); 31755 31756 if (!(0, _primitives.isName)(type)) { 31757 throw new _util.FormatError('XObject should have a Name subtype'); 31758 } 31759 31760 if (type.name !== 'Form') { 31761 skipEmptyXObjs[name] = true; 31762 resolveXObject(); 31763 return; 31764 } 31765 31766 var currentState = stateManager.state.clone(); 31767 var xObjStateManager = new StateManager(currentState); 31768 var matrix = xobj.dict.getArray('Matrix'); 31769 31770 if (Array.isArray(matrix) && matrix.length === 6) { 31771 xObjStateManager.transform(matrix); 31772 } 31773 31774 enqueueChunk(); 31775 var sinkWrapper = { 31776 enqueueInvoked: false, 31777 enqueue: function enqueue(chunk, size) { 31778 this.enqueueInvoked = true; 31779 sink.enqueue(chunk, size); 31780 }, 31781 31782 get desiredSize() { 31783 return sink.desiredSize; 31784 }, 31785 31786 get ready() { 31787 return sink.ready; 31788 } 31789 31790 }; 31791 self.getTextContent({ 31792 stream: xobj, 31793 task: task, 31794 resources: xobj.dict.get('Resources') || resources, 31795 stateManager: xObjStateManager, 31796 normalizeWhitespace: normalizeWhitespace, 31797 combineTextItems: combineTextItems, 31798 sink: sinkWrapper, 31799 seenStyles: seenStyles 31800 }).then(function () { 31801 if (!sinkWrapper.enqueueInvoked) { 31802 skipEmptyXObjs[name] = true; 31803 } 31804 31805 resolveXObject(); 31806 }, rejectXObject); 31807 }).catch(function (reason) { 31808 if (reason instanceof _util.AbortException) { 31809 return; 31810 } 31811 31812 if (self.options.ignoreErrors) { 31813 (0, _util.warn)("getTextContent - ignoring XObject: \"".concat(reason, "\".")); 31814 return; 31815 } 31816 31817 throw reason; 31818 })); 31819 return; 31820 31821 case _util.OPS.setGState: 31822 flushTextContentItem(); 31823 var dictName = args[0]; 31824 var extGState = resources.get('ExtGState'); 31825 31826 if (!(0, _primitives.isDict)(extGState) || !(0, _primitives.isName)(dictName)) { 31827 break; 31828 } 31829 31830 var gState = extGState.get(dictName.name); 31831 31832 if (!(0, _primitives.isDict)(gState)) { 31833 break; 31834 } 31835 31836 var gStateFont = gState.get('Font'); 31837 31838 if (gStateFont) { 31839 textState.fontName = null; 31840 textState.fontSize = gStateFont[1]; 31841 next(handleSetFont(null, gStateFont[0])); 31842 return; 31843 } 31844 31845 break; 31846 } 31847 31848 if (textContent.items.length >= sink.desiredSize) { 31849 stop = true; 31850 break; 31851 } 31852 } 31853 31854 if (stop) { 31855 next(deferred); 31856 return; 31857 } 31858 31859 flushTextContentItem(); 31860 enqueueChunk(); 31861 resolve(); 31862 }).catch(function (reason) { 31863 if (reason instanceof _util.AbortException) { 31864 return; 31865 } 31866 31867 if (_this8.options.ignoreErrors) { 31868 (0, _util.warn)("getTextContent - ignoring errors during \"".concat(task.name, "\" ") + "task: \"".concat(reason, "\".")); 31869 flushTextContentItem(); 31870 enqueueChunk(); 31871 return; 31872 } 31873 31874 throw reason; 31875 }); 31876 }, 31877 extractDataStructures: function PartialEvaluator_extractDataStructures(dict, baseDict, properties) { 31878 var _this9 = this; 31879 31880 var xref = this.xref; 31881 var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode'); 31882 var toUnicodePromise = toUnicode ? this.readToUnicode(toUnicode) : Promise.resolve(undefined); 31883 31884 if (properties.composite) { 31885 var cidSystemInfo = dict.get('CIDSystemInfo'); 31886 31887 if ((0, _primitives.isDict)(cidSystemInfo)) { 31888 properties.cidSystemInfo = { 31889 registry: (0, _util.stringToPDFString)(cidSystemInfo.get('Registry')), 31890 ordering: (0, _util.stringToPDFString)(cidSystemInfo.get('Ordering')), 31891 supplement: cidSystemInfo.get('Supplement') 31892 }; 31893 } 31894 31895 var cidToGidMap = dict.get('CIDToGIDMap'); 31896 31897 if ((0, _primitives.isStream)(cidToGidMap)) { 31898 properties.cidToGidMap = this.readCidToGidMap(cidToGidMap); 31899 } 31900 } 31901 31902 var differences = []; 31903 var baseEncodingName = null; 31904 var encoding; 31905 31906 if (dict.has('Encoding')) { 31907 encoding = dict.get('Encoding'); 31908 31909 if ((0, _primitives.isDict)(encoding)) { 31910 baseEncodingName = encoding.get('BaseEncoding'); 31911 baseEncodingName = (0, _primitives.isName)(baseEncodingName) ? baseEncodingName.name : null; 31912 31913 if (encoding.has('Differences')) { 31914 var diffEncoding = encoding.get('Differences'); 31915 var index = 0; 31916 31917 for (var j = 0, jj = diffEncoding.length; j < jj; j++) { 31918 var data = xref.fetchIfRef(diffEncoding[j]); 31919 31920 if ((0, _util.isNum)(data)) { 31921 index = data; 31922 } else if ((0, _primitives.isName)(data)) { 31923 differences[index++] = data.name; 31924 } else { 31925 throw new _util.FormatError("Invalid entry in 'Differences' array: ".concat(data)); 31926 } 31927 } 31928 } 31929 } else if ((0, _primitives.isName)(encoding)) { 31930 baseEncodingName = encoding.name; 31931 } else { 31932 throw new _util.FormatError('Encoding is not a Name nor a Dict'); 31933 } 31934 31935 if (baseEncodingName !== 'MacRomanEncoding' && baseEncodingName !== 'MacExpertEncoding' && baseEncodingName !== 'WinAnsiEncoding') { 31936 baseEncodingName = null; 31937 } 31938 } 31939 31940 if (baseEncodingName) { 31941 properties.defaultEncoding = (0, _encodings.getEncoding)(baseEncodingName).slice(); 31942 } else { 31943 var isSymbolicFont = !!(properties.flags & _fonts.FontFlags.Symbolic); 31944 var isNonsymbolicFont = !!(properties.flags & _fonts.FontFlags.Nonsymbolic); 31945 encoding = _encodings.StandardEncoding; 31946 31947 if (properties.type === 'TrueType' && !isNonsymbolicFont) { 31948 encoding = _encodings.WinAnsiEncoding; 31949 } 31950 31951 if (isSymbolicFont) { 31952 encoding = _encodings.MacRomanEncoding; 31953 31954 if (!properties.file) { 31955 if (/Symbol/i.test(properties.name)) { 31956 encoding = _encodings.SymbolSetEncoding; 31957 } else if (/Dingbats/i.test(properties.name)) { 31958 encoding = _encodings.ZapfDingbatsEncoding; 31959 } 31960 } 31961 } 31962 31963 properties.defaultEncoding = encoding; 31964 } 31965 31966 properties.differences = differences; 31967 properties.baseEncodingName = baseEncodingName; 31968 properties.hasEncoding = !!baseEncodingName || differences.length > 0;
31969 properties.dict = dict; 31970 return toUnicodePromise.then(function (toUnicode) { 31971 properties.toUnicode = toUnicode; 31972 return _this9.buildToUnicode(properties); 31973 }).then(function (toUnicode) { 31974 properties.toUnicode = toUnicode; 31975 return properties; 31976 }); 31977 }, 31978 _buildSimpleFontToUnicode: function _buildSimpleFontToUnicode(properties) { 31979 (0, _util.assert)(!properties.composite, 'Must be a simple font.'); 31980 var toUnicode = [], 31981 charcode, 31982 glyphName; 31983 var encoding = properties.defaultEncoding.slice(); 31984 var baseEncodingName = properties.baseEncodingName; 31985 var differences = properties.differences; 31986 31987 for (charcode in differences) { 31988 glyphName = differences[charcode]; 31989 31990 if (glyphName === '.notdef') { 31991 continue; 31992 } 31993 31994 encoding[charcode] = glyphName; 31995 } 31996 31997 var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 31998 31999 for (charcode in encoding) { 32000 glyphName = encoding[charcode]; 32001 32002 if (glyphName === '') { 32003 continue; 32004 } else if (glyphsUnicodeMap[glyphName] === undefined) { 32005 var code = 0; 32006 32007 switch (glyphName[0]) { 32008 case 'G': 32009 if (glyphName.length === 3) { 32010 code = parseInt(glyphName.substring(1), 16); 32011 } 32012 32013 break; 32014 32015 case 'g': 32016 if (glyphName.length === 5) { 32017 code = parseInt(glyphName.substring(1), 16); 32018 } 32019 32020 break; 32021 32022 case 'C': 32023 case 'c': 32024 if (glyphName.length >= 3) { 32025 code = +glyphName.substring(1); 32026 } 32027 32028 break; 32029 32030 default: 32031 var unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); 32032 32033 if (unicode !== -1) { 32034 code = unicode; 32035 } 32036 32037 } 32038 32039 if (code) { 32040 if (baseEncodingName && code === +charcode) { 32041 var baseEncoding = (0, _encodings.getEncoding)(baseEncodingName); 32042 32043 if (baseEncoding && (glyphName = baseEncoding[charcode])) { 32044 toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); 32045 continue; 32046 } 32047 } 32048 32049 toUnicode[charcode] = String.fromCodePoint(code); 32050 } 32051 32052 continue; 32053 } 32054 32055 toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); 32056 } 32057 32058 return new _fonts.ToUnicodeMap(toUnicode); 32059 }, 32060 buildToUnicode: function buildToUnicode(properties) { 32061 properties.hasIncludedToUnicodeMap = !!properties.toUnicode && properties.toUnicode.length > 0; 32062 32063 if (properties.hasIncludedToUnicodeMap) { 32064 if (!properties.composite && properties.hasEncoding) { 32065 properties.fallbackToUnicode = this._buildSimpleFontToUnicode(properties); 32066 } 32067 32068 return Promise.resolve(properties.toUnicode); 32069 } 32070 32071 if (!properties.composite) { 32072 return Promise.resolve(this._buildSimpleFontToUnicode(properties)); 32073 } 32074 32075 if (properties.composite && (properties.cMap.builtInCMap && !(properties.cMap instanceof _cmap.IdentityCMap) || properties.cidSystemInfo.registry === 'Adobe' && (properties.cidSystemInfo.ordering === 'GB1' || properties.cidSystemInfo.ordering === 'CNS1' || properties.cidSystemInfo.ordering === 'Japan1' || properties.cidSystemInfo.ordering === 'Korea1'))) { 32076 var registry = properties.cidSystemInfo.registry; 32077 var ordering = properties.cidSystemInfo.ordering; 32078 32079 var ucs2CMapName = _primitives.Name.get(registry + '-' + ordering + '-UCS2'); 32080 32081 return _cmap.CMapFactory.create({ 32082 encoding: ucs2CMapName, 32083 fetchBuiltInCMap: this.fetchBuiltInCMap, 32084 useCMap: null 32085 }).then(function (ucs2CMap) { 32086 var cMap = properties.cMap; 32087 var toUnicode = []; 32088 cMap.forEach(function (charcode, cid) { 32089 if (cid > 0xffff) { 32090 throw new _util.FormatError('Max size of CID is 65,535'); 32091 } 32092 32093 var ucs2 = ucs2CMap.lookup(cid); 32094 32095 if (ucs2) { 32096 toUnicode[charcode] = String.fromCharCode((ucs2.charCodeAt(0) << 8) + ucs2.charCodeAt(1)); 32097 } 32098 }); 32099 return new _fonts.ToUnicodeMap(toUnicode); 32100 }); 32101 } 32102 32103 return Promise.resolve(new _fonts.IdentityToUnicodeMap(properties.firstChar, properties.lastChar)); 32104 }, 32105 readToUnicode: function PartialEvaluator_readToUnicode(toUnicode) { 32106 var cmapObj = toUnicode; 32107 32108 if ((0, _primitives.isName)(cmapObj)) { 32109 return _cmap.CMapFactory.create({ 32110 encoding: cmapObj, 32111 fetchBuiltInCMap: this.fetchBuiltInCMap, 32112 useCMap: null 32113 }).then(function (cmap) { 32114 if (cmap instanceof _cmap.IdentityCMap) { 32115 return new _fonts.IdentityToUnicodeMap(0, 0xFFFF); 32116 } 32117 32118 return new _fonts.ToUnicodeMap(cmap.getMap()); 32119 }); 32120 } else if ((0, _primitives.isStream)(cmapObj)) { 32121 return _cmap.CMapFactory.create({ 32122 encoding: cmapObj, 32123 fetchBuiltInCMap: this.fetchBuiltInCMap, 32124 useCMap: null 32125 }).then(function (cmap) { 32126 if (cmap instanceof _cmap.IdentityCMap) { 32127 return new _fonts.IdentityToUnicodeMap(0, 0xFFFF); 32128 } 32129 32130 var map = new Array(cmap.length);
32131 cmap.forEach(function (charCode, token) { 32132 var str = []; 32133 32134 for (var k = 0; k < token.length; k += 2) { 32135 var w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); 32136 32137 if ((w1 & 0xF800) !== 0xD800) { 32138 str.push(w1); 32139 continue; 32140 } 32141 32142 k += 2; 32143 var w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); 32144 str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); 32145 } 32146 32147 map[charCode] = String.fromCodePoint.apply(String, str); 32148 }); 32149 return new _fonts.ToUnicodeMap(map); 32150 }); 32151 } 32152 32153 return Promise.resolve(null); 32154 }, 32155 readCidToGidMap: function PartialEvaluator_readCidToGidMap(cidToGidStream) { 32156 var glyphsData = cidToGidStream.getBytes(); 32157 var result = []; 32158 32159 for (var j = 0, jj = glyphsData.length; j < jj; j++) { 32160 var glyphID = glyphsData[j++] << 8 | glyphsData[j]; 32161 32162 if (glyphID === 0) { 32163 continue; 32164 } 32165 32166 var code = j >> 1; 32167 result[code] = glyphID; 32168 } 32169 32170 return result; 32171 }, 32172 extractWidths: function PartialEvaluator_extractWidths(dict, descriptor, properties) { 32173 var xref = this.xref; 32174 var glyphsWidths = []; 32175 var defaultWidth = 0; 32176 var glyphsVMetrics = []; 32177 var defaultVMetrics; 32178 var i, ii, j, jj, start, code, widths; 32179 32180 if (properties.composite) { 32181 defaultWidth = dict.has('DW') ? dict.get('DW') : 1000; 32182 widths = dict.get('W'); 32183 32184 if (widths) { 32185 for (i = 0, ii = widths.length; i < ii; i++) { 32186 start = xref.fetchIfRef(widths[i++]); 32187 code = xref.fetchIfRef(widths[i]); 32188 32189 if (Array.isArray(code)) { 32190 for (j = 0, jj = code.length; j < jj; j++) { 32191 glyphsWidths[start++] = xref.fetchIfRef(code[j]); 32192 } 32193 } else { 32194 var width = xref.fetchIfRef(widths[++i]); 32195 32196 for (j = start; j <= code; j++) { 32197 glyphsWidths[j] = width; 32198 } 32199 } 32200 } 32201 } 32202 32203 if (properties.vertical) { 32204 var vmetrics = dict.getArray('DW2') || [880, -1000]; 32205 defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; 32206 vmetrics = dict.get('W2'); 32207 32208 if (vmetrics) { 32209 for (i = 0, ii = vmetrics.length; i < ii; i++) { 32210 start = xref.fetchIfRef(vmetrics[i++]); 32211 code = xref.fetchIfRef(vmetrics[i]); 32212 32213 if (Array.isArray(code)) { 32214 for (j = 0, jj = code.length; j < jj; j++) { 32215 glyphsVMetrics[start++] = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])]; 32216 } 32217 } else { 32218 var vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])]; 32219 32220 for (j = start; j <= code; j++) { 32221 glyphsVMetrics[j] = vmetric; 32222 } 32223 } 32224 } 32225 } 32226 } 32227 } else { 32228 var firstChar = properties.firstChar; 32229 widths = dict.get('Widths'); 32230 32231 if (widths) { 32232 j = firstChar; 32233 32234 for (i = 0, ii = widths.length; i < ii; i++) { 32235 glyphsWidths[j++] = xref.fetchIfRef(widths[i]); 32236 } 32237 32238 defaultWidth = parseFloat(descriptor.get('MissingWidth')) || 0; 32239 } else { 32240 var baseFontName = dict.get('BaseFont'); 32241 32242 if ((0, _primitives.isName)(baseFontName)) { 32243 var metrics = this.getBaseFontMetrics(baseFontName.name); 32244 glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties); 32245 defaultWidth = metrics.defaultWidth; 32246 } 32247 } 32248 } 32249 32250 var isMonospace = true; 32251 var firstWidth = defaultWidth; 32252 32253 for (var glyph in glyphsWidths) { 32254 var glyphWidth = glyphsWidths[glyph]; 32255 32256 if (!glyphWidth) { 32257 continue; 32258 } 32259 32260 if (!firstWidth) { 32261 firstWidth = glyphWidth; 32262 continue; 32263 } 32264 32265 if (firstWidth !== glyphWidth) { 32266 isMonospace = false; 32267 break; 32268 } 32269 } 32270 32271 if (isMonospace) { 32272 properties.flags |= _fonts.FontFlags.FixedPitch; 32273 } 32274 32275 properties.defaultWidth = defaultWidth; 32276 properties.widths = glyphsWidths; 32277 properties.defaultVMetrics = defaultVMetrics; 32278 properties.vmetrics = glyphsVMetrics; 32279 }, 32280 isSerifFont: function PartialEvaluator_isSerifFont(baseFontName) { 32281 var fontNameWoStyle = baseFontName.split('-')[0]; 32282 return fontNameWoStyle in (0, _standard_fonts.getSerifFonts)() || fontNameWoStyle.search(/serif/gi) !== -1; 32283 }, 32284 getBaseFontMetrics: function PartialEvaluator_getBaseFontMetrics(name) { 32285 var defaultWidth = 0; 32286 var widths = []; 32287 var monospace = false; 32288 var stdFontMap = (0, _standard_fonts.getStdFontMap)(); 32289 var lookupName = stdFontMap[name] || name; 32290 var Metrics = (0, _metrics.getMetrics)();
32291 32292 if (!(lookupName in Metrics)) { 32293 if (this.isSerifFont(name)) { 32294 lookupName = 'Times-Roman'; 32295 } else { 32296 lookupName = 'Helvetica'; 32297 } 32298 } 32299 32300 var glyphWidths = Metrics[lookupName]; 32301 32302 if ((0, _util.isNum)(glyphWidths)) { 32303 defaultWidth = glyphWidths; 32304 monospace = true; 32305 } else { 32306 widths = glyphWidths(); 32307 } 32308 32309 return { 32310 defaultWidth: defaultWidth, 32311 monospace: monospace, 32312 widths: widths 32313 }; 32314 }, 32315 buildCharCodeToWidth: function PartialEvaluator_bulildCharCodeToWidth(widthsByGlyphName, properties) { 32316 var widths = Object.create(null); 32317 var differences = properties.differences; 32318 var encoding = properties.defaultEncoding; 32319 32320 for (var charCode = 0; charCode < 256; charCode++) { 32321 if (charCode in differences && widthsByGlyphName[differences[charCode]]) { 32322 widths[charCode] = widthsByGlyphName[differences[charCode]]; 32323 continue; 32324 } 32325 32326 if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { 32327 widths[charCode] = widthsByGlyphName[encoding[charCode]]; 32328 continue; 32329 } 32330 } 32331 32332 return widths; 32333 }, 32334 preEvaluateFont: function PartialEvaluator_preEvaluateFont(dict) { 32335 var baseDict = dict; 32336 var type = dict.get('Subtype'); 32337 32338 if (!(0, _primitives.isName)(type)) { 32339 throw new _util.FormatError('invalid font Subtype'); 32340 } 32341 32342 var composite = false; 32343 var uint8array; 32344 32345 if (type.name === 'Type0') { 32346 var df = dict.get('DescendantFonts'); 32347 32348 if (!df) { 32349 throw new _util.FormatError('Descendant fonts are not specified'); 32350 } 32351 32352 dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df; 32353 type = dict.get('Subtype'); 32354 32355 if (!(0, _primitives.isName)(type)) { 32356 throw new _util.FormatError('invalid font Subtype'); 32357 } 32358 32359 composite = true; 32360 } 32361 32362 var descriptor = dict.get('FontDescriptor'); 32363 32364 if (descriptor) { 32365 var hash = new _murmurhash.MurmurHash3_64(); 32366 var encoding = baseDict.getRaw('Encoding'); 32367 32368 if ((0, _primitives.isName)(encoding)) { 32369 hash.update(encoding.name); 32370 } else if ((0, _primitives.isRef)(encoding)) { 32371 hash.update(encoding.toString()); 32372 } else if ((0, _primitives.isDict)(encoding)) { 32373 var keys = encoding.getKeys(); 32374 32375 for (var i = 0, ii = keys.length; i < ii; i++) { 32376 var entry = encoding.getRaw(keys[i]); 32377 32378 if ((0, _primitives.isName)(entry)) { 32379 hash.update(entry.name); 32380 } else if ((0, _primitives.isRef)(entry)) { 32381 hash.update(entry.toString()); 32382 } else if (Array.isArray(entry)) { 32383 var diffLength = entry.length, 32384 diffBuf = new Array(diffLength); 32385 32386 for (var j = 0; j < diffLength; j++) { 32387 var diffEntry = entry[j]; 32388 32389 if ((0, _primitives.isName)(diffEntry)) { 32390 diffBuf[j] = diffEntry.name; 32391 } else if ((0, _util.isNum)(diffEntry) || (0, _primitives.isRef)(diffEntry)) { 32392 diffBuf[j] = diffEntry.toString(); 32393 } 32394 } 32395 32396 hash.update(diffBuf.join()); 32397 } 32398 } 32399 } 32400 32401 var toUnicode = dict.get('ToUnicode') || baseDict.get('ToUnicode'); 32402 32403 if ((0, _primitives.isStream)(toUnicode)) { 32404 var stream = toUnicode.str || toUnicode; 32405 uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start); 32406 hash.update(uint8array); 32407 } else if ((0, _primitives.isName)(toUnicode)) { 32408 hash.update(toUnicode.name); 32409 } 32410 32411 var widths = dict.get('Widths') || baseDict.get('Widths'); 32412 32413 if (widths) { 32414 uint8array = new Uint8Array(new Uint32Array(widths).buffer); 32415 hash.update(uint8array); 32416 } 32417 } 32418 32419 return { 32420 descriptor: descriptor, 32421 dict: dict, 32422 baseDict: baseDict, 32423 composite: composite,
32424 type: type.name, 32425 hash: hash ? hash.hexdigest() : '' 32426 }; 32427 }, 32428 translateFont: function PartialEvaluator_translateFont(preEvaluatedFont) { 32429 var _this10 = this; 32430 32431 var baseDict = preEvaluatedFont.baseDict; 32432 var dict = preEvaluatedFont.dict; 32433 var composite = preEvaluatedFont.composite; 32434 var descriptor = preEvaluatedFont.descriptor; 32435 var type = preEvaluatedFont.type; 32436 var maxCharIndex = composite ? 0xFFFF : 0xFF; 32437 var properties; 32438 32439 if (!descriptor) { 32440 if (type === 'Type3') { 32441 descriptor = new _primitives.Dict(null); 32442 descriptor.set('FontName', _primitives.Name.get(type)); 32443 descriptor.set('FontBBox', dict.getArray('FontBBox')); 32444 } else { 32445 var baseFontName = dict.get('BaseFont'); 32446 32447 if (!(0, _primitives.isName)(baseFontName)) { 32448 throw new _util.FormatError('Base font is not specified'); 32449 } 32450 32451 baseFontName = baseFontName.name.replace(/[,_]/g, '-'); 32452 var metrics = this.getBaseFontMetrics(baseFontName); 32453 var fontNameWoStyle = baseFontName.split('-')[0]; 32454 var flags = (this.isSerifFont(fontNameWoStyle) ? _fonts.FontFlags.Serif : 0) | (metrics.monospace ? _fonts.FontFlags.FixedPitch : 0) | ((0, _standard_fonts.getSymbolsFonts)()[fontNameWoStyle] ? _fonts.FontFlags.Symbolic : _fonts.FontFlags.Nonsymbolic); 32455 properties = { 32456 type: type, 32457 name: baseFontName, 32458 widths: metrics.widths, 32459 defaultWidth: metrics.defaultWidth, 32460 flags: flags, 32461 firstChar: 0, 32462 lastChar: maxCharIndex 32463 }; 32464 return this.extractDataStructures(dict, dict, properties).then(function (properties) { 32465 properties.widths = _this10.buildCharCodeToWidth(metrics.widths, properties); 32466 return new _fonts.Font(baseFontName, null, properties); 32467 }); 32468 } 32469 } 32470 32471 var firstChar = dict.get('FirstChar') || 0; 32472 var lastChar = dict.get('LastChar') || maxCharIndex; 32473 var fontName = descriptor.get('FontName'); 32474 var baseFont = dict.get('BaseFont'); 32475 32476 if ((0, _util.isString)(fontName)) { 32477 fontName = _primitives.Name.get(fontName); 32478 } 32479 32480 if ((0, _util.isString)(baseFont)) { 32481 baseFont = _primitives.Name.get(baseFont); 32482 } 32483 32484 if (type !== 'Type3') { 32485 var fontNameStr = fontName && fontName.name; 32486 var baseFontStr = baseFont && baseFont.name; 32487 32488 if (fontNameStr !== baseFontStr) { 32489 (0, _util.info)("The FontDescriptor's FontName is \"".concat(fontNameStr, "\" but ") + "should be the same as the Font's BaseFont \"".concat(baseFontStr, "\".")); 32490 32491 if (fontNameStr && baseFontStr && baseFontStr.startsWith(fontNameStr)) { 32492 fontName = baseFont; 32493 } 32494 } 32495 } 32496 32497 fontName = fontName || baseFont; 32498 32499 if (!(0, _primitives.isName)(fontName)) { 32500 throw new _util.FormatError('invalid font name'); 32501 } 32502 32503 var fontFile = descriptor.get('FontFile', 'FontFile2', 'FontFile3'); 32504 32505 if (fontFile) { 32506 if (fontFile.dict) { 32507 var subtype = fontFile.dict.get('Subtype'); 32508 32509 if (subtype) { 32510 subtype = subtype.name; 32511 } 32512 32513 var length1 = fontFile.dict.get('Length1'); 32514 var length2 = fontFile.dict.get('Length2'); 32515 var length3 = fontFile.dict.get('Length3'); 32516 } 32517 } 32518 32519 properties = { 32520 type: type, 32521 name: fontName.name, 32522 subtype: subtype, 32523 file: fontFile, 32524 length1: length1, 32525 length2: length2, 32526 length3: length3, 32527 loadedName: baseDict.loadedName, 32528 composite: composite, 32529 wideChars: composite, 32530 fixedPitch: false, 32531 fontMatrix: dict.getArray('FontMatrix') || _util.FONT_IDENTITY_MATRIX, 32532 firstChar: firstChar || 0, 32533 lastChar: lastChar || maxCharIndex, 32534 bbox: descriptor.getArray('FontBBox'), 32535 ascent: descriptor.get('Ascent'), 32536 descent: descriptor.get('Descent'), 32537 xHeight: descriptor.get('XHeight'), 32538 capHeight: descriptor.get('CapHeight'), 32539 flags: descriptor.get('Flags'), 32540 italicAngle: descriptor.get('ItalicAngle'), 32541 isType3Font: false 32542 }; 32543 var cMapPromise; 32544 32545 if (composite) { 32546 var cidEncoding = baseDict.get('Encoding'); 32547 32548 if ((0, _primitives.isName)(cidEncoding)) { 32549 properties.cidEncoding = cidEncoding.name; 32550 } 32551 32552 cMapPromise = _cmap.CMapFactory.create({ 32553 encoding: cidEncoding, 32554 fetchBuiltInCMap: this.fetchBuiltInCMap, 32555 useCMap: null 32556 }).then(function (cMap) { 32557 properties.cMap = cMap; 32558 properties.vertical = properties.cMap.vertical; 32559 }); 32560 } else { 32561 cMapPromise = Promise.resolve(undefined); 32562 } 32563 32564 return cMapPromise.then(function () { 32565 return _this10.extractDataStructures(dict, baseDict, properties); 32566 }).then(function (properties) { 32567 _this10.extractWidths(dict, descriptor, properties); 32568 32569 if (type === 'Type3') { 32570 properties.isType3Font = true; 32571 } 32572 32573 return new _fonts.Font(fontName.name, fontFile, properties); 32574 }); 32575 } 32576 }; 32577 32578 PartialEvaluator.buildFontPaths = function (font, glyphs, handler) { 32579 function buildPath(fontChar) { 32580 if (font.renderer.hasBuiltPath(fontChar)) { 32581 return; 32582 } 32583 32584 handler.send('commonobj', ["".concat(font.loadedName, "_path_").concat(fontChar), 'FontPath', font.renderer.getPathJs(fontChar)]); 32585 } 32586 32587 var _iteratorNormalCompletion = true; 32588 var _didIteratorError = false; 32589 var _iteratorError = undefined; 32590 32591 try { 32592 for (var _iterator = glyphs[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { 32593 var glyph = _step.value; 32594 buildPath(glyph.fontChar); 32595 var accent = glyph.accent; 32596 32597 if (accent && accent.fontChar) { 32598 buildPath(accent.fontChar); 32599 } 32600 } 32601 } catch (err) {
32602 _didIteratorError = true; 32603 _iteratorError = err; 32604 } finally { 32605 try { 32606 if (!_iteratorNormalCompletion && _iterator.return != null) { 32607 _iterator.return(); 32608 } 32609 } finally { 32610 if (_didIteratorError) { 32611 throw _iteratorError; 32612 } 32613 } 32614 } 32615 }; 32616 32617 return PartialEvaluator; 32618}(); 32619 32620exports.PartialEvaluator = PartialEvaluator; 32621 32622var TranslatedFont = function TranslatedFontClosure() { 32623 function TranslatedFont(loadedName, font, dict) { 32624 this.loadedName = loadedName; 32625 this.font = font; 32626 this.dict = dict; 32627 this.type3Loaded = null; 32628 this.sent = false; 32629 } 32630 32631 TranslatedFont.prototype = { 32632 send: function send(handler) { 32633 if (this.sent) { 32634 return; 32635 } 32636 32637 this.sent = true; 32638 handler.send('commonobj', [this.loadedName, 'Font', this.font.exportData()]); 32639 }, 32640 fallback: function fallback(handler) { 32641 if (!this.font.data) { 32642 return; 32643 } 32644 32645 this.font.disableFontFace = true; 32646 var glyphs = this.font.glyphCacheValues; 32647 PartialEvaluator.buildFontPaths(this.font, glyphs, handler); 32648 }, 32649 loadType3Data: function loadType3Data(evaluator, resources, parentOperatorList, task) { 32650 if (!this.font.isType3Font) { 32651 throw new Error('Must be a Type3 font.'); 32652 } 32653 32654 if (this.type3Loaded) { 32655 return this.type3Loaded; 32656 } 32657 32658 var type3Options = Object.create(evaluator.options); 32659 type3Options.ignoreErrors = false; 32660 var type3Evaluator = evaluator.clone(type3Options); 32661 var translatedFont = this.font; 32662 var loadCharProcsPromise = Promise.resolve(); 32663 var charProcs = this.dict.get('CharProcs'); 32664 var fontResources = this.dict.get('Resources') || resources; 32665 var charProcKeys = charProcs.getKeys(); 32666 var charProcOperatorList = Object.create(null); 32667 32668 var _loop2 = function _loop2() { 32669 var key = charProcKeys[i]; 32670 loadCharProcsPromise = loadCharProcsPromise.then(function () { 32671 var glyphStream = charProcs.get(key); 32672 var operatorList = new _operator_list.OperatorList(); 32673 return type3Evaluator.getOperatorList({ 32674 stream: glyphStream, 32675 task: task, 32676 resources: fontResources, 32677 operatorList: operatorList 32678 }).then(function () { 32679 charProcOperatorList[key] = operatorList.getIR(); 32680 parentOperatorList.addDependencies(operatorList.dependencies); 32681 }).catch(function (reason) { 32682 (0, _util.warn)("Type3 font resource \"".concat(key, "\" is not available.")); 32683 var operatorList = new _operator_list.OperatorList(); 32684 charProcOperatorList[key] = operatorList.getIR(); 32685 }); 32686 }); 32687 }; 32688 32689 for (var i = 0, n = charProcKeys.length; i < n; ++i) { 32690 _loop2(); 32691 } 32692 32693 this.type3Loaded = loadCharProcsPromise.then(function () { 32694 translatedFont.charProcOperatorList = charProcOperatorList; 32695 }); 32696 return this.type3Loaded; 32697 } 32698 }; 32699 return TranslatedFont; 32700}(); 32701 32702var StateManager = function StateManagerClosure() { 32703 function StateManager(initialState) { 32704 this.state = initialState; 32705 this.stateStack = []; 32706 } 32707 32708 StateManager.prototype = { 32709 save: function save() { 32710 var old = this.state; 32711 this.stateStack.push(this.state); 32712 this.state = old.clone(); 32713 }, 32714 restore: function restore() { 32715 var prev = this.stateStack.pop(); 32716 32717 if (prev) { 32718 this.state = prev; 32719 } 32720 }, 32721 transform: function transform(args) { 32722 this.state.ctm = _util.Util.transform(this.state.ctm, args); 32723 } 32724 }; 32725 return StateManager; 32726}(); 32727 32728var TextState = function TextStateClosure() { 32729 function TextState() { 32730 this.ctm = new Float32Array(_util.IDENTITY_MATRIX); 32731 this.fontName = null; 32732 this.fontSize = 0; 32733 this.font = null; 32734 this.fontMatrix = _util.FONT_IDENTITY_MATRIX; 32735 this.textMatrix = _util.IDENTITY_MATRIX.slice();
32736 this.textLineMatrix = _util.IDENTITY_MATRIX.slice(); 32737 this.charSpacing = 0; 32738 this.wordSpacing = 0; 32739 this.leading = 0; 32740 this.textHScale = 1; 32741 this.textRise = 0; 32742 } 32743 32744 TextState.prototype = { 32745 setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { 32746 var m = this.textMatrix; 32747 m[0] = a; 32748 m[1] = b; 32749 m[2] = c; 32750 m[3] = d; 32751 m[4] = e; 32752 m[5] = f; 32753 }, 32754 setTextLineMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { 32755 var m = this.textLineMatrix; 32756 m[0] = a; 32757 m[1] = b; 32758 m[2] = c; 32759 m[3] = d; 32760 m[4] = e; 32761 m[5] = f; 32762 }, 32763 translateTextMatrix: function TextState_translateTextMatrix(x, y) { 32764 var m = this.textMatrix; 32765 m[4] = m[0] * x + m[2] * y + m[4]; 32766 m[5] = m[1] * x + m[3] * y + m[5]; 32767 }, 32768 translateTextLineMatrix: function TextState_translateTextMatrix(x, y) { 32769 var m = this.textLineMatrix; 32770 m[4] = m[0] * x + m[2] * y + m[4]; 32771 m[5] = m[1] * x + m[3] * y + m[5]; 32772 },
32773 calcTextLineMatrixAdvance: function TextState_calcTextLineMatrixAdvance(a, b, c, d, e, f) { 32774 var font = this.font; 32775 32776 if (!font) { 32777 return null; 32778 } 32779 32780 var m = this.textLineMatrix; 32781 32782 if (!(a === m[0] && b === m[1] && c === m[2] && d === m[3])) { 32783 return null; 32784 } 32785 32786 var txDiff = e - m[4], 32787 tyDiff = f - m[5]; 32788 32789 if (font.vertical && txDiff !== 0 || !font.vertical && tyDiff !== 0) { 32790 return null; 32791 } 32792 32793 var tx, 32794 ty, 32795 denominator = a * d - b * c; 32796 32797 if (font.vertical) { 32798 tx = -tyDiff * c / denominator; 32799 ty = tyDiff * a / denominator; 32800 } else { 32801 tx = txDiff * d / denominator; 32802 ty = -txDiff * b / denominator; 32803 } 32804 32805 return { 32806 width: tx, 32807 height: ty, 32808 value: font.vertical ? ty : tx 32809 }; 32810 }, 32811 calcRenderMatrix: function TextState_calcRendeMatrix(ctm) { 32812 var tsm = [this.fontSize * this.textHScale, 0, 0, this.fontSize, 0, this.textRise]; 32813 return _util.Util.transform(ctm, _util.Util.transform(this.textMatrix, tsm)); 32814 }, 32815 carriageReturn: function TextState_carriageReturn() { 32816 this.translateTextLineMatrix(0, -this.leading);
vendor: 6,219 bytes, lines 32817-33098
32817 this.textMatrix = this.textLineMatrix.slice(); 32818 }, 32819 clone: function TextState_clone() { 32820 var clone = Object.create(this); 32821 clone.textMatrix = this.textMatrix.slice(); 32822 clone.textLineMatrix = this.textLineMatrix.slice(); 32823 clone.fontMatrix = this.fontMatrix.slice(); 32824 return clone; 32825 } 32826 }; 32827 return TextState; 32828}(); 32829 32830var EvalState = function EvalStateClosure() { 32831 function EvalState() { 32832 this.ctm = new Float32Array(_util.IDENTITY_MATRIX); 32833 this.font = null; 32834 this.textRenderingMode = _util.TextRenderingMode.FILL; 32835 this.fillColorSpace = _colorspace.ColorSpace.singletons.gray; 32836 this.strokeColorSpace = _colorspace.ColorSpace.singletons.gray; 32837 } 32838 32839 EvalState.prototype = { 32840 clone: function CanvasExtraState_clone() { 32841 return Object.create(this); 32842 } 32843 }; 32844 return EvalState; 32845}(); 32846 32847var EvaluatorPreprocessor = function EvaluatorPreprocessorClosure() { 32848 var getOPMap = (0, _util.getLookupTableFactory)(function (t) { 32849 t['w'] = { 32850 id: _util.OPS.setLineWidth, 32851 numArgs: 1, 32852 variableArgs: false 32853 }; 32854 t['J'] = { 32855 id: _util.OPS.setLineCap, 32856 numArgs: 1, 32857 variableArgs: false 32858 }; 32859 t['j'] = { 32860 id: _util.OPS.setLineJoin, 32861 numArgs: 1, 32862 variableArgs: false 32863 }; 32864 t['M'] = { 32865 id: _util.OPS.setMiterLimit, 32866 numArgs: 1, 32867 variableArgs: false 32868 }; 32869 t['d'] = { 32870 id: _util.OPS.setDash, 32871 numArgs: 2, 32872 variableArgs: false 32873 }; 32874 t['ri'] = { 32875 id: _util.OPS.setRenderingIntent, 32876 numArgs: 1, 32877 variableArgs: false 32878 }; 32879 t['i'] = { 32880 id: _util.OPS.setFlatness, 32881 numArgs: 1, 32882 variableArgs: false 32883 }; 32884 t['gs'] = { 32885 id: _util.OPS.setGState, 32886 numArgs: 1, 32887 variableArgs: false 32888 }; 32889 t['q'] = { 32890 id: _util.OPS.save, 32891 numArgs: 0, 32892 variableArgs: false 32893 }; 32894 t['Q'] = { 32895 id: _util.OPS.restore, 32896 numArgs: 0, 32897 variableArgs: false 32898 }; 32899 t['cm'] = { 32900 id: _util.OPS.transform, 32901 numArgs: 6, 32902 variableArgs: false 32903 }; 32904 t['m'] = { 32905 id: _util.OPS.moveTo, 32906 numArgs: 2, 32907 variableArgs: false 32908 }; 32909 t['l'] = { 32910 id: _util.OPS.lineTo, 32911 numArgs: 2, 32912 variableArgs: false 32913 }; 32914 t['c'] = { 32915 id: _util.OPS.curveTo, 32916 numArgs: 6, 32917 variableArgs: false 32918 }; 32919 t['v'] = { 32920 id: _util.OPS.curveTo2, 32921 numArgs: 4, 32922 variableArgs: false 32923 }; 32924 t['y'] = { 32925 id: _util.OPS.curveTo3, 32926 numArgs: 4, 32927 variableArgs: false 32928 }; 32929 t['h'] = { 32930 id: _util.OPS.closePath, 32931 numArgs: 0, 32932 variableArgs: false 32933 }; 32934 t['re'] = { 32935 id: _util.OPS.rectangle, 32936 numArgs: 4, 32937 variableArgs: false 32938 }; 32939 t['S'] = { 32940 id: _util.OPS.stroke, 32941 numArgs: 0, 32942 variableArgs: false 32943 }; 32944 t['s'] = { 32945 id: _util.OPS.closeStroke, 32946 numArgs: 0, 32947 variableArgs: false 32948 }; 32949 t['f'] = { 32950 id: _util.OPS.fill, 32951 numArgs: 0, 32952 variableArgs: false 32953 }; 32954 t['F'] = { 32955 id: _util.OPS.fill, 32956 numArgs: 0, 32957 variableArgs: false 32958 }; 32959 t['f*'] = { 32960 id: _util.OPS.eoFill, 32961 numArgs: 0, 32962 variableArgs: false 32963 }; 32964 t['B'] = { 32965 id: _util.OPS.fillStroke, 32966 numArgs: 0, 32967 variableArgs: false 32968 }; 32969 t['B*'] = { 32970 id: _util.OPS.eoFillStroke, 32971 numArgs: 0, 32972 variableArgs: false 32973 }; 32974 t['b'] = { 32975 id: _util.OPS.closeFillStroke, 32976 numArgs: 0, 32977 variableArgs: false 32978 }; 32979 t['b*'] = { 32980 id: _util.OPS.closeEOFillStroke, 32981 numArgs: 0, 32982 variableArgs: false 32983 }; 32984 t['n'] = { 32985 id: _util.OPS.endPath, 32986 numArgs: 0, 32987 variableArgs: false 32988 }; 32989 t['W'] = { 32990 id: _util.OPS.clip, 32991 numArgs: 0, 32992 variableArgs: false 32993 }; 32994 t['W*'] = { 32995 id: _util.OPS.eoClip, 32996 numArgs: 0, 32997 variableArgs: false 32998 }; 32999 t['BT'] = { 33000 id: _util.OPS.beginText, 33001 numArgs: 0, 33002 variableArgs: false 33003 }; 33004 t['ET'] = { 33005 id: _util.OPS.endText, 33006 numArgs: 0, 33007 variableArgs: false 33008 }; 33009 t['Tc'] = { 33010 id: _util.OPS.setCharSpacing, 33011 numArgs: 1, 33012 variableArgs: false 33013 }; 33014 t['Tw'] = { 33015 id: _util.OPS.setWordSpacing, 33016 numArgs: 1, 33017 variableArgs: false 33018 }; 33019 t['Tz'] = { 33020 id: _util.OPS.setHScale, 33021 numArgs: 1, 33022 variableArgs: false 33023 }; 33024 t['TL'] = { 33025 id: _util.OPS.setLeading, 33026 numArgs: 1, 33027 variableArgs: false 33028 }; 33029 t['Tf'] = { 33030 id: _util.OPS.setFont, 33031 numArgs: 2, 33032 variableArgs: false 33033 }; 33034 t['Tr'] = { 33035 id: _util.OPS.setTextRenderingMode, 33036 numArgs: 1, 33037 variableArgs: false 33038 }; 33039 t['Ts'] = { 33040 id: _util.OPS.setTextRise, 33041 numArgs: 1, 33042 variableArgs: false 33043 }; 33044 t['Td'] = { 33045 id: _util.OPS.moveText, 33046 numArgs: 2, 33047 variableArgs: false 33048 }; 33049 t['TD'] = { 33050 id: _util.OPS.setLeadingMoveText, 33051 numArgs: 2, 33052 variableArgs: false 33053 }; 33054 t['Tm'] = { 33055 id: _util.OPS.setTextMatrix, 33056 numArgs: 6, 33057 variableArgs: false 33058 }; 33059 t['T*'] = { 33060 id: _util.OPS.nextLine, 33061 numArgs: 0, 33062 variableArgs: false 33063 }; 33064 t['Tj'] = { 33065 id: _util.OPS.showText, 33066 numArgs: 1, 33067 variableArgs: false 33068 }; 33069 t['TJ'] = { 33070 id: _util.OPS.showSpacedText, 33071 numArgs: 1, 33072 variableArgs: false 33073 }; 33074 t['\''] = { 33075 id: _util.OPS.nextLineShowText, 33076 numArgs: 1, 33077 variableArgs: false 33078 }; 33079 t['"'] = { 33080 id: _util.OPS.nextLineSetSpacingShowText, 33081 numArgs: 3, 33082 variableArgs: false 33083 }; 33084 t['d0'] = { 33085 id: _util.OPS.setCharWidth, 33086 numArgs: 2, 33087 variableArgs: false 33088 }; 33089 t['d1'] = { 33090 id: _util.OPS.setCharWidthAndBounds, 33091 numArgs: 6, 33092 variableArgs: false 33093 }; 33094 t['CS'] = { 33095 id: _util.OPS.setStrokeColorSpace, 33096 numArgs: 1, 33097 variableArgs: false 33098 };
33099 t['cs'] = { 33100 id: _util.OPS.setFillColorSpace, 33101 numArgs: 1, 33102 variableArgs: false 33103 }; 33104 t['SC'] = { 33105 id: _util.OPS.setStrokeColor, 33106 numArgs: 4, 33107 variableArgs: true 33108 }; 33109 t['SCN'] = { 33110 id: _util.OPS.setStrokeColorN, 33111 numArgs: 33, 33112 variableArgs: true 33113 }; 33114 t['sc'] = { 33115 id: _util.OPS.setFillColor, 33116 numArgs: 4, 33117 variableArgs: true 33118 }; 33119 t['scn'] = { 33120 id: _util.OPS.setFillColorN, 33121 numArgs: 33, 33122 variableArgs: true 33123 }; 33124 t['G'] = { 33125 id: _util.OPS.setStrokeGray, 33126 numArgs: 1, 33127 variableArgs: false 33128 }; 33129 t['g'] = { 33130 id: _util.OPS.setFillGray, 33131 numArgs: 1, 33132 variableArgs: false 33133 }; 33134 t['RG'] = { 33135 id: _util.OPS.setStrokeRGBColor, 33136 numArgs: 3, 33137 variableArgs: false 33138 }; 33139 t['rg'] = { 33140 id: _util.OPS.setFillRGBColor, 33141 numArgs: 3, 33142 variableArgs: false 33143 }; 33144 t['K'] = { 33145 id: _util.OPS.setStrokeCMYKColor, 33146 numArgs: 4, 33147 variableArgs: false 33148 }; 33149 t['k'] = { 33150 id: _util.OPS.setFillCMYKColor, 33151 numArgs: 4, 33152 variableArgs: false 33153 }; 33154 t['sh'] = { 33155 id: _util.OPS.shadingFill, 33156 numArgs: 1, 33157 variableArgs: false 33158 }; 33159 t['BI'] = { 33160 id: _util.OPS.beginInlineImage, 33161 numArgs: 0, 33162 variableArgs: false 33163 }; 33164 t['ID'] = { 33165 id: _util.OPS.beginImageData, 33166 numArgs: 0, 33167 variableArgs: false 33168 }; 33169 t['EI'] = { 33170 id: _util.OPS.endInlineImage, 33171 numArgs: 1, 33172 variableArgs: false 33173 }; 33174 t['Do'] = { 33175 id: _util.OPS.paintXObject, 33176 numArgs: 1, 33177 variableArgs: false 33178 }; 33179 t['MP'] = { 33180 id: _util.OPS.markPoint, 33181 numArgs: 1, 33182 variableArgs: false 33183 }; 33184 t['DP'] = { 33185 id: _util.OPS.markPointProps, 33186 numArgs: 2, 33187 variableArgs: false 33188 }; 33189 t['BMC'] = { 33190 id: _util.OPS.beginMarkedContent, 33191 numArgs: 1, 33192 variableArgs: false 33193 }; 33194 t['BDC'] = { 33195 id: _util.OPS.beginMarkedContentProps, 33196 numArgs: 2, 33197 variableArgs: false 33198 }; 33199 t['EMC'] = { 33200 id: _util.OPS.endMarkedContent, 33201 numArgs: 0, 33202 variableArgs: false 33203 }; 33204 t['BX'] = { 33205 id: _util.OPS.beginCompat, 33206 numArgs: 0, 33207 variableArgs: false 33208 }; 33209 t['EX'] = { 33210 id: _util.OPS.endCompat, 33211 numArgs: 0, 33212 variableArgs: false 33213 }; 33214 t['BM'] = null; 33215 t['BD'] = null; 33216 t['true'] = null; 33217 t['fa'] = null; 33218 t['fal'] = null; 33219 t['fals'] = null; 33220 t['false'] = null; 33221 t['nu'] = null; 33222 t['nul'] = null; 33223 t['null'] = null; 33224 }); 33225 var MAX_INVALID_PATH_OPS = 20; 33226 33227 function EvaluatorPreprocessor(stream, xref, stateManager) { 33228 this.opMap = getOPMap(); 33229 this.parser = new _parser.Parser(new _parser.Lexer(stream, this.opMap), false, xref); 33230 this.stateManager = stateManager; 33231 this.nonProcessedArgs = []; 33232 this._numInvalidPathOPS = 0; 33233 } 33234 33235 EvaluatorPreprocessor.prototype = { 33236 get savedStatesDepth() { 33237 return this.stateManager.stateStack.length; 33238 }, 33239 33240 read: function EvaluatorPreprocessor_read(operation) { 33241 var args = operation.args; 33242 33243 while (true) { 33244 var obj = this.parser.getObj(); 33245 33246 if ((0, _primitives.isCmd)(obj)) { 33247 var cmd = obj.cmd; 33248 var opSpec = this.opMap[cmd]; 33249 33250 if (!opSpec) { 33251 (0, _util.warn)("Unknown command \"".concat(cmd, "\".")); 33252 continue; 33253 } 33254 33255 var fn = opSpec.id; 33256 var numArgs = opSpec.numArgs; 33257 var argsLength = args !== null ? args.length : 0; 33258 33259 if (!opSpec.variableArgs) { 33260 if (argsLength !== numArgs) { 33261 var nonProcessedArgs = this.nonProcessedArgs; 33262 33263 while (argsLength > numArgs) { 33264 nonProcessedArgs.push(args.shift()); 33265 argsLength--; 33266 } 33267 33268 while (argsLength < numArgs && nonProcessedArgs.length !== 0) { 33269 if (args === null) { 33270 args = []; 33271 } 33272 33273 args.unshift(nonProcessedArgs.pop()); 33274 argsLength++; 33275 } 33276 } 33277 33278 if (argsLength < numArgs) { 33279 var partialMsg = "command ".concat(cmd, ": expected ").concat(numArgs, " args, ") + "but received ".concat(argsLength, " args."); 33280 33281 if (fn >= _util.OPS.moveTo && fn <= _util.OPS.endPath && ++this._numInvalidPathOPS >
33281 MAX_INVALID_PATH_OPS) { 33282 throw new _util.FormatError("Invalid ".concat(partialMsg)); 33283 } 33284 33285 (0, _util.warn)("Skipping ".concat(partialMsg)); 33286 33287 if (args !== null) { 33288 args.length = 0; 33289 } 33290 33291 continue; 33292 } 33293 } else if (argsLength > numArgs) { 33294 (0, _util.info)("Command ".concat(cmd, ": expected [0, ").concat(numArgs, "] args, ") + "but received ".concat(argsLength, " args.")); 33295 } 33296 33297 this.preprocessCommand(fn, args); 33298 operation.fn = fn; 33299 operation.args = args; 33300 return true; 33301 } 33302 33303 if ((0, _primitives.isEOF)(obj)) { 33304 return false; 33305 } 33306 33307 if (obj !== null) { 33308 if (args === null) { 33309 args = []; 33310 } 33311 33312 args.push(obj); 33313 33314 if (args.length > 33) { 33315 throw new _util.FormatError('Too many arguments'); 33316 } 33317 } 33318 } 33319 }, 33320 preprocessCommand: function EvaluatorPreprocessor_preprocessCommand(fn, args) { 33321 switch (fn | 0) { 33322 case _util.OPS.save: 33323 this.stateManager.save(); 33324 break; 33325 33326 case _util.OPS.restore: 33327 this.stateManager.restore(); 33328 break; 33329 33330 case _util.OPS.transform: 33331 this.stateManager.transform(args); 33332 break; 33333 } 33334 } 33335 }; 33336 return EvaluatorPreprocessor; 33337}();
33338 33339/***/ }), 33340/* 172 */ 33341/***/ (function(module, exports, __w_pdfjs_require__) { 33342 33343"use strict"; 33344 33345 33346Object.defineProperty(exports, "__esModule", { 33347 value: true 33348}); 33349exports.CMapFactory = exports.IdentityCMap = exports.CMap = void 0; 33350 33351var _util = __w_pdfjs_require__(6); 33352 33353var _primitives = __w_pdfjs_require__(155); 33354 33355var _parser = __w_pdfjs_require__(156); 33356 33357var _stream = __w_pdfjs_require__(157); 33358 33359function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 33360 33361function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 33362 33363function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 33364 33365function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 33366 33367function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 33368 33369function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 33370 33371function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 33372 33373function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 33374 33375function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 33376 33377var BUILT_IN_CMAPS = ['Adobe-GB1-UCS2', 'Adobe-CNS1-UCS2', 'Adobe-Japan1-UCS2', 'Adobe-Korea1-UCS2', '78-EUC-H', '78-EUC-V', '78-H', '78-RKSJ-H', '78-RKSJ-V', '78-V', '78ms-RKSJ-H', '78ms-RKSJ-V', '83pv-RKSJ-H', '90ms-RKSJ-H', '90ms-RKSJ-V', '90msp-RKSJ-H', '90msp-RKSJ-V', '90pv-RKSJ-H', '90pv-RKSJ-V', 'Add-H', 'Add-RKSJ-H', 'Add-RKSJ-V', 'Add-V', 'Adobe-CNS1-0', 'Adobe-CNS1-1', 'Adobe-CNS1-2', 'Adobe-CNS1-3', 'Adobe-CNS1-4', 'Adobe-CNS1-5', 'Adobe-CNS1-6', 'Adobe-GB1-0', 'Adobe-GB1-1', 'Adobe-GB1-2', 'Adobe-GB1-3', 'Adobe-GB1-4', 'Adobe-GB1-5', 'Adobe-Japan1-0', 'Adobe-Japan1-1', 'Adobe-Japan1-2', 'Adobe-Japan1-3', 'Adobe-Japan1-4', 'Adobe-Japan1-5', 'Adobe-Japan1-6', 'Adobe-Korea1-0', 'Adobe-Korea1-1', 'Adobe-Korea1-2', 'B5-H', 'B5-V', 'B5pc-H', 'B5pc-V', 'CNS-EUC-H', 'CNS-EUC-V', 'CNS1-H', 'CNS1-V', 'CNS2-H', 'CNS2-V', 'ETHK-B5-H', 'ETHK-B5-V', 'ETen-B5-H', 'ETen-B5-V', 'ETenms-B5-H', 'ETenms-B5-V', 'EUC-H', 'EUC-V', 'Ext-H', 'Ext-RKSJ-H', 'Ext-RKSJ-V', 'Ext-V', 'GB-EUC-H', 'GB-EUC-V', 'GB-H', 'GB-V', 'GBK-EUC-H', 'GBK-EUC-V', 'GBK2K-H', 'GBK2K-V', 'GBKp-EUC-H', 'GBKp-EUC-V', 'GBT-EUC-H', 'GBT-EUC-V', 'GBT-H', 'GBT-V', 'GBTpc-EUC-H', 'GBTpc-EUC-V', 'GBpc-EUC-H', 'GBpc-EUC-V', 'H', 'HKdla-B5-H', 'HKdla-B5-V', 'HKdlb-B5-H', 'HKdlb-B5-V', 'HKgccs-B5-H', 'HKgccs-B5-V', 'HKm314-B5-H', 'HKm314-B5-V', 'HKm471-B5-H', 'HKm471-B5-V', 'HKscs-B5-H', 'HKscs-B5-V', 'Hankaku', 'Hiragana', 'KSC-EUC-H', 'KSC-EUC-V', 'KSC-H', 'KSC-Johab-H', 'KSC-Johab-V', 'KSC-V', 'KSCms-UHC-H', 'KSCms-UHC-HW-H', 'KSCms-UHC-HW-V', 'KSCms-UHC-V', 'KSCpc-EUC-H', 'KSCpc-EUC-V', 'Katakana', 'NWP-H', 'NWP-V', 'RKSJ-H', 'RKSJ-V', 'Roman', 'UniCNS-UCS2-H', 'UniCNS-UCS2-V', 'UniCNS-UTF16-H', 'UniCNS-UTF16-V', 'UniCNS-UTF32-H', 'UniCNS-UTF32-V', 'UniCNS-UTF8-H', 'UniCNS-UTF8-V', 'UniGB-UCS2-H', 'UniGB-UCS2-V', 'UniGB-UTF16-H', 'UniGB-UTF16-V', 'UniGB-UTF32-H', 'UniGB-UTF32-V', 'UniGB-UTF8-H', 'UniGB-UTF8-V', 'UniJIS-UCS2-H', 'UniJIS-UCS2-HW-H', 'UniJIS-UCS2-HW-V', 'UniJIS-UCS2-V', 'UniJIS-UTF16-H', 'UniJIS-UTF16-V', 'UniJIS-UTF32-H', 'UniJIS-UTF32-V', 'UniJIS-UTF8-H', 'UniJIS-UTF8-V', 'UniJIS2004-UTF16-H', 'UniJIS2004-UTF16-V', 'UniJIS2004-UTF32-H', 'UniJIS2004-UTF32-V', 'UniJIS2004-UTF8-H', 'UniJIS2004-UTF8-V', 'UniJISPro-UCS2-HW-V', 'UniJISPro-UCS2-V', 'UniJISPro-UTF8-V', 'UniJISX0213-UTF32-H', 'UniJISX0213-UTF32-V', 'UniJISX02132004-UTF32-H', 'UniJISX02132004-UTF32-V', 'UniKS-UCS2-H', 'UniKS-UCS2-V', 'UniKS-UTF16-H', 'UniKS-UTF16-V', 'UniKS-UTF32-H', 'UniKS-UTF32-V', 'UniKS-UTF8-H', 'UniKS-UTF8-V', 'V', 'WP-Symbol']; 33378 33379var CMap = 33380/*#__PURE__*/ 33381function () { 33382 function CMap() { 33383 var builtInCMap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 33384 33385 _classCallCheck(this, CMap); 33386 33387 this.codespaceRanges = [[], [], [], []]; 33388 this.numCodespaceRanges = 0; 33389 this._map = []; 33390 this.name = ''; 33391 this.vertical = false; 33392 this.useCMap = null; 33393 this.builtInCMap = builtInCMap; 33394 } 33395 33396 _createClass(CMap, [{ 33397 key: "addCodespaceRange", 33398 value: function addCodespaceRange(n, low, high) { 33399 this.codespaceRanges[n - 1].push(low, high); 33400 this.numCodespaceRanges++; 33401 } 33402 }, { 33403 key: "mapCidRange", 33404 value: function mapCidRange(low, high, dstLow) { 33405 while (low <= high) { 33406 this._map[low++] = dstLow++; 33407 } 33408 } 33409 }, { 33410 key: "mapBfRange", 33411 value: function mapBfRange(low, high, dstLow) { 33412 var lastByte = dstLow.length - 1; 33413 33414 while (low <= high) { 33415 this._map[low++] = dstLow; 33416 dstLow = dstLow.substring(0, lastByte) + String.fromCharCode(dstLow.charCodeAt(lastByte) + 1); 33417 } 33418 } 33419 }, { 33420 key: "mapBfRangeToArray", 33421 value: function mapBfRangeToArray(low, high, array) { 33422 var i = 0, 33423 ii = array.length; 33424 33425 while (low <= high && i < ii) { 33426 this._map[low] = array[i++]; 33427 ++low; 33428 } 33429 } 33430 }, { 33431 key: "mapOne", 33432 value: function mapOne(src, dst) { 33433 this._map[src] = dst; 33434 } 33435 }, { 33436 key: "lookup", 33437 value: function lookup(code) { 33438 return this._map[code]; 33439 } 33440 }, { 33441 key: "contains", 33442 value: function contains(code) { 33443 return this._map[code] !== undefined; 33444 } 33445 }, { 33446 key: "forEach", 33447 value: function forEach(callback) { 33448 var map = this._map; 33449 var length = map.length; 33450
33451 if (length <= 0x10000) { 33452 for (var i = 0; i < length; i++) { 33453 if (map[i] !== undefined) { 33454 callback(i, map[i]); 33455 } 33456 } 33457 } else { 33458 for (var _i in map) { 33459 callback(_i, map[_i]); 33460 } 33461 } 33462 } 33463 }, { 33464 key: "charCodeOf", 33465 value: function charCodeOf(value) { 33466 var map = this._map; 33467 33468 if (map.length <= 0x10000) { 33469 return map.indexOf(value); 33470 } 33471 33472 for (var charCode in map) { 33473 if (map[charCode] === value) { 33474 return charCode | 0; 33475 } 33476 } 33477 33478 return -1; 33479 } 33480 }, { 33481 key: "getMap", 33482 value: function getMap() { 33483 return this._map; 33484 } 33485 }, { 33486 key: "readCharCode", 33487 value: function readCharCode(str, offset, out) { 33488 var c = 0; 33489 var codespaceRanges = this.codespaceRanges; 33490 33491 for (var n = 0, nn = codespaceRanges.length; n < nn; n++) { 33492 c = (c << 8 | str.charCodeAt(offset + n)) >>> 0; 33493 var codespaceRange = codespaceRanges[n]; 33494 33495 for (var k = 0, kk = codespaceRange.length; k < kk;) { 33496 var low = codespaceRange[k++]; 33497 var high = codespaceRange[k++]; 33498 33499 if (c >= low && c <= high) {
33500 out.charcode = c; 33501 out.length = n + 1; 33502 return; 33503 } 33504 } 33505 } 33506 33507 out.charcode = 0; 33508 out.length = 1; 33509 } 33510 }, { 33511 key: "length", 33512 get: function get() { 33513 return this._map.length; 33514 } 33515 }, { 33516 key: "isIdentityCMap", 33517 get: function get() { 33518 if (!(this.name === 'Identity-H' || this.name === 'Identity-V')) { 33519 return false; 33520 } 33521 33522 if (this._map.length !== 0x10000) { 33523 return false; 33524 } 33525 33526 for (var i = 0; i < 0x10000; i++) { 33527 if (this._map[i] !== i) { 33528 return false; 33529 } 33530 } 33531 33532 return true; 33533 } 33534 }]); 33535 33536 return CMap; 33537}(); 33538 33539exports.CMap = CMap; 33540 33541var IdentityCMap = 33542/*#__PURE__*/ 33543function (_CMap) { 33544 _inherits(IdentityCMap, _CMap); 33545 33546 function IdentityCMap(vertical, n) { 33547 var _this; 33548 33549 _classCallCheck(this, IdentityCMap); 33550 33551 _this = _possibleConstructorReturn(this, _getPrototypeOf(IdentityCMap).call(this)); 33552 _this.vertical = vertical; 33553 33554 _this.addCodespaceRange(n, 0, 0xffff); 33555 33556 return _this; 33557 } 33558 33559 _createClass(IdentityCMap, [{ 33560 key: "mapCidRange", 33561 value: function mapCidRange(low, high, dstLow) { 33562 (0, _util.unreachable)('should not call mapCidRange'); 33563 } 33564 }, { 33565 key: "mapBfRange", 33566 value: function mapBfRange(low, high, dstLow) { 33567 (0, _util.unreachable)('should not call mapBfRange'); 33568 } 33569 }, { 33570 key: "mapBfRangeToArray", 33571 value: function mapBfRangeToArray(low, high, array) { 33572 (0, _util.unreachable)('should not call mapBfRangeToArray'); 33573 } 33574 }, { 33575 key: "mapOne", 33576 value: function mapOne(src, dst) { 33577 (0, _util.unreachable)('should not call mapCidOne'); 33578 } 33579 }, { 33580 key: "lookup", 33581 value: function lookup(code) { 33582 return Number.isInteger(code) && code <= 0xffff ? code : undefined; 33583 } 33584 }, { 33585 key: "contains", 33586 value: function contains(code) { 33587 return Number.isInteger(code) && code <= 0xffff; 33588 } 33589 }, { 33590 key: "forEach", 33591 value: function forEach(callback) { 33592 for (var i = 0; i <= 0xffff; i++) { 33593 callback(i, i); 33594 } 33595 } 33596 }, { 33597 key: "charCodeOf", 33598 value: function charCodeOf(value) { 33599 return Number.isInteger(value) && value <= 0xffff ? value : -1; 33600 } 33601 }, { 33602 key: "getMap", 33603 value: function getMap() { 33604 var map = new Array(0x10000); 33605 33606 for (var i = 0; i <= 0xffff; i++) { 33607 map[i] = i; 33608 } 33609 33610 return map; 33611 } 33612 }, { 33613 key: "length", 33614 get: function get() { 33615 return 0x10000; 33616 } 33617 }, { 33618 key: "isIdentityCMap", 33619 get: function get() { 33620 (0, _util.unreachable)('should not access .isIdentityCMap'); 33621 } 33622 }]); 33623 33624 return IdentityCMap; 33625}(CMap); 33626 33627exports.IdentityCMap = IdentityCMap; 33628 33629var BinaryCMapReader = function BinaryCMapReaderClosure() { 33630 function hexToInt(a, size) { 33631 var n = 0; 33632 33633 for (var i = 0; i <= size; i++) { 33634 n = n << 8 | a[i]; 33635 } 33636 33637 return n >>> 0; 33638 } 33639 33640 function hexToStr(a, size) { 33641 if (size === 1) { 33642 return String.fromCharCode(a[0], a[1]); 33643 } 33644 33645 if (size === 3) { 33646 return String.fromCharCode(a[0], a[1], a[2], a[3]); 33647 } 33648 33649 return String.fromCharCode.apply(null, a.subarray(0, size + 1)); 33650 } 33651 33652 function addHex(a, b, size) { 33653 var c = 0; 33654 33655 for (var i = size; i >= 0; i--) { 33656 c += a[i] + b[i]; 33657 a[i] = c & 255; 33658 c >>= 8; 33659 } 33660 } 33661 33662 function incHex(a, size) { 33663 var c = 1; 33664 33665 for (var i = size; i >= 0 && c > 0; i--) { 33666 c += a[i]; 33667 a[i] = c & 255; 33668 c >>= 8; 33669 } 33670 } 33671 33672 var MAX_NUM_SIZE = 16; 33673 var MAX_ENCODED_NUM_SIZE = 19; 33674 33675 function BinaryCMapStream(data) { 33676 this.buffer = data; 33677 this.pos = 0; 33678 this.end = data.length; 33679 this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE); 33680 } 33681 33682 BinaryCMapStream.prototype = { 33683 readByte: function readByte() { 33684 if (this.pos >= this.end) { 33685 return -1; 33686 } 33687 33688 return this.buffer[this.pos++]; 33689 }, 33690 readNumber: function readNumber() { 33691 var n = 0; 33692 var last; 33693 33694 do { 33695 var b = this.readByte(); 33696 33697 if (b < 0) { 33698 throw new _util.FormatError('unexpected EOF in bcmap'); 33699 } 33700 33701 last = !(b & 0x80); 33702 n = n << 7 | b & 0x7F; 33703 } while (!last); 33704 33705 return n; 33706 }, 33707 readSigned: function readSigned() { 33708 var n = this.readNumber(); 33709 return n & 1 ? ~(n >>> 1) : n >>> 1; 33710 }, 33711 readHex: function readHex(num, size) { 33712 num.set(this.buffer.subarray(this.pos, this.pos + size + 1)); 33713 this.pos += size + 1; 33714 }, 33715 readHexNumber: function readHexNumber(num, size) { 33716 var last; 33717 var stack = this.tmpBuf, 33718 sp = 0; 33719 33720 do { 33721 var b = this.readByte(); 33722 33723 if (b < 0) { 33724 throw new _util.FormatError('unexpected EOF in bcmap'); 33725 } 33726 33727 last = !(b & 0x80); 33728 stack[sp++] = b & 0x7F; 33729 } while (!last); 33730 33731 var i = size, 33732 buffer = 0, 33733 bufferSize = 0; 33734 33735 while (i >= 0) { 33736 while (bufferSize < 8 && stack.length > 0) { 33737 buffer = stack[--sp] << bufferSize | buffer; 33738 bufferSize += 7; 33739 } 33740 33741 num[i] = buffer & 255; 33742 i--; 33743 buffer >>= 8; 33744 bufferSize -= 8; 33745 } 33746 }, 33747 readHexSigned: function readHexSigned(num, size) { 33748 this.readHexNumber(num, size); 33749 var sign = num[size] & 1 ? 255 : 0; 33750 var c = 0; 33751 33752 for (var i = 0; i <= size; i++) { 33753 c = (c & 1) << 8 | num[i]; 33754 num[i] = c >> 1 ^ sign; 33755 } 33756 }, 33757 readString: function readString() { 33758 var len = this.readNumber(); 33759 var s = ''; 33760 33761 for (var i = 0; i < len; i++) { 33762 s += String.fromCharCode(this.readNumber()); 33763 } 33764 33765 return s; 33766 } 33767 }; 33768 33769 function processBinaryCMap(data, cMap, extend) { 33770 return new Promise(function (resolve, reject) { 33771 var stream = new BinaryCMapStream(data); 33772 var header = stream.readByte(); 33773 cMap.vertical = !!(header & 1); 33774 var useCMap = null; 33775 var start = new Uint8Array(MAX_NUM_SIZE); 33776 var end = new Uint8Array(MAX_NUM_SIZE); 33777 var char = new Uint8Array(MAX_NUM_SIZE);
vendor: 5,434 bytes, lines 33778-33948
33778 var charCode = new Uint8Array(MAX_NUM_SIZE); 33779 var tmp = new Uint8Array(MAX_NUM_SIZE); 33780 var code; 33781 var b; 33782 33783 while ((b = stream.readByte()) >= 0) { 33784 var type = b >> 5; 33785 33786 if (type === 7) { 33787 switch (b & 0x1F) { 33788 case 0: 33789 stream.readString(); 33790 break; 33791 33792 case 1: 33793 useCMap = stream.readString(); 33794 break; 33795 } 33796 33797 continue; 33798 } 33799 33800 var sequence = !!(b & 0x10); 33801 var dataSize = b & 15; 33802 33803 if (dataSize + 1 > MAX_NUM_SIZE) { 33804 throw new Error('processBinaryCMap: Invalid dataSize.'); 33805 } 33806 33807 var ucs2DataSize = 1; 33808 var subitemsCount = stream.readNumber(); 33809 var i; 33810 33811 switch (type) { 33812 case 0: 33813 stream.readHex(start, dataSize); 33814 stream.readHexNumber(end, dataSize); 33815 addHex(end, start, dataSize); 33816 cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); 33817 33818 for (i = 1; i < subitemsCount; i++) { 33819 incHex(end, dataSize); 33820 stream.readHexNumber(start, dataSize); 33821 addHex(start, end, dataSize); 33822 stream.readHexNumber(end, dataSize); 33823 addHex(end, start, dataSize); 33824 cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); 33825 } 33826 33827 break; 33828 33829 case 1: 33830 stream.readHex(start, dataSize); 33831 stream.readHexNumber(end, dataSize); 33832 addHex(end, start, dataSize); 33833 stream.readNumber(); 33834 33835 for (i = 1; i < subitemsCount; i++) { 33836 incHex(end, dataSize); 33837 stream.readHexNumber(start, dataSize); 33838 addHex(start, end, dataSize); 33839 stream.readHexNumber(end, dataSize); 33840 addHex(end, start, dataSize); 33841 stream.readNumber(); 33842 } 33843 33844 break; 33845 33846 case 2: 33847 stream.readHex(char, dataSize); 33848 code = stream.readNumber(); 33849 cMap.mapOne(hexToInt(char, dataSize), code); 33850 33851 for (i = 1; i < subitemsCount; i++) { 33852 incHex(char, dataSize); 33853 33854 if (!sequence) { 33855 stream.readHexNumber(tmp, dataSize); 33856 addHex(char, tmp, dataSize); 33857 } 33858 33859 code = stream.readSigned() + (code + 1); 33860 cMap.mapOne(hexToInt(char, dataSize), code); 33861 } 33862 33863 break; 33864 33865 case 3: 33866 stream.readHex(start, dataSize); 33867 stream.readHexNumber(end, dataSize); 33868 addHex(end, start, dataSize); 33869 code = stream.readNumber(); 33870 cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); 33871 33872 for (i = 1; i < subitemsCount; i++) { 33873 incHex(end, dataSize); 33874 33875 if (!sequence) { 33876 stream.readHexNumber(start, dataSize); 33877 addHex(start, end, dataSize); 33878 } else { 33879 start.set(end); 33880 } 33881 33882 stream.readHexNumber(end, dataSize); 33883 addHex(end, start, dataSize); 33884 code = stream.readNumber(); 33885 cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); 33886 } 33887 33888 break; 33889 33890 case 4: 33891 stream.readHex(char, ucs2DataSize); 33892 stream.readHex(charCode, dataSize); 33893 cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); 33894 33895 for (i = 1; i < subitemsCount; i++) { 33896 incHex(char, ucs2DataSize); 33897 33898 if (!sequence) { 33899 stream.readHexNumber(tmp, ucs2DataSize); 33900 addHex(char, tmp, ucs2DataSize); 33901 } 33902 33903 incHex(charCode, dataSize); 33904 stream.readHexSigned(tmp, dataSize); 33905 addHex(charCode, tmp, dataSize); 33906 cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); 33907 } 33908 33909 break; 33910 33911 case 5: 33912 stream.readHex(start, ucs2DataSize); 33913 stream.readHexNumber(end, ucs2DataSize); 33914 addHex(end, start, ucs2DataSize); 33915 stream.readHex(charCode, dataSize); 33916 cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); 33917 33918 for (i = 1; i < subitemsCount; i++) { 33919 incHex(end, ucs2DataSize); 33920 33921 if (!sequence) { 33922 stream.readHexNumber(start, ucs2DataSize); 33923 addHex(start, end, ucs2DataSize); 33924 } else { 33925 start.set(end); 33926 } 33927 33928 stream.readHexNumber(end, ucs2DataSize); 33929 addHex(end, start, ucs2DataSize); 33930 stream.readHex(charCode, dataSize); 33931 cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); 33932 } 33933 33934 break; 33935 33936 default: 33937 reject(new Error('processBinaryCMap: Unknown type: ' + type)); 33938 return; 33939 } 33940 } 33941 33942 if (useCMap) { 33943 resolve(extend(useCMap)); 33944 return; 33945 } 33946 33947 resolve(cMap); 33948 });
33949 } 33950 33951 function BinaryCMapReader() {} 33952 33953 BinaryCMapReader.prototype = { 33954 process: processBinaryCMap 33955 }; 33956 return BinaryCMapReader; 33957}(); 33958 33959var CMapFactory = function CMapFactoryClosure() { 33960 function strToInt(str) { 33961 var a = 0; 33962 33963 for (var i = 0; i < str.length; i++) { 33964 a = a << 8 | str.charCodeAt(i); 33965 } 33966 33967 return a >>> 0; 33968 } 33969 33970 function expectString(obj) { 33971 if (!(0, _util.isString)(obj)) { 33972 throw new _util.FormatError('Malformed CMap: expected string.'); 33973 } 33974 } 33975 33976 function expectInt(obj) { 33977 if (!Number.isInteger(obj)) { 33978 throw new _util.FormatError('Malformed CMap: expected int.'); 33979 } 33980 } 33981 33982 function parseBfChar(cMap, lexer) { 33983 while (true) { 33984 var obj = lexer.getObj(); 33985 33986 if ((0, _primitives.isEOF)(obj)) { 33987 break; 33988 } 33989 33990 if ((0, _primitives.isCmd)(obj, 'endbfchar')) { 33991 return; 33992 } 33993 33994 expectString(obj); 33995 var src = strToInt(obj); 33996 obj = lexer.getObj(); 33997 expectString(obj); 33998 var dst = obj; 33999 cMap.mapOne(src, dst); 34000 } 34001 } 34002 34003 function parseBfRange(cMap, lexer) { 34004 while (true) { 34005 var obj = lexer.getObj(); 34006 34007 if ((0, _primitives.isEOF)(obj)) { 34008 break; 34009 } 34010 34011 if ((0, _primitives.isCmd)(obj, 'endbfrange')) { 34012 return; 34013 } 34014 34015 expectString(obj); 34016 var low = strToInt(obj); 34017 obj = lexer.getObj(); 34018 expectString(obj); 34019 var high = strToInt(obj); 34020 obj = lexer.getObj(); 34021 34022 if (Number.isInteger(obj) || (0, _util.isString)(obj)) { 34023 var dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj; 34024 cMap.mapBfRange(low, high, dstLow); 34025 } else if ((0, _primitives.isCmd)(obj, '[')) { 34026 obj = lexer.getObj(); 34027 var array = []; 34028 34029 while (!(0, _primitives.isCmd)(obj, ']') && !(0, _primitives.isEOF)(obj)) { 34030 array.push(obj); 34031 obj = lexer.getObj(); 34032 } 34033 34034 cMap.mapBfRangeToArray(low, high, array); 34035 } else { 34036 break; 34037 } 34038 } 34039 34040 throw new _util.FormatError('Invalid bf range.'); 34041 } 34042 34043 function parseCidChar(cMap, lexer) { 34044 while (true) { 34045 var obj = lexer.getObj(); 34046 34047 if ((0, _primitives.isEOF)(obj)) { 34048 break; 34049 } 34050 34051 if ((0, _primitives.isCmd)(obj, 'endcidchar')) { 34052 return; 34053 } 34054 34055 expectString(obj); 34056 var src = strToInt(obj); 34057 obj = lexer.getObj(); 34058 expectInt(obj); 34059 var dst = obj; 34060 cMap.mapOne(src, dst); 34061 } 34062 } 34063 34064 function parseCidRange(cMap, lexer) { 34065 while (true) { 34066 var obj = lexer.getObj(); 34067 34068 if ((0, _primitives.isEOF)(obj)) { 34069 break; 34070 } 34071 34072 if ((0, _primitives.isCmd)(obj, 'endcidrange')) { 34073 return; 34074 } 34075 34076 expectString(obj); 34077 var low = strToInt(obj); 34078 obj = lexer.getObj(); 34079 expectString(obj); 34080 var high = strToInt(obj); 34081 obj = lexer.getObj(); 34082 expectInt(obj); 34083 var dstLow = obj; 34084 cMap.mapCidRange(low, high, dstLow); 34085 } 34086 } 34087 34088 function parseCodespaceRange(cMap, lexer) { 34089 while (true) { 34090 var obj = lexer.getObj(); 34091 34092 if ((0, _primitives.isEOF)(obj)) { 34093 break; 34094 } 34095 34096 if ((0, _primitives.isCmd)(obj, 'endcodespacerange')) { 34097 return; 34098 } 34099 34100 if (!(0, _util.isString)(obj)) { 34101 break; 34102 } 34103 34104 var low = strToInt(obj); 34105 obj = lexer.getObj(); 34106 34107 if (!(0, _util.isString)(obj)) { 34108 break; 34109 } 34110 34111 var high = strToInt(obj); 34112 cMap.addCodespaceRange(obj.length, low, high); 34113 } 34114 34115 throw new _util.FormatError('Invalid codespace range.'); 34116 } 34117 34118 function parseWMode(cMap, lexer) { 34119 var obj = lexer.getObj(); 34120 34121 if (Number.isInteger(obj)) { 34122 cMap.vertical = !!obj; 34123 } 34124 } 34125 34126 function parseCMapName(cMap, lexer) { 34127 var obj = lexer.getObj(); 34128 34129 if ((0, _primitives.isName)(obj) && (0, _util.isString)(obj.name)) { 34130 cMap.name = obj.name; 34131 } 34132 } 34133 34134 function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) { 34135 var previous; 34136 var embeddedUseCMap; 34137 34138 objLoop: while (true) {
34139 try { 34140 var obj = lexer.getObj(); 34141 34142 if ((0, _primitives.isEOF)(obj)) { 34143 break; 34144 } else if ((0, _primitives.isName)(obj)) { 34145 if (obj.name === 'WMode') { 34146 parseWMode(cMap, lexer); 34147 } else if (obj.name === 'CMapName') { 34148 parseCMapName(cMap, lexer); 34149 } 34150 34151 previous = obj; 34152 } else if ((0, _primitives.isCmd)(obj)) { 34153 switch (obj.cmd) { 34154 case 'endcmap': 34155 break objLoop; 34156 34157 case 'usecmap': 34158 if ((0, _primitives.isName)(previous)) { 34159 embeddedUseCMap = previous.name; 34160 } 34161 34162 break; 34163 34164 case 'begincodespacerange': 34165 parseCodespaceRange(cMap, lexer); 34166 break; 34167 34168 case 'beginbfchar': 34169 parseBfChar(cMap, lexer); 34170 break; 34171 34172 case 'begincidchar': 34173 parseCidChar(cMap, lexer); 34174 break; 34175 34176 case 'beginbfrange': 34177 parseBfRange(cMap, lexer); 34178 break; 34179 34180 case 'begincidrange': 34181 parseCidRange(cMap, lexer); 34182 break; 34183 } 34184 } 34185 } catch (ex) { 34186 if (ex instanceof _util.MissingDataException) { 34187 throw ex; 34188 } 34189 34190 (0, _util.warn)('Invalid cMap data: ' + ex); 34191 continue; 34192 } 34193 } 34194 34195 if (!useCMap && embeddedUseCMap) { 34196 useCMap = embeddedUseCMap; 34197 } 34198 34199 if (useCMap) { 34200 return extendCMap(cMap, fetchBuiltInCMap, useCMap); 34201 } 34202 34203 return Promise.resolve(cMap); 34204 } 34205 34206 function extendCMap(cMap, fetchBuiltInCMap, useCMap) { 34207 return createBuiltInCMap(useCMap, fetchBuiltInCMap).then(function (newCMap) { 34208 cMap.useCMap = newCMap; 34209 34210 if (cMap.numCodespaceRanges === 0) { 34211 var useCodespaceRanges = cMap.useCMap.codespaceRanges; 34212 34213 for (var i = 0; i < useCodespaceRanges.length; i++) { 34214 cMap.codespaceRanges[i] = useCodespaceRanges[i].slice(); 34215 } 34216 34217 cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges; 34218 } 34219 34220 cMap.useCMap.forEach(function (key, value) { 34221 if (!cMap.contains(key)) { 34222 cMap.mapOne(key, cMap.useCMap.lookup(key)); 34223 } 34224 }); 34225 return cMap; 34226 }); 34227 } 34228 34229 function createBuiltInCMap(name, fetchBuiltInCMap) { 34230 if (name === 'Identity-H') { 34231 return Promise.resolve(new IdentityCMap(false, 2)); 34232 } else if (name === 'Identity-V') { 34233 return Promise.resolve(new IdentityCMap(true, 2)); 34234 } 34235 34236 if (!BUILT_IN_CMAPS.includes(name)) { 34237 return Promise.reject(new Error('Unknown CMap name: ' + name)); 34238 } 34239 34240 if (!fetchBuiltInCMap) { 34241 return Promise.reject(new Error('Built-in CMap parameters are not provided.')); 34242 } 34243 34244 return fetchBuiltInCMap(name).then(function (data) { 34245 var cMapData = data.cMapData, 34246 compressionType = data.compressionType; 34247 var cMap = new CMap(true); 34248 34249 if (compressionType === _util.CMapCompressionType.BINARY) { 34250 return new BinaryCMapReader().process(cMapData, cMap, function (useCMap) { 34251 return extendCMap(cMap, fetchBuiltInCMap, useCMap); 34252 }); 34253 } 34254 34255 if (compressionType === _util.CMapCompressionType.NONE) { 34256 var lexer = new _parser.Lexer(new _stream.Stream(cMapData)); 34257 return parseCMap(cMap, lexer, fetchBuiltInCMap, null); 34258 } 34259 34260 return Promise.reject(new Error('TODO: Only BINARY/NONE CMap compression is currently supported.')); 34261 }); 34262 } 34263 34264 return { 34265 create: function create(params) { 34266 var encoding = params.encoding; 34267 var fetchBuiltInCMap = params.fetchBuiltInCMap; 34268 var useCMap = params.useCMap; 34269 34270 if ((0, _primitives.isName)(encoding)) { 34271 return createBuiltInCMap(encoding.name, fetchBuiltInCMap); 34272 } else if ((0, _primitives.isStream)(encoding)) { 34273 var cMap = new CMap(); 34274 var lexer = new _parser.Lexer(encoding); 34275 return parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap).then(function (parsedCMap) { 34276 if (parsedCMap.isIdentityCMap) { 34277 return createBuiltInCMap(parsedCMap.name, fetchBuiltInCMap); 34278 } 34279 34280 return parsedCMap; 34281 }); 34282 } 34283 34284 return Promise.reject(new Error('Encoding required.')); 34285 } 34286 }; 34287}(); 34288 34289exports.CMapFactory = CMapFactory;
34290 34291/***/ }), 34292/* 173 */ 34293/***/ (function(module, exports, __w_pdfjs_require__) { 34294 34295"use strict"; 34296 34297 34298Object.defineProperty(exports, "__esModule", { 34299 value: true 34300}); 34301exports.getFontType = getFontType; 34302exports.IdentityToUnicodeMap = exports.ToUnicodeMap = exports.FontFlags = exports.Font = exports.ErrorFont = exports.SEAC_ANALYSIS_ENABLED = void 0; 34303 34304var _util = __w_pdfjs_require__(6); 34305 34306var _cff_parser = __w_pdfjs_require__(174); 34307 34308var _glyphlist = __w_pdfjs_require__(177); 34309 34310var _encodings = __w_pdfjs_require__(176); 34311 34312var _standard_fonts = __w_pdfjs_require__(178); 34313 34314var _unicode = __w_pdfjs_require__(179); 34315 34316var _font_renderer = __w_pdfjs_require__(180); 34317 34318var _cmap = __w_pdfjs_require__(172); 34319 34320var _stream = __w_pdfjs_require__(157); 34321 34322var _type1_parser = __w_pdfjs_require__(181); 34323 34324function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } 34325 34326function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } 34327 34328function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } 34329 34330function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 34331 34332var PRIVATE_USE_AREAS = [[0xE000, 0xF8FF], [0x100000, 0x10FFFD]]; 34333var PDF_GLYPH_SPACE_UNITS = 1000; 34334var SEAC_ANALYSIS_ENABLED = true; 34335exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED; 34336var FontFlags = { 34337 FixedPitch: 1, 34338 Serif: 2, 34339 Symbolic: 4, 34340 Script: 8, 34341 Nonsymbolic: 32, 34342 Italic: 64, 34343 AllCap: 65536, 34344 SmallCap: 131072, 34345 ForceBold: 262144 34346}; 34347exports.FontFlags = FontFlags; 34348var MacStandardGlyphOrdering = ['.notdef', '.null', 'nonmarkingreturn', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis', 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde', 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', 'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', 'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling', 'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright', 'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', 'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff', 'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine', 'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot', 'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft', 'guillemotright', 'ellipsis', 'nonbreakingspace', 'Agrave', 'Atilde', 'Otilde', 'OE', 'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', 'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', 'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', 'periodcentered', 'quotesinglbase', 'quotedblbase', 'perthousand', 'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', 'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'Lslash', 'lslash', 'Scaron', 'scaron', 'Zcaron', 'zcaron', 'brokenbar', 'Eth', 'eth', 'Yacute', 'yacute', 'Thorn', 'thorn', 'minus', 'multiply', 'onesuperior', 'twosuperior', 'threesuperior', 'onehalf', 'onequarter', 'threequarters', 'franc', 'Gbreve', 'gbreve', 'Idotaccent', 'Scedilla', 'scedilla', 'Cacute', 'cacute', 'Ccaron', 'ccaron', 'dcroat']; 34349 34350function adjustWidths(properties) { 34351 if (!properties.fontMatrix) { 34352 return; 34353 } 34354 34355 if (properties.fontMatrix[0] === _util.FONT_IDENTITY_MATRIX[0]) { 34356 return; 34357 } 34358 34359 var scale = 0.001 / properties.fontMatrix[0]; 34360 var glyphsWidths = properties.widths; 34361 34362 for (var glyph in glyphsWidths) { 34363 glyphsWidths[glyph] *= scale; 34364 } 34365 34366 properties.defaultWidth *= scale; 34367} 34368 34369function adjustToUnicode(properties, builtInEncoding) { 34370 if (properties.hasIncludedToUnicodeMap) { 34371 return; 34372 } 34373 34374 if (properties.hasEncoding) { 34375 return; 34376 } 34377 34378 if (builtInEncoding === properties.defaultEncoding) { 34379 return; 34380 } 34381 34382 if (properties.toUnicode instanceof IdentityToUnicodeMap) { 34383 return; 34384 } 34385 34386 var toUnicode = [], 34387 glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 34388
34389 for (var charCode in builtInEncoding) { 34390 var glyphName = builtInEncoding[charCode]; 34391 var unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); 34392 34393 if (unicode !== -1) { 34394 toUnicode[charCode] = String.fromCharCode(unicode); 34395 } 34396 } 34397 34398 properties.toUnicode.amend(toUnicode); 34399} 34400 34401function getFontType(type, subtype) { 34402 switch (type) { 34403 case 'Type1': 34404 return subtype === 'Type1C' ? _util.FontType.TYPE1C : _util.FontType.TYPE1; 34405 34406 case 'CIDFontType0': 34407 return subtype === 'CIDFontType0C' ? _util.FontType.CIDFONTTYPE0C : _util.FontType.CIDFONTTYPE0; 34408 34409 case 'OpenType': 34410 return _util.FontType.OPENTYPE; 34411 34412 case 'TrueType': 34413 return _util.FontType.TRUETYPE; 34414 34415 case 'CIDFontType2': 34416 return _util.FontType.CIDFONTTYPE2; 34417 34418 case 'MMType1': 34419 return _util.FontType.MMTYPE1; 34420 34421 case 'Type0': 34422 return _util.FontType.TYPE0; 34423 34424 default: 34425 return _util.FontType.UNKNOWN; 34426 } 34427} 34428 34429function recoverGlyphName(name, glyphsUnicodeMap) { 34430 if (glyphsUnicodeMap[name] !== undefined) { 34431 return name; 34432 } 34433 34434 var unicode = (0, _unicode.getUnicodeForGlyph)(name, glyphsUnicodeMap); 34435 34436 if (unicode !== -1) { 34437 for (var key in glyphsUnicodeMap) { 34438 if (glyphsUnicodeMap[key] === unicode) { 34439 return key; 34440 } 34441 } 34442 } 34443 34444 (0, _util.info)('Unable to recover a standard glyph name for: ' + name); 34445 return name; 34446} 34447 34448var Glyph = function GlyphClosure() { 34449 function Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) { 34450 this.fontChar = fontChar; 34451 this.unicode = unicode; 34452 this.accent = accent; 34453 this.width = width; 34454 this.vmetric = vmetric; 34455 this.operatorListId = operatorListId; 34456 this.isSpace = isSpace; 34457 this.isInFont = isInFont; 34458 } 34459 34460 Glyph.prototype.matchesForCache = function (fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) { 34461 return this.fontChar === fontChar && this.unicode === unicode && this.accent === accent && this.width === width && this.vmetric === vmetric && this.operatorListId === operatorListId && this.isSpace === isSpace && this.isInFont === isInFont; 34462 }; 34463 34464 return Glyph; 34465}(); 34466 34467var ToUnicodeMap = function ToUnicodeMapClosure() { 34468 function ToUnicodeMap() { 34469 var cmap = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []; 34470 this._map = cmap; 34471 } 34472 34473 ToUnicodeMap.prototype = { 34474 get length() { 34475 return this._map.length; 34476 }, 34477 34478 forEach: function forEach(callback) { 34479 for (var charCode in this._map) { 34480 callback(charCode, this._map[charCode].charCodeAt(0)); 34481 } 34482 }, 34483 has: function has(i) { 34484 return this._map[i] !== undefined; 34485 }, 34486 get: function get(i) { 34487 return this._map[i]; 34488 }, 34489 charCodeOf: function charCodeOf(value) { 34490 var map = this._map; 34491 34492 if (map.length <= 0x10000) { 34493 return map.indexOf(value); 34494 } 34495 34496 for (var charCode in map) { 34497 if (map[charCode] === value) { 34498 return charCode | 0; 34499 } 34500 } 34501 34502 return -1; 34503 }, 34504 amend: function amend(map) { 34505 for (var charCode in map) { 34506 this._map[charCode] = map[charCode]; 34507 } 34508 } 34509 }; 34510 return ToUnicodeMap; 34511}(); 34512 34513exports.ToUnicodeMap = ToUnicodeMap; 34514 34515var IdentityToUnicodeMap = function IdentityToUnicodeMapClosure() { 34516 function IdentityToUnicodeMap(firstChar, lastChar) { 34517 this.firstChar = firstChar; 34518 this.lastChar = lastChar; 34519 } 34520 34521 IdentityToUnicodeMap.prototype = { 34522 get length() { 34523 return this.lastChar + 1 - this.firstChar; 34524 }, 34525 34526 forEach: function forEach(callback) { 34527 for (var i = this.firstChar, ii = this.lastChar; i <= ii; i++) { 34528 callback(i, i); 34529 } 34530 }, 34531 has: function has(i) { 34532 return this.firstChar <= i && i <= this.lastChar; 34533 }, 34534 get: function get(i) { 34535 if (this.firstChar <= i && i <= this.lastChar) { 34536 return String.fromCharCode(i); 34537 } 34538 34539 return undefined; 34540 },
34541 charCodeOf: function charCodeOf(v) { 34542 return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar ? v : -1; 34543 }, 34544 amend: function amend(map) { 34545 (0, _util.unreachable)('Should not call amend()'); 34546 } 34547 }; 34548 return IdentityToUnicodeMap; 34549}(); 34550 34551exports.IdentityToUnicodeMap = IdentityToUnicodeMap; 34552 34553var OpenTypeFileBuilder = function OpenTypeFileBuilderClosure() { 34554 function writeInt16(dest, offset, num) { 34555 dest[offset] = num >> 8 & 0xFF; 34556 dest[offset + 1] = num & 0xFF; 34557 } 34558 34559 function writeInt32(dest, offset, num) { 34560 dest[offset] = num >> 24 & 0xFF; 34561 dest[offset + 1] = num >> 16 & 0xFF; 34562 dest[offset + 2] = num >> 8 & 0xFF; 34563 dest[offset + 3] = num & 0xFF; 34564 } 34565 34566 function writeData(dest, offset, data) { 34567 var i, ii; 34568 34569 if (data instanceof Uint8Array) { 34570 dest.set(data, offset); 34571 } else if (typeof data === 'string') { 34572 for (i = 0, ii = data.length; i < ii; i++) { 34573 dest[offset++] = data.charCodeAt(i) & 0xFF; 34574 } 34575 } else { 34576 for (i = 0, ii = data.length; i < ii; i++) { 34577 dest[offset++] = data[i] & 0xFF; 34578 } 34579 } 34580 } 34581 34582 function OpenTypeFileBuilder(sfnt) { 34583 this.sfnt = sfnt; 34584 this.tables = Object.create(null); 34585 } 34586 34587 OpenTypeFileBuilder.getSearchParams = function OpenTypeFileBuilder_getSearchParams(entriesCount, entrySize) { 34588 var maxPower2 = 1, 34589 log2 = 0; 34590 34591 while ((maxPower2 ^ entriesCount) > maxPower2) { 34592 maxPower2 <<= 1; 34593 log2++; 34594 } 34595 34596 var searchRange = maxPower2 * entrySize; 34597 return { 34598 range: searchRange, 34599 entry: log2, 34600 rangeShift: entrySize * entriesCount - searchRange 34601 }; 34602 }; 34603 34604 var OTF_HEADER_SIZE = 12; 34605 var OTF_TABLE_ENTRY_SIZE = 16; 34606 OpenTypeFileBuilder.prototype = { 34607 toArray: function OpenTypeFileBuilder_toArray() { 34608 var sfnt = this.sfnt; 34609 var tables = this.tables; 34610 var tablesNames = Object.keys(tables); 34611 tablesNames.sort(); 34612 var numTables = tablesNames.length; 34613 var i, j, jj, table, tableName; 34614 var offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE; 34615 var tableOffsets = [offset]; 34616 34617 for (i = 0; i < numTables; i++) { 34618 table = tables[tablesNames[i]]; 34619 var paddedLength = (table.length + 3 & ~3) >>> 0; 34620 offset += paddedLength; 34621 tableOffsets.push(offset); 34622 } 34623 34624 var file = new Uint8Array(offset); 34625 34626 for (i = 0; i < numTables; i++) { 34627 table = tables[tablesNames[i]]; 34628 writeData(file, tableOffsets[i], table); 34629 } 34630 34631 if (sfnt === 'true') { 34632 sfnt = (0, _util.string32)(0x00010000); 34633 } 34634 34635 file[0] = sfnt.charCodeAt(0) & 0xFF; 34636 file[1] = sfnt.charCodeAt(1) & 0xFF; 34637 file[2] = sfnt.charCodeAt(2) & 0xFF; 34638 file[3] = sfnt.charCodeAt(3) & 0xFF; 34639 writeInt16(file, 4, numTables); 34640 var searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16); 34641 writeInt16(file, 6, searchParams.range); 34642 writeInt16(file, 8, searchParams.entry); 34643 writeInt16(file, 10, searchParams.rangeShift); 34644 offset = OTF_HEADER_SIZE; 34645 34646 for (i = 0; i < numTables; i++) { 34647 tableName = tablesNames[i]; 34648 file[offset] = tableName.charCodeAt(0) & 0xFF; 34649 file[offset + 1] = tableName.charCodeAt(1) & 0xFF; 34650 file[offset + 2] = tableName.charCodeAt(2) & 0xFF; 34651 file[offset + 3] = tableName.charCodeAt(3) & 0xFF; 34652 var checksum = 0; 34653 34654 for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) { 34655 var quad = (0, _util.readUint32)(file, j); 34656 checksum = checksum + quad >>> 0; 34657 } 34658 34659 writeInt32(file, offset + 4, checksum); 34660 writeInt32(file, offset + 8, tableOffsets[i]); 34661 writeInt32(file, offset + 12, tables[tableName].length); 34662 offset += OTF_TABLE_ENTRY_SIZE; 34663 } 34664 34665 return file; 34666 }, 34667 addTable: function OpenTypeFileBuilder_addTable(tag, data) { 34668 if (tag in this.tables) { 34669 throw new Error('Table ' + tag + ' already exists'); 34670 } 34671
34672 this.tables[tag] = data; 34673 } 34674 }; 34675 return OpenTypeFileBuilder; 34676}(); 34677 34678var Font = function FontClosure() { 34679 function Font(name, file, properties) { 34680 var charCode; 34681 this.name = name; 34682 this.loadedName = properties.loadedName; 34683 this.isType3Font = properties.isType3Font; 34684 this.sizes = []; 34685 this.missingFile = false; 34686 this.glyphCache = Object.create(null); 34687 this.isSerifFont = !!(properties.flags & FontFlags.Serif); 34688 this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); 34689 this.isMonospace = !!(properties.flags & FontFlags.FixedPitch); 34690 var type = properties.type; 34691 var subtype = properties.subtype; 34692 this.type = type; 34693 this.subtype = subtype; 34694 this.fallbackName = this.isMonospace ? 'monospace' : this.isSerifFont ? 'serif' : 'sans-serif'; 34695 this.differences = properties.differences; 34696 this.widths = properties.widths; 34697 this.defaultWidth = properties.defaultWidth; 34698 this.composite = properties.composite; 34699 this.wideChars = properties.wideChars; 34700 this.cMap = properties.cMap; 34701 this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS; 34702 this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS; 34703 this.fontMatrix = properties.fontMatrix; 34704 this.bbox = properties.bbox; 34705 this.defaultEncoding = properties.defaultEncoding; 34706 this.toUnicode = properties.toUnicode; 34707 this.fallbackToUnicode = properties.fallbackToUnicode || new ToUnicodeMap(); 34708 this.toFontChar = []; 34709 34710 if (properties.type === 'Type3') { 34711 for (charCode = 0; charCode < 256; charCode++) { 34712 this.toFontChar[charCode] = this.differences[charCode] || properties.defaultEncoding[charCode]; 34713 } 34714 34715 this.fontType = _util.FontType.TYPE3; 34716 return; 34717 } 34718 34719 this.cidEncoding = properties.cidEncoding; 34720 this.vertical = properties.vertical; 34721 34722 if (this.vertical) { 34723 this.vmetrics = properties.vmetrics; 34724 this.defaultVMetrics = properties.defaultVMetrics; 34725 } 34726 34727 if (!file || file.isEmpty) { 34728 if (file) { 34729 (0, _util.warn)('Font file is empty in "' + name + '" (' + this.loadedName + ')'); 34730 } 34731 34732 this.fallbackToSystemFont(); 34733 return; 34734 } 34735 34736 var _getFontFileType = getFontFileType(file, properties); 34737 34738 var _getFontFileType2 = _slicedToArray(_getFontFileType, 2); 34739 34740 type = _getFontFileType2[0]; 34741 subtype = _getFontFileType2[1]; 34742 34743 if (type !== this.type || subtype !== this.subtype) { 34744 (0, _util.info)('Inconsistent font file Type/SubType, expected: ' + "".concat(this.type, "/").concat(this.subtype, " but found: ").concat(type, "/").concat(subtype, ".")); 34745 } 34746 34747 try { 34748 var data; 34749 34750 switch (type) { 34751 case 'MMType1': 34752 (0, _util.info)('MMType1 font (' + name + '), falling back to Type1.'); 34753 34754 case 'Type1': 34755 case 'CIDFontType0': 34756 this.mimetype = 'font/opentype'; 34757 var cff = subtype === 'Type1C' || subtype === 'CIDFontType0C' ? new CFFFont(file, properties) : new Type1Font(name, file, properties); 34758 adjustWidths(properties); 34759 data = this.convert(name, cff, properties); 34760 break; 34761 34762 case 'OpenType': 34763 case 'TrueType': 34764 case 'CIDFontType2': 34765 this.mimetype = 'font/opentype'; 34766 data = this.checkAndRepair(name, file, properties); 34767 34768 if (this.isOpenType) { 34769 adjustWidths(properties); 34770 type = 'OpenType'; 34771 } 34772 34773 break; 34774 34775 default: 34776 throw new _util.FormatError("Font ".concat(type, " is not supported")); 34777 } 34778 } catch (e) { 34779 (0, _util.warn)(e); 34780 this.fallbackToSystemFont(); 34781 return; 34782 } 34783 34784 this.data = data; 34785 this.fontType = getFontType(type, subtype); 34786 this.fontMatrix = properties.fontMatrix; 34787 this.widths = properties.widths; 34788 this.defaultWidth = properties.defaultWidth; 34789 this.toUnicode = properties.toUnicode; 34790 this.encoding = properties.baseEncoding; 34791 this.seacMap = properties.seacMap; 34792 } 34793 34794 Font.getFontID = function () { 34795 var ID = 1; 34796 return function Font_getFontID() { 34797 return String(ID++); 34798 }; 34799 }(); 34800 34801 function int16(b0, b1) { 34802 return (b0 << 8) + b1;
34803 } 34804 34805 function writeSignedInt16(bytes, index, value) { 34806 bytes[index + 1] = value; 34807 bytes[index] = value >>> 8; 34808 } 34809 34810 function signedInt16(b0, b1) { 34811 var value = (b0 << 8) + b1; 34812 return value & 1 << 15 ? value - 0x10000 : value; 34813 } 34814 34815 function int32(b0, b1, b2, b3) { 34816 return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; 34817 } 34818 34819 function string16(value) { 34820 return String.fromCharCode(value >> 8 & 0xff, value & 0xff); 34821 } 34822 34823 function safeString16(value) { 34824 value = value > 0x7FFF ? 0x7FFF : value < -0x8000 ? -0x8000 : value; 34825 return String.fromCharCode(value >> 8 & 0xff, value & 0xff); 34826 } 34827 34828 function isTrueTypeFile(file) { 34829 var header = file.peekBytes(4); 34830 return (0, _util.readUint32)(header, 0) === 0x00010000 || (0, _util.bytesToString)(header) === 'true'; 34831 } 34832 34833 function isTrueTypeCollectionFile(file) { 34834 var header = file.peekBytes(4); 34835 return (0, _util.bytesToString)(header) === 'ttcf'; 34836 } 34837 34838 function isOpenTypeFile(file) { 34839 var header = file.peekBytes(4); 34840 return (0, _util.bytesToString)(header) === 'OTTO'; 34841 } 34842 34843 function isType1File(file) { 34844 var header = file.peekBytes(2); 34845 34846 if (header[0] === 0x25 && header[1] === 0x21) { 34847 return true; 34848 } 34849 34850 if (header[0] === 0x80 && header[1] === 0x01) { 34851 return true; 34852 } 34853 34854 return false; 34855 } 34856 34857 function isCFFFile(file) { 34858 var header = file.peekBytes(4); 34859 34860 if (header[0] >= 1 && header[3] >= 1 && header[3] <= 4) { 34861 return true; 34862 } 34863 34864 return false; 34865 } 34866 34867 function getFontFileType(file, _ref) { 34868 var type = _ref.type, 34869 subtype = _ref.subtype, 34870 composite = _ref.composite; 34871 var fileType, fileSubtype; 34872 34873 if (isTrueTypeFile(file) || isTrueTypeCollectionFile(file)) { 34874 if (composite) { 34875 fileType = 'CIDFontType2'; 34876 } else { 34877 fileType = 'TrueType'; 34878 } 34879 } else if (isOpenTypeFile(file)) { 34880 if (composite) { 34881 fileType = 'CIDFontType2'; 34882 } else { 34883 fileType = 'OpenType'; 34884 } 34885 } else if (isType1File(file)) { 34886 if (composite) { 34887 fileType = 'CIDFontType0'; 34888 } else { 34889 fileType = type === 'MMType1' ? 'MMType1' : 'Type1'; 34890 } 34891 } else if (isCFFFile(file)) { 34892 if (composite) { 34893 fileType = 'CIDFontType0'; 34894 fileSubtype = 'CIDFontType0C'; 34895 } else { 34896 fileType = type === 'MMType1' ? 'MMType1' : 'Type1'; 34897 fileSubtype = 'Type1C'; 34898 } 34899 } else { 34900 (0, _util.warn)('getFontFileType: Unable to detect correct font file Type/Subtype.'); 34901 fileType = type; 34902 fileSubtype = subtype; 34903 } 34904 34905 return [fileType, fileSubtype]; 34906 } 34907 34908 function buildToFontChar(encoding, glyphsUnicodeMap, differences) { 34909 var toFontChar = [], 34910 unicode; 34911 34912 for (var i = 0, ii = encoding.length; i < ii; i++) { 34913 unicode = (0, _unicode.getUnicodeForGlyph)(encoding[i], glyphsUnicodeMap); 34914 34915 if (unicode !== -1) { 34916 toFontChar[i] = unicode; 34917 } 34918 } 34919 34920 for (var charCode in differences) { 34921 unicode = (0, _unicode.getUnicodeForGlyph)(differences[charCode], glyphsUnicodeMap); 34922 34923 if (unicode !== -1) { 34924 toFontChar[+charCode] = unicode; 34925 } 34926 } 34927 34928 return toFontChar; 34929 } 34930 34931 function adjustMapping(charCodeToGlyphId, hasGlyph, newGlyphZeroId) { 34932 var newMap = Object.create(null); 34933 var toFontChar = []; 34934 var privateUseAreaIndex = 0; 34935 var nextAvailableFontCharCode = PRIVATE_USE_AREAS[privateUseAreaIndex][0]; 34936 var privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1]; 34937 34938 for (var originalCharCode in charCodeToGlyphId) { 34939 originalCharCode |= 0; 34940 var glyphId = charCodeToGlyphId[originalCharCode]; 34941 34942 if (!hasGlyph(glyphId)) { 34943 continue; 34944 } 34945 34946 if (nextAvailableFontCharCode > privateUseOffetEnd) { 34947 privateUseAreaIndex++; 34948 34949 if (privateUseAreaIndex >= PRIVATE_USE_AREAS.length) { 34950 (0, _util.warn)('Ran out of space in font private use area.'); 34951 break; 34952 } 34953 34954 nextAvailableFontCharCode = PRIVATE_USE_AREAS[privateUseAreaIndex][0]; 34955 privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1]; 34956 } 34957 34958 var fontCharCode = nextAvailableFontCharCode++; 34959 34960 if (glyphId === 0) { 34961 glyphId = newGlyphZeroId; 34962 } 34963 34964 newMap[fontCharCode] = glyphId; 34965 toFontChar[originalCharCode] = fontCharCode; 34966 } 34967 34968 return { 34969 toFontChar: toFontChar,
34970 charCodeToGlyphId: newMap, 34971 nextAvailableFontCharCode: nextAvailableFontCharCode 34972 }; 34973 } 34974 34975 function getRanges(glyphs, numGlyphs) { 34976 var codes = []; 34977 34978 for (var charCode in glyphs) { 34979 if (glyphs[charCode] >= numGlyphs) { 34980 continue; 34981 } 34982 34983 codes.push({ 34984 fontCharCode: charCode | 0, 34985 glyphId: glyphs[charCode] 34986 }); 34987 } 34988 34989 if (codes.length === 0) { 34990 codes.push({ 34991 fontCharCode: 0, 34992 glyphId: 0 34993 }); 34994 } 34995 34996 codes.sort(function fontGetRangesSort(a, b) { 34997 return a.fontCharCode - b.fontCharCode; 34998 }); 34999 var ranges = []; 35000 var length = codes.length; 35001 35002 for (var n = 0; n < length;) { 35003 var start = codes[n].fontCharCode; 35004 var codeIndices = [codes[n].glyphId]; 35005 ++n; 35006 var end = start; 35007 35008 while (n < length && end + 1 === codes[n].fontCharCode) { 35009 codeIndices.push(codes[n].glyphId); 35010 ++end; 35011 ++n; 35012 35013 if (end === 0xFFFF) { 35014 break; 35015 } 35016 } 35017 35018 ranges.push([start, end, codeIndices]); 35019 } 35020 35021 return ranges; 35022 } 35023 35024 function createCmapTable(glyphs, numGlyphs) { 35025 var ranges = getRanges(glyphs, numGlyphs); 35026 var numTables = ranges[ranges.length - 1][1] > 0xFFFF ? 2 : 1; 35027 var cmap = '\x00\x00' + string16(numTables) + '\x00\x03' + '\x00\x01' + (0, _util.string32)(4 + numTables * 8); 35028 var i, ii, j, jj; 35029 35030 for (i = ranges.length - 1; i >= 0; --i) { 35031 if (ranges[i][0] <= 0xFFFF) { 35032 break; 35033 } 35034 } 35035 35036 var bmpLength = i + 1; 35037 35038 if (ranges[i][0] < 0xFFFF && ranges[i][1] === 0xFFFF) { 35039 ranges[i][1] = 0xFFFE; 35040 } 35041 35042 var trailingRangesCount = ranges[i][1] < 0xFFFF ? 1 : 0; 35043 var segCount = bmpLength + trailingRangesCount; 35044 var searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2); 35045 var startCount = ''; 35046 var endCount = ''; 35047 var idDeltas = ''; 35048 var idRangeOffsets = ''; 35049 var glyphsIds = ''; 35050 var bias = 0; 35051 var range, start, end, codes; 35052 35053 for (i = 0, ii = bmpLength; i < ii; i++) { 35054 range = ranges[i]; 35055 start = range[0]; 35056 end = range[1]; 35057 startCount += string16(start); 35058 endCount += string16(end); 35059 codes = range[2]; 35060 var contiguous = true; 35061 35062 for (j = 1, jj = codes.length; j < jj; ++j) { 35063 if (codes[j] !== codes[j - 1] + 1) { 35064 contiguous = false; 35065 break; 35066 } 35067 } 35068 35069 if (!contiguous) { 35070 var offset = (segCount - i) * 2 + bias * 2; 35071 bias += end - start + 1; 35072 idDeltas += string16(0); 35073 idRangeOffsets += string16(offset); 35074 35075 for (j = 0, jj = codes.length; j < jj; ++j) { 35076 glyphsIds += string16(codes[j]); 35077 } 35078 } else { 35079 var startCode = codes[0]; 35080 idDeltas += string16(startCode - start & 0xFFFF); 35081 idRangeOffsets += string16(0); 35082 } 35083 } 35084 35085 if (trailingRangesCount > 0) { 35086 endCount += '\xFF\xFF'; 35087 startCount += '\xFF\xFF'; 35088 idDeltas += '\x00\x01'; 35089 idRangeOffsets += '\x00\x00'; 35090 } 35091 35092 var format314 = '\x00\x00' + string16(2 * segCount) + string16(searchParams.range) + string16(searchParams.entry) + string16(searchParams.rangeShift) + endCount + '\x00\x00' + startCount + idDeltas + idRangeOffsets + glyphsIds; 35093 var format31012 = ''; 35094 var header31012 = ''; 35095 35096 if (numTables > 1) { 35097 cmap += '\x00\x03' + '\x00\x0A' + (0, _util.string32)(4 + numTables * 8 + 4 + format314.length); 35098 format31012 = ''; 35099 35100 for (i = 0, ii = ranges.length; i < ii; i++) { 35101 range = ranges[i]; 35102 start = range[0]; 35103 codes = range[2]; 35104 var code = codes[0]; 35105 35106 for (j = 1, jj = codes.length; j < jj; ++j) { 35107 if (codes[j] !== codes[j - 1] + 1) { 35108 end = range[0] + j - 1; 35109 format31012 += (0, _util.string32)(start) + (0, _util.string32)(end) + (0, _util.string32)(code); 35110 start = end + 1; 35111 code = codes[j]; 35112 } 35113 } 35114 35115 format31012 += (0, _util.string32)(start) + (0, _util.string32)(range[1]) + (0, _util.string32)(code); 35116 } 35117 35118 header31012 = '\x00\x0C' + '\x00\x00' + (0, _util.string32)(format31012.length + 16) + '\x00\x00\x00\x00' + (0, _util.string32)(format31012.length / 12); 35119 } 35120 35121 return cmap + '\x00\x04' + string16(format314.length + 4) + format314 + header31012 + format31012; 35122 } 35123 35124 function validateOS2Table(os2) { 35125 var stream = new _stream.Stream(os2.data); 35126 var version = stream.getUint16(); 35127 stream.getBytes(60); 35128 var selection = stream.getUint16(); 35129 35130 if (version < 4 && selection & 0x0300) { 35131 return false; 35132 } 35133 35134 var firstChar = stream.getUint16(); 35135 var lastChar = stream.getUint16(); 35136 35137 if (firstChar > lastChar) { 35138 return false; 35139 } 35140 35141 stream.getBytes(6); 35142 var usWinAscent = stream.getUint16(); 35143
35144 if (usWinAscent === 0) { 35145 return false; 35146 } 35147 35148 os2.data[8] = os2.data[9] = 0; 35149 return true; 35150 } 35151 35152 function createOS2Table(properties, charstrings, override) { 35153 override = override || { 35154 unitsPerEm: 0, 35155 yMax: 0, 35156 yMin: 0, 35157 ascent: 0, 35158 descent: 0 35159 }; 35160 var ulUnicodeRange1 = 0; 35161 var ulUnicodeRange2 = 0; 35162 var ulUnicodeRange3 = 0; 35163 var ulUnicodeRange4 = 0; 35164 var firstCharIndex = null; 35165 var lastCharIndex = 0; 35166 35167 if (charstrings) { 35168 for (var code in charstrings) { 35169 code |= 0; 35170 35171 if (firstCharIndex > code || !firstCharIndex) { 35172 firstCharIndex = code; 35173 } 35174 35175 if (lastCharIndex < code) { 35176 lastCharIndex = code; 35177 } 35178 35179 var position = (0, _unicode.getUnicodeRangeFor)(code); 35180 35181 if (position < 32) { 35182 ulUnicodeRange1 |= 1 << position; 35183 } else if (position < 64) { 35184 ulUnicodeRange2 |= 1 << position - 32; 35185 } else if (position < 96) { 35186 ulUnicodeRange3 |= 1 << position - 64; 35187 } else if (position < 123) { 35188 ulUnicodeRange4 |= 1 << position - 96; 35189 } else { 35190 throw new _util.FormatError('Unicode ranges Bits > 123 are reserved for internal usage'); 35191 } 35192 } 35193 35194 if (lastCharIndex > 0xFFFF) { 35195 lastCharIndex = 0xFFFF; 35196 } 35197 } else { 35198 firstCharIndex = 0; 35199 lastCharIndex = 255; 35200 } 35201 35202 var bbox = properties.bbox || [0, 0, 0, 0]; 35203 var unitsPerEm = override.unitsPerEm || 1 / (properties.fontMatrix || _util.FONT_IDENTITY_MATRIX)[0]; 35204 var scale = properties.ascentScaled ? 1.0 : unitsPerEm / PDF_GLYPH_SPACE_UNITS; 35205 var typoAscent = override.ascent || Math.round(scale * (properties.ascent || bbox[3])); 35206 var typoDescent = override.descent || Math.round(scale * (properties.descent || bbox[1])); 35207 35208 if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) { 35209 typoDescent = -typoDescent; 35210 } 35211 35212 var winAscent = override.yMax || typoAscent; 35213 var winDescent = -override.yMin || -typoDescent; 35214 return '\x00\x03' + '\x02\x24' + '\x01\xF4' + '\x00\x05' + '\x00\x00' + '\x02\x8A' + '\x02\xBB' + '\x00\x00' + '\x00\x8C' + '\x02\x8A' + '\x02\xBB' + '\x00\x00' + '\x01\xDF' + '\x00\x31' + '\x01\x02' + '\x00\x00' + '\x00\x00\x06' + String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) + '\x00\x00\x00\x00\x00\x00' + (0, _util.string32)(ulUnicodeRange1) + (0, _util.string32)(ulUnicodeRange2) + (0, _util.string32)(ulUnicodeRange3) + (0, _util.string32)(ulUnicodeRange4) + '\x2A\x32\x31\x2A' + string16(properties.italicAngle ? 1 : 0) + string16(firstCharIndex || properties.firstChar) + string16(lastCharIndex || properties.lastChar) + string16(typoAscent) + string16(typoDescent) + '\x00\x64' + string16(winAscent) + string16(winDescent) + '\x00\x00\x00\x00' + '\x00\x00\x00\x00' + string16(properties.xHeight) + string16(properties.capHeight) + string16(0) + string16(firstCharIndex || properties.firstChar) + '\x00\x03'; 35215 } 35216 35217 function createPostTable(properties) { 35218 var angle = Math.floor(properties.italicAngle * Math.pow(2, 16)); 35219 return '\x00\x03\x00\x00' + (0, _util.string32)(angle) + '\x00\x00' + '\x00\x00' + (0, _util.string32)(properties.fixedPitch) + '\x00\x00\x00\x00' + '\x00\x00\x00\x00' + '\x00\x00\x00\x00' + '\x00\x00\x00\x00'; 35220 } 35221 35222 function createNameTable(name, proto) { 35223 if (!proto) { 35224 proto = [[], []]; 35225 } 35226 35227 var strings = [proto[0][0] || 'Original licence', proto[0][1] || name, proto[0][2] || 'Unknown', proto[0][3] || 'uniqueID', proto[0][4] || name, proto[0][5] || 'Version 0.11', proto[0][6] || '', proto[0][7] || 'Unknown', proto[0][8] || 'Unknown', proto[0][9] || 'Unknown']; 35228 var stringsUnicode = []; 35229 var i, ii, j, jj, str; 35230 35231 for (i = 0, ii = strings.length; i < ii; i++) { 35232 str = proto[1][i] || strings[i]; 35233 var strBufUnicode = []; 35234 35235 for (j = 0, jj = str.length; j < jj; j++) { 35236 strBufUnicode.push(string16(str.charCodeAt(j))); 35237 } 35238 35239 stringsUnicode.push(strBufUnicode.join(''));
35240 } 35241 35242 var names = [strings, stringsUnicode]; 35243 var platforms = ['\x00\x01', '\x00\x03']; 35244 var encodings = ['\x00\x00', '\x00\x01']; 35245 var languages = ['\x00\x00', '\x04\x09']; 35246 var namesRecordCount = strings.length * platforms.length; 35247 var nameTable = '\x00\x00' + string16(namesRecordCount) + string16(namesRecordCount * 12 + 6); 35248 var strOffset = 0; 35249 35250 for (i = 0, ii = platforms.length; i < ii; i++) { 35251 var strs = names[i]; 35252 35253 for (j = 0, jj = strs.length; j < jj; j++) { 35254 str = strs[j]; 35255 var nameRecord = platforms[i] + encodings[i] + languages[i] + string16(j) + string16(str.length) + string16(strOffset); 35256 nameTable += nameRecord; 35257 strOffset += str.length; 35258 } 35259 } 35260 35261 nameTable += strings.join('') + stringsUnicode.join(''); 35262 return nameTable; 35263 } 35264 35265 Font.prototype = { 35266 name: null, 35267 font: null, 35268 mimetype: null, 35269 encoding: null, 35270 disableFontFace: false, 35271 35272 get renderer() { 35273 var renderer = _font_renderer.FontRendererFactory.create(this, SEAC_ANALYSIS_ENABLED); 35274 35275 return (0, _util.shadow)(this, 'renderer', renderer); 35276 }, 35277 35278 exportData: function Font_exportData() { 35279 var data = {}; 35280 35281 for (var i in this) { 35282 if (this.hasOwnProperty(i)) { 35283 data[i] = this[i]; 35284 } 35285 } 35286 35287 return data; 35288 }, 35289 fallbackToSystemFont: function Font_fallbackToSystemFont() { 35290 var _this = this; 35291 35292 this.missingFile = true; 35293 var charCode, unicode; 35294 var name = this.name; 35295 var type = this.type; 35296 var subtype = this.subtype; 35297 var fontName = name.replace(/[,_]/g, '-'); 35298 var stdFontMap = (0, _standard_fonts.getStdFontMap)(), 35299 nonStdFontMap = (0, _standard_fonts.getNonStdFontMap)(); 35300 var isStandardFont = !!stdFontMap[fontName] || !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]); 35301 fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName; 35302 this.bold = fontName.search(/bold/gi) !== -1; 35303 this.italic = fontName.search(/oblique/gi) !== -1 || fontName.search(/italic/gi) !== -1; 35304 this.black = name.search(/Black/g) !== -1; 35305 this.remeasure = Object.keys(this.widths).length > 0; 35306 35307 if (isStandardFont && type === 'CIDFontType2' && this.cidEncoding.startsWith('Identity-')) { 35308 var GlyphMapForStandardFonts = (0, _standard_fonts.getGlyphMapForStandardFonts)(); 35309 var map = []; 35310 35311 for (charCode in GlyphMapForStandardFonts) { 35312 map[+charCode] = GlyphMapForStandardFonts[charCode]; 35313 } 35314 35315 if (/Arial-?Black/i.test(name)) { 35316 var SupplementalGlyphMapForArialBlack = (0, _standard_fonts.getSupplementalGlyphMapForArialBlack)(); 35317 35318 for (charCode in SupplementalGlyphMapForArialBlack) { 35319 map[+charCode] = SupplementalGlyphMapForArialBlack[charCode]; 35320 } 35321 } else if (/Calibri/i.test(name)) { 35322 var SupplementalGlyphMapForCalibri = (0, _standard_fonts.getSupplementalGlyphMapForCalibri)(); 35323 35324 for (charCode in SupplementalGlyphMapForCalibri) { 35325 map[+charCode] = SupplementalGlyphMapForCalibri[charCode]; 35326 } 35327 } 35328 35329 var isIdentityUnicode = this.toUnicode instanceof IdentityToUnicodeMap; 35330 35331 if (!isIdentityUnicode) { 35332 this.toUnicode.forEach(function (charCode, unicodeCharCode) { 35333 map[+charCode] = unicodeCharCode; 35334 }); 35335 } 35336 35337 this.toFontChar = map; 35338 this.toUnicode = new ToUnicodeMap(map); 35339 } else if (/Symbol/i.test(fontName)) { 35340 this.toFontChar = buildToFontChar(_encodings.SymbolSetEncoding, (0, _glyphlist.getGlyphsUnicode)(), this.differences); 35341 } else if (/Dingbats/i.test(fontName)) { 35342 if (/Wingdings/i.test(name)) { 35343 (0, _util.warn)('Non-embedded Wingdings font, falling back to ZapfDingbats.'); 35344 } 35345 35346 this.toFontChar = buildToFontChar(_encodings.ZapfDingbatsEncoding, (0, _glyphlist.getDingbatsGlyphsUnicode)(), this.differences); 35347 } else if (isStandardFont) { 35348 this.toFontChar = buildToFontChar(this.defaultEncoding, (0, _glyphlist.getGlyphsUnicode)(), this.differences); 35349 } else { 35350 var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 35351 this.toUnicode.forEach(function (charCode, unicodeCharCode) { 35352 if (!_this.composite) { 35353 var glyphName = _this.differences[charCode] || _this.defaultEncoding[charCode]; 35354 unicode = (0, _unicode.getUnicodeForGlyph)(glyphName, glyphsUnicodeMap); 35355 35356 if (unicode !== -1) { 35357 unicodeCharCode = unicode; 35358 } 35359 } 35360 35361 _this.toFontChar[charCode] = unicodeCharCode; 35362 }); 35363 } 35364 35365 this.loadedName = fontName.split('-')[0]; 35366 this.fontType = getFontType(type, subtype); 35367 }, 35368 checkAndRepair: function Font_checkAndRepair(name, font, properties) { 35369 var VALID_TABLES = ['OS/2', 'cmap', 'head', 'hhea', 'hmtx', 'maxp', 'name', 'post', 'loca', 'glyf', 'fpgm', 'prep', 'cvt ', 'CFF ']; 35370 35371 function readTables(file, numTables) { 35372 var tables = Object.create(null);
35373 tables['OS/2'] = null; 35374 tables['cmap'] = null; 35375 tables['head'] = null; 35376 tables['hhea'] = null; 35377 tables['hmtx'] = null; 35378 tables['maxp'] = null; 35379 tables['name'] = null; 35380 tables['post'] = null; 35381 35382 for (var i = 0; i < numTables; i++) { 35383 var table = readTableEntry(font); 35384 35385 if (!VALID_TABLES.includes(table.tag)) { 35386 continue; 35387 } 35388 35389 if (table.length === 0) { 35390 continue; 35391 } 35392 35393 tables[table.tag] = table; 35394 } 35395 35396 return tables; 35397 } 35398 35399 function readTableEntry(file) { 35400 var tag = (0, _util.bytesToString)(file.getBytes(4)); 35401 var checksum = file.getInt32() >>> 0; 35402 var offset = file.getInt32() >>> 0; 35403 var length = file.getInt32() >>> 0; 35404 var previousPosition = file.pos; 35405 file.pos = file.start ? file.start : 0; 35406 file.skip(offset); 35407 var data = file.getBytes(length); 35408 file.pos = previousPosition; 35409 35410 if (tag === 'head') { 35411 data[8] = data[9] = data[10] = data[11] = 0; 35412 data[17] |= 0x20; 35413 } 35414 35415 return { 35416 tag: tag, 35417 checksum: checksum, 35418 length: length, 35419 offset: offset, 35420 data: data 35421 }; 35422 } 35423 35424 function readOpenTypeHeader(ttf) { 35425 return { 35426 version: (0, _util.bytesToString)(ttf.getBytes(4)), 35427 numTables: ttf.getUint16(), 35428 searchRange: ttf.getUint16(), 35429 entrySelector: ttf.getUint16(), 35430 rangeShift: ttf.getUint16() 35431 }; 35432 } 35433 35434 function readTrueTypeCollectionHeader(ttc) { 35435 var ttcTag = (0, _util.bytesToString)(ttc.getBytes(4)); 35436 (0, _util.assert)(ttcTag === 'ttcf', 'Must be a TrueType Collection font.'); 35437 var majorVersion = ttc.getUint16(); 35438 var minorVersion = ttc.getUint16(); 35439 var numFonts = ttc.getInt32() >>> 0; 35440 var offsetTable = []; 35441 35442 for (var i = 0; i < numFonts; i++) { 35443 offsetTable.push(ttc.getInt32() >>> 0); 35444 } 35445 35446 var header = { 35447 ttcTag: ttcTag, 35448 majorVersion: majorVersion, 35449 minorVersion: minorVersion, 35450 numFonts: numFonts, 35451 offsetTable: offsetTable 35452 }; 35453 35454 switch (majorVersion) { 35455 case 1: 35456 return header; 35457 35458 case 2: 35459 header.dsigTag = ttc.getInt32() >>> 0; 35460 header.dsigLength = ttc.getInt32() >>> 0; 35461 header.dsigOffset = ttc.getInt32() >>> 0; 35462 return header; 35463 } 35464 35465 throw new _util.FormatError("Invalid TrueType Collection majorVersion: ".concat(majorVersion, ".")); 35466 } 35467 35468 function readTrueTypeCollectionData(ttc, fontName) { 35469 var _readTrueTypeCollecti = readTrueTypeCollectionHeader(ttc), 35470 numFonts = _readTrueTypeCollecti.numFonts, 35471 offsetTable = _readTrueTypeCollecti.offsetTable; 35472 35473 for (var i = 0; i < numFonts; i++) { 35474 ttc.pos = (ttc.start || 0) + offsetTable[i]; 35475 var potentialHeader = readOpenTypeHeader(ttc); 35476 var potentialTables = readTables(ttc, potentialHeader.numTables); 35477 35478 if (!potentialTables['name']) { 35479 throw new _util.FormatError('TrueType Collection font must contain a "name" table.'); 35480 } 35481 35482 var nameTable = readNameTable(potentialTables['name']); 35483 35484 for (var j = 0, jj = nameTable.length; j < jj; j++) { 35485 for (var k = 0, kk = nameTable[j].length; k < kk; k++) { 35486 var nameEntry = nameTable[j][k]; 35487 35488 if (nameEntry && nameEntry.replace(/\s/g, '') === fontName) { 35489 return { 35490 header: potentialHeader, 35491 tables: potentialTables 35492 }; 35493 } 35494 } 35495 } 35496 } 35497 35498 throw new _util.FormatError("TrueType Collection does not contain \"".concat(fontName, "\" font.")); 35499 } 35500 35501 function readCmapTable(cmap, font, isSymbolicFont, hasEncoding) { 35502 if (!cmap) { 35503 (0, _util.warn)('No cmap table available.'); 35504 return { 35505 platformId: -1, 35506 encodingId: -1, 35507 mappings: [], 35508 hasShortCmap: false 35509 }; 35510 } 35511 35512 var segment; 35513 var start = (font.start ? font.start : 0) + cmap.offset; 35514 font.pos = start; 35515 font.getUint16(); 35516 var numTables = font.getUint16(); 35517 var potentialTable; 35518 var canBreak = false; 35519 35520 for (var i = 0; i < numTables; i++) { 35521 var platformId = font.getUint16(); 35522 var encodingId = font.getUint16(); 35523 var offset = font.getInt32() >>> 0; 35524 var useTable = false; 35525 35526 if (potentialTable && potentialTable.platformId === platformId && potentialTable.encodingId === encodingId) { 35527 continue; 35528 } 35529 35530 if (platformId === 0 && encodingId === 0) { 35531 useTable = true; 35532 } else if (platformId === 1 && encodingId === 0) { 35533 useTable = true; 35534 } else if (platformId === 3 && encodingId === 1 && (hasEncoding || !potentialTable)) { 35535 useTable = true; 35536 35537 if (!isSymbolicFont) { 35538 canBreak = true; 35539 } 35540 } else if (isSymbolicFont && platformId === 3 && encodingId === 0) { 35541 useTable = true; 35542 canBreak = true; 35543 } 35544 35545 if (useTable) { 35546 potentialTable = { 35547 platformId: platformId, 35548 encodingId: encodingId, 35549 offset: offset 35550 }; 35551 } 35552 35553 if (canBreak) { 35554 break; 35555 } 35556 } 35557 35558 if (potentialTable) { 35559 font.pos = start + potentialTable.offset; 35560 } 35561 35562 if (!potentialTable || font.peekByte() === -1) { 35563 (0, _util.warn)('Could not find a preferred cmap table.'); 35564 return { 35565 platformId: -1, 35566 encodingId: -1, 35567 mappings: [], 35568 hasShortCmap: false 35569 }; 35570 } 35571 35572 var format = font.getUint16(); 35573 font.getUint16(); 35574 font.getUint16(); 35575 var hasShortCmap = false; 35576 var mappings = []; 35577 var j, glyphId; 35578 35579 if (format === 0) { 35580 for (j = 0; j < 256; j++) { 35581 var index = font.getByte(); 35582 35583 if (!index) { 35584 continue; 35585 } 35586 35587 mappings.push({
35588 charCode: j, 35589 glyphId: index 35590 }); 35591 } 35592 35593 hasShortCmap = true; 35594 } else if (format === 4) { 35595 var segCount = font.getUint16() >> 1; 35596 font.getBytes(6); 35597 var segIndex, 35598 segments = []; 35599 35600 for (segIndex = 0; segIndex < segCount; segIndex++) { 35601 segments.push({ 35602 end: font.getUint16() 35603 }); 35604 } 35605 35606 font.getUint16(); 35607 35608 for (segIndex = 0; segIndex < segCount; segIndex++) { 35609 segments[segIndex].start = font.getUint16(); 35610 } 35611 35612 for (segIndex = 0; segIndex < segCount; segIndex++) { 35613 segments[segIndex].delta = font.getUint16(); 35614 } 35615 35616 var offsetsCount = 0; 35617 35618 for (segIndex = 0; segIndex < segCount; segIndex++) { 35619 segment = segments[segIndex]; 35620 var rangeOffset = font.getUint16(); 35621 35622 if (!rangeOffset) { 35623 segment.offsetIndex = -1; 35624 continue; 35625 } 35626 35627 var offsetIndex = (rangeOffset >> 1) - (segCount - segIndex); 35628 segment.offsetIndex = offsetIndex; 35629 offsetsCount = Math.max(offsetsCount, offsetIndex + segment.end - segment.start + 1); 35630 } 35631 35632 var offsets = []; 35633 35634 for (j = 0; j < offsetsCount; j++) { 35635 offsets.push(font.getUint16()); 35636 } 35637 35638 for (segIndex = 0; segIndex < segCount; segIndex++) { 35639 segment = segments[segIndex]; 35640 start = segment.start; 35641 var end = segment.end; 35642 var delta = segment.delta; 35643 offsetIndex = segment.offsetIndex; 35644 35645 for (j = start; j <= end; j++) { 35646 if (j === 0xFFFF) { 35647 continue; 35648 } 35649 35650 glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start]; 35651 glyphId = glyphId + delta & 0xFFFF; 35652 mappings.push({ 35653 charCode: j, 35654 glyphId: glyphId 35655 }); 35656 } 35657 } 35658 } else if (format === 6) { 35659 var firstCode = font.getUint16(); 35660 var entryCount = font.getUint16(); 35661 35662 for (j = 0; j < entryCount; j++) { 35663 glyphId = font.getUint16(); 35664 var charCode = firstCode + j; 35665 mappings.push({ 35666 charCode: charCode, 35667 glyphId: glyphId 35668 }); 35669 } 35670 } else { 35671 (0, _util.warn)('cmap table has unsupported format: ' + format); 35672 return { 35673 platformId: -1, 35674 encodingId: -1, 35675 mappings: [], 35676 hasShortCmap: false 35677 }; 35678 } 35679 35680 mappings.sort(function (a, b) { 35681 return a.charCode - b.charCode; 35682 }); 35683 35684 for (i = 1; i < mappings.length; i++) { 35685 if (mappings[i - 1].charCode === mappings[i].charCode) { 35686 mappings.splice(i, 1); 35687 i--; 35688 } 35689 } 35690 35691 return { 35692 platformId: potentialTable.platformId, 35693 encodingId: potentialTable.encodingId, 35694 mappings: mappings, 35695 hasShortCmap: hasShortCmap 35696 }; 35697 } 35698 35699 function sanitizeMetrics(font, header, metrics, numGlyphs) { 35700 if (!header) { 35701 if (metrics) { 35702 metrics.data = null; 35703 } 35704 35705 return; 35706 } 35707 35708 font.pos = (font.start ? font.start : 0) + header.offset; 35709 font.pos += 4; 35710 font.pos += 2; 35711 font.pos += 2; 35712 font.pos += 2; 35713 font.pos += 2; 35714 font.pos += 2; 35715 font.pos += 2; 35716 font.pos += 2; 35717 font.pos += 2; 35718 font.pos += 2; 35719 font.pos += 2; 35720 font.pos += 8; 35721 font.pos += 2; 35722 var numOfMetrics = font.getUint16(); 35723 35724 if (numOfMetrics > numGlyphs) { 35725 (0, _util.info)('The numOfMetrics (' + numOfMetrics + ') should not be ' + 'greater than the numGlyphs (' + numGlyphs + ')'); 35726 numOfMetrics = numGlyphs; 35727 header.data[34] = (numOfMetrics & 0xff00) >> 8; 35728 header.data[35] = numOfMetrics & 0x00ff; 35729 } 35730 35731 var numOfSidebearings = numGlyphs - numOfMetrics; 35732 var numMissing = numOfSidebearings - (metrics.length - numOfMetrics * 4 >> 1); 35733 35734 if (numMissing > 0) { 35735 var entries = new Uint8Array(metrics.length + numMissing * 2);
35736 entries.set(metrics.data); 35737 metrics.data = entries; 35738 } 35739 } 35740 35741 function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, hintsValid) { 35742 var glyphProfile = { 35743 length: 0, 35744 sizeOfInstructions: 0 35745 }; 35746 35747 if (sourceEnd - sourceStart <= 12) { 35748 return glyphProfile; 35749 } 35750 35751 var glyf = source.subarray(sourceStart, sourceEnd); 35752 var contoursCount = signedInt16(glyf[0], glyf[1]); 35753 35754 if (contoursCount < 0) { 35755 contoursCount = -1; 35756 writeSignedInt16(glyf, 0, contoursCount); 35757 dest.set(glyf, destStart); 35758 glyphProfile.length = glyf.length; 35759 return glyphProfile; 35760 } 35761 35762 var i, 35763 j = 10, 35764 flagsCount = 0; 35765 35766 for (i = 0; i < contoursCount; i++) { 35767 var endPoint = glyf[j] << 8 | glyf[j + 1]; 35768 flagsCount = endPoint + 1; 35769 j += 2; 35770 } 35771 35772 var instructionsStart = j; 35773 var instructionsLength = glyf[j] << 8 | glyf[j + 1]; 35774 glyphProfile.sizeOfInstructions = instructionsLength; 35775 j += 2 + instructionsLength; 35776 var instructionsEnd = j; 35777 var coordinatesLength = 0; 35778 35779 for (i = 0; i < flagsCount; i++) { 35780 var flag = glyf[j++]; 35781 35782 if (flag & 0xC0) { 35783 glyf[j - 1] = flag & 0x3F; 35784 } 35785 35786 var xyLength = (flag & 2 ? 1 : flag & 16 ? 0 : 2) + (flag & 4 ? 1 : flag & 32 ? 0 : 2); 35787 coordinatesLength += xyLength; 35788 35789 if (flag & 8) { 35790 var repeat = glyf[j++]; 35791 i += repeat; 35792 coordinatesLength += repeat * xyLength; 35793 } 35794 } 35795 35796 if (coordinatesLength === 0) { 35797 return glyphProfile; 35798 } 35799 35800 var glyphDataLength = j + coordinatesLength; 35801 35802 if (glyphDataLength > glyf.length) { 35803 return glyphProfile; 35804 } 35805 35806 if (!hintsValid && instructionsLength > 0) { 35807 dest.set(glyf.subarray(0, instructionsStart), destStart); 35808 dest.set([0, 0], destStart + instructionsStart); 35809 dest.set(glyf.subarray(instructionsEnd, glyphDataLength), destStart + instructionsStart + 2); 35810 glyphDataLength -= instructionsLength; 35811 35812 if (glyf.length - glyphDataLength > 3) { 35813 glyphDataLength = glyphDataLength + 3 & ~3; 35814 } 35815 35816 glyphProfile.length = glyphDataLength; 35817 return glyphProfile; 35818 } 35819 35820 if (glyf.length - glyphDataLength > 3) { 35821 glyphDataLength = glyphDataLength + 3 & ~3; 35822 dest.set(glyf.subarray(0, glyphDataLength), destStart); 35823 glyphProfile.length = glyphDataLength; 35824 return glyphProfile; 35825 } 35826 35827 dest.set(glyf, destStart); 35828 glyphProfile.length = glyf.length; 35829 return glyphProfile; 35830 } 35831 35832 function sanitizeHead(head, numGlyphs, locaLength) { 35833 var data = head.data; 35834 var version = int32(data[0], data[1], data[2], data[3]); 35835 35836 if (version >> 16 !== 1) { 35837 (0, _util.info)('Attempting to fix invalid version in head table: ' + version); 35838 data[0] = 0; 35839 data[1] = 1; 35840 data[2] = 0; 35841 data[3] = 0; 35842 } 35843 35844 var indexToLocFormat = int16(data[50], data[51]); 35845 35846 if (indexToLocFormat < 0 || indexToLocFormat > 1) { 35847 (0, _util.info)('Attempting to fix invalid indexToLocFormat in head table: ' + indexToLocFormat); 35848 var numGlyphsPlusOne = numGlyphs + 1; 35849 35850 if (locaLength === numGlyphsPlusOne << 1) { 35851 data[50] = 0; 35852 data[51] = 0; 35853 } else if (locaLength === numGlyphsPlusOne << 2) { 35854 data[50] = 0; 35855 data[51] = 1; 35856 } else { 35857 throw new _util.FormatError('Could not fix indexToLocFormat: ' + indexToLocFormat); 35858 } 35859 } 35860 } 35861 35862 function sanitizeGlyphLocations(loca, glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions) { 35863 var itemSize, itemDecode, itemEncode; 35864 35865 if (isGlyphLocationsLong) { 35866 itemSize = 4; 35867 35868 itemDecode = function fontItemDecodeLong(data, offset) { 35869 return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; 35870 }; 35871 35872 itemEncode = function fontItemEncodeLong(data, offset, value) { 35873 data[offset] = value >>> 24 & 0xFF; 35874 data[offset + 1] = value >> 16 & 0xFF; 35875 data[offset + 2] = value >> 8 & 0xFF; 35876 data[offset + 3] = value & 0xFF; 35877 }; 35878 } else { 35879 itemSize = 2; 35880 35881 itemDecode = function fontItemDecode(data, offset) { 35882 return data[offset] << 9 | data[offset + 1] << 1; 35883 }; 35884 35885 itemEncode = function fontItemEncode(data, offset, value) { 35886 data[offset] = value >> 9 & 0xFF; 35887 data[offset + 1] = value >> 1 & 0xFF; 35888 }; 35889 } 35890 35891 var numGlyphsOut = dupFirstEntry ? numGlyphs + 1 : numGlyphs; 35892 var locaData = loca.data; 35893 var locaDataSize = itemSize * (1 + numGlyphsOut); 35894 locaData = new Uint8Array(locaDataSize); 35895 locaData.set(loca.data.subarray(0, locaDataSize)); 35896 loca.data = locaData; 35897 var oldGlyfData = glyf.data; 35898 var oldGlyfDataLength = oldGlyfData.length; 35899 var newGlyfData = new Uint8Array(oldGlyfDataLength); 35900 var startOffset = itemDecode(locaData, 0); 35901 var writeOffset = 0; 35902 var missingGlyphs = Object.create(null); 35903 itemEncode(locaData, 0, writeOffset); 35904 var i, j; 35905 35906 for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { 35907 var endOffset = itemDecode(locaData, j); 35908 35909 if (endOffset === 0) { 35910 endOffset = startOffset; 35911 } 35912 35913 if (endOffset > oldGlyfDataLength && (oldGlyfDataLength + 3 & ~3) === endOffset) { 35914 endOffset = oldGlyfDataLength; 35915 } 35916 35917 if (endOffset > oldGlyfDataLength) { 35918 startOffset = endOffset; 35919 } 35920 35921 var glyphProfile = sanitizeGlyph(oldGlyfData, startOffset, endOffset, newGlyfData, writeOffset, hintsValid); 35922 var newLength = glyphProfile.length; 35923 35924 if (newLength === 0) { 35925 missingGlyphs[i] = true; 35926 } 35927
vendor: 8,534 bytes, lines 35928-36198
35928 if (glyphProfile.sizeOfInstructions > maxSizeOfInstructions) { 35929 maxSizeOfInstructions = glyphProfile.sizeOfInstructions; 35930 } 35931 35932 writeOffset += newLength; 35933 itemEncode(locaData, j, writeOffset); 35934 startOffset = endOffset; 35935 } 35936 35937 if (writeOffset === 0) { 35938 var simpleGlyph = new Uint8Array([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]); 35939 35940 for (i = 0, j = itemSize; i < numGlyphsOut; i++, j += itemSize) { 35941 itemEncode(locaData, j, simpleGlyph.length); 35942 } 35943 35944 glyf.data = simpleGlyph; 35945 } else if (dupFirstEntry) { 35946 var firstEntryLength = itemDecode(locaData, itemSize); 35947 35948 if (newGlyfData.length > firstEntryLength + writeOffset) { 35949 glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); 35950 } else { 35951 glyf.data = new Uint8Array(firstEntryLength + writeOffset); 35952 glyf.data.set(newGlyfData.subarray(0, writeOffset)); 35953 } 35954 35955 glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset); 35956 itemEncode(loca.data, locaData.length - itemSize, writeOffset + firstEntryLength); 35957 } else { 35958 glyf.data = newGlyfData.subarray(0, writeOffset); 35959 } 35960 35961 return { 35962 missingGlyphs: missingGlyphs, 35963 maxSizeOfInstructions: maxSizeOfInstructions 35964 }; 35965 } 35966 35967 function readPostScriptTable(post, properties, maxpNumGlyphs) { 35968 var start = (font.start ? font.start : 0) + post.offset; 35969 font.pos = start; 35970 var length = post.length, 35971 end = start + length; 35972 var version = font.getInt32(); 35973 font.getBytes(28); 35974 var glyphNames; 35975 var valid = true; 35976 var i; 35977 35978 switch (version) { 35979 case 0x00010000: 35980 glyphNames = MacStandardGlyphOrdering; 35981 break; 35982 35983 case 0x00020000: 35984 var numGlyphs = font.getUint16(); 35985 35986 if (numGlyphs !== maxpNumGlyphs) { 35987 valid = false; 35988 break; 35989 } 35990 35991 var glyphNameIndexes = []; 35992 35993 for (i = 0; i < numGlyphs; ++i) { 35994 var index = font.getUint16(); 35995 35996 if (index >= 32768) { 35997 valid = false; 35998 break; 35999 } 36000 36001 glyphNameIndexes.push(index); 36002 } 36003 36004 if (!valid) { 36005 break; 36006 } 36007 36008 var customNames = []; 36009 var strBuf = []; 36010 36011 while (font.pos < end) { 36012 var stringLength = font.getByte(); 36013 strBuf.length = stringLength; 36014 36015 for (i = 0; i < stringLength; ++i) { 36016 strBuf[i] = String.fromCharCode(font.getByte()); 36017 } 36018 36019 customNames.push(strBuf.join('')); 36020 } 36021 36022 glyphNames = []; 36023 36024 for (i = 0; i < numGlyphs; ++i) { 36025 var j = glyphNameIndexes[i]; 36026 36027 if (j < 258) { 36028 glyphNames.push(MacStandardGlyphOrdering[j]); 36029 continue; 36030 } 36031 36032 glyphNames.push(customNames[j - 258]); 36033 } 36034 36035 break; 36036 36037 case 0x00030000: 36038 break; 36039 36040 default: 36041 (0, _util.warn)('Unknown/unsupported post table version ' + version); 36042 valid = false; 36043 36044 if (properties.defaultEncoding) { 36045 glyphNames = properties.defaultEncoding; 36046 } 36047 36048 break; 36049 } 36050 36051 properties.glyphNames = glyphNames; 36052 return valid; 36053 } 36054 36055 function readNameTable(nameTable) { 36056 var start = (font.start ? font.start : 0) + nameTable.offset; 36057 font.pos = start; 36058 var names = [[], []]; 36059 var length = nameTable.length, 36060 end = start + length; 36061 var format = font.getUint16(); 36062 var FORMAT_0_HEADER_LENGTH = 6; 36063 36064 if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) { 36065 return names; 36066 } 36067 36068 var numRecords = font.getUint16(); 36069 var stringsStart = font.getUint16(); 36070 var records = []; 36071 var NAME_RECORD_LENGTH = 12; 36072 var i, ii; 36073 36074 for (i = 0; i < numRecords && font.pos + NAME_RECORD_LENGTH <= end; i++) { 36075 var r = { 36076 platform: font.getUint16(), 36077 encoding: font.getUint16(), 36078 language: font.getUint16(), 36079 name: font.getUint16(), 36080 length: font.getUint16(), 36081 offset: font.getUint16() 36082 }; 36083 36084 if (r.platform === 1 && r.encoding === 0 && r.language === 0 || r.platform === 3 && r.encoding === 1 && r.language === 0x409) { 36085 records.push(r); 36086 } 36087 } 36088 36089 for (i = 0, ii = records.length; i < ii; i++) { 36090 var record = records[i]; 36091 36092 if (record.length <= 0) { 36093 continue; 36094 } 36095 36096 var pos = start + stringsStart + record.offset; 36097 36098 if (pos + record.length > end) { 36099 continue; 36100 } 36101 36102 font.pos = pos; 36103 var nameIndex = record.name; 36104 36105 if (record.encoding) { 36106 var str = ''; 36107 36108 for (var j = 0, jj = record.length; j < jj; j += 2) { 36109 str += String.fromCharCode(font.getUint16()); 36110 } 36111 36112 names[1][nameIndex] = str; 36113 } else { 36114 names[0][nameIndex] = (0, _util.bytesToString)(font.getBytes(record.length)); 36115 } 36116 } 36117 36118 return names; 36119 } 36120 36121 var TTOpsStackDeltas = [0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2]; 36122 36123 function sanitizeTTProgram(table, ttContext) { 36124 var data = table.data; 36125 var i = 0, 36126 j, 36127 n, 36128 b, 36129 funcId, 36130 pc, 36131 lastEndf = 0, 36132 lastDeff = 0; 36133 var stack = []; 36134 var callstack = []; 36135 var functionsCalled = []; 36136 var tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions; 36137 var inFDEF = false, 36138 ifLevel = 0, 36139 inELSE = 0; 36140 36141 for (var ii = data.length; i < ii;) { 36142 var op = data[i++]; 36143 36144 if (op === 0x40) { 36145 n = data[i++]; 36146 36147 if (inFDEF || inELSE) { 36148 i += n; 36149 } else { 36150 for (j = 0; j < n; j++) { 36151 stack.push(data[i++]); 36152 } 36153 } 36154 } else if (op === 0x41) { 36155 n = data[i++]; 36156 36157 if (inFDEF || inELSE) { 36158 i += n * 2; 36159 } else { 36160 for (j = 0; j < n; j++) { 36161 b = data[i++]; 36162 stack.push(b << 8 | data[i++]); 36163 } 36164 } 36165 } else if ((op & 0xF8) === 0xB0) { 36166 n = op - 0xB0 + 1; 36167 36168 if (inFDEF || inELSE) { 36169 i += n; 36170 } else { 36171 for (j = 0; j < n; j++) { 36172 stack.push(data[i++]); 36173 } 36174 } 36175 } else if ((op & 0xF8) === 0xB8) { 36176 n = op - 0xB8 + 1; 36177 36178 if (inFDEF || inELSE) { 36179 i += n * 2; 36180 } else { 36181 for (j = 0; j < n; j++) { 36182 b = data[i++]; 36183 stack.push(b << 8 | data[i++]); 36184 } 36185 } 36186 } else if (op === 0x2B && !tooComplexToFollowFunctions) { 36187 if (!inFDEF && !inELSE) { 36188 funcId = stack[stack.length - 1]; 36189 36190 if (isNaN(funcId)) { 36191 (0, _util.info)('TT: CALL empty stack (or invalid entry).'); 36192 } else { 36193 ttContext.functionsUsed[funcId] = true; 36194 36195 if (funcId in ttContext.functionsStackDeltas) { 36196 var newStackLength = stack.length + ttContext.functionsStackDeltas[funcId]; 36197 36198 if (newStackLength < 0) {
36199 (0, _util.warn)('TT: CALL invalid functions stack delta.'); 36200 ttContext.hintsValid = false; 36201 return; 36202 } 36203 36204 stack.length = newStackLength; 36205 } else if (funcId in ttContext.functionsDefined && !functionsCalled.includes(funcId)) { 36206 callstack.push({ 36207 data: data, 36208 i: i, 36209 stackTop: stack.length - 1 36210 }); 36211 functionsCalled.push(funcId); 36212 pc = ttContext.functionsDefined[funcId]; 36213 36214 if (!pc) { 36215 (0, _util.warn)('TT: CALL non-existent function'); 36216 ttContext.hintsValid = false; 36217 return; 36218 } 36219 36220 data = pc.data; 36221 i = pc.i; 36222 } 36223 } 36224 } 36225 } else if (op === 0x2C && !tooComplexToFollowFunctions) { 36226 if (inFDEF || inELSE) { 36227 (0, _util.warn)('TT: nested FDEFs not allowed'); 36228 tooComplexToFollowFunctions = true; 36229 } 36230 36231 inFDEF = true; 36232 lastDeff = i; 36233 funcId = stack.pop(); 36234 ttContext.functionsDefined[funcId] = { 36235 data: data, 36236 i: i 36237 }; 36238 } else if (op === 0x2D) { 36239 if (inFDEF) { 36240 inFDEF = false; 36241 lastEndf = i; 36242 } else { 36243 pc = callstack.pop(); 36244 36245 if (!pc) { 36246 (0, _util.warn)('TT: ENDF bad stack'); 36247 ttContext.hintsValid = false; 36248 return; 36249 } 36250 36251 funcId = functionsCalled.pop(); 36252 data = pc.data; 36253 i = pc.i; 36254 ttContext.functionsStackDeltas[funcId] = stack.length - pc.stackTop; 36255 } 36256 } else if (op === 0x89) { 36257 if (inFDEF || inELSE) { 36258 (0, _util.warn)('TT: nested IDEFs not allowed'); 36259 tooComplexToFollowFunctions = true; 36260 } 36261 36262 inFDEF = true; 36263 lastDeff = i; 36264 } else if (op === 0x58) { 36265 ++ifLevel; 36266 } else if (op === 0x1B) { 36267 inELSE = ifLevel; 36268 } else if (op === 0x59) { 36269 if (inELSE === ifLevel) { 36270 inELSE = 0; 36271 } 36272 36273 --ifLevel; 36274 } else if (op === 0x1C) { 36275 if (!inFDEF && !inELSE) { 36276 var offset = stack[stack.length - 1]; 36277 36278 if (offset > 0) { 36279 i += offset - 1; 36280 } 36281 } 36282 } 36283 36284 if (!inFDEF && !inELSE) { 36285 var stackDelta = op <= 0x8E ? TTOpsStackDeltas[op] : op >= 0xC0 && op <= 0xDF ? -1 : op >= 0xE0 ? -2 : 0; 36286 36287 if (op >= 0x71 && op <= 0x75) { 36288 n = stack.pop(); 36289 36290 if (!isNaN(n)) { 36291 stackDelta = -n * 2; 36292 } 36293 } 36294 36295 while (stackDelta < 0 && stack.length > 0) { 36296 stack.pop(); 36297 stackDelta++; 36298 } 36299 36300 while (stackDelta > 0) { 36301 stack.push(NaN); 36302 stackDelta--; 36303 } 36304 } 36305 } 36306 36307 ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; 36308 var content = [data]; 36309 36310 if (i > data.length) { 36311 content.push(new Uint8Array(i - data.length)); 36312 } 36313 36314 if (lastDeff > lastEndf) { 36315 (0, _util.warn)('TT: complementing a missing function tail'); 36316 content.push(new Uint8Array([0x22, 0x2D])); 36317 } 36318 36319 foldTTTable(table, content); 36320 } 36321 36322 function checkInvalidFunctions(ttContext, maxFunctionDefs) { 36323 if (ttContext.tooComplexToFollowFunctions) { 36324 return; 36325 } 36326 36327 if (ttContext.functionsDefined.length > maxFunctionDefs) { 36328 (0, _util.warn)('TT: more functions defined than expected'); 36329 ttContext.hintsValid = false; 36330 return; 36331 } 36332 36333 for (var j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { 36334 if (j > maxFunctionDefs) { 36335 (0, _util.warn)('TT: invalid function id: ' + j); 36336 ttContext.hintsValid = false; 36337 return; 36338 } 36339 36340 if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) { 36341 (0, _util.warn)('TT: undefined function: ' + j); 36342 ttContext.hintsValid = false; 36343 return; 36344 } 36345 } 36346 } 36347 36348 function foldTTTable(table, content) { 36349 if (content.length > 1) { 36350 var newLength = 0; 36351 var j, jj; 36352 36353 for (j = 0, jj = content.length; j < jj; j++) { 36354 newLength += content[j].length; 36355 } 36356 36357 newLength = newLength + 3 & ~3; 36358 var result = new Uint8Array(newLength); 36359 var pos = 0; 36360 36361 for (j = 0, jj = content.length; j < jj; j++) { 36362 result.set(content[j], pos); 36363 pos += content[j].length; 36364 } 36365 36366 table.data = result; 36367 table.length = newLength; 36368 } 36369 } 36370 36371 function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) { 36372 var ttContext = { 36373 functionsDefined: [], 36374 functionsUsed: [], 36375 functionsStackDeltas: [], 36376 tooComplexToFollowFunctions: false, 36377 hintsValid: true 36378 }; 36379 36380 if (fpgm) { 36381 sanitizeTTProgram(fpgm, ttContext); 36382 } 36383 36384 if (prep) { 36385 sanitizeTTProgram(prep, ttContext); 36386 } 36387 36388 if (fpgm) { 36389 checkInvalidFunctions(ttContext, maxFunctionDefs); 36390 } 36391 36392 if (cvt && cvt.length & 1) { 36393 var cvtData = new Uint8Array(cvt.length + 1); 36394 cvtData.set(cvt.data); 36395 cvt.data = cvtData; 36396 } 36397 36398 return ttContext.hintsValid; 36399 } 36400 36401 font = new _stream.Stream(new Uint8Array(font.getBytes())); 36402 var header, tables; 36403 36404 if (isTrueTypeCollectionFile(font)) { 36405 var ttcData = readTrueTypeCollectionData(font, this.name); 36406 header = ttcData.header; 36407 tables = ttcData.tables; 36408 } else { 36409 header = readOpenTypeHeader(font); 36410 tables = readTables(font, header.numTables); 36411 } 36412 36413 var cff, cffFile; 36414 var isTrueType = !tables['CFF ']; 36415 36416 if (!isTrueType) { 36417 var isComposite = properties.composite && ((properties.cidToGidMap || []).length > 0 || !(properties.cMap instanceof _cmap.IdentityCMap)); 36418 36419 if (header.version === 'OTTO' && !isComposite || !tables['head'] || !tables['hhea'] || !tables['maxp'] || !tables['post']) { 36420 cffFile = new _stream.Stream(tables['CFF '].data); 36421 cff = new CFFFont(cffFile, properties); 36422 adjustWidths(properties); 36423 return this.convert(name, cff, properties); 36424 } 36425 36426 delete tables['glyf']; 36427 delete tables['loca']; 36428 delete tables['fpgm']; 36429 delete tables['prep']; 36430 delete tables['cvt ']; 36431 this.isOpenType = true; 36432 } else { 36433 if (!tables['loca']) { 36434 throw new _util.FormatError('Required "loca" table is not found'); 36435 } 36436 36437 if (!tables['glyf']) { 36438 (0, _util.warn)('Required "glyf" table is not found -- trying to re
36438cover.'); 36439 tables['glyf'] = { 36440 tag: 'glyf', 36441 data: new Uint8Array(0) 36442 }; 36443 } 36444 36445 this.isOpenType = false; 36446 } 36447 36448 if (!tables['maxp']) { 36449 throw new _util.FormatError('Required "maxp" table is not found'); 36450 } 36451 36452 font.pos = (font.start || 0) + tables['maxp'].offset; 36453 var version = font.getInt32(); 36454 var numGlyphs = font.getUint16(); 36455 var numGlyphsOut = numGlyphs + 1; 36456 var dupFirstEntry = true; 36457 36458 if (numGlyphsOut > 0xFFFF) { 36459 dupFirstEntry = false; 36460 numGlyphsOut = numGlyphs; 36461 (0, _util.warn)('Not enough space in glyfs to duplicate first glyph.'); 36462 } 36463 36464 var maxFunctionDefs = 0; 36465 var maxSizeOfInstructions = 0; 36466 36467 if (version >= 0x00010000 && tables['maxp'].length >= 22) { 36468 font.pos += 8; 36469 var maxZones = font.getUint16(); 36470 36471 if (maxZones > 2) { 36472 tables['maxp'].data[14] = 0; 36473 tables['maxp'].data[15] = 2; 36474 } 36475 36476 font.pos += 4; 36477 maxFunctionDefs = font.getUint16(); 36478 font.pos += 4; 36479 maxSizeOfInstructions = font.getUint16(); 36480 } 36481 36482 tables['maxp'].data[4] = numGlyphsOut >> 8; 36483 tables['maxp'].data[5] = numGlyphsOut & 255; 36484 var hintsValid = sanitizeTTPrograms(tables['fpgm'], tables['prep'], tables['cvt '], maxFunctionDefs); 36485 36486 if (!hintsValid) { 36487 delete tables['fpgm']; 36488 delete tables['prep']; 36489 delete tables['cvt ']; 36490 } 36491 36492 sanitizeMetrics(font, tables['hhea'], tables['hmtx'], numGlyphsOut); 36493 36494 if (!tables['head']) { 36495 throw new _util.FormatError('Required "head" table is not found'); 36496 } 36497 36498 sanitizeHead(tables['head'], numGlyphs, isTrueType ? tables['loca'].length : 0); 36499 var missingGlyphs = Object.create(null); 36500 36501 if (isTrueType) { 36502 var isGlyphLocationsLong = int16(tables['head'].data[50], tables['head'].data[51]); 36503 var glyphsInfo = sanitizeGlyphLocations(tables['loca'], tables['glyf'], numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions); 36504 missingGlyphs = glyphsInfo.missingGlyphs; 36505 36506 if (version >= 0x00010000 && tables['maxp'].length >= 22) { 36507 tables['maxp'].data[26] = glyphsInfo.maxSizeOfInstructions >> 8; 36508 tables['maxp'].data[27] = glyphsInfo.maxSizeOfInstructions & 255; 36509 } 36510 } 36511 36512 if (!tables['hhea']) { 36513 throw new _util.FormatError('Required "hhea" table is not found'); 36514 } 36515 36516 if (tables['hhea'].data[10] === 0 && tables['hhea'].data[11] === 0) { 36517 tables['hhea'].data[10] = 0xFF; 36518 tables['hhea'].data[11] = 0xFF; 36519 } 36520 36521 var metricsOverride = { 36522 unitsPerEm: int16(tables['head'].data[18], tables['head'].data[19]), 36523 yMax: int16(tables['head'].data[42], tables['head'].data[43]), 36524 yMin: signedInt16(tables['head'].data[38], tables['head'].data[39]), 36525 ascent: int16(tables['hhea'].data[4], tables['hhea'].data[5]), 36526 descent: signedInt16(tables['hhea'].data[6], tables['hhea'].data[7]) 36527 }; 36528 this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm; 36529 this.descent = metricsOverride.descent / metricsOverride.unitsPerEm; 36530 36531 if (tables['post']) { 36532 readPostScriptTable(tables['post'], properties, numGlyphs); 36533 } 36534 36535 tables['post'] = { 36536 tag: 'post', 36537 data: createPostTable(properties) 36538 }; 36539 var charCodeToGlyphId = [], 36540 charCode; 36541 36542 function hasGlyph(glyphId) { 36543 return !missingGlyphs[glyphId]; 36544 } 36545 36546 if (properties.composite) { 36547 var cidToGidMap = properties.cidToGidMap || []; 36548 var isCidToGidMapEmpty = cidToGidMap.length === 0; 36549 properties.cMap.forEach(function (charCode, cid) { 36550 if (cid > 0xffff) { 36551 throw new _util.FormatError('Max size of CID is 65,535'); 36552 } 36553 36554 var glyphId = -1; 36555 36556 if (isCidToGidMapEmpty) { 36557 glyphId = cid; 36558 } else if (cidToGidMap[cid] !== undefined) { 36559 glyphId = cidToGidMap[cid]; 36560 } 36561 36562 if (glyphId >= 0 && glyphId < numGlyphs && hasGlyph(glyphId)) {
vendor: 1,099 bytes, lines 36563-36584
36563 charCodeToGlyphId[charCode] = glyphId; 36564 } 36565 }); 36566 } else { 36567 var cmapTable = readCmapTable(tables['cmap'], font, this.isSymbolicFont, properties.hasEncoding); 36568 var cmapPlatformId = cmapTable.platformId; 36569 var cmapEncodingId = cmapTable.encodingId; 36570 var cmapMappings = cmapTable.mappings; 36571 var cmapMappingsLength = cmapMappings.length; 36572 36573 if (properties.hasEncoding && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0) || cmapPlatformId === -1 && cmapEncodingId === -1 && !!(0, _encodings.getEncoding)(properties.baseEncodingName)) { 36574 var baseEncoding = []; 36575 36576 if (properties.baseEncodingName === 'MacRomanEncoding' || properties.baseEncodingName === 'WinAnsiEncoding') { 36577 baseEncoding = (0, _encodings.getEncoding)(properties.baseEncodingName); 36578 } 36579 36580 var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 36581 36582 for (charCode = 0; charCode < 256; charCode++) { 36583 var glyphName, standardGlyphName; 36584
36585 if (this.differences && charCode in this.differences) { 36586 glyphName = this.differences[charCode]; 36587 } else if (charCode in baseEncoding && baseEncoding[charCode] !== '') { 36588 glyphName = baseEncoding[charCode]; 36589 } else { 36590 glyphName = _encodings.StandardEncoding[charCode]; 36591 } 36592 36593 if (!glyphName) { 36594 continue; 36595 } 36596 36597 standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); 36598 var unicodeOrCharCode; 36599 36600 if (cmapPlatformId === 3 && cmapEncodingId === 1) { 36601 unicodeOrCharCode = glyphsUnicodeMap[standardGlyphName]; 36602 } else if (cmapPlatformId === 1 && cmapEncodingId === 0) { 36603 unicodeOrCharCode = _encodings.MacRomanEncoding.indexOf(standardGlyphName); 36604 } 36605 36606 var found = false; 36607 36608 for (var i = 0; i < cmapMappingsLength; ++i) { 36609 if (cmapMappings[i].charCode !== unicodeOrCharCode) { 36610 continue; 36611 } 36612 36613 charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; 36614 found = true; 36615 break; 36616 } 36617 36618 if (!found && properties.glyphNames) { 36619 var glyphId = properties.glyphNames.indexOf(glyphName); 36620 36621 if (glyphId === -1 && standardGlyphName !== glyphName) { 36622 glyphId = properties.glyphNames.indexOf(standardGlyphName); 36623 } 36624 36625 if (glyphId > 0 && hasGlyph(glyphId)) { 36626 charCodeToGlyphId[charCode] = glyphId; 36627 } 36628 } 36629 } 36630 } else if (cmapPlatformId === 0 && cmapEncodingId === 0) { 36631 for (var _i2 = 0; _i2 < cmapMappingsLength; ++_i2) { 36632 charCodeToGlyphId[cmapMappings[_i2].charCode] = cmapMappings[_i2].glyphId; 36633 } 36634 } else { 36635 for (var _i3 = 0; _i3 < cmapMappingsLength; ++_i3) { 36636 charCode = cmapMappings[_i3].charCode; 36637 36638 if (cmapPlatformId === 3 && charCode >= 0xF000 && charCode <= 0xF0FF) { 36639 charCode &= 0xFF; 36640 } 36641 36642 charCodeToGlyphId[charCode] = cmapMappings[_i3].glyphId; 36643 } 36644 } 36645 } 36646 36647 if (charCodeToGlyphId.length === 0) { 36648 charCodeToGlyphId[0] = 0; 36649 } 36650 36651 var glyphZeroId = numGlyphsOut - 1; 36652 36653 if (!dupFirstEntry) { 36654 glyphZeroId = 0; 36655 } 36656 36657 var newMapping = adjustMapping(charCodeToGlyphId, hasGlyph, glyphZeroId); 36658 this.toFontChar = newMapping.toFontChar; 36659 tables['cmap'] = { 36660 tag: 'cmap', 36661 data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphsOut) 36662 }; 36663 36664 if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) { 36665 tables['OS/2'] = { 36666 tag: 'OS/2', 36667 data: createOS2Table(properties, newMapping.charCodeToGlyphId, metricsOverride) 36668 }; 36669 } 36670 36671 if (!isTrueType) { 36672 try { 36673 cffFile = new _stream.Stream(tables['CFF '].data); 36674 var parser = new _cff_parser.CFFParser(cffFile, properties, SEAC_ANALYSIS_ENABLED); 36675 cff = parser.parse(); 36676 cff.duplicateFirstGlyph(); 36677 var compiler = new _cff_parser.CFFCompiler(cff); 36678 tables['CFF '].data = compiler.compile(); 36679 } catch (e) { 36680 (0, _util.warn)('Failed to compile font ' + properties.loadedName); 36681 } 36682 } 36683 36684 if (!tables['name']) { 36685 tables['name'] = { 36686 tag: 'name', 36687 data: createNameTable(this.name) 36688 }; 36689 } else { 36690 var namePrototype = readNameTable(tables['name']); 36691 tables['name'].data = createNameTable(name, namePrototype); 36692 } 36693 36694 var builder = new OpenTypeFileBuilder(header.version); 36695 36696 for (var tableTag in tables) { 36697 builder.addTable(tableTag, tables[tableTag].data); 36698 } 36699 36700 return builder.toArray(); 36701 }, 36702 convert: function Font_convert(fontName, font, properties) { 36703 properties.fixedPitch = false; 36704 36705 if (properties.builtInEncoding) { 36706 adjustToUnicode(properties, properties.builtInEncoding); 36707 } 36708 36709 var glyphZeroId = 1; 36710 36711 if (font instanceof CFFFont) { 36712 glyphZeroId = font.numGlyphs - 1; 36713 } 36714 36715 var mapping = font.getGlyphMapping(properties); 36716 var newMapping = adjustMapping(mapping, font.hasGlyphId.bind(font), glyphZeroId); 36717 this.toFontChar = newMapping.toFontChar; 36718 var numGlyphs = font.numGlyphs; 36719 36720 function getCharCodes(charCodeToGlyphId, glyphId) {
vendor: 5,730 bytes, lines 36721-36872
36721 var charCodes = null; 36722 36723 for (var charCode in charCodeToGlyphId) { 36724 if (glyphId === charCodeToGlyphId[charCode]) { 36725 if (!charCodes) { 36726 charCodes = []; 36727 } 36728 36729 charCodes.push(charCode | 0); 36730 } 36731 } 36732 36733 return charCodes; 36734 } 36735 36736 function createCharCode(charCodeToGlyphId, glyphId) { 36737 for (var charCode in charCodeToGlyphId) { 36738 if (glyphId === charCodeToGlyphId[charCode]) { 36739 return charCode | 0; 36740 } 36741 } 36742 36743 newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = glyphId; 36744 return newMapping.nextAvailableFontCharCode++; 36745 } 36746 36747 var seacs = font.seacs; 36748 36749 if (SEAC_ANALYSIS_ENABLED && seacs && seacs.length) { 36750 var matrix = properties.fontMatrix || _util.FONT_IDENTITY_MATRIX; 36751 var charset = font.getCharset(); 36752 var seacMap = Object.create(null); 36753 36754 for (var glyphId in seacs) { 36755 glyphId |= 0; 36756 var seac = seacs[glyphId]; 36757 var baseGlyphName = _encodings.StandardEncoding[seac[2]]; 36758 var accentGlyphName = _encodings.StandardEncoding[seac[3]]; 36759 var baseGlyphId = charset.indexOf(baseGlyphName); 36760 var accentGlyphId = charset.indexOf(accentGlyphName); 36761 36762 if (baseGlyphId < 0 || accentGlyphId < 0) { 36763 continue; 36764 } 36765 36766 var accentOffset = { 36767 x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], 36768 y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] 36769 }; 36770 var charCodes = getCharCodes(mapping, glyphId); 36771 36772 if (!charCodes) { 36773 continue; 36774 } 36775 36776 for (var i = 0, ii = charCodes.length; i < ii; i++) { 36777 var charCode = charCodes[i]; 36778 var charCodeToGlyphId = newMapping.charCodeToGlyphId; 36779 var baseFontCharCode = createCharCode(charCodeToGlyphId, baseGlyphId); 36780 var accentFontCharCode = createCharCode(charCodeToGlyphId, accentGlyphId); 36781 seacMap[charCode] = { 36782 baseFontCharCode: baseFontCharCode, 36783 accentFontCharCode: accentFontCharCode, 36784 accentOffset: accentOffset 36785 }; 36786 } 36787 } 36788 36789 properties.seacMap = seacMap; 36790 } 36791 36792 var unitsPerEm = 1 / (properties.fontMatrix || _util.FONT_IDENTITY_MATRIX)[0]; 36793 var builder = new OpenTypeFileBuilder('\x4F\x54\x54\x4F'); 36794 builder.addTable('CFF ', font.data); 36795 builder.addTable('OS/2', createOS2Table(properties, newMapping.charCodeToGlyphId)); 36796 builder.addTable('cmap', createCmapTable(newMapping.charCodeToGlyphId, numGlyphs)); 36797 builder.addTable('head', '\x00\x01\x00\x00' + '\x00\x00\x10\x00' + '\x00\x00\x00\x00' + '\x5F\x0F\x3C\xF5' + '\x00\x00' + safeString16(unitsPerEm) + '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + '\x00\x00\x00\x00\x9e\x0b\x7e\x27' + '\x00\x00' + safeString16(properties.descent) + '\x0F\xFF' + safeString16(properties.ascent) + string16(properties.italicAngle ? 2 : 0) + '\x00\x11' + '\x00\x00' + '\x00\x00' + '\x00\x00'); 36798 builder.addTable('hhea', '\x00\x01\x00\x00' + safeString16(properties.ascent) + safeString16(properties.descent) + '\x00\x00' + '\xFF\xFF' + '\x00\x00' + '\x00\x00' + '\x00\x00' + safeString16(properties.capHeight) + safeString16(Math.tan(properties.italicAngle) * properties.xHeight) + '\x00\x00' + '\x00\x00' + '\x00\x00' + '\x00\x00' + '\x00\x00' + '\x00\x00' + string16(numGlyphs)); 36799 builder.addTable('hmtx', function fontFieldsHmtx() { 36800 var charstrings = font.charstrings; 36801 var cffWidths = font.cff ? font.cff.widths : null; 36802 var hmtx = '\x00\x00\x00\x00'; 36803 36804 for (var i = 1, ii = numGlyphs; i < ii; i++) { 36805 var width = 0; 36806 36807 if (charstrings) { 36808 var charstring = charstrings[i - 1]; 36809 width = 'width' in charstring ? charstring.width : 0; 36810 } else if (cffWidths) { 36811 width = Math.ceil(cffWidths[i] || 0); 36812 } 36813 36814 hmtx += string16(width) + string16(0); 36815 } 36816 36817 return hmtx; 36818 }()); 36819 builder.addTable('maxp', '\x00\x00\x50\x00' + string16(numGlyphs)); 36820 builder.addTable('name', createNameTable(fontName)); 36821 builder.addTable('post', createPostTable(properties)); 36822 return builder.toArray(); 36823 }, 36824 36825 get spaceWidth() { 36826 if ('_shadowWidth' in this) { 36827 return this._shadowWidth; 36828 } 36829 36830 var possibleSpaceReplacements = ['space', 'minus', 'one', 'i', 'I']; 36831 var width; 36832 36833 for (var i = 0, ii = possibleSpaceReplacements.length; i < ii; i++) { 36834 var glyphName = possibleSpaceReplacements[i]; 36835 36836 if (glyphName in this.widths) { 36837 width = this.widths[glyphName]; 36838 break; 36839 } 36840 36841 var glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 36842 var glyphUnicode = glyphsUnicodeMap[glyphName]; 36843 var charcode = 0; 36844 36845 if (this.composite) { 36846 if (this.cMap.contains(glyphUnicode)) { 36847 charcode = this.cMap.lookup(glyphUnicode); 36848 } 36849 } 36850 36851 if (!charcode && this.toUnicode) { 36852 charcode = this.toUnicode.charCodeOf(glyphUnicode); 36853 } 36854 36855 if (charcode <= 0) { 36856 charcode = glyphUnicode; 36857 } 36858 36859 width = this.widths[charcode]; 36860 36861 if (width) { 36862 break; 36863 } 36864 } 36865 36866 width = width || this.defaultWidth; 36867 this._shadowWidth = width; 36868 return width; 36869 }, 36870 36871 charToGlyph: function Font_charToGlyph(charcode, isSpace) { 36872 var fontCharCode, width, operatorListId;
36873 var widthCode = charcode; 36874 36875 if (this.cMap && this.cMap.contains(charcode)) { 36876 widthCode = this.cMap.lookup(charcode); 36877 } 36878 36879 width = this.widths[widthCode]; 36880 width = (0, _util.isNum)(width) ? width : this.defaultWidth; 36881 var vmetric = this.vmetrics && this.vmetrics[widthCode]; 36882 var unicode = this.toUnicode.get(charcode) || this.fallbackToUnicode.get(charcode) || charcode; 36883 36884 if (typeof unicode === 'number') { 36885 unicode = String.fromCharCode(unicode); 36886 } 36887 36888 var isInFont = charcode in this.toFontChar; 36889 fontCharCode = this.toFontChar[charcode] || charcode; 36890 36891 if (this.missingFile) { 36892 fontCharCode = (0, _unicode.mapSpecialUnicodeValues)(fontCharCode); 36893 } 36894 36895 if (this.isType3Font) { 36896 operatorListId = fontCharCode; 36897 } 36898 36899 var accent = null; 36900 36901 if (this.seacMap && this.seacMap[charcode]) { 36902 isInFont = true; 36903 var seac = this.seacMap[charcode]; 36904 fontCharCode = seac.baseFontCharCode; 36905 accent = { 36906 fontChar: String.fromCodePoint(seac.accentFontCharCode), 36907 offset: seac.accentOffset 36908 }; 36909 } 36910 36911 var fontChar = typeof fontCharCode === 'number' ? String.fromCodePoint(fontCharCode) : ''; 36912 var glyph = this.glyphCache[charcode]; 36913 36914 if (!glyph || !glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont)) { 36915 glyph = new Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont); 36916 this.glyphCache[charcode] = glyph; 36917 } 36918 36919 return glyph; 36920 }, 36921 charsToGlyphs: function Font_charsToGlyphs(chars) { 36922 var charsCache = this.charsCache; 36923 var glyphs, glyph, charcode; 36924 36925 if (charsCache) { 36926 glyphs = charsCache[chars]; 36927 36928 if (glyphs) { 36929 return glyphs; 36930 } 36931 } 36932 36933 if (!charsCache) { 36934 charsCache = this.charsCache = Object.create(null); 36935 } 36936 36937 glyphs = []; 36938 var charsCacheKey = chars; 36939 var i = 0, 36940 ii; 36941 36942 if (this.cMap) { 36943 var c = Object.create(null); 36944 36945 while (i < chars.length) { 36946 this.cMap.readCharCode(chars, i, c); 36947 charcode = c.charcode; 36948 var length = c.length; 36949 i += length; 36950 var isSpace = length === 1 && chars.charCodeAt(i - 1) === 0x20; 36951 glyph = this.charToGlyph(charcode, isSpace); 36952 glyphs.push(glyph); 36953 } 36954 } else { 36955 for (i = 0, ii = chars.length; i < ii; ++i) { 36956 charcode = chars.charCodeAt(i); 36957 glyph = this.charToGlyph(charcode, charcode === 0x20); 36958 glyphs.push(glyph); 36959 } 36960 } 36961 36962 return charsCache[charsCacheKey] = glyphs; 36963 }, 36964 36965 get glyphCacheValues() { 36966 return Object.values(this.glyphCache); 36967 } 36968 36969 }; 36970 return Font; 36971}();
36972 36973exports.Font = Font; 36974 36975var ErrorFont = function ErrorFontClosure() { 36976 function ErrorFont(error) { 36977 this.error = error; 36978 this.loadedName = 'g_font_error'; 36979 this.missingFile = true; 36980 } 36981 36982 ErrorFont.prototype = { 36983 charsToGlyphs: function ErrorFont_charsToGlyphs() { 36984 return []; 36985 }, 36986 exportData: function ErrorFont_exportData() { 36987 return { 36988 error: this.error 36989 }; 36990 } 36991 }; 36992 return ErrorFont; 36993}(); 36994 36995exports.ErrorFont = ErrorFont; 36996 36997function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) { 36998 var charCodeToGlyphId = Object.create(null); 36999 var glyphId, charCode, baseEncoding; 37000 var isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); 37001 37002 if (properties.baseEncodingName) { 37003 baseEncoding = (0, _encodings.getEncoding)(properties.baseEncodingName); 37004 37005 for (charCode = 0; charCode < baseEncoding.length; charCode++) { 37006 glyphId = glyphNames.indexOf(baseEncoding[charCode]); 37007 37008 if (glyphId >= 0) { 37009 charCodeToGlyphId[charCode] = glyphId; 37010 } else { 37011 charCodeToGlyphId[charCode] = 0; 37012 } 37013 } 37014 } else if (isSymbolicFont) { 37015 for (charCode in builtInEncoding) { 37016 charCodeToGlyphId[charCode] = builtInEncoding[charCode]; 37017 } 37018 } else { 37019 baseEncoding = _encodings.StandardEncoding; 37020 37021 for (charCode = 0; charCode < baseEncoding.length; charCode++) { 37022 glyphId = glyphNames.indexOf(baseEncoding[charCode]); 37023 37024 if (glyphId >= 0) { 37025 charCodeToGlyphId[charCode] = glyphId; 37026 } else { 37027 charCodeToGlyphId[charCode] = 0; 37028 } 37029 } 37030 } 37031 37032 var differences = properties.differences, 37033 glyphsUnicodeMap; 37034 37035 if (differences) { 37036 for (charCode in differences) { 37037 var glyphName = differences[charCode]; 37038 glyphId = glyphNames.indexOf(glyphName); 37039 37040 if (glyphId === -1) { 37041 if (!glyphsUnicodeMap) { 37042 glyphsUnicodeMap = (0, _glyphlist.getGlyphsUnicode)(); 37043 } 37044 37045 var standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); 37046 37047 if (standardGlyphName !== glyphName) { 37048 glyphId = glyphNames.indexOf(standardGlyphName); 37049 } 37050 } 37051 37052 if (glyphId >= 0) { 37053 charCodeToGlyphId[charCode] = glyphId; 37054 } else { 37055 charCodeToGlyphId[charCode] = 0; 37056 } 37057 } 37058 } 37059 37060 return charCodeToGlyphId; 37061} 37062 37063var Type1Font = function Type1FontClosure() { 37064 function findBlock(streamBytes, signature, startIndex) { 37065 var streamBytesLength = streamBytes.length; 37066 var signatureLength = signature.length; 37067 var scanLength = streamBytesLength - signatureLength; 37068 var i = startIndex, 37069 j, 37070 found = false; 37071 37072 while (i < scanLength) { 37073 j = 0; 37074 37075 while (j < signatureLength && streamBytes[i + j] === signature[j]) { 37076 j++; 37077 } 37078 37079 if (j >= signatureLength) { 37080 i += j; 37081 37082 while (i < streamBytesLength && (0, _util.isSpace)(streamBytes[i])) { 37083 i++; 37084 } 37085 37086 found = true; 37087 break; 37088 } 37089 37090 i++; 37091 } 37092 37093 return { 37094 found: found, 37095 length: i 37096 }; 37097 } 37098 37099 function getHeaderBlock(stream, suggestedLength) { 37100 var EEXEC_SIGNATURE = [0x65, 0x65, 0x78, 0x65, 0x63]; 37101 var streamStartPos = stream.pos; 37102 var headerBytes, headerBytesLength, block; 37103 37104 try { 37105 headerBytes = stream.getBytes(suggestedLength); 37106 headerBytesLength = headerBytes.length; 37107 } catch (ex) { 37108 if (ex instanceof _util.MissingDataException) { 37109 throw ex; 37110 } 37111 } 37112 37113 if (headerBytesLength === suggestedLength) { 37114 block = findBlock(headerBytes, EEXEC_SIGNATURE, suggestedLength - 2 * EEXEC_SIGNATURE.length); 37115 37116 if (block.found && block.length === suggestedLength) { 37117 return { 37118 stream: new _stream.Stream(headerBytes), 37119 length: suggestedLength 37120 }; 37121 } 37122 } 37123 37124 (0, _util.warn)('Invalid "Length1" property in Type1 font -- trying to recover.'); 37125 stream.pos = streamStartPos; 37126 var SCAN_BLOCK_LENGTH = 2048; 37127 var actualLength; 37128 37129 while (true) { 37130 var scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); 37131 block = findBlock(scanBytes, EEXEC_SIGNATURE, 0); 37132 37133 if (block.length === 0) { 37134 break; 37135 } 37136 37137 stream.pos += block.length; 37138 37139 if (block.found) { 37140 actualLength = stream.pos - streamStartPos; 37141 break; 37142 } 37143 } 37144 37145 stream.pos = streamStartPos; 37146 37147 if (actualLength) { 37148 return { 37149 stream: new _stream.Stream(stream.getBytes(actualLength)), 37150 length: actualLength 37151 }; 37152 } 37153
37154 (0, _util.warn)('Unable to recover "Length1" property in Type1 font -- using as is.'); 37155 return { 37156 stream: new _stream.Stream(stream.getBytes(suggestedLength)), 37157 length: suggestedLength 37158 }; 37159 } 37160 37161 function getEexecBlock(stream, suggestedLength) { 37162 var eexecBytes = stream.getBytes(); 37163 return { 37164 stream: new _stream.Stream(eexecBytes), 37165 length: eexecBytes.length 37166 }; 37167 } 37168 37169 function Type1Font(name, file, properties) { 37170 var PFB_HEADER_SIZE = 6; 37171 var headerBlockLength = properties.length1; 37172 var eexecBlockLength = properties.length2; 37173 var pfbHeader = file.peekBytes(PFB_HEADER_SIZE); 37174 var pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01; 37175 37176 if (pfbHeaderPresent) { 37177 file.skip(PFB_HEADER_SIZE); 37178 headerBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; 37179 } 37180 37181 var headerBlock = getHeaderBlock(file, headerBlockLength); 37182 var headerBlockParser = new _type1_parser.Type1Parser(headerBlock.stream, false, SEAC_ANALYSIS_ENABLED); 37183 headerBlockParser.extractFontHeader(properties); 37184 37185 if (pfbHeaderPresent) { 37186 pfbHeader = file.getBytes(PFB_HEADER_SIZE); 37187 eexecBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; 37188 } 37189 37190 var eexecBlock = getEexecBlock(file, eexecBlockLength); 37191 var eexecBlockParser = new _type1_parser.Type1Parser(eexecBlock.stream, true, SEAC_ANALYSIS_ENABLED); 37192 var data = eexecBlockParser.extractFontProgram(); 37193 37194 for (var info in data.properties) { 37195 properties[info] = data.properties[info]; 37196 } 37197 37198 var charstrings = data.charstrings; 37199 var type2Charstrings = this.getType2Charstrings(charstrings); 37200 var subrs = this.getType2Subrs(data.subrs); 37201 this.charstrings = charstrings; 37202 this.data = this.wrap(name, type2Charstrings, this.charstrings, subrs, properties); 37203 this.seacs = this.getSeacs(data.charstrings); 37204 } 37205 37206 Type1Font.prototype = { 37207 get numGlyphs() { 37208 return this.charstrings.length + 1; 37209 }, 37210 37211 getCharset: function Type1Font_getCharset() { 37212 var charset = ['.notdef']; 37213 var charstrings = this.charstrings; 37214 37215 for (var glyphId = 0; glyphId < charstrings.length; glyphId++) { 37216 charset.push(charstrings[glyphId].glyphName); 37217 } 37218 37219 return charset; 37220 }, 37221 getGlyphMapping: function Type1Font_getGlyphMapping(properties) { 37222 var charstrings = this.charstrings; 37223 var glyphNames = ['.notdef'], 37224 glyphId; 37225 37226 for (glyphId = 0; glyphId < charstrings.length; glyphId++) { 37227 glyphNames.push(charstrings[glyphId].glyphName); 37228 } 37229 37230 var encoding = properties.builtInEncoding; 37231 37232 if (encoding) { 37233 var builtInEncoding = Object.create(null); 37234 37235 for (var charCode in encoding) { 37236 glyphId = glyphNames.indexOf(encoding[charCode]); 37237 37238 if (glyphId >= 0) { 37239 builtInEncoding[charCode] = glyphId; 37240 } 37241 } 37242 } 37243 37244 return type1FontGlyphMapping(properties, builtInEncoding, glyphNames); 37245 }, 37246 hasGlyphId: function Type1Font_hasGlyphID(id) { 37247 if (id < 0 || id >= this.numGlyphs) { 37248 return false; 37249 } 37250 37251 if (id === 0) { 37252 return true; 37253 } 37254 37255 var glyph = this.charstrings[id - 1]; 37256 return glyph.charstring.length > 0; 37257 }, 37258 getSeacs: function Type1Font_getSeacs(charstrings) { 37259 var i, ii; 37260 var seacMap = []; 37261 37262 for (i = 0, ii = charstrings.length; i < ii; i++) { 37263 var charstring = charstrings[i]; 37264 37265 if (charstring.seac) { 37266 seacMap[i + 1] = charstring.seac; 37267 } 37268 } 37269 37270 return seacMap; 37271 }, 37272 getType2Charstrings: function Type1Font_getType2Charstrings(type1Charstrings) { 37273 var type2Charstrings = []; 37274 37275 for (var i = 0, ii = type1Charstrings.length; i < ii; i++) { 37276 type2Charstrings.push(type1Charstrings[i].charstring); 37277 } 37278 37279 return type2Charstrings; 37280 }, 37281 getType2Subrs: function Type1Font_getType2Subrs(type1Subrs) { 37282 var bias = 0; 37283 var count = type1Subrs.length; 37284 37285 if (count < 1133) { 37286 bias = 107; 37287 } else if (count < 33769) { 37288 bias = 1131; 37289 } else { 37290 bias = 32768; 37291 } 37292 37293 var type2Subrs = []; 37294 var i; 37295 37296 for (i = 0; i < bias; i++) { 37297 type2Subrs.push([0x0B]); 37298 } 37299 37300 for (i = 0; i < count; i++) { 37301 type2Subrs.push(type1Subrs[i]); 37302 } 37303 37304 return type2Subrs; 37305 }, 37306 wrap: function Type1Font_wrap(name, glyphs, charstrings, subrs, properties) { 37307 var cff = new _cff_parser.CFF(); 37308 cff.header = new _cff_parser.CFFHeader(1, 0, 4, 4); 37309 cff.names = [name]; 37310 var topDict = new _cff_parser.CFFTopDict(); 37311 topDict.setByName('version', 391); 37312 topDict.setByName('Notice', 392); 37313 topDict.setByName('FullName', 393); 37314 topDict.setByName('FamilyName', 394); 37315 topDict.setByName('Weight', 395); 37316 topDict.setByName('Encoding', null); 37317 topDict.setByName('FontMatrix', properties.fontMatrix); 37318 topDict.setByName('FontBBox', properties.bbox); 37319 topDict.setByName('charset', null); 37320 topDict.setByName('CharStrings', null); 37321 topDict.setByName('Private', null); 37322 cff.topDict = topDict; 37323 var strings = new _cff_parser.CFFStrings();
37324 strings.add('Version 0.11'); 37325 strings.add('See original notice'); 37326 strings.add(name); 37327 strings.add(name); 37328 strings.add('Medium'); 37329 cff.strings = strings; 37330 cff.globalSubrIndex = new _cff_parser.CFFIndex(); 37331 var count = glyphs.length; 37332 var charsetArray = [0]; 37333 var i, ii; 37334 37335 for (i = 0; i < count; i++) { 37336 var index = _cff_parser.CFFStandardStrings.indexOf(charstrings[i].glyphName); 37337 37338 if (index === -1) { 37339 index = 0; 37340 } 37341 37342 charsetArray.push(index >> 8 & 0xff, index & 0xff); 37343 } 37344 37345 cff.charset = new _cff_parser.CFFCharset(false, 0, [], charsetArray); 37346 var charStringsIndex = new _cff_parser.CFFIndex(); 37347 charStringsIndex.add([0x8B, 0x0E]); 37348 37349 for (i = 0; i < count; i++) { 37350 charStringsIndex.add(glyphs[i]); 37351 } 37352 37353 cff.charStrings = charStringsIndex; 37354 var privateDict = new _cff_parser.CFFPrivateDict(); 37355 privateDict.setByName('Subrs', null); 37356 var fields = ['BlueValues', 'OtherBlues', 'FamilyBlues', 'FamilyOtherBlues', 'StemSnapH', 'StemSnapV', 'BlueShift', 'BlueFuzz', 'BlueScale', 'LanguageGroup', 'ExpansionFactor', 'ForceBold', 'StdHW', 'StdVW']; 37357 37358 for (i = 0, ii = fields.length; i < ii; i++) { 37359 var field = fields[i]; 37360 37361 if (!(field in properties.privateData)) { 37362 continue; 37363 } 37364 37365 var value = properties.privateData[field]; 37366 37367 if (Array.isArray(value)) { 37368 for (var j = value.length - 1; j > 0; j--) { 37369 value[j] -= value[j - 1]; 37370 } 37371 } 37372 37373 privateDict.setByName(field, value); 37374 } 37375 37376 cff.topDict.privateDict = privateDict; 37377 var subrIndex = new _cff_parser.CFFIndex(); 37378 37379 for (i = 0, ii = subrs.length; i < ii; i++) { 37380 subrIndex.add(subrs[i]); 37381 } 37382 37383 privateDict.subrsIndex = subrIndex; 37384 var compiler = new _cff_parser.CFFCompiler(cff); 37385 return compiler.compile(); 37386 } 37387 }; 37388 return Type1Font; 37389}(); 37390 37391var CFFFont = function CFFFontClosure() { 37392 function CFFFont(file, properties) { 37393 this.properties = properties; 37394 var parser = new _cff_parser.CFFParser(file, properties, SEAC_ANALYSIS_ENABLED); 37395 this.cff = parser.parse(); 37396 this.cff.duplicateFirstGlyph(); 37397 var compiler = new _cff_parser.CFFCompiler(this.cff); 37398 this.seacs = this.cff.seacs; 37399 37400 try { 37401 this.data = compiler.compile(); 37402 } catch (e) { 37403 (0, _util.warn)('Failed to compile font ' + properties.loadedName); 37404 this.data = file; 37405 } 37406 } 37407 37408 CFFFont.prototype = { 37409 get numGlyphs() { 37410 return this.cff.charStrings.count; 37411 }, 37412 37413 getCharset: function CFFFont_getCharset() { 37414 return this.cff.charset.charset; 37415 }, 37416 getGlyphMapping: function CFFFont_getGlyphMapping() { 37417 var cff = this.cff; 37418 var properties = this.properties; 37419 var charsets = cff.charset.charset; 37420 var charCodeToGlyphId; 37421 var glyphId; 37422 37423 if (properties.composite) { 37424 charCodeToGlyphId = Object.create(null); 37425 37426 if (cff.isCIDFont) { 37427 for (glyphId = 0; glyphId < charsets.length; glyphId++) { 37428 var cid = charsets[glyphId]; 37429 var charCode = properties.cMap.charCodeOf(cid); 37430 charCodeToGlyphId[charCode] = glyphId; 37431 } 37432 } else { 37433 for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) { 37434 charCodeToGlyphId[glyphId] = glyphId; 37435 } 37436 } 37437 37438 return charCodeToGlyphId; 37439 } 37440 37441 var encoding = cff.encoding ? cff.encoding.encoding : null; 37442 charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); 37443 return charCodeToGlyphId; 37444 }, 37445 hasGlyphId: function CFFFont_hasGlyphID(id) { 37446 return this.cff.hasGlyphId(id); 37447 } 37448 }; 37449 return CFFFont; 37450}(); 37451 37452/***/ }), 37453/* 174 */ 37454/***/ (function(module, exports, __w_pdfjs_require__) { 37455 37456"use strict"; 37457 37458 37459Object.defineProperty(exports, "__esModule", { 37460 value: true 37461}); 37462exports.CFFFDSelect = exports.CFFCompiler = exports.CFFPrivateDict = exports.CFFTopDict = exports.CFFCharset = exports.CFFIndex = exports.CFFStrings = exp
vendor: 9,556 bytes, lines 37462-37703
37462orts.CFFHeader = exports.CFF = exports.CFFParser = exports.CFFStandardStrings = void 0; 37463 37464var _util = __w_pdfjs_require__(6); 37465 37466var _charsets = __w_pdfjs_require__(175); 37467 37468var _encodings = __w_pdfjs_require__(176); 37469 37470var MAX_SUBR_NESTING = 10; 37471var CFFStandardStrings = ['.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', 'questiondown', 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'emdash', 'AE', 'ordfeminine', 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', 'dotlessi', 'lslash', 'oslash', 'oe', 'germandbls', 'onesuperior', 'logicalnot', 'mu', 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', 'onequarter', 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', 'twosuperior', 'registered', 'minus', 'eth', 'multiply', 'threesuperior', 'copyright', 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', 'Atilde', 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', 'Ocircumflex', 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', 'Ucircumflex', 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', 'aacute', 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', 'ccedilla', 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', 'icircumflex', 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', 'odieresis', 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', 'udieresis', 'ugrave', 'yacute', 'ydieresis', 'zcaron', 'exclamsmall', 'Hungarumlautsmall', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'questionsmall', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', 'tsuperior', 'ff', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', 'Tildesmall', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', 'Dotaccentsmall', 'Macronsmall', 'figuredash', 'hypheninferior', 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', 'Ydieresissmall', '001.000', '001.001', '001.002', '001.003', 'Black', 'Bold', 'Book', 'Light', 'Medium', 'Regular', 'Roman', 'Semibold']; 37472exports.CFFStandardStrings = CFFStandardStrings; 37473 37474var CFFParser = function CFFParserClosure() { 37475 var CharstringValidationData = [null, { 37476 id: 'hstem', 37477 min: 2, 37478 stackClearing: true, 37479 stem: true 37480 }, null, { 37481 id: 'vstem', 37482 min: 2, 37483 stackClearing: true, 37484 stem: true 37485 }, { 37486 id: 'vmoveto', 37487 min: 1, 37488 stackClearing: true 37489 }, { 37490 id: 'rlineto', 37491 min: 2, 37492 resetStack: true 37493 }, { 37494 id: 'hlineto', 37495 min: 1, 37496 resetStack: true 37497 }, { 37498 id: 'vlineto', 37499 min: 1, 37500 resetStack: true 37501 }, { 37502 id: 'rrcurveto', 37503 min: 6, 37504 resetStack: true 37505 }, null, { 37506 id: 'callsubr', 37507 min: 1, 37508 undefStack: true 37509 }, { 37510 id: 'return', 37511 min: 0, 37512 undefStack: true 37513 }, null, null, { 37514 id: 'endchar', 37515 min: 0, 37516 stackClearing: true 37517 }, null, null, null, { 37518 id: 'hstemhm', 37519 min: 2, 37520 stackClearing: true, 37521 stem: true 37522 }, { 37523 id: 'hintmask', 37524 min: 0, 37525 stackClearing: true 37526 }, { 37527 id: 'cntrmask', 37528 min: 0, 37529 stackClearing: true 37530 }, { 37531 id: 'rmoveto', 37532 min: 2, 37533 stackClearing: true 37534 }, { 37535 id: 'hmoveto', 37536 min: 1, 37537 stackClearing: true 37538 }, { 37539 id: 'vstemhm', 37540 min: 2, 37541 stackClearing: true, 37542 stem: true 37543 }, { 37544 id: 'rcurveline', 37545 min: 8, 37546 resetStack: true 37547 }, { 37548 id: 'rlinecurve', 37549 min: 8, 37550 resetStack: true 37551 }, { 37552 id: 'vvcurveto', 37553 min: 4, 37554 resetStack: true 37555 }, { 37556 id: 'hhcurveto', 37557 min: 4, 37558 resetStack: true 37559 }, null, { 37560 id: 'callgsubr', 37561 min: 1, 37562 undefStack: true 37563 }, { 37564 id: 'vhcurveto', 37565 min: 4, 37566 resetStack: true 37567 }, { 37568 id: 'hvcurveto', 37569 min: 4, 37570 resetStack: true 37571 }]; 37572 var CharstringValidationData12 = [null, null, null, { 37573 id: 'and', 37574 min: 2, 37575 stackDelta: -1 37576 }, { 37577 id: 'or', 37578 min: 2, 37579 stackDelta: -1 37580 }, { 37581 id: 'not', 37582 min: 1, 37583 stackDelta: 0 37584 }, null, null, null, { 37585 id: 'abs', 37586 min: 1, 37587 stackDelta: 0 37588 }, { 37589 id: 'add', 37590 min: 2, 37591 stackDelta: -1, 37592 stackFn: function stack_div(stack, index) { 37593 stack[index - 2] = stack[index - 2] + stack[index - 1]; 37594 } 37595 }, { 37596 id: 'sub', 37597 min: 2, 37598 stackDelta: -1, 37599 stackFn: function stack_div(stack, index) { 37600 stack[index - 2] = stack[index - 2] - stack[index - 1]; 37601 } 37602 }, { 37603 id: 'div', 37604 min: 2, 37605 stackDelta: -1, 37606 stackFn: function stack_div(stack, index) { 37607 stack[index - 2] = stack[index - 2] / stack[index - 1]; 37608 } 37609 }, null, { 37610 id: 'neg', 37611 min: 1, 37612 stackDelta: 0, 37613 stackFn: function stack_div(stack, index) { 37614 stack[index - 1] = -stack[index - 1]; 37615 } 37616 }, { 37617 id: 'eq', 37618 min: 2, 37619 stackDelta: -1 37620 }, null, null, { 37621 id: 'drop', 37622 min: 1, 37623 stackDelta: -1 37624 }, null, { 37625 id: 'put', 37626 min: 2, 37627 stackDelta: -2 37628 }, { 37629 id: 'get', 37630 min: 1, 37631 stackDelta: 0 37632 }, { 37633 id: 'ifelse', 37634 min: 4, 37635 stackDelta: -3 37636 }, { 37637 id: 'random', 37638 min: 0, 37639 stackDelta: 1 37640 }, { 37641 id: 'mul', 37642 min: 2, 37643 stackDelta: -1, 37644 stackFn: function stack_div(stack, index) { 37645 stack[index - 2] = stack[index - 2] * stack[index - 1]; 37646 } 37647 }, null, { 37648 id: 'sqrt', 37649 min: 1, 37650 stackDelta: 0 37651 }, { 37652 id: 'dup', 37653 min: 1, 37654 stackDelta: 1 37655 }, { 37656 id: 'exch', 37657 min: 2, 37658 stackDelta: 0 37659 }, { 37660 id: 'index', 37661 min: 2, 37662 stackDelta: 0 37663 }, { 37664 id: 'roll', 37665 min: 3, 37666 stackDelta: -2 37667 }, null, null, null, { 37668 id: 'hflex', 37669 min: 7, 37670 resetStack: true 37671 }, { 37672 id: 'flex', 37673 min: 13, 37674 resetStack: true 37675 }, { 37676 id: 'hflex1', 37677 min: 9, 37678 resetStack: true 37679 }, { 37680 id: 'flex1', 37681 min: 11, 37682 resetStack: true 37683 }]; 37684 37685 function CFFParser(file, properties, seacAnalysisEnabled) { 37686 this.bytes = file.getBytes(); 37687 this.properties = properties; 37688 this.seacAnalysisEnabled = !!seacAnalysisEnabled; 37689 } 37690 37691 CFFParser.prototype = { 37692 parse: function CFFParser_parse() { 37693 var properties = this.properties; 37694 var cff = new CFF(); 37695 this.cff = cff; 37696 var header = this.parseHeader(); 37697 var nameIndex = this.parseIndex(header.endPos); 37698 var topDictIndex = this.parseIndex(nameIndex.endPos); 37699 var stringIndex = this.parseIndex(topDictIndex.endPos); 37700 var globalSubrIndex = this.parseIndex(stringIndex.endPos); 37701 var topDictParsed = this.parseDict(topDictIndex.obj.get(0)); 37702 var topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings); 37703 cff.header = header.obj;
37704 cff.names = this.parseNameIndex(nameIndex.obj); 37705 cff.strings = this.parseStringIndex(stringIndex.obj); 37706 cff.topDict = topDict; 37707 cff.globalSubrIndex = globalSubrIndex.obj; 37708 this.parsePrivateDict(cff.topDict); 37709 cff.isCIDFont = topDict.hasName('ROS'); 37710 var charStringOffset = topDict.getByName('CharStrings'); 37711 var charStringIndex = this.parseIndex(charStringOffset).obj; 37712 var fontMatrix = topDict.getByName('FontMatrix'); 37713 37714 if (fontMatrix) { 37715 properties.fontMatrix = fontMatrix; 37716 } 37717 37718 var fontBBox = topDict.getByName('FontBBox'); 37719 37720 if (fontBBox) { 37721 properties.ascent = Math.max(fontBBox[3], fontBBox[1]); 37722 properties.descent = Math.min(fontBBox[1], fontBBox[3]); 37723 properties.ascentScaled = true; 37724 } 37725 37726 var charset, encoding; 37727 37728 if (cff.isCIDFont) { 37729 var fdArrayIndex = this.parseIndex(topDict.getByName('FDArray')).obj; 37730 37731 for (var i = 0, ii = fdArrayIndex.count; i < ii; ++i) { 37732 var dictRaw = fdArrayIndex.get(i); 37733 var fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), cff.strings); 37734 this.parsePrivateDict(fontDict); 37735 cff.fdArray.push(fontDict); 37736 } 37737 37738 encoding = null; 37739 charset = this.parseCharsets(topDict.getByName('charset'), charStringIndex.count, cff.strings, true); 37740 cff.fdSelect = this.parseFDSelect(topDict.getByName('FDSelect'), charStringIndex.count); 37741 } else { 37742 charset = this.parseCharsets(topDict.getByName('charset'), charStringIndex.count, cff.strings, false); 37743 encoding = this.parseEncoding(topDict.getByName('Encoding'), properties, cff.strings, charset.charset); 37744 } 37745 37746 cff.charset = charset; 37747 cff.encoding = encoding; 37748 var charStringsAndSeacs = this.parseCharStrings({ 37749 charStrings: charStringIndex, 37750 localSubrIndex: topDict.privateDict.subrsIndex, 37751 globalSubrIndex: globalSubrIndex.obj, 37752 fdSelect: cff.fdSelect, 37753 fdArray: cff.fdArray, 37754 privateDict: topDict.privateDict 37755 }); 37756 cff.charStrings = charStringsAndSeacs.charStrings; 37757 cff.seacs = charStringsAndSeacs.seacs; 37758 cff.widths = charStringsAndSeacs.widths; 37759 return cff; 37760 }, 37761 parseHeader: function CFFParser_parseHeader() { 37762 var bytes = this.bytes; 37763 var bytesLength = bytes.length; 37764 var offset = 0; 37765 37766 while (offset < bytesLength && bytes[offset] !== 1) { 37767 ++offset; 37768 } 37769 37770 if (offset >= bytesLength) { 37771 throw new _util.FormatError('Invalid CFF header'); 37772 } 37773 37774 if (offset !== 0) { 37775 (0, _util.info)('cff data is shifted'); 37776 bytes = bytes.subarray(offset); 37777 this.bytes = bytes; 37778 } 37779 37780 var major = bytes[0]; 37781 var minor = bytes[1]; 37782 var hdrSize = bytes[2]; 37783 var offSize = bytes[3]; 37784 var header = new CFFHeader(major, minor, hdrSize, offSize); 37785 return { 37786 obj: header, 37787 endPos: hdrSize 37788 }; 37789 }, 37790 parseDict: function CFFParser_parseDict(dict) { 37791 var pos = 0; 37792 37793 function parseOperand() { 37794 var value = dict[pos++]; 37795 37796 if (value === 30) { 37797 return parseFloatOperand(); 37798 } else if (value === 28) { 37799 value = dict[pos++]; 37800 value = (value << 24 | dict[pos++] << 16) >> 16; 37801 return value; 37802 } else if (value === 29) { 37803 value = dict[pos++]; 37804 value = value << 8 | dict[pos++]; 37805 value = value << 8 | dict[pos++]; 37806 value = value << 8 | dict[pos++]; 37807 return value; 37808 } else if (value >= 32 && value <= 246) { 37809 return value - 139; 37810 } else if (value >= 247 && value <= 250) { 37811 return (value - 247) * 256 + dict[pos++] + 108; 37812 } else if (value >= 251 && value <= 254) { 37813 return -((value - 251) * 256) - dict[pos++] - 108; 37814 } 37815 37816 (0, _util.warn)('CFFParser_parseDict: "' + value + '" is a reserved command.'); 37817 return NaN; 37818 } 37819 37820 function parseFloatOperand() { 37821 var str = ''; 37822 var eof = 15; 37823 var lookup = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', 'E', 'E-', null, '-']; 37824 var length = dict.length; 37825 37826 while (pos < length) { 37827 var b = dict[pos++]; 37828 var b1 = b >> 4; 37829 var b2 = b & 15;
37830 37831 if (b1 === eof) { 37832 break; 37833 } 37834 37835 str += lookup[b1]; 37836 37837 if (b2 === eof) { 37838 break; 37839 } 37840 37841 str += lookup[b2]; 37842 } 37843 37844 return parseFloat(str); 37845 } 37846 37847 var operands = []; 37848 var entries = []; 37849 pos = 0; 37850 var end = dict.length; 37851 37852 while (pos < end) { 37853 var b = dict[pos]; 37854 37855 if (b <= 21) { 37856 if (b === 12) { 37857 b = b << 8 | dict[++pos]; 37858 } 37859 37860 entries.push([b, operands]); 37861 operands = []; 37862 ++pos; 37863 } else { 37864 operands.push(parseOperand()); 37865 } 37866 } 37867 37868 return entries; 37869 }, 37870 parseIndex: function CFFParser_parseIndex(pos) { 37871 var cffIndex = new CFFIndex(); 37872 var bytes = this.bytes; 37873 var count = bytes[pos++] << 8 | bytes[pos++]; 37874 var offsets = []; 37875 var end = pos; 37876 var i, ii; 37877 37878 if (count !== 0) { 37879 var offsetSize = bytes[pos++]; 37880 var startPos = pos + (count + 1) * offsetSize - 1; 37881 37882 for (i = 0, ii = count + 1; i < ii; ++i) { 37883 var offset = 0; 37884 37885 for (var j = 0; j < offsetSize; ++j) { 37886 offset <<= 8; 37887 offset += bytes[pos++]; 37888 } 37889 37890 offsets.push(startPos + offset); 37891 } 37892 37893 end = offsets[count]; 37894 } 37895 37896 for (i = 0, ii = offsets.length - 1; i < ii; ++i) { 37897 var offsetStart = offsets[i]; 37898 var offsetEnd = offsets[i + 1]; 37899 cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); 37900 } 37901 37902 return { 37903 obj: cffIndex, 37904 endPos: end 37905 }; 37906 }, 37907 parseNameIndex: function CFFParser_parseNameIndex(index) { 37908 var names = []; 37909 37910 for (var i = 0, ii = index.count; i < ii; ++i) { 37911 var name = index.get(i); 37912 names.push((0, _util.bytesToString)(name)); 37913 } 37914 37915 return names; 37916 }, 37917 parseStringIndex: function CFFParser_parseStringIndex(index) { 37918 var strings = new CFFStrings(); 37919 37920 for (var i = 0, ii = index.count; i < ii; ++i) { 37921 var data = index.get(i); 37922 strings.add((0, _util.bytesToString)(data)); 37923 } 37924 37925 return strings; 37926 }, 37927 createDict: function CFFParser_createDict(Type, dict, strings) { 37928 var cffDict = new Type(strings); 37929 37930 for (var i = 0, ii = dict.length; i < ii; ++i) { 37931 var pair = dict[i]; 37932 var key = pair[0]; 37933 var value = pair[1]; 37934 cffDict.setByKey(key, value); 37935 } 37936 37937 return cffDict; 37938 }, 37939 parseCharString: function CFFParser_parseCharString(state, data, localSubrIndex, globalSubrIndex) { 37940 if (!data || state.callDepth > MAX_SUBR_NESTING) { 37941 return false; 37942 } 37943 37944 var stackSize = state.stackSize; 37945 var stack = state.stack; 37946 var length = data.length; 37947 37948 for (var j = 0; j < length;) { 37949 var value = data[j++]; 37950 var validationCommand = null; 37951 37952 if (value === 12) { 37953 var q = data[j++]; 37954 37955 if (q === 0) { 37956 data[j - 2] = 139; 37957 data[j - 1] = 22; 37958 stackSize = 0; 37959 } else { 37960 validationCommand = CharstringValidationData12[q]; 37961 } 37962 } else if (value === 28) { 37963 stack[stackSize] = (data[j] << 24 | data[j + 1] << 16) >> 16; 37964 j += 2; 37965 stackSize++; 37966 } else if (value === 14) { 37967 if (stackSize >= 4) { 37968 stackSize -= 4; 37969 37970 if (this.seacAnalysisEnabled) { 37971 state.seac = stack.slice(stackSize, stackSize + 4); 37972 return false; 37973 } 37974 } 37975 37976 validationCommand = CharstringValidationData[value]; 37977 } else if (value >= 32 && value <= 246) { 37978 stack[stackSize] = value - 139; 37979 stackSize++; 37980 } else if (value >= 247 && value <= 254) { 37981 stack[stackSize] = value < 251 ? (value - 247 << 8) + data[j] + 108 : -(value - 251 << 8) - data[j] - 108; 37982 j++; 37983 stackSize++; 37984 }
vendor: 4,707 bytes, lines 37984-38121
37984 else if (value === 255) { 37985 stack[stackSize] = (data[j] << 24 | data[j + 1] << 16 | data[j + 2] << 8 | data[j + 3]) / 65536; 37986 j += 4; 37987 stackSize++; 37988 } else if (value === 19 || value === 20) { 37989 state.hints += stackSize >> 1; 37990 j += state.hints + 7 >> 3; 37991 stackSize %= 2; 37992 validationCommand = CharstringValidationData[value]; 37993 } else if (value === 10 || value === 29) { 37994 var subrsIndex; 37995 37996 if (value === 10) { 37997 subrsIndex = localSubrIndex; 37998 } else { 37999 subrsIndex = globalSubrIndex; 38000 } 38001 38002 if (!subrsIndex) { 38003 validationCommand = CharstringValidationData[value]; 38004 (0, _util.warn)('Missing subrsIndex for ' + validationCommand.id); 38005 return false; 38006 } 38007 38008 var bias = 32768; 38009 38010 if (subrsIndex.count < 1240) { 38011 bias = 107; 38012 } else if (subrsIndex.count < 33900) { 38013 bias = 1131; 38014 } 38015 38016 var subrNumber = stack[--stackSize] + bias; 38017 38018 if (subrNumber < 0 || subrNumber >= subrsIndex.count || isNaN(subrNumber)) { 38019 validationCommand = CharstringValidationData[value]; 38020 (0, _util.warn)('Out of bounds subrIndex for ' + validationCommand.id); 38021 return false; 38022 } 38023 38024 state.stackSize = stackSize; 38025 state.callDepth++; 38026 var valid = this.parseCharString(state, subrsIndex.get(subrNumber), localSubrIndex, globalSubrIndex); 38027 38028 if (!valid) { 38029 return false; 38030 } 38031 38032 state.callDepth--; 38033 stackSize = state.stackSize; 38034 continue; 38035 } else if (value === 11) { 38036 state.stackSize = stackSize; 38037 return true; 38038 } else { 38039 validationCommand = CharstringValidationData[value]; 38040 } 38041 38042 if (validationCommand) { 38043 if (validationCommand.stem) { 38044 state.hints += stackSize >> 1; 38045 38046 if (value === 3 || value === 23) { 38047 state.hasVStems = true; 38048 } else if (state.hasVStems && (value === 1 || value === 18)) { 38049 (0, _util.warn)('CFF stem hints are in wrong order'); 38050 data[j - 1] = value === 1 ? 3 : 23; 38051 } 38052 } 38053 38054 if ('min' in validationCommand) { 38055 if (!state.undefStack && stackSize < validationCommand.min) { 38056 (0, _util.warn)('Not enough parameters for ' + validationCommand.id + '; actual: ' + stackSize + ', expected: ' + validationCommand.min); 38057 return false; 38058 } 38059 } 38060 38061 if (state.firstStackClearing && validationCommand.stackClearing) { 38062 state.firstStackClearing = false; 38063 stackSize -= validationCommand.min; 38064 38065 if (stackSize >= 2 && validationCommand.stem) { 38066 stackSize %= 2; 38067 } else if (stackSize > 1) { 38068 (0, _util.warn)('Found too many parameters for stack-clearing command'); 38069 } 38070 38071 if (stackSize > 0 && stack[stackSize - 1] >= 0) { 38072 state.width = stack[stackSize - 1]; 38073 } 38074 } 38075 38076 if ('stackDelta' in validationCommand) { 38077 if ('stackFn' in validationCommand) { 38078 validationCommand.stackFn(stack, stackSize); 38079 } 38080 38081 stackSize += validationCommand.stackDelta; 38082 } else if (validationCommand.stackClearing) { 38083 stackSize = 0; 38084 } else if (validationCommand.resetStack) { 38085 stackSize = 0; 38086 state.undefStack = false; 38087 } else if (validationCommand.undefStack) { 38088 stackSize = 0; 38089 state.undefStack = true; 38090 state.firstStackClearing = false; 38091 } 38092 } 38093 } 38094 38095 state.stackSize = stackSize; 38096 return true; 38097 }, 38098 parseCharStrings: function parseCharStrings(_ref) { 38099 var charStrings = _ref.charStrings, 38100 localSubrIndex = _ref.localSubrIndex, 38101 globalSubrIndex = _ref.globalSubrIndex, 38102 fdSelect = _ref.fdSelect, 38103 fdArray = _ref.fdArray, 38104 privateDict = _ref.privateDict; 38105 var seacs = []; 38106 var widths = []; 38107 var count = charStrings.count; 38108 38109 for (var i = 0; i < count; i++) { 38110 var charstring = charStrings.get(i); 38111 var state = { 38112 callDepth: 0, 38113 stackSize: 0, 38114 stack: [], 38115 undefStack: true, 38116 hints: 0, 38117 firstStackClearing: true, 38118 seac: null, 38119 width: null, 38120 hasVStems: false 38121 };
38122 var valid = true; 38123 var localSubrToUse = null; 38124 var privateDictToUse = privateDict; 38125 38126 if (fdSelect && fdArray.length) { 38127 var fdIndex = fdSelect.getFDIndex(i); 38128 38129 if (fdIndex === -1) { 38130 (0, _util.warn)('Glyph index is not in fd select.'); 38131 valid = false; 38132 } 38133 38134 if (fdIndex >= fdArray.length) { 38135 (0, _util.warn)('Invalid fd index for glyph index.'); 38136 valid = false; 38137 } 38138 38139 if (valid) { 38140 privateDictToUse = fdArray[fdIndex].privateDict; 38141 localSubrToUse = privateDictToUse.subrsIndex; 38142 } 38143 } else if (localSubrIndex) { 38144 localSubrToUse = localSubrIndex; 38145 } 38146 38147 if (valid) { 38148 valid = this.parseCharString(state, charstring, localSubrToUse, globalSubrIndex); 38149 } 38150 38151 if (state.width !== null) { 38152 var nominalWidth = privateDictToUse.getByName('nominalWidthX'); 38153 widths[i] = nominalWidth + state.width; 38154 } else { 38155 var defaultWidth = privateDictToUse.getByName('defaultWidthX'); 38156 widths[i] = defaultWidth; 38157 } 38158 38159 if (state.seac !== null) { 38160 seacs[i] = state.seac; 38161 } 38162 38163 if (!valid) { 38164 charStrings.set(i, new Uint8Array([14])); 38165 } 38166 } 38167 38168 return { 38169 charStrings: charStrings, 38170 seacs: seacs, 38171 widths: widths 38172 }; 38173 }, 38174 emptyPrivateDictionary: function CFFParser_emptyPrivateDictionary(parentDict) { 38175 var privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings); 38176 parentDict.setByKey(18, [0, 0]); 38177 parentDict.privateDict = privateDict; 38178 }, 38179 parsePrivateDict: function CFFParser_parsePrivateDict(parentDict) { 38180 if (!parentDict.hasName('Private')) { 38181 this.emptyPrivateDictionary(parentDict); 38182 return; 38183 } 38184 38185 var privateOffset = parentDict.getByName('Private'); 38186 38187 if (!Array.isArray(privateOffset) || privateOffset.length !== 2) { 38188 parentDict.removeByName('Private'); 38189 return; 38190 } 38191 38192 var size = privateOffset[0]; 38193 var offset = privateOffset[1]; 38194 38195 if (size === 0 || offset >= this.bytes.length) { 38196 this.emptyPrivateDictionary(parentDict); 38197 return; 38198 } 38199 38200 var privateDictEnd = offset + size; 38201 var dictData = this.bytes.subarray(offset, privateDictEnd); 38202 var dict = this.parseDict(dictData); 38203 var privateDict = this.createDict(CFFPrivateDict, dict, parentDict.strings); 38204 parentDict.privateDict = privateDict; 38205 38206 if (!privateDict.getByName('Subrs')) { 38207 return; 38208 } 38209 38210 var subrsOffset = privateDict.getByName('Subrs'); 38211 var relativeOffset = offset + subrsOffset; 38212 38213 if (subrsOffset === 0 || relativeOffset >= this.bytes.length) { 38214 this.emptyPrivateDictionary(parentDict); 38215 return; 38216 } 38217 38218 var subrsIndex = this.parseIndex(relativeOffset); 38219 privateDict.subrsIndex = subrsIndex.obj; 38220 }, 38221 parseCharsets: function CFFParser_parseCharsets(pos, length, strings, cid) { 38222 if (pos === 0) { 38223 return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, _charsets.ISOAdobeCharset); 38224 } else if (pos === 1) { 38225 return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, _charsets.ExpertCharset); 38226 } else if (pos === 2) { 38227 return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, _charsets.ExpertSubsetCharset); 38228 } 38229 38230 var bytes = this.bytes; 38231 var start = pos; 38232 var format = bytes[pos++]; 38233 var charset = ['.notdef']; 38234 var id, count, i; 38235 length -= 1; 38236 38237 switch (format) { 38238 case 0: 38239 for (i = 0; i < length; i++) { 38240 id = bytes[pos++] << 8 | bytes[pos++]; 38241 charset.push(cid ? id : strings.get(id)); 38242 } 38243 38244 break; 38245 38246 case 1: 38247 while (charset.length <= length) { 38248 id = bytes[pos++] << 8 | bytes[pos++]; 38249 count = bytes[pos++]; 38250 38251 for (i = 0; i <= count; i++) { 38252 charset.push(cid ? id++ : strings.get(id++)); 38253 } 38254 } 38255 38256 break; 38257 38258 case 2: 38259 while (charset.length <= length) {
38260 id = bytes[pos++] << 8 | bytes[pos++]; 38261 count = bytes[pos++] << 8 | bytes[pos++]; 38262 38263 for (i = 0; i <= count; i++) { 38264 charset.push(cid ? id++ : strings.get(id++)); 38265 } 38266 } 38267 38268 break; 38269 38270 default: 38271 throw new _util.FormatError('Unknown charset format'); 38272 } 38273 38274 var end = pos; 38275 var raw = bytes.subarray(start, end); 38276 return new CFFCharset(false, format, charset, raw); 38277 }, 38278 parseEncoding: function CFFParser_parseEncoding(pos, properties, strings, charset) { 38279 var encoding = Object.create(null); 38280 var bytes = this.bytes; 38281 var predefined = false; 38282 var format, i, ii; 38283 var raw = null; 38284 38285 function readSupplement() { 38286 var supplementsCount = bytes[pos++]; 38287 38288 for (i = 0; i < supplementsCount; i++) { 38289 var code = bytes[pos++]; 38290 var sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff); 38291 encoding[code] = charset.indexOf(strings.get(sid)); 38292 } 38293 } 38294 38295 if (pos === 0 || pos === 1) { 38296 predefined = true; 38297 format = pos; 38298 var baseEncoding = pos ? _encodings.ExpertEncoding : _encodings.StandardEncoding; 38299 38300 for (i = 0, ii = charset.length; i < ii; i++) { 38301 var index = baseEncoding.indexOf(charset[i]); 38302 38303 if (index !== -1) { 38304 encoding[index] = i; 38305 } 38306 } 38307 } else { 38308 var dataStart = pos; 38309 format = bytes[pos++]; 38310 38311 switch (format & 0x7f) { 38312 case 0: 38313 var glyphsCount = bytes[pos++]; 38314 38315 for (i = 1; i <= glyphsCount; i++) { 38316 encoding[bytes[pos++]] = i; 38317 } 38318 38319 break; 38320 38321 case 1: 38322 var rangesCount = bytes[pos++]; 38323 var gid = 1; 38324 38325 for (i = 0; i < rangesCount; i++) { 38326 var start = bytes[pos++]; 38327 var left = bytes[pos++]; 38328 38329 for (var j = start; j <= start + left; j++) { 38330 encoding[j] = gid++; 38331 } 38332 } 38333 38334 break; 38335 38336 default: 38337 throw new _util.FormatError("Unknown encoding format: ".concat(format, " in CFF")); 38338 } 38339 38340 var dataEnd = pos; 38341 38342 if (format & 0x80) { 38343 bytes[dataStart] &= 0x7f; 38344 readSupplement(); 38345 } 38346 38347 raw = bytes.subarray(dataStart, dataEnd); 38348 } 38349 38350 format = format & 0x7f; 38351 return new CFFEncoding(predefined, format, encoding, raw); 38352 }, 38353 parseFDSelect: function CFFParser_parseFDSelect(pos, length) { 38354 var bytes = this.bytes; 38355 var format = bytes[pos++]; 38356 var fdSelect = []; 38357 var i; 38358 38359 switch (format) { 38360 case 0: 38361 for (i = 0; i < length; ++i) { 38362 var id = bytes[pos++]; 38363 fdSelect.push(id); 38364 } 38365 38366 break; 38367 38368 case 3: 38369 var rangesCount = bytes[pos++] << 8 | bytes[pos++]; 38370 38371 for (i = 0; i < rangesCount; ++i) { 38372 var first = bytes[pos++] << 8 | bytes[pos++]; 38373 38374 if (i === 0 && first !== 0) { 38375 (0, _util.warn)('parseFDSelect: The first range must have a first GID of 0' + ' -- trying to recover.'); 38376 first = 0; 38377 } 38378 38379 var fdIndex = bytes[pos++]; 38380 var next = bytes[pos] << 8 | bytes[pos + 1]; 38381 38382 for (var j = first; j < next; ++j) { 38383 fdSelect.push(fdIndex); 38384 } 38385 } 38386 38387 pos += 2; 38388 break; 38389 38390 default: 38391 throw new _util.FormatError("parseFDSelect: Unknown format \"".concat(format, "\".")); 38392 } 38393 38394 if (fdSelect.length !== length) { 38395 throw new _util.FormatError('parseFDSelect: Invalid font data.'); 38396 } 38397 38398 return new CFFFDSelect(format, fdSelect); 38399 } 38400 }; 38401 return CFFParser; 38402}(); 38403 38404exports.CFFParser = CFFParser; 38405 38406var CFF = function CFFClosure() { 38407 function CFF() { 38408 this.header = null; 38409 this.names = []; 38410 this.topDict = null; 38411 this.strings = new CFFStrings();
38412 this.globalSubrIndex = null; 38413 this.encoding = null; 38414 this.charset = null; 38415 this.charStrings = null; 38416 this.fdArray = []; 38417 this.fdSelect = null; 38418 this.isCIDFont = false; 38419 } 38420 38421 CFF.prototype = { 38422 duplicateFirstGlyph: function CFF_duplicateFirstGlyph() { 38423 if (this.charStrings.count >= 65535) { 38424 (0, _util.warn)('Not enough space in charstrings to duplicate first glyph.'); 38425 return; 38426 } 38427 38428 var glyphZero = this.charStrings.get(0); 38429 this.charStrings.add(glyphZero); 38430 38431 if (this.isCIDFont) { 38432 this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]); 38433 } 38434 }, 38435 hasGlyphId: function CFF_hasGlyphID(id) { 38436 if (id < 0 || id >= this.charStrings.count) { 38437 return false; 38438 } 38439 38440 var glyph = this.charStrings.get(id); 38441 return glyph.length > 0; 38442 } 38443 }; 38444 return CFF; 38445}(); 38446 38447exports.CFF = CFF; 38448 38449var CFFHeader = function CFFHeaderClosure() { 38450 function CFFHeader(major, minor, hdrSize, offSize) { 38451 this.major = major; 38452 this.minor = minor; 38453 this.hdrSize = hdrSize; 38454 this.offSize = offSize; 38455 } 38456 38457 return CFFHeader; 38458}(); 38459 38460exports.CFFHeader = CFFHeader; 38461 38462var CFFStrings = function CFFStringsClosure() { 38463 function CFFStrings() { 38464 this.strings = []; 38465 } 38466 38467 CFFStrings.prototype = { 38468 get: function CFFStrings_get(index) { 38469 if (index >= 0 && index <= 390) { 38470 return CFFStandardStrings[index]; 38471 } 38472 38473 if (index - 391 <= this.strings.length) { 38474 return this.strings[index - 391]; 38475 } 38476 38477 return CFFStandardStrings[0]; 38478 }, 38479 add: function CFFStrings_add(value) { 38480 this.strings.push(value); 38481 }, 38482 38483 get count() { 38484 return this.strings.length; 38485 } 38486 38487 }; 38488 return CFFStrings; 38489}(); 38490 38491exports.CFFStrings = CFFStrings; 38492 38493var CFFIndex = function CFFIndexClosure() { 38494 function CFFIndex() { 38495 this.objects = []; 38496 this.length = 0; 38497 } 38498 38499 CFFIndex.prototype = { 38500 add: function CFFIndex_add(data) { 38501 this.length += data.length; 38502 this.objects.push(data); 38503 }, 38504 set: function CFFIndex_set(index, data) { 38505 this.length += data.length - this.objects[index].length; 38506 this.objects[index] = data; 38507 }, 38508 get: function CFFIndex_get(index) { 38509 return this.objects[index]; 38510 }, 38511 38512 get count() { 38513 return this.objects.length; 38514 } 38515 38516 }; 38517 return CFFIndex; 38518}(); 38519 38520exports.CFFIndex = CFFIndex; 38521 38522var CFFDict = function CFFDictClosure() { 38523 function CFFDict(tables, strings) { 38524 this.keyToNameMap = tables.keyToNameMap; 38525 this.nameToKeyMap = tables.nameToKeyMap; 38526 this.defaults = tables.defaults; 38527 this.types = tables.types; 38528 this.opcodes = tables.opcodes; 38529 this.order = tables.order; 38530 this.strings = strings; 38531 this.values = Object.create(null); 38532 } 38533 38534 CFFDict.prototype = { 38535 setByKey: function CFFDict_setByKey(key, value) { 38536 if (!(key in this.keyToNameMap)) { 38537 return false; 38538 } 38539 38540 var valueLength = value.length; 38541 38542 if (valueLength === 0) { 38543 return true; 38544 } 38545 38546 for (var i = 0; i < valueLength; i++) { 38547 if (isNaN(value[i])) { 38548 (0, _util.warn)('Invalid CFFDict value: "' + value + '" for key "' + key + '".'); 38549 return true; 38550 } 38551 } 38552 38553 var type = this.types[key]; 38554 38555 if (type === 'num' || type === 'sid' || type === 'offset') { 38556 value = value[0]; 38557 } 38558 38559 this.values[key] = value; 38560 return true; 38561 }, 38562 setByName: function CFFDict_setByName(name, value) { 38563 if (!(name in this.nameToKeyMap)) { 38564 throw new _util.FormatError("Invalid dictionary name \"".concat(name, "\"")); 38565 } 38566 38567 this.values[this.nameToKeyMap[name]] = value; 38568 }, 38569 hasName: function CFFDict_hasName(name) { 38570 return this.nameToKeyMap[name] in this.values; 38571 }, 38572 getByName: function CFFDict_getByName(name) { 38573 if (!(name in this.nameToKeyMap)) { 38574 throw new _util.FormatError("Invalid dictionary name ".concat(name, "\"")); 38575 } 38576 38577 var key = this.nameToKeyMap[name]; 38578 38579 if (!(key in this.values)) { 38580 return this.defaults[key]; 38581 } 38582 38583 return this.values[key]; 38584 }, 38585 removeByName: function CFFDict_removeByName(name) { 38586 delete this.values[this.nameToKeyMap[name]]; 38587 } 38588 }; 38589 38590 CFFDict.createTables = function CFFDict_createTables(layout) { 38591 var tables = { 38592 keyToNameMap: {}, 38593 nameToKeyMap: {}, 38594 defaults: {}, 38595 types: {}, 38596 opcodes: {}, 38597 order: [] 38598 }; 38599 38600 for (var i = 0, ii = layout.length; i < ii; ++i) { 38601 var entry = layout[i]; 38602 var key = Array.isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0]; 38603 tables.keyToNameMap[key] = entry[1]; 38604 tables.nameToKeyMap[entry[1]] = key; 38605 tables.types[key] = entry[2]; 38606 tables.defaults[key] = entry[3]; 38607 tables.opcodes[key] = Array.isArray(entry[0]) ? entry[0] : [entry[0]]; 38608 tables.order.push(key); 38609 } 38610 38611 return tables; 38612 }; 38613 38614 return CFFDict; 38615}();
vendor: 2,790 bytes, lines 38616-38651
38616 38617var CFFTopDict = function CFFTopDictClosure() { 38618 var layout = [[[12, 30], 'ROS', ['sid', 'sid', 'num'], null], [[12, 20], 'SyntheticBase', 'num', null], [0, 'version', 'sid', null], [1, 'Notice', 'sid', null], [[12, 0], 'Copyright', 'sid', null], [2, 'FullName', 'sid', null], [3, 'FamilyName', 'sid', null], [4, 'Weight', 'sid', null], [[12, 1], 'isFixedPitch', 'num', 0], [[12, 2], 'ItalicAngle', 'num', 0], [[12, 3], 'UnderlinePosition', 'num', -100], [[12, 4], 'UnderlineThickness', 'num', 50], [[12, 5], 'PaintType', 'num', 0], [[12, 6], 'CharstringType', 'num', 2], [[12, 7], 'FontMatrix', ['num', 'num', 'num', 'num', 'num', 'num'], [0.001, 0, 0, 0.001, 0, 0]], [13, 'UniqueID', 'num', null], [5, 'FontBBox', ['num', 'num', 'num', 'num'], [0, 0, 0, 0]], [[12, 8], 'StrokeWidth', 'num', 0], [14, 'XUID', 'array', null], [15, 'charset', 'offset', 0], [16, 'Encoding', 'offset', 0], [17, 'CharStrings', 'offset', 0], [18, 'Private', ['offset', 'offset'], null], [[12, 21], 'PostScript', 'sid', null], [[12, 22], 'BaseFontName', 'sid', null], [[12, 23], 'BaseFontBlend', 'delta', null], [[12, 31], 'CIDFontVersion', 'num', 0], [[12, 32], 'CIDFontRevision', 'num', 0], [[12, 33], 'CIDFontType', 'num', 0], [[12, 34], 'CIDCount', 'num', 8720], [[12, 35], 'UIDBase', 'num', null], [[12, 37], 'FDSelect', 'offset', null], [[12, 36], 'FDArray', 'offset', null], [[12, 38], 'FontName', 'sid', null]]; 38619 var tables = null; 38620 38621 function CFFTopDict(strings) { 38622 if (tables === null) { 38623 tables = CFFDict.createTables(layout); 38624 } 38625 38626 CFFDict.call(this, tables, strings); 38627 this.privateDict = null; 38628 } 38629 38630 CFFTopDict.prototype = Object.create(CFFDict.prototype); 38631 return CFFTopDict; 38632}(); 38633 38634exports.CFFTopDict = CFFTopDict; 38635 38636var CFFPrivateDict = function CFFPrivateDictClosure() { 38637 var layout = [[6, 'BlueValues', 'delta', null], [7, 'OtherBlues', 'delta', null], [8, 'FamilyBlues', 'delta', null], [9, 'FamilyOtherBlues', 'delta', null], [[12, 9], 'BlueScale', 'num', 0.039625], [[12, 10], 'BlueShift', 'num', 7], [[12, 11], 'BlueFuzz', 'num', 1], [10, 'StdHW', 'num', null], [11, 'StdVW', 'num', null], [[12, 12], 'StemSnapH', 'delta', null], [[12, 13], 'StemSnapV', 'delta', null], [[12, 14], 'ForceBold', 'num', 0], [[12, 17], 'LanguageGroup', 'num', 0], [[12, 18], 'ExpansionFactor', 'num', 0.06], [[12, 19], 'initialRandomSeed', 'num', 0], [20, 'defaultWidthX', 'num', 0], [21, 'nominalWidthX', 'num', 0], [19, 'Subrs', 'offset', null]]; 38638 var tables = null; 38639 38640 function CFFPrivateDict(strings) { 38641 if (tables === null) { 38642 tables = CFFDict.createTables(layout); 38643 } 38644 38645 CFFDict.call(this, tables, strings); 38646 this.subrsIndex = null; 38647 } 38648 38649 CFFPrivateDict.prototype = Object.create(CFFDict.prototype); 38650 return CFFPrivateDict; 38651}();
38652 38653exports.CFFPrivateDict = CFFPrivateDict; 38654var CFFCharsetPredefinedTypes = { 38655 ISO_ADOBE: 0, 38656 EXPERT: 1, 38657 EXPERT_SUBSET: 2 38658}; 38659 38660var CFFCharset = function CFFCharsetClosure() { 38661 function CFFCharset(predefined, format, charset, raw) { 38662 this.predefined = predefined; 38663 this.format = format; 38664 this.charset = charset; 38665 this.raw = raw; 38666 } 38667 38668 return CFFCharset; 38669}(); 38670 38671exports.CFFCharset = CFFCharset; 38672 38673var CFFEncoding = function CFFEncodingClosure() { 38674 function CFFEncoding(predefined, format, encoding, raw) { 38675 this.predefined = predefined; 38676 this.format = format; 38677 this.encoding = encoding; 38678 this.raw = raw; 38679 } 38680 38681 return CFFEncoding; 38682}(); 38683 38684var CFFFDSelect = function CFFFDSelectClosure() { 38685 function CFFFDSelect(format, fdSelect) { 38686 this.format = format; 38687 this.fdSelect = fdSelect; 38688 } 38689 38690 CFFFDSelect.prototype = { 38691 getFDIndex: function CFFFDSelect_get(glyphIndex) { 38692 if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { 38693 return -1; 38694 } 38695 38696 return this.fdSelect[glyphIndex]; 38697 } 38698 }; 38699 return CFFFDSelect; 38700}(); 38701 38702exports.CFFFDSelect = CFFFDSelect; 38703 38704var CFFOffsetTracker = function CFFOffsetTrackerClosure() { 38705 function CFFOffsetTracker() { 38706 this.offsets = Object.create(null); 38707 } 38708 38709 CFFOffsetTracker.prototype = { 38710 isTracking: function CFFOffsetTracker_isTracking(key) { 38711 return key in this.offsets; 38712 }, 38713 track: function CFFOffsetTracker_track(key, location) { 38714 if (key in this.offsets) { 38715 throw new _util.FormatError("Already tracking location of ".concat(key)); 38716 } 38717 38718 this.offsets[key] = location; 38719 }, 38720 offset: function CFFOffsetTracker_offset(value) { 38721 for (var key in this.offsets) { 38722 this.offsets[key] += value; 38723 } 38724 }, 38725 setEntryLocation: function CFFOffsetTracker_setEntryLocation(key, values, output) { 38726 if (!(key in this.offsets)) { 38727 throw new _util.FormatError("Not tracking location of ".concat(key)); 38728 } 38729 38730 var data = output.data; 38731 var dataOffset = this.offsets[key]; 38732 var size = 5; 38733 38734 for (var i = 0, ii = values.length; i < ii; ++i) { 38735 var offset0 = i * size + dataOffset; 38736 var offset1 = offset0 + 1; 38737 var offset2 = offset0 + 2; 38738 var offset3 = offset0 + 3; 38739 var offset4 = offset0 + 4; 38740 38741 if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { 38742 throw new _util.FormatError('writing to an offset that is not empty'); 38743 } 38744 38745 var value = values[i]; 38746 data[offset0] = 0x1d; 38747 data[offset1] = value >> 24 & 0xFF; 38748 data[offset2] = value >> 16 & 0xFF; 38749 data[offset3] = value >> 8 & 0xFF; 38750 data[offset4] = value & 0xFF; 38751 } 38752 } 38753 }; 38754 return CFFOffsetTracker; 38755}(); 38756 38757var CFFCompiler = function CFFCompilerClosure() { 38758 function CFFCompiler(cff) { 38759 this.cff = cff; 38760 } 38761 38762 CFFCompiler.prototype = { 38763 compile: function CFFCompiler_compile() { 38764 var cff = this.cff; 38765 var output = { 38766 data: [], 38767 length: 0, 38768 add: function CFFCompiler_add(data) { 38769 this.data = this.data.concat(data); 38770 this.length = this.data.length; 38771 } 38772 }; 38773 var header = this.compileHeader(cff.header); 38774 output.add(header); 38775 var nameIndex = this.compileNameIndex(cff.names); 38776 output.add(nameIndex); 38777 38778 if (cff.isCIDFont) { 38779 if (cff.topDict.hasName('FontMatrix')) { 38780 var base = cff.topDict.getByName('FontMatrix'); 38781 cff.topDict.removeByName('FontMatrix'); 38782 38783 for (var i = 0, ii = cff.fdArray.length; i < ii; i++) { 38784 var subDict = cff.fdArray[i]; 38785 var matrix = base.slice(0); 38786 38787 if (subDict.hasName('FontMatrix')) { 38788 matrix = _util.Util.transform(matrix, subDict.getByName('FontMatrix')); 38789 } 38790 38791 subDict.setByName('FontMatrix', matrix); 38792 } 38793 } 38794 } 38795 38796 cff.topDict.setByName('charset', 0); 38797 var compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); 38798 output.add(compiled.output); 38799 var topDictTracker = compiled.trackers[0]; 38800 var stringIndex = this.compileStringIndex(cff.strings.strings); 38801 output.add(stringIndex); 38802 var globalSubrIndex = this.compileIndex(cff.globalSubrIndex); 38803 output.add(globalSubrIndex); 38804 38805 if (cff.encoding && cff.topDict.hasName('Encoding')) { 38806 if (cff.encoding.predefined) { 38807 topDictTracker.setEntryLocation('Encoding', [cff.encoding.format], output); 38808 } else { 38809 var encoding = this.compileEncoding(cff.encoding); 38810 topDictTracker.setEntryLocation('Encoding', [output.length], output); 38811 output.add(encoding); 38812 } 38813 } 38814 38815 var charset = this.compileCharset(cff.charset); 38816 topDictTracker.setEntryLocation('charset', [output.length], output); 38817 output.add(charset); 38818 var charStrings = this.compileCharStrings(cff.charStrings); 38819 topDictTracker.setEntryLocation('CharStrings', [output.length], output); 38820 output.add(charStrings); 38821 38822 if (cff.isCIDFont) { 38823 topDictTracker.setEntryLocation('FDSelect', [output.length], output); 38824 var fdSelect = this.compileFDSelect(cff.fdSelect); 38825 output.add(fdSelect); 38826 compiled = this.compileTopDicts(cff.fdArray, output.length, true); 38827 topDictTracker.setEntryLocation('FDArray', [output.length], output); 38828 output.add(compiled.output); 38829 var fontDictTrackers = compiled.trackers; 38830 this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); 38831 } 38832 38833 this.compilePrivateDicts([cff.topDict], [topDictTracker], output); 38834 output.add([0]); 38835 return output.data; 38836 }, 38837 encodeNumber: function CFFCompiler_encodeNumber(value) { 38838 if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { 38839 return this.encodeInteger(value); 38840 } 38841 38842 return this.encodeFloat(value); 38843 }, 38844 encodeFloat: function CFFCompiler_encodeFloat(num) { 38845 var value = num.toString(); 38846 var m = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(value); 38847 38848 if (m) { 38849 var epsilon = parseFloat('1e' + ((m[2] ? +m[2] : 0) + m[1].length)); 38850 value = (Math.round(num * epsilon) / epsilon).toString(); 38851 } 38852 38853 var nibbles = ''; 38854 var i, ii; 38855 38856 for (i = 0, ii = value.length; i < ii; ++i) { 38857 var a = value[i]; 38858 38859 if (a === 'e') { 38860 nibbles += value[++i] === '-' ? 'c' : 'b'; 38861 } else if (a === '.') { 38862 nibbles += 'a'; 38863 } else if (a === '-') { 38864 nibbles += 'e'; 38865 } else { 38866 nibbles += a; 38867 } 38868 } 38869 38870 nibbles += nibbles.length & 1 ? 'f' : 'ff'; 38871 var out = [30]; 38872 38873 for (i = 0, ii = nibbles.length; i < ii; i += 2) { 38874 out.push(parseInt(nibbles.substring(i, i + 2), 16)); 38875 } 38876 38877 return out; 38878 }, 38879 encodeInteger: function CFFCompiler_encodeInteger(value) { 38880 var code; 38881 38882 if (value >= -107 && value <= 107) { 38883 code = [value + 139]; 38884 } else if (value >= 108 && value <= 1131) { 38885 value = value - 108; 38886 code = [(value >> 8) + 247, value & 0xFF]; 38887 } else if (value >= -1131 && value <= -108) { 38888 value = -value - 108; 38889 code = [(value >> 8) + 251, value & 0xFF]; 38890 } else if (value >= -32768 && value <= 32767) { 38891 code = [0x1c, value >> 8 & 0xFF, value & 0xFF]; 38892 } else { 38893 code = [0x1d, value >> 24 & 0xFF, value >> 16 & 0xFF, value >> 8 & 0xFF, value & 0xFF]; 38894 } 38895 38896 return code; 38897 }, 38898 compileHeader: function CFFCompiler_compileHeader(header) { 38899 return [header.major, header.minor, header.hdrSize, header.offSize]; 38900 }, 38901 compileNameIndex: function CFFCompiler_compileNameIndex(names) { 38902 var nameIndex = new CFFIndex(); 38903 38904 for (var i = 0, ii = names.length; i < ii; ++i) { 38905 var name = names[i]; 38906 var length = Math.min(name.length, 127);
38907 var sanitizedName = new Array(length); 38908 38909 for (var j = 0; j < length; j++) { 38910 var char = name[j]; 38911 38912 if (char < '!' || char > '~' || char === '[' || char === ']' || char === '(' || char === ')' || char === '{' || char === '}' || char === '<' || char === '>' || char === '/' || char === '%') { 38913 char = '_'; 38914 } 38915 38916 sanitizedName[j] = char; 38917 } 38918 38919 sanitizedName = sanitizedName.join(''); 38920 38921 if (sanitizedName === '') { 38922 sanitizedName = 'Bad_Font_Name'; 38923 } 38924 38925 nameIndex.add((0, _util.stringToBytes)(sanitizedName)); 38926 } 38927 38928 return this.compileIndex(nameIndex); 38929 }, 38930 compileTopDicts: function CFFCompiler_compileTopDicts(dicts, length, removeCidKeys) { 38931 var fontDictTrackers = []; 38932 var fdArrayIndex = new CFFIndex(); 38933 38934 for (var i = 0, ii = dicts.length; i < ii; ++i) { 38935 var fontDict = dicts[i]; 38936 38937 if (removeCidKeys) { 38938 fontDict.removeByName('CIDFontVersion'); 38939 fontDict.removeByName('CIDFontRevision'); 38940 fontDict.removeByName('CIDFontType'); 38941 fontDict.removeByName('CIDCount'); 38942 fontDict.removeByName('UIDBase'); 38943 } 38944 38945 var fontDictTracker = new CFFOffsetTracker(); 38946 var fontDictData = this.compileDict(fontDict, fontDictTracker); 38947 fontDictTrackers.push(fontDictTracker); 38948 fdArrayIndex.add(fontDictData); 38949 fontDictTracker.offset(length); 38950 } 38951 38952 fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); 38953 return { 38954 trackers: fontDictTrackers, 38955 output: fdArrayIndex 38956 }; 38957 }, 38958 compilePrivateDicts: function CFFCompiler_compilePrivateDicts(dicts, trackers, output) { 38959 for (var i = 0, ii = dicts.length; i < ii; ++i) { 38960 var fontDict = dicts[i]; 38961 var privateDict = fontDict.privateDict; 38962 38963 if (!privateDict || !fontDict.hasName('Private')) { 38964 throw new _util.FormatError('There must be a private dictionary.'); 38965 } 38966 38967 var privateDictTracker = new CFFOffsetTracker(); 38968 var privateDictData = this.compileDict(privateDict, privateDictTracker); 38969 var outputLength = output.length; 38970 privateDictTracker.offset(outputLength); 38971 38972 if (!privateDictData.length) { 38973 outputLength = 0; 38974 } 38975 38976 trackers[i].setEntryLocation('Private', [privateDictData.length, outputLength], output); 38977 output.add(privateDictData); 38978 38979 if (privateDict.subrsIndex && privateDict.hasName('Subrs')) { 38980 var subrs = this.compileIndex(privateDict.subrsIndex); 38981 privateDictTracker.setEntryLocation('Subrs', [privateDictData.length], output); 38982 output.add(subrs); 38983 } 38984 } 38985 }, 38986 compileDict: function CFFCompiler_compileDict(dict, offsetTracker) { 38987 var out = []; 38988 var order = dict.order; 38989 38990 for (var i = 0; i < order.length; ++i) { 38991 var key = order[i]; 38992 38993 if (!(key in dict.values)) { 38994 continue; 38995 } 38996 38997 var values = dict.values[key]; 38998 var types = dict.types[key]; 38999 39000 if (!Array.isArray(types)) { 39001 types = [types]; 39002 } 39003 39004 if (!Array.isArray(values)) { 39005 values = [values]; 39006 } 39007 39008 if (values.length === 0) { 39009 continue; 39010 } 39011 39012 for (var j = 0, jj = types.length; j < jj; ++j) { 39013 var type = types[j]; 39014 var value = values[j]; 39015 39016 switch (type) { 39017 case 'num': 39018 case 'sid': 39019 out = out.concat(this.encodeNumber(value)); 39020 break; 39021 39022 case 'offset': 39023 var name = dict.keyToNameMap[key]; 39024 39025 if (!offsetTracker.isTracking(name)) { 39026 offsetTracker.track(name, out.length); 39027 } 39028 39029 out = out.concat([0x1d, 0, 0, 0, 0]); 39030 break; 39031 39032 case 'array': 39033 case 'delta': 39034 out = out.concat(this.encodeNumber(value)); 39035 39036 for (var k = 1, kk = values.length; k < kk; ++k) { 39037 out = out.concat(this.encodeNumber(values[k])); 39038 } 39039 39040 break; 39041 39042 default: 39043 throw new _util.FormatError("Unknown data type of ".concat(type)); 39044 } 39045 } 39046 39047 out = out.concat(dict.opcodes[key]); 39048 } 39049 39050 return out; 39051 }, 39052 compileStringIndex: function CFFCompiler_compileStringIndex(strings) { 39053 var stringIndex = new CFFIndex(); 39054 39055 for (var i = 0, ii = strings.length; i < ii; ++i) {
39056 stringIndex.add((0, _util.stringToBytes)(strings[i])); 39057 } 39058 39059 return this.compileIndex(stringIndex); 39060 }, 39061 compileGlobalSubrIndex: function CFFCompiler_compileGlobalSubrIndex() { 39062 var globalSubrIndex = this.cff.globalSubrIndex; 39063 this.out.writeByteArray(this.compileIndex(globalSubrIndex)); 39064 }, 39065 compileCharStrings: function CFFCompiler_compileCharStrings(charStrings) { 39066 var charStringsIndex = new CFFIndex(); 39067 39068 for (var i = 0; i < charStrings.count; i++) { 39069 var glyph = charStrings.get(i); 39070 39071 if (glyph.length === 0) { 39072 charStringsIndex.add(new Uint8Array([0x8B, 0x0E])); 39073 continue; 39074 } 39075 39076 charStringsIndex.add(glyph); 39077 } 39078 39079 return this.compileIndex(charStringsIndex); 39080 }, 39081 compileCharset: function CFFCompiler_compileCharset(charset) { 39082 var length = 1 + (this.cff.charStrings.count - 1) * 2; 39083 var out = new Uint8Array(length); 39084 return this.compileTypedArray(out); 39085 }, 39086 compileEncoding: function CFFCompiler_compileEncoding(encoding) { 39087 return this.compileTypedArray(encoding.raw); 39088 }, 39089 compileFDSelect: function CFFCompiler_compileFDSelect(fdSelect) { 39090 var format = fdSelect.format; 39091 var out, i; 39092 39093 switch (format) { 39094 case 0: 39095 out = new Uint8Array(1 + fdSelect.fdSelect.length); 39096 out[0] = format; 39097 39098 for (i = 0; i < fdSelect.fdSelect.length; i++) { 39099 out[i + 1] = fdSelect.fdSelect[i]; 39100 } 39101 39102 break; 39103 39104 case 3: 39105 var start = 0; 39106 var lastFD = fdSelect.fdSelect[0]; 39107 var ranges = [format, 0, 0, start >> 8 & 0xFF, start & 0xFF, lastFD]; 39108 39109 for (i = 1; i < fdSelect.fdSelect.length; i++) { 39110 var currentFD = fdSelect.fdSelect[i]; 39111 39112 if (currentFD !== lastFD) { 39113 ranges.push(i >> 8 & 0xFF, i & 0xFF, currentFD); 39114 lastFD = currentFD; 39115 } 39116 } 39117 39118 var numRanges = (ranges.length - 3) / 3; 39119 ranges[1] = numRanges >> 8 & 0xFF; 39120 ranges[2] = numRanges & 0xFF; 39121 ranges.push(i >> 8 & 0xFF, i & 0xFF); 39122 out = new Uint8Array(ranges); 39123 break; 39124 } 39125 39126 return this.compileTypedArray(out); 39127 }, 39128 compileTypedArray: function CFFCompiler_compileTypedArray(data) { 39129 var out = []; 39130 39131 for (var i = 0, ii = data.length; i < ii; ++i) { 39132 out[i] = data[i]; 39133 } 39134 39135 return out; 39136 }, 39137 compileIndex: function CFFCompiler_compileIndex(index, trackers) { 39138 trackers = trackers || []; 39139 var objects = index.objects; 39140 var count = objects.length; 39141 39142 if (count === 0) { 39143 return [0, 0, 0]; 39144 } 39145 39146 var data = [count >> 8 & 0xFF, count & 0xff]; 39147 var lastOffset = 1, 39148 i; 39149 39150 for (i = 0; i < count; ++i) { 39151 lastOffset += objects[i].length; 39152 } 39153 39154 var offsetSize; 39155 39156 if (lastOffset < 0x100) { 39157 offsetSize = 1; 39158 } else if (lastOffset < 0x10000) { 39159 offsetSize = 2; 39160 } else if (lastOffset < 0x1000000) { 39161 offsetSize = 3; 39162 } else { 39163 offsetSize = 4; 39164 } 39165 39166 data.push(offsetSize); 39167 var relativeOffset = 1; 39168 39169 for (i = 0; i < count + 1; i++) { 39170 if (offsetSize === 1) { 39171 data.push(relativeOffset & 0xFF); 39172 } else if (offsetSize === 2) { 39173 data.push(relativeOffset >> 8 & 0xFF, relativeOffset & 0xFF); 39174 } else if (offsetSize === 3) { 39175 data.push(relativeOffset >> 16 & 0xFF, relativeOffset >> 8 & 0xFF, relativeOffset & 0xFF); 39176 } else { 39177 data.push(relativeOffset >>> 24 & 0xFF, relativeOffset >> 16 & 0xFF, relativeOffset >> 8 & 0xFF, relativeOffset & 0xFF); 39178 } 39179 39180 if (objects[i]) { 39181 relativeOffset += objects[i].length; 39182 } 39183 } 39184 39185 for (i = 0; i < count; i++) { 39186 if (trackers[i]) { 39187 trackers[i].offset(data.length); 39188 } 39189 39190 for (var j = 0, jj = objects[i].length; j < jj; j++) { 39191 data.push(objects[i][j]); 39192 } 39193 } 39194 39195 return data; 39196 } 39197 }; 39198 return CFFCompiler; 39199}();
39200 39201exports.CFFCompiler = CFFCompiler; 39202 39203/***/ }), 39204/* 175 */ 39205/***/ (function(module, exports, __w_pdfjs_require__) { 39206 39207"use strict"; 39208 39209 39210Object.defineProperty(exports, "__esModule", { 39211 value: true 39212}); 39213exports.ExpertSubsetCharset = exports.ExpertCharset = exports.ISOAdobeCharset = void 0; 39214var ISOAdobeCharset = ['.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'exclamdown', 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'endash', 'dagger', 'daggerdbl', 'periodcentered', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', 'questiondown', 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron', 'emdash', 'AE', 'ordfeminine', 'Lslash', 'Oslash', 'OE', 'ordmasculine', 'ae', 'dotlessi', 'lslash', 'oslash', 'oe', 'germandbls', 'onesuperior', 'logicalnot', 'mu', 'trademark', 'Eth', 'onehalf', 'plusminus', 'Thorn', 'onequarter', 'divide', 'brokenbar', 'degree', 'thorn', 'threequarters', 'twosuperior', 'registered', 'minus', 'eth', 'multiply', 'threesuperior', 'copyright', 'Aacute', 'Acircumflex', 'Adieresis', 'Agrave', 'Aring', 'Atilde', 'Ccedilla', 'Eacute', 'Ecircumflex', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Ntilde', 'Oacute', 'Ocircumflex', 'Odieresis', 'Ograve', 'Otilde', 'Scaron', 'Uacute', 'Ucircumflex', 'Udieresis', 'Ugrave', 'Yacute', 'Ydieresis', 'Zcaron', 'aacute', 'acircumflex', 'adieresis', 'agrave', 'aring', 'atilde', 'ccedilla', 'eacute', 'ecircumflex', 'edieresis', 'egrave', 'iacute', 'icircumflex', 'idieresis', 'igrave', 'ntilde', 'oacute', 'ocircumflex', 'odieresis', 'ograve', 'otilde', 'scaron', 'uacute', 'ucircumflex', 'udieresis', 'ugrave', 'yacute', 'ydieresis', 'zcaron']; 39215exports.ISOAdobeCharset = ISOAdobeCharset; 39216var ExpertCharset = ['.notdef', 'space', 'exclamsmall', 'Hungarumlautsmall', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'questionsmall', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', 'Tildesmall', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', 'Dotaccentsmall', 'Macronsmall', 'figuredash', 'hypheninferior', 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', 'onequarter', 'onehalf', 'threequarters', 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', 'Ydieresissmall']; 39217exports.ExpertCharset = ExpertCharset; 39218var ExpertSubsetCharset = ['.notdef', 'space', 'dollaroldstyle', 'dollarsuperior', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', 'isuperior', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', 'rsuperior', 'ssuperior', 'tsuperior', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', 'parenrightinferior', 'hyphensuperior', 'colonmonetary', 'onefitted', 'rupiah', 'centoldstyle', 'figuredash', 'hypheninferior', 'onequarter', 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', 'zerosuperior', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior']; 39219exports.ExpertSubsetCharset = ExpertSubsetCharset; 39220 39221/***/ }), 39222/* 176 */ 39223/***/ (function(module, exports, __w_pdfjs_require__) { 39224 39225"use strict"; 39226 39227 39228Object.defineProperty(exports, "__esModule", { 39229 value: true 39230}); 39231exports.getEncoding = getEncoding; 39232exports.ExpertEncoding = exports.ZapfDingbatsEncoding = exports.SymbolSetEncoding = exports.MacRomanEncoding = exports.StandardEncoding = exports.WinAnsiEncoding = void 0; 39233var ExpertEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclamsmall', 'Hungarumlautsmall', '', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior', 'questionsmall', '', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior', 'esuperior', '', '', '', 'isuperior', '', '', 'lsuperior', 'msuperior', 'nsuperior', 'osuperior', '', '', 'rsuperior', 'ssuperior', 'tsuperior', '', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall', 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', 'Tildesmall', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall', '', '', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall', 'Caronsmall', '', 'Dotaccentsmall', '', '', 'Macronsmall', '', '', 'f
39233iguredash', 'hypheninferior', '', '', 'Ogoneksmall', 'Ringsmall', 'Cedillasmall', '', '', '', 'onequarter', 'onehalf', 'threequarters', 'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', '', '', 'zerosuperior', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior', 'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior', 'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior', 'seveninferior', 'eightinferior', 'nineinferior', 'centinferior', 'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall', 'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall', 'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall', 'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall', 'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall', 'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall', 'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall', 'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall', 'Ydieresissmall']; 39234exports.ExpertEncoding = ExpertEncoding; 39235var MacExpertEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclamsmall', 'Hungarumlautsmall', 'centoldstyle', 'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior', 'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon', 'semicolon', '', 'threequartersemdash', '', 'questionsmall', '', '', '', '', 'Ethsmall', '', '', 'onequarter', 'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths', 'seveneighths', 'onethird', 'twothirds', '', '', '', '', '', '', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'parenrightinferior', 'Circumflexsmall', 'hypheninferior', 'Gravesmall', 'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah', 'Tildesmall', '', '', 'asuperior', 'centsuperior', '', '', '', '', 'Aacutesmall', 'Agravesmall', 'Acircumflexsmall', 'Adieresissmall', 'Atildesmall', 'Aringsmall', 'Ccedillasmall', 'Eacutesmall', 'Egravesmall', 'Ecircumflexsmall', 'Edieresissmall', 'Iacutesmall', 'Igravesmall', 'Icircumflexsmall', 'Idieresissmall', 'Ntildesmall', 'Oacutesmall', 'Ogravesmall', 'Ocircumflexsmall', 'Odieresissmall', 'Otildesmall', 'Uacutesmall', 'Ugravesmall', 'Ucircumflexsmall', 'Udieresissmall', '', 'eightsuperior', 'fourinferior', 'threeinferior', 'sixinferior', 'eightinferior', 'seveninferior', 'Scaronsmall', '', 'centinferior', 'twoinferior', '', 'Dieresissmall', '', 'Caronsmall', 'osuperior', 'fiveinferior', '', 'commainferior', 'periodinferior', 'Yacutesmall', '', 'dollarinferior', '', '', 'Thornsmall', '', 'nineinferior', 'zeroinferior', 'Zcaronsmall', 'AEsmall', 'Oslashsmall', 'questiondownsmall', 'oneinferior', 'Lslashsmall', '', '', '', '', '', '', 'Cedillasmall', '', '', '', '', '', 'OEsmall', 'figuredash', 'hyphensuperior', '', '', '', '', 'exclamdownsmall', '', 'Ydieresissmall', '', 'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior', 'sevensuperior', 'ninesuperior', 'zerosuperior', '', 'esuperior', 'rsuperior', 'tsuperior', '', '', 'isuperior', 'ssuperior', 'dsuperior', '', '', '', '', '', 'lsuperior', 'Ogoneksmall', 'Brevesmall', 'Macronsmall', 'bsuperior', 'nsuperior', 'msuperior', 'commasuperior', 'periodsuperior', 'Dotaccentsmall', 'Ringsmall', '', '', '', '']; 39236var MacRomanEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', '', 'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis', 'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde', 'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis', 'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute', 'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave', 'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling', 'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright', 'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity', 'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff', 'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine', 'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot', 'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft', 'guillemotright', 'ellipsis', 'space', 'Agrave', 'Atilde', 'Otilde', 'OE', 'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft', 'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction', 'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl', 'periodce
39236ntered', 'quotesinglbase', 'quotedblbase', 'perthousand', 'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple', 'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut', 'ogonek', 'caron']; 39237exports.MacRomanEncoding = MacRomanEncoding; 39238var StandardEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdown', 'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency', 'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', '', 'endash', 'dagger', 'daggerdbl', 'periodcentered', '', 'paragraph', 'bullet', 'quotesinglbase', 'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis', 'perthousand', '', 'questiondown', '', 'grave', 'acute', 'circumflex', 'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', '', 'ring', 'cedilla', '', 'hungarumlaut', 'ogonek', 'caron', 'emdash', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'AE', '', 'ordfeminine', '', '', '', '', 'Lslash', 'Oslash', 'OE', 'ordmasculine', '', '', '', '', '', 'ae', '', '', '', 'dotlessi', '', '', 'lslash', 'oslash', 'oe', 'germandbls', '', '', '', '']; 39239exports.StandardEncoding = StandardEncoding; 39240var WinAnsiEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent', 'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus', 'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright', 'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', 'bullet', 'Euro', 'bullet', 'quotesinglbase', 'florin', 'quotedblbase', 'ellipsis', 'dagger', 'daggerdbl', 'circumflex', 'perthousand', 'Scaron', 'guilsinglleft', 'OE', 'bullet', 'Zcaron', 'bullet', 'bullet', 'quoteleft', 'quoteright', 'quotedblleft', 'quotedblright', 'bullet', 'endash', 'emdash', 'tilde', 'trademark', 'scaron', 'guilsinglright', 'oe', 'bullet', 'zcaron', 'Ydieresis', 'space', 'exclamdown', 'cent', 'sterling', 'currency', 'yen', 'brokenbar', 'section', 'dieresis', 'copyright', 'ordfeminine', 'guillemotleft', 'logicalnot', 'hyphen', 'registered', 'macron', 'degree', 'plusminus', 'twosuperior', 'threesuperior', 'acute', 'mu', 'paragraph', 'periodcentered', 'cedilla', 'onesuperior', 'ordmasculine', 'guillemotright', 'onequarter', 'onehalf', 'threequarters', 'questiondown', 'Agrave', 'Aacute', 'Acircumflex', 'Atilde', 'Adieresis', 'Aring', 'AE', 'Ccedilla', 'Egrave', 'Eacute', 'Ecircumflex', 'Edieresis', 'Igrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Eth', 'Ntilde', 'Ograve', 'Oacute', 'Ocircumflex', 'Otilde', 'Odieresis', 'multiply', 'Oslash', 'Ugrave', 'Uacute', 'Ucircumflex', 'Udieresis', 'Yacute', 'Thorn', 'germandbls', 'agrave', 'aacute', 'acircumflex', 'atilde', 'adieresis', 'aring', 'ae', 'ccedilla', 'egrave', 'eacute', 'ecircumflex', 'edieresis', 'igrave', 'iacute', 'icircumflex', 'idieresis', 'eth', 'ntilde', 'ograve', 'oacute', 'ocircumflex', 'otilde', 'odieresis', 'divi
39240de', 'oslash', 'ugrave', 'uacute', 'ucircumflex', 'udieresis', 'yacute', 'thorn', 'ydieresis']; 39241exports.WinAnsiEncoding = WinAnsiEncoding; 39242var SymbolSetEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'exclam', 'universal', 'numbersign', 'existential', 'percent', 'ampersand', 'suchthat', 'parenleft', 'parenright', 'asteriskmath', 'plus', 'comma', 'minus', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less', 'equal', 'greater', 'question', 'congruent', 'Alpha', 'Beta', 'Chi', 'Delta', 'Epsilon', 'Phi', 'Gamma', 'Eta', 'Iota', 'theta1', 'Kappa', 'Lambda', 'Mu', 'Nu', 'Omicron', 'Pi', 'Theta', 'Rho', 'Sigma', 'Tau', 'Upsilon', 'sigma1', 'Omega', 'Xi', 'Psi', 'Zeta', 'bracketleft', 'therefore', 'bracketright', 'perpendicular', 'underscore', 'radicalex', 'alpha', 'beta', 'chi', 'delta', 'epsilon', 'phi', 'gamma', 'eta', 'iota', 'phi1', 'kappa', 'lambda', 'mu', 'nu', 'omicron', 'pi', 'theta', 'rho', 'sigma', 'tau', 'upsilon', 'omega1', 'omega', 'xi', 'psi', 'zeta', 'braceleft', 'bar', 'braceright', 'similar', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'Euro', 'Upsilon1', 'minute', 'lessequal', 'fraction', 'infinity', 'florin', 'club', 'diamond', 'heart', 'spade', 'arrowboth', 'arrowleft', 'arrowup', 'arrowright', 'arrowdown', 'degree', 'plusminus', 'second', 'greaterequal', 'multiply', 'proportional', 'partialdiff', 'bullet', 'divide', 'notequal', 'equivalence', 'approxequal', 'ellipsis', 'arrowvertex', 'arrowhorizex', 'carriagereturn', 'aleph', 'Ifraktur', 'Rfraktur', 'weierstrass', 'circlemultiply', 'circleplus', 'emptyset', 'intersection', 'union', 'propersuperset', 'reflexsuperset', 'notsubset', 'propersubset', 'reflexsubset', 'element', 'notelement', 'angle', 'gradient', 'registerserif', 'copyrightserif', 'trademarkserif', 'product', 'radical', 'dotmath', 'logicalnot', 'logicaland', 'logicalor', 'arrowdblboth', 'arrowdblleft', 'arrowdblup', 'arrowdblright', 'arrowdbldown', 'lozenge', 'angleleft', 'registersans', 'copyrightsans', 'trademarksans', 'summation', 'parenlefttp', 'parenleftex', 'parenleftbt', 'bracketlefttp', 'bracketleftex', 'bracketleftbt', 'bracelefttp', 'braceleftmid', 'braceleftbt', 'braceex', '', 'angleright', 'integral', 'integraltp', 'integralex', 'integralbt', 'parenrighttp', 'parenrightex', 'parenrightbt', 'bracketrighttp', 'bracketrightex', 'bracketrightbt', 'bracerighttp', 'bracerightmid', 'bracerightbt', '']; 39243exports.SymbolSetEncoding = SymbolSetEncoding; 39244var ZapfDingbatsEncoding = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'space', 'a1', 'a2', 'a202', 'a3', 'a4', 'a5', 'a119', 'a118', 'a117', 'a11', 'a12', 'a13', 'a14', 'a15', 'a16', 'a105', 'a17', 'a18', 'a19', 'a20', 'a21', 'a22', 'a23', 'a24', 'a25', 'a26', 'a27', 'a28', 'a6', 'a7', 'a8', 'a9', 'a10', 'a29', 'a30', 'a31', 'a32', 'a33', 'a34', 'a35', 'a36', 'a37', 'a38', 'a39', 'a40', 'a41', 'a42', 'a43', 'a44', 'a45', 'a46', 'a47', 'a48', 'a49', 'a50', 'a51', 'a52', 'a53', 'a54', 'a55', 'a56', 'a57', 'a58', 'a59', 'a60', 'a61', 'a62', 'a63', 'a64', 'a65', 'a66', 'a67', 'a68', 'a69', 'a70', 'a71', 'a72', 'a73', 'a74', 'a203', 'a75', 'a204', 'a76', 'a77', 'a78', 'a79', 'a81', 'a82', 'a83', 'a84', 'a97', 'a98', 'a99', 'a100', '', 'a89', 'a90', 'a93', 'a94', 'a91', 'a92', 'a205', 'a85', 'a206', 'a86', 'a87', 'a88', 'a95', 'a96', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'a101', 'a102', 'a103', 'a104', 'a106', 'a107', 'a108', 'a112', 'a111', 'a110', 'a109', 'a120', 'a121', 'a122', 'a123', 'a124', 'a125', 'a126', 'a127', 'a128', 'a129', 'a130', 'a131', 'a132', 'a133', 'a134', 'a135', 'a136', 'a137', 'a138', 'a139', 'a140', 'a141', 'a142', 'a143', 'a144', 'a145', 'a146', 'a147', 'a148', 'a149', 'a150', 'a151', 'a152', 'a153', 'a154', 'a155', 'a156', 'a157', 'a158', 'a159', 'a160', 'a161', 'a163', 'a164', 'a196', 'a165', 'a192', 'a166', 'a167', 'a168', 'a169', 'a170', 'a171', 'a172', 'a173', 'a162', 'a174', 'a175', 'a176', 'a177', 'a178', 'a179', 'a193', 'a180', 'a199', 'a181', 'a200', 'a182', '', 'a201', 'a183', 'a184', 'a197', 'a185', 'a194', 'a198', 'a186', 'a195', 'a187', 'a188', 'a189', 'a190', 'a191', '']; 39245exports.ZapfDingbatsEncoding = ZapfDingbatsEncoding; 39246 39247function getEncoding(encodingName) { 39248 switch (encodingName) { 39249 case 'WinAnsiEncoding': 39250 return WinAnsiEncoding; 39251 39252 case 'StandardEncoding': 39253 return StandardEncoding; 39254 39255 case 'MacRomanEncoding': 39256 return MacRomanEncoding; 39257 39258 case 'SymbolSetEncoding': 39259 return SymbolSetEncoding; 39260 39261 case 'ZapfDingbatsEncoding': 39262 return ZapfDingbatsEncoding; 39263 39264 case 'ExpertEncoding': 39265 return ExpertEncoding; 39266 39267 case 'MacExpertEncoding': 39268 return MacExpertEncoding; 39269 39270 default: 39271 return null; 39272 } 39273} 39274 39275/***/ }), 39276/* 177 */ 39277/***/ (function(module, exports, __w_pdfjs_require__) { 39278 39279var getLookupTableFactory = __w_pdfjs_require__(6).getLookupTableFactory;
39280var getGlyphsUnicode = getLookupTableFactory(function (t) { 39281 t['A'] = 0x0041; 39282 t['AE'] = 0x00C6; 39283 t['AEacute'] = 0x01FC; 39284 t['AEmacron'] = 0x01E2; 39285 t['AEsmall'] = 0xF7E6; 39286 t['Aacute'] = 0x00C1; 39287 t['Aacutesmall'] = 0xF7E1; 39288 t['Abreve'] = 0x0102; 39289 t['Abreveacute'] = 0x1EAE; 39290 t['Abrevecyrillic'] = 0x04D0; 39291 t['Abrevedotbelow'] = 0x1EB6; 39292 t['Abrevegrave'] = 0x1EB0; 39293 t['Abrevehookabove'] = 0x1EB2; 39294 t['Abrevetilde'] = 0x1EB4; 39295 t['Acaron'] = 0x01CD; 39296 t['Acircle'] = 0x24B6; 39297 t['Acircumflex'] = 0x00C2; 39298 t['Acircumflexacute'] = 0x1EA4; 39299 t['Acircumflexdotbelow'] = 0x1EAC; 39300 t['Acircumflexgrave'] = 0x1EA6; 39301 t['Acircumflexhookabove'] = 0x1EA8; 39302 t['Acircumflexsmall'] = 0xF7E2; 39303 t['Acircumflextilde'] = 0x1EAA; 39304 t['Acute'] = 0xF6C9; 39305 t['Acutesmall'] = 0xF7B4; 39306 t['Acyrillic'] = 0x0410; 39307 t['Adblgrave'] = 0x0200; 39308 t['Adieresis'] = 0x00C4; 39309 t['Adieresiscyrillic'] = 0x04D2; 39310 t['Adieresismacron'] = 0x01DE; 39311 t['Adieresissmall'] = 0xF7E4; 39312 t['Adotbelow'] = 0x1EA0; 39313 t['Adotmacron'] = 0x01E0; 39314 t['Agrave'] = 0x00C0; 39315 t['Agravesmall'] = 0xF7E0; 39316 t['Ahookabove'] = 0x1EA2; 39317 t['Aiecyrillic'] = 0x04D4; 39318 t['Ainvertedbreve'] = 0x0202; 39319 t['Alpha'] = 0x0391; 39320 t['Alphatonos'] = 0x0386; 39321 t['Amacron'] = 0x0100; 39322 t['Amonospace'] = 0xFF21; 39323 t['Aogonek'] = 0x0104; 39324 t['Aring'] = 0x00C5; 39325 t['Aringacute'] = 0x01FA; 39326 t['Aringbelow'] = 0x1E00; 39327 t['Aringsmall'] = 0xF7E5; 39328 t['Asmall'] = 0xF761; 39329 t['Atilde'] = 0x00C3; 39330 t['Atildesmall'] = 0xF7E3; 39331 t['Aybarmenian'] = 0x0531; 39332 t['B'] = 0x0042; 39333 t['Bcircle'] = 0x24B7; 39334 t['Bdotaccent'] = 0x1E02; 39335 t['Bdotbelow'] = 0x1E04; 39336 t['Becyrillic'] = 0x0411; 39337 t['Benarmenian'] = 0x0532; 39338 t['Beta'] = 0x0392; 39339 t['Bhook'] = 0x0181; 39340 t['Blinebelow'] = 0x1E06; 39341 t['Bmonospace'] = 0xFF22; 39342 t['Brevesmall'] = 0xF6F4; 39343 t['Bsmall'] = 0xF762; 39344 t['Btopbar'] = 0x0182; 39345 t['C'] = 0x0043; 39346 t['Caarmenian'] = 0x053E; 39347 t['Cacute'] = 0x0106; 39348 t['Caron'] = 0xF6CA; 39349 t['Caronsmall'] = 0xF6F5; 39350 t['Ccaron'] = 0x010C; 39351 t['Ccedilla'] = 0x00C7; 39352 t['Ccedillaacute'] = 0x1E08; 39353 t['Ccedillasmall'] = 0xF7E7; 39354 t['Ccircle'] = 0x24B8; 39355 t['Ccircumflex'] = 0x0108; 39356 t['Cdot'] = 0x010A; 39357 t['Cdotaccent'] = 0x010A; 39358 t['Cedillasmall'] = 0xF7B8; 39359 t['Chaarmenian'] = 0x0549; 39360 t['Cheabkhasiancyrillic'] = 0x04BC; 39361 t['Checyrillic'] = 0x0427; 39362 t['Chedescenderabkhasiancyrillic'] = 0x04BE; 39363 t['Chedescendercyrillic'] = 0x04B6; 39364 t['Chedieresiscyrillic'] = 0x04F4; 39365 t['Cheharmenian'] = 0x0543; 39366 t['Chekhakassiancyrillic'] = 0x04CB; 39367 t['Cheverticalstrokecyrillic'] = 0x04B8; 39368 t['Chi'] = 0x03A7; 39369 t['Chook'] = 0x0187; 39370 t['Circumflexsmall'] = 0xF6F6; 39371 t['Cmonospace'] = 0xFF23; 39372 t['Coarmenian'] = 0x0551; 39373 t['Csmall'] = 0xF763; 39374 t['D'] = 0x0044; 39375 t['DZ'] = 0x01F1; 39376 t['DZcaron'] = 0x01C4; 39377 t['Daarmenian'] = 0x0534; 39378 t['Dafrican'] = 0x0189; 39379 t['Dcaron'] = 0x010E; 39380 t['Dcedilla'] = 0x1E10; 39381 t['Dcircle'] = 0x24B9; 39382 t['Dcircumflexbelow'] = 0x1E12; 39383 t['Dcroat'] = 0x0110; 39384 t['Ddotaccent'] = 0x1E0A; 39385 t['Ddotbelow'] = 0x1E0C; 39386 t['Decyrillic'] = 0x0414; 39387 t['Deicoptic'] = 0x03EE; 39388 t['Delta'] = 0x2206; 39389 t['Deltagreek'] = 0x0394; 39390 t['Dhook'] = 0x018A; 39391 t['Dieresis'] = 0xF6CB; 39392 t['DieresisAcute'] = 0xF6CC; 39393 t['DieresisGrave'] = 0xF6CD; 39394 t['Dieresissmall'] = 0xF7A8; 39395 t['Digammagreek'] = 0x03DC; 39396 t['Djecyrillic'] = 0x0402; 39397 t['Dlinebelow'] = 0x1E0E; 39398 t['Dmonospace'] = 0xFF24; 39399 t['Dotaccentsmall'] = 0xF6F7; 39400 t['Dslash'] = 0x0110; 39401 t['Dsmall'] = 0xF764; 39402 t['Dtopbar'] = 0x018B; 39403 t['Dz'] = 0x01F2; 39404 t['Dzcaron'] = 0x01C5; 39405 t['Dzeabkhasiancyrillic'] = 0x04E0; 39406 t['Dzecyrillic'] = 0x0405; 39407 t['Dzhecyrillic'] = 0x040F; 39408 t['E'] = 0x0045; 39409 t['Eacute'] = 0x00C9; 39410 t['Eacutesmall'] = 0xF7E9; 39411 t['Ebreve'] = 0x0114; 39412 t['Ecaron'] = 0x011A; 39413 t['Ecedillabreve'] = 0x1E1C; 39414 t['Echarmenian'] = 0x0535; 39415 t['Ecircle'] = 0x24BA; 39416 t['Ecircumflex'] = 0x00CA; 39417 t['Ecircumflexacute'] = 0x1EBE; 39418 t['Ecircumflexbelow'] = 0x1E18; 39419 t['Ecircumflexdotbelow'] = 0x1EC6; 39420 t['Ecircumflexgrave'] = 0x1EC0; 39421 t['Ecircumflexhookabove'] = 0x1EC2; 39422 t['Ecircumflexsmall'] = 0xF7EA; 39423 t['Ecircumflextilde'] = 0x1EC4; 39424 t['Ecyrillic'] = 0x0404; 39425 t['Edblgrave'] = 0x0204; 39426 t['Edieresis'] = 0x00CB;
39427 t['Edieresissmall'] = 0xF7EB; 39428 t['Edot'] = 0x0116; 39429 t['Edotaccent'] = 0x0116; 39430 t['Edotbelow'] = 0x1EB8; 39431 t['Efcyrillic'] = 0x0424; 39432 t['Egrave'] = 0x00C8; 39433 t['Egravesmall'] = 0xF7E8; 39434 t['Eharmenian'] = 0x0537; 39435 t['Ehookabove'] = 0x1EBA; 39436 t['Eightroman'] = 0x2167; 39437 t['Einvertedbreve'] = 0x0206; 39438 t['Eiotifiedcyrillic'] = 0x0464; 39439 t['Elcyrillic'] = 0x041B; 39440 t['Elevenroman'] = 0x216A; 39441 t['Emacron'] = 0x0112; 39442 t['Emacronacute'] = 0x1E16; 39443 t['Emacrongrave'] = 0x1E14; 39444 t['Emcyrillic'] = 0x041C; 39445 t['Emonospace'] = 0xFF25; 39446 t['Encyrillic'] = 0x041D; 39447 t['Endescendercyrillic'] = 0x04A2; 39448 t['Eng'] = 0x014A; 39449 t['Enghecyrillic'] = 0x04A4; 39450 t['Enhookcyrillic'] = 0x04C7; 39451 t['Eogonek'] = 0x0118; 39452 t['Eopen'] = 0x0190; 39453 t['Epsilon'] = 0x0395; 39454 t['Epsilontonos'] = 0x0388; 39455 t['Ercyrillic'] = 0x0420; 39456 t['Ereversed'] = 0x018E; 39457 t['Ereversedcyrillic'] = 0x042D; 39458 t['Escyrillic'] = 0x0421; 39459 t['Esdescendercyrillic'] = 0x04AA; 39460 t['Esh'] = 0x01A9; 39461 t['Esmall'] = 0xF765; 39462 t['Eta'] = 0x0397; 39463 t['Etarmenian'] = 0x0538;
39464 t['Etatonos'] = 0x0389; 39465 t['Eth'] = 0x00D0; 39466 t['Ethsmall'] = 0xF7F0; 39467 t['Etilde'] = 0x1EBC; 39468 t['Etildebelow'] = 0x1E1A; 39469 t['Euro'] = 0x20AC; 39470 t['Ezh'] = 0x01B7; 39471 t['Ezhcaron'] = 0x01EE; 39472 t['Ezhreversed'] = 0x01B8; 39473 t['F'] = 0x0046; 39474 t['Fcircle'] = 0x24BB; 39475 t['Fdotaccent'] = 0x1E1E; 39476 t['Feharmenian'] = 0x0556; 39477 t['Feicoptic'] = 0x03E4; 39478 t['Fhook'] = 0x0191; 39479 t['Fitacyrillic'] = 0x0472; 39480 t['Fiveroman'] = 0x2164; 39481 t['Fmonospace'] = 0xFF26; 39482 t['Fourroman'] = 0x2163; 39483 t['Fsmall'] = 0xF766; 39484 t['G'] = 0x0047; 39485 t['GBsquare'] = 0x3387; 39486 t['Gacute'] = 0x01F4; 39487 t['Gamma'] = 0x0393; 39488 t['Gammaafrican'] = 0x0194; 39489 t['Gangiacoptic'] = 0x03EA; 39490 t['Gbreve'] = 0x011E; 39491 t['Gcaron'] = 0x01E6; 39492 t['Gcedilla'] = 0x0122; 39493 t['Gcircle'] = 0x24BC; 39494 t['Gcircumflex'] = 0x011C; 39495 t['Gcommaaccent'] = 0x0122; 39496 t['Gdot'] = 0x0120; 39497 t['Gdotaccent'] = 0x0120; 39498 t['Gecyrillic'] = 0x0413; 39499 t['Ghadarmenian'] = 0x0542; 39500 t['Ghemiddlehookcyrillic'] = 0x0494; 39501 t['Ghestrokecyrillic'] = 0x0492; 39502 t['Gheupturncyrillic'] = 0x0490; 39503 t['Ghook'] = 0x0193; 39504 t['Gimarmenian'] = 0x0533; 39505 t['Gjecyrillic'] = 0x0403; 39506 t['Gmacron'] = 0x1E20; 39507 t['Gmonospace'] = 0xFF27; 39508 t['Grave'] = 0xF6CE; 39509 t['Gravesmall'] = 0xF760; 39510 t['Gsmall'] = 0xF767; 39511 t['Gsmallhook'] = 0x029B; 39512 t['Gstroke'] = 0x01E4; 39513 t['H'] = 0x0048; 39514 t['H18533'] = 0x25CF; 39515 t['H18543'] = 0x25AA; 39516 t['H18551'] = 0x25AB; 39517 t['H22073'] = 0x25A1; 39518 t['HPsquare'] = 0x33CB; 39519 t['Haabkhasiancyrillic'] = 0x04A8; 39520 t['Hadescendercyrillic'] = 0x04B2; 39521 t['Hardsigncyrillic'] = 0x042A; 39522 t['Hbar'] = 0x0126; 39523 t['Hbrevebelow'] = 0x1E2A; 39524 t['Hcedilla'] = 0x1E28; 39525 t['Hcircle'] = 0x24BD; 39526 t['Hcircumflex'] = 0x0124; 39527 t['Hdieresis'] = 0x1E26; 39528 t['Hdotaccent'] = 0x1E22; 39529 t['Hdotbelow'] = 0x1E24; 39530 t['Hmonospace'] = 0xFF28; 39531 t['Hoarmenian'] = 0x0540; 39532 t['Horicoptic'] = 0x03E8; 39533 t['Hsmall'] = 0xF768; 39534 t['Hungarumlaut'] = 0xF6CF; 39535 t['Hungarumlautsmall'] = 0xF6F8; 39536 t['Hzsquare'] = 0x3390; 39537 t['I'] = 0x0049; 39538 t['IAcyrillic'] = 0x042F; 39539 t['IJ'] = 0x0132; 39540 t['IUcyrillic'] = 0x042E; 39541 t['Iacute'] = 0x00CD; 39542 t['Iacutesmall'] = 0xF7ED; 39543 t['Ibreve'] = 0x012C; 39544 t['Icaron'] = 0x01CF; 39545 t['Icircle'] = 0x24BE; 39546 t['Icircumflex'] = 0x00CE; 39547 t['Icircumflexsmall'] = 0xF7EE; 39548 t['Icyrillic'] = 0x0406; 39549 t['Idblgrave'] = 0x0208; 39550 t['Idieresis'] = 0x00CF; 39551 t['Idieresisacute'] = 0x1E2E; 39552 t['Idieresiscyrillic'] = 0x04E4; 39553 t['Idieresissmall'] = 0xF7EF; 39554 t['Idot'] = 0x0130; 39555 t['Idotaccent'] = 0x0130; 39556 t['Idotbelow'] = 0x1ECA; 39557 t['Iebrevecyrillic'] = 0x04D6; 39558 t['Iecyrillic'] = 0x0415; 39559 t['Ifraktur'] = 0x2111; 39560 t['Igrave'] = 0x00CC; 39561 t['Igravesmall'] = 0xF7EC; 39562 t['Ihookabove'] = 0x1EC8; 39563 t['Iicyrillic'] = 0x0418; 39564 t['Iinvertedbreve'] = 0x020A; 39565 t['Iishortcyrillic'] = 0x0419; 39566 t['Imacron'] = 0x012A; 39567 t['Imacroncyrillic'] = 0x04E2; 39568 t['Imonospace'] = 0xFF29; 39569 t['Iniarmenian'] = 0x053B; 39570 t['Iocyrillic'] = 0x0401; 39571 t['Iogonek'] = 0x012E; 39572 t['Iota'] = 0x0399; 39573 t['Iotaafrican'] = 0x0196; 39574 t['Iotadieresis'] = 0x03AA; 39575 t['Iotatonos'] = 0x038A; 39576 t['Ismall'] = 0xF769; 39577 t['Istroke'] = 0x0197; 39578 t['Itilde'] = 0x0128; 39579 t['Itildebelow'] = 0x1E2C; 39580 t['Izhitsacyrillic'] = 0x0474; 39581 t['Izhitsadblgravecyrillic'] = 0x0476; 39582 t['J'] = 0x004A; 39583 t['Jaarmenian'] = 0x0541; 39584 t['Jcircle'] = 0x24BF; 39585 t['Jcircumflex'] = 0x0134; 39586 t['Jecyrillic'] = 0x0408; 39587 t['Jheharmenian'] = 0x054B; 39588 t['Jmonospace'] = 0xFF2A; 39589 t['Jsmall'] = 0xF76A; 39590 t['K'] = 0x004B; 39591 t['KBsquare'] = 0x3385; 39592 t['KKsquare'] = 0x33CD; 39593 t['Kabashkircyrillic'] = 0x04A0; 39594 t['Kacute'] = 0x1E30; 39595 t['Kacyrillic'] = 0x041A; 39596 t['Kadescendercyrillic'] = 0x049A; 39597 t['Kahookcyrillic'] = 0x04C3; 39598 t['Kappa'] = 0x039A; 39599 t['Kastrokecyrillic'] = 0x049E;
39600 t['Kaverticalstrokecyrillic'] = 0x049C; 39601 t['Kcaron'] = 0x01E8; 39602 t['Kcedilla'] = 0x0136; 39603 t['Kcircle'] = 0x24C0; 39604 t['Kcommaaccent'] = 0x0136; 39605 t['Kdotbelow'] = 0x1E32; 39606 t['Keharmenian'] = 0x0554; 39607 t['Kenarmenian'] = 0x053F; 39608 t['Khacyrillic'] = 0x0425; 39609 t['Kheicoptic'] = 0x03E6; 39610 t['Khook'] = 0x0198; 39611 t['Kjecyrillic'] = 0x040C; 39612 t['Klinebelow'] = 0x1E34; 39613 t['Kmonospace'] = 0xFF2B; 39614 t['Koppacyrillic'] = 0x0480; 39615 t['Koppagreek'] = 0x03DE; 39616 t['Ksicyrillic'] = 0x046E; 39617 t['Ksmall'] = 0xF76B; 39618 t['L'] = 0x004C; 39619 t['LJ'] = 0x01C7; 39620 t['LL'] = 0xF6BF; 39621 t['Lacute'] = 0x0139; 39622 t['Lambda'] = 0x039B; 39623 t['Lcaron'] = 0x013D; 39624 t['Lcedilla'] = 0x013B; 39625 t['Lcircle'] = 0x24C1; 39626 t['Lcircumflexbelow'] = 0x1E3C; 39627 t['Lcommaaccent'] = 0x013B; 39628 t['Ldot'] = 0x013F; 39629 t['Ldotaccent'] = 0x013F; 39630 t['Ldotbelow'] = 0x1E36; 39631 t['Ldotbelowmacron'] = 0x1E38; 39632 t['Liwnarmenian'] = 0x053C; 39633 t['Lj'] = 0x01C8; 39634 t['Ljecyrillic'] = 0x0409; 39635 t['Llinebelow'] = 0x1E3A; 39636 t['Lmonospace'] = 0xFF2C; 39637 t['Lslash'] = 0x0141; 39638 t['Lslashsmall'] = 0xF6F9; 39639 t['Lsmall'] = 0xF76C; 39640 t['M'] = 0x004D; 39641 t['MBsquare'] = 0x3386; 39642 t['Macron'] = 0xF6D0; 39643 t['Macronsmall'] = 0xF7AF; 39644 t['Macute'] = 0x1E3E; 39645 t['Mcircle'] = 0x24C2; 39646 t['Mdotaccent'] = 0x1E40; 39647 t['Mdotbelow'] = 0x1E42; 39648 t['Menarmenian'] = 0x0544; 39649 t['Mmonospace'] = 0xFF2D; 39650 t['Msmall'] = 0xF76D; 39651 t['Mturned'] = 0x019C; 39652 t['Mu'] = 0x039C; 39653 t['N'] = 0x004E; 39654 t['NJ'] = 0x01CA; 39655 t['Nacute'] = 0x0143; 39656 t['Ncaron'] = 0x0147; 39657 t['Ncedilla'] = 0x0145; 39658 t['Ncircle'] = 0x24C3; 39659 t['Ncircumflexbelow'] = 0x1E4A; 39660 t['Ncommaaccent'] = 0x0145; 39661 t['Ndotaccent'] = 0x1E44; 39662 t['Ndotbelow'] = 0x1E46; 39663 t['Nhookleft'] = 0x019D; 39664 t['Nineroman'] = 0x2168; 39665 t['Nj'] = 0x01CB; 39666 t['Njecyrillic'] = 0x040A; 39667 t['Nlinebelow'] = 0x1E48; 39668 t['Nmonospace'] = 0xFF2E; 39669 t['Nowarmenian'] = 0x0546; 39670 t['Nsmall'] = 0xF76E; 39671 t['Ntilde'] = 0x00D1; 39672 t['Ntildesmall'] = 0xF7F1; 39673 t['Nu'] = 0x039D; 39674 t['O'] = 0x004F; 39675 t['OE'] = 0x0152; 39676 t['OEsmall'] = 0xF6FA; 39677 t['Oacute'] = 0x00D3; 39678 t['Oacutesmall'] = 0xF7F3; 39679 t['Obarredcyrillic'] = 0x04E8; 39680 t['Obarreddieresiscyrillic'] = 0x04EA; 39681 t['Obreve'] = 0x014E; 39682 t['Ocaron'] = 0x01D1; 39683 t['Ocenteredtilde'] = 0x019F; 39684 t['Ocircle'] = 0x24C4; 39685 t['Ocircumflex'] = 0x00D4; 39686 t['Ocircumflexacute'] = 0x1ED0; 39687 t['Ocircumflexdotbelow'] = 0x1ED8; 39688 t['Ocircumflexgrave'] = 0x1ED2; 39689 t['Ocircumflexhookabove'] = 0x1ED4; 39690 t['Ocircumflexsmall'] = 0xF7F4; 39691 t['Ocircumflextilde'] = 0x1ED6; 39692 t['Ocyrillic'] = 0x041E; 39693 t['Odblacute'] = 0x0150; 39694 t['Odblgrave'] = 0x020C; 39695 t['Odieresis'] = 0x00D6; 39696 t['Odieresiscyrillic'] = 0x04E6; 39697 t['Odieresissmall'] = 0xF7F6; 39698 t['Odotbelow'] = 0x1ECC; 39699 t['Ogoneksmall'] = 0xF6FB; 39700 t['Ograve'] = 0x00D2; 39701 t['Ogravesmall'] = 0xF7F2; 39702 t['Oharmenian'] = 0x0555; 39703 t['Ohm'] = 0x2126; 39704 t['Ohookabove'] = 0x1ECE; 39705 t['Ohorn'] = 0x01A0; 39706 t['Ohornacute'] = 0x1EDA; 39707 t['Ohorndotbelow'] = 0x1EE2; 39708 t['Ohorngrave'] = 0x1EDC; 39709 t['Ohornhookabove'] = 0x1EDE; 39710 t['Ohorntilde'] = 0x1EE0; 39711 t['Ohungarumlaut'] = 0x0150; 39712 t['Oi'] = 0x01A2; 39713 t['Oinvertedbreve'] = 0x020E; 39714 t['Omacron'] = 0x014C; 39715 t['Omacronacute'] = 0x1E52; 39716 t['Omacrongrave'] = 0x1E50; 39717 t['Omega'] = 0x2126; 39718 t['Omegacyrillic'] = 0x0460; 39719 t['Omegagreek'] = 0x03A9; 39720 t['Omegaroundcyrillic'] = 0x047A; 39721 t['Omegatitlocyrillic'] = 0x047C; 39722 t['Omegatonos'] = 0x038F; 39723 t['Omicron'] = 0x039F; 39724 t['Omicrontonos'] = 0x038C; 39725 t['Omonospace'] = 0xFF2F; 39726 t['Oneroman'] = 0x2160; 39727 t['Oogonek'] = 0x01EA; 39728 t['Oogonekmacron'] = 0x01EC; 39729 t['Oopen'] = 0x0186; 39730 t['Oslash'] = 0x00D8; 39731 t['Oslashacute'] = 0x01FE; 39732 t['Oslashsmall'] = 0xF7F8; 39733 t['Osmall'] = 0xF76F; 39734 t['Ostrokeacute'] = 0x01FE; 39735 t['Otcyrillic'] = 0x047E; 39736 t['Otilde'] = 0x00D5; 39737 t['Otildeacute'] = 0x1E4C; 39738 t['Otildedieresis'] = 0x1E4E; 39739 t['Otildesmall'] = 0xF7F5; 39740 t['P'] = 0x0050; 39741 t['Pacute'] = 0x1E54; 39742 t['Pcircle'] = 0x24C5; 39743 t['Pdotaccent'] = 0x1E56; 39744 t['Pecyrillic'] = 0x041F; 39745 t['Peharmenian'] = 0x054A; 39746 t['Pemiddlehookcyrillic'] = 0x04A6; 39747 t['Phi'] = 0x03A6; 39748 t['Phook'] = 0x01A4; 39749 t['Pi'] = 0x03A0; 39750 t['Piwrarmenian'] = 0x0553; 39751 t['Pmonospace'] = 0xFF30; 39752 t['Psi'] = 0x03A8; 39753 t['Psicyrillic'] = 0x0470; 39754 t['Psmall'] = 0xF770; 39755 t['Q'] = 0x0051; 39756 t['Qcircle'] = 0x24C6; 39757 t['Qmonospace'] = 0xFF31; 39758 t['Qsmall'] = 0xF771; 39759 t['R'] = 0x0052; 39760 t['Raarmenian'] = 0x054C; 39761 t['Racute'] = 0x0154; 39762 t['Rcaron'] = 0x0158; 39763 t['Rcedilla'] = 0x0156; 39764 t['Rcircle'] = 0x24C7; 39765 t['Rcommaaccent'] = 0x0156; 39766 t['Rdblgrave'] = 0x0210; 39767 t['Rdotaccent'] = 0x1E58; 39768 t['Rdotbelow'] = 0x1E5A; 39769 t['Rdotbelowmacron'] = 0x1E5C; 39770 t['Reharmenian'] = 0x0550; 39771 t['Rfraktur'] = 0x211C; 39772 t['Rho'] = 0x03A1; 39773 t['Ringsmall'] = 0xF6FC; 39774 t['Rinvertedbreve'] = 0x0212; 39775 t['Rlinebelow'] = 0x1E5E; 39776 t['Rmonospace'] = 0xFF32; 39777 t['Rsmall'] = 0xF772; 39778 t['Rsmallinverted'] = 0x0281; 39779 t['Rsmallinvertedsuperior'] = 0x02B6; 39780 t['S'] = 0x0053; 39781 t['SF010000'] = 0x250C; 39782 t['SF020000'] = 0x2514; 39783 t['SF030000'] = 0x2510; 39784 t['SF040000'] = 0x2518; 39785 t['SF050000'] = 0x253C; 39786 t['SF060000'] = 0x252C; 39787 t['SF070000'] = 0x2534; 39788 t['SF080000'] = 0x251C; 39789 t['SF090000'] = 0x2524; 39790 t['SF100000'] = 0x2500; 39791 t['SF110000'] = 0x2502; 39792 t['SF190000'] = 0x2561; 39793 t['SF200000'] = 0x2562; 39794 t['SF210000'] = 0x2556; 39795 t['SF220000'] = 0x2555; 39796 t['SF230000'] = 0x2563; 39797 t['SF240000'] = 0x2551; 39798 t['SF250000'] = 0x2557; 39799 t['SF260000'] = 0x255D; 39800 t['SF270000'] = 0x255C; 39801 t['SF280000'] = 0x255B; 39802 t['SF360000'] = 0x255E; 39803 t['SF370000'] = 0x255F; 39804 t['SF380000'] = 0x255A; 39805 t['SF390000'] = 0x2554; 39806 t['SF400000'] = 0x2569; 39807 t['SF410000'] = 0x2566; 39808 t['SF420000'] = 0x2560; 39809 t['SF430000'] = 0x2550; 39810 t['SF440000'] = 0x256C; 39811 t['SF450000'] = 0x2567; 39812 t['SF460000'] = 0x2568; 39813 t['SF470000'] = 0x2564; 39814 t['SF480000'] = 0x2565; 39815 t['SF490000'] = 0x2559; 39816 t['SF500000'] = 0x2558; 39817 t['SF510000'] = 0x2552; 39818 t['SF520000'] = 0x2553; 39819 t['SF530000'] = 0x256B;
39820 t['SF540000'] = 0x256A; 39821 t['Sacute'] = 0x015A; 39822 t['Sacutedotaccent'] = 0x1E64; 39823 t['Sampigreek'] = 0x03E0; 39824 t['Scaron'] = 0x0160; 39825 t['Scarondotaccent'] = 0x1E66; 39826 t['Scaronsmall'] = 0xF6FD; 39827 t['Scedilla'] = 0x015E; 39828 t['Schwa'] = 0x018F; 39829 t['Schwacyrillic'] = 0x04D8; 39830 t['Schwadieresiscyrillic'] = 0x04DA; 39831 t['Scircle'] = 0x24C8; 39832 t['Scircumflex'] = 0x015C; 39833 t['Scommaaccent'] = 0x0218; 39834 t['Sdotaccent'] = 0x1E60; 39835 t['Sdotbelow'] = 0x1E62; 39836 t['Sdotbelowdotaccent'] = 0x1E68; 39837 t['Seharmenian'] = 0x054D; 39838 t['Sevenroman'] = 0x2166; 39839 t['Shaarmenian'] = 0x0547; 39840 t['Shacyrillic'] = 0x0428; 39841 t['Shchacyrillic'] = 0x0429; 39842 t['Sheicoptic'] = 0x03E2; 39843 t['Shhacyrillic'] = 0x04BA; 39844 t['Shimacoptic'] = 0x03EC; 39845 t['Sigma'] = 0x03A3; 39846 t['Sixroman'] = 0x2165; 39847 t['Smonospace'] = 0xFF33; 39848 t['Softsigncyrillic'] = 0x042C; 39849 t['Ssmall'] = 0xF773; 39850 t['Stigmagreek'] = 0x03DA; 39851 t['T'] = 0x0054; 39852 t['Tau'] = 0x03A4; 39853 t['Tbar'] = 0x0166; 39854 t['Tcaron'] = 0x0164; 39855 t['Tcedilla'] = 0x0162; 39856 t['Tcircle'] = 0x24C9; 39857 t['Tcircumflexbelow'] = 0x1E70; 39858 t['Tcommaaccent'] = 0x0162; 39859 t['Tdotaccent'] = 0x1E6A; 39860 t['Tdotbelow'] = 0x1E6C; 39861 t['Tecyrillic'] = 0x0422; 39862 t['Tedescendercyrillic'] = 0x04AC; 39863 t['Tenroman'] = 0x2169; 39864 t['Tetsecyrillic'] = 0x04B4; 39865 t['Theta'] = 0x0398; 39866 t['Thook'] = 0x01AC; 39867 t['Thorn'] = 0x00DE; 39868 t['Thornsmall'] = 0xF7FE; 39869 t['Threeroman'] = 0x2162; 39870 t['Tildesmall'] = 0xF6FE; 39871 t['Tiwnarmenian'] = 0x054F; 39872 t['Tlinebelow'] = 0x1E6E; 39873 t['Tmonospace'] = 0xFF34; 39874 t['Toarmenian'] = 0x0539; 39875 t['Tonefive'] = 0x01BC; 39876 t['Tonesix'] = 0x0184; 39877 t['Tonetwo'] = 0x01A7; 39878 t['Tretroflexhook'] = 0x01AE; 39879 t['Tsecyrillic'] = 0x0426; 39880 t['Tshecyrillic'] = 0x040B; 39881 t['Tsmall'] = 0xF774; 39882 t['Twelveroman'] = 0x216B; 39883 t['Tworoman'] = 0x2161; 39884 t['U'] = 0x0055; 39885 t['Uacute'] = 0x00DA; 39886 t['Uacutesmall'] = 0xF7FA; 39887 t['Ubreve'] = 0x016C; 39888 t['Ucaron'] = 0x01D3; 39889 t['Ucircle'] = 0x24CA; 39890 t['Ucircumflex'] = 0x00DB; 39891 t['Ucircumflexbelow'] = 0x1E76; 39892 t['Ucircumflexsmall'] = 0xF7FB; 39893 t['Ucyrillic'] = 0x0423; 39894 t['Udblacute'] = 0x0170; 39895 t['Udblgrave'] = 0x0214; 39896 t['Udieresis'] = 0x00DC; 39897 t['Udieresisacute'] = 0x01D7;
39898 t['Udieresisbelow'] = 0x1E72; 39899 t['Udieresiscaron'] = 0x01D9; 39900 t['Udieresiscyrillic'] = 0x04F0; 39901 t['Udieresisgrave'] = 0x01DB; 39902 t['Udieresismacron'] = 0x01D5; 39903 t['Udieresissmall'] = 0xF7FC; 39904 t['Udotbelow'] = 0x1EE4; 39905 t['Ugrave'] = 0x00D9; 39906 t['Ugravesmall'] = 0xF7F9; 39907 t['Uhookabove'] = 0x1EE6; 39908 t['Uhorn'] = 0x01AF; 39909 t['Uhornacute'] = 0x1EE8; 39910 t['Uhorndotbelow'] = 0x1EF0; 39911 t['Uhorngrave'] = 0x1EEA; 39912 t['Uhornhookabove'] = 0x1EEC; 39913 t['Uhorntilde'] = 0x1EEE; 39914 t['Uhungarumlaut'] = 0x0170; 39915 t['Uhungarumlautcyrillic'] = 0x04F2; 39916 t['Uinvertedbreve'] = 0x0216; 39917 t['Ukcyrillic'] = 0x0478; 39918 t['Umacron'] = 0x016A; 39919 t['Umacroncyrillic'] = 0x04EE; 39920 t['Umacrondieresis'] = 0x1E7A; 39921 t['Umonospace'] = 0xFF35; 39922 t['Uogonek'] = 0x0172; 39923 t['Upsilon'] = 0x03A5; 39924 t['Upsilon1'] = 0x03D2; 39925 t['Upsilonacutehooksymbolgreek'] = 0x03D3; 39926 t['Upsilonafrican'] = 0x01B1; 39927 t['Upsilondieresis'] = 0x03AB; 39928 t['Upsilondieresishooksymbolgreek'] = 0x03D4; 39929 t['Upsilonhooksymbol'] = 0x03D2; 39930 t['Upsilontonos'] = 0x038E; 39931 t['Uring'] = 0x016E; 39932 t['Ushortcyrillic'] = 0x040E; 39933 t['Usmall'] = 0xF775; 39934 t['Ustraightcyrillic'] = 0x04AE; 39935 t['Ustraightstrokecyrillic'] = 0x04B0; 39936 t['Utilde'] = 0x0168; 39937 t['Utildeacute'] = 0x1E78; 39938 t['Utildebelow'] = 0x1E74; 39939 t['V'] = 0x0056; 39940 t['Vcircle'] = 0x24CB; 39941 t['Vdotbelow'] = 0x1E7E; 39942 t['Vecyrillic'] = 0x0412; 39943 t['Vewarmenian'] = 0x054E; 39944 t['Vhook'] = 0x01B2; 39945 t['Vmonospace'] = 0xFF36; 39946 t['Voarmenian'] = 0x0548; 39947 t['Vsmall'] = 0xF776; 39948 t['Vtilde'] = 0x1E7C; 39949 t['W'] = 0x0057; 39950 t['Wacute'] = 0x1E82; 39951 t['Wcircle'] = 0x24CC; 39952 t['Wcircumflex'] = 0x0174; 39953 t['Wdieresis'] = 0x1E84; 39954 t['Wdotaccent'] = 0x1E86; 39955 t['Wdotbelow'] = 0x1E88; 39956 t['Wgrave'] = 0x1E80; 39957 t['Wmonospace'] = 0xFF37; 39958 t['Wsmall'] = 0xF777; 39959 t['X'] = 0x0058; 39960 t['Xcircle'] = 0x24CD; 39961 t['Xdieresis'] = 0x1E8C; 39962 t['Xdotaccent'] = 0x1E8A; 39963 t['Xeharmenian'] = 0x053D; 39964 t['Xi'] = 0x039E; 39965 t['Xmonospace'] = 0xFF38; 39966 t['Xsmall'] = 0xF778; 39967 t['Y'] = 0x0059; 39968 t['Yacute'] = 0x00DD; 39969 t['Yacutesmall'] = 0xF7FD; 39970 t['Yatcyrillic'] = 0x0462; 39971 t['Ycircle'] = 0x24CE; 39972 t['Ycircumflex'] = 0x0176; 39973 t['Ydieresis'] = 0x0178; 39974 t['Ydieresissmall'] = 0xF7FF; 39975 t['Ydotaccent'] = 0x1E8E; 39976 t['Ydotbelow'] = 0x1EF4; 39977 t['Yericyrillic'] = 0x042B; 39978 t['Yerudieresiscyrillic'] = 0x04F8; 39979 t['Ygrave'] = 0x1EF2; 39980 t['Yhook'] = 0x01B3; 39981 t['Yhookabove'] = 0x1EF6; 39982 t['Yiarmenian'] = 0x0545; 39983 t['Yicyrillic'] = 0x0407; 39984 t['Yiwnarmenian'] = 0x0552; 39985 t['Ymonospace'] = 0xFF39; 39986 t['Ysmall'] = 0xF779; 39987 t['Ytilde'] = 0x1EF8; 39988 t['Yusbigcyrillic'] = 0x046A; 39989 t['Yusbigiotifiedcyrillic'] = 0x046C; 39990 t['Yuslittlecyrillic'] = 0x0466; 39991 t['Yuslittleiotifiedcyrillic'] = 0x0468; 39992 t['Z'] = 0x005A; 39993 t['Zaarmenian'] = 0x0536; 39994 t['Zacute'] = 0x0179; 39995 t['Zcaron'] = 0x017D; 39996 t['Zcaronsmall'] = 0xF6FF; 39997 t['Zcircle'] = 0x24CF; 39998 t['Zcircumflex'] = 0x1E90; 39999 t['Zdot'] = 0x017B; 40000 t['Zdotaccent'] = 0x017B; 40001 t['Zdotbelow'] = 0x1E92; 40002 t['Zecyrillic'] = 0x0417; 40003 t['Zedescendercyrillic'] = 0x0498; 40004 t['Zedieresiscyrillic'] = 0x04DE; 40005 t['Zeta'] = 0x0396; 40006 t['Zhearmenian'] = 0x053A; 40007 t['Zhebrevecyrillic'] = 0x04C1; 40008 t['Zhecyrillic'] = 0x0416; 40009 t['Zhedescendercyrillic'] = 0x0496; 40010 t['Zhedieresiscyrillic'] = 0x04DC; 40011 t['Zlinebelow'] = 0x1E94; 40012 t['Zmonospace'] = 0xFF3A; 40013 t['Zsmall'] = 0xF77A; 40014 t['Zstroke'] = 0x01B5; 40015 t['a'] = 0x0061; 40016 t['aabengali'] = 0x0986; 40017 t['aacute'] = 0x00E1; 40018 t['aadeva'] = 0x0906; 40019 t['aagujarati'] = 0x0A86; 40020 t['aagurmukhi'] = 0x0A06; 40021 t['aamatragurmukhi'] = 0x0A3E; 40022 t['aarusquare'] = 0x3303; 40023 t['aavowelsignbengali'] = 0x09BE; 40024 t['aavowelsigndeva'] = 0x093E; 40025 t['aavowelsigngujarati'] = 0x0ABE; 40026 t['abbreviationmarkarmenian'] = 0x055F; 40027 t['abbreviationsigndeva'] = 0x0970; 40028 t['abengali'] = 0x0985; 40029 t['abopomofo'] = 0x311A; 40030 t['abreve'] = 0x0103; 40031 t['abreveacute'] = 0x1EAF; 40032 t['abrevecyrillic'] = 0x04D1; 40033 t['abrevedotbelow'] = 0x1EB7; 40034 t['abrevegrave'] = 0x1EB1; 40035 t['abrevehookabove'] = 0x1EB3; 40036 t['abrevetilde'] = 0x1EB5; 40037 t['acaron'] = 0x01CE; 40038 t['acircle'] = 0x24D0; 40039 t['acircumflex'] = 0x00E2; 40040 t['acircumflexacute'] = 0x1EA5; 40041 t['acircumflexdotbelow'] = 0x1EAD; 40042 t['acircumflexgrave'] = 0x1EA7; 40043 t['acircumflexhookabove'] = 0x1EA9; 40044 t['acircumflextilde'] = 0x1EAB; 40045 t['acute'] = 0x00B4; 40046 t['acutebelowcmb'] = 0x0317;
40047 t['acutecmb'] = 0x0301; 40048 t['acutecomb'] = 0x0301; 40049 t['acutedeva'] = 0x0954; 40050 t['acutelowmod'] = 0x02CF; 40051 t['acutetonecmb'] = 0x0341; 40052 t['acyrillic'] = 0x0430; 40053 t['adblgrave'] = 0x0201; 40054 t['addakgurmukhi'] = 0x0A71; 40055 t['adeva'] = 0x0905; 40056 t['adieresis'] = 0x00E4; 40057 t['adieresiscyrillic'] = 0x04D3; 40058 t['adieresismacron'] = 0x01DF; 40059 t['adotbelow'] = 0x1EA1; 40060 t['adotmacron'] = 0x01E1; 40061 t['ae'] = 0x00E6; 40062 t['aeacute'] = 0x01FD; 40063 t['aekorean'] = 0x3150; 40064 t['aemacron'] = 0x01E3; 40065 t['afii00208'] = 0x2015; 40066 t['afii08941'] = 0x20A4; 40067 t['afii10017'] = 0x0410; 40068 t['afii10018'] = 0x0411; 40069 t['afii10019'] = 0x0412; 40070 t['afii10020'] = 0x0413; 40071 t['afii10021'] = 0x0414; 40072 t['afii10022'] = 0x0415; 40073 t['afii10023'] = 0x0401; 40074 t['afii10024'] = 0x0416; 40075 t['afii10025'] = 0x0417; 40076 t['afii10026'] = 0x0418; 40077 t['afii10027'] = 0x0419; 40078 t['afii10028'] = 0x041A; 40079 t['afii10029'] = 0x041B; 40080 t['afii10030'] = 0x041C; 40081 t['afii10031'] = 0x041D; 40082 t['afii10032'] = 0x041E; 40083 t['afii10033'] = 0x041F; 40084 t['afii10034'] = 0x0420; 40085 t['afii10035'] = 0x0421; 40086 t['afii10036'] = 0x0422; 40087 t['afii10037'] = 0x0423; 40088 t['afii10038'] = 0x0424; 40089 t['afii10039'] = 0x0425; 40090 t['afii10040'] = 0x0426; 40091 t['afii10041'] = 0x0427; 40092 t['afii10042'] = 0x0428; 40093 t['afii10043'] = 0x0429; 40094 t['afii10044'] = 0x042A; 40095 t['afii10045'] = 0x042B; 40096 t['afii10046'] = 0x042C; 40097 t['afii10047'] = 0x042D; 40098 t['afii10048'] = 0x042E; 40099 t['afii10049'] = 0x042F; 40100 t['afii10050'] = 0x0490; 40101 t['afii10051'] = 0x0402; 40102 t['afii10052'] = 0x0403; 40103 t['afii10053'] = 0x0404; 40104 t['afii10054'] = 0x0405; 40105 t['afii10055'] = 0x0406; 40106 t['afii10056'] = 0x0407; 40107 t['afii10057'] = 0x0408; 40108 t['afii10058'] = 0x0409; 40109 t['afii10059'] = 0x040A; 40110 t['afii10060'] = 0x040B; 40111 t['afii10061'] = 0x040C; 40112 t['afii10062'] = 0x040E; 40113 t['afii10063'] = 0xF6C4; 40114 t['afii10064'] = 0xF6C5; 40115 t['afii10065'] = 0x0430; 40116 t['afii10066'] = 0x0431; 40117 t['afii10067'] = 0x0432; 40118 t['afii10068'] = 0x0433; 40119 t['afii10069'] = 0x0434; 40120 t['afii10070'] = 0x0435; 40121 t['afii10071'] = 0x0451; 40122 t['afii10072'] = 0x0436; 40123 t['afii10073'] = 0x0437; 40124 t['afii10074'] = 0x0438; 40125 t['afii10075'] = 0x0439; 40126 t['afii10076'] = 0x043A; 40127 t['afii10077'] = 0x043B; 40128 t['afii10078'] = 0x043C; 40129 t['afii10079'] = 0x043D; 40130 t['afii10080'] = 0x043E; 40131 t['afii10081'] = 0x043F; 40132 t['afii10082'] = 0x0440; 40133 t['afii10083'] = 0x0441; 40134 t['afii10084'] = 0x0442; 40135 t['afii10085'] = 0x0443; 40136 t['afii10086'] = 0x0444; 40137 t['afii10087'] = 0x0445; 40138 t['afii10088'] = 0x0446; 40139 t['afii10089'] = 0x0447; 40140 t['afii10090'] = 0x0448; 40141 t['afii10091'] = 0x0449; 40142 t['afii10092'] = 0x044A; 40143 t['afii10093'] = 0x044B; 40144 t['afii10094'] = 0x044C; 40145 t['afii10095'] = 0x044D; 40146 t['afii10096'] = 0x044E; 40147 t['afii10097'] = 0x044F; 40148 t['afii10098'] = 0x0491; 40149 t['afii10099'] = 0x0452; 40150 t['afii10100'] = 0x0453; 40151 t['afii10101'] = 0x0454; 40152 t['afii10102'] = 0x0455; 40153 t['afii10103'] = 0x0456; 40154 t['afii10104'] = 0x0457; 40155 t['afii10105'] = 0x0458; 40156 t['afii10106'] = 0x0459; 40157 t['afii10107'] = 0x045A; 40158 t['afii10108'] = 0x045B; 40159 t['afii10109'] = 0x045C; 40160 t['afii10110'] = 0x045E; 40161 t['afii10145'] = 0x040F; 40162 t['afii10146'] = 0x0462; 40163 t['afii10147'] = 0x0472; 40164 t['afii10148'] = 0x0474; 40165 t['afii10192'] = 0xF6C6; 40166 t['afii10193'] = 0x045F; 40167 t['afii10194'] = 0x0463; 40168 t['afii10195'] = 0x0473; 40169 t['afii10196'] = 0x0475; 40170 t['afii10831'] = 0xF6C7; 40171 t['afii10832'] = 0xF6C8; 40172 t['afii10846'] = 0x04D9; 40173 t['afii299'] = 0x200E; 40174 t['afii300'] = 0x200F; 40175 t['afii301'] = 0x200D; 40176 t['afii57381'] = 0x066A; 40177 t['afii57388'] = 0x060C; 40178 t['afii57392'] = 0x0660; 40179 t['afii57393'] = 0x0661; 40180 t['afii57394'] = 0x0662; 40181 t['afii57395'] = 0x0663; 40182 t['afii57396'] = 0x0664; 40183 t['afii57397'] = 0x0665; 40184 t['afii57398'] = 0x0666; 40185 t['afii57399'] = 0x0667; 40186 t['afii57400'] = 0x0668; 40187 t['afii57401'] = 0x0669; 40188 t['afii57403'] = 0x061B; 40189 t['afii57407'] = 0x061F; 40190 t['afii57409'] = 0x0621; 40191 t['afii57410'] = 0x0622; 40192 t['afii57411'] = 0x0623; 40193 t['afii57412'] = 0x0624; 40194 t['afii57413'] = 0x0625; 40195 t['afii57414'] = 0x0626; 40196 t['afii57415'] = 0x0627; 40197 t['afii57416'] = 0x0628; 40198 t['afii57417'] = 0x0629; 40199 t['afii57418'] = 0x062A; 40200 t['afii57419'] = 0x062B; 40201 t['afii57420'] = 0x062C; 40202 t['afii57421'] = 0x062D; 40203 t['afii57422'] = 0x062E; 40204 t['afii57423'] = 0x062F; 40205 t['afii57424'] = 0x0630; 40206 t['afii57425'] = 0x0631;
40207 t['afii57426'] = 0x0632; 40208 t['afii57427'] = 0x0633; 40209 t['afii57428'] = 0x0634; 40210 t['afii57429'] = 0x0635; 40211 t['afii57430'] = 0x0636; 40212 t['afii57431'] = 0x0637; 40213 t['afii57432'] = 0x0638; 40214 t['afii57433'] = 0x0639; 40215 t['afii57434'] = 0x063A; 40216 t['afii57440'] = 0x0640; 40217 t['afii57441'] = 0x0641; 40218 t['afii57442'] = 0x0642; 40219 t['afii57443'] = 0x0643; 40220 t['afii57444'] = 0x0644; 40221 t['afii57445'] = 0x0645; 40222 t['afii57446'] = 0x0646; 40223 t['afii57448'] = 0x0648; 40224 t['afii57449'] = 0x0649; 40225 t['afii57450'] = 0x064A; 40226 t['afii57451'] = 0x064B; 40227 t['afii57452'] = 0x064C; 40228 t['afii57453'] = 0x064D; 40229 t['afii57454'] = 0x064E; 40230 t['afii57455'] = 0x064F; 40231 t['afii57456'] = 0x0650; 40232 t['afii57457'] = 0x0651; 40233 t['afii57458'] = 0x0652; 40234 t['afii57470'] = 0x0647; 40235 t['afii57505'] = 0x06A4; 40236 t['afii57506'] = 0x067E; 40237 t['afii57507'] = 0x0686; 40238 t['afii57508'] = 0x0698; 40239 t['afii57509'] = 0x06AF; 40240 t['afii57511'] = 0x0679; 40241 t['afii57512'] = 0x0688; 40242 t['afii57513'] = 0x0691; 40243 t['afii57514'] = 0x06BA; 40244 t['afii57519'] = 0x06D2; 40245 t['afii57534'] = 0x06D5; 40246 t['afii57636'] = 0x20AA; 40247 t['afii57645'] = 0x05BE; 40248 t['afii57658'] = 0x05C3; 40249 t['afii57664'] = 0x05D0; 40250 t['afii57665'] = 0x05D1; 40251 t['afii57666'] = 0x05D2; 40252 t['afii57667'] = 0x05D3; 40253 t['afii57668'] = 0x05D4; 40254 t['afii57669'] = 0x05D5; 40255 t['afii57670'] = 0x05D6; 40256 t['afii57671'] = 0x05D7; 40257 t['afii57672'] = 0x05D8; 40258 t['afii57673'] = 0x05D9; 40259 t['afii57674'] = 0x05DA; 40260 t['afii57675'] = 0x05DB; 40261 t['afii57676'] = 0x05DC; 40262 t['afii57677'] = 0x05DD; 40263 t['afii57678'] = 0x05DE; 40264 t['afii57679'] = 0x05DF; 40265 t['afii57680'] = 0x05E0; 40266 t['afii57681'] = 0x05E1; 40267 t['afii57682'] = 0x05E2; 40268 t['afii57683'] = 0x05E3; 40269 t['afii57684'] = 0x05E4; 40270 t['afii57685'] = 0x05E5; 40271 t['afii57686'] = 0x05E6; 40272 t['afii57687'] = 0x05E7; 40273 t['afii57688'] = 0x05E8; 40274 t['afii57689'] = 0x05E9; 40275 t['afii57690'] = 0x05EA; 40276 t['afii57694'] = 0xFB2A; 40277 t['afii57695'] = 0xFB2B; 40278 t['afii57700'] = 0xFB4B; 40279 t['afii57705'] = 0xFB1F; 40280 t['afii57716'] = 0x05F0; 40281 t['afii57717'] = 0x05F1; 40282 t['afii57718'] = 0x05F2; 40283 t['afii57723'] = 0xFB35; 40284 t['afii57793'] = 0x05B4; 40285 t['afii57794'] = 0x05B5; 40286 t['afii57795'] = 0x05B6; 40287 t['afii57796'] = 0x05BB; 40288 t['afii57797'] = 0x05B8; 40289 t['afii57798'] = 0x05B7; 40290 t['afii57799'] = 0x05B0; 40291 t['afii57800'] = 0x05B2; 40292 t['afii57801'] = 0x05B1; 40293 t['afii57802'] = 0x05B3; 40294 t['afii57803'] = 0x05C2; 40295 t['afii57804'] = 0x05C1; 40296 t['afii57806'] = 0x05B9; 40297 t['afii57807'] = 0x05BC; 40298 t['afii57839'] = 0x05BD; 40299 t['afii57841'] = 0x05BF; 40300 t['afii57842'] = 0x05C0; 40301 t['afii57929'] = 0x02BC; 40302 t['afii61248'] = 0x2105; 40303 t['afii61289'] = 0x2113; 40304 t['afii61352'] = 0x2116; 40305 t['afii61573'] = 0x202C; 40306 t['afii61574'] = 0x202D; 40307 t['afii61575'] = 0x202E; 40308 t['afii61664'] = 0x200C; 40309 t['afii63167'] = 0x066D; 40310 t['afii64937'] = 0x02BD; 40311 t['agrave'] = 0x00E0; 40312 t['agujarati'] = 0x0A85; 40313 t['agurmukhi'] = 0x0A05; 40314 t['ahiragana'] = 0x3042; 40315 t['ahookabove'] = 0x1EA3; 40316 t['aibengali'] = 0x0990; 40317 t['aibopomofo'] = 0x311E; 40318 t['aideva'] = 0x0910; 40319 t['aiecyrillic'] = 0x04D5; 40320 t['aigujarati'] = 0x0A90; 40321 t['aigurmukhi'] = 0x0A10; 40322 t['aimatragurmukhi'] = 0x0A48; 40323 t['ainarabic'] = 0x0639; 40324 t['ainfinalarabic'] = 0xFECA; 40325 t['aininitialarabic'] = 0xFECB; 40326 t['ainmedialarabic'] = 0xFECC; 40327 t['ainvertedbreve'] = 0x0203; 40328 t['aivowelsignbengali'] = 0x09C8; 40329 t['aivowelsigndeva'] = 0x0948; 40330 t['aivowelsigngujarati'] = 0x0AC8; 40331 t['akatakana'] = 0x30A2; 40332 t['akatakanahalfwidth'] = 0xFF71; 40333 t['akorean'] = 0x314F; 40334 t['alef'] = 0x05D0; 40335 t['alefarabic'] = 0x0627; 40336 t['alefdageshhebrew'] = 0xFB30; 40337 t['aleffinalarabic'] = 0xFE8E; 40338 t['alefhamzaabovearabic'] = 0x0623; 40339 t['alefhamzaabovefinalarabic'] = 0xFE84; 40340 t['alefhamzabelowarabic'] = 0x0625; 40341 t['alefhamzabelowfinalarabic'] = 0xFE88; 40342 t['alefhebrew'] = 0x05D0; 40343 t['aleflamedhebrew'] = 0xFB4F; 40344 t['alefmaddaabovearabic'] = 0x0622; 40345 t['alefmaddaabovefinalarabic'] = 0xFE82; 40346 t['alefmaksuraarabic'] = 0x0649; 40347 t['alefmaksurafinalarabic'] = 0xFEF0; 40348 t['alefmaksurainitialarabic'] = 0xFEF3; 40349 t['alefmaksuramedialarabic'] = 0xFEF4; 40350 t['alefpatahhebrew'] = 0xFB2E; 40351 t['alefqamatshebrew'] = 0xFB2F; 40352 t['aleph'] = 0x2135; 40353 t['allequal'] = 0x224C;
40354 t['alpha'] = 0x03B1; 40355 t['alphatonos'] = 0x03AC; 40356 t['amacron'] = 0x0101; 40357 t['amonospace'] = 0xFF41; 40358 t['ampersand'] = 0x0026; 40359 t['ampersandmonospace'] = 0xFF06; 40360 t['ampersandsmall'] = 0xF726; 40361 t['amsquare'] = 0x33C2; 40362 t['anbopomofo'] = 0x3122; 40363 t['angbopomofo'] = 0x3124; 40364 t['angbracketleft'] = 0x3008; 40365 t['angbracketright'] = 0x3009; 40366 t['angkhankhuthai'] = 0x0E5A; 40367 t['angle'] = 0x2220; 40368 t['anglebracketleft'] = 0x3008; 40369 t['anglebracketleftvertical'] = 0xFE3F; 40370 t['anglebracketright'] = 0x3009; 40371 t['anglebracketrightvertical'] = 0xFE40; 40372 t['angleleft'] = 0x2329; 40373 t['angleright'] = 0x232A; 40374 t['angstrom'] = 0x212B; 40375 t['anoteleia'] = 0x0387; 40376 t['anudattadeva'] = 0x0952; 40377 t['anusvarabengali'] = 0x0982; 40378 t['anusvaradeva'] = 0x0902; 40379 t['anusvaragujarati'] = 0x0A82; 40380 t['aogonek'] = 0x0105; 40381 t['apaatosquare'] = 0x3300; 40382 t['aparen'] = 0x249C; 40383 t['apostrophearmenian'] = 0x055A; 40384 t['apostrophemod'] = 0x02BC; 40385 t['apple'] = 0xF8FF; 40386 t['approaches'] = 0x2250; 40387 t['approxequal'] = 0x2248; 40388 t['approxequalorimage'] = 0x2252; 40389 t['approximatelyequal'] = 0x2245; 40390 t['araeaekorean'] = 0x318E; 40391 t['araeakorean'] = 0x318D; 40392 t['arc'] = 0x2312; 40393 t['arighthalfring'] = 0x1E9A; 40394 t['aring'] = 0x00E5; 40395 t['aringacute'] = 0x01FB; 40396 t['aringbelow'] = 0x1E01; 40397 t['arrowboth'] = 0x2194; 40398 t['arrowdashdown'] = 0x21E3; 40399 t['arrowdashleft'] = 0x21E0; 40400 t['arrowdashright'] = 0x21E2; 40401 t['arrowdashup'] = 0x21E1; 40402 t['arrowdblboth'] = 0x21D4; 40403 t['arrowdbldown'] = 0x21D3; 40404 t['arrowdblleft'] = 0x21D0; 40405 t['arrowdblright'] = 0x21D2; 40406 t['arrowdblup'] = 0x21D1; 40407 t['arrowdown'] = 0x2193; 40408 t['arrowdownleft'] = 0x2199; 40409 t['arrowdownright'] = 0x2198; 40410 t['arrowdownwhite'] = 0x21E9; 40411 t['arrowheaddownmod'] = 0x02C5; 40412 t['arrowheadleftmod'] = 0x02C2; 40413 t['arrowheadrightmod'] = 0x02C3; 40414 t['arrowheadupmod'] = 0x02C4; 40415 t['arrowhorizex'] = 0xF8E7; 40416 t['arrowleft'] = 0x2190;
40417 t['arrowleftdbl'] = 0x21D0; 40418 t['arrowleftdblstroke'] = 0x21CD; 40419 t['arrowleftoverright'] = 0x21C6; 40420 t['arrowleftwhite'] = 0x21E6; 40421 t['arrowright'] = 0x2192; 40422 t['arrowrightdblstroke'] = 0x21CF; 40423 t['arrowrightheavy'] = 0x279E; 40424 t['arrowrightoverleft'] = 0x21C4; 40425 t['arrowrightwhite'] = 0x21E8; 40426 t['arrowtableft'] = 0x21E4; 40427 t['arrowtabright'] = 0x21E5; 40428 t['arrowup'] = 0x2191; 40429 t['arrowupdn'] = 0x2195; 40430 t['arrowupdnbse'] = 0x21A8; 40431 t['arrowupdownbase'] = 0x21A8; 40432 t['arrowupleft'] = 0x2196; 40433 t['arrowupleftofdown'] = 0x21C5; 40434 t['arrowupright'] = 0x2197; 40435 t['arrowupwhite'] = 0x21E7; 40436 t['arrowvertex'] = 0xF8E6; 40437 t['asciicircum'] = 0x005E; 40438 t['asciicircummonospace'] = 0xFF3E; 40439 t['asciitilde'] = 0x007E; 40440 t['asciitildemonospace'] = 0xFF5E; 40441 t['ascript'] = 0x0251; 40442 t['ascriptturned'] = 0x0252; 40443 t['asmallhiragana'] = 0x3041; 40444 t['asmallkatakana'] = 0x30A1; 40445 t['asmallkatakanahalfwidth'] = 0xFF67; 40446 t['asterisk'] = 0x002A; 40447 t['asteriskaltonearabic'] = 0x066D; 40448 t['asteriskarabic'] = 0x066D; 40449 t['asteriskmath'] = 0x2217; 40450 t['asteriskmonospace'] = 0xFF0A; 40451 t['asterisksmall'] = 0xFE61; 40452 t['asterism'] = 0x2042; 40453 t['asuperior'] = 0xF6E9; 40454 t['asymptoticallyequal'] = 0x2243; 40455 t['at'] = 0x0040; 40456 t['atilde'] = 0x00E3; 40457 t['atmonospace'] = 0xFF20; 40458 t['atsmall'] = 0xFE6B; 40459 t['aturned'] = 0x0250; 40460 t['aubengali'] = 0x0994; 40461 t['aubopomofo'] = 0x3120; 40462 t['audeva'] = 0x0914; 40463 t['augujarati'] = 0x0A94; 40464 t['augurmukhi'] = 0x0A14; 40465 t['aulengthmarkbengali'] = 0x09D7; 40466 t['aumatragurmukhi'] = 0x0A4C; 40467 t['auvowelsignbengali'] = 0x09CC; 40468 t['auvowelsigndeva'] = 0x094C; 40469 t['auvowelsigngujarati'] = 0x0ACC; 40470 t['avagrahadeva'] = 0x093D; 40471 t['aybarmenian'] = 0x0561; 40472 t['ayin'] = 0x05E2; 40473 t['ayinaltonehebrew'] = 0xFB20; 40474 t['ayinhebrew'] = 0x05E2; 40475 t['b'] = 0x0062; 40476 t['babengali'] = 0x09AC; 40477 t['backslash'] = 0x005C; 40478 t['backslashmonospace'] = 0xFF3C; 40479 t['badeva'] = 0x092C; 40480 t['bagujarati'] = 0x0AAC; 40481 t['bagurmukhi'] = 0x0A2C; 40482 t['bahiragana'] = 0x3070; 40483 t['bahtthai'] = 0x0E3F; 40484 t['bakatakana'] = 0x30D0; 40485 t['bar'] = 0x007C; 40486 t['barmonospace'] = 0xFF5C; 40487 t['bbopomofo'] = 0x3105; 40488 t['bcircle'] = 0x24D1; 40489 t['bdotaccent'] = 0x1E03; 40490 t['bdotbelow'] = 0x1E05; 40491 t['beamedsixteenthnotes'] = 0x266C; 40492 t['because'] = 0x2235; 40493 t['becyrillic'] = 0x0431; 40494 t['beharabic'] = 0x0628; 40495 t['behfinalarabic'] = 0xFE90; 40496 t['behinitialarabic'] = 0xFE91; 40497 t['behiragana'] = 0x3079; 40498 t['behmedialarabic'] = 0xFE92; 40499 t['behmeeminitialarabic'] = 0xFC9F; 40500 t['behmeemisolatedarabic'] = 0xFC08; 40501 t['behnoonfinalarabic'] = 0xFC6D; 40502 t['bekatakana'] = 0x30D9; 40503 t['benarmenian'] = 0x0562; 40504 t['bet'] = 0x05D1; 40505 t['beta'] = 0x03B2; 40506 t['betasymbolgreek'] = 0x03D0; 40507 t['betdagesh'] = 0xFB31; 40508 t['betdageshhebrew'] = 0xFB31; 40509 t['bethebrew'] = 0x05D1; 40510 t['betrafehebrew'] = 0xFB4C; 40511 t['bhabengali'] = 0x09AD; 40512 t['bhadeva'] = 0x092D; 40513 t['bhagujarati'] = 0x0AAD; 40514 t['bhagurmukhi'] = 0x0A2D; 40515 t['bhook'] = 0x0253; 40516 t['bihiragana'] = 0x3073; 40517 t['bikatakana'] = 0x30D3; 40518 t['bilabialclick'] = 0x0298; 40519 t['bindigurmukhi'] = 0x0A02; 40520 t['birusquare'] = 0x3331; 40521 t['blackcircle'] = 0x25CF; 40522 t['blackdiamond'] = 0x25C6; 40523 t['blackdownpointingtriangle'] = 0x25BC; 40524 t['blackleftpointingpointer'] = 0x25C4; 40525 t['blackleftpointingtriangle'] = 0x25C0; 40526 t['blacklenticularbracketleft'] = 0x3010; 40527 t['blacklenticularbracketleftvertical'] = 0xFE3B; 40528 t['blacklenticularbracketright'] = 0x3011; 40529 t['blacklenticularbracketrightvertical'] = 0xFE3C; 40530 t['blacklowerlefttriangle'] = 0x25E3; 40531 t['blacklowerrighttriangle'] = 0x25E2; 40532 t['blackrectangle'] = 0x25AC; 40533 t['blackrightpointingpointer'] = 0x25BA; 40534 t['blackrightpointingtriangle'] = 0x25B6; 40535 t['blacksmallsquare'] = 0x25AA; 40536 t['blacksmilingface'] = 0x263B; 40537 t['blacksquare'] = 0x25A0; 40538 t['blackstar'] = 0x2605; 40539 t['blackupperlefttriangle'] = 0x25E4; 40540 t['blackupperrighttriangle'] = 0x25E5; 40541 t['blackuppointingsmalltriangle'] = 0x25B4; 40542 t['blackuppointingtriangle'] = 0x25B2; 40543 t['blank'] = 0x2423; 40544 t['blinebelow'] = 0x1E07; 40545 t['block'] = 0x2588; 40546 t['bmonospace'] = 0xFF42; 40547 t['bobaimaithai'] = 0x0E1A; 40548 t['bohiragana'] = 0x307C; 40549 t['bokatakana'] = 0x30DC; 40550 t['bparen'] = 0x249D; 40551 t['bqsquare'] = 0x33C3; 40552 t['braceex'] = 0xF8F4; 40553 t['braceleft'] = 0x007B; 40554 t['braceleftbt'] = 0xF8F3; 40555 t['braceleftmid'] = 0xF8F2; 40556 t['braceleftmonospace'] = 0xFF5B; 40557 t['braceleftsmall'] = 0xFE5B; 40558 t['bracelefttp'] = 0xF8F1; 40559 t['braceleftvertical'] = 0xFE37; 40560 t['braceright'] = 0x007D; 40561 t['bracerightbt'] = 0xF8FE; 40562 t['bracerightmid'] = 0xF8FD; 40563 t['bracerightmonospace'] = 0xFF5D; 40564 t['bracerightsmall'] = 0xFE5C; 40565 t['bracerighttp'] = 0xF8FC; 40566 t['bracerightvertical'] = 0xFE38; 40567 t['bracketleft'] = 0x005B; 40568 t['bracketleftbt'] = 0xF8F0; 40569 t['bracketleftex'] = 0xF8EF; 40570 t['bracketleftmonospace'] = 0xFF3B; 40571 t['bracketlefttp'] = 0xF8EE; 40572 t['bracketright'] = 0x005D; 40573 t['bracketrightbt'] = 0xF8FB; 40574 t['bracketrightex'] = 0xF8FA; 40575 t['bracketrightmonospace'] = 0xFF3D; 40576 t['bracketrighttp'] = 0xF8F9; 40577 t['breve'] = 0x02D8; 40578 t['brevebelowcmb'] = 0x032E; 40579 t['brevecmb'] = 0x0306; 40580 t['breveinvertedbelowcmb'] = 0x032F; 40581 t['breveinvertedcmb'] = 0x0311; 40582 t['breveinverteddoublecmb'] = 0x0361; 40583 t['bridgebelowcmb'] = 0x032A; 40584 t['bridgeinvertedbelowcmb'] = 0x033A; 40585 t['brokenbar'] = 0x00A6;
40586 t['bstroke'] = 0x0180; 40587 t['bsuperior'] = 0xF6EA; 40588 t['btopbar'] = 0x0183; 40589 t['buhiragana'] = 0x3076; 40590 t['bukatakana'] = 0x30D6; 40591 t['bullet'] = 0x2022; 40592 t['bulletinverse'] = 0x25D8; 40593 t['bulletoperator'] = 0x2219; 40594 t['bullseye'] = 0x25CE; 40595 t['c'] = 0x0063; 40596 t['caarmenian'] = 0x056E; 40597 t['cabengali'] = 0x099A; 40598 t['cacute'] = 0x0107; 40599 t['cadeva'] = 0x091A; 40600 t['cagujarati'] = 0x0A9A; 40601 t['cagurmukhi'] = 0x0A1A; 40602 t['calsquare'] = 0x3388; 40603 t['candrabindubengali'] = 0x0981; 40604 t['candrabinducmb'] = 0x0310; 40605 t['candrabindudeva'] = 0x0901; 40606 t['candrabindugujarati'] = 0x0A81; 40607 t['capslock'] = 0x21EA; 40608 t['careof'] = 0x2105; 40609 t['caron'] = 0x02C7; 40610 t['caronbelowcmb'] = 0x032C; 40611 t['caroncmb'] = 0x030C; 40612 t['carriagereturn'] = 0x21B5; 40613 t['cbopomofo'] = 0x3118; 40614 t['ccaron'] = 0x010D; 40615 t['ccedilla'] = 0x00E7; 40616 t['ccedillaacute'] = 0x1E09; 40617 t['ccircle'] = 0x24D2; 40618 t['ccircumflex'] = 0x0109; 40619 t['ccurl'] = 0x0255; 40620 t['cdot'] = 0x010B; 40621 t['cdotaccent'] = 0x010B; 40622 t['cdsquare'] = 0x33C5; 40623 t['cedilla'] = 0x00B8; 40624 t['cedillacmb'] = 0x0327; 40625 t['cent'] = 0x00A2; 40626 t['centigrade'] = 0x2103; 40627 t['centinferior'] = 0xF6DF; 40628 t['centmonospace'] = 0xFFE0; 40629 t['centoldstyle'] = 0xF7A2; 40630 t['centsuperior'] = 0xF6E0; 40631 t['chaarmenian'] = 0x0579; 40632 t['chabengali'] = 0x099B; 40633 t['chadeva'] = 0x091B; 40634 t['chagujarati'] = 0x0A9B; 40635 t['chagurmukhi'] = 0x0A1B; 40636 t['chbopomofo'] = 0x3114; 40637 t['cheabkhasiancyrillic'] = 0x04BD; 40638 t['checkmark'] = 0x2713; 40639 t['checyrillic'] = 0x0447; 40640 t['chedescenderabkhasiancyrillic'] = 0x04BF; 40641 t['chedescendercyrillic'] = 0x04B7; 40642 t['chedieresiscyrillic'] = 0x04F5; 40643 t['cheharmenian'] = 0x0573; 40644 t['chekhakassiancyrillic'] = 0x04CC; 40645 t['cheverticalstrokecyrillic'] = 0x04B9; 40646 t['chi'] = 0x03C7; 40647 t['chieuchacirclekorean'] = 0x3277; 40648 t['chieuchaparenkorean'] = 0x3217; 40649 t['chieuchcirclekorean'] = 0x3269; 40650 t['chieuchkorean'] = 0x314A; 40651 t['chieuchparenkorean'] = 0x3209; 40652 t['chochangthai'] = 0x0E0A; 40653 t['chochanthai'] = 0x0E08; 40654 t['chochingthai'] = 0x0E09; 40655 t['chochoethai'] = 0x0E0C; 40656 t['chook'] = 0x0188; 40657 t['cieucacirclekorean'] = 0x3276; 40658 t['cieucaparenkorean'] = 0x3216; 40659 t['cieuccirclekorean'] = 0x3268; 40660 t['cieuckorean'] = 0x3148; 40661 t['cieucparenkorean'] = 0x3208; 40662 t['cieucuparenkorean'] = 0x321C; 40663 t['circle'] = 0x25CB; 40664 t['circlecopyrt'] = 0x00A9; 40665 t['circlemultiply'] = 0x2297; 40666 t['circleot'] = 0x2299; 40667 t['circleplus'] = 0x2295; 40668 t['circlepostalmark'] = 0x3036; 40669 t['circlewithlefthalfblack'] = 0x25D0; 40670 t['circlewithrighthalfblack'] = 0x25D1; 40671 t['circumflex'] = 0x02C6; 40672 t['circumflexbelowcmb'] = 0x032D; 40673 t['circumflexcmb'] = 0x0302; 40674 t['clear'] = 0x2327; 40675 t['clickalveolar'] = 0x01C2; 40676 t['clickdental'] = 0x01C0; 40677 t['clicklateral'] = 0x01C1; 40678 t['clickretroflex'] = 0x01C3; 40679 t['club'] = 0x2663; 40680 t['clubsuitblack'] = 0x2663; 40681 t['clubsuitwhite'] = 0x2667; 40682 t['cmcubedsquare'] = 0x33A4; 40683 t['cmonospace'] = 0xFF43; 40684 t['cmsquaredsquare'] = 0x33A0; 40685 t['coarmenian'] = 0x0581; 40686 t['colon'] = 0x003A; 40687 t['colonmonetary'] = 0x20A1; 40688 t['colonmonospace'] = 0xFF1A; 40689 t['colonsign'] = 0x20A1; 40690 t['colonsmall'] = 0xFE55; 40691 t['colontriangularhalfmod'] = 0x02D1; 40692 t['colontriangularmod'] = 0x02D0; 40693 t['comma'] = 0x002C; 40694 t['commaabovecmb'] = 0x0313; 40695 t['commaaboverightcmb'] = 0x0315; 40696 t['commaaccent'] = 0xF6C3; 40697 t['commaarabic'] = 0x060C; 40698 t['commaarmenian'] = 0x055D; 40699 t['commainferior'] = 0xF6E1; 40700 t['commamonospace'] = 0xFF0C; 40701 t['commareversedabovecmb'] = 0x0314; 40702 t['commareversedmod'] = 0x02BD; 40703 t['commasmall'] = 0xFE50; 40704 t['commasuperior'] = 0xF6E2; 40705 t['commaturnedabovecmb'] = 0x0312; 40706 t['commaturnedmod'] = 0x02BB; 40707 t['compass'] = 0x263C; 40708 t['congruent'] = 0x2245; 40709 t['contourintegral'] = 0x222E; 40710 t['control'] = 0x2303; 40711 t['controlACK'] = 0x0006; 40712 t['controlBEL'] = 0x0007; 40713 t['controlBS'] = 0x0008; 40714 t['controlCAN'] = 0x0018; 40715 t['controlCR'] = 0x000D; 40716 t['controlDC1'] = 0x0011; 40717 t['controlDC2'] = 0x0012; 40718 t['controlDC3'] = 0x0013; 40719 t['controlDC4'] = 0x0014; 40720 t['controlDEL'] = 0x007F; 40721 t['controlDLE'] = 0x0010; 40722 t['controlEM'] = 0x0019; 40723 t['controlENQ'] = 0x0005; 40724 t['controlEOT'] = 0x0004; 40725 t['controlESC'] = 0x001B; 40726 t['controlETB'] = 0x0017; 40727 t['controlETX'] = 0x0003; 40728 t['controlFF'] = 0x000C; 40729 t['controlFS'] = 0x001C; 40730 t['controlGS'] = 0x001D;
40731 t['controlHT'] = 0x0009; 40732 t['controlLF'] = 0x000A; 40733 t['controlNAK'] = 0x0015; 40734 t['controlNULL'] = 0x0000; 40735 t['controlRS'] = 0x001E; 40736 t['controlSI'] = 0x000F; 40737 t['controlSO'] = 0x000E; 40738 t['controlSOT'] = 0x0002; 40739 t['controlSTX'] = 0x0001; 40740 t['controlSUB'] = 0x001A; 40741 t['controlSYN'] = 0x0016; 40742 t['controlUS'] = 0x001F; 40743 t['controlVT'] = 0x000B; 40744 t['copyright'] = 0x00A9; 40745 t['copyrightsans'] = 0xF8E9; 40746 t['copyrightserif'] = 0xF6D9; 40747 t['cornerbracketleft'] = 0x300C; 40748 t['cornerbracketlefthalfwidth'] = 0xFF62; 40749 t['cornerbracketleftvertical'] = 0xFE41; 40750 t['cornerbracketright'] = 0x300D; 40751 t['cornerbracketrighthalfwidth'] = 0xFF63; 40752 t['cornerbracketrightvertical'] = 0xFE42; 40753 t['corporationsquare'] = 0x337F; 40754 t['cosquare'] = 0x33C7; 40755 t['coverkgsquare'] = 0x33C6; 40756 t['cparen'] = 0x249E; 40757 t['cruzeiro'] = 0x20A2; 40758 t['cstretched'] = 0x0297; 40759 t['curlyand'] = 0x22CF; 40760 t['curlyor'] = 0x22CE; 40761 t['currency'] = 0x00A4; 40762 t['cyrBreve'] = 0xF6D1; 40763 t['cyrFlex'] = 0xF6D2; 40764 t['cyrbreve'] = 0xF6D4; 40765 t['cyrflex'] = 0xF6D5; 40766 t['d'] = 0x0064; 40767 t['daarmenian'] = 0x0564; 40768 t['dabengali'] = 0x09A6; 40769 t['dadarabic'] = 0x0636; 40770 t['dadeva'] = 0x0926; 40771 t['dadfinalarabic'] = 0xFEBE; 40772 t['dadinitialarabic'] = 0xFEBF; 40773 t['dadmedialarabic'] = 0xFEC0; 40774 t['dagesh'] = 0x05BC; 40775 t['dageshhebrew'] = 0x05BC; 40776 t['dagger'] = 0x2020; 40777 t['daggerdbl'] = 0x2021; 40778 t['dagujarati'] = 0x0AA6; 40779 t['dagurmukhi'] = 0x0A26; 40780 t['dahiragana'] = 0x3060; 40781 t['dakatakana'] = 0x30C0; 40782 t['dalarabic'] = 0x062F; 40783 t['dalet'] = 0x05D3; 40784 t['daletdagesh'] = 0xFB33; 40785 t['daletdageshhebrew'] = 0xFB33; 40786 t['dalethebrew'] = 0x05D3; 40787 t['dalfinalarabic'] = 0xFEAA; 40788 t['dammaarabic'] = 0x064F; 40789 t['dammalowarabic'] = 0x064F; 40790 t['dammatanaltonearabic'] = 0x064C; 40791 t['dammatanarabic'] = 0x064C; 40792 t['danda'] = 0x0964; 40793 t['dargahebrew'] = 0x05A7; 40794 t['dargalefthebrew'] = 0x05A7; 40795 t['dasiapneumatacyrilliccmb'] = 0x0485; 40796 t['dblGrave'] = 0xF6D3; 40797 t['dblanglebracketleft'] = 0x300A; 40798 t['dblanglebracketleftvertical'] = 0xFE3D; 40799 t['dblanglebracketright'] = 0x300B; 40800 t['dblanglebracketrightvertical'] = 0xFE3E; 40801 t['dblarchinvertedbelowcmb'] = 0x032B; 40802 t['dblarrowleft'] = 0x21D4; 40803 t['dblarrowright'] = 0x21D2; 40804 t['dbldanda'] = 0x0965; 40805 t['dblgrave'] = 0xF6D6; 40806 t['dblgravecmb'] = 0x030F; 40807 t['dblintegral'] = 0x222C; 40808 t['dbllowline'] = 0x2017; 40809 t['dbllowlinecmb'] = 0x0333; 40810 t['dbloverlinecmb'] = 0x033F; 40811 t['dblprimemod'] = 0x02BA; 40812 t['dblverticalbar'] = 0x2016; 40813 t['dblverticallineabovecmb'] = 0x030E; 40814 t['dbopomofo'] = 0x3109; 40815 t['dbsquare'] = 0x33C8; 40816 t['dcaron'] = 0x010F; 40817 t['dcedilla'] = 0x1E11; 40818 t['dcircle'] = 0x24D3; 40819 t['dcircumflexbelow'] = 0x1E13; 40820 t['dcroat'] = 0x0111; 40821 t['ddabengali'] = 0x09A1; 40822 t['ddadeva'] = 0x0921; 40823 t['ddagujarati'] = 0x0AA1; 40824 t['ddagurmukhi'] = 0x0A21; 40825 t['ddalarabic'] = 0x0688; 40826 t['ddalfinalarabic'] = 0xFB89; 40827 t['dddhadeva'] = 0x095C; 40828 t['ddhabengali'] = 0x09A2; 40829 t['ddhadeva'] = 0x0922; 40830 t['ddhagujarati'] = 0x0AA2; 40831 t['ddhagurmukhi'] = 0x0A22; 40832 t['ddotaccent'] = 0x1E0B; 40833 t['ddotbelow'] = 0x1E0D; 40834 t['decimalseparatorarabic'] = 0x066B; 40835 t['decimalseparatorpersian'] = 0x066B; 40836 t['decyrillic'] = 0x0434; 40837 t['degree'] = 0x00B0; 40838 t['dehihebrew'] = 0x05AD; 40839 t['dehiragana'] = 0x3067; 40840 t['deicoptic'] = 0x03EF; 40841 t['dekatakana'] = 0x30C7; 40842 t['deleteleft'] = 0x232B; 40843 t['deleteright'] = 0x2326; 40844 t['delta'] = 0x03B4; 40845 t['deltaturned'] = 0x018D;
40846 t['denominatorminusonenumeratorbengali'] = 0x09F8; 40847 t['dezh'] = 0x02A4; 40848 t['dhabengali'] = 0x09A7; 40849 t['dhadeva'] = 0x0927; 40850 t['dhagujarati'] = 0x0AA7; 40851 t['dhagurmukhi'] = 0x0A27; 40852 t['dhook'] = 0x0257; 40853 t['dialytikatonos'] = 0x0385; 40854 t['dialytikatonoscmb'] = 0x0344; 40855 t['diamond'] = 0x2666; 40856 t['diamondsuitwhite'] = 0x2662; 40857 t['dieresis'] = 0x00A8; 40858 t['dieresisacute'] = 0xF6D7; 40859 t['dieresisbelowcmb'] = 0x0324; 40860 t['dieresiscmb'] = 0x0308; 40861 t['dieresisgrave'] = 0xF6D8; 40862 t['dieresistonos'] = 0x0385; 40863 t['dihiragana'] = 0x3062; 40864 t['dikatakana'] = 0x30C2; 40865 t['dittomark'] = 0x3003; 40866 t['divide'] = 0x00F7; 40867 t['divides'] = 0x2223; 40868 t['divisionslash'] = 0x2215; 40869 t['djecyrillic'] = 0x0452; 40870 t['dkshade'] = 0x2593; 40871 t['dlinebelow'] = 0x1E0F; 40872 t['dlsquare'] = 0x3397; 40873 t['dmacron'] = 0x0111; 40874 t['dmonospace'] = 0xFF44; 40875 t['dnblock'] = 0x2584; 40876 t['dochadathai'] = 0x0E0E; 40877 t['dodekthai'] = 0x0E14; 40878 t['dohiragana'] = 0x3069; 40879 t['dokatakana'] = 0x30C9; 40880 t['dollar'] = 0x0024; 40881 t['dollarinferior'] = 0xF6E3; 40882 t['dollarmonospace'] = 0xFF04; 40883 t['dollaroldstyle'] = 0xF724; 40884 t['dollarsmall'] = 0xFE69; 40885 t['dollarsuperior'] = 0xF6E4; 40886 t['dong'] = 0x20AB; 40887 t['dorusquare'] = 0x3326; 40888 t['dotaccent'] = 0x02D9; 40889 t['dotaccentcmb'] = 0x0307; 40890 t['dotbelowcmb'] = 0x0323; 40891 t['dotbelowcomb'] = 0x0323;
40892 t['dotkatakana'] = 0x30FB; 40893 t['dotlessi'] = 0x0131; 40894 t['dotlessj'] = 0xF6BE; 40895 t['dotlessjstrokehook'] = 0x0284; 40896 t['dotmath'] = 0x22C5; 40897 t['dottedcircle'] = 0x25CC; 40898 t['doubleyodpatah'] = 0xFB1F; 40899 t['doubleyodpatahhebrew'] = 0xFB1F; 40900 t['downtackbelowcmb'] = 0x031E; 40901 t['downtackmod'] = 0x02D5; 40902 t['dparen'] = 0x249F; 40903 t['dsuperior'] = 0xF6EB; 40904 t['dtail'] = 0x0256; 40905 t['dtopbar'] = 0x018C; 40906 t['duhiragana'] = 0x3065; 40907 t['dukatakana'] = 0x30C5; 40908 t['dz'] = 0x01F3; 40909 t['dzaltone'] = 0x02A3; 40910 t['dzcaron'] = 0x01C6; 40911 t['dzcurl'] = 0x02A5; 40912 t['dzeabkhasiancyrillic'] = 0x04E1; 40913 t['dzecyrillic'] = 0x0455; 40914 t['dzhecyrillic'] = 0x045F; 40915 t['e'] = 0x0065; 40916 t['eacute'] = 0x00E9; 40917 t['earth'] = 0x2641; 40918 t['ebengali'] = 0x098F; 40919 t['ebopomofo'] = 0x311C; 40920 t['ebreve'] = 0x0115; 40921 t['ecandradeva'] = 0x090D; 40922 t['ecandragujarati'] = 0x0A8D; 40923 t['ecandravowelsigndeva'] = 0x0945; 40924 t['ecandravowelsigngujarati'] = 0x0AC5; 40925 t['ecaron'] = 0x011B; 40926 t['ecedillabreve'] = 0x1E1D; 40927 t['echarmenian'] = 0x0565; 40928 t['echyiwnarmenian'] = 0x0587; 40929 t['ecircle'] = 0x24D4; 40930 t['ecircumflex'] = 0x00EA; 40931 t['ecircumflexacute'] = 0x1EBF; 40932 t['ecircumflexbelow'] = 0x1E19; 40933 t['ecircumflexdotbelow'] = 0x1EC7; 40934 t['ecircumflexgrave'] = 0x1EC1; 40935 t['ecircumflexhookabove'] = 0x1EC3; 40936 t['ecircumflextilde'] = 0x1EC5; 40937 t['ecyrillic'] = 0x0454; 40938 t['edblgrave'] = 0x0205; 40939 t['edeva'] = 0x090F; 40940 t['edieresis'] = 0x00EB; 40941 t['edot'] = 0x0117; 40942 t['edotaccent'] = 0x0117; 40943 t['edotbelow'] = 0x1EB9; 40944 t['eegurmukhi'] = 0x0A0F; 40945 t['eematragurmukhi'] = 0x0A47; 40946 t['efcyrillic'] = 0x0444; 40947 t['egrave'] = 0x00E8; 40948 t['egujarati'] = 0x0A8F; 40949 t['eharmenian'] = 0x0567; 40950 t['ehbopomofo'] = 0x311D; 40951 t['ehiragana'] = 0x3048; 40952 t['ehookabove'] = 0x1EBB; 40953 t['eibopomofo'] = 0x311F; 40954 t['eight'] = 0x0038; 40955 t['eightarabic'] = 0x0668; 40956 t['eightbengali'] = 0x09EE; 40957 t['eightcircle'] = 0x2467; 40958 t['eightcircleinversesansserif'] = 0x2791; 40959 t['eightdeva'] = 0x096E; 40960 t['eighteencircle'] = 0x2471; 40961 t['eighteenparen'] = 0x2485; 40962 t['eighteenperiod'] = 0x2499; 40963 t['eightgujarati'] = 0x0AEE; 40964 t['eightgurmukhi'] = 0x0A6E; 40965 t['eighthackarabic'] = 0x0668; 40966 t['eighthangzhou'] = 0x3028; 40967 t['eighthnotebeamed'] = 0x266B; 40968 t['eightideographicparen'] = 0x3227; 40969 t['eightinferior'] = 0x2088; 40970 t['eightmonospace'] = 0xFF18; 40971 t['eightoldstyle'] = 0xF738; 40972 t['eightparen'] = 0x247B; 40973 t['eightperiod'] = 0x248F; 40974 t['eightpersian'] = 0x06F8; 40975 t['eightroman'] = 0x2177; 40976 t['eightsuperior'] = 0x2078; 40977 t['eightthai'] = 0x0E58; 40978 t['einvertedbreve'] = 0x0207; 40979 t['eiotifiedcyrillic'] = 0x0465; 40980 t['ekatakana'] = 0x30A8; 40981 t['ekatakanahalfwidth'] = 0xFF74; 40982 t['ekonkargurmukhi'] = 0x0A74; 40983 t['ekorean'] = 0x3154; 40984 t['elcyrillic'] = 0x043B; 40985 t['element'] = 0x2208; 40986 t['elevencircle'] = 0x246A; 40987 t['elevenparen'] = 0x247E; 40988 t['elevenperiod'] = 0x2492; 40989 t['elevenroman'] = 0x217A; 40990 t['ellipsis'] = 0x2026; 40991 t['ellipsisvertical'] = 0x22EE; 40992 t['emacron'] = 0x0113; 40993 t['emacronacute'] = 0x1E17; 40994 t['emacrongrave'] = 0x1E15; 40995 t['emcyrillic'] = 0x043C; 40996 t['emdash'] = 0x2014; 40997 t['emdashvertical'] = 0xFE31; 40998 t['emonospace'] = 0xFF45; 40999 t['emphasismarkarmenian'] = 0x055B; 41000 t['emptyset'] = 0x2205; 41001 t['enbopomofo'] = 0x3123; 41002 t['encyrillic'] = 0x043D; 41003 t['endash'] = 0x2013; 41004 t['endashvertical'] = 0xFE32; 41005 t['endescendercyrillic'] = 0x04A3; 41006 t['eng'] = 0x014B; 41007 t['engbopomofo'] = 0x3125; 41008 t['enghecyrillic'] = 0x04A5; 41009 t['enhookcyrillic'] = 0x04C8; 41010 t['enspace'] = 0x2002; 41011 t['eogonek'] = 0x0119; 41012 t['eokorean'] = 0x3153; 41013 t['eopen'] = 0x025B; 41014 t['eopenclosed'] = 0x029A; 41015 t['eopenreversed'] = 0x025C; 41016 t['eopenreversedclosed'] = 0x025E; 41017 t['eopenreversedhook'] = 0x025D; 41018 t['eparen'] = 0x24A0; 41019 t['epsilon'] = 0x03B5; 41020 t['epsilontonos'] = 0x03AD; 41021 t['equal'] = 0x003D; 41022 t['equalmonospace'] = 0xFF1D; 41023 t['equalsmall'] = 0xFE66; 41024 t['equalsuperior'] = 0x207C; 41025 t['equivalence'] = 0x2261; 41026 t['erbopomofo'] = 0x3126; 41027 t['ercyrillic'] = 0x0440; 41028 t['ereversed'] = 0x0258; 41029 t['ereversedcyrillic'] = 0x044D; 41030 t['escyrillic'] = 0x0441; 41031 t['esdescendercyrillic'] = 0x04AB; 41032 t['esh'] = 0x0283; 41033 t['eshcurl'] = 0x0286; 41034 t['eshortdeva'] = 0x090E; 41035 t['eshortvowelsigndeva'] = 0x0946; 41036 t['eshreversedloop'] = 0x01AA; 41037 t['eshsquatreversed'] = 0x0285; 41038 t['esmallhiragana'] = 0x3047; 41039 t['esmallkatakana'] = 0x30A7; 41040 t['esmallkatakanahalfwidth'] = 0xFF6A;
41041 t['estimated'] = 0x212E; 41042 t['esuperior'] = 0xF6EC; 41043 t['eta'] = 0x03B7; 41044 t['etarmenian'] = 0x0568; 41045 t['etatonos'] = 0x03AE; 41046 t['eth'] = 0x00F0; 41047 t['etilde'] = 0x1EBD; 41048 t['etildebelow'] = 0x1E1B; 41049 t['etnahtafoukhhebrew'] = 0x0591; 41050 t['etnahtafoukhlefthebrew'] = 0x0591; 41051 t['etnahtahebrew'] = 0x0591; 41052 t['etnahtalefthebrew'] = 0x0591; 41053 t['eturned'] = 0x01DD; 41054 t['eukorean'] = 0x3161; 41055 t['euro'] = 0x20AC; 41056 t['evowelsignbengali'] = 0x09C7; 41057 t['evowelsigndeva'] = 0x0947; 41058 t['evowelsigngujarati'] = 0x0AC7; 41059 t['exclam'] = 0x0021; 41060 t['exclamarmenian'] = 0x055C; 41061 t['exclamdbl'] = 0x203C; 41062 t['exclamdown'] = 0x00A1; 41063 t['exclamdownsmall'] = 0xF7A1; 41064 t['exclammonospace'] = 0xFF01; 41065 t['exclamsmall'] = 0xF721; 41066 t['existential'] = 0x2203; 41067 t['ezh'] = 0x0292; 41068 t['ezhcaron'] = 0x01EF; 41069 t['ezhcurl'] = 0x0293; 41070 t['ezhreversed'] = 0x01B9; 41071 t['ezhtail'] = 0x01BA; 41072 t['f'] = 0x0066; 41073 t['fadeva'] = 0x095E; 41074 t['fagurmukhi'] = 0x0A5E; 41075 t['fahrenheit'] = 0x2109; 41076 t['fathaarabic'] = 0x064E; 41077 t['fathalowarabic'] = 0x064E; 41078 t['fathatanarabic'] = 0x064B; 41079 t['fbopomofo'] = 0x3108; 41080 t['fcircle'] = 0x24D5; 41081 t['fdotaccent'] = 0x1E1F; 41082 t['feharabic'] = 0x0641; 41083 t['feharmenian'] = 0x0586; 41084 t['fehfinalarabic'] = 0xFED2; 41085 t['fehinitialarabic'] = 0xFED3; 41086 t['fehmedialarabic'] = 0xFED4; 41087 t['feicoptic'] = 0x03E5; 41088 t['female'] = 0x2640; 41089 t['ff'] = 0xFB00; 41090 t['ffi'] = 0xFB03; 41091 t['ffl'] = 0xFB04; 41092 t['fi'] = 0xFB01; 41093 t['fifteencircle'] = 0x246E; 41094 t['fifteenparen'] = 0x2482; 41095 t['fifteenperiod'] = 0x2496; 41096 t['figuredash'] = 0x2012; 41097 t['filledbox'] = 0x25A0; 41098 t['filledrect'] = 0x25AC; 41099 t['finalkaf'] = 0x05DA; 41100 t['finalkafdagesh'] = 0xFB3A; 41101 t['finalkafdageshhebrew'] = 0xFB3A; 41102 t['finalkafhebrew'] = 0x05DA; 41103 t['finalmem'] = 0x05DD; 41104 t['finalmemhebrew'] = 0x05DD; 41105 t['finalnun'] = 0x05DF; 41106 t['finalnunhebrew'] = 0x05DF; 41107 t['finalpe'] = 0x05E3; 41108 t['finalpehebrew'] = 0x05E3; 41109 t['finaltsadi'] = 0x05E5; 41110 t['finaltsadihebrew'] = 0x05E5; 41111 t['firsttonechinese'] = 0x02C9; 41112 t['fisheye'] = 0x25C9; 41113 t['fitacyrillic'] = 0x0473; 41114 t['five'] = 0x0035; 41115 t['fivearabic'] = 0x0665; 41116 t['fivebengali'] = 0x09EB; 41117 t['fivecircle'] = 0x2464; 41118 t['fivecircleinversesansserif'] = 0x278E; 41119 t['fivedeva'] = 0x096B; 41120 t['fiveeighths'] = 0x215D; 41121 t['fivegujarati'] = 0x0AEB; 41122 t['fivegurmukhi'] = 0x0A6B; 41123 t['fivehackarabic'] = 0x0665; 41124 t['fivehangzhou'] = 0x3025; 41125 t['fiveideographicparen'] = 0x3224; 41126 t['fiveinferior'] = 0x2085; 41127 t['fivemonospace'] = 0xFF15; 41128 t['fiveoldstyle'] = 0xF735; 41129 t['fiveparen'] = 0x2478; 41130 t['fiveperiod'] = 0x248C; 41131 t['fivepersian'] = 0x06F5; 41132 t['fiveroman'] = 0x2174; 41133 t['fivesuperior'] = 0x2075; 41134 t['fivethai'] = 0x0E55; 41135 t['fl'] = 0xFB02; 41136 t['florin'] = 0x0192; 41137 t['fmonospace'] = 0xFF46; 41138 t['fmsquare'] = 0x3399; 41139 t['fofanthai'] = 0x0E1F; 41140 t['fofathai'] = 0x0E1D; 41141 t['fongmanthai'] = 0x0E4F; 41142 t['forall'] = 0x2200; 41143 t['four'] = 0x0034; 41144 t['fourarabic'] = 0x0664; 41145 t['fourbengali'] = 0x09EA; 41146 t['fourcircle'] = 0x2463; 41147 t['fourcircleinversesansserif'] = 0x278D; 41148 t['fourdeva'] = 0x096A; 41149 t['fourgujarati'] = 0x0AEA; 41150 t['fourgurmukhi'] = 0x0A6A; 41151 t['fourhackarabic'] = 0x0664; 41152 t['fourhangzhou'] = 0x3024; 41153 t['fourideographicparen'] = 0x3223; 41154 t['fourinferior'] = 0x2084; 41155 t['fourmonospace'] = 0xFF14; 41156 t['fournumeratorbengali'] = 0x09F7; 41157 t['fouroldstyle'] = 0xF734; 41158 t['fourparen'] = 0x2477; 41159 t['fourperiod'] = 0x248B; 41160 t['fourpersian'] = 0x06F4; 41161 t['fourroman'] = 0x2173; 41162 t['foursuperior'] = 0x2074; 41163 t['fourteencircle'] = 0x246D; 41164 t['fourteenparen'] = 0x2481; 41165 t['fourteenperiod'] = 0x2495;
41166 t['fourthai'] = 0x0E54; 41167 t['fourthtonechinese'] = 0x02CB; 41168 t['fparen'] = 0x24A1; 41169 t['fraction'] = 0x2044; 41170 t['franc'] = 0x20A3; 41171 t['g'] = 0x0067; 41172 t['gabengali'] = 0x0997; 41173 t['gacute'] = 0x01F5; 41174 t['gadeva'] = 0x0917; 41175 t['gafarabic'] = 0x06AF; 41176 t['gaffinalarabic'] = 0xFB93; 41177 t['gafinitialarabic'] = 0xFB94; 41178 t['gafmedialarabic'] = 0xFB95; 41179 t['gagujarati'] = 0x0A97; 41180 t['gagurmukhi'] = 0x0A17; 41181 t['gahiragana'] = 0x304C; 41182 t['gakatakana'] = 0x30AC; 41183 t['gamma'] = 0x03B3; 41184 t['gammalatinsmall'] = 0x0263; 41185 t['gammasuperior'] = 0x02E0; 41186 t['gangiacoptic'] = 0x03EB; 41187 t['gbopomofo'] = 0x310D; 41188 t['gbreve'] = 0x011F; 41189 t['gcaron'] = 0x01E7; 41190 t['gcedilla'] = 0x0123; 41191 t['gcircle'] = 0x24D6; 41192 t['gcircumflex'] = 0x011D; 41193 t['gcommaaccent'] = 0x0123; 41194 t['gdot'] = 0x0121; 41195 t['gdotaccent'] = 0x0121; 41196 t['gecyrillic'] = 0x0433; 41197 t['gehiragana'] = 0x3052; 41198 t['gekatakana'] = 0x30B2; 41199 t['geometricallyequal'] = 0x2251; 41200 t['gereshaccenthebrew'] = 0x059C; 41201 t['gereshhebrew'] = 0x05F3; 41202 t['gereshmuqdamhebrew'] = 0x059D; 41203 t['germandbls'] = 0x00DF; 41204 t['gershayimaccenthebrew'] = 0x059E; 41205 t['gershayimhebrew'] = 0x05F4; 41206 t['getamark'] = 0x3013; 41207 t['ghabengali'] = 0x0998; 41208 t['ghadarmenian'] = 0x0572; 41209 t['ghadeva'] = 0x0918; 41210 t['ghagujarati'] = 0x0A98; 41211 t['ghagurmukhi'] = 0x0A18; 41212 t['ghainarabic'] = 0x063A; 41213 t['ghainfinalarabic'] = 0xFECE; 41214 t['ghaininitialarabic'] = 0xFECF; 41215 t['ghainmedialarabic'] = 0xFED0; 41216 t['ghemiddlehookcyrillic'] = 0x0495; 41217 t['ghestrokecyrillic'] = 0x0493; 41218 t['gheupturncyrillic'] = 0x0491; 41219 t['ghhadeva'] = 0x095A; 41220 t['ghhagurmukhi'] = 0x0A5A; 41221 t['ghook'] = 0x0260; 41222 t['ghzsquare'] = 0x3393; 41223 t['gihiragana'] = 0x304E; 41224 t['gikatakana'] = 0x30AE; 41225 t['gimarmenian'] = 0x0563; 41226 t['gimel'] = 0x05D2; 41227 t['gimeldagesh'] = 0xFB32; 41228 t['gimeldageshhebrew'] = 0xFB32; 41229 t['gimelhebrew'] = 0x05D2; 41230 t['gjecyrillic'] = 0x0453; 41231 t['glottalinvertedstroke'] = 0x01BE; 41232 t['glottalstop'] = 0x0294; 41233 t['glottalstopinverted'] = 0x0296; 41234 t['glottalstopmod'] = 0x02C0; 41235 t['glottalstopreversed'] = 0x0295; 41236 t['glottalstopreversedmod'] = 0x02C1; 41237 t['glottalstopreversedsuperior'] = 0x02E4; 41238 t['glottalstopstroke'] = 0x02A1; 41239 t['glottalstopstrokereversed'] = 0x02A2; 41240 t['gmacron'] = 0x1E21; 41241 t['gmonospace'] = 0xFF47; 41242 t['gohiragana'] = 0x3054; 41243 t['gokatakana'] = 0x30B4; 41244 t['gparen'] = 0x24A2; 41245 t['gpasquare'] = 0x33AC; 41246 t['gradient'] = 0x2207; 41247 t['grave'] = 0x0060; 41248 t['gravebelowcmb'] = 0x0316; 41249 t['gravecmb'] = 0x0300; 41250 t['gravecomb'] = 0x0300; 41251 t['gravedeva'] = 0x0953; 41252 t['gravelowmod'] = 0x02CE; 41253 t['gravemonospace'] = 0xFF40; 41254 t['gravetonecmb'] = 0x0340; 41255 t['greater'] = 0x003E; 41256 t['greaterequal'] = 0x2265; 41257 t['greaterequalorless'] = 0x22DB; 41258 t['greatermonospace'] = 0xFF1E; 41259 t['greaterorequivalent'] = 0x2273; 41260 t['greaterorless'] = 0x2277; 41261 t['greateroverequal'] = 0x2267; 41262 t['greatersmall'] = 0xFE65; 41263 t['gscript'] = 0x0261; 41264 t['gstroke'] = 0x01E5; 41265 t['guhiragana'] = 0x3050; 41266 t['guillemotleft'] = 0x00AB; 41267 t['guillemotright'] = 0x00BB; 41268 t['guilsinglleft'] = 0x2039; 41269 t['guilsinglright'] = 0x203A; 41270 t['gukatakana'] = 0x30B0; 41271 t['guramusquare'] = 0x3318; 41272 t['gysquare'] = 0x33C9; 41273 t['h'] = 0x0068; 41274 t['haabkhasiancyrillic'] = 0x04A9; 41275 t['haaltonearabic'] = 0x06C1; 41276 t['habengali'] = 0x09B9; 41277 t['hadescendercyrillic'] = 0x04B3; 41278 t['hadeva'] = 0x0939; 41279 t['hagujarati'] = 0x0AB9; 41280 t['hagurmukhi'] = 0x0A39; 41281 t['haharabic'] = 0x062D; 41282 t['hahfinalarabic'] = 0xFEA2; 41283 t['hahinitialarabic'] = 0xFEA3; 41284 t['hahiragana'] = 0x306F; 41285 t['hahmedialarabic'] = 0xFEA4; 41286 t['haitusquare'] = 0x332A; 41287 t['hakatakana'] = 0x30CF; 41288 t['hakatakanahalfwidth'] = 0xFF8A; 41289 t['halantgurmukhi'] = 0x0A4D; 41290 t['hamzaarabic'] = 0x0621; 41291 t['hamzalowarabic'] = 0x0621; 41292 t['hangulfiller'] = 0x3164; 41293 t['hardsigncyrillic'] = 0x044A; 41294 t['harpoonleftbarbup'] = 0x21BC; 41295 t['harpoonrightbarbup'] = 0x21C0; 41296 t['hasquare'] = 0x33CA; 41297 t['hatafpatah'] = 0x05B2; 41298 t['hatafpatah16'] = 0x05B2; 41299 t['hatafpatah23'] = 0x05B2; 41300 t['hatafpatah2f'] = 0x05B2; 41301 t['hatafpatahhebrew'] = 0x05B2; 41302 t['hatafpatahnarrowhebrew'] = 0x05B2; 41303 t['hatafpatahquarterhebrew'] = 0x05B2; 41304 t['hatafpatahwidehebrew'] = 0x05B2; 41305 t['hatafqamats'] = 0x05B3; 41306 t['hatafqamats1b'] = 0x05B3; 41307 t['hatafqamats28'] = 0x05B3; 41308 t['hatafqamats34'] = 0x05B3; 41309 t['hatafqamatshebrew'] = 0x05B3; 41310 t['hatafqamatsnarrowhebrew'] = 0x05B3; 41311 t['hatafqamatsquarterhebrew'] = 0x05B3; 41312 t['hatafqamatswidehebrew'] = 0x05B3; 41313 t['hatafsegol'] = 0x05B1; 41314 t['hatafsegol17'] = 0x05B1; 41315 t['hatafsegol24'] = 0x05B1; 41316 t['hatafsegol30'] = 0x05B1; 41317 t['hatafsegolhebrew'] = 0x05B1; 41318 t['hatafsegolnarrowhebrew'] = 0x05B1; 41319 t['hatafsegolquarterhebrew'] = 0x05B1; 41320 t['hatafsegolwidehebrew'] = 0x05B1; 41321 t['hbar'] = 0x0127; 41322 t['hbopomofo'] = 0x310F; 41323 t['hbrevebelow'] = 0x1E2B; 41324 t['hcedilla'] = 0x1E29; 41325 t['hcircle'] = 0x24D7; 41326 t['hcircumflex'] = 0x0125; 41327 t['hdieresis'] = 0x1E27; 41328 t['hdotaccent'] = 0x1E23; 41329 t['hdotbelow'] = 0x1E25; 41330 t['he'] = 0x05D4; 41331 t['heart'] = 0x2665; 41332 t['heartsuitblack'] = 0x2665; 41333 t['heartsuitwhite'] = 0x2661; 41334 t['hedagesh'] = 0xFB34; 41335 t['hedageshhebrew'] = 0xFB34; 41336 t['hehaltonearabic'] = 0x06C1; 41337 t['heharabic'] = 0x0647; 41338 t['hehebrew'] = 0x05D4; 41339 t['hehfinalaltonearabic'] = 0xFBA7; 41340 t['hehfinalalttwoarabic'] = 0xFEEA; 41341 t['hehfinalarabic'] = 0xFEEA; 41342 t['hehhamzaabovefinalarabic'] = 0xFBA5; 41343 t['hehhamzaaboveisolatedarabic'] = 0xFBA4; 41344 t['hehinitialaltonearabic'] = 0xFBA8; 41345 t['hehinitialarabic'] = 0xFEEB; 41346 t['hehiragana'] = 0x3078; 41347 t['hehmedialaltonearabic'] = 0xFBA9; 41348 t['hehmedialarabic'] = 0xFEEC; 41349 t['heiseierasquare'] = 0x337B; 41350 t['hekatakana'] = 0x30D8; 41351 t['hekatakanahalfwidth'] = 0xFF8D; 41352 t['hekutaarusquare'] = 0x3336; 41353 t['henghook'] = 0x0267; 41354 t['herutusquare'] = 0x3339; 41355 t['het'] = 0x05D7; 41356 t['hethebrew'] = 0x05D7; 41357 t['hhook'] = 0x0266; 41358 t['hhooksuperior'] = 0x02B1; 41359 t['hieuhacirclekorean'] = 0x327B; 41360 t['hieuhaparenkorean'] = 0x321B; 41361 t['hieuhcirclekorean'] = 0x326D; 41362 t['hieuhkorean'] = 0x314E; 41363 t['hieuhparenkorean'] = 0x320D; 41364 t['hihiragana'] = 0x3072; 41365 t['hikatakana'] = 0x30D2; 41366 t['hikatakanahalfwidth'] = 0xFF8B; 41367 t['hiriq'] = 0x05B4; 41368 t['hiriq14'] = 0x05B4; 41369 t['hiriq21'] = 0x05B4; 41370 t['hiriq2d'] = 0x05B4; 41371 t['hiriqhebrew'] = 0x05B4; 41372 t['hiriqnarrowhebrew'] = 0x05B4; 41373 t['hiriqquarterhebrew'] = 0x05B4; 41374 t['hiriqwidehebrew'] = 0x05B4; 41375 t['hlinebelow'] = 0x1E96; 41376 t['hmonospace'] = 0xFF48; 41377 t['hoarmenian'] = 0x0570; 41378 t['hohipthai'] = 0x0E2B; 41379 t['hohiragana'] = 0x307B; 41380 t['hokatakana'] = 0x30DB; 41381 t['hokatakanahalfwidth'] = 0xFF8E; 41382 t['holam'] = 0x05B9; 41383 t['holam19'] = 0x05B9; 41384 t['holam26'] = 0x05B9; 41385 t['holam32'] = 0x05B9; 41386 t['holamhebrew'] = 0x05B9; 41387 t['holamnarrowhebrew'] = 0x05B9; 41388 t['holamquarterhebrew'] = 0x05B9; 41389 t['holamwidehebrew'] = 0x05B9; 41390 t['honokhukthai'] = 0x0E2E;
41391 t['hookabovecomb'] = 0x0309; 41392 t['hookcmb'] = 0x0309; 41393 t['hookpalatalizedbelowcmb'] = 0x0321; 41394 t['hookretroflexbelowcmb'] = 0x0322; 41395 t['hoonsquare'] = 0x3342; 41396 t['horicoptic'] = 0x03E9; 41397 t['horizontalbar'] = 0x2015; 41398 t['horncmb'] = 0x031B; 41399 t['hotsprings'] = 0x2668; 41400 t['house'] = 0x2302; 41401 t['hparen'] = 0x24A3; 41402 t['hsuperior'] = 0x02B0; 41403 t['hturned'] = 0x0265; 41404 t['huhiragana'] = 0x3075; 41405 t['huiitosquare'] = 0x3333; 41406 t['hukatakana'] = 0x30D5; 41407 t['hukatakanahalfwidth'] = 0xFF8C; 41408 t['hungarumlaut'] = 0x02DD; 41409 t['hungarumlautcmb'] = 0x030B; 41410 t['hv'] = 0x0195; 41411 t['hyphen'] = 0x002D; 41412 t['hypheninferior'] = 0xF6E5; 41413 t['hyphenmonospace'] = 0xFF0D; 41414 t['hyphensmall'] = 0xFE63; 41415 t['hyphensuperior'] = 0xF6E6; 41416 t['hyphentwo'] = 0x2010; 41417 t['i'] = 0x0069; 41418 t['iacute'] = 0x00ED; 41419 t['iacyrillic'] = 0x044F; 41420 t['ibengali'] = 0x0987; 41421 t['ibopomofo'] = 0x3127; 41422 t['ibreve'] = 0x012D; 41423 t['icaron'] = 0x01D0; 41424 t['icircle'] = 0x24D8; 41425 t['icircumflex'] = 0x00EE; 41426 t['icyrillic'] = 0x0456; 41427 t['idblgrave'] = 0x0209; 41428 t['ideographearthcircle'] = 0x328F; 41429 t['ideographfirecircle'] = 0x328B; 41430 t['ideographicallianceparen'] = 0x323F; 41431 t['ideographiccallparen'] = 0x323A; 41432 t['ideographiccentrecircle'] = 0x32A5; 41433 t['ideographicclose'] = 0x3006; 41434 t['ideographiccomma'] = 0x3001; 41435 t['ideographiccommaleft'] = 0xFF64; 41436 t['ideographiccongratulationparen'] = 0x3237; 41437 t['ideographiccorrectcircle'] = 0x32A3; 41438 t['ideographicearthparen'] = 0x322F; 41439 t['ideographicenterpriseparen'] = 0x323D; 41440 t['ideographicexcellentcircle'] = 0x329D; 41441 t['ideographicfestivalparen'] = 0x3240; 41442 t['ideographicfinancialcircle'] = 0x3296; 41443 t['ideographicfinancialparen'] = 0x3236; 41444 t['ideographicfireparen'] = 0x322B; 41445 t['ideographichaveparen'] = 0x3232; 41446 t['ideographichighcircle'] = 0x32A4; 41447 t['ideographiciterationmark'] = 0x3005; 41448 t['ideographiclaborcircle'] = 0x3298; 41449 t['ideographiclaborparen'] = 0x3238; 41450 t['ideographicleftcircle'] = 0x32A7; 41451 t['ideographiclowcircle'] = 0x32A6; 41452 t['ideographicmedicinecircle'] = 0x32A9; 41453 t['ideographicmetalparen'] = 0x322E; 41454 t['ideographicmoonparen'] = 0x322A; 41455 t['ideographicnameparen'] = 0x3234; 41456 t['ideographicperiod'] = 0x3002; 41457 t['ideographicprintcircle'] = 0x329E; 41458 t['ideographicreachparen'] = 0x3243; 41459 t['ideographicrepresentparen'] = 0x3239; 41460 t['ideographicresourceparen'] = 0x323E; 41461 t['ideographicrightcircle'] = 0x32A8; 41462 t['ideographicsecretcircle'] = 0x3299; 41463 t['ideographicselfparen'] = 0x3242; 41464 t['ideographicsocietyparen'] = 0x3233; 41465 t['ideographicspace'] = 0x3000; 41466 t['ideographicspecialparen'] = 0x3235; 41467 t['ideographicstockparen'] = 0x3231; 41468 t['ideographicstudyparen'] = 0x323B; 41469 t['ideographicsunparen'] = 0x3230; 41470 t['ideographicsuperviseparen'] = 0x323C; 41471 t['ideographicwaterparen'] = 0x322C; 41472 t['ideographicwoodparen'] = 0x322D; 41473 t['ideographiczero'] = 0x3007; 41474 t['ideographmetalcircle'] = 0x328E; 41475 t['ideographmooncircle'] = 0x328A; 41476 t['ideographnamecircle'] = 0x3294; 41477 t['ideographsuncircle'] = 0x3290; 41478 t['ideographwatercircle'] = 0x328C; 41479 t['ideographwoodcircle'] = 0x328D; 41480 t['ideva'] = 0x0907; 41481 t['idieresis'] = 0x00EF; 41482 t['idieresisacute'] = 0x1E2F; 41483 t['idieresiscyrillic'] = 0x04E5; 41484 t['idotbelow'] = 0x1ECB; 41485 t['iebrevecyrillic'] = 0x04D7; 41486 t['iecyrillic'] = 0x0435; 41487 t['ieungacirclekorean'] = 0x3275; 41488 t['ieungaparenkorean'] = 0x3215; 41489 t['ieungcirclekorean'] = 0x3267; 41490 t['ieungkorean'] = 0x3147; 41491 t['ieungparenkorean'] = 0x3207; 41492 t['igrave'] = 0x00EC; 41493 t['igujarati'] = 0x0A87; 41494 t['igurmukhi'] = 0x0A07; 41495 t['ihiragana'] = 0x3044; 41496 t['ihookabove'] = 0x1EC9; 41497 t['iibengali'] = 0x0988; 41498 t['iicyrillic'] = 0x0438; 41499 t['iideva'] = 0x0908; 41500 t['iigujarati'] = 0x0A88; 41501 t['iigurmukhi'] = 0x0A08; 41502 t['iimatragurmukhi'] = 0x0A40; 41503 t['iinvertedbreve'] = 0x020B; 41504 t['iishortcyrillic'] = 0x0439; 41505 t['iivowelsignbengali'] = 0x09C0; 41506 t['iivowelsigndeva'] = 0x0940; 41507 t['iivowelsigngujarati'] = 0x0AC0; 41508 t['ij'] = 0x0133; 41509 t['ikatakana'] = 0x30A4; 41510 t['ikatakanahalfwidth'] = 0xFF72; 41511 t['ikorean'] = 0x3163; 41512 t['ilde'] = 0x02DC; 41513 t['iluyhebrew'] = 0x05AC; 41514 t['imacron'] = 0x012B; 41515 t['imacroncyrillic'] = 0x04E3; 41516 t['imageorapproximatelyequal'] = 0x2253; 41517 t['imatragurmukhi'] = 0x0A3F; 41518 t['imonospace'] = 0xFF49; 41519 t['increment'] = 0x2206; 41520 t['infinity'] = 0x221E; 41521 t['iniarmenian'] = 0x056B; 41522 t['integral'] = 0x222B; 41523 t['integralbottom'] = 0x2321; 41524 t['integralbt'] = 0x2321; 41525 t['integralex'] = 0xF8F5; 41526 t['integraltop'] = 0x2320; 41527 t['integraltp'] = 0x2320; 41528 t['intersection'] = 0x2229; 41529 t['intisquare'] = 0x3305; 41530 t['invbullet'] = 0x25D8; 41531 t['invcircle'] = 0x25D9; 41532 t['invsmileface'] = 0x263B; 41533 t['iocyrillic'] = 0x0451; 41534 t['iogonek'] = 0x012F; 41535 t['iota'] = 0x03B9; 41536 t['iotadieresis'] = 0x03CA;
41537 t['iotadieresistonos'] = 0x0390; 41538 t['iotalatin'] = 0x0269; 41539 t['iotatonos'] = 0x03AF; 41540 t['iparen'] = 0x24A4; 41541 t['irigurmukhi'] = 0x0A72; 41542 t['ismallhiragana'] = 0x3043; 41543 t['ismallkatakana'] = 0x30A3; 41544 t['ismallkatakanahalfwidth'] = 0xFF68; 41545 t['issharbengali'] = 0x09FA; 41546 t['istroke'] = 0x0268; 41547 t['isuperior'] = 0xF6ED; 41548 t['iterationhiragana'] = 0x309D; 41549 t['iterationkatakana'] = 0x30FD; 41550 t['itilde'] = 0x0129; 41551 t['itildebelow'] = 0x1E2D; 41552 t['iubopomofo'] = 0x3129; 41553 t['iucyrillic'] = 0x044E; 41554 t['ivowelsignbengali'] = 0x09BF; 41555 t['ivowelsigndeva'] = 0x093F; 41556 t['ivowelsigngujarati'] = 0x0ABF; 41557 t['izhitsacyrillic'] = 0x0475; 41558 t['izhitsadblgravecyrillic'] = 0x0477; 41559 t['j'] = 0x006A; 41560 t['jaarmenian'] = 0x0571; 41561 t['jabengali'] = 0x099C; 41562 t['jadeva'] = 0x091C; 41563 t['jagujarati'] = 0x0A9C; 41564 t['jagurmukhi'] = 0x0A1C; 41565 t['jbopomofo'] = 0x3110; 41566 t['jcaron'] = 0x01F0; 41567 t['jcircle'] = 0x24D9; 41568 t['jcircumflex'] = 0x0135; 41569 t['jcrossedtail'] = 0x029D; 41570 t['jdotlessstroke'] = 0x025F; 41571 t['jecyrillic'] = 0x0458; 41572 t['jeemarabic'] = 0x062C; 41573 t['jeemfinalarabic'] = 0xFE9E; 41574 t['jeeminitialarabic'] = 0xFE9F; 41575 t['jeemmedialarabic'] = 0xFEA0; 41576 t['jeharabic'] = 0x0698; 41577 t['jehfinalarabic'] = 0xFB8B; 41578 t['jhabengali'] = 0x099D; 41579 t['jhadeva'] = 0x091D; 41580 t['jhagujarati'] = 0x0A9D; 41581 t['jhagurmukhi'] = 0x0A1D; 41582 t['jheharmenian'] = 0x057B; 41583 t['jis'] = 0x3004; 41584 t['jmonospace'] = 0xFF4A; 41585 t['jparen'] = 0x24A5; 41586 t['jsuperior'] = 0x02B2; 41587 t['k'] = 0x006B; 41588 t['kabashkircyrillic'] = 0x04A1; 41589 t['kabengali'] = 0x0995; 41590 t['kacute'] = 0x1E31; 41591 t['kacyrillic'] = 0x043A; 41592 t['kadescendercyrillic'] = 0x049B; 41593 t['kadeva'] = 0x0915; 41594 t['kaf'] = 0x05DB; 41595 t['kafarabic'] = 0x0643; 41596 t['kafdagesh'] = 0xFB3B; 41597 t['kafdageshhebrew'] = 0xFB3B; 41598 t['kaffinalarabic'] = 0xFEDA; 41599 t['kafhebrew'] = 0x05DB; 41600 t['kafinitialarabic'] = 0xFEDB; 41601 t['kafmedialarabic'] = 0xFEDC; 41602 t['kafrafehebrew'] = 0xFB4D; 41603 t['kagujarati'] = 0x0A95; 41604 t['kagurmukhi'] = 0x0A15; 41605 t['kahiragana'] = 0x304B; 41606 t['kahookcyrillic'] = 0x04C4; 41607 t['kakatakana'] = 0x30AB; 41608 t['kakatakanahalfwidth'] = 0xFF76; 41609 t['kappa'] = 0x03BA; 41610 t['kappasymbolgreek'] = 0x03F0; 41611 t['kapyeounmieumkorean'] = 0x3171; 41612 t['kapyeounphieuphkorean'] = 0x3184; 41613 t['kapyeounpieupkorean'] = 0x3178; 41614 t['kapyeounssangpieupkorean'] = 0x3179; 41615 t['karoriisquare'] = 0x330D; 41616 t['kashidaautoarabic'] = 0x0640; 41617 t['kashidaautonosidebearingarabic'] = 0x0640; 41618 t['kasmallkatakana'] = 0x30F5; 41619 t['kasquare'] = 0x3384; 41620 t['kasraarabic'] = 0x0650; 41621 t['kasratanarabic'] = 0x064D; 41622 t['kastrokecyrillic'] = 0x049F; 41623 t['katahiraprolongmarkhalfwidth'] = 0xFF70; 41624 t['kaverticalstrokecyrillic'] = 0x049D; 41625 t['kbopomofo'] = 0x310E; 41626 t['kcalsquare'] = 0x3389; 41627 t['kcaron'] = 0x01E9; 41628 t['kcedilla'] = 0x0137; 41629 t['kcircle'] = 0x24DA; 41630 t['kcommaaccent'] = 0x0137; 41631 t['kdotbelow'] = 0x1E33; 41632 t['keharmenian'] = 0x0584; 41633 t['kehiragana'] = 0x3051; 41634 t['kekatakana'] = 0x30B1; 41635 t['kekatakanahalfwidth'] = 0xFF79; 41636 t['kenarmenian'] = 0x056F; 41637 t['kesmallkatakana'] = 0x30F6; 41638 t['kgreenlandic'] = 0x0138; 41639 t['khabengali'] = 0x0996; 41640 t['khacyrillic'] = 0x0445; 41641 t['khadeva'] = 0x0916; 41642 t['khagujarati'] = 0x0A96; 41643 t['khagurmukhi'] = 0x0A16; 41644 t['khaharabic'] = 0x062E; 41645 t['khahfinalarabic'] = 0xFEA6; 41646 t['khahinitialarabic'] = 0xFEA7; 41647 t['khahmedialarabic'] = 0xFEA8; 41648 t['kheicoptic'] = 0x03E7; 41649 t['khhadeva'] = 0x0959; 41650 t['khhagurmukhi'] = 0x0A59; 41651 t['khieukhacirclekorean'] = 0x3278; 41652 t['khieukhaparenkorean'] = 0x3218; 41653 t['khieukhcirclekorean'] = 0x326A; 41654 t['khieukhkorean'] = 0x314B; 41655 t['khieukhparenkorean'] = 0x320A; 41656 t['khokhaithai'] = 0x0E02; 41657 t['khokhonthai'] = 0x0E05; 41658 t['khokhuatthai'] = 0x0E03; 41659 t['khokhwaithai'] = 0x0E04; 41660 t['khomutthai'] = 0x0E5B; 41661 t['khook'] = 0x0199; 41662 t['khorakhangthai'] = 0x0E06; 41663 t['khzsquare'] = 0x3391; 41664 t['kihiragana'] = 0x304D; 41665 t['kikatakana'] = 0x30AD; 41666 t['kikatakanahalfwidth'] = 0xFF77; 41667 t['kiroguramusquare'] = 0x3315; 41668 t['kiromeetorusquare'] = 0x3316; 41669 t['kirosquare'] = 0x3314; 41670 t['kiyeokacirclekorean'] = 0x326E; 41671 t['kiyeokaparenkorean'] = 0x320E; 41672 t['kiyeokcirclekorean'] = 0x3260; 41673 t['kiyeokkorean'] = 0x3131; 41674 t['kiyeokparenkorean'] = 0x3200; 41675 t['kiyeoksioskorean'] = 0x3133; 41676 t['kjecyrillic'] = 0x045C; 41677 t['klinebelow'] = 0x1E35; 41678 t['klsquare'] = 0x3398; 41679 t['kmcubedsquare'] = 0x33A6; 41680 t['kmonospace'] = 0xFF4B; 41681 t['kmsquaredsquare'] = 0x33A2; 41682 t['kohiragana'] = 0x3053; 41683 t['kohmsquare'] = 0x33C0; 41684 t['kokaithai'] = 0x0E01; 41685 t['kokatakana'] = 0x30B3; 41686 t['kokatakanahalfwidth'] = 0xFF7A; 41687 t['kooposquare'] = 0x331E; 41688 t['koppacyrillic'] = 0x0481; 41689 t['koreanstandardsymbol'] = 0x327F; 41690 t['koroniscmb'] = 0x0343; 41691 t['kparen'] = 0x24A6; 41692 t['kpasquare'] = 0x33AA; 41693 t['ksicyrillic'] = 0x046F; 41694 t['ktsquare'] = 0x33CF; 41695 t['kturned'] = 0x029E; 41696 t['kuhiragana'] = 0x304F; 41697 t['kukatakana'] = 0x30AF; 41698 t['kukatakanahalfwidth'] = 0xFF78; 41699 t['kvsquare'] = 0x33B8; 41700 t['kwsquare'] = 0x33BE; 41701 t['l'] = 0x006C; 41702 t['labengali'] = 0x09B2; 41703 t['lacute'] = 0x013A; 41704 t['ladeva'] = 0x0932; 41705 t['lagujarati'] = 0x0AB2; 41706 t['lagurmukhi'] = 0x0A32; 41707 t['lakkhangyaothai'] = 0x0E45; 41708 t['lamaleffinalarabic'] = 0xFEFC; 41709 t['lamalefhamzaabovefinalarabic'] = 0xFEF8; 41710 t['lamalefhamzaaboveisolatedarabic'] = 0xFEF7; 41711 t['lamalefhamzabelowfinalarabic'] = 0xFEFA; 41712 t['lamalefhamzabelowisolatedarabic'] = 0xFEF9; 41713 t['lamalefisolatedarabic'] = 0xFEFB; 41714 t['lamalefmaddaabovefinalarabic'] = 0xFEF6; 41715 t['lamalefmaddaaboveisolatedarabic'] = 0xFEF5; 41716 t['lamarabic'] = 0x0644; 41717 t['lambda'] = 0x03BB; 41718 t['lambdastroke'] = 0x019B; 41719 t['lamed'] = 0x05DC; 41720 t['lameddagesh'] = 0xFB3C;
41721 t['lameddageshhebrew'] = 0xFB3C; 41722 t['lamedhebrew'] = 0x05DC; 41723 t['lamfinalarabic'] = 0xFEDE; 41724 t['lamhahinitialarabic'] = 0xFCCA; 41725 t['laminitialarabic'] = 0xFEDF; 41726 t['lamjeeminitialarabic'] = 0xFCC9; 41727 t['lamkhahinitialarabic'] = 0xFCCB; 41728 t['lamlamhehisolatedarabic'] = 0xFDF2; 41729 t['lammedialarabic'] = 0xFEE0; 41730 t['lammeemhahinitialarabic'] = 0xFD88; 41731 t['lammeeminitialarabic'] = 0xFCCC; 41732 t['largecircle'] = 0x25EF; 41733 t['lbar'] = 0x019A; 41734 t['lbelt'] = 0x026C; 41735 t['lbopomofo'] = 0x310C; 41736 t['lcaron'] = 0x013E; 41737 t['lcedilla'] = 0x013C; 41738 t['lcircle'] = 0x24DB; 41739 t['lcircumflexbelow'] = 0x1E3D; 41740 t['lcommaaccent'] = 0x013C; 41741 t['ldot'] = 0x0140; 41742 t['ldotaccent'] = 0x0140; 41743 t['ldotbelow'] = 0x1E37; 41744 t['ldotbelowmacron'] = 0x1E39; 41745 t['leftangleabovecmb'] = 0x031A; 41746 t['lefttackbelowcmb'] = 0x0318; 41747 t['less'] = 0x003C; 41748 t['lessequal'] = 0x2264; 41749 t['lessequalorgreater'] = 0x22DA; 41750 t['lessmonospace'] = 0xFF1C; 41751 t['lessorequivalent'] = 0x2272; 41752 t['lessorgreater'] = 0x2276; 41753 t['lessoverequal'] = 0x2266; 41754 t['lesssmall'] = 0xFE64; 41755 t['lezh'] = 0x026E; 41756 t['lfblock'] = 0x258C; 41757 t['lhookretroflex'] = 0x026D; 41758 t['lira'] = 0x20A4; 41759 t['liwnarmenian'] = 0x056C; 41760 t['lj'] = 0x01C9; 41761 t['ljecyrillic'] = 0x0459; 41762 t['ll'] = 0xF6C0; 41763 t['lladeva'] = 0x0933; 41764 t['llagujarati'] = 0x0AB3; 41765 t['llinebelow'] = 0x1E3B; 41766 t['llladeva'] = 0x0934; 41767 t['llvocalicbengali'] = 0x09E1; 41768 t['llvocalicdeva'] = 0x0961; 41769 t['llvocalicvowelsignbengali'] = 0x09E3; 41770 t['llvocalicvowelsigndeva'] = 0x0963; 41771 t['lmiddletilde'] = 0x026B; 41772 t['lmonospace'] = 0xFF4C; 41773 t['lmsquare'] = 0x33D0; 41774 t['lochulathai'] = 0x0E2C; 41775 t['logicaland'] = 0x2227; 41776 t['logicalnot'] = 0x00AC; 41777 t['logicalnotreversed'] = 0x2310; 41778 t['logicalor'] = 0x2228; 41779 t['lolingthai'] = 0x0E25; 41780 t['longs'] = 0x017F; 41781 t['lowlinecenterline'] = 0xFE4E; 41782 t['lowlinecmb'] = 0x0332; 41783 t['lowlinedashed'] = 0xFE4D; 41784 t['lozenge'] = 0x25CA; 41785 t['lparen'] = 0x24A7; 41786 t['lslash'] = 0x0142; 41787 t['lsquare'] = 0x2113; 41788 t['lsuperior'] = 0xF6EE; 41789 t['ltshade'] = 0x2591; 41790 t['luthai'] = 0x0E26; 41791 t['lvocalicbengali'] = 0x098C; 41792 t['lvocalicdeva'] = 0x090C; 41793 t['lvocalicvowelsignbengali'] = 0x09E2; 41794 t['lvocalicvowelsigndeva'] = 0x0962; 41795 t['lxsquare'] = 0x33D3; 41796 t['m'] = 0x006D; 41797 t['mabengali'] = 0x09AE; 41798 t['macron'] = 0x00AF; 41799 t['macronbelowcmb'] = 0x0331; 41800 t['macroncmb'] = 0x0304; 41801 t['macronlowmod'] = 0x02CD; 41802 t['macronmonospace'] = 0xFFE3; 41803 t['macute'] = 0x1E3F; 41804 t['madeva'] = 0x092E; 41805 t['magujarati'] = 0x0AAE; 41806 t['magurmukhi'] = 0x0A2E; 41807 t['mahapakhhebrew'] = 0x05A4; 41808 t['mahapakhlefthebrew'] = 0x05A4; 41809 t['mahiragana'] = 0x307E; 41810 t['maichattawalowleftthai'] = 0xF895; 41811 t['maichattawalowrightthai'] = 0xF894; 41812 t['maichattawathai'] = 0x0E4B; 41813 t['maichattawaupperleftthai'] = 0xF893; 41814 t['maieklowleftthai'] = 0xF88C; 41815 t['maieklowrightthai'] = 0xF88B; 41816 t['maiekthai'] = 0x0E48; 41817 t['maiekupperleftthai'] = 0xF88A; 41818 t['maihanakatleftthai'] = 0xF884; 41819 t['maihanakatthai'] = 0x0E31; 41820 t['maitaikhuleftthai'] = 0xF889; 41821 t['maitaikhuthai'] = 0x0E47; 41822 t['maitholowleftthai'] = 0xF88F; 41823 t['maitholowrightthai'] = 0xF88E; 41824 t['maithothai'] = 0x0E49; 41825 t['maithoupperleftthai'] = 0xF88D; 41826 t['maitrilowleftthai'] = 0xF892; 41827 t['maitrilowrightthai'] = 0xF891; 41828 t['maitrithai'] = 0x0E4A; 41829 t['maitriupperleftthai'] = 0xF890; 41830 t['maiyamokthai'] = 0x0E46; 41831 t['makatakana'] = 0x30DE; 41832 t['makatakanahalfwidth'] = 0xFF8F; 41833 t['male'] = 0x2642; 41834 t['mansyonsquare'] = 0x3347; 41835 t['maqafhebrew'] = 0x05BE; 41836 t['mars'] = 0x2642; 41837 t['masoracirclehebrew'] = 0x05AF; 41838 t['masquare'] = 0x3383; 41839 t['mbopomofo'] = 0x3107; 41840 t['mbsquare'] = 0x33D4; 41841 t['mcircle'] = 0x24DC; 41842 t['mcubedsquare'] = 0x33A5; 41843 t['mdotaccent'] = 0x1E41; 41844 t['mdotbelow'] = 0x1E43; 41845 t['meemarabic'] = 0x0645; 41846 t['meemfinalarabic'] = 0xFEE2; 41847 t['meeminitialarabic'] = 0xFEE3; 41848 t['meemmedialarabic'] = 0xFEE4; 41849 t['meemmeeminitialarabic'] = 0xFCD1; 41850 t['meemmeemisolatedarabic'] = 0xFC48; 41851 t['meetorusquare'] = 0x334D; 41852 t['mehiragana'] = 0x3081; 41853 t['meizierasquare'] = 0x337E; 41854 t['mekatakana'] = 0x30E1; 41855 t['mekatakanahalfwidth'] = 0xFF92; 41856 t['mem'] = 0x05DE; 41857 t['memdagesh'] = 0xFB3E; 41858 t['memdageshhebrew'] = 0xFB3E; 41859 t['memhebrew'] = 0x05DE; 41860 t['menarmenian'] = 0x0574; 41861 t['merkhahebrew'] = 0x05A5; 41862 t['merkhakefulahebrew'] = 0x05A6; 41863 t['merkhakefulalefthebrew'] = 0x05A6; 41864 t['merkhalefthebrew'] = 0x05A5; 41865 t['mhook'] = 0x0271; 41866 t['mhzsquare'] = 0x3392; 41867 t['middledotkatakanahalfwidth'] = 0xFF65; 41868 t['middot'] = 0x00B7; 41869 t['mieumacirclekorean'] = 0x3272; 41870 t['mieumaparenkorean'] = 0x3212; 41871 t['mieumcirclekorean'] = 0x3264; 41872 t['mieumkorean'] = 0x3141; 41873 t['mieumpansioskorean'] = 0x3170; 41874 t['mieumparenkorean'] = 0x3204; 41875 t['mieumpieupkorean'] = 0x316E; 41876 t['mieumsioskorean'] = 0x316F; 41877 t['mihiragana'] = 0x307F; 41878 t['mikatakana'] = 0x30DF; 41879 t['mikatakanahalfwidth'] = 0xFF90; 41880 t['minus'] = 0x2212; 41881 t['minusbelowcmb'] = 0x0320; 41882 t['minuscircle'] = 0x2296; 41883 t['minusmod'] = 0x02D7; 41884 t['minusplus'] = 0x2213; 41885 t['minute'] = 0x2032; 41886 t['miribaarusquare'] = 0x334A; 41887 t['mirisquare'] = 0x3349; 41888 t['mlonglegturned'] = 0x0270; 41889 t['mlsquare'] = 0x3396; 41890 t['mmcubedsquare'] = 0x33A3; 41891 t['mmonospace'] = 0xFF4D; 41892 t['mmsquaredsquare'] = 0x339F; 41893 t['mohiragana'] = 0x3082; 41894 t['mohmsquare'] = 0x33C1; 41895 t['mokatakana'] = 0x30E2; 41896 t['mokatakanahalfwidth'] = 0xFF93; 41897 t['molsquare'] = 0x33D6; 41898 t['momathai'] = 0x0E21; 41899 t['moverssquare'] = 0x33A7; 41900 t['moverssquaredsquare'] = 0x33A8; 41901 t['mparen'] = 0x24A8; 41902 t['mpasquare'] = 0x33AB; 41903 t['mssquare'] = 0x33B3; 41904 t['msuperior'] = 0xF6EF; 41905 t['mturned'] = 0x026F; 41906 t['mu'] = 0x00B5; 41907 t['mu1'] = 0x00B5; 41908 t['muasquare'] = 0x3382; 41909 t['muchgreater'] = 0x226B; 41910 t['muchless'] = 0x226A; 41911 t['mufsquare'] = 0x338C; 41912 t['mugreek'] = 0x03BC; 41913 t['mugsquare'] = 0x338D; 41914 t['muhiragana'] = 0x3080; 41915 t['mukatakana'] = 0x30E0; 41916 t['mukatakanahalfwidth'] = 0xFF91; 41917 t['mulsquare'] = 0x3395; 41918 t['multiply'] = 0x00D7;
41919 t['mumsquare'] = 0x339B; 41920 t['munahhebrew'] = 0x05A3; 41921 t['munahlefthebrew'] = 0x05A3; 41922 t['musicalnote'] = 0x266A; 41923 t['musicalnotedbl'] = 0x266B; 41924 t['musicflatsign'] = 0x266D; 41925 t['musicsharpsign'] = 0x266F; 41926 t['mussquare'] = 0x33B2; 41927 t['muvsquare'] = 0x33B6; 41928 t['muwsquare'] = 0x33BC; 41929 t['mvmegasquare'] = 0x33B9; 41930 t['mvsquare'] = 0x33B7; 41931 t['mwmegasquare'] = 0x33BF; 41932 t['mwsquare'] = 0x33BD; 41933 t['n'] = 0x006E; 41934 t['nabengali'] = 0x09A8; 41935 t['nabla'] = 0x2207; 41936 t['nacute'] = 0x0144; 41937 t['nadeva'] = 0x0928; 41938 t['nagujarati'] = 0x0AA8; 41939 t['nagurmukhi'] = 0x0A28; 41940 t['nahiragana'] = 0x306A; 41941 t['nakatakana'] = 0x30CA; 41942 t['nakatakanahalfwidth'] = 0xFF85; 41943 t['napostrophe'] = 0x0149; 41944 t['nasquare'] = 0x3381; 41945 t['nbopomofo'] = 0x310B; 41946 t['nbspace'] = 0x00A0; 41947 t['ncaron'] = 0x0148; 41948 t['ncedilla'] = 0x0146; 41949 t['ncircle'] = 0x24DD; 41950 t['ncircumflexbelow'] = 0x1E4B; 41951 t['ncommaaccent'] = 0x0146; 41952 t['ndotaccent'] = 0x1E45; 41953 t['ndotbelow'] = 0x1E47; 41954 t['nehiragana'] = 0x306D; 41955 t['nekatakana'] = 0x30CD; 41956 t['nekatakanahalfwidth'] = 0xFF88; 41957 t['newsheqelsign'] = 0x20AA; 41958 t['nfsquare'] = 0x338B; 41959 t['ngabengali'] = 0x0999; 41960 t['ngadeva'] = 0x0919; 41961 t['ngagujarati'] = 0x0A99; 41962 t['ngagurmukhi'] = 0x0A19; 41963 t['ngonguthai'] = 0x0E07; 41964 t['nhiragana'] = 0x3093; 41965 t['nhookleft'] = 0x0272; 41966 t['nhookretroflex'] = 0x0273; 41967 t['nieunacirclekorean'] = 0x326F; 41968 t['nieunaparenkorean'] = 0x320F; 41969 t['nieuncieuckorean'] = 0x3135; 41970 t['nieuncirclekorean'] = 0x3261; 41971 t['nieunhieuhkorean'] = 0x3136; 41972 t['nieunkorean'] = 0x3134; 41973 t['nieunpansioskorean'] = 0x3168; 41974 t['nieunparenkorean'] = 0x3201; 41975 t['nieunsioskorean'] = 0x3167; 41976 t['nieuntikeutkorean'] = 0x3166; 41977 t['nihiragana'] = 0x306B; 41978 t['nikatakana'] = 0x30CB; 41979 t['nikatakanahalfwidth'] = 0xFF86; 41980 t['nikhahitleftthai'] = 0xF899; 41981 t['nikhahitthai'] = 0x0E4D; 41982 t['nine'] = 0x0039; 41983 t['ninearabic'] = 0x0669; 41984 t['ninebengali'] = 0x09EF; 41985 t['ninecircle'] = 0x2468; 41986 t['ninecircleinversesansserif'] = 0x2792; 41987 t['ninedeva'] = 0x096F; 41988 t['ninegujarati'] = 0x0AEF; 41989 t['ninegurmukhi'] = 0x0A6F; 41990 t['ninehackarabic'] = 0x0669; 41991 t['ninehangzhou'] = 0x3029; 41992 t['nineideographicparen'] = 0x3228; 41993 t['nineinferior'] = 0x2089; 41994 t['ninemonospace'] = 0xFF19; 41995 t['nineoldstyle'] = 0xF739; 41996 t['nineparen'] = 0x247C; 41997 t['nineperiod'] = 0x2490; 41998 t['ninepersian'] = 0x06F9; 41999 t['nineroman'] = 0x2178; 42000 t['ninesuperior'] = 0x2079; 42001 t['nineteencircle'] = 0x2472; 42002 t['nineteenparen'] = 0x2486; 42003 t['nineteenperiod'] = 0x249A; 42004 t['ninethai'] = 0x0E59; 42005 t['nj'] = 0x01CC; 42006 t['njecyrillic'] = 0x045A; 42007 t['nkatakana'] = 0x30F3; 42008 t['nkatakanahalfwidth'] = 0xFF9D; 42009 t['nlegrightlong'] = 0x019E; 42010 t['nlinebelow'] = 0x1E49; 42011 t['nmonospace'] = 0xFF4E; 42012 t['nmsquare'] = 0x339A; 42013 t['nnabengali'] = 0x09A3; 42014 t['nnadeva'] = 0x0923; 42015 t['nnagujarati'] = 0x0AA3; 42016 t['nnagurmukhi'] = 0x0A23; 42017 t['nnnadeva'] = 0x0929; 42018 t['nohiragana'] = 0x306E; 42019 t['nokatakana'] = 0x30CE; 42020 t['nokatakanahalfwidth'] = 0xFF89; 42021 t['nonbreakingspace'] = 0x00A0; 42022 t['nonenthai'] = 0x0E13; 42023 t['nonuthai'] = 0x0E19; 42024 t['noonarabic'] = 0x0646; 42025 t['noonfinalarabic'] = 0xFEE6; 42026 t['noonghunnaarabic'] = 0x06BA; 42027 t['noonghunnafinalarabic'] = 0xFB9F; 42028 t['nooninitialarabic'] = 0xFEE7; 42029 t['noonjeeminitialarabic'] = 0xFCD2; 42030 t['noonjeemisolatedarabic'] = 0xFC4B; 42031 t['noonmedialarabic'] = 0xFEE8; 42032 t['noonmeeminitialarabic'] = 0xFCD5; 42033 t['noonmeemisolatedarabic'] = 0xFC4E; 42034 t['noonnoonfinalarabic'] = 0xFC8D; 42035 t['notcontains'] = 0x220C; 42036 t['notelement'] = 0x2209; 42037 t['notelementof'] = 0x2209; 42038 t['notequal'] = 0x2260; 42039 t['notgreater'] = 0x226F; 42040 t['notgreaternorequal'] = 0x2271; 42041 t['notgreaternorless'] = 0x2279; 42042 t['notidentical'] = 0x2262; 42043 t['notless'] = 0x226E; 42044 t['notlessnorequal'] = 0x2270; 42045 t['notparallel'] = 0x2226; 42046 t['notprecedes'] = 0x2280; 42047 t['notsubset'] = 0x2284; 42048 t['notsucceeds'] = 0x2281; 42049 t['notsuperset'] = 0x2285; 42050 t['nowarmenian'] = 0x0576; 42051 t['nparen'] = 0x24A9; 42052 t['nssquare'] = 0x33B1; 42053 t['nsuperior'] = 0x207F; 42054 t['ntilde'] = 0x00F1; 42055 t['nu'] = 0x03BD; 42056 t['nuhiragana'] = 0x306C; 42057 t['nukatakana'] = 0x30CC; 42058 t['nukatakanahalfwidth'] = 0xFF87; 42059 t['nuktabengali'] = 0x09BC; 42060 t['nuktadeva'] = 0x093C; 42061 t['nuktagujarati'] = 0x0ABC; 42062 t['nuktagurmukhi'] = 0x0A3C; 42063 t['numbersign'] = 0x0023; 42064 t['numbersignmonospace'] = 0xFF03; 42065 t['numbersignsmall'] = 0xFE5F; 42066 t['numeralsigngreek'] = 0x0374; 42067 t['numeralsignlowergreek'] = 0x0375; 42068 t['numero'] = 0x2116; 42069 t['nun'] = 0x05E0; 42070 t['nundagesh'] = 0xFB40; 42071 t['nundageshhebrew'] = 0xFB40; 42072 t['nunhebrew'] = 0x05E0; 42073 t['nvsquare'] = 0x33B5; 42074 t['nwsquare'] = 0x33BB; 42075 t['nyabengali'] = 0x099E; 42076 t['nyadeva'] = 0x091E; 42077 t['nyagujarati'] = 0x0A9E; 42078 t['nyagurmukhi'] = 0x0A1E; 42079 t['o'] = 0x006F; 42080 t['oacute'] = 0x00F3; 42081 t['oangthai'] = 0x0E2D; 42082 t['obarred'] = 0x0275; 42083 t['obarredcyrillic'] = 0x04E9; 42084 t['obarreddieresiscyrillic'] = 0x04EB; 42085 t['obengali'] = 0x0993; 42086 t['obopomofo'] = 0x311B; 42087 t['obreve'] = 0x014F; 42088 t['ocandradeva'] = 0x0911; 42089 t['ocandragujarati'] = 0x0A91; 42090 t['ocandravowelsigndeva'] = 0x0949; 42091 t['ocandravowelsigngujarati'] = 0x0AC9; 42092 t['ocaron'] = 0x01D2; 42093 t['ocircle'] = 0x24DE; 42094 t['ocircumflex'] = 0x00F4; 42095 t['ocircumflexacute'] = 0x1ED1; 42096 t['ocircumflexdotbelow'] = 0x1ED9; 42097 t['ocircumflexgrave'] = 0x1ED3; 42098 t['ocircumflexhookabove'] = 0x1ED5; 42099 t['ocircumflextilde'] = 0x1ED7; 42100 t['ocyrillic'] = 0x043E; 42101 t['odblacute'] = 0x0151; 42102 t['odblgrave'] = 0x020D; 42103 t['odeva'] = 0x0913; 42104 t['odieresis'] = 0x00F6; 42105 t['odieresiscyrillic'] = 0x04E7; 42106 t['odotbelow'] = 0x1ECD; 42107 t['oe'] = 0x0153; 42108 t['oekorean'] = 0x315A; 42109 t['ogonek'] = 0x02DB; 42110 t['ogonekcmb'] = 0x0328; 42111 t['ograve'] = 0x00F2; 42112 t['ogujarati'] = 0x0A93; 42113 t['oharmenian'] = 0x0585; 42114 t['ohiragana'] = 0x304A; 42115 t['ohookabove'] = 0x1ECF; 42116 t['ohorn'] = 0x01A1; 42117 t['ohornacute'] = 0x1EDB; 42118 t['ohorndotbelow'] = 0x1EE3; 42119 t['ohorngrave'] = 0x1EDD; 42120 t['ohornhookabove'] = 0x1EDF; 42121 t['ohorntilde'] = 0x1EE1; 42122 t['ohungarumlaut'] = 0x0151; 42123 t['oi'] = 0x01A3; 42124 t['oinvertedbreve'] = 0x020F; 42125 t['okatakana'] = 0x30AA; 42126 t['okatakanahalfwidth'] = 0xFF75; 42127 t['okorean'] = 0x3157; 42128 t['olehebrew'] = 0x05AB; 42129 t['omacron'] = 0x014D; 42130 t['omacronacute'] = 0x1E53; 42131 t['omacrongrave'] = 0x1E51; 42132 t['omdeva'] = 0x0950; 42133 t['omega'] = 0x03C9; 42134 t['omega1'] = 0x03D6; 42135 t['omegacyrillic'] = 0x0461; 42136 t['omegalatinclosed'] = 0x0277; 42137 t['omegaroundcyrillic'] = 0x047B; 42138 t['omegatitlocyrillic'] = 0x047D;
42139 t['omegatonos'] = 0x03CE; 42140 t['omgujarati'] = 0x0AD0; 42141 t['omicron'] = 0x03BF; 42142 t['omicrontonos'] = 0x03CC; 42143 t['omonospace'] = 0xFF4F; 42144 t['one'] = 0x0031; 42145 t['onearabic'] = 0x0661; 42146 t['onebengali'] = 0x09E7; 42147 t['onecircle'] = 0x2460; 42148 t['onecircleinversesansserif'] = 0x278A; 42149 t['onedeva'] = 0x0967; 42150 t['onedotenleader'] = 0x2024; 42151 t['oneeighth'] = 0x215B; 42152 t['onefitted'] = 0xF6DC; 42153 t['onegujarati'] = 0x0AE7; 42154 t['onegurmukhi'] = 0x0A67; 42155 t['onehackarabic'] = 0x0661; 42156 t['onehalf'] = 0x00BD; 42157 t['onehangzhou'] = 0x3021; 42158 t['oneideographicparen'] = 0x3220; 42159 t['oneinferior'] = 0x2081; 42160 t['onemonospace'] = 0xFF11; 42161 t['onenumeratorbengali'] = 0x09F4; 42162 t['oneoldstyle'] = 0xF731; 42163 t['oneparen'] = 0x2474; 42164 t['oneperiod'] = 0x2488; 42165 t['onepersian'] = 0x06F1; 42166 t['onequarter'] = 0x00BC; 42167 t['oneroman'] = 0x2170; 42168 t['onesuperior'] = 0x00B9; 42169 t['onethai'] = 0x0E51; 42170 t['onethird'] = 0x2153; 42171 t['oogonek'] = 0x01EB; 42172 t['oogonekmacron'] = 0x01ED; 42173 t['oogurmukhi'] = 0x0A13; 42174 t['oomatragurmukhi'] = 0x0A4B; 42175 t['oopen'] = 0x0254; 42176 t['oparen'] = 0x24AA; 42177 t['openbullet'] = 0x25E6; 42178 t['option'] = 0x2325; 42179 t['ordfeminine'] = 0x00AA; 42180 t['ordmasculine'] = 0x00BA; 42181 t['orthogonal'] = 0x221F; 42182 t['oshortdeva'] = 0x0912; 42183 t['oshortvowelsigndeva'] = 0x094A; 42184 t['oslash'] = 0x00F8; 42185 t['oslashacute'] = 0x01FF; 42186 t['osmallhiragana'] = 0x3049; 42187 t['osmallkatakana'] = 0x30A9; 42188 t['osmallkatakanahalfwidth'] = 0xFF6B; 42189 t['ostrokeacute'] = 0x01FF; 42190 t['osuperior'] = 0xF6F0; 42191 t['otcyrillic'] = 0x047F; 42192 t['otilde'] = 0x00F5; 42193 t['otildeacute'] = 0x1E4D; 42194 t['otildedieresis'] = 0x1E4F; 42195 t['oubopomofo'] = 0x3121; 42196 t['overline'] = 0x203E; 42197 t['overlinecenterline'] = 0xFE4A; 42198 t['overlinecmb'] = 0x0305; 42199 t['overlinedashed'] = 0xFE49; 42200 t['overlinedblwavy'] = 0xFE4C; 42201 t['overlinewavy'] = 0xFE4B; 42202 t['overscore'] = 0x00AF; 42203 t['ovowelsignbengali'] = 0x09CB; 42204 t['ovowelsigndeva'] = 0x094B; 42205 t['ovowelsigngujarati'] = 0x0ACB; 42206 t['p'] = 0x0070; 42207 t['paampssquare'] = 0x3380; 42208 t['paasentosquare'] = 0x332B; 42209 t['pabengali'] = 0x09AA; 42210 t['pacute'] = 0x1E55;
42211 t['padeva'] = 0x092A; 42212 t['pagedown'] = 0x21DF; 42213 t['pageup'] = 0x21DE; 42214 t['pagujarati'] = 0x0AAA; 42215 t['pagurmukhi'] = 0x0A2A; 42216 t['pahiragana'] = 0x3071; 42217 t['paiyannoithai'] = 0x0E2F; 42218 t['pakatakana'] = 0x30D1; 42219 t['palatalizationcyrilliccmb'] = 0x0484; 42220 t['palochkacyrillic'] = 0x04C0; 42221 t['pansioskorean'] = 0x317F; 42222 t['paragraph'] = 0x00B6; 42223 t['parallel'] = 0x2225; 42224 t['parenleft'] = 0x0028; 42225 t['parenleftaltonearabic'] = 0xFD3E; 42226 t['parenleftbt'] = 0xF8ED; 42227 t['parenleftex'] = 0xF8EC; 42228 t['parenleftinferior'] = 0x208D; 42229 t['parenleftmonospace'] = 0xFF08; 42230 t['parenleftsmall'] = 0xFE59; 42231 t['parenleftsuperior'] = 0x207D; 42232 t['parenlefttp'] = 0xF8EB; 42233 t['parenleftvertical'] = 0xFE35; 42234 t['parenright'] = 0x0029; 42235 t['parenrightaltonearabic'] = 0xFD3F; 42236 t['parenrightbt'] = 0xF8F8; 42237 t['parenrightex'] = 0xF8F7; 42238 t['parenrightinferior'] = 0x208E; 42239 t['parenrightmonospace'] = 0xFF09; 42240 t['parenrightsmall'] = 0xFE5A; 42241 t['parenrightsuperior'] = 0x207E; 42242 t['parenrighttp'] = 0xF8F6; 42243 t['parenrightvertical'] = 0xFE36; 42244 t['partialdiff'] = 0x2202; 42245 t['paseqhebrew'] = 0x05C0; 42246 t['pashtahebrew'] = 0x0599; 42247 t['pasquare'] = 0x33A9; 42248 t['patah'] = 0x05B7; 42249 t['patah11'] = 0x05B7; 42250 t['patah1d'] = 0x05B7; 42251 t['patah2a'] = 0x05B7; 42252 t['patahhebrew'] = 0x05B7; 42253 t['patahnarrowhebrew'] = 0x05B7; 42254 t['patahquarterhebrew'] = 0x05B7; 42255 t['patahwidehebrew'] = 0x05B7; 42256 t['pazerhebrew'] = 0x05A1; 42257 t['pbopomofo'] = 0x3106; 42258 t['pcircle'] = 0x24DF; 42259 t['pdotaccent'] = 0x1E57; 42260 t['pe'] = 0x05E4; 42261 t['pecyrillic'] = 0x043F; 42262 t['pedagesh'] = 0xFB44; 42263 t['pedageshhebrew'] = 0xFB44; 42264 t['peezisquare'] = 0x333B; 42265 t['pefinaldageshhebrew'] = 0xFB43; 42266 t['peharabic'] = 0x067E; 42267 t['peharmenian'] = 0x057A; 42268 t['pehebrew'] = 0x05E4; 42269 t['pehfinalarabic'] = 0xFB57; 42270 t['pehinitialarabic'] = 0xFB58; 42271 t['pehiragana'] = 0x307A; 42272 t['pehmedialarabic'] = 0xFB59; 42273 t['pekatakana'] = 0x30DA; 42274 t['pemiddlehookcyrillic'] = 0x04A7; 42275 t['perafehebrew'] = 0xFB4E; 42276 t['percent'] = 0x0025; 42277 t['percentarabic'] = 0x066A; 42278 t['percentmonospace'] = 0xFF05; 42279 t['percentsmall'] = 0xFE6A; 42280 t['period'] = 0x002E; 42281 t['periodarmenian'] = 0x0589; 42282 t['periodcentered'] = 0x00B7; 42283 t['periodhalfwidth'] = 0xFF61; 42284 t['periodinferior'] = 0xF6E7; 42285 t['periodmonospace'] = 0xFF0E; 42286 t['periodsmall'] = 0xFE52; 42287 t['periodsuperior'] = 0xF6E8; 42288 t['perispomenigreekcmb'] = 0x0342; 42289 t['perpendicular'] = 0x22A5; 42290 t['perthousand'] = 0x2030; 42291 t['peseta'] = 0x20A7; 42292 t['pfsquare'] = 0x338A; 42293 t['phabengali'] = 0x09AB; 42294 t['phadeva'] = 0x092B; 42295 t['phagujarati'] = 0x0AAB; 42296 t['phagurmukhi'] = 0x0A2B; 42297 t['phi'] = 0x03C6; 42298 t['phi1'] = 0x03D5; 42299 t['phieuphacirclekorean'] = 0x327A; 42300 t['phieuphaparenkorean'] = 0x321A; 42301 t['phieuphcirclekorean'] = 0x326C; 42302 t['phieuphkorean'] = 0x314D; 42303 t['phieuphparenkorean'] = 0x320C; 42304 t['philatin'] = 0x0278; 42305 t['phinthuthai'] = 0x0E3A; 42306 t['phisymbolgreek'] = 0x03D5; 42307 t['phook'] = 0x01A5; 42308 t['phophanthai'] = 0x0E1E; 42309 t['phophungthai'] = 0x0E1C; 42310 t['phosamphaothai'] = 0x0E20; 42311 t['pi'] = 0x03C0; 42312 t['pieupacirclekorean'] = 0x3273; 42313 t['pieupaparenkorean'] = 0x3213; 42314 t['pieupcieuckorean'] = 0x3176; 42315 t['pieupcirclekorean'] = 0x3265; 42316 t['pieupkiyeokkorean'] = 0x3172; 42317 t['pieupkorean'] = 0x3142; 42318 t['pieupparenkorean'] = 0x3205; 42319 t['pieupsioskiyeokkorean'] = 0x3174; 42320 t['pieupsioskorean'] = 0x3144; 42321 t['pieupsiostikeutkorean'] = 0x3175; 42322 t['pieupthieuthkorean'] = 0x3177; 42323 t['pieuptikeutkorean'] = 0x3173; 42324 t['pihiragana'] = 0x3074; 42325 t['pikatakana'] = 0x30D4; 42326 t['pisymbolgreek'] = 0x03D6; 42327 t['piwrarmenian'] = 0x0583; 42328 t['plus'] = 0x002B; 42329 t['plusbelowcmb'] = 0x031F; 42330 t['pluscircle'] = 0x2295; 42331 t['plusminus'] = 0x00B1; 42332 t['plusmod'] = 0x02D6; 42333 t['plusmonospace'] = 0xFF0B; 42334 t['plussmall'] = 0xFE62; 42335 t['plussuperior'] = 0x207A; 42336 t['pmonospace'] = 0xFF50; 42337 t['pmsquare'] = 0x33D8; 42338 t['pohiragana'] = 0x307D; 42339 t['pointingindexdownwhite'] = 0x261F; 42340 t['pointingindexleftwhite'] = 0x261C; 42341 t['pointingindexrightwhite'] = 0x261E; 42342 t['pointingindexupwhite'] = 0x261D; 42343 t['pokatakana'] = 0x30DD; 42344 t['poplathai'] = 0x0E1B; 42345 t['postalmark'] = 0x3012; 42346 t['postalmarkface'] = 0x3020; 42347 t['pparen'] = 0x24AB; 42348 t['precedes'] = 0x227A; 42349 t['prescription'] = 0x211E; 42350 t['primemod'] = 0x02B9; 42351 t['primereversed'] = 0x2035; 42352 t['product'] = 0x220F; 42353 t['projective'] = 0x2305; 42354 t['prolongedkana'] = 0x30FC; 42355 t['propellor'] = 0x2318; 42356 t['propersubset'] = 0x2282; 42357 t['propersuperset'] = 0x2283; 42358 t['proportion'] = 0x2237; 42359 t['proportional'] = 0x221D; 42360 t['psi'] = 0x03C8; 42361 t['psicyrillic'] = 0x0471; 42362 t['psilipneumatacyrilliccmb'] = 0x0486; 42363 t['pssquare'] = 0x33B0; 42364 t['puhiragana'] = 0x3077;
42365 t['pukatakana'] = 0x30D7; 42366 t['pvsquare'] = 0x33B4; 42367 t['pwsquare'] = 0x33BA; 42368 t['q'] = 0x0071; 42369 t['qadeva'] = 0x0958; 42370 t['qadmahebrew'] = 0x05A8; 42371 t['qafarabic'] = 0x0642; 42372 t['qaffinalarabic'] = 0xFED6; 42373 t['qafinitialarabic'] = 0xFED7; 42374 t['qafmedialarabic'] = 0xFED8; 42375 t['qamats'] = 0x05B8; 42376 t['qamats10'] = 0x05B8; 42377 t['qamats1a'] = 0x05B8; 42378 t['qamats1c'] = 0x05B8; 42379 t['qamats27'] = 0x05B8; 42380 t['qamats29'] = 0x05B8; 42381 t['qamats33'] = 0x05B8; 42382 t['qamatsde'] = 0x05B8; 42383 t['qamatshebrew'] = 0x05B8; 42384 t['qamatsnarrowhebrew'] = 0x05B8; 42385 t['qamatsqatanhebrew'] = 0x05B8; 42386 t['qamatsqatannarrowhebrew'] = 0x05B8; 42387 t['qamatsqatanquarterhebrew'] = 0x05B8; 42388 t['qamatsqatanwidehebrew'] = 0x05B8; 42389 t['qamatsquarterhebrew'] = 0x05B8; 42390 t['qamatswidehebrew'] = 0x05B8; 42391 t['qarneyparahebrew'] = 0x059F; 42392 t['qbopomofo'] = 0x3111; 42393 t['qcircle'] = 0x24E0; 42394 t['qhook'] = 0x02A0; 42395 t['qmonospace'] = 0xFF51; 42396 t['qof'] = 0x05E7; 42397 t['qofdagesh'] = 0xFB47; 42398 t['qofdageshhebrew'] = 0xFB47; 42399 t['qofhebrew'] = 0x05E7; 42400 t['qparen'] = 0x24AC; 42401 t['quarternote'] = 0x2669; 42402 t['qubuts'] = 0x05BB; 42403 t['qubuts18'] = 0x05BB; 42404 t['qubuts25'] = 0x05BB; 42405 t['qubuts31'] = 0x05BB; 42406 t['qubutshebrew'] = 0x05BB; 42407 t['qubutsnarrowhebrew'] = 0x05BB; 42408 t['qubutsquarterhebrew'] = 0x05BB; 42409 t['qubutswidehebrew'] = 0x05BB; 42410 t['question'] = 0x003F; 42411 t['questionarabic'] = 0x061F; 42412 t['questionarmenian'] = 0x055E; 42413 t['questiondown'] = 0x00BF; 42414 t['questiondownsmall'] = 0xF7BF; 42415 t['questiongreek'] = 0x037E; 42416 t['questionmonospace'] = 0xFF1F; 42417 t['questionsmall'] = 0xF73F; 42418 t['quotedbl'] = 0x0022; 42419 t['quotedblbase'] = 0x201E; 42420 t['quotedblleft'] = 0x201C; 42421 t['quotedblmonospace'] = 0xFF02; 42422 t['quotedblprime'] = 0x301E; 42423 t['quotedblprimereversed'] = 0x301D; 42424 t['quotedblright'] = 0x201D; 42425 t['quoteleft'] = 0x2018; 42426 t['quoteleftreversed'] = 0x201B; 42427 t['quotereversed'] = 0x201B; 42428 t['quoteright'] = 0x2019; 42429 t['quoterightn'] = 0x0149; 42430 t['quotesinglbase'] = 0x201A; 42431 t['quotesingle'] = 0x0027; 42432 t['quotesinglemonospace'] = 0xFF07; 42433 t['r'] = 0x0072; 42434 t['raarmenian'] = 0x057C; 42435 t['rabengali'] = 0x09B0; 42436 t['racute'] = 0x0155; 42437 t['radeva'] = 0x0930; 42438 t['radical'] = 0x221A; 42439 t['radicalex'] = 0xF8E5; 42440 t['radoverssquare'] = 0x33AE; 42441 t['radoverssquaredsquare'] = 0x33AF; 42442 t['radsquare'] = 0x33AD; 42443 t['rafe'] = 0x05BF; 42444 t['rafehebrew'] = 0x05BF; 42445 t['ragujarati'] = 0x0AB0; 42446 t['ragurmukhi'] = 0x0A30; 42447 t['rahiragana'] = 0x3089; 42448 t['rakatakana'] = 0x30E9; 42449 t['rakatakanahalfwidth'] = 0xFF97; 42450 t['ralowerdiagonalbengali'] = 0x09F1; 42451 t['ramiddlediagonalbengali'] = 0x09F0; 42452 t['ramshorn'] = 0x0264; 42453 t['ratio'] = 0x2236; 42454 t['rbopomofo'] = 0x3116; 42455 t['rcaron'] = 0x0159; 42456 t['rcedilla'] = 0x0157; 42457 t['rcircle'] = 0x24E1; 42458 t['rcommaaccent'] = 0x0157; 42459 t['rdblgrave'] = 0x0211; 42460 t['rdotaccent'] = 0x1E59; 42461 t['rdotbelow'] = 0x1E5B; 42462 t['rdotbelowmacron'] = 0x1E5D; 42463 t['referencemark'] = 0x203B; 42464 t['reflexsubset'] = 0x2286; 42465 t['reflexsuperset'] = 0x2287; 42466 t['registered'] = 0x00AE; 42467 t['registersans'] = 0xF8E8; 42468 t['registerserif'] = 0xF6DA; 42469 t['reharabic'] = 0x0631; 42470 t['reharmenian'] = 0x0580; 42471 t['rehfinalarabic'] = 0xFEAE; 42472 t['rehiragana'] = 0x308C; 42473 t['rekatakana'] = 0x30EC; 42474 t['rekatakanahalfwidth'] = 0xFF9A; 42475 t['resh'] = 0x05E8; 42476 t['reshdageshhebrew'] = 0xFB48; 42477 t['reshhebrew'] = 0x05E8; 42478 t['reversedtilde'] = 0x223D; 42479 t['reviahebrew'] = 0x0597; 42480 t['reviamugrashhebrew'] = 0x0597; 42481 t['revlogicalnot'] = 0x2310; 42482 t['rfishhook'] = 0x027E; 42483 t['rfishhookreversed'] = 0x027F; 42484 t['rhabengali'] = 0x09DD; 42485 t['rhadeva'] = 0x095D; 42486 t['rho'] = 0x03C1; 42487 t['rhook'] = 0x027D; 42488 t['rhookturned'] = 0x027B; 42489 t['rhookturnedsuperior'] = 0x02B5; 42490 t['rhosymbolgreek'] = 0x03F1; 42491 t['rhotichookmod'] = 0x02DE; 42492 t['rieulacirclekorean'] = 0x3271; 42493 t['rieulaparenkorean'] = 0x3211; 42494 t['rieulcirclekorean'] = 0x3263; 42495 t['rieulhieuhkorean'] = 0x3140; 42496 t['rieulkiyeokkorean'] = 0x313A; 42497 t['rieulkiyeoksioskorean'] = 0x3169; 42498 t['rieulkorean'] = 0x3139; 42499 t['rieulmieumkorean'] = 0x313B; 42500 t['rieulpansioskorean'] = 0x316C; 42501 t['rieulparenkorean'] = 0x3203; 42502 t['rieulphieuphkorean'] = 0x313F; 42503 t['rieulpieupkorean'] = 0x313C; 42504 t['rieulpieupsioskorean'] = 0x316B; 42505 t['rieulsioskorean'] = 0x313D; 42506 t['rieulthieuthkorean'] = 0x313E; 42507 t['rieultikeutkorean'] = 0x316A; 42508 t['rieulyeorinhieuhkorean'] = 0x316D; 42509 t['rightangle'] = 0x221F; 42510 t['righttackbelowcmb'] = 0x0319; 42511 t['righttriangle'] = 0x22BF; 42512 t['rihiragana'] = 0x308A; 42513 t['rikatakana'] = 0x30EA; 42514 t['rikatakanahalfwidth'] = 0xFF98; 42515 t['ring'] = 0x02DA; 42516 t['ringbelowcmb'] = 0x0325; 42517 t['ringcmb'] = 0x030A; 42518 t['ringhalfleft'] = 0x02BF; 42519 t['ringhalfleftarmenian'] = 0x0559; 42520 t['ringhalfleftbelowcmb'] = 0x031C; 42521 t['ringhalfleftcentered'] = 0x02D3; 42522 t['ringhalfright'] = 0x02BE; 42523 t['ringhalfrightbelowcmb'] = 0x0339; 42524 t['ringhalfrightcentered'] = 0x02D2; 42525 t['rinvertedbreve'] = 0x0213; 42526 t['rittorusquare'] = 0x3351; 42527 t['rlinebelow'] = 0x1E5F; 42528 t['rlongleg'] = 0x027C; 42529 t['rlonglegturned'] = 0x027A; 42530 t['rmonospace'] = 0xFF52; 42531 t['rohiragana'] = 0x308D; 42532 t['rokatakana'] = 0x30ED; 42533 t['rokatakanahalfwidth'] = 0xFF9B; 42534 t['roruathai'] = 0x0E23; 42535 t['rparen'] = 0x24AD; 42536 t['rrabengali'] = 0x09DC; 42537 t['rradeva'] = 0x0931; 42538 t['rragurmukhi'] = 0x0A5C; 42539 t['rreharabic'] = 0x0691; 42540 t['rrehfinalarabic'] = 0xFB8D; 42541 t['rrvocalicbengali'] = 0x09E0; 42542 t['rrvocalicdeva'] = 0x0960;
42543 t['rrvocalicgujarati'] = 0x0AE0; 42544 t['rrvocalicvowelsignbengali'] = 0x09C4; 42545 t['rrvocalicvowelsigndeva'] = 0x0944; 42546 t['rrvocalicvowelsigngujarati'] = 0x0AC4; 42547 t['rsuperior'] = 0xF6F1; 42548 t['rtblock'] = 0x2590; 42549 t['rturned'] = 0x0279; 42550 t['rturnedsuperior'] = 0x02B4; 42551 t['ruhiragana'] = 0x308B; 42552 t['rukatakana'] = 0x30EB; 42553 t['rukatakanahalfwidth'] = 0xFF99; 42554 t['rupeemarkbengali'] = 0x09F2; 42555 t['rupeesignbengali'] = 0x09F3; 42556 t['rupiah'] = 0xF6DD; 42557 t['ruthai'] = 0x0E24; 42558 t['rvocalicbengali'] = 0x098B; 42559 t['rvocalicdeva'] = 0x090B; 42560 t['rvocalicgujarati'] = 0x0A8B; 42561 t['rvocalicvowelsignbengali'] = 0x09C3; 42562 t['rvocalicvowelsigndeva'] = 0x0943; 42563 t['rvocalicvowelsigngujarati'] = 0x0AC3; 42564 t['s'] = 0x0073; 42565 t['sabengali'] = 0x09B8; 42566 t['sacute'] = 0x015B; 42567 t['sacutedotaccent'] = 0x1E65; 42568 t['sadarabic'] = 0x0635; 42569 t['sadeva'] = 0x0938; 42570 t['sadfinalarabic'] = 0xFEBA; 42571 t['sadinitialarabic'] = 0xFEBB; 42572 t['sadmedialarabic'] = 0xFEBC; 42573 t['sagujarati'] = 0x0AB8; 42574 t['sagurmukhi'] = 0x0A38; 42575 t['sahiragana'] = 0x3055; 42576 t['sakatakana'] = 0x30B5; 42577 t['sakatakanahalfwidth'] = 0xFF7B; 42578 t['sallallahoualayhewasallamarabic'] = 0xFDFA; 42579 t['samekh'] = 0x05E1; 42580 t['samekhdagesh'] = 0xFB41; 42581 t['samekhdageshhebrew'] = 0xFB41; 42582 t['samekhhebrew'] = 0x05E1; 42583 t['saraaathai'] = 0x0E32; 42584 t['saraaethai'] = 0x0E41; 42585 t['saraaimaimalaithai'] = 0x0E44; 42586 t['saraaimaimuanthai'] = 0x0E43; 42587 t['saraamthai'] = 0x0E33; 42588 t['saraathai'] = 0x0E30; 42589 t['saraethai'] = 0x0E40; 42590 t['saraiileftthai'] = 0xF886; 42591 t['saraiithai'] = 0x0E35; 42592 t['saraileftthai'] = 0xF885; 42593 t['saraithai'] = 0x0E34; 42594 t['saraothai'] = 0x0E42; 42595 t['saraueeleftthai'] = 0xF888; 42596 t['saraueethai'] = 0x0E37; 42597 t['saraueleftthai'] = 0xF887; 42598 t['sarauethai'] = 0x0E36; 42599 t['sarauthai'] = 0x0E38; 42600 t['sarauuthai'] = 0x0E39; 42601 t['sbopomofo'] = 0x3119; 42602 t['scaron'] = 0x0161; 42603 t['scarondotaccent'] = 0x1E67; 42604 t['scedilla'] = 0x015F; 42605 t['schwa'] = 0x0259; 42606 t['schwacyrillic'] = 0x04D9; 42607 t['schwadieresiscyrillic'] = 0x04DB; 42608 t['schwahook'] = 0x025A; 42609 t['scircle'] = 0x24E2; 42610 t['scircumflex'] = 0x015D; 42611 t['scommaaccent'] = 0x0219; 42612 t['sdotaccent'] = 0x1E61; 42613 t['sdotbelow'] = 0x1E63; 42614 t['sdotbelowdotaccent'] = 0x1E69; 42615 t['seagullbelowcmb'] = 0x033C; 42616 t['second'] = 0x2033; 42617 t['secondtonechinese'] = 0x02CA; 42618 t['section'] = 0x00A7; 42619 t['seenarabic'] = 0x0633; 42620 t['seenfinalarabic'] = 0xFEB2; 42621 t['seeninitialarabic'] = 0xFEB3; 42622 t['seenmedialarabic'] = 0xFEB4; 42623 t['segol'] = 0x05B6; 42624 t['segol13'] = 0x05B6; 42625 t['segol1f'] = 0x05B6; 42626 t['segol2c'] = 0x05B6; 42627 t['segolhebrew'] = 0x05B6; 42628 t['segolnarrowhebrew'] = 0x05B6; 42629 t['segolquarterhebrew'] = 0x05B6; 42630 t['segoltahebrew'] = 0x0592; 42631 t['segolwidehebrew'] = 0x05B6; 42632 t['seharmenian'] = 0x057D; 42633 t['sehiragana'] = 0x305B; 42634 t['sekatakana'] = 0x30BB; 42635 t['sekatakanahalfwidth'] = 0xFF7E; 42636 t['semicolon'] = 0x003B; 42637 t['semicolonarabic'] = 0x061B; 42638 t['semicolonmonospace'] = 0xFF1B; 42639 t['semicolonsmall'] = 0xFE54; 42640 t['semivoicedmarkkana'] = 0x309C; 42641 t['semivoicedmarkkanahalfwidth'] = 0xFF9F; 42642 t['sentisquare'] = 0x3322; 42643 t['sentosquare'] = 0x3323; 42644 t['seven'] = 0x0037; 42645 t['sevenarabic'] = 0x0667; 42646 t['sevenbengali'] = 0x09ED; 42647 t['sevencircle'] = 0x2466; 42648 t['sevencircleinversesansserif'] = 0x2790; 42649 t['sevendeva'] = 0x096D; 42650 t['seveneighths'] = 0x215E; 42651 t['sevengujarati'] = 0x0AED; 42652 t['sevengurmukhi'] = 0x0A6D; 42653 t['sevenhackarabic'] = 0x0667; 42654 t['sevenhangzhou'] = 0x3027; 42655 t['sevenideographicparen'] = 0x3226; 42656 t['seveninferior'] = 0x2087; 42657 t['sevenmonospace'] = 0xFF17; 42658 t['sevenoldstyle'] = 0xF737; 42659 t['sevenparen'] = 0x247A; 42660 t['sevenperiod'] = 0x248E; 42661 t['sevenpersian'] = 0x06F7; 42662 t['sevenroman'] = 0x2176; 42663 t['sevensuperior'] = 0x2077; 42664 t['seventeencircle'] = 0x2470; 42665 t['seventeenparen'] = 0x2484; 42666 t['seventeenperiod'] = 0x2498; 42667 t['seventhai'] = 0x0E57; 42668 t['sfthyphen'] = 0x00AD; 42669 t['shaarmenian'] = 0x0577; 42670 t['shabengali'] = 0x09B6; 42671 t['shacyrillic'] = 0x0448; 42672 t['shaddaarabic'] = 0x0651; 42673 t['shaddadammaarabic'] = 0xFC61; 42674 t['shaddadammatanarabic'] = 0xFC5E; 42675 t['shaddafathaarabic'] = 0xFC60; 42676 t['shaddakasraarabic'] = 0xFC62; 42677 t['shaddakasratanarabic'] = 0xFC5F; 42678 t['shade'] = 0x2592; 42679 t['shadedark'] = 0x2593; 42680 t['shadelight'] = 0x2591; 42681 t['shademedium'] = 0x2592; 42682 t['shadeva'] = 0x0936; 42683 t['shagujarati'] = 0x0AB6; 42684 t['shagurmukhi'] = 0x0A36; 42685 t['shalshelethebrew'] = 0x0593; 42686 t['shbopomofo'] = 0x3115; 42687 t['shchacyrillic'] = 0x0449; 42688 t['sheenarabic'] = 0x0634; 42689 t['sheenfinalarabic'] = 0xFEB6; 42690 t['sheeninitialarabic'] = 0xFEB7; 42691 t['sheenmedialarabic'] = 0xFEB8; 42692 t['sheicoptic'] = 0x03E3; 42693 t['sheqel'] = 0x20AA; 42694 t['sheqelhebrew'] = 0x20AA; 42695 t['sheva'] = 0x05B0; 42696 t['sheva115'] = 0x05B0; 42697 t['sheva15'] = 0x05B0; 42698 t['sheva22'] = 0x05B0; 42699 t['sheva2e'] = 0x05B0; 42700 t['shevahebrew'] = 0x05B0; 42701 t['shevanarrowhebrew'] = 0x05B0; 42702 t['shevaquarterhebrew'] = 0x05B0; 42703 t['shevawidehebrew'] = 0x05B0; 42704 t['shhacyrillic'] = 0x04BB; 42705 t['shimacoptic'] = 0x03ED; 42706 t['shin'] = 0x05E9; 42707 t['shindagesh'] = 0xFB49; 42708 t['shindageshhebrew'] = 0xFB49; 42709 t['shindageshshindot'] = 0xFB2C; 42710 t['shindageshshindothebrew'] = 0xFB2C; 42711 t['shindageshsindot'] = 0xFB2D; 42712 t['shindageshsindothebrew'] = 0xFB2D; 42713 t['shindothebrew'] = 0x05C1; 42714 t['shinhebrew'] = 0x05E9; 42715 t['shinshindot'] = 0xFB2A; 42716 t['shinshindothebrew'] = 0xFB2A; 42717 t['shinsindot'] = 0xFB2B; 42718 t['shinsindothebrew'] = 0xFB2B; 42719 t['shook'] = 0x0282;
42720 t['sigma'] = 0x03C3; 42721 t['sigma1'] = 0x03C2; 42722 t['sigmafinal'] = 0x03C2; 42723 t['sigmalunatesymbolgreek'] = 0x03F2; 42724 t['sihiragana'] = 0x3057; 42725 t['sikatakana'] = 0x30B7; 42726 t['sikatakanahalfwidth'] = 0xFF7C; 42727 t['siluqhebrew'] = 0x05BD; 42728 t['siluqlefthebrew'] = 0x05BD; 42729 t['similar'] = 0x223C; 42730 t['sindothebrew'] = 0x05C2; 42731 t['siosacirclekorean'] = 0x3274; 42732 t['siosaparenkorean'] = 0x3214; 42733 t['sioscieuckorean'] = 0x317E; 42734 t['sioscirclekorean'] = 0x3266; 42735 t['sioskiyeokkorean'] = 0x317A; 42736 t['sioskorean'] = 0x3145; 42737 t['siosnieunkorean'] = 0x317B; 42738 t['siosparenkorean'] = 0x3206; 42739 t['siospieupkorean'] = 0x317D; 42740 t['siostikeutkorean'] = 0x317C; 42741 t['six'] = 0x0036; 42742 t['sixarabic'] = 0x0666; 42743 t['sixbengali'] = 0x09EC; 42744 t['sixcircle'] = 0x2465; 42745 t['sixcircleinversesansserif'] = 0x278F; 42746 t['sixdeva'] = 0x096C; 42747 t['sixgujarati'] = 0x0AEC; 42748 t['sixgurmukhi'] = 0x0A6C; 42749 t['sixhackarabic'] = 0x0666; 42750 t['sixhangzhou'] = 0x3026; 42751 t['sixideographicparen'] = 0x3225; 42752 t['sixinferior'] = 0x2086; 42753 t['sixmonospace'] = 0xFF16; 42754 t['sixoldstyle'] = 0xF736; 42755 t['sixparen'] = 0x2479; 42756 t['sixperiod'] = 0x248D; 42757 t['sixpersian'] = 0x06F6; 42758 t['sixroman'] = 0x2175; 42759 t['sixsuperior'] = 0x2076; 42760 t['sixteencircle'] = 0x246F; 42761 t['sixteencurrencydenominatorbengali'] = 0x09F9; 42762 t['sixteenparen'] = 0x2483; 42763 t['sixteenperiod'] = 0x2497; 42764 t['sixthai'] = 0x0E56; 42765 t['slash'] = 0x002F; 42766 t['slashmonospace'] = 0xFF0F; 42767 t['slong'] = 0x017F; 42768 t['slongdotaccent'] = 0x1E9B; 42769 t['smileface'] = 0x263A; 42770 t['smonospace'] = 0xFF53; 42771 t['sofpasuqhebrew'] = 0x05C3; 42772 t['softhyphen'] = 0x00AD; 42773 t['softsigncyrillic'] = 0x044C; 42774 t['sohiragana'] = 0x305D; 42775 t['sokatakana'] = 0x30BD; 42776 t['sokatakanahalfwidth'] = 0xFF7F; 42777 t['soliduslongoverlaycmb'] = 0x0338; 42778 t['solidusshortoverlaycmb'] = 0x0337; 42779 t['sorusithai'] = 0x0E29; 42780 t['sosalathai'] = 0x0E28; 42781 t['sosothai'] = 0x0E0B; 42782 t['sosuathai'] = 0x0E2A; 42783 t['space'] = 0x0020; 42784 t['spacehackarabic'] = 0x0020; 42785 t['spade'] = 0x2660; 42786 t['spadesuitblack'] = 0x2660; 42787 t['spadesuitwhite'] = 0x2664; 42788 t['sparen'] = 0x24AE; 42789 t['squarebelowcmb'] = 0x033B; 42790 t['squarecc'] = 0x33C4; 42791 t['squarecm'] = 0x339D; 42792 t['squarediagonalcrosshatchfill'] = 0x25A9; 42793 t['squarehorizontalfill'] = 0x25A4; 42794 t['squarekg'] = 0x338F; 42795 t['squarekm'] = 0x339E; 42796 t['squarekmcapital'] = 0x33CE; 42797 t['squareln'] = 0x33D1; 42798 t['squarelog'] = 0x33D2; 42799 t['squaremg'] = 0x338E; 42800 t['squaremil'] = 0x33D5; 42801 t['squaremm'] = 0x339C; 42802 t['squaremsquared'] = 0x33A1; 42803 t['squareorthogonalcrosshatchfill'] = 0x25A6; 42804 t['squareupperlefttolowerrightfill'] = 0x25A7; 42805 t['squareupperrighttolowerleftfill'] = 0x25A8; 42806 t['squareverticalfill'] = 0x25A5; 42807 t['squarewhitewithsmallblack'] = 0x25A3; 42808 t['srsquare'] = 0x33DB; 42809 t['ssabengali'] = 0x09B7; 42810 t['ssadeva'] = 0x0937; 42811 t['ssagujarati'] = 0x0AB7; 42812 t['ssangcieuckorean'] = 0x3149; 42813 t['ssanghieuhkorean'] = 0x3185; 42814 t['ssangieungkorean'] = 0x3180; 42815 t['ssangkiyeokkorean'] = 0x3132; 42816 t['ssangnieunkorean'] = 0x3165; 42817 t['ssangpieupkorean'] = 0x3143; 42818 t['ssangsioskorean'] = 0x3146; 42819 t['ssangtikeutkorean'] = 0x3138; 42820 t['ssuperior'] = 0xF6F2; 42821 t['sterling'] = 0x00A3; 42822 t['sterlingmonospace'] = 0xFFE1; 42823 t['strokelongoverlaycmb'] = 0x0336; 42824 t['strokeshortoverlaycmb'] = 0x0335; 42825 t['subset'] = 0x2282; 42826 t['subsetnotequal'] = 0x228A; 42827 t['subsetorequal'] = 0x2286; 42828 t['succeeds'] = 0x227B; 42829 t['suchthat'] = 0x220B; 42830 t['suhiragana'] = 0x3059; 42831 t['sukatakana'] = 0x30B9; 42832 t['sukatakanahalfwidth'] = 0xFF7D; 42833 t['sukunarabic'] = 0x0652; 42834 t['summation'] = 0x2211; 42835 t['sun'] = 0x263C; 42836 t['superset'] = 0x2283; 42837 t['supersetnotequal'] = 0x228B; 42838 t['supersetorequal'] = 0x2287; 42839 t['svsquare'] = 0x33DC; 42840 t['syouwaerasquare'] = 0x337C; 42841 t['t'] = 0x0074; 42842 t['tabengali'] = 0x09A4; 42843 t['tackdown'] = 0x22A4; 42844 t['tackleft'] = 0x22A3; 42845 t['tadeva'] = 0x0924; 42846 t['tagujarati'] = 0x0AA4; 42847 t['tagurmukhi'] = 0x0A24; 42848 t['taharabic'] = 0x0637; 42849 t['tahfinalarabic'] = 0xFEC2; 42850 t['tahinitialarabic'] = 0xFEC3; 42851 t['tahiragana'] = 0x305F; 42852 t['tahmedialarabic'] = 0xFEC4; 42853 t['taisyouerasquare'] = 0x337D; 42854 t['takatakana'] = 0x30BF;
42855 t['takatakanahalfwidth'] = 0xFF80; 42856 t['tatweelarabic'] = 0x0640; 42857 t['tau'] = 0x03C4; 42858 t['tav'] = 0x05EA; 42859 t['tavdages'] = 0xFB4A; 42860 t['tavdagesh'] = 0xFB4A; 42861 t['tavdageshhebrew'] = 0xFB4A; 42862 t['tavhebrew'] = 0x05EA; 42863 t['tbar'] = 0x0167; 42864 t['tbopomofo'] = 0x310A; 42865 t['tcaron'] = 0x0165; 42866 t['tccurl'] = 0x02A8; 42867 t['tcedilla'] = 0x0163; 42868 t['tcheharabic'] = 0x0686; 42869 t['tchehfinalarabic'] = 0xFB7B; 42870 t['tchehinitialarabic'] = 0xFB7C; 42871 t['tchehmedialarabic'] = 0xFB7D; 42872 t['tcircle'] = 0x24E3; 42873 t['tcircumflexbelow'] = 0x1E71; 42874 t['tcommaaccent'] = 0x0163; 42875 t['tdieresis'] = 0x1E97; 42876 t['tdotaccent'] = 0x1E6B; 42877 t['tdotbelow'] = 0x1E6D; 42878 t['tecyrillic'] = 0x0442; 42879 t['tedescendercyrillic'] = 0x04AD; 42880 t['teharabic'] = 0x062A; 42881 t['tehfinalarabic'] = 0xFE96; 42882 t['tehhahinitialarabic'] = 0xFCA2; 42883 t['tehhahisolatedarabic'] = 0xFC0C; 42884 t['tehinitialarabic'] = 0xFE97; 42885 t['tehiragana'] = 0x3066; 42886 t['tehjeeminitialarabic'] = 0xFCA1; 42887 t['tehjeemisolatedarabic'] = 0xFC0B; 42888 t['tehmarbutaarabic'] = 0x0629; 42889 t['tehmarbutafinalarabic'] = 0xFE94; 42890 t['tehmedialarabic'] = 0xFE98; 42891 t['tehmeeminitialarabic'] = 0xFCA4; 42892 t['tehmeemisolatedarabic'] = 0xFC0E; 42893 t['tehnoonfinalarabic'] = 0xFC73; 42894 t['tekatakana'] = 0x30C6; 42895 t['tekatakanahalfwidth'] = 0xFF83; 42896 t['telephone'] = 0x2121; 42897 t['telephoneblack'] = 0x260E; 42898 t['telishagedolahebrew'] = 0x05A0; 42899 t['telishaqetanahebrew'] = 0x05A9; 42900 t['tencircle'] = 0x2469; 42901 t['tenideographicparen'] = 0x3229; 42902 t['tenparen'] = 0x247D; 42903 t['tenperiod'] = 0x2491; 42904 t['tenroman'] = 0x2179; 42905 t['tesh'] = 0x02A7; 42906 t['tet'] = 0x05D8; 42907 t['tetdagesh'] = 0xFB38; 42908 t['tetdageshhebrew'] = 0xFB38; 42909 t['tethebrew'] = 0x05D8; 42910 t['tetsecyrillic'] = 0x04B5; 42911 t['tevirhebrew'] = 0x059B; 42912 t['tevirlefthebrew'] = 0x059B; 42913 t['thabengali'] = 0x09A5; 42914 t['thadeva'] = 0x0925; 42915 t['thagujarati'] = 0x0AA5; 42916 t['thagurmukhi'] = 0x0A25; 42917 t['thalarabic'] = 0x0630; 42918 t['thalfinalarabic'] = 0xFEAC; 42919 t['thanthakhatlowleftthai'] = 0xF898; 42920 t['thanthakhatlowrightthai'] = 0xF897; 42921 t['thanthakhatthai'] = 0x0E4C; 42922 t['thanthakhatupperleftthai'] = 0xF896; 42923 t['theharabic'] = 0x062B; 42924 t['thehfinalarabic'] = 0xFE9A; 42925 t['thehinitialarabic'] = 0xFE9B; 42926 t['thehmedialarabic'] = 0xFE9C; 42927 t['thereexists'] = 0x2203; 42928 t['therefore'] = 0x2234; 42929 t['theta'] = 0x03B8; 42930 t['theta1'] = 0x03D1; 42931 t['thetasymbolgreek'] = 0x03D1; 42932 t['thieuthacirclekorean'] = 0x3279; 42933 t['thieuthaparenkorean'] = 0x3219; 42934 t['thieuthcirclekorean'] = 0x326B; 42935 t['thieuthkorean'] = 0x314C; 42936 t['thieuthparenkorean'] = 0x320B; 42937 t['thirteencircle'] = 0x246C; 42938 t['thirteenparen'] = 0x2480; 42939 t['thirteenperiod'] = 0x2494; 42940 t['thonangmonthothai'] = 0x0E11; 42941 t['thook'] = 0x01AD; 42942 t['thophuthaothai'] = 0x0E12; 42943 t['thorn'] = 0x00FE; 42944 t['thothahanthai'] = 0x0E17; 42945 t['thothanthai'] = 0x0E10; 42946 t['thothongthai'] = 0x0E18; 42947 t['thothungthai'] = 0x0E16; 42948 t['thousandcyrillic'] = 0x0482; 42949 t['thousandsseparatorarabic'] = 0x066C; 42950 t['thousandsseparatorpersian'] = 0x066C; 42951 t['three'] = 0x0033; 42952 t['threearabic'] = 0x0663; 42953 t['threebengali'] = 0x09E9; 42954 t['threecircle'] = 0x2462; 42955 t['threecircleinversesansserif'] = 0x278C; 42956 t['threedeva'] = 0x0969; 42957 t['threeeighths'] = 0x215C; 42958 t['threegujarati'] = 0x0AE9; 42959 t['threegurmukhi'] = 0x0A69; 42960 t['threehackarabic'] = 0x0663; 42961 t['threehangzhou'] = 0x3023; 42962 t['threeideographicparen'] = 0x3222; 42963 t['threeinferior'] = 0x2083; 42964 t['threemonospace'] = 0xFF13; 42965 t['threenumeratorbengali'] = 0x09F6; 42966 t['threeoldstyle'] = 0xF733; 42967 t['threeparen'] = 0x2476; 42968 t['threeperiod'] = 0x248A; 42969 t['threepersian'] = 0x06F3; 42970 t['threequarters'] = 0x00BE; 42971 t['threequartersemdash'] = 0xF6DE; 42972 t['threeroman'] = 0x2172; 42973 t['threesuperior'] = 0x00B3; 42974 t['threethai'] = 0x0E53; 42975 t['thzsquare'] = 0x3394; 42976 t['tihiragana'] = 0x3061; 42977 t['tikatakana'] = 0x30C1; 42978 t['tikatakanahalfwidth'] = 0xFF81; 42979 t['tikeutacirclekorean'] = 0x3270; 42980 t['tikeutaparenkorean'] = 0x3210; 42981 t['tikeutcirclekorean'] = 0x3262; 42982 t['tikeutkorean'] = 0x3137; 42983 t['tikeutparenkorean'] = 0x3202; 42984 t['tilde'] = 0x02DC; 42985 t['tildebelowcmb'] = 0x0330; 42986 t['tildecmb'] = 0x0303; 42987 t['tildecomb'] = 0x0303; 42988 t['tildedoublecmb'] = 0x0360; 42989 t['tildeoperator'] = 0x223C; 42990 t['tildeoverlaycmb'] = 0x0334; 42991 t['tildeverticalcmb'] = 0x033E; 42992 t['timescircle'] = 0x2297; 42993 t['tipehahebrew'] = 0x0596; 42994 t['tipehalefthebrew'] = 0x0596; 42995 t['tippigurmukhi'] = 0x0A70; 42996 t['titlocyrilliccmb'] = 0x0483; 42997 t['tiwnarmenian'] = 0x057F; 42998 t['tlinebelow'] = 0x1E6F; 42999 t['tmonospace'] = 0xFF54; 43000 t['toarmenian'] = 0x0569; 43001 t['tohiragana'] = 0x3068; 43002 t['tokatakana'] = 0x30C8; 43003 t['tokatakanahalfwidth'] = 0xFF84; 43004 t['tonebarextrahighmod'] = 0x02E5; 43005 t['tonebarextralowmod'] = 0x02E9; 43006 t['tonebarhighmod'] = 0x02E6; 43007 t['tonebarlowmod'] = 0x02E8; 43008 t['tonebarmidmod'] = 0x02E7; 43009 t['tonefive'] = 0x01BD; 43010 t['tonesix'] = 0x0185; 43011 t['tonetwo'] = 0x01A8; 43012 t['tonos'] = 0x0384; 43013 t['tonsquare'] = 0x3327; 43014 t['topatakthai'] = 0x0E0F; 43015 t['tortoiseshellbracketleft'] = 0x3014; 43016 t['tortoiseshellbracketleftsmall'] = 0xFE5D; 43017 t['tortoiseshellbracketleftvertical'] = 0xFE39; 43018 t['tortoiseshellbracketright'] = 0x3015; 43019 t['tortoiseshellbracketrightsmall'] = 0xFE5E; 43020 t['tortoiseshellbracketrightvertical'] = 0xFE3A; 43021 t['totaothai'] = 0x0E15; 43022 t['tpalatalhook'] = 0x01AB; 43023 t['tparen'] = 0x24AF; 43024 t['trademark'] = 0x2122; 43025 t['trademarksans'] = 0xF8EA; 43026 t['trademarkserif'] = 0xF6DB; 43027 t['tretroflexhook'] = 0x0288; 43028 t['triagdn'] = 0x25BC; 43029 t['triaglf'] = 0x25C4; 43030 t['triagrt'] = 0x25BA; 43031 t['triagup'] = 0x25B2; 43032 t['ts'] = 0x02A6; 43033 t['tsadi'] = 0x05E6; 43034 t['tsadidagesh'] = 0xFB46; 43035 t['tsadidageshhebrew'] = 0xFB46; 43036 t['tsadihebrew'] = 0x05E6; 43037 t['tsecyrillic'] = 0x0446;
43038 t['tsere'] = 0x05B5; 43039 t['tsere12'] = 0x05B5; 43040 t['tsere1e'] = 0x05B5; 43041 t['tsere2b'] = 0x05B5; 43042 t['tserehebrew'] = 0x05B5; 43043 t['tserenarrowhebrew'] = 0x05B5; 43044 t['tserequarterhebrew'] = 0x05B5; 43045 t['tserewidehebrew'] = 0x05B5; 43046 t['tshecyrillic'] = 0x045B; 43047 t['tsuperior'] = 0xF6F3; 43048 t['ttabengali'] = 0x099F; 43049 t['ttadeva'] = 0x091F; 43050 t['ttagujarati'] = 0x0A9F; 43051 t['ttagurmukhi'] = 0x0A1F; 43052 t['tteharabic'] = 0x0679; 43053 t['ttehfinalarabic'] = 0xFB67; 43054 t['ttehinitialarabic'] = 0xFB68; 43055 t['ttehmedialarabic'] = 0xFB69; 43056 t['tthabengali'] = 0x09A0; 43057 t['tthadeva'] = 0x0920; 43058 t['tthagujarati'] = 0x0AA0; 43059 t['tthagurmukhi'] = 0x0A20; 43060 t['tturned'] = 0x0287; 43061 t['tuhiragana'] = 0x3064; 43062 t['tukatakana'] = 0x30C4; 43063 t['tukatakanahalfwidth'] = 0xFF82; 43064 t['tusmallhiragana'] = 0x3063; 43065 t['tusmallkatakana'] = 0x30C3; 43066 t['tusmallkatakanahalfwidth'] = 0xFF6F; 43067 t['twelvecircle'] = 0x246B; 43068 t['twelveparen'] = 0x247F; 43069 t['twelveperiod'] = 0x2493; 43070 t['twelveroman'] = 0x217B; 43071 t['twentycircle'] = 0x2473; 43072 t['twentyhangzhou'] = 0x5344; 43073 t['twentyparen'] = 0x2487; 43074 t['twentyperiod'] = 0x249B; 43075 t['two'] = 0x0032; 43076 t['twoarabic'] = 0x0662; 43077 t['twobengali'] = 0x09E8; 43078 t['twocircle'] = 0x2461; 43079 t['twocircleinversesansserif'] = 0x278B; 43080 t['twodeva'] = 0x0968; 43081 t['twodotenleader'] = 0x2025; 43082 t['twodotleader'] = 0x2025; 43083 t['twodotleadervertical'] = 0xFE30; 43084 t['twogujarati'] = 0x0AE8; 43085 t['twogurmukhi'] = 0x0A68; 43086 t['twohackarabic'] = 0x0662; 43087 t['twohangzhou'] = 0x3022; 43088 t['twoideographicparen'] = 0x3221; 43089 t['twoinferior'] = 0x2082; 43090 t['twomonospace'] = 0xFF12; 43091 t['twonumeratorbengali'] = 0x09F5; 43092 t['twooldstyle'] = 0xF732; 43093 t['twoparen'] = 0x2475; 43094 t['twoperiod'] = 0x2489; 43095 t['twopersian'] = 0x06F2; 43096 t['tworoman'] = 0x2171; 43097 t['twostroke'] = 0x01BB; 43098 t['twosuperior'] = 0x00B2; 43099 t['twothai'] = 0x0E52; 43100 t['twothirds'] = 0x2154; 43101 t['u'] = 0x0075; 43102 t['uacute'] = 0x00FA; 43103 t['ubar'] = 0x0289; 43104 t['ubengali'] = 0x0989; 43105 t['ubopomofo'] = 0x3128; 43106 t['ubreve'] = 0x016D; 43107 t['ucaron'] = 0x01D4; 43108 t['ucircle'] = 0x24E4; 43109 t['ucircumflex'] = 0x00FB; 43110 t['ucircumflexbelow'] = 0x1E77; 43111 t['ucyrillic'] = 0x0443; 43112 t['udattadeva'] = 0x0951; 43113 t['udblacute'] = 0x0171; 43114 t['udblgrave'] = 0x0215; 43115 t['udeva'] = 0x0909; 43116 t['udieresis'] = 0x00FC; 43117 t['udieresisacute'] = 0x01D8; 43118 t['udieresisbelow'] = 0x1E73; 43119 t['udieresiscaron'] = 0x01DA; 43120 t['udieresiscyrillic'] = 0x04F1; 43121 t['udieresisgrave'] = 0x01DC; 43122 t['udieresismacron'] = 0x01D6; 43123 t['udotbelow'] = 0x1EE5; 43124 t['ugrave'] = 0x00F9; 43125 t['ugujarati'] = 0x0A89; 43126 t['ugurmukhi'] = 0x0A09; 43127 t['uhiragana'] = 0x3046; 43128 t['uhookabove'] = 0x1EE7; 43129 t['uhorn'] = 0x01B0; 43130 t['uhornacute'] = 0x1EE9; 43131 t['uhorndotbelow'] = 0x1EF1; 43132 t['uhorngrave'] = 0x1EEB; 43133 t['uhornhookabove'] = 0x1EED; 43134 t['uhorntilde'] = 0x1EEF; 43135 t['uhungarumlaut'] = 0x0171; 43136 t['uhungarumlautcyrillic'] = 0x04F3; 43137 t['uinvertedbreve'] = 0x0217; 43138 t['ukatakana'] = 0x30A6; 43139 t['ukatakanahalfwidth'] = 0xFF73; 43140 t['ukcyrillic'] = 0x0479; 43141 t['ukorean'] = 0x315C; 43142 t['umacron'] = 0x016B; 43143 t['umacroncyrillic'] = 0x04EF; 43144 t['umacrondieresis'] = 0x1E7B; 43145 t['umatragurmukhi'] = 0x0A41; 43146 t['umonospace'] = 0xFF55; 43147 t['underscore'] = 0x005F; 43148 t['underscoredbl'] = 0x2017; 43149 t['underscoremonospace'] = 0xFF3F; 43150 t['underscorevertical'] = 0xFE33; 43151 t['underscorewavy'] = 0xFE4F; 43152 t['union'] = 0x222A; 43153 t['universal'] = 0x2200; 43154 t['uogonek'] = 0x0173; 43155 t['uparen'] = 0x24B0; 43156 t['upblock'] = 0x2580; 43157 t['upperdothebrew'] = 0x05C4; 43158 t['upsilon'] = 0x03C5; 43159 t['upsilondieresis'] = 0x03CB; 43160 t['upsilondieresistonos'] = 0x03B0; 43161 t['upsilonlatin'] = 0x028A; 43162 t['upsilontonos'] = 0x03CD; 43163 t['uptackbelowcmb'] = 0x031D; 43164 t['uptackmod'] = 0x02D4; 43165 t['uragurmukhi'] = 0x0A73; 43166 t['uring'] = 0x016F; 43167 t['ushortcyrillic'] = 0x045E; 43168 t['usmallhiragana'] = 0x3045; 43169 t['usmallkatakana'] = 0x30A5; 43170 t['usmallkatakanahalfwidth'] = 0xFF69; 43171 t['ustraightcyrillic'] = 0x04AF; 43172 t['ustraightstrokecyrillic'] = 0x04B1; 43173 t['utilde'] = 0x0169; 43174 t['utildeacute'] = 0x1E79; 43175 t['utildebelow'] = 0x1E75; 43176 t['uubengali'] = 0x098A; 43177 t['uudeva'] = 0x090A; 43178 t['uugujarati'] = 0x0A8A; 43179 t['uugurmukhi'] = 0x0A0A; 43180 t['uumatragurmukhi'] = 0x0A42; 43181 t['uuvowelsignbengali'] = 0x09C2; 43182 t['uuvowelsigndeva'] = 0x0942; 43183 t['uuvowelsigngujarati'] = 0x0AC2; 43184 t['uvowelsignbengali'] = 0x09C1; 43185 t['uvowelsigndeva'] = 0x0941; 43186 t['uvowelsigngujarati'] = 0x0AC1; 43187 t['v'] = 0x0076; 43188 t['vadeva'] = 0x0935; 43189 t['vagujarati'] = 0x0AB5; 43190 t['vagurmukhi'] = 0x0A35; 43191 t['vakatakana'] = 0x30F7; 43192 t['vav'] = 0x05D5;
43193 t['vavdagesh'] = 0xFB35; 43194 t['vavdagesh65'] = 0xFB35; 43195 t['vavdageshhebrew'] = 0xFB35; 43196 t['vavhebrew'] = 0x05D5; 43197 t['vavholam'] = 0xFB4B; 43198 t['vavholamhebrew'] = 0xFB4B; 43199 t['vavvavhebrew'] = 0x05F0; 43200 t['vavyodhebrew'] = 0x05F1; 43201 t['vcircle'] = 0x24E5; 43202 t['vdotbelow'] = 0x1E7F; 43203 t['vecyrillic'] = 0x0432; 43204 t['veharabic'] = 0x06A4; 43205 t['vehfinalarabic'] = 0xFB6B; 43206 t['vehinitialarabic'] = 0xFB6C; 43207 t['vehmedialarabic'] = 0xFB6D; 43208 t['vekatakana'] = 0x30F9; 43209 t['venus'] = 0x2640; 43210 t['verticalbar'] = 0x007C; 43211 t['verticallineabovecmb'] = 0x030D; 43212 t['verticallinebelowcmb'] = 0x0329; 43213 t['verticallinelowmod'] = 0x02CC; 43214 t['verticallinemod'] = 0x02C8; 43215 t['vewarmenian'] = 0x057E; 43216 t['vhook'] = 0x028B; 43217 t['vikatakana'] = 0x30F8; 43218 t['viramabengali'] = 0x09CD; 43219 t['viramadeva'] = 0x094D; 43220 t['viramagujarati'] = 0x0ACD; 43221 t['visargabengali'] = 0x0983; 43222 t['visargadeva'] = 0x0903; 43223 t['visargagujarati'] = 0x0A83; 43224 t['vmonospace'] = 0xFF56; 43225 t['voarmenian'] = 0x0578; 43226 t['voicediterationhiragana'] = 0x309E; 43227 t['voicediterationkatakana'] = 0x30FE; 43228 t['voicedmarkkana'] = 0x309B; 43229 t['voicedmarkkanahalfwidth'] = 0xFF9E; 43230 t['vokatakana'] = 0x30FA; 43231 t['vparen'] = 0x24B1; 43232 t['vtilde'] = 0x1E7D; 43233 t['vturned'] = 0x028C; 43234 t['vuhiragana'] = 0x3094; 43235 t['vukatakana'] = 0x30F4; 43236 t['w'] = 0x0077; 43237 t['wacute'] = 0x1E83; 43238 t['waekorean'] = 0x3159; 43239 t['wahiragana'] = 0x308F; 43240 t['wakatakana'] = 0x30EF; 43241 t['wakatakanahalfwidth'] = 0xFF9C; 43242 t['wakorean'] = 0x3158; 43243 t['wasmallhiragana'] = 0x308E; 43244 t['wasmallkatakana'] = 0x30EE; 43245 t['wattosquare'] = 0x3357; 43246 t['wavedash'] = 0x301C; 43247 t['wavyunderscorevertical'] = 0xFE34; 43248 t['wawarabic'] = 0x0648; 43249 t['wawfinalarabic'] = 0xFEEE; 43250 t['wawhamzaabovearabic'] = 0x0624; 43251 t['wawhamzaabovefinalarabic'] = 0xFE86; 43252 t['wbsquare'] = 0x33DD; 43253 t['wcircle'] = 0x24E6; 43254 t['wcircumflex'] = 0x0175; 43255 t['wdieresis'] = 0x1E85; 43256 t['wdotaccent'] = 0x1E87; 43257 t['wdotbelow'] = 0x1E89; 43258 t['wehiragana'] = 0x3091; 43259 t['weierstrass'] = 0x2118; 43260 t['wekatakana'] = 0x30F1; 43261 t['wekorean'] = 0x315E; 43262 t['weokorean'] = 0x315D; 43263 t['wgrave'] = 0x1E81; 43264 t['whitebullet'] = 0x25E6; 43265 t['whitecircle'] = 0x25CB; 43266 t['whitecircleinverse'] = 0x25D9; 43267 t['whitecornerbracketleft'] = 0x300E; 43268 t['whitecornerbracketleftvertical'] = 0xFE43; 43269 t['whitecornerbracketright'] = 0x300F; 43270 t['whitecornerbracketrightvertical'] = 0xFE44; 43271 t['whitediamond'] = 0x25C7; 43272 t['whitediamondcontainingblacksmalldiamond'] = 0x25C8; 43273 t['whitedownpointingsmalltriangle'] = 0x25BF; 43274 t['whitedownpointingtriangle'] = 0x25BD; 43275 t['whiteleftpointingsmalltriangle'] = 0x25C3; 43276 t['whiteleftpointingtriangle'] = 0x25C1; 43277 t['whitelenticularbracketleft'] = 0x3016; 43278 t['whitelenticularbracketright'] = 0x3017; 43279 t['whiterightpointingsmalltriangle'] = 0x25B9; 43280 t['whiterightpointingtriangle'] = 0x25B7; 43281 t['whitesmallsquare'] = 0x25AB; 43282 t['whitesmilingface'] = 0x263A; 43283 t['whitesquare'] = 0x25A1; 43284 t['whitestar'] = 0x2606; 43285 t['whitetelephone'] = 0x260F; 43286 t['whitetortoiseshellbracketleft'] = 0x3018; 43287 t['whitetortoiseshellbracketright'] = 0x3019; 43288 t['whiteuppointingsmalltriangle'] = 0x25B5; 43289 t['whiteuppointingtriangle'] = 0x25B3; 43290 t['wihiragana'] = 0x3090; 43291 t['wikatakana'] = 0x30F0; 43292 t['wikorean'] = 0x315F; 43293 t['wmonospace'] = 0xFF57; 43294 t['wohiragana'] = 0x3092; 43295 t['wokatakana'] = 0x30F2; 43296 t['wokatakanahalfwidth'] = 0xFF66; 43297 t['won'] = 0x20A9; 43298 t['wonmonospace'] = 0xFFE6; 43299 t['wowaenthai'] = 0x0E27; 43300 t['wparen'] = 0x24B2; 43301 t['wring'] = 0x1E98; 43302 t['wsuperior'] = 0x02B7; 43303 t['wturned'] = 0x028D; 43304 t['wynn'] = 0x01BF; 43305 t['x'] = 0x0078; 43306 t['xabovecmb'] = 0x033D; 43307 t['xbopomofo'] = 0x3112; 43308 t['xcircle'] = 0x24E7; 43309 t['xdieresis'] = 0x1E8D; 43310 t['xdotaccent'] = 0x1E8B; 43311 t['xeharmenian'] = 0x056D; 43312 t['xi'] = 0x03BE; 43313 t['xmonospace'] = 0xFF58; 43314 t['xparen'] = 0x24B3; 43315 t['xsuperior'] = 0x02E3; 43316 t['y'] = 0x0079; 43317 t['yaadosquare'] = 0x334E; 43318 t['yabengali'] = 0x09AF; 43319 t['yacute'] = 0x00FD; 43320 t['yadeva'] = 0x092F; 43321 t['yaekorean'] = 0x3152; 43322 t['yagujarati'] = 0x0AAF; 43323 t['yagurmukhi'] = 0x0A2F; 43324 t['yahiragana'] = 0x3084; 43325 t['yakatakana'] = 0x30E4; 43326 t['yakatakanahalfwidth'] = 0xFF94; 43327 t['yakorean'] = 0x3151; 43328 t['yamakkanthai'] = 0x0E4E; 43329 t['yasmallhiragana'] = 0x3083; 43330 t['yasmallkatakana'] = 0x30E3; 43331 t['yasmallkatakanahalfwidth'] = 0xFF6C; 43332 t['yatcyrillic'] = 0x0463; 43333 t['ycircle'] = 0x24E8; 43334 t['ycircumflex'] = 0x0177; 43335 t['ydieresis'] = 0x00FF;
43336 t['ydotaccent'] = 0x1E8F; 43337 t['ydotbelow'] = 0x1EF5; 43338 t['yeharabic'] = 0x064A; 43339 t['yehbarreearabic'] = 0x06D2; 43340 t['yehbarreefinalarabic'] = 0xFBAF; 43341 t['yehfinalarabic'] = 0xFEF2; 43342 t['yehhamzaabovearabic'] = 0x0626; 43343 t['yehhamzaabovefinalarabic'] = 0xFE8A; 43344 t['yehhamzaaboveinitialarabic'] = 0xFE8B; 43345 t['yehhamzaabovemedialarabic'] = 0xFE8C; 43346 t['yehinitialarabic'] = 0xFEF3; 43347 t['yehmedialarabic'] = 0xFEF4; 43348 t['yehmeeminitialarabic'] = 0xFCDD; 43349 t['yehmeemisolatedarabic'] = 0xFC58; 43350 t['yehnoonfinalarabic'] = 0xFC94; 43351 t['yehthreedotsbelowarabic'] = 0x06D1; 43352 t['yekorean'] = 0x3156; 43353 t['yen'] = 0x00A5; 43354 t['yenmonospace'] = 0xFFE5; 43355 t['yeokorean'] = 0x3155; 43356 t['yeorinhieuhkorean'] = 0x3186; 43357 t['yerahbenyomohebrew'] = 0x05AA; 43358 t['yerahbenyomolefthebrew'] = 0x05AA; 43359 t['yericyrillic'] = 0x044B; 43360 t['yerudieresiscyrillic'] = 0x04F9; 43361 t['yesieungkorean'] = 0x3181; 43362 t['yesieungpansioskorean'] = 0x3183; 43363 t['yesieungsioskorean'] = 0x3182; 43364 t['yetivhebrew'] = 0x059A; 43365 t['ygrave'] = 0x1EF3; 43366 t['yhook'] = 0x01B4; 43367 t['yhookabove'] = 0x1EF7; 43368 t['yiarmenian'] = 0x0575; 43369 t['yicyrillic'] = 0x0457; 43370 t['yikorean'] = 0x3162; 43371 t['yinyang'] = 0x262F; 43372 t['yiwnarmenian'] = 0x0582; 43373 t['ymonospace'] = 0xFF59; 43374 t['yod'] = 0x05D9; 43375 t['yoddagesh'] = 0xFB39; 43376 t['yoddageshhebrew'] = 0xFB39; 43377 t['yodhebrew'] = 0x05D9; 43378 t['yodyodhebrew'] = 0x05F2; 43379 t['yodyodpatahhebrew'] = 0xFB1F; 43380 t['yohiragana'] = 0x3088; 43381 t['yoikorean'] = 0x3189; 43382 t['yokatakana'] = 0x30E8; 43383 t['yokatakanahalfwidth'] = 0xFF96; 43384 t['yokorean'] = 0x315B; 43385 t['yosmallhiragana'] = 0x3087; 43386 t['yosmallkatakana'] = 0x30E7; 43387 t['yosmallkatakanahalfwidth'] = 0xFF6E; 43388 t['yotgreek'] = 0x03F3; 43389 t['yoyaekorean'] = 0x3188; 43390 t['yoyakorean'] = 0x3187; 43391 t['yoyakthai'] = 0x0E22; 43392 t['yoyingthai'] = 0x0E0D; 43393 t['yparen'] = 0x24B4; 43394 t['ypogegrammeni'] = 0x037A; 43395 t['ypogegrammenigreekcmb'] = 0x0345; 43396 t['yr'] = 0x01A6; 43397 t['yring'] = 0x1E99; 43398 t['ysuperior'] = 0x02B8; 43399 t['ytilde'] = 0x1EF9; 43400 t['yturned'] = 0x028E; 43401 t['yuhiragana'] = 0x3086; 43402 t['yuikorean'] = 0x318C; 43403 t['yukatakana'] = 0x30E6; 43404 t['yukatakanahalfwidth'] = 0xFF95; 43405 t['yukorean'] = 0x3160; 43406 t['yusbigcyrillic'] = 0x046B; 43407 t['yusbigiotifiedcyrillic'] = 0x046D; 43408 t['yuslittlecyrillic'] = 0x0467; 43409 t['yuslittleiotifiedcyrillic'] = 0x0469; 43410 t['yusmallhiragana'] = 0x3085; 43411 t['yusmallkatakana'] = 0x30E5; 43412 t['yusmallkatakanahalfwidth'] = 0xFF6D; 43413 t['yuyekorean'] = 0x318B; 43414 t['yuyeokorean'] = 0x318A; 43415 t['yyabengali'] = 0x09DF; 43416 t['yyadeva'] = 0x095F; 43417 t['z'] = 0x007A; 43418 t['zaarmenian'] = 0x0566; 43419 t['zacute'] = 0x017A; 43420 t['zadeva'] = 0x095B; 43421 t['zagurmukhi'] = 0x0A5B; 43422 t['zaharabic'] = 0x0638; 43423 t['zahfinalarabic'] = 0xFEC6; 43424 t['zahinitialarabic'] = 0xFEC7; 43425 t['zahiragana'] = 0x3056; 43426 t['zahmedialarabic'] = 0xFEC8; 43427 t['zainarabic'] = 0x0632; 43428 t['zainfinalarabic'] = 0xFEB0; 43429 t['zakatakana'] = 0x30B6; 43430 t['zaqefgadolhebrew'] = 0x0595; 43431 t['zaqefqatanhebrew'] = 0x0594; 43432 t['zarqahebrew'] = 0x0598; 43433 t['zayin'] = 0x05D6; 43434 t['zayindagesh'] = 0xFB36; 43435 t['zayindageshhebrew'] = 0xFB36; 43436 t['zayinhebrew'] = 0x05D6; 43437 t['zbopomofo'] = 0x3117; 43438 t['zcaron'] = 0x017E; 43439 t['zcircle'] = 0x24E9; 43440 t['zcircumflex'] = 0x1E91; 43441 t['zcurl'] = 0x0291; 43442 t['zdot'] = 0x017C; 43443 t['zdotaccent'] = 0x017C; 43444 t['zdotbelow'] = 0x1E93; 43445 t['zecyrillic'] = 0x0437; 43446 t['zedescendercyrillic'] = 0x0499; 43447 t['zedieresiscyrillic'] = 0x04DF; 43448 t['zehiragana'] = 0x305C; 43449 t['zekatakana'] = 0x30BC; 43450 t['zero'] = 0x0030; 43451 t['zeroarabic'] = 0x0660; 43452 t['zerobengali'] = 0x09E6; 43453 t['zerodeva'] = 0x0966; 43454 t['zerogujarati'] = 0x0AE6; 43455 t['zerogurmukhi'] = 0x0A66; 43456 t['zerohackarabic'] = 0x0660; 43457 t['zeroinferior'] = 0x2080; 43458 t['zeromonospace'] = 0xFF10; 43459 t['zerooldstyle'] = 0xF730; 43460 t['zeropersian'] = 0x06F0; 43461 t['zerosuperior'] = 0x2070; 43462 t['zerothai'] = 0x0E50; 43463 t['zerowidthjoiner'] = 0xFEFF; 43464 t['zerowidthnonjoiner'] = 0x200C; 43465 t['zerowidthspace'] = 0x200B; 43466 t['zeta'] = 0x03B6; 43467 t['zhbopomofo'] = 0x3113; 43468 t['zhearmenian'] = 0x056A; 43469 t['zhebrevecyrillic'] = 0x04C2; 43470 t['zhecyrillic'] = 0x0436; 43471 t['zhedescendercyrillic'] = 0x0497; 43472 t['zhedieresiscyrillic'] = 0x04DD; 43473 t['zihiragana'] = 0x3058; 43474 t['zikatakana'] = 0x30B8; 43475 t['zinorhebrew'] = 0x05AE; 43476 t['zlinebelow'] = 0x1E95; 43477 t['zmonospace'] = 0xFF5A; 43478 t['zohiragana'] = 0x305E; 43479 t['zokatakana'] = 0x30BE; 43480 t['zparen'] = 0x24B5; 43481 t['zretroflexhook'] = 0x0290; 43482 t['zstroke'] = 0x01B6; 43483 t['zuhiragana'] = 0x305A; 43484 t['zukatakana'] = 0x30BA; 43485 t['.notdef'] = 0x0000; 43486 t['angbracketleftbig'] = 0x2329; 43487 t['angbracketleftBig'] = 0x2329; 43488 t['angbracketleftbigg'] = 0x2329; 43489 t['angbracketleftBigg'] = 0x2329; 43490 t['angbracketrightBig'] = 0x232A; 43491 t['angbracketrightbig'] = 0x232A; 43492 t['angbracketrightBigg'] = 0x232A; 43493 t['angbracketrightbigg'] = 0x232A; 43494 t['arrowhookleft'] = 0x21AA; 43495 t['arrowhookright'] = 0x21A9; 43496 t['arrowlefttophalf'] = 0x21BC; 43497 t['arrowleftbothalf'] = 0x21BD; 43498 t['arrownortheast'] = 0x2197; 43499 t['arrownorthwest'] = 0x2196; 43500 t['arrowrighttophalf'] = 0x21C0; 43501 t['arrowrightbothalf'] = 0x21C1; 43502 t['arrowsoutheast'] = 0x2198; 43503 t['arrowsouthwest'] = 0x2199; 43504 t['backslashbig'] = 0x2216; 43505 t['backslashBig'] = 0x2216; 43506 t['backslashBigg'] = 0x2216; 43507 t['backslashbigg'] = 0x2216; 43508 t['bardbl'] = 0x2016; 43509 t['bracehtipdownleft'] = 0xFE37; 43510 t['bracehtipdownright'] = 0xFE37; 43511 t['bracehtipupleft'] = 0xFE38; 43512 t['bracehtipupright'] = 0xFE38; 43513 t['braceleftBig'] = 0x007B; 43514 t['braceleftbig'] = 0x007B; 43515 t['braceleftbigg'] = 0x007B; 43516 t['braceleftBigg'] = 0x007B; 43517 t['bracerightBig'] = 0x007D; 43518 t['bracerightbig'] = 0x007D; 43519 t['bracerightbigg'] = 0x007D; 43520 t['bracerightBigg'] = 0x007D; 43521 t['bracketleftbig'] = 0x005B; 43522 t['bracketleftBig'] = 0x005B; 43523 t['bracketleftbigg'] = 0x005B; 43524 t['bracketleftBigg'] = 0x005B; 43525 t['bracketrightBig'] = 0x005D; 43526 t['bracketrightbig'] = 0x005D; 43527 t['bracketrightbigg'] = 0x005D; 43528 t['bracketrightBigg'] = 0x005D; 43529 t['ceilingleftbig'] = 0x2308; 43530 t['ceilingleftBig'] = 0x2308; 43531 t['ceilingleftBigg'] = 0x2308; 43532 t['ceilingleftbigg'] = 0x2308; 43533 t['ceilingrightbig'] = 0x2309; 43534 t['ceilingrightBig'] = 0x2309; 43535 t['ceilingrightbigg'] = 0x2309; 43536 t['ceilingrightBigg'] = 0x2309; 43537 t['circledotdisplay'] = 0x2299; 43538 t['circledottext'] = 0x2299; 43539 t['circlemultiplydisplay'] = 0x2297; 43540 t['circlemultiplytext'] = 0x2297; 43541 t['circleplusdisplay'] = 0x2295; 43542 t['circleplustext'] = 0x2295; 43543 t['contintegraldisplay'] = 0x222E; 43544 t['contintegraltext'] = 0x222E; 43545 t['coproductdisplay'] = 0x2210; 43546 t['coproducttext'] = 0x2210; 43547 t['floorleftBig'] = 0x230A; 43548 t['floorleftbig'] = 0x230A; 43549 t['floorleftbigg'] = 0x230A; 43550 t['floorleftBigg'] = 0x230A; 43551 t['floorrightbig'] = 0x230B; 43552 t['floorrightBig'] = 0x230B; 43553 t['floorrightBigg'] = 0x230B; 43554 t['floorrightbigg'] = 0x230B; 43555 t['hatwide'] = 0x0302; 43556 t['hatwider'] = 0x0302; 43557 t['hatwidest'] = 0x0302; 43558 t['intercal'] = 0x1D40; 43559 t['integraldisplay'] = 0x222B; 43560 t['integraltext'] = 0x222B; 43561 t['intersectiondisplay'] = 0x22C2; 43562 t['intersectiontext'] = 0x22C2; 43563 t['logicalanddisplay'] = 0x2227; 43564 t['logicalandtext'] = 0x2227; 43565 t['logicalordisplay'] = 0x2228; 43566 t['logicalortext'] = 0x2228; 43567 t['parenleftBig'] = 0x0028; 43568 t['parenleftbig'] = 0x0028; 43569 t['parenleftBigg'] = 0x0028; 43570 t['parenleftbigg'] = 0x0028; 43571 t['parenrightBig'] = 0x0029; 43572 t['parenrightbig'] = 0x0029; 43573 t['parenrightBigg'] = 0x0029; 43574 t['parenrightbigg'] = 0x0029; 43575 t['prime'] = 0x2032; 43576 t['productdisplay'] = 0x220F; 43577 t['producttext'] = 0x220F; 43578 t['radicalbig'] = 0x221A; 43579 t['radicalBig'] = 0x221A; 43580 t['radicalBigg'] = 0x221A; 43581 t['radicalbigg'] = 0x221A; 43582 t['radicalbt'] = 0x221A; 43583 t['radicaltp'] = 0x221A; 43584 t['radicalvertex'] = 0x221A; 43585 t['slashbig'] = 0x002F; 43586 t['slashBig'] = 0x002F; 43587 t['slashBigg'] = 0x002F; 43588 t['slashbigg'] = 0x002F; 43589 t['summationdisplay'] = 0x2211; 43590 t['summationtext'] = 0x2211; 43591 t['tildewide'] = 0x02DC; 43592 t['tildewider'] = 0x02DC; 43593 t['tildewidest'] = 0x02DC; 43594 t['uniondisplay'] = 0x22C3; 43595 t['unionmultidisplay'] = 0x228E; 43596 t['unionmultitext'] = 0x228E; 43597 t['unionsqdisplay'] = 0x2294; 43598 t['unionsqtext'] = 0x2294; 43599 t['uniontext'] = 0x22C3; 43600 t['vextenddouble'] = 0x2225; 43601 t['vextendsingle'] = 0x2223; 43602}); 43603var getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) { 43604 t['space'] = 0x0020; 43605 t['a1'] = 0x2701; 43606 t['a2'] = 0x2702; 43607 t['a202'] = 0x2703; 43608 t['a3'] = 0x2704; 43609 t['a4'] = 0x260E; 43610 t['a5'] = 0x2706; 43611 t['a119'] = 0x2707; 43612 t['a118'] = 0x2708; 43613 t['a117'] = 0x2709; 43614 t['a11'] = 0x261B; 43615 t['a12'] = 0x261E; 43616 t['a13'] = 0x270C; 43617 t['a14'] = 0x270D; 43618 t['a15'] = 0x270E; 43619 t['a16'] = 0x270F; 43620 t['a105'] = 0x2710; 43621 t['a17'] = 0x2711; 43622 t['a18'] = 0x2712; 43623 t['a19'] = 0x2713; 43624 t['a20'] = 0x2714; 43625 t['a21'] = 0x2715; 43626 t['a22'] = 0x2716; 43627 t['a23'] = 0x2717; 43628 t['a24'] = 0x2718; 43629 t['a25'] = 0x2719; 43630 t['a26'] = 0x271A; 43631 t['a27'] = 0x271B;
43632 t['a28'] = 0x271C; 43633 t['a6'] = 0x271D; 43634 t['a7'] = 0x271E; 43635 t['a8'] = 0x271F; 43636 t['a9'] = 0x2720; 43637 t['a10'] = 0x2721; 43638 t['a29'] = 0x2722; 43639 t['a30'] = 0x2723; 43640 t['a31'] = 0x2724; 43641 t['a32'] = 0x2725; 43642 t['a33'] = 0x2726; 43643 t['a34'] = 0x2727; 43644 t['a35'] = 0x2605; 43645 t['a36'] = 0x2729; 43646 t['a37'] = 0x272A; 43647 t['a38'] = 0x272B; 43648 t['a39'] = 0x272C; 43649 t['a40'] = 0x272D; 43650 t['a41'] = 0x272E; 43651 t['a42'] = 0x272F; 43652 t['a43'] = 0x2730; 43653 t['a44'] = 0x2731; 43654 t['a45'] = 0x2732; 43655 t['a46'] = 0x2733; 43656 t['a47'] = 0x2734; 43657 t['a48'] = 0x2735; 43658 t['a49'] = 0x2736; 43659 t['a50'] = 0x2737; 43660 t['a51'] = 0x2738; 43661 t['a52'] = 0x2739; 43662 t['a53'] = 0x273A; 43663 t['a54'] = 0x273B; 43664 t['a55'] = 0x273C; 43665 t['a56'] = 0x273D; 43666 t['a57'] = 0x273E; 43667 t['a58'] = 0x273F; 43668 t['a59'] = 0x2740; 43669 t['a60'] = 0x2741; 43670 t['a61'] = 0x2742; 43671 t['a62'] = 0x2743; 43672 t['a63'] = 0x2744; 43673 t['a64'] = 0x2745; 43674 t['a65'] = 0x2746; 43675 t['a66'] = 0x2747; 43676 t['a67'] = 0x2748; 43677 t['a68'] = 0x2749; 43678 t['a69'] = 0x274A; 43679 t['a70'] = 0x274B; 43680 t['a71'] = 0x25CF; 43681 t['a72'] = 0x274D; 43682 t['a73'] = 0x25A0; 43683 t['a74'] = 0x274F; 43684 t['a203'] = 0x2750; 43685 t['a75'] = 0x2751; 43686 t['a204'] = 0x2752; 43687 t['a76'] = 0x25B2; 43688 t['a77'] = 0x25BC; 43689 t['a78'] = 0x25C6; 43690 t['a79'] = 0x2756; 43691 t['a81'] = 0x25D7; 43692 t['a82'] = 0x2758; 43693 t['a83'] = 0x2759; 43694 t['a84'] = 0x275A; 43695 t['a97'] = 0x275B; 43696 t['a98'] = 0x275C; 43697 t['a99'] = 0x275D; 43698 t['a100'] = 0x275E; 43699 t['a101'] = 0x2761; 43700 t['a102'] = 0x2762; 43701 t['a103'] = 0x2763; 43702 t['a104'] = 0x2764; 43703 t['a106'] = 0x2765; 43704 t['a107'] = 0x2766; 43705 t['a108'] = 0x2767; 43706 t['a112'] = 0x2663; 43707 t['a111'] = 0x2666; 43708 t['a110'] = 0x2665; 43709 t['a109'] = 0x2660; 43710 t['a120'] = 0x2460; 43711 t['a121'] = 0x2461; 43712 t['a122'] = 0x2462; 43713 t['a123'] = 0x2463; 43714 t['a124'] = 0x2464; 43715 t['a125'] = 0x2465; 43716 t['a126'] = 0x2466; 43717 t['a127'] = 0x2467; 43718 t['a128'] = 0x2468; 43719 t['a129'] = 0x2469; 43720 t['a130'] = 0x2776; 43721 t['a131'] = 0x2777; 43722 t['a132'] = 0x2778; 43723 t['a133'] = 0x2779; 43724 t['a134'] = 0x277A; 43725 t['a135'] = 0x277B; 43726 t['a136'] = 0x277C; 43727 t['a137'] = 0x277D; 43728 t['a138'] = 0x277E; 43729 t['a139'] = 0x277F; 43730 t['a140'] = 0x2780; 43731 t['a141'] = 0x2781; 43732 t['a142'] = 0x2782; 43733 t['a143'] = 0x2783; 43734 t['a144'] = 0x2784; 43735 t['a145'] = 0x2785; 43736 t['a146'] = 0x2786; 43737 t['a147'] = 0x2787; 43738 t['a148'] = 0x2788; 43739 t['a149'] = 0x2789; 43740 t['a150'] = 0x278A; 43741 t['a151'] = 0x278B; 43742 t['a152'] = 0x278C; 43743 t['a153'] = 0x278D; 43744 t['a154'] = 0x278E; 43745 t['a155'] = 0x278F; 43746 t['a156'] = 0x2790; 43747 t['a157'] = 0x2791; 43748 t['a158'] = 0x2792; 43749 t['a159'] = 0x2793; 43750 t['a160'] = 0x2794; 43751 t['a161'] = 0x2192; 43752 t['a163'] = 0x2194; 43753 t['a164'] = 0x2195; 43754 t['a196'] = 0x2798; 43755 t['a165'] = 0x2799; 43756 t['a192'] = 0x279A; 43757 t['a166'] = 0x279B; 43758 t['a167'] = 0x279C; 43759 t['a168'] = 0x279D; 43760 t['a169'] = 0x279E; 43761 t['a170'] = 0x279F; 43762 t['a171'] = 0x27A0; 43763 t['a172'] = 0x27A1; 43764 t['a173'] = 0x27A2; 43765 t['a162'] = 0x27A3; 43766 t['a174'] = 0x27A4; 43767 t['a175'] = 0x27A5; 43768 t['a176'] = 0x27A6; 43769 t['a177'] = 0x27A7; 43770 t['a178'] = 0x27A8; 43771 t['a179'] = 0x27A9; 43772 t['a193'] = 0x27AA; 43773 t['a180'] = 0x27AB; 43774 t['a199'] = 0x27AC; 43775 t['a181'] = 0x27AD; 43776 t['a200'] = 0x27AE; 43777 t['a182'] = 0x27AF; 43778 t['a201'] = 0x27B1; 43779 t['a183'] = 0x27B2; 43780 t['a184'] = 0x27B3; 43781 t['a197'] = 0x27B4; 43782 t['a185'] = 0x27B5; 43783 t['a194'] = 0x27B6; 43784 t['a198'] = 0x27B7; 43785 t['a186'] = 0x27B8; 43786 t['a195'] = 0x27B9; 43787 t['a187'] = 0x27BA; 43788 t['a188'] = 0x27BB; 43789 t['a189'] = 0x27BC; 43790 t['a190'] = 0x27BD; 43791 t['a191'] = 0x27BE; 43792 t['a89'] = 0x2768; 43793 t['a90'] = 0x2769; 43794 t['a93'] = 0x276A; 43795 t['a94'] = 0x276B; 43796 t['a91'] = 0x276C; 43797 t['a92'] = 0x276D; 43798 t['a205'] = 0x276E; 43799 t['a85'] = 0x276F; 43800 t['a206'] = 0x2770; 43801 t['a86'] = 0x2771; 43802 t['a87'] = 0x2772; 43803 t['a88'] = 0x2773; 43804 t['a95'] = 0x2774; 43805 t['a96'] = 0x2775; 43806 t['.notdef'] = 0x0000; 43807}); 43808exports.getGlyphsUnicode = getGlyphsUnicode; 43809exports.getDingbatsGlyphsUnicode = getDingbatsGlyphsUnicode; 43810 43811/***/ }), 43812/* 178 */ 43813/***/ (function(module, exports, __w_pdfjs_require__) { 43814 43815"use strict"; 43816 43817 43818Object.defineProperty(exports, "__esModule", { 43819 value: true 43820}); 43821exports.getSupplementalGlyphMapForCalibri = exports.getSupplementalGlyphMapForArialBlack = exports.getGlyphMapForStandardFonts = exp
43821orts.getSymbolsFonts = exports.getSerifFonts = exports.getNonStdFontMap = exports.getStdFontMap = void 0; 43822 43823var _util = __w_pdfjs_require__(6); 43824 43825var getStdFontMap = (0, _util.getLookupTableFactory)(function (t) { 43826 t['ArialNarrow'] = 'Helvetica'; 43827 t['ArialNarrow-Bold'] = 'Helvetica-Bold'; 43828 t['ArialNarrow-BoldItalic'] = 'Helvetica-BoldOblique'; 43829 t['ArialNarrow-Italic'] = 'Helvetica-Oblique'; 43830 t['ArialBlack'] = 'Helvetica'; 43831 t['ArialBlack-Bold'] = 'Helvetica-Bold'; 43832 t['ArialBlack-BoldItalic'] = 'Helvetica-BoldOblique'; 43833 t['ArialBlack-Italic'] = 'Helvetica-Oblique'; 43834 t['Arial-Black'] = 'Helvetica'; 43835 t['Arial-Black-Bold'] = 'Helvetica-Bold'; 43836 t['Arial-Black-BoldItalic'] = 'Helvetica-BoldOblique'; 43837 t['Arial-Black-Italic'] = 'Helvetica-Oblique'; 43838 t['Arial'] = 'Helvetica'; 43839 t['Arial-Bold'] = 'Helvetica-Bold'; 43840 t['Arial-BoldItalic'] = 'Helvetica-BoldOblique'; 43841 t['Arial-Italic'] = 'Helvetica-Oblique'; 43842 t['Arial-BoldItalicMT'] = 'Helvetica-BoldOblique'; 43843 t['Arial-BoldMT'] = 'Helvetica-Bold'; 43844 t['Arial-ItalicMT'] = 'Helvetica-Oblique'; 43845 t['ArialMT'] = 'Helvetica'; 43846 t['Courier-Bold'] = 'Courier-Bold'; 43847 t['Courier-BoldItalic'] = 'Courier-BoldOblique'; 43848 t['Courier-Italic'] = 'Courier-Oblique'; 43849 t['CourierNew'] = 'Courier'; 43850 t['CourierNew-Bold'] = 'Courier-Bold'; 43851 t['CourierNew-BoldItalic'] = 'Courier-BoldOblique'; 43852 t['CourierNew-Italic'] = 'Courier-Oblique'; 43853 t['CourierNewPS-BoldItalicMT'] = 'Courier-BoldOblique'; 43854 t['CourierNewPS-BoldMT'] = 'Courier-Bold'; 43855 t['CourierNewPS-ItalicMT'] = 'Courier-Oblique'; 43856 t['CourierNewPSMT'] = 'Courier'; 43857 t['Helvetica'] = 'Helvetica'; 43858 t['Helvetica-Bold'] = 'Helvetica-Bold'; 43859 t['Helvetica-BoldItalic'] = 'Helvetica-BoldOblique'; 43860 t['Helvetica-BoldOblique'] = 'Helvetica-BoldOblique'; 43861 t['Helvetica-Italic'] = 'Helvetica-Oblique'; 43862 t['Helvetica-Oblique'] = 'Helvetica-Oblique'; 43863 t['SegoeUISymbol'] = 'Helvetica'; 43864 t['Symbol-Bold'] = 'Symbol'; 43865 t['Symbol-BoldItalic'] = 'Symbol'; 43866 t['Symbol-Italic'] = 'Symbol'; 43867 t['TimesNewRoman'] = 'Times-Roman'; 43868 t['TimesNewRoman-Bold'] = 'Times-Bold'; 43869 t['TimesNewRoman-BoldItalic'] = 'Times-BoldItalic'; 43870 t['TimesNewRoman-Italic'] = 'Times-Italic'; 43871 t['TimesNewRomanPS'] = 'Times-Roman'; 43872 t['TimesNewRomanPS-Bold'] = 'Times-Bold'; 43873 t['TimesNewRomanPS-BoldItalic'] = 'Times-BoldItalic'; 43874 t['TimesNewRomanPS-BoldItalicMT'] = 'Times-BoldItalic'; 43875 t['TimesNewRomanPS-BoldMT'] = 'Times-Bold'; 43876 t['TimesNewRomanPS-Italic'] = 'Times-Italic'; 43877 t['TimesNewRomanPS-ItalicMT'] = 'Times-Italic'; 43878 t['TimesNewRomanPSMT'] = 'Times-Roman'; 43879 t['TimesNewRomanPSMT-Bold'] = 'Times-Bold'; 43880 t['TimesNewRomanPSMT-BoldItalic'] = 'Times-BoldItalic'; 43881 t['TimesNewRomanPSMT-Italic'] = 'Times-Italic'; 43882}); 43883exports.getStdFontMap = getStdFontMap; 43884var getNonStdFontMap = (0, _util.getLookupTableFactory)(function (t) { 43885 t['Calibri'] = 'Helvetica'; 43886 t['Calibri-Bold'] = 'Helvetica-Bold'; 43887 t['Calibri-BoldItalic'] = 'Helvetica-BoldOblique'; 43888 t['Calibri-Italic'] = 'Helvetica-Oblique'; 43889 t['CenturyGothic'] = 'Helvetica'; 43890 t['CenturyGothic-Bold'] = 'Helvetica-Bold'; 43891 t['CenturyGothic-BoldItalic'] = 'Helvetica-BoldOblique'; 43892 t['CenturyGothic-Italic'] = 'Helvetica-Oblique'; 43893 t['ComicSansMS'] = 'Comic Sans MS'; 43894 t['ComicSansMS-Bold'] = 'Comic Sans MS-Bold'; 43895 t['ComicSansMS-BoldItalic'] = 'Comic Sans MS-BoldItalic'; 43896 t['ComicSansMS-Italic'] = 'Comic Sans MS-Italic'; 43897 t['LucidaConsole'] = 'Courier'; 43898 t['LucidaConsole-Bold'] = 'Courier-Bold'; 43899 t['LucidaConsole-BoldItalic'] = 'Courier-BoldOblique'; 43900 t['LucidaConsole-Italic'] = 'Courier-Oblique'; 43901 t['LucidaSans-Demi'] = 'Helvetica-Bold'; 43902 t['MS-Gothic'] = 'MS Gothic'; 43903 t['MS-Gothic-Bold'] = 'MS Gothic-Bold'; 43904 t['MS-Gothic-BoldItalic'] = 'MS Gothic-BoldItalic'; 43905 t['MS-Gothic-Italic'] = 'MS Gothic-Italic'; 43906 t['MS-Mincho'] = 'MS Mincho'; 43907 t['MS-Mincho-Bold'] = 'MS Mincho-Bold'; 43908 t['MS-Mincho-BoldItalic'] = 'MS Mincho-BoldItalic'; 43909 t['MS-Mincho-Italic'] = 'MS Mincho-Italic'; 43910 t['MS-PGothic'] = 'MS PGothic'; 43911 t['MS-PGothic-Bold'] = 'MS PGothic-Bold'; 43912 t['MS-PGothic-BoldItalic'] = 'MS PGothic-BoldItalic'; 43913 t['MS-PGothic-Italic'] = 'MS PGothic-Italic'; 43914 t['MS-PMincho'] = 'MS PMincho'; 43915 t['MS-PMincho-Bold'] = 'MS PMincho-Bold'; 43916 t['MS-PMincho-BoldItalic'] = 'MS PMincho-BoldItalic'; 43917 t['MS-PMincho-Italic'] = 'MS PMincho-Italic'; 43918 t['NuptialScript'] = 'Times-Italic'; 43919 t['Wingdings'] = 'ZapfDingbats'; 43920}); 43921exports.getNonStdFontMap = getNonStdFontMap; 43922var getSerifFonts = (0, _util.getLookupTableFactory)(function (t) { 43923 t['Adobe Jenson'] = true; 43924 t['Adobe Text'] = true; 43925 t['Albertus'] = true; 43926 t['Aldus'] = true; 43927 t['Alexandria'] = true; 43928 t['Algerian'] = true; 43929 t['American Typewriter'] = true; 43930 t['Antiqua'] = true; 43931 t['Apex'] = true; 43932 t['Arno'] = true; 43933 t['Aster'] = true; 43934 t['Aurora'] = true; 43935 t['Baskerville'] = true; 43936 t['Bell'] = true; 43937 t['Bembo'] = true; 43938 t['Bembo Schoolbook'] = true; 43939 t['Benguiat'] = true; 43940 t['Berkeley Old Style'] = true; 43941 t['Bernhard Modern'] = true; 43942 t['Berthold City'] = true; 43943 t['Bodoni'] = true; 43944 t['Bauer Bodoni'] = true; 43945 t['Book Antiqua'] = true; 43946 t['Bookman'] = true; 43947 t['Bordeaux Roman'] = true; 43948 t['Californian FB'] = true; 43949 t['Calisto'] = true; 43950 t['Calvert'] = true; 43951 t['Capitals'] = true; 43952 t['Cambria'] = true; 43953 t['Cartier'] = true; 43954 t['Caslon'] = true; 43955 t['Catull'] = true; 43956 t['Centaur'] = true; 43957 t['Century Old Style'] = true; 43958 t['Century Schoolbook'] = true; 43959 t['Chaparral'] = true; 43960 t['Charis SIL'] = true; 43961 t['Cheltenham'] = true; 43962 t['Cholla Slab'] = true; 43963 t['Clarendon'] = true; 43964 t['Clearface'] = true; 43965 t['Cochin'] = true; 43966 t['Colonna'] = true; 43967 t['Computer Modern'] = true; 43968 t['Concrete Roman'] = true; 43969 t['Constantia'] = true;
43970 t['Cooper Black'] = true; 43971 t['Corona'] = true; 43972 t['Ecotype'] = true; 43973 t['Egyptienne'] = true; 43974 t['Elephant'] = true; 43975 t['Excelsior'] = true; 43976 t['Fairfield'] = true; 43977 t['FF Scala'] = true; 43978 t['Folkard'] = true; 43979 t['Footlight'] = true; 43980 t['FreeSerif'] = true; 43981 t['Friz Quadrata'] = true; 43982 t['Garamond'] = true; 43983 t['Gentium'] = true; 43984 t['Georgia'] = true; 43985 t['Gloucester'] = true; 43986 t['Goudy Old Style'] = true; 43987 t['Goudy Schoolbook'] = true; 43988 t['Goudy Pro Font'] = true; 43989 t['Granjon'] = true; 43990 t['Guardian Egyptian'] = true; 43991 t['Heather'] = true; 43992 t['Hercules'] = true; 43993 t['High Tower Text'] = true; 43994 t['Hiroshige'] = true; 43995 t['Hoefler Text'] = true; 43996 t['Humana Serif'] = true; 43997 t['Imprint'] = true; 43998 t['Ionic No. 5'] = true; 43999 t['Janson'] = true; 44000 t['Joanna'] = true; 44001 t['Korinna'] = true; 44002 t['Lexicon'] = true; 44003 t['Liberation Serif'] = true; 44004 t['Linux Libertine'] = true; 44005 t['Literaturnaya'] = true; 44006 t['Lucida'] = true; 44007 t['Lucida Bright'] = true; 44008 t['Melior'] = true; 44009 t['Memphis'] = true; 44010 t['Miller'] = true; 44011 t['Minion'] = true; 44012 t['Modern'] = true; 44013 t['Mona Lisa'] = true; 44014 t['Mrs Eaves'] = true; 44015 t['MS Serif'] = true; 44016 t['Museo Slab'] = true; 44017 t['New York'] = true; 44018 t['Nimbus Roman'] = true; 44019 t['NPS Rawlinson Roadway'] = true; 44020 t['NuptialScript'] = true; 44021 t['Palatino'] = true; 44022 t['Perpetua'] = true; 44023 t['Plantin'] = true; 44024 t['Plantin Schoolbook'] = true; 44025 t['Playbill'] = true; 44026 t['Poor Richard'] = true; 44027 t['Rawlinson Roadway'] = true; 44028 t['Renault'] = true; 44029 t['Requiem'] = true; 44030 t['Rockwell'] = true; 44031 t['Roman'] = true; 44032 t['Rotis Serif'] = true; 44033 t['Sabon'] = true; 44034 t['Scala'] = true; 44035 t['Seagull'] = true; 44036 t['Sistina'] = true; 44037 t['Souvenir'] = true; 44038 t['STIX'] = true; 44039 t['Stone Informal'] = true; 44040 t['Stone Serif'] = true; 44041 t['Sylfaen'] = true; 44042 t['Times'] = true; 44043 t['Trajan'] = true; 44044 t['Trinité'] = true; 44045 t['Trump Mediaeval'] = true; 44046 t['Utopia'] = true; 44047 t['Vale Type'] = true; 44048 t['Bitstream Vera'] = true; 44049 t['Vera Serif'] = true; 44050 t['Versailles'] = true;
44051 t['Wanted'] = true; 44052 t['Weiss'] = true; 44053 t['Wide Latin'] = true; 44054 t['Windsor'] = true; 44055 t['XITS'] = true; 44056}); 44057exports.getSerifFonts = getSerifFonts; 44058var getSymbolsFonts = (0, _util.getLookupTableFactory)(function (t) { 44059 t['Dingbats'] = true; 44060 t['Symbol'] = true; 44061 t['ZapfDingbats'] = true; 44062}); 44063exports.getSymbolsFonts = getSymbolsFonts; 44064var getGlyphMapForStandardFonts = (0, _util.getLookupTableFactory)(function (t) { 44065 t[2] = 10; 44066 t[3] = 32; 44067 t[4] = 33; 44068 t[5] = 34; 44069 t[6] = 35; 44070 t[7] = 36; 44071 t[8] = 37; 44072 t[9] = 38; 44073 t[10] = 39; 44074 t[11] = 40; 44075 t[12] = 41; 44076 t[13] = 42; 44077 t[14] = 43; 44078 t[15] = 44; 44079 t[16] = 45; 44080 t[17] = 46; 44081 t[18] = 47; 44082 t[19] = 48; 44083 t[20] = 49; 44084 t[21] = 50; 44085 t[22] = 51; 44086 t[23] = 52; 44087 t[24] = 53; 44088 t[25] = 54; 44089 t[26] = 55; 44090 t[27] = 56; 44091 t[28] = 57; 44092 t[29] = 58; 44093 t[30] = 894; 44094 t[31] = 60; 44095 t[32] = 61; 44096 t[33] = 62; 44097 t[34] = 63; 44098 t[35] = 64; 44099 t[36] = 65; 44100 t[37] = 66; 44101 t[38] = 67; 44102 t[39] = 68; 44103 t[40] = 69; 44104 t[41] = 70; 44105 t[42] = 71; 44106 t[43] = 72; 44107 t[44] = 73; 44108 t[45] = 74; 44109 t[46] = 75; 44110 t[47] = 76; 44111 t[48] = 77; 44112 t[49] = 78; 44113 t[50] = 79; 44114 t[51] = 80; 44115 t[52] = 81; 44116 t[53] = 82; 44117 t[54] = 83; 44118 t[55] = 84; 44119 t[56] = 85; 44120 t[57] = 86; 44121 t[58] = 87; 44122 t[59] = 88; 44123 t[60] = 89; 44124 t[61] = 90; 44125 t[62] = 91; 44126 t[63] = 92; 44127 t[64] = 93; 44128 t[65] = 94; 44129 t[66] = 95; 44130 t[67] = 96; 44131 t[68] = 97; 44132 t[69] = 98; 44133 t[70] = 99; 44134 t[71] = 100; 44135 t[72] = 101; 44136 t[73] = 102; 44137 t[74] = 103; 44138 t[75] = 104; 44139 t[76] = 105; 44140 t[77] = 106; 44141 t[78] = 107; 44142 t[79] = 108; 44143 t[80] = 109; 44144 t[81] = 110; 44145 t[82] = 111; 44146 t[83] = 112; 44147 t[84] = 113; 44148 t[85] = 114; 44149 t[86] = 115; 44150 t[87] = 116; 44151 t[88] = 117; 44152 t[89] = 118; 44153 t[90] = 119; 44154 t[91] = 120; 44155 t[92] = 121; 44156 t[93] = 122; 44157 t[94] = 123; 44158 t[95] = 124; 44159 t[96] = 125; 44160 t[97] = 126; 44161 t[98] = 196; 44162 t[99] = 197; 44163 t[100] = 199; 44164 t[101] = 201; 44165 t[102] = 209; 44166 t[103] = 214; 44167 t[104] = 220; 44168 t[105] = 225; 44169 t[106] = 224; 44170 t[107] = 226; 44171 t[108] = 228; 44172 t[109] = 227; 44173 t[110] = 229; 44174 t[111] = 231; 44175 t[112] = 233; 44176 t[113] = 232; 44177 t[114] = 234; 44178 t[115] = 235; 44179 t[116] = 237; 44180 t[117] = 236; 44181 t[118] = 238; 44182 t[119] = 239; 44183 t[120] = 241; 44184 t[121] = 243; 44185 t[122] = 242; 44186 t[123] = 244; 44187 t[124] = 246; 44188 t[125] = 245; 44189 t[126] = 250; 44190 t[127] = 249; 44191 t[128] = 251; 44192 t[129] = 252; 44193 t[130] = 8224; 44194 t[131] = 176; 44195 t[132] = 162; 44196 t[133] = 163; 44197 t[134] = 167; 44198 t[135] = 8226; 44199 t[136] = 182; 44200 t[137] = 223; 44201 t[138] = 174; 44202 t[139] = 169; 44203 t[140] = 8482; 44204 t[141] = 180; 44205 t[142] = 168; 44206 t[143] = 8800; 44207 t[144] = 198; 44208 t[145] = 216; 44209 t[146] = 8734; 44210 t[147] = 177; 44211 t[148] = 8804; 44212 t[149] = 8805; 44213 t[150] = 165; 44214 t[151] = 181; 44215 t[152] = 8706; 44216 t[153] = 8721; 44217 t[154] = 8719; 44218 t[156] = 8747; 44219 t[157] = 170; 44220 t[158] = 186; 44221 t[159] = 8486; 44222 t[160] = 230; 44223 t[161] = 248; 44224 t[162] = 191; 44225 t[163] = 161; 44226 t[164] = 172; 44227 t[165] = 8730; 44228 t[166] = 402; 44229 t[167] = 8776; 44230 t[168] = 8710; 44231 t[169] = 171; 44232 t[170] = 187; 44233 t[171] = 8230; 44234 t[210] = 218; 44235 t[223] = 711; 44236 t[224] = 321; 44237 t[225] = 322; 44238 t[227] = 353; 44239 t[229] = 382; 44240 t[234] = 253; 44241 t[252] = 263; 44242 t[253] = 268; 44243 t[254] = 269; 44244 t[258] = 258; 44245 t[260] = 260; 44246 t[261] = 261; 44247 t[265] = 280; 44248 t[266] = 281; 44249 t[268] = 283; 44250 t[269] = 313; 44251 t[275] = 323; 44252 t[276] = 324; 44253 t[278] = 328; 44254 t[284] = 345; 44255 t[285] = 346; 44256 t[286] = 347; 44257 t[292] = 367; 44258 t[295] = 377; 44259 t[296] = 378; 44260 t[298] = 380; 44261 t[305] = 963; 44262 t[306] = 964; 44263 t[307] = 966; 44264 t[308] = 8215; 44265 t[309] = 8252; 44266 t[310] = 8319; 44267 t[311] = 8359; 44268 t[312] = 8592; 44269 t[313] = 8593; 44270 t[337] = 9552; 44271 t[493] = 1039; 44272 t[494] = 1040; 44273 t[705] = 1524; 44274 t[706] = 8362; 44275 t[710] = 64288; 44276 t[711] = 64298; 44277 t[759] = 1617; 44278 t[761] = 1776; 44279 t[763] = 1778; 44280 t[775] = 1652; 44281 t[777] = 1764; 44282 t[778] = 1780; 44283 t[779] = 1781; 44284 t[780] = 1782; 44285 t[782] = 771; 44286 t[783] = 64726; 44287 t[786] = 8363; 44288 t[788] = 8532; 44289 t[790] = 768; 44290 t[791] = 769; 44291 t[792] = 768; 44292 t[795] = 803; 44293 t[797] = 64336; 44294 t[798] = 64337; 44295 t[799] = 64342;
44296 t[800] = 64343; 44297 t[801] = 64344; 44298 t[802] = 64345; 44299 t[803] = 64362; 44300 t[804] = 64363; 44301 t[805] = 64364; 44302 t[2424] = 7821; 44303 t[2425] = 7822; 44304 t[2426] = 7823; 44305 t[2427] = 7824; 44306 t[2428] = 7825; 44307 t[2429] = 7826; 44308 t[2430] = 7827; 44309 t[2433] = 7682; 44310 t[2678] = 8045; 44311 t[2679] = 8046; 44312 t[2830] = 1552; 44313 t[2838] = 686; 44314 t[2840] = 751; 44315 t[2842] = 753; 44316 t[2843] = 754; 44317 t[2844] = 755; 44318 t[2846] = 757; 44319 t[2856] = 767; 44320 t[2857] = 848; 44321 t[2858] = 849; 44322 t[2862] = 853; 44323 t[2863] = 854; 44324 t[2864] = 855; 44325 t[2865] = 861; 44326 t[2866] = 862; 44327 t[2906] = 7460; 44328 t[2908] = 7462; 44329 t[2909] = 7463; 44330 t[2910] = 7464; 44331 t[2912] = 7466; 44332 t[2913] = 7467; 44333 t[2914] = 7468; 44334 t[2916] = 7470; 44335 t[2917] = 7471; 44336 t[2918] = 7472; 44337 t[2920] = 7474; 44338 t[2921] = 7475; 44339 t[2922] = 7476; 44340 t[2924] = 7478; 44341 t[2925] = 7479; 44342 t[2926] = 7480; 44343 t[2928] = 7482; 44344 t[2929] = 7483; 44345 t[2930] = 7484; 44346 t[2932] = 7486; 44347 t[2933] = 7487; 44348 t[2934] = 7488; 44349 t[2936] = 7490; 44350 t[2937] = 7491; 44351 t[2938] = 7492; 44352 t[2940] = 7494; 44353 t[2941] = 7495; 44354 t[2942] = 7496; 44355 t[2944] = 7498; 44356 t[2946] = 7500; 44357 t[2948] = 7502; 44358 t[2950] = 7504; 44359 t[2951] = 7505; 44360 t[2952] = 7506; 44361 t[2954] = 7508; 44362 t[2955] = 7509; 44363 t[2956] = 7510; 44364 t[2958] = 7512; 44365 t[2959] = 7513; 44366 t[2960] = 7514; 44367 t[2962] = 7516; 44368 t[2963] = 7517; 44369 t[2964] = 7518; 44370 t[2966] = 7520; 44371 t[2967] = 7521; 44372 t[2968] = 7522; 44373 t[2970] = 7524; 44374 t[2971] = 7525; 44375 t[2972] = 7526; 44376 t[2974] = 7528; 44377 t[2975] = 7529; 44378 t[2976] = 7530; 44379 t[2978] = 1537; 44380 t[2979] = 1538; 44381 t[2980] = 1539; 44382 t[2982] = 1549; 44383 t[2983] = 1551; 44384 t[2984] = 1552; 44385 t[2986] = 1554; 44386 t[2987] = 1555; 44387 t[2988] = 1556; 44388 t[2990] = 1623; 44389 t[2991] = 1624; 44390 t[2995] = 1775; 44391 t[2999] = 1791; 44392 t[3002] = 64290; 44393 t[3003] = 64291; 44394 t[3004] = 64292; 44395 t[3006] = 64294; 44396 t[3007] = 64295; 44397 t[3008] = 64296; 44398 t[3011] = 1900; 44399 t[3014] = 8223; 44400 t[3015] = 8244; 44401 t[3017] = 7532; 44402 t[3018] = 7533; 44403 t[3019] = 7534; 44404 t[3075] = 7590;
44405 t[3076] = 7591; 44406 t[3079] = 7594; 44407 t[3080] = 7595; 44408 t[3083] = 7598; 44409 t[3084] = 7599; 44410 t[3087] = 7602; 44411 t[3088] = 7603; 44412 t[3091] = 7606; 44413 t[3092] = 7607; 44414 t[3095] = 7610; 44415 t[3096] = 7611; 44416 t[3099] = 7614; 44417 t[3100] = 7615; 44418 t[3103] = 7618; 44419 t[3104] = 7619; 44420 t[3107] = 8337; 44421 t[3108] = 8338; 44422 t[3116] = 1884; 44423 t[3119] = 1885; 44424 t[3120] = 1885; 44425 t[3123] = 1886; 44426 t[3124] = 1886; 44427 t[3127] = 1887; 44428 t[3128] = 1887; 44429 t[3131] = 1888; 44430 t[3132] = 1888; 44431 t[3135] = 1889; 44432 t[3136] = 1889; 44433 t[3139] = 1890; 44434 t[3140] = 1890; 44435 t[3143] = 1891; 44436 t[3144] = 1891; 44437 t[3147] = 1892; 44438 t[3148] = 1892; 44439 t[3153] = 580; 44440 t[3154] = 581; 44441 t[3157] = 584; 44442 t[3158] = 585; 44443 t[3161] = 588; 44444 t[3162] = 589; 44445 t[3165] = 891; 44446 t[3166] = 892; 44447 t[3169] = 1274; 44448 t[3170] = 1275; 44449 t[3173] = 1278; 44450 t[3174] = 1279; 44451 t[3181] = 7622; 44452 t[3182] = 7623; 44453 t[3282] = 11799; 44454 t[3316] = 578; 44455 t[3379] = 42785; 44456 t[3393] = 1159; 44457 t[3416] = 8377; 44458}); 44459exports.getGlyphMapForStandardFonts = getGlyphMapForStandardFonts; 44460var getSupplementalGlyphMapForArialBlack = (0, _util.getLookupTableFactory)(function (t) { 44461 t[227] = 322; 44462 t[264] = 261; 44463 t[291] = 346; 44464}); 44465exports.getSupplementalGlyphMapForArialBlack = getSupplementalGlyphMapForArialBlack; 44466var getSupplementalGlyphMapForCalibri = (0, _util.getLookupTableFactory)(function (t) { 44467 t[1] = 32; 44468 t[4] = 65; 44469 t[17] = 66; 44470 t[18] = 67; 44471 t[24] = 68; 44472 t[28] = 69; 44473 t[38] = 70; 44474 t[39] = 71; 44475 t[44] = 72; 44476 t[47] = 73; 44477 t[58] = 74; 44478 t[60] = 75; 44479 t[62] = 76; 44480 t[68] = 77; 44481 t[69] = 78; 44482 t[75] = 79; 44483 t[87] = 80; 44484 t[89] = 81; 44485 t[90] = 82; 44486 t[94] = 83; 44487 t[100] = 84; 44488 t[104] = 85; 44489 t[115] = 86; 44490 t[116] = 87; 44491 t[121] = 88; 44492 t[122] = 89; 44493 t[127] = 90; 44494 t[258] = 97; 44495 t[268] = 261; 44496 t[271] = 98; 44497 t[272] = 99; 44498 t[273] = 263; 44499 t[282] = 100; 44500 t[286] = 101; 44501 t[295] = 281; 44502 t[296] = 102; 44503 t[336] = 103; 44504 t[346] = 104; 44505 t[349] = 105; 44506 t[361] = 106; 44507 t[364] = 107; 44508 t[367] = 108; 44509 t[371] = 322; 44510 t[373] = 109; 44511 t[374] = 110; 44512 t[381] = 111; 44513 t[383] = 243; 44514 t[393] = 112; 44515 t[395] = 113; 44516 t[396] = 114; 44517 t[400] = 115; 44518 t[401] = 347; 44519 t[410] = 116; 44520 t[437] = 117; 44521 t[448] = 118; 44522 t[449] = 119; 44523 t[454] = 120; 44524 t[455] = 121; 44525 t[460] = 122; 44526 t[463] = 380; 44527 t[853] = 44; 44528 t[855] = 58; 44529 t[856] = 46; 44530 t[876] = 47; 44531 t[878] = 45; 44532 t[882] = 45; 44533 t[894] = 40; 44534 t[895] = 41; 44535 t[896] = 91; 44536 t[897] = 93; 44537 t[923] = 64; 44538 t[1004] = 48; 44539 t[1005] = 49; 44540 t[1006] = 50; 44541 t[1007] = 51; 44542 t[1008] = 52; 44543 t[1009] = 53; 44544 t[1010] = 54; 44545 t[1011] = 55; 44546 t[1012] = 56; 44547 t[1013] = 57; 44548 t[1081] = 37; 44549 t[1085] = 43; 44550 t[1086] = 45; 44551}); 44552exports.getSupplementalGlyphMapForCalibri = getSupplementalGlyphMapForCalibri; 44553 44554/***/ }), 44555/* 179 */ 44556/***/ (function(module, exports, __w_pdfjs_require__) { 44557 44558var getLookupTableFactory = __w_pdfjs_require__(6).getLookupTableFactory;
44559var getSpecialPUASymbols = getLookupTableFactory(function (t) { 44560 t[63721] = 0x00A9; 44561 t[63193] = 0x00A9; 44562 t[63720] = 0x00AE; 44563 t[63194] = 0x00AE; 44564 t[63722] = 0x2122; 44565 t[63195] = 0x2122; 44566 t[63729] = 0x23A7; 44567 t[63730] = 0x23A8; 44568 t[63731] = 0x23A9; 44569 t[63740] = 0x23AB; 44570 t[63741] = 0x23AC; 44571 t[63742] = 0x23AD; 44572 t[63726] = 0x23A1; 44573 t[63727] = 0x23A2; 44574 t[63728] = 0x23A3; 44575 t[63737] = 0x23A4; 44576 t[63738] = 0x23A5; 44577 t[63739] = 0x23A6; 44578 t[63723] = 0x239B; 44579 t[63724] = 0x239C; 44580 t[63725] = 0x239D; 44581 t[63734] = 0x239E; 44582 t[63735] = 0x239F; 44583 t[63736] = 0x23A0; 44584}); 44585function mapSpecialUnicodeValues(code) { 44586 if (code >= 0xFFF0 && code <= 0xFFFF) { 44587 return 0; 44588 } else if (code >= 0xF600 && code <= 0xF8FF) { 44589 return getSpecialPUASymbols()[code] || code; 44590 } else if (code === 0x00AD) { 44591 return 0x002D; 44592 } 44593 return code; 44594} 44595function getUnicodeForGlyph(name, glyphsUnicodeMap) { 44596 var unicode = glyphsUnicodeMap[name]; 44597 if (unicode !== undefined) { 44598 return unicode; 44599 } 44600 if (!name) { 44601 return -1; 44602 } 44603 if (name[0] === 'u') { 44604 var nameLen = name.length, hexStr; 44605 if (nameLen === 7 && name[1] === 'n' && name[2] === 'i') { 44606 hexStr = name.substring(3); 44607 } else if (nameLen >= 5 && nameLen <= 7) { 44608 hexStr = name.substring(1); 44609 } else { 44610 return -1; 44611 } 44612 if (hexStr === hexStr.toUpperCase()) { 44613 unicode = parseInt(hexStr, 16); 44614 if (unicode >= 0) { 44615 return unicode; 44616 } 44617 } 44618 } 44619 return -1; 44620} 44621var UnicodeRanges = [ 44622 { 44623 'begin': 0x0000, 44624 'end': 0x007F 44625 }, 44626 { 44627 'begin': 0x0080, 44628 'end': 0x00FF 44629 }, 44630 { 44631 'begin': 0x0100, 44632 'end': 0x017F 44633 }, 44634 { 44635 'begin': 0x0180, 44636 'end': 0x024F 44637 }, 44638 { 44639 'begin': 0x0250, 44640 'end': 0x02AF 44641 }, 44642 { 44643 'begin': 0x02B0, 44644 'end': 0x02FF 44645 }, 44646 { 44647 'begin': 0x0300, 44648 'end': 0x036F 44649 }, 44650 { 44651 'begin': 0x0370, 44652 'end': 0x03FF 44653 }, 44654 { 44655 'begin': 0x2C80, 44656 'end': 0x2CFF 44657 }, 44658 { 44659 'begin': 0x0400, 44660 'end': 0x04FF 44661 }, 44662 { 44663 'begin': 0x0530, 44664 'end': 0x058F 44665 }, 44666 { 44667 'begin': 0x0590, 44668 'end': 0x05FF 44669 }, 44670 { 44671 'begin': 0xA500, 44672 'end': 0xA63F 44673 }, 44674 { 44675 'begin': 0x0600, 44676 'end': 0x06FF 44677 }, 44678 { 44679 'begin': 0x07C0, 44680 'end': 0x07FF 44681 }, 44682 { 44683 'begin': 0x0900, 44684 'end': 0x097F 44685 }, 44686 { 44687 'begin': 0x0980, 44688 'end': 0x09FF 44689 }, 44690 { 44691 'begin': 0x0A00, 44692 'end': 0x0A7F 44693 }, 44694 { 44695 'begin': 0x0A80, 44696 'end': 0x0AFF 44697 }, 44698 { 44699 'begin': 0x0B00, 44700 'end': 0x0B7F 44701 }, 44702 { 44703 'begin': 0x0B80, 44704 'end': 0x0BFF 44705 }, 44706 { 44707 'begin': 0x0C00, 44708 'end': 0x0C7F 44709 }, 44710 { 44711 'begin': 0x0C80, 44712 'end': 0x0CFF 44713 }, 44714 { 44715 'begin': 0x0D00, 44716 'end': 0x0D7F 44717 }, 44718 { 44719 'begin': 0x0E00, 44720 'end': 0x0E7F 44721 }, 44722 { 44723 'begin': 0x0E80, 44724 'end': 0x0EFF 44725 }, 44726 { 44727 'begin': 0x10A0, 44728 'end': 0x10FF 44729 }, 44730 { 44731 'begin': 0x1B00, 44732 'end': 0x1B7F 44733 }, 44734 { 44735 'begin': 0x1100, 44736 'end': 0x11FF 44737 }, 44738 { 44739 'begin': 0x1E00, 44740 'end': 0x1EFF 44741 }, 44742 { 44743 'begin': 0x1F00, 44744 'end': 0x1FFF 44745 }, 44746 { 44747 'begin': 0x2000, 44748 'end': 0x206F 44749 }, 44750 { 44751 'begin': 0x2070, 44752 'end': 0x209F 44753 }, 44754 { 44755 'begin': 0x20A0, 44756 'end': 0x20CF 44757 }, 44758 { 44759 'begin': 0x20D0, 44760 'end': 0x20FF 44761 }, 44762 { 44763 'begin': 0x2100, 44764 'end': 0x214F 44765 }, 44766 { 44767 'begin': 0x2150, 44768 'end': 0x218F 44769 }, 44770 { 44771 'begin': 0x2190, 44772 'end': 0x21FF 44773 }, 44774 { 44775 'begin': 0x2200, 44776 'end': 0x22FF 44777 }, 44778 { 44779 'begin': 0x2300, 44780 'end': 0x23FF 44781 }, 44782 { 44783 'begin': 0x2400, 44784 'end': 0x243F 44785 }, 44786 { 44787 'begin': 0x2440, 44788 'end': 0x245F 44789 }, 44790 { 44791 'begin': 0x2460, 44792 'end': 0x24FF 44793 }, 44794 { 44795 'begin': 0x2500, 44796 'end': 0x257F 44797 }, 44798 { 44799 'begin': 0x2580, 44800 'end': 0x259F 44801 }, 44802 { 44803 'begin': 0x25A0, 44804 'end': 0x25FF 44805 }, 44806 { 44807 'begin': 0x2600, 44808 'end': 0x26FF 44809 }, 44810 { 44811 'begin': 0x2700, 44812 'end': 0x27BF 44813 }, 44814 { 44815 'begin': 0x3000, 44816 'end': 0x303F 44817 }, 44818 { 44819 'begin': 0x3040, 44820 'end': 0x309F 44821 }, 44822 { 44823 'begin': 0x30A0, 44824 'end': 0x30FF 44825 }, 44826 { 44827 'begin': 0x3100, 44828 'end': 0x312F 44829 }, 44830 { 44831 'begin': 0x3130, 44832 'end': 0x318F 44833 }, 44834 { 44835 'begin': 0xA840, 44836 'end': 0xA87F 44837 }, 44838 { 44839 'begin': 0x3200, 44840 'end': 0x32FF 44841 }, 44842 { 44843 'begin': 0x3300, 44844 'end': 0x33FF 44845 }, 44846 { 44847 'begin': 0xAC00, 44848 'end': 0xD7AF 44849 }, 44850 { 44851 'begin': 0xD800, 44852 'end': 0xDFFF 44853 }, 44854 { 44855 'begin': 0x10900, 44856 'end': 0x1091F 44857 }, 44858 { 44859 'begin': 0x4E00, 44860 'end': 0x9FFF 44861 }, 44862 { 44863 'begin': 0xE000, 44864 'end': 0xF8FF 44865 }, 44866 { 44867 'begin': 0x31C0, 44868 'end': 0x31EF 44869 }, 44870 { 44871 'begin': 0xFB00, 44872 'end': 0xFB4F 44873 }, 44874 { 44875 'begin': 0xFB50, 44876 'end': 0xFDFF 44877 }, 44878 { 44879 'begin': 0xFE20, 44880 'end': 0xFE2F 44881 }, 44882 { 44883 'begin': 0xFE10, 44884 'end': 0xFE1F 44885 }, 44886 { 44887 'begin': 0xFE50, 44888 'end': 0xFE6F 44889 }, 44890 { 44891 'begin': 0xFE70, 44892 'end': 0xFEFF 44893 }, 44894 { 44895 'begin': 0xFF00, 44896 'end': 0xFFEF 44897 }, 44898 { 44899 'begin': 0xFFF0, 44900 'end': 0xFFFF 44901 }, 44902 { 44903 'begin': 0x0F00, 44904 'end': 0x0FFF 44905 }, 44906 { 44907 'begin': 0x0700, 44908 'end': 0x074F 44909 }, 44910 { 44911 'begin': 0x0780, 44912 'end': 0x07BF 44913 }, 44914 { 44915 'begin': 0x0D80, 44916 'end': 0x0DFF 44917 }, 44918 { 44919 'begin': 0x1000, 44920 'end': 0x109F 44921 }, 44922 { 44923 'begin': 0x1200, 44924 'end': 0x137F 44925 }, 44926 { 44927 'begin': 0x13A0, 44928 'end': 0x13FF 44929 }, 44930 { 44931 'begin': 0x1400, 44932 'end': 0x167F 44933 }, 44934 { 44935 'begin': 0x1680, 44936 'end': 0x169F 44937 }, 44938 { 44939 'begin': 0x16A0, 44940 'end': 0x16FF 44941 }, 44942 { 44943 'begin': 0x1780, 44944 'end': 0x17FF 44945 }, 44946 { 44947 'begin': 0x1800, 44948 'end': 0x18AF 44949 }, 44950 { 44951 'begin': 0x2800, 44952 'end': 0x28FF 44953 }, 44954 { 44955 'begin': 0xA000, 44956 'end': 0xA48F 44957 }, 44958 { 44959 'begin': 0x1700, 44960 'end': 0x171F 44961 }, 44962 { 44963 'begin': 0x10300, 44964 'end': 0x1032F 44965 }, 44966 { 44967 'begin': 0x10330, 44968 'end': 0x1034F 44969 }, 44970 { 44971 'begin': 0x10400, 44972 'end': 0x1044F 44973 }, 44974 { 44975 'begin': 0x1D000, 44976 'end': 0x1D0FF 44977 }, 44978 { 44979 'begin': 0x1D400, 44980 'end': 0x1D7FF 44981 }, 44982 { 44983 'begin': 0xFF000, 44984 'end': 0xFFFFD 44985 }, 44986 { 44987 'begin': 0xFE00,
44988 'end': 0xFE0F 44989 }, 44990 { 44991 'begin': 0xE0000, 44992 'end': 0xE007F 44993 }, 44994 { 44995 'begin': 0x1900, 44996 'end': 0x194F 44997 }, 44998 { 44999 'begin': 0x1950, 45000 'end': 0x197F 45001 }, 45002 { 45003 'begin': 0x1980, 45004 'end': 0x19DF 45005 }, 45006 { 45007 'begin': 0x1A00, 45008 'end': 0x1A1F 45009 }, 45010 { 45011 'begin': 0x2C00, 45012 'end': 0x2C5F 45013 }, 45014 { 45015 'begin': 0x2D30, 45016 'end': 0x2D7F 45017 }, 45018 { 45019 'begin': 0x4DC0, 45020 'end': 0x4DFF 45021 }, 45022 { 45023 'begin': 0xA800, 45024 'end': 0xA82F 45025 }, 45026 { 45027 'begin': 0x10000, 45028 'end': 0x1007F 45029 }, 45030 { 45031 'begin': 0x10140, 45032 'end': 0x1018F 45033 }, 45034 { 45035 'begin': 0x10380, 45036 'end': 0x1039F 45037 }, 45038 { 45039 'begin': 0x103A0, 45040 'end': 0x103DF 45041 }, 45042 { 45043 'begin': 0x10450, 45044 'end': 0x1047F 45045 }, 45046 { 45047 'begin': 0x10480, 45048 'end': 0x104AF 45049 }, 45050 { 45051 'begin': 0x10800, 45052 'end': 0x1083F 45053 }, 45054 { 45055 'begin': 0x10A00, 45056 'end': 0x10A5F 45057 }, 45058 { 45059 'begin': 0x1D300, 45060 'end': 0x1D35F 45061 }, 45062 { 45063 'begin': 0x12000, 45064 'end': 0x123FF 45065 }, 45066 { 45067 'begin': 0x1D360, 45068 'end': 0x1D37F 45069 }, 45070 { 45071 'begin': 0x1B80, 45072 'end': 0x1BBF 45073 }, 45074 { 45075 'begin': 0x1C00, 45076 'end': 0x1C4F 45077 }, 45078 { 45079 'begin': 0x1C50, 45080 'end': 0x1C7F 45081 }, 45082 { 45083 'begin': 0xA880, 45084 'end': 0xA8DF 45085 }, 45086 { 45087 'begin': 0xA900, 45088 'end': 0xA92F 45089 }, 45090 { 45091 'begin': 0xA930, 45092 'end': 0xA95F 45093 }, 45094 { 45095 'begin': 0xAA00, 45096 'end': 0xAA5F 45097 }, 45098 { 45099 'begin': 0x10190, 45100 'end': 0x101CF 45101 }, 45102 { 45103 'begin': 0x101D0, 45104 'end': 0x101FF 45105 }, 45106 { 45107 'begin': 0x102A0, 45108 'end': 0x102DF 45109 }, 45110 { 45111 'begin': 0x1F030, 45112 'end': 0x1F09F 45113 } 45114]; 45115function getUnicodeRangeFor(value) { 45116 for (var i = 0, ii = UnicodeRanges.length; i < ii; i++) { 45117 var range = UnicodeRanges[i]; 45118 if (value >= range.begin && value < range.end) { 45119 return i; 45120 } 45121 } 45122 return -1; 45123} 45124function isRTLRangeFor(value) { 45125 var range = UnicodeRanges[13]; 45126 if (value >= range.begin && value < range.end) { 45127 return true; 45128 } 45129 range = UnicodeRanges[11]; 45130 if (value >= range.begin && value < range.end) { 45131 return true; 45132 } 45133 return false; 45134} 45135var getNormalizedUnicodes = getLookupTableFactory(function (t) { 45136 t['\u00A8'] = '\u0020\u0308'; 45137 t['\u00AF'] = '\u0020\u0304'; 45138 t['\u00B4'] = '\u0020\u0301'; 45139 t['\u00B5'] = '\u03BC'; 45140 t['\u00B8'] = '\u0020\u0327'; 45141 t['\u0132'] = '\u0049\u004A'; 45142 t['\u0133'] = '\u0069\u006A'; 45143 t['\u013F'] = '\u004C\u00B7'; 45144 t['\u0140'] = '\u006C\u00B7'; 45145 t['\u0149'] = '\u02BC\u006E'; 45146 t['\u017F'] = '\u0073'; 45147 t['\u01C4'] = '\u0044\u017D'; 45148 t['\u01C5'] = '\u0044\u017E'; 45149 t['\u01C6'] = '\u0064\u017E'; 45150 t['\u01C7'] = '\u004C\u004A'; 45151 t['\u01C8'] = '\u004C\u006A'; 45152 t['\u01C9'] = '\u006C\u006A'; 45153 t['\u01CA'] = '\u004E\u004A'; 45154 t['\u01CB'] = '\u004E\u006A'; 45155 t['\u01CC'] = '\u006E\u006A'; 45156 t['\u01F1'] = '\u0044\u005A'; 45157 t['\u01F2'] = '\u0044\u007A'; 45158 t['\u01F3'] = '\u0064\u007A'; 45159 t['\u02D8'] = '\u0020\u0306'; 45160 t['\u02D9'] = '\u0020\u0307'; 45161 t['\u02DA'] = '\u0020\u030A'; 45162 t['\u02DB'] = '\u0020\u0328'; 45163 t['\u02DC'] = '\u0020\u0303'; 45164 t['\u02DD'] = '\u0020\u030B'; 45165 t['\u037A'] = '\u0020\u0345'; 45166 t['\u0384'] = '\u0020\u0301'; 45167 t['\u03D0'] = '\u03B2'; 45168 t['\u03D1'] = '\u03B8'; 45169 t['\u03D2'] = '\u03A5'; 45170 t['\u03D5'] = '\u03C6'; 45171 t['\u03D6'] = '\u03C0'; 45172 t['\u03F0'] = '\u03BA'; 45173 t['\u03F1'] = '\u03C1'; 45174 t['\u03F2'] = '\u03C2'; 45175 t['\u03F4'] = '\u0398'; 45176 t['\u03F5'] = '\u03B5'; 45177 t['\u03F9'] = '\u03A3'; 45178 t['\u0587'] = '\u0565\u0582'; 45179 t['\u0675'] = '\u0627\u0674'; 45180 t['\u0676'] = '\u0648\u0674'; 45181 t['\u0677'] = '\u06C7\u0674'; 45182 t['\u0678'] = '\u064A\u0674'; 45183 t['\u0E33'] = '\u0E4D\u0E32'; 45184 t['\u0EB3'] = '\u0ECD\u0EB2'; 45185 t['\u0EDC'] = '\u0EAB\u0E99'; 45186 t['\u0EDD'] = '\u0EAB\u0EA1'; 45187 t['\u0F77'] = '\u0FB2\u0F81'; 45188 t['\u0F79'] = '\u0FB3\u0F81'; 45189 t['\u1E9A'] = '\u0061\u02BE'; 45190 t['\u1FBD'] = '\u0020\u0313'; 45191 t['\u1FBF'] = '\u0020\u0313'; 45192 t['\u1FC0'] = '\u0020\u0342'; 45193 t['\u1FFE'] = '\u0020\u0314'; 45194 t['\u2002'] = '\u0020'; 45195 t['\u2003'] = '\u0020'; 45196 t['\u2004'] = '\u0020'; 45197 t['\u2005'] = '\u0020'; 45198 t['\u2006'] = '\u0020'; 45199 t['\u2008'] = '\u0020'; 45200 t['\u2009'] = '\u0020'; 45201 t['\u200A'] = '\u0020'; 45202 t['\u2017'] = '\u0020\u0333'; 45203 t['\u2024'] = '\u002E'; 45204 t['\u2025'] = '\u002E\u002E'; 45205 t['\u2026'] = '\u002E\u002E\u002E'; 45206 t['\u2033'] = '\u2032\u2032'; 45207 t['\u2034'] = '\u2032\u2032\u2032'; 45208 t['\u2036'] = '\u2035\u2035'; 45209 t['\u2037'] = '\u2035\u2035\u2035'; 45210 t['\u203C'] = '\u0021\u0021'; 45211 t['\u203E'] = '\u0020\u0305'; 45212 t['\u2047'] = '\u003F\u003F'; 45213 t['\u2048'] = '\u003F\u0021'; 45214 t['\u2049'] = '\u0021\u003F'; 45215 t['\u2057'] = '\u2032\u2032\u2032\u2032'; 45216 t['\u205F'] = '\u0020'; 45217 t['\u20A8'] = '\u0052\u0073';
45218 t['\u2100'] = '\u0061\u002F\u0063'; 45219 t['\u2101'] = '\u0061\u002F\u0073'; 45220 t['\u2103'] = '\u00B0\u0043'; 45221 t['\u2105'] = '\u0063\u002F\u006F'; 45222 t['\u2106'] = '\u0063\u002F\u0075'; 45223 t['\u2107'] = '\u0190'; 45224 t['\u2109'] = '\u00B0\u0046'; 45225 t['\u2116'] = '\u004E\u006F'; 45226 t['\u2121'] = '\u0054\u0045\u004C'; 45227 t['\u2135'] = '\u05D0'; 45228 t['\u2136'] = '\u05D1'; 45229 t['\u2137'] = '\u05D2'; 45230 t['\u2138'] = '\u05D3'; 45231 t['\u213B'] = '\u0046\u0041\u0058'; 45232 t['\u2160'] = '\u0049'; 45233 t['\u2161'] = '\u0049\u0049'; 45234 t['\u2162'] = '\u0049\u0049\u0049'; 45235 t['\u2163'] = '\u0049\u0056'; 45236 t['\u2164'] = '\u0056'; 45237 t['\u2165'] = '\u0056\u0049'; 45238 t['\u2166'] = '\u0056\u0049\u0049'; 45239 t['\u2167'] = '\u0056\u0049\u0049\u0049'; 45240 t['\u2168'] = '\u0049\u0058'; 45241 t['\u2169'] = '\u0058'; 45242 t['\u216A'] = '\u0058\u0049'; 45243 t['\u216B'] = '\u0058\u0049\u0049'; 45244 t['\u216C'] = '\u004C'; 45245 t['\u216D'] = '\u0043'; 45246 t['\u216E'] = '\u0044'; 45247 t['\u216F'] = '\u004D'; 45248 t['\u2170'] = '\u0069'; 45249 t['\u2171'] = '\u0069\u0069'; 45250 t['\u2172'] = '\u0069\u0069\u0069'; 45251 t['\u2173'] = '\u0069\u0076'; 45252 t['\u2174'] = '\u0076'; 45253 t['\u2175'] = '\u0076\u0069'; 45254 t['\u2176'] = '\u0076\u0069\u0069'; 45255 t['\u2177'] = '\u0076\u0069\u0069\u0069'; 45256 t['\u2178'] = '\u0069\u0078'; 45257 t['\u2179'] = '\u0078'; 45258 t['\u217A'] = '\u0078\u0069'; 45259 t['\u217B'] = '\u0078\u0069\u0069'; 45260 t['\u217C'] = '\u006C'; 45261 t['\u217D'] = '\u0063'; 45262 t['\u217E'] = '\u0064'; 45263 t['\u217F'] = '\u006D'; 45264 t['\u222C'] = '\u222B\u222B'; 45265 t['\u222D'] = '\u222B\u222B\u222B'; 45266 t['\u222F'] = '\u222E\u222E'; 45267 t['\u2230'] = '\u222E\u222E\u222E'; 45268 t['\u2474'] = '\u0028\u0031\u0029'; 45269 t['\u2475'] = '\u0028\u0032\u0029'; 45270 t['\u2476'] = '\u0028\u0033\u0029'; 45271 t['\u2477'] = '\u0028\u0034\u0029'; 45272 t['\u2478'] = '\u0028\u0035\u0029'; 45273 t['\u2479'] = '\u0028\u0036\u0029'; 45274 t['\u247A'] = '\u0028\u0037\u0029'; 45275 t['\u247B'] = '\u0028\u0038\u0029'; 45276 t['\u247C'] = '\u0028\u0039\u0029'; 45277 t['\u247D'] = '\u0028\u0031\u0030\u0029'; 45278 t['\u247E'] = '\u0028\u0031\u0031\u0029'; 45279 t['\u247F'] = '\u0028\u0031\u0032\u0029'; 45280 t['\u2480'] = '\u0028\u0031\u0033\u0029'; 45281 t['\u2481'] = '\u0028\u0031\u0034\u0029'; 45282 t['\u2482'] = '\u0028\u0031\u0035\u0029'; 45283 t['\u2483'] = '\u0028\u0031\u0036\u0029'; 45284 t['\u2484'] = '\u0028\u0031\u0037\u0029'; 45285 t['\u2485'] = '\u0028\u0031\u0038\u0029'; 45286 t['\u2486'] = '\u0028\u0031\u0039\u0029'; 45287 t['\u2487'] = '\u0028\u0032\u0030\u0029'; 45288 t['\u2488'] = '\u0031\u002E'; 45289 t['\u2489'] = '\u0032\u002E'; 45290 t['\u248A'] = '\u0033\u002E'; 45291 t['\u248B'] = '\u0034\u002E'; 45292 t['\u248C'] = '\u0035\u002E'; 45293 t['\u248D'] = '\u0036\u002E'; 45294 t['\u248E'] = '\u0037\u002E'; 45295 t['\u248F'] = '\u0038\u002E'; 45296 t['\u2490'] = '\u0039\u002E'; 45297 t['\u2491'] = '\u0031\u0030\u002E'; 45298 t['\u2492'] = '\u0031\u0031\u002E'; 45299 t['\u2493'] = '\u0031\u0032\u002E'; 45300 t['\u2494'] = '\u0031\u0033\u002E'; 45301 t['\u2495'] = '\u0031\u0034\u002E'; 45302 t['\u2496'] = '\u0031\u0035\u002E'; 45303 t['\u2497'] = '\u0031\u0036\u002E'; 45304 t['\u2498'] = '\u0031\u0037\u002E'; 45305 t['\u2499'] = '\u0031\u0038\u002E'; 45306 t['\u249A'] = '\u0031\u0039\u002E'; 45307 t['\u249B'] = '\u0032\u0030\u002E'; 45308 t['\u249C'] = '\u0028\u0061\u0029'; 45309 t['\u249D'] = '\u0028\u0062\u0029'; 45310 t['\u249E'] = '\u0028\u0063\u0029'; 45311 t['\u249F'] = '\u0028\u0064\u0029'; 45312 t['\u24A0'] = '\u0028\u0065\u0029'; 45313 t['\u24A1'] = '\u0028\u0066\u0029'; 45314 t['\u24A2'] = '\u0028\u0067\u0029'; 45315 t['\u24A3'] = '\u0028\u0068\u0029'; 45316 t['\u24A4'] = '\u0028\u0069\u0029'; 45317 t['\u24A5'] = '\u0028\u006A\u0029'; 45318 t['\u24A6'] = '\u0028\u006B\u0029'; 45319 t['\u24A7'] = '\u0028\u006C\u0029'; 45320 t['\u24A8'] = '\u0028\u006D\u0029'; 45321 t['\u24A9'] = '\u0028\u006E\u0029'; 45322 t['\u24AA'] = '\u0028\u006F\u0029'; 45323 t['\u24AB'] = '\u0028\u0070\u0029'; 45324 t['\u24AC'] = '\u0028\u0071\u0029'; 45325 t['\u24AD'] = '\u0028\u0072\u0029'; 45326 t['\u24AE'] = '\u0028\u0073\u0029'; 45327 t['\u24AF'] = '\u0028\u0074\u0029'; 45328 t['\u24B0'] = '\u0028\u0075\u0029'; 45329 t['\u24B1'] = '\u0028\u0076\u0029'; 45330 t['\u24B2'] = '\u0028\u0077\u0029'; 45331 t['\u24B3'] = '\u0028\u0078\u0029'; 45332 t['\u24B4'] = '\u0028\u0079\u0029'; 45333 t['\u24B5'] = '\u0028\u007A\u0029'; 45334 t['\u2A0C'] = '\u222B\u222B\u222B\u222B'; 45335 t['\u2A74'] = '\u003A\u003A\u003D'; 45336 t['\u2A75'] = '\u003D\u003D'; 45337 t['\u2A76'] = '\u003D\u003D\u003D'; 45338 t['\u2E9F'] = '\u6BCD'; 45339 t['\u2EF3'] = '\u9F9F'; 45340 t['\u2F00'] = '\u4E00'; 45341 t['\u2F01'] = '\u4E28'; 45342 t['\u2F02'] = '\u4E36'; 45343 t['\u2F03'] = '\u4E3F'; 45344 t['\u2F04'] = '\u4E59'; 45345 t['\u2F05'] = '\u4E85'; 45346 t['\u2F06'] = '\u4E8C'; 45347 t['\u2F07'] = '\u4EA0'; 45348 t['\u2F08'] = '\u4EBA'; 45349 t['\u2F09'] = '\u513F'; 45350 t['\u2F0A'] = '\u5165'; 45351 t['\u2F0B'] = '\u516B';
45352 t['\u2F0C'] = '\u5182'; 45353 t['\u2F0D'] = '\u5196'; 45354 t['\u2F0E'] = '\u51AB'; 45355 t['\u2F0F'] = '\u51E0'; 45356 t['\u2F10'] = '\u51F5'; 45357 t['\u2F11'] = '\u5200'; 45358 t['\u2F12'] = '\u529B'; 45359 t['\u2F13'] = '\u52F9'; 45360 t['\u2F14'] = '\u5315'; 45361 t['\u2F15'] = '\u531A'; 45362 t['\u2F16'] = '\u5338'; 45363 t['\u2F17'] = '\u5341'; 45364 t['\u2F18'] = '\u535C'; 45365 t['\u2F19'] = '\u5369'; 45366 t['\u2F1A'] = '\u5382'; 45367 t['\u2F1B'] = '\u53B6'; 45368 t['\u2F1C'] = '\u53C8'; 45369 t['\u2F1D'] = '\u53E3'; 45370 t['\u2F1E'] = '\u56D7'; 45371 t['\u2F1F'] = '\u571F'; 45372 t['\u2F20'] = '\u58EB'; 45373 t['\u2F21'] = '\u5902'; 45374 t['\u2F22'] = '\u590A'; 45375 t['\u2F23'] = '\u5915'; 45376 t['\u2F24'] = '\u5927'; 45377 t['\u2F25'] = '\u5973'; 45378 t['\u2F26'] = '\u5B50'; 45379 t['\u2F27'] = '\u5B80'; 45380 t['\u2F28'] = '\u5BF8'; 45381 t['\u2F29'] = '\u5C0F'; 45382 t['\u2F2A'] = '\u5C22'; 45383 t['\u2F2B'] = '\u5C38'; 45384 t['\u2F2C'] = '\u5C6E'; 45385 t['\u2F2D'] = '\u5C71'; 45386 t['\u2F2E'] = '\u5DDB'; 45387 t['\u2F2F'] = '\u5DE5'; 45388 t['\u2F30'] = '\u5DF1'; 45389 t['\u2F31'] = '\u5DFE'; 45390 t['\u2F32'] = '\u5E72'; 45391 t['\u2F33'] = '\u5E7A'; 45392 t['\u2F34'] = '\u5E7F'; 45393 t['\u2F35'] = '\u5EF4'; 45394 t['\u2F36'] = '\u5EFE'; 45395 t['\u2F37'] = '\u5F0B'; 45396 t['\u2F38'] = '\u5F13'; 45397 t['\u2F39'] = '\u5F50'; 45398 t['\u2F3A'] = '\u5F61'; 45399 t['\u2F3B'] = '\u5F73'; 45400 t['\u2F3C'] = '\u5FC3'; 45401 t['\u2F3D'] = '\u6208'; 45402 t['\u2F3E'] = '\u6236'; 45403 t['\u2F3F'] = '\u624B'; 45404 t['\u2F40'] = '\u652F'; 45405 t['\u2F41'] = '\u6534'; 45406 t['\u2F42'] = '\u6587'; 45407 t['\u2F43'] = '\u6597'; 45408 t['\u2F44'] = '\u65A4'; 45409 t['\u2F45'] = '\u65B9'; 45410 t['\u2F46'] = '\u65E0'; 45411 t['\u2F47'] = '\u65E5'; 45412 t['\u2F48'] = '\u66F0'; 45413 t['\u2F49'] = '\u6708'; 45414 t['\u2F4A'] = '\u6728'; 45415 t['\u2F4B'] = '\u6B20'; 45416 t['\u2F4C'] = '\u6B62'; 45417 t['\u2F4D'] = '\u6B79'; 45418 t['\u2F4E'] = '\u6BB3'; 45419 t['\u2F4F'] = '\u6BCB'; 45420 t['\u2F50'] = '\u6BD4'; 45421 t['\u2F51'] = '\u6BDB'; 45422 t['\u2F52'] = '\u6C0F'; 45423 t['\u2F53'] = '\u6C14'; 45424 t['\u2F54'] = '\u6C34'; 45425 t['\u2F55'] = '\u706B'; 45426 t['\u2F56'] = '\u722A'; 45427 t['\u2F57'] = '\u7236'; 45428 t['\u2F58'] = '\u723B'; 45429 t['\u2F59'] = '\u723F'; 45430 t['\u2F5A'] = '\u7247'; 45431 t['\u2F5B'] = '\u7259'; 45432 t['\u2F5C'] = '\u725B'; 45433 t['\u2F5D'] = '\u72AC'; 45434 t['\u2F5E'] = '\u7384'; 45435 t['\u2F5F'] = '\u7389'; 45436 t['\u2F60'] = '\u74DC'; 45437 t['\u2F61'] = '\u74E6'; 45438 t['\u2F62'] = '\u7518'; 45439 t['\u2F63'] = '\u751F'; 45440 t['\u2F64'] = '\u7528'; 45441 t['\u2F65'] = '\u7530'; 45442 t['\u2F66'] = '\u758B'; 45443 t['\u2F67'] = '\u7592'; 45444 t['\u2F68'] = '\u7676'; 45445 t['\u2F69'] = '\u767D'; 45446 t['\u2F6A'] = '\u76AE'; 45447 t['\u2F6B'] = '\u76BF'; 45448 t['\u2F6C'] = '\u76EE'; 45449 t['\u2F6D'] = '\u77DB'; 45450 t['\u2F6E'] = '\u77E2'; 45451 t['\u2F6F'] = '\u77F3'; 45452 t['\u2F70'] = '\u793A'; 45453 t['\u2F71'] = '\u79B8'; 45454 t['\u2F72'] = '\u79BE'; 45455 t['\u2F73'] = '\u7A74'; 45456 t['\u2F74'] = '\u7ACB'; 45457 t['\u2F75'] = '\u7AF9'; 45458 t['\u2F76'] = '\u7C73'; 45459 t['\u2F77'] = '\u7CF8'; 45460 t['\u2F78'] = '\u7F36'; 45461 t['\u2F79'] = '\u7F51'; 45462 t['\u2F7A'] = '\u7F8A'; 45463 t['\u2F7B'] = '\u7FBD'; 45464 t['\u2F7C'] = '\u8001'; 45465 t['\u2F7D'] = '\u800C'; 45466 t['\u2F7E'] = '\u8012'; 45467 t['\u2F7F'] = '\u8033'; 45468 t['\u2F80'] = '\u807F'; 45469 t['\u2F81'] = '\u8089'; 45470 t['\u2F82'] = '\u81E3'; 45471 t['\u2F83'] = '\u81EA'; 45472 t['\u2F84'] = '\u81F3'; 45473 t['\u2F85'] = '\u81FC'; 45474 t['\u2F86'] = '\u820C'; 45475 t['\u2F87'] = '\u821B'; 45476 t['\u2F88'] = '\u821F'; 45477 t['\u2F89'] = '\u826E'; 45478 t['\u2F8A'] = '\u8272'; 45479 t['\u2F8B'] = '\u8278'; 45480 t['\u2F8C'] = '\u864D'; 45481 t['\u2F8D'] = '\u866B'; 45482 t['\u2F8E'] = '\u8840'; 45483 t['\u2F8F'] = '\u884C'; 45484 t['\u2F90'] = '\u8863'; 45485 t['\u2F91'] = '\u897E'; 45486 t['\u2F92'] = '\u898B'; 45487 t['\u2F93'] = '\u89D2'; 45488 t['\u2F94'] = '\u8A00'; 45489 t['\u2F95'] = '\u8C37'; 45490 t['\u2F96'] = '\u8C46'; 45491 t['\u2F97'] = '\u8C55'; 45492 t['\u2F98'] = '\u8C78'; 45493 t['\u2F99'] = '\u8C9D'; 45494 t['\u2F9A'] = '\u8D64'; 45495 t['\u2F9B'] = '\u8D70'; 45496 t['\u2F9C'] = '\u8DB3'; 45497 t['\u2F9D'] = '\u8EAB'; 45498 t['\u2F9E'] = '\u8ECA'; 45499 t['\u2F9F'] = '\u8F9B'; 45500 t['\u2FA0'] = '\u8FB0'; 45501 t['\u2FA1'] = '\u8FB5'; 45502 t['\u2FA2'] = '\u9091'; 45503 t['\u2FA3'] = '\u9149'; 45504 t['\u2FA4'] = '\u91C6'; 45505 t['\u2FA5'] = '\u91CC'; 45506 t['\u2FA6'] = '\u91D1'; 45507 t['\u2FA7'] = '\u9577'; 45508 t['\u2FA8'] = '\u9580'; 45509 t['\u2FA9'] = '\u961C'; 45510 t['\u2FAA'] = '\u96B6'; 45511 t['\u2FAB'] = '\u96B9'; 45512 t['\u2FAC'] = '\u96E8'; 45513 t['\u2FAD'] = '\u9751'; 45514 t['\u2FAE'] = '\u975E'; 45515 t['\u2FAF'] = '\u9762'; 45516 t['\u2FB0'] = '\u9769'; 45517 t['\u2FB1'] = '\u97CB'; 45518 t['\u2FB2'] = '\u97ED'; 45519 t['\u2FB3'] = '\u97F3'; 45520 t['\u2FB4'] = '\u9801'; 45521 t['\u2FB5'] = '\u98A8'; 45522 t['\u2FB6'] = '\u98DB'; 45523 t['\u2FB7'] = '\u98DF'; 45524 t['\u2FB8'] = '\u9996'; 45525 t['\u2FB9'] = '\u9999'; 45526 t['\u2FBA'] = '\u99AC'; 45527 t['\u2FBB'] = '\u9AA8'; 45528 t['\u2FBC'] = '\u9AD8'; 45529 t['\u2FBD'] = '\u9ADF'; 45530 t['\u2FBE'] = '\u9B25'; 45531 t['\u2FBF'] = '\u9B2F'; 45532 t['\u2FC0'] = '\u9B32'; 45533 t['\u2FC1'] = '\u9B3C';
45534 t['\u2FC2'] = '\u9B5A'; 45535 t['\u2FC3'] = '\u9CE5'; 45536 t['\u2FC4'] = '\u9E75'; 45537 t['\u2FC5'] = '\u9E7F'; 45538 t['\u2FC6'] = '\u9EA5'; 45539 t['\u2FC7'] = '\u9EBB'; 45540 t['\u2FC8'] = '\u9EC3'; 45541 t['\u2FC9'] = '\u9ECD'; 45542 t['\u2FCA'] = '\u9ED1'; 45543 t['\u2FCB'] = '\u9EF9'; 45544 t['\u2FCC'] = '\u9EFD'; 45545 t['\u2FCD'] = '\u9F0E'; 45546 t['\u2FCE'] = '\u9F13'; 45547 t['\u2FCF'] = '\u9F20'; 45548 t['\u2FD0'] = '\u9F3B'; 45549 t['\u2FD1'] = '\u9F4A'; 45550 t['\u2FD2'] = '\u9F52'; 45551 t['\u2FD3'] = '\u9F8D'; 45552 t['\u2FD4'] = '\u9F9C'; 45553 t['\u2FD5'] = '\u9FA0'; 45554 t['\u3036'] = '\u3012'; 45555 t['\u3038'] = '\u5341'; 45556 t['\u3039'] = '\u5344'; 45557 t['\u303A'] = '\u5345'; 45558 t['\u309B'] = '\u0020\u3099'; 45559 t['\u309C'] = '\u0020\u309A'; 45560 t['\u3131'] = '\u1100'; 45561 t['\u3132'] = '\u1101'; 45562 t['\u3133'] = '\u11AA'; 45563 t['\u3134'] = '\u1102'; 45564 t['\u3135'] = '\u11AC'; 45565 t['\u3136'] = '\u11AD'; 45566 t['\u3137'] = '\u1103'; 45567 t['\u3138'] = '\u1104'; 45568 t['\u3139'] = '\u1105'; 45569 t['\u313A'] = '\u11B0'; 45570 t['\u313B'] = '\u11B1'; 45571 t['\u313C'] = '\u11B2'; 45572 t['\u313D'] = '\u11B3'; 45573 t['\u313E'] = '\u11B4'; 45574 t['\u313F'] = '\u11B5'; 45575 t['\u3140'] = '\u111A'; 45576 t['\u3141'] = '\u1106'; 45577 t['\u3142'] = '\u1107'; 45578 t['\u3143'] = '\u1108'; 45579 t['\u3144'] = '\u1121'; 45580 t['\u3145'] = '\u1109'; 45581 t['\u3146'] = '\u110A'; 45582 t['\u3147'] = '\u110B'; 45583 t['\u3148'] = '\u110C'; 45584 t['\u3149'] = '\u110D'; 45585 t['\u314A'] = '\u110E'; 45586 t['\u314B'] = '\u110F'; 45587 t['\u314C'] = '\u1110'; 45588 t['\u314D'] = '\u1111'; 45589 t['\u314E'] = '\u1112'; 45590 t['\u314F'] = '\u1161'; 45591 t['\u3150'] = '\u1162'; 45592 t['\u3151'] = '\u1163'; 45593 t['\u3152'] = '\u1164'; 45594 t['\u3153'] = '\u1165'; 45595 t['\u3154'] = '\u1166'; 45596 t['\u3155'] = '\u1167'; 45597 t['\u3156'] = '\u1168'; 45598 t['\u3157'] = '\u1169'; 45599 t['\u3158'] = '\u116A'; 45600 t['\u3159'] = '\u116B'; 45601 t['\u315A'] = '\u116C'; 45602 t['\u315B'] = '\u116D'; 45603 t['\u315C'] = '\u116E'; 45604 t['\u315D'] = '\u116F'; 45605 t['\u315E'] = '\u1170'; 45606 t['\u315F'] = '\u1171'; 45607 t['\u3160'] = '\u1172'; 45608 t['\u3161'] = '\u1173'; 45609 t['\u3162'] = '\u1174'; 45610 t['\u3163'] = '\u1175'; 45611 t['\u3164'] = '\u1160'; 45612 t['\u3165'] = '\u1114'; 45613 t['\u3166'] = '\u1115'; 45614 t['\u3167'] = '\u11C7'; 45615 t['\u3168'] = '\u11C8'; 45616 t['\u3169'] = '\u11CC'; 45617 t['\u316A'] = '\u11CE'; 45618 t['\u316B'] = '\u11D3'; 45619 t['\u316C'] = '\u11D7'; 45620 t['\u316D'] = '\u11D9'; 45621 t['\u316E'] = '\u111C'; 45622 t['\u316F'] = '\u11DD'; 45623 t['\u3170'] = '\u11DF'; 45624 t['\u3171'] = '\u111D'; 45625 t['\u3172'] = '\u111E'; 45626 t['\u3173'] = '\u1120'; 45627 t['\u3174'] = '\u1122'; 45628 t['\u3175'] = '\u1123'; 45629 t['\u3176'] = '\u1127'; 45630 t['\u3177'] = '\u1129'; 45631 t['\u3178'] = '\u112B'; 45632 t['\u3179'] = '\u112C'; 45633 t['\u317A'] = '\u112D'; 45634 t['\u317B'] = '\u112E'; 45635 t['\u317C'] = '\u112F'; 45636 t['\u317D'] = '\u1132'; 45637 t['\u317E'] = '\u1136'; 45638 t['\u317F'] = '\u1140'; 45639 t['\u3180'] = '\u1147'; 45640 t['\u3181'] = '\u114C'; 45641 t['\u3182'] = '\u11F1'; 45642 t['\u3183'] = '\u11F2'; 45643 t['\u3184'] = '\u1157'; 45644 t['\u3185'] = '\u1158'; 45645 t['\u3186'] = '\u1159'; 45646 t['\u3187'] = '\u1184'; 45647 t['\u3188'] = '\u1185'; 45648 t['\u3189'] = '\u1188'; 45649 t['\u318A'] = '\u1191'; 45650 t['\u318B'] = '\u1192'; 45651 t['\u318C'] = '\u1194'; 45652 t['\u318D'] = '\u119E'; 45653 t['\u318E'] = '\u11A1'; 45654 t['\u3200'] = '\u0028\u1100\u0029'; 45655 t['\u3201'] = '\u0028\u1102\u0029'; 45656 t['\u3202'] = '\u0028\u1103\u0029'; 45657 t['\u3203'] = '\u0028\u1105\u0029'; 45658 t['\u3204'] = '\u0028\u1106\u0029'; 45659 t['\u3205'] = '\u0028\u1107\u0029'; 45660 t['\u3206'] = '\u0028\u1109\u0029'; 45661 t['\u3207'] = '\u0028\u110B\u0029'; 45662 t['\u3208'] = '\u0028\u110C\u0029'; 45663 t['\u3209'] = '\u0028\u110E\u0029'; 45664 t['\u320A'] = '\u0028\u110F\u0029'; 45665 t['\u320B'] = '\u0028\u1110\u0029'; 45666 t['\u320C'] = '\u0028\u1111\u0029'; 45667 t['\u320D'] = '\u0028\u1112\u0029'; 45668 t['\u320E'] = '\u0028\u1100\u1161\u0029'; 45669 t['\u320F'] = '\u0028\u1102\u1161\u0029'; 45670 t['\u3210'] = '\u0028\u1103\u1161\u0029'; 45671 t['\u3211'] = '\u0028\u1105\u1161\u0029'; 45672 t['\u3212'] = '\u0028\u1106\u1161\u0029'; 45673 t['\u3213'] = '\u0028\u1107\u1161\u0029'; 45674 t['\u3214'] = '\u0028\u1109\u1161\u0029'; 45675 t['\u3215'] = '\u0028\u110B\u1161\u0029'; 45676 t['\u3216'] = '\u0028\u110C\u1161\u0029'; 45677 t['\u3217'] = '\u0028\u110E\u1161\u0029'; 45678 t['\u3218'] = '\u0028\u110F\u1161\u0029'; 45679 t['\u3219'] = '\u0028\u1110\u1161\u0029'; 45680 t['\u321A'] = '\u0028\u1111\u1161\u0029'; 45681 t['\u321B'] = '\u0028\u1112\u1161\u0029'; 45682 t['\u321C'] = '\u0028\u110C\u116E\u0029'; 45683 t['\u321D'] = '\u0028\u110B\u1169\u110C\u1165\u11AB\u0029'; 45684 t['\u321E'] = '\u0028\u110B\u1169\u1112\u116E\u0029'; 45685 t['\u3220'] = '\u0028\u4E00\u0029'; 45686 t['\u3221'] = '\u0028\u4E8C\u0029'; 45687 t['\u3222'] = '\u0028\u4E09\u0029'; 45688 t['\u3223'] = '\u0028\u56DB\u0029'; 45689 t['\u3224'] = '\u0028\u4E94\u0029'; 45690 t['\u3225'] = '\u0028\u516D\u0029'; 45691 t['\u3226'] = '\u0028\u4E03\u0029'; 45692 t['\u3227'] = '\u0028\u516B\u0029'; 45693 t['\u3228'] = '\u0028\u4E5D\u0029'; 45694 t['\u3229'] = '\u0028\u5341\u0029'; 45695 t['\u322A'] = '\u0028\u6708\u0029'; 45696 t['\u322B'] = '\u0028\u706B\u0029'; 45697 t['\u322C'] = '\u0028\u6C34\u0029'; 45698 t['\u322D'] = '\u0028\u6728\u0029'; 45699 t['\u322E'] = '\u0028\u91D1\u0029';
45700 t['\u322F'] = '\u0028\u571F\u0029'; 45701 t['\u3230'] = '\u0028\u65E5\u0029'; 45702 t['\u3231'] = '\u0028\u682A\u0029'; 45703 t['\u3232'] = '\u0028\u6709\u0029'; 45704 t['\u3233'] = '\u0028\u793E\u0029'; 45705 t['\u3234'] = '\u0028\u540D\u0029'; 45706 t['\u3235'] = '\u0028\u7279\u0029'; 45707 t['\u3236'] = '\u0028\u8CA1\u0029'; 45708 t['\u3237'] = '\u0028\u795D\u0029'; 45709 t['\u3238'] = '\u0028\u52B4\u0029'; 45710 t['\u3239'] = '\u0028\u4EE3\u0029'; 45711 t['\u323A'] = '\u0028\u547C\u0029'; 45712 t['\u323B'] = '\u0028\u5B66\u0029'; 45713 t['\u323C'] = '\u0028\u76E3\u0029'; 45714 t['\u323D'] = '\u0028\u4F01\u0029'; 45715 t['\u323E'] = '\u0028\u8CC7\u0029'; 45716 t['\u323F'] = '\u0028\u5354\u0029'; 45717 t['\u3240'] = '\u0028\u796D\u0029'; 45718 t['\u3241'] = '\u0028\u4F11\u0029'; 45719 t['\u3242'] = '\u0028\u81EA\u0029'; 45720 t['\u3243'] = '\u0028\u81F3\u0029'; 45721 t['\u32C0'] = '\u0031\u6708'; 45722 t['\u32C1'] = '\u0032\u6708'; 45723 t['\u32C2'] = '\u0033\u6708'; 45724 t['\u32C3'] = '\u0034\u6708'; 45725 t['\u32C4'] = '\u0035\u6708'; 45726 t['\u32C5'] = '\u0036\u6708'; 45727 t['\u32C6'] = '\u0037\u6708'; 45728 t['\u32C7'] = '\u0038\u6708'; 45729 t['\u32C8'] = '\u0039\u6708'; 45730 t['\u32C9'] = '\u0031\u0030\u6708'; 45731 t['\u32CA'] = '\u0031\u0031\u6708'; 45732 t['\u32CB'] = '\u0031\u0032\u6708'; 45733 t['\u3358'] = '\u0030\u70B9'; 45734 t['\u3359'] = '\u0031\u70B9'; 45735 t['\u335A'] = '\u0032\u70B9'; 45736 t['\u335B'] = '\u0033\u70B9'; 45737 t['\u335C'] = '\u0034\u70B9'; 45738 t['\u335D'] = '\u0035\u70B9'; 45739 t['\u335E'] = '\u0036\u70B9'; 45740 t['\u335F'] = '\u0037\u70B9'; 45741 t['\u3360'] = '\u0038\u70B9'; 45742 t['\u3361'] = '\u0039\u70B9'; 45743 t['\u3362'] = '\u0031\u0030\u70B9'; 45744 t['\u3363'] = '\u0031\u0031\u70B9'; 45745 t['\u3364'] = '\u0031\u0032\u70B9'; 45746 t['\u3365'] = '\u0031\u0033\u70B9'; 45747 t['\u3366'] = '\u0031\u0034\u70B9'; 45748 t['\u3367'] = '\u0031\u0035\u70B9'; 45749 t['\u3368'] = '\u0031\u0036\u70B9'; 45750 t['\u3369'] = '\u0031\u0037\u70B9'; 45751 t['\u336A'] = '\u0031\u0038\u70B9'; 45752 t['\u336B'] = '\u0031\u0039\u70B9'; 45753 t['\u336C'] = '\u0032\u0030\u70B9'; 45754 t['\u336D'] = '\u0032\u0031\u70B9'; 45755 t['\u336E'] = '\u0032\u0032\u70B9'; 45756 t['\u336F'] = '\u0032\u0033\u70B9'; 45757 t['\u3370'] = '\u0032\u0034\u70B9'; 45758 t['\u33E0'] = '\u0031\u65E5'; 45759 t['\u33E1'] = '\u0032\u65E5'; 45760 t['\u33E2'] = '\u0033\u65E5'; 45761 t['\u33E3'] = '\u0034\u65E5'; 45762 t['\u33E4'] = '\u0035\u65E5'; 45763 t['\u33E5'] = '\u0036\u65E5'; 45764 t['\u33E6'] = '\u0037\u65E5'; 45765 t['\u33E7'] = '\u0038\u65E5'; 45766 t['\u33E8'] = '\u0039\u65E5'; 45767 t['\u33E9'] = '\u0031\u0030\u65E5'; 45768 t['\u33EA'] = '\u0031\u0031\u65E5'; 45769 t['\u33EB'] = '\u0031\u0032\u65E5'; 45770 t['\u33EC'] = '\u0031\u0033\u65E5'; 45771 t['\u33ED'] = '\u0031\u0034\u65E5'; 45772 t['\u33EE'] = '\u0031\u0035\u65E5'; 45773 t['\u33EF'] = '\u0031\u0036\u65E5'; 45774 t['\u33F0'] = '\u0031\u0037\u65E5'; 45775 t['\u33F1'] = '\u0031\u0038\u65E5'; 45776 t['\u33F2'] = '\u0031\u0039\u65E5'; 45777 t['\u33F3'] = '\u0032\u0030\u65E5'; 45778 t['\u33F4'] = '\u0032\u0031\u65E5'; 45779 t['\u33F5'] = '\u0032\u0032\u65E5'; 45780 t['\u33F6'] = '\u0032\u0033\u65E5'; 45781 t['\u33F7'] = '\u0032\u0034\u65E5'; 45782 t['\u33F8'] = '\u0032\u0035\u65E5'; 45783 t['\u33F9'] = '\u0032\u0036\u65E5'; 45784 t['\u33FA'] = '\u0032\u0037\u65E5'; 45785 t['\u33FB'] = '\u0032\u0038\u65E5'; 45786 t['\u33FC'] = '\u0032\u0039\u65E5'; 45787 t['\u33FD'] = '\u0033\u0030\u65E5'; 45788 t['\u33FE'] = '\u0033\u0031\u65E5'; 45789 t['\uFB00'] = '\u0066\u0066'; 45790 t['\uFB01'] = '\u0066\u0069'; 45791 t['\uFB02'] = '\u0066\u006C'; 45792 t['\uFB03'] = '\u0066\u0066\u0069'; 45793 t['\uFB04'] = '\u0066\u0066\u006C'; 45794 t['\uFB05'] = '\u017F\u0074'; 45795 t['\uFB06'] = '\u0073\u0074'; 45796 t['\uFB13'] = '\u0574\u0576'; 45797 t['\uFB14'] = '\u0574\u0565'; 45798 t['\uFB15'] = '\u0574\u056B'; 45799 t['\uFB16'] = '\u057E\u0576'; 45800 t['\uFB17'] = '\u0574\u056D'; 45801 t['\uFB4F'] = '\u05D0\u05DC'; 45802 t['\uFB50'] = '\u0671'; 45803 t['\uFB51'] = '\u0671'; 45804 t['\uFB52'] = '\u067B'; 45805 t['\uFB53'] = '\u067B'; 45806 t['\uFB54'] = '\u067B'; 45807 t['\uFB55'] = '\u067B'; 45808 t['\uFB56'] = '\u067E'; 45809 t['\uFB57'] = '\u067E'; 45810 t['\uFB58'] = '\u067E'; 45811 t['\uFB59'] = '\u067E'; 45812 t['\uFB5A'] = '\u0680'; 45813 t['\uFB5B'] = '\u0680'; 45814 t['\uFB5C'] = '\u0680'; 45815 t['\uFB5D'] = '\u0680'; 45816 t['\uFB5E'] = '\u067A'; 45817 t['\uFB5F'] = '\u067A'; 45818 t['\uFB60'] = '\u067A';
45819 t['\uFB61'] = '\u067A'; 45820 t['\uFB62'] = '\u067F'; 45821 t['\uFB63'] = '\u067F'; 45822 t['\uFB64'] = '\u067F'; 45823 t['\uFB65'] = '\u067F'; 45824 t['\uFB66'] = '\u0679'; 45825 t['\uFB67'] = '\u0679'; 45826 t['\uFB68'] = '\u0679'; 45827 t['\uFB69'] = '\u0679'; 45828 t['\uFB6A'] = '\u06A4'; 45829 t['\uFB6B'] = '\u06A4'; 45830 t['\uFB6C'] = '\u06A4'; 45831 t['\uFB6D'] = '\u06A4'; 45832 t['\uFB6E'] = '\u06A6'; 45833 t['\uFB6F'] = '\u06A6'; 45834 t['\uFB70'] = '\u06A6'; 45835 t['\uFB71'] = '\u06A6'; 45836 t['\uFB72'] = '\u0684'; 45837 t['\uFB73'] = '\u0684'; 45838 t['\uFB74'] = '\u0684'; 45839 t['\uFB75'] = '\u0684'; 45840 t['\uFB76'] = '\u0683'; 45841 t['\uFB77'] = '\u0683'; 45842 t['\uFB78'] = '\u0683'; 45843 t['\uFB79'] = '\u0683'; 45844 t['\uFB7A'] = '\u0686'; 45845 t['\uFB7B'] = '\u0686'; 45846 t['\uFB7C'] = '\u0686'; 45847 t['\uFB7D'] = '\u0686'; 45848 t['\uFB7E'] = '\u0687'; 45849 t['\uFB7F'] = '\u0687'; 45850 t['\uFB80'] = '\u0687'; 45851 t['\uFB81'] = '\u0687'; 45852 t['\uFB82'] = '\u068D'; 45853 t['\uFB83'] = '\u068D'; 45854 t['\uFB84'] = '\u068C'; 45855 t['\uFB85'] = '\u068C'; 45856 t['\uFB86'] = '\u068E'; 45857 t['\uFB87'] = '\u068E'; 45858 t['\uFB88'] = '\u0688'; 45859 t['\uFB89'] = '\u0688'; 45860 t['\uFB8A'] = '\u0698'; 45861 t['\uFB8B'] = '\u0698'; 45862 t['\uFB8C'] = '\u0691'; 45863 t['\uFB8D'] = '\u0691'; 45864 t['\uFB8E'] = '\u06A9'; 45865 t['\uFB8F'] = '\u06A9'; 45866 t['\uFB90'] = '\u06A9'; 45867 t['\uFB91'] = '\u06A9'; 45868 t['\uFB92'] = '\u06AF'; 45869 t['\uFB93'] = '\u06AF'; 45870 t['\uFB94'] = '\u06AF'; 45871 t['\uFB95'] = '\u06AF'; 45872 t['\uFB96'] = '\u06B3'; 45873 t['\uFB97'] = '\u06B3'; 45874 t['\uFB98'] = '\u06B3'; 45875 t['\uFB99'] = '\u06B3'; 45876 t['\uFB9A'] = '\u06B1'; 45877 t['\uFB9B'] = '\u06B1'; 45878 t['\uFB9C'] = '\u06B1'; 45879 t['\uFB9D'] = '\u06B1'; 45880 t['\uFB9E'] = '\u06BA'; 45881 t['\uFB9F'] = '\u06BA'; 45882 t['\uFBA0'] = '\u06BB'; 45883 t['\uFBA1'] = '\u06BB'; 45884 t['\uFBA2'] = '\u06BB'; 45885 t['\uFBA3'] = '\u06BB'; 45886 t['\uFBA4'] = '\u06C0'; 45887 t['\uFBA5'] = '\u06C0'; 45888 t['\uFBA6'] = '\u06C1'; 45889 t['\uFBA7'] = '\u06C1'; 45890 t['\uFBA8'] = '\u06C1'; 45891 t['\uFBA9'] = '\u06C1'; 45892 t['\uFBAA'] = '\u06BE'; 45893 t['\uFBAB'] = '\u06BE'; 45894 t['\uFBAC'] = '\u06BE'; 45895 t['\uFBAD'] = '\u06BE'; 45896 t['\uFBAE'] = '\u06D2'; 45897 t['\uFBAF'] = '\u06D2'; 45898 t['\uFBB0'] = '\u06D3'; 45899 t['\uFBB1'] = '\u06D3'; 45900 t['\uFBD3'] = '\u06AD'; 45901 t['\uFBD4'] = '\u06AD'; 45902 t['\uFBD5'] = '\u06AD'; 45903 t['\uFBD6'] = '\u06AD'; 45904 t['\uFBD7'] = '\u06C7'; 45905 t['\uFBD8'] = '\u06C7'; 45906 t['\uFBD9'] = '\u06C6'; 45907 t['\uFBDA'] = '\u06C6'; 45908 t['\uFBDB'] = '\u06C8'; 45909 t['\uFBDC'] = '\u06C8'; 45910 t['\uFBDD'] = '\u0677'; 45911 t['\uFBDE'] = '\u06CB'; 45912 t['\uFBDF'] = '\u06CB'; 45913 t['\uFBE0'] = '\u06C5'; 45914 t['\uFBE1'] = '\u06C5'; 45915 t['\uFBE2'] = '\u06C9'; 45916 t['\uFBE3'] = '\u06C9'; 45917 t['\uFBE4'] = '\u06D0'; 45918 t['\uFBE5'] = '\u06D0'; 45919 t['\uFBE6'] = '\u06D0'; 45920 t['\uFBE7'] = '\u06D0'; 45921 t['\uFBE8'] = '\u0649'; 45922 t['\uFBE9'] = '\u0649'; 45923 t['\uFBEA'] = '\u0626\u0627'; 45924 t['\uFBEB'] = '\u0626\u0627'; 45925 t['\uFBEC'] = '\u0626\u06D5'; 45926 t['\uFBED'] = '\u0626\u06D5'; 45927 t['\uFBEE'] = '\u0626\u0648'; 45928 t['\uFBEF'] = '\u0626\u0648'; 45929 t['\uFBF0'] = '\u0626\u06C7'; 45930 t['\uFBF1'] = '\u0626\u06C7'; 45931 t['\uFBF2'] = '\u0626\u06C6'; 45932 t['\uFBF3'] = '\u0626\u06C6'; 45933 t['\uFBF4'] = '\u0626\u06C8'; 45934 t['\uFBF5'] = '\u0626\u06C8'; 45935 t['\uFBF6'] = '\u0626\u06D0'; 45936 t['\uFBF7'] = '\u0626\u06D0'; 45937 t['\uFBF8'] = '\u0626\u06D0'; 45938 t['\uFBF9'] = '\u0626\u0649'; 45939 t['\uFBFA'] = '\u0626\u0649'; 45940 t['\uFBFB'] = '\u0626\u0649'; 45941 t['\uFBFC'] = '\u06CC'; 45942 t['\uFBFD'] = '\u06CC'; 45943 t['\uFBFE'] = '\u06CC'; 45944 t['\uFBFF'] = '\u06CC'; 45945 t['\uFC00'] = '\u0626\u062C'; 45946 t['\uFC01'] = '\u0626\u062D'; 45947 t['\uFC02'] = '\u0626\u0645'; 45948 t['\uFC03'] = '\u0626\u0649'; 45949 t['\uFC04'] = '\u0626\u064A'; 45950 t['\uFC05'] = '\u0628\u062C'; 45951 t['\uFC06'] = '\u0628\u062D'; 45952 t['\uFC07'] = '\u0628\u062E'; 45953 t['\uFC08'] = '\u0628\u0645'; 45954 t['\uFC09'] = '\u0628\u0649'; 45955 t['\uFC0A'] = '\u0628\u064A'; 45956 t['\uFC0B'] = '\u062A\u062C'; 45957 t['\uFC0C'] = '\u062A\u062D'; 45958 t['\uFC0D'] = '\u062A\u062E'; 45959 t['\uFC0E'] = '\u062A\u0645'; 45960 t['\uFC0F'] = '\u062A\u0649'; 45961 t['\uFC10'] = '\u062A\u064A'; 45962 t['\uFC11'] = '\u062B\u062C'; 45963 t['\uFC12'] = '\u062B\u0645'; 45964 t['\uFC13'] = '\u062B\u0649'; 45965 t['\uFC14'] = '\u062B\u064A'; 45966 t['\uFC15'] = '\u062C\u062D'; 45967 t['\uFC16'] = '\u062C\u0645'; 45968 t['\uFC17'] = '\u062D\u062C'; 45969 t['\uFC18'] = '\u062D\u0645'; 45970 t['\uFC19'] = '\u062E\u062C'; 45971 t['\uFC1A'] = '\u062E\u062D'; 45972 t['\uFC1B'] = '\u062E\u0645';
45973 t['\uFC1C'] = '\u0633\u062C'; 45974 t['\uFC1D'] = '\u0633\u062D'; 45975 t['\uFC1E'] = '\u0633\u062E'; 45976 t['\uFC1F'] = '\u0633\u0645'; 45977 t['\uFC20'] = '\u0635\u062D'; 45978 t['\uFC21'] = '\u0635\u0645'; 45979 t['\uFC22'] = '\u0636\u062C'; 45980 t['\uFC23'] = '\u0636\u062D'; 45981 t['\uFC24'] = '\u0636\u062E'; 45982 t['\uFC25'] = '\u0636\u0645'; 45983 t['\uFC26'] = '\u0637\u062D'; 45984 t['\uFC27'] = '\u0637\u0645'; 45985 t['\uFC28'] = '\u0638\u0645'; 45986 t['\uFC29'] = '\u0639\u062C'; 45987 t['\uFC2A'] = '\u0639\u0645'; 45988 t['\uFC2B'] = '\u063A\u062C'; 45989 t['\uFC2C'] = '\u063A\u0645'; 45990 t['\uFC2D'] = '\u0641\u062C'; 45991 t['\uFC2E'] = '\u0641\u062D'; 45992 t['\uFC2F'] = '\u0641\u062E'; 45993 t['\uFC30'] = '\u0641\u0645'; 45994 t['\uFC31'] = '\u0641\u0649'; 45995 t['\uFC32'] = '\u0641\u064A'; 45996 t['\uFC33'] = '\u0642\u062D'; 45997 t['\uFC34'] = '\u0642\u0645'; 45998 t['\uFC35'] = '\u0642\u0649'; 45999 t['\uFC36'] = '\u0642\u064A'; 46000 t['\uFC37'] = '\u0643\u0627'; 46001 t['\uFC38'] = '\u0643\u062C'; 46002 t['\uFC39'] = '\u0643\u062D'; 46003 t['\uFC3A'] = '\u0643\u062E'; 46004 t['\uFC3B'] = '\u0643\u0644'; 46005 t['\uFC3C'] = '\u0643\u0645'; 46006 t['\uFC3D'] = '\u0643\u0649'; 46007 t['\uFC3E'] = '\u0643\u064A'; 46008 t['\uFC3F'] = '\u0644\u062C'; 46009 t['\uFC40'] = '\u0644\u062D'; 46010 t['\uFC41'] = '\u0644\u062E'; 46011 t['\uFC42'] = '\u0644\u0645'; 46012 t['\uFC43'] = '\u0644\u0649'; 46013 t['\uFC44'] = '\u0644\u064A'; 46014 t['\uFC45'] = '\u0645\u062C'; 46015 t['\uFC46'] = '\u0645\u062D'; 46016 t['\uFC47'] = '\u0645\u062E'; 46017 t['\uFC48'] = '\u0645\u0645'; 46018 t['\uFC49'] = '\u0645\u0649'; 46019 t['\uFC4A'] = '\u0645\u064A'; 46020 t['\uFC4B'] = '\u0646\u062C'; 46021 t['\uFC4C'] = '\u0646\u062D'; 46022 t['\uFC4D'] = '\u0646\u062E'; 46023 t['\uFC4E'] = '\u0646\u0645'; 46024 t['\uFC4F'] = '\u0646\u0649'; 46025 t['\uFC50'] = '\u0646\u064A'; 46026 t['\uFC51'] = '\u0647\u062C'; 46027 t['\uFC52'] = '\u0647\u0645'; 46028 t['\uFC53'] = '\u0647\u0649'; 46029 t['\uFC54'] = '\u0647\u064A'; 46030 t['\uFC55'] = '\u064A\u062C'; 46031 t['\uFC56'] = '\u064A\u062D'; 46032 t['\uFC57'] = '\u064A\u062E'; 46033 t['\uFC58'] = '\u064A\u0645'; 46034 t['\uFC59'] = '\u064A\u0649'; 46035 t['\uFC5A'] = '\u064A\u064A'; 46036 t['\uFC5B'] = '\u0630\u0670'; 46037 t['\uFC5C'] = '\u0631\u0670'; 46038 t['\uFC5D'] = '\u0649\u0670'; 46039 t['\uFC5E'] = '\u0020\u064C\u0651'; 46040 t['\uFC5F'] = '\u0020\u064D\u0651'; 46041 t['\uFC60'] = '\u0020\u064E\u0651'; 46042 t['\uFC61'] = '\u0020\u064F\u0651'; 46043 t['\uFC62'] = '\u0020\u0650\u0651'; 46044 t['\uFC63'] = '\u0020\u0651\u0670'; 46045 t['\uFC64'] = '\u0626\u0631'; 46046 t['\uFC65'] = '\u0626\u0632'; 46047 t['\uFC66'] = '\u0626\u0645'; 46048 t['\uFC67'] = '\u0626\u0646'; 46049 t['\uFC68'] = '\u0626\u0649'; 46050 t['\uFC69'] = '\u0626\u064A'; 46051 t['\uFC6A'] = '\u0628\u0631'; 46052 t['\uFC6B'] = '\u0628\u0632'; 46053 t['\uFC6C'] = '\u0628\u0645'; 46054 t['\uFC6D'] = '\u0628\u0646'; 46055 t['\uFC6E'] = '\u0628\u0649'; 46056 t['\uFC6F'] = '\u0628\u064A'; 46057 t['\uFC70'] = '\u062A\u0631'; 46058 t['\uFC71'] = '\u062A\u0632'; 46059 t['\uFC72'] = '\u062A\u0645'; 46060 t['\uFC73'] = '\u062A\u0646'; 46061 t['\uFC74'] = '\u062A\u0649'; 46062 t['\uFC75'] = '\u062A\u064A'; 46063 t['\uFC76'] = '\u062B\u0631'; 46064 t['\uFC77'] = '\u062B\u0632'; 46065 t['\uFC78'] = '\u062B\u0645'; 46066 t['\uFC79'] = '\u062B\u0646'; 46067 t['\uFC7A'] = '\u062B\u0649'; 46068 t['\uFC7B'] = '\u062B\u064A'; 46069 t['\uFC7C'] = '\u0641\u0649'; 46070 t['\uFC7D'] = '\u0641\u064A'; 46071 t['\uFC7E'] = '\u0642\u0649'; 46072 t['\uFC7F'] = '\u0642\u064A'; 46073 t['\uFC80'] = '\u0643\u0627'; 46074 t['\uFC81'] = '\u0643\u0644'; 46075 t['\uFC82'] = '\u0643\u0645'; 46076 t['\uFC83'] = '\u0643\u0649'; 46077 t['\uFC84'] = '\u0643\u064A'; 46078 t['\uFC85'] = '\u0644\u0645'; 46079 t['\uFC86'] = '\u0644\u0649'; 46080 t['\uFC87'] = '\u0644\u064A'; 46081 t['\uFC88'] = '\u0645\u0627'; 46082 t['\uFC89'] = '\u0645\u0645'; 46083 t['\uFC8A'] = '\u0646\u0631'; 46084 t['\uFC8B'] = '\u0646\u0632'; 46085 t['\uFC8C'] = '\u0646\u0645'; 46086 t['\uFC8D'] = '\u0646\u0646'; 46087 t['\uFC8E'] = '\u0646\u0649'; 46088 t['\uFC8F'] = '\u0646\u064A'; 46089 t['\uFC90'] = '\u0649\u0670'; 46090 t['\uFC91'] = '\u064A\u0631'; 46091 t['\uFC92'] = '\u064A\u0632'; 46092 t['\uFC93'] = '\u064A\u0645'; 46093 t['\uFC94'] = '\u064A\u0646'; 46094 t['\uFC95'] = '\u064A\u0649'; 46095 t['\uFC96'] = '\u064A\u064A'; 46096 t['\uFC97'] = '\u0626\u062C'; 46097 t['\uFC98'] = '\u0626\u062D'; 46098 t['\uFC99'] = '\u0626\u062E'; 46099 t['\uFC9A'] = '\u0626\u0645'; 46100 t['\uFC9B'] = '\u0626\u0647'; 46101 t['\uFC9C'] = '\u0628\u062C'; 46102 t['\uFC9D'] = '\u0628\u062D'; 46103 t['\uFC9E'] = '\u0628\u062E'; 46104 t['\uFC9F'] = '\u0628\u0645'; 46105 t['\uFCA0'] = '\u0628\u0647'; 46106 t['\uFCA1'] = '\u062A\u062C'; 46107 t['\uFCA2'] = '\u062A\u062D'; 46108 t['\uFCA3'] = '\u062A\u062E'; 46109 t['\uFCA4'] = '\u062A\u0645'; 46110 t['\uFCA5'] = '\u062A\u0647'; 46111 t['\uFCA6'] = '\u062B\u0645'; 46112 t['\uFCA7'] = '\u062C\u062D'; 46113 t['\uFCA8'] = '\u062C\u0645'; 46114 t['\uFCA9'] = '\u062D\u062C'; 46115 t['\uFCAA'] = '\u062D\u0645'; 46116 t['\uFCAB'] = '\u062E\u062C'; 46117 t['\uFCAC'] = '\u062E\u0645';
46118 t['\uFCAD'] = '\u0633\u062C'; 46119 t['\uFCAE'] = '\u0633\u062D'; 46120 t['\uFCAF'] = '\u0633\u062E'; 46121 t['\uFCB0'] = '\u0633\u0645'; 46122 t['\uFCB1'] = '\u0635\u062D'; 46123 t['\uFCB2'] = '\u0635\u062E'; 46124 t['\uFCB3'] = '\u0635\u0645'; 46125 t['\uFCB4'] = '\u0636\u062C'; 46126 t['\uFCB5'] = '\u0636\u062D'; 46127 t['\uFCB6'] = '\u0636\u062E'; 46128 t['\uFCB7'] = '\u0636\u0645'; 46129 t['\uFCB8'] = '\u0637\u062D'; 46130 t['\uFCB9'] = '\u0638\u0645'; 46131 t['\uFCBA'] = '\u0639\u062C'; 46132 t['\uFCBB'] = '\u0639\u0645'; 46133 t['\uFCBC'] = '\u063A\u062C'; 46134 t['\uFCBD'] = '\u063A\u0645'; 46135 t['\uFCBE'] = '\u0641\u062C'; 46136 t['\uFCBF'] = '\u0641\u062D'; 46137 t['\uFCC0'] = '\u0641\u062E'; 46138 t['\uFCC1'] = '\u0641\u0645'; 46139 t['\uFCC2'] = '\u0642\u062D'; 46140 t['\uFCC3'] = '\u0642\u0645'; 46141 t['\uFCC4'] = '\u0643\u062C'; 46142 t['\uFCC5'] = '\u0643\u062D'; 46143 t['\uFCC6'] = '\u0643\u062E'; 46144 t['\uFCC7'] = '\u0643\u0644'; 46145 t['\uFCC8'] = '\u0643\u0645'; 46146 t['\uFCC9'] = '\u0644\u062C'; 46147 t['\uFCCA'] = '\u0644\u062D'; 46148 t['\uFCCB'] = '\u0644\u062E'; 46149 t['\uFCCC'] = '\u0644\u0645'; 46150 t['\uFCCD'] = '\u0644\u0647'; 46151 t['\uFCCE'] = '\u0645\u062C'; 46152 t['\uFCCF'] = '\u0645\u062D'; 46153 t['\uFCD0'] = '\u0645\u062E'; 46154 t['\uFCD1'] = '\u0645\u0645'; 46155 t['\uFCD2'] = '\u0646\u062C'; 46156 t['\uFCD3'] = '\u0646\u062D'; 46157 t['\uFCD4'] = '\u0646\u062E'; 46158 t['\uFCD5'] = '\u0646\u0645'; 46159 t['\uFCD6'] = '\u0646\u0647'; 46160 t['\uFCD7'] = '\u0647\u062C'; 46161 t['\uFCD8'] = '\u0647\u0645'; 46162 t['\uFCD9'] = '\u0647\u0670'; 46163 t['\uFCDA'] = '\u064A\u062C'; 46164 t['\uFCDB'] = '\u064A\u062D'; 46165 t['\uFCDC'] = '\u064A\u062E'; 46166 t['\uFCDD'] = '\u064A\u0645'; 46167 t['\uFCDE'] = '\u064A\u0647'; 46168 t['\uFCDF'] = '\u0626\u0645'; 46169 t['\uFCE0'] = '\u0626\u0647'; 46170 t['\uFCE1'] = '\u0628\u0645'; 46171 t['\uFCE2'] = '\u0628\u0647'; 46172 t['\uFCE3'] = '\u062A\u0645'; 46173 t['\uFCE4'] = '\u062A\u0647'; 46174 t['\uFCE5'] = '\u062B\u0645'; 46175 t['\uFCE6'] = '\u062B\u0647'; 46176 t['\uFCE7'] = '\u0633\u0645'; 46177 t['\uFCE8'] = '\u0633\u0647'; 46178 t['\uFCE9'] = '\u0634\u0645'; 46179 t['\uFCEA'] = '\u0634\u0647'; 46180 t['\uFCEB'] = '\u0643\u0644'; 46181 t['\uFCEC'] = '\u0643\u0645'; 46182 t['\uFCED'] = '\u0644\u0645'; 46183 t['\uFCEE'] = '\u0646\u0645'; 46184 t['\uFCEF'] = '\u0646\u0647'; 46185 t['\uFCF0'] = '\u064A\u0645'; 46186 t['\uFCF1'] = '\u064A\u0647'; 46187 t['\uFCF2'] = '\u0640\u064E\u0651'; 46188 t['\uFCF3'] = '\u0640\u064F\u0651'; 46189 t['\uFCF4'] = '\u0640\u0650\u0651'; 46190 t['\uFCF5'] = '\u0637\u0649'; 46191 t['\uFCF6'] = '\u0637\u064A'; 46192 t['\uFCF7'] = '\u0639\u0649'; 46193 t['\uFCF8'] = '\u0639\u064A'; 46194 t['\uFCF9'] = '\u063A\u0649'; 46195 t['\uFCFA'] = '\u063A\u064A'; 46196 t['\uFCFB'] = '\u0633\u0649'; 46197 t['\uFCFC'] = '\u0633\u064A'; 46198 t['\uFCFD'] = '\u0634\u0649'; 46199 t['\uFCFE'] = '\u0634\u064A'; 46200 t['\uFCFF'] = '\u062D\u0649'; 46201 t['\uFD00'] = '\u062D\u064A'; 46202 t['\uFD01'] = '\u062C\u0649'; 46203 t['\uFD02'] = '\u062C\u064A'; 46204 t['\uFD03'] = '\u062E\u0649'; 46205 t['\uFD04'] = '\u062E\u064A'; 46206 t['\uFD05'] = '\u0635\u0649'; 46207 t['\uFD06'] = '\u0635\u064A'; 46208 t['\uFD07'] = '\u0636\u0649'; 46209 t['\uFD08'] = '\u0636\u064A'; 46210 t['\uFD09'] = '\u0634\u062C'; 46211 t['\uFD0A'] = '\u0634\u062D'; 46212 t['\uFD0B'] = '\u0634\u062E'; 46213 t['\uFD0C'] = '\u0634\u0645'; 46214 t['\uFD0D'] = '\u0634\u0631'; 46215 t['\uFD0E'] = '\u0633\u0631'; 46216 t['\uFD0F'] = '\u0635\u0631'; 46217 t['\uFD10'] = '\u0636\u0631'; 46218 t['\uFD11'] = '\u0637\u0649'; 46219 t['\uFD12'] = '\u0637\u064A'; 46220 t['\uFD13'] = '\u0639\u0649'; 46221 t['\uFD14'] = '\u0639\u064A'; 46222 t['\uFD15'] = '\u063A\u0649'; 46223 t['\uFD16'] = '\u063A\u064A'; 46224 t['\uFD17'] = '\u0633\u0649'; 46225 t['\uFD18'] = '\u0633\u064A'; 46226 t['\uFD19'] = '\u0634\u0649'; 46227 t['\uFD1A'] = '\u0634\u064A'; 46228 t['\uFD1B'] = '\u062D\u0649'; 46229 t['\uFD1C'] = '\u062D\u064A'; 46230 t['\uFD1D'] = '\u062C\u0649'; 46231 t['\uFD1E'] = '\u062C\u064A'; 46232 t['\uFD1F'] = '\u062E\u0649'; 46233 t['\uFD20'] = '\u062E\u064A'; 46234 t['\uFD21'] = '\u0635\u0649'; 46235 t['\uFD22'] = '\u0635\u064A'; 46236 t['\uFD23'] = '\u0636\u0649'; 46237 t['\uFD24'] = '\u0636\u064A'; 46238 t['\uFD25'] = '\u0634\u062C'; 46239 t['\uFD26'] = '\u0634\u062D'; 46240 t['\uFD27'] = '\u0634\u062E'; 46241 t['\uFD28'] = '\u0634\u0645'; 46242 t['\uFD29'] = '\u0634\u0631'; 46243 t['\uFD2A'] = '\u0633\u0631'; 46244 t['\uFD2B'] = '\u0635\u0631'; 46245 t['\uFD2C'] = '\u0636\u0631'; 46246 t['\uFD2D'] = '\u0634\u062C'; 46247 t['\uFD2E'] = '\u0634\u062D'; 46248 t['\uFD2F'] = '\u0634\u062E'; 46249 t['\uFD30'] = '\u0634\u0645'; 46250 t['\uFD31'] = '\u0633\u0647'; 46251 t['\uFD32'] = '\u0634\u0647'; 46252 t['\uFD33'] = '\u0637\u0645';
46253 t['\uFD34'] = '\u0633\u062C'; 46254 t['\uFD35'] = '\u0633\u062D'; 46255 t['\uFD36'] = '\u0633\u062E'; 46256 t['\uFD37'] = '\u0634\u062C'; 46257 t['\uFD38'] = '\u0634\u062D'; 46258 t['\uFD39'] = '\u0634\u062E'; 46259 t['\uFD3A'] = '\u0637\u0645'; 46260 t['\uFD3B'] = '\u0638\u0645'; 46261 t['\uFD3C'] = '\u0627\u064B'; 46262 t['\uFD3D'] = '\u0627\u064B'; 46263 t['\uFD50'] = '\u062A\u062C\u0645'; 46264 t['\uFD51'] = '\u062A\u062D\u062C'; 46265 t['\uFD52'] = '\u062A\u062D\u062C'; 46266 t['\uFD53'] = '\u062A\u062D\u0645'; 46267 t['\uFD54'] = '\u062A\u062E\u0645'; 46268 t['\uFD55'] = '\u062A\u0645\u062C'; 46269 t['\uFD56'] = '\u062A\u0645\u062D'; 46270 t['\uFD57'] = '\u062A\u0645\u062E'; 46271 t['\uFD58'] = '\u062C\u0645\u062D'; 46272 t['\uFD59'] = '\u062C\u0645\u062D'; 46273 t['\uFD5A'] = '\u062D\u0645\u064A'; 46274 t['\uFD5B'] = '\u062D\u0645\u0649'; 46275 t['\uFD5C'] = '\u0633\u062D\u062C'; 46276 t['\uFD5D'] = '\u0633\u062C\u062D'; 46277 t['\uFD5E'] = '\u0633\u062C\u0649'; 46278 t['\uFD5F'] = '\u0633\u0645\u062D'; 46279 t['\uFD60'] = '\u0633\u0645\u062D'; 46280 t['\uFD61'] = '\u0633\u0645\u062C'; 46281 t['\uFD62'] = '\u0633\u0645\u0645'; 46282 t['\uFD63'] = '\u0633\u0645\u0645'; 46283 t['\uFD64'] = '\u0635\u062D\u062D'; 46284 t['\uFD65'] = '\u0635\u062D\u062D'; 46285 t['\uFD66'] = '\u0635\u0645\u0645'; 46286 t['\uFD67'] = '\u0634\u062D\u0645'; 46287 t['\uFD68'] = '\u0634\u062D\u0645'; 46288 t['\uFD69'] = '\u0634\u062C\u064A'; 46289 t['\uFD6A'] = '\u0634\u0645\u062E'; 46290 t['\uFD6B'] = '\u0634\u0645\u062E'; 46291 t['\uFD6C'] = '\u0634\u0645\u0645'; 46292 t['\uFD6D'] = '\u0634\u0645\u0645'; 46293 t['\uFD6E'] = '\u0636\u062D\u0649'; 46294 t['\uFD6F'] = '\u0636\u062E\u0645'; 46295 t['\uFD70'] = '\u0636\u062E\u0645'; 46296 t['\uFD71'] = '\u0637\u0645\u062D'; 46297 t['\uFD72'] = '\u0637\u0645\u062D'; 46298 t['\uFD73'] = '\u0637\u0645\u0645'; 46299 t['\uFD74'] = '\u0637\u0645\u064A'; 46300 t['\uFD75'] = '\u0639\u062C\u0645'; 46301 t['\uFD76'] = '\u0639\u0645\u0645'; 46302 t['\uFD77'] = '\u0639\u0645\u0645'; 46303 t['\uFD78'] = '\u0639\u0645\u0649'; 46304 t['\uFD79'] = '\u063A\u0645\u0645'; 46305 t['\uFD7A'] = '\u063A\u0645\u064A'; 46306 t['\uFD7B'] = '\u063A\u0645\u0649'; 46307 t['\uFD7C'] = '\u0641\u062E\u0645'; 46308 t['\uFD7D'] = '\u0641\u062E\u0645'; 46309 t['\uFD7E'] = '\u0642\u0645\u062D'; 46310 t['\uFD7F'] = '\u0642\u0645\u0645'; 46311 t['\uFD80'] = '\u0644\u062D\u0645'; 46312 t['\uFD81'] = '\u0644\u062D\u064A'; 46313 t['\uFD82'] = '\u0644\u062D\u0649'; 46314 t['\uFD83'] = '\u0644\u062C\u062C'; 46315 t['\uFD84'] = '\u0644\u062C\u062C'; 46316 t['\uFD85'] = '\u0644\u062E\u0645'; 46317 t['\uFD86'] = '\u0644\u062E\u0645'; 46318 t['\uFD87'] = '\u0644\u0645\u062D'; 46319 t['\uFD88'] = '\u0644\u0645\u062D'; 46320 t['\uFD89'] = '\u0645\u062D\u062C'; 46321 t['\uFD8A'] = '\u0645\u062D\u0645'; 46322 t['\uFD8B'] = '\u0645\u062D\u064A'; 46323 t['\uFD8C'] = '\u0645\u062C\u062D'; 46324 t['\uFD8D'] = '\u0645\u062C\u0645'; 46325 t['\uFD8E'] = '\u0645\u062E\u062C'; 46326 t['\uFD8F'] = '\u0645\u062E\u0645'; 46327 t['\uFD92'] = '\u0645\u062C\u062E'; 46328 t['\uFD93'] = '\u0647\u0645\u062C'; 46329 t['\uFD94'] = '\u0647\u0645\u0645'; 46330 t['\uFD95'] = '\u0646\u062D\u0645'; 46331 t['\uFD96'] = '\u0646\u062D\u0649'; 46332 t['\uFD97'] = '\u0646\u062C\u0645'; 46333 t['\uFD98'] = '\u0646\u062C\u0645'; 46334 t['\uFD99'] = '\u0646\u062C\u0649'; 46335 t['\uFD9A'] = '\u0646\u0645\u064A'; 46336 t['\uFD9B'] = '\u0646\u0645\u0649'; 46337 t['\uFD9C'] = '\u064A\u0645\u0645'; 46338 t['\uFD9D'] = '\u064A\u0645\u0645'; 46339 t['\uFD9E'] = '\u0628\u062E\u064A'; 46340 t['\uFD9F'] = '\u062A\u062C\u064A'; 46341 t['\uFDA0'] = '\u062A\u062C\u0649'; 46342 t['\uFDA1'] = '\u062A\u062E\u064A'; 46343 t['\uFDA2'] = '\u062A\u062E\u0649'; 46344 t['\uFDA3'] = '\u062A\u0645\u064A'; 46345 t['\uFDA4'] = '\u062A\u0645\u0649'; 46346 t['\uFDA5'] = '\u062C\u0645\u064A'; 46347 t['\uFDA6'] = '\u062C\u062D\u0649'; 46348 t['\uFDA7'] = '\u062C\u0645\u0649'; 46349 t['\uFDA8'] = '\u0633\u062E\u0649'; 46350 t['\uFDA9'] = '\u0635\u062D\u064A'; 46351 t['\uFDAA'] = '\u0634\u062D\u064A'; 46352 t['\uFDAB'] = '\u0636\u062D\u064A'; 46353 t['\uFDAC'] = '\u0644\u062C\u064A'; 46354 t['\uFDAD'] = '\u0644\u0645\u064A'; 46355 t['\uFDAE'] = '\u064A\u062D\u064A'; 46356 t['\uFDAF'] = '\u064A\u062C\u064A'; 46357 t['\uFDB0'] = '\u064A\u0645\u064A'; 46358 t['\uFDB1'] = '\u0645\u0645\u064A'; 46359 t['\uFDB2'] = '\u0642\u0645\u064A'; 46360 t['\uFDB3'] = '\u0646\u062D\u064A'; 46361 t['\uFDB4'] = '\u0642\u0645\u062D'; 46362 t['\uFDB5'] = '\u0644\u062D\u0645'; 46363 t['\uFDB6'] = '\u0639\u0645\u064A'; 46364 t['\uFDB7'] = '\u0643\u0645\u064A'; 46365 t['\uFDB8'] = '\u0646\u062C\u062D'; 46366 t['\uFDB9'] = '\u0645\u062E\u064A'; 46367 t['\uFDBA'] = '\u0644\u062C\u0645'; 46368 t['\uFDBB'] = '\u0643\u0645\u0645'; 46369 t['\uFDBC'] = '\u0644\u062C\u0645'; 46370 t['\uFDBD'] = '\u0646\u062C\u062D'; 46371 t['\uFDBE'] = '\u062C\u062D\u064A'; 46372 t['\uFDBF'] = '\u062D\u062C\u064A'; 46373 t['\uFDC0'] = '\u0645\u062C\u064A'; 46374 t['\uFDC1'] = '\u0641\u0645\u064A'; 46375 t['\uFDC2'] = '\u0628\u062D\u064A'; 46376 t['\uFDC3'] = '\u0643\u0645\u0645'; 46377 t['\uFDC4'] = '\u0639\u062C\u0645'; 46378 t['\uFDC5'] = '\u0635\u0645\u0645'; 46379 t['\uFDC6'] = '\u0633\u062E\u064A'; 46380 t['\uFDC7'] = '\u0646\u062C\u064A'; 46381 t['\uFE49'] = '\u203E'; 46382 t['\uFE4A'] = '\u203E';
46383 t['\uFE4B'] = '\u203E'; 46384 t['\uFE4C'] = '\u203E'; 46385 t['\uFE4D'] = '\u005F'; 46386 t['\uFE4E'] = '\u005F'; 46387 t['\uFE4F'] = '\u005F'; 46388 t['\uFE80'] = '\u0621'; 46389 t['\uFE81'] = '\u0622'; 46390 t['\uFE82'] = '\u0622'; 46391 t['\uFE83'] = '\u0623'; 46392 t['\uFE84'] = '\u0623'; 46393 t['\uFE85'] = '\u0624'; 46394 t['\uFE86'] = '\u0624'; 46395 t['\uFE87'] = '\u0625'; 46396 t['\uFE88'] = '\u0625'; 46397 t['\uFE89'] = '\u0626'; 46398 t['\uFE8A'] = '\u0626'; 46399 t['\uFE8B'] = '\u0626'; 46400 t['\uFE8C'] = '\u0626'; 46401 t['\uFE8D'] = '\u0627'; 46402 t['\uFE8E'] = '\u0627'; 46403 t['\uFE8F'] = '\u0628'; 46404 t['\uFE90'] = '\u0628'; 46405 t['\uFE91'] = '\u0628'; 46406 t['\uFE92'] = '\u0628'; 46407 t['\uFE93'] = '\u0629'; 46408 t['\uFE94'] = '\u0629'; 46409 t['\uFE95'] = '\u062A'; 46410 t['\uFE96'] = '\u062A'; 46411 t['\uFE97'] = '\u062A'; 46412 t['\uFE98'] = '\u062A'; 46413 t['\uFE99'] = '\u062B'; 46414 t['\uFE9A'] = '\u062B'; 46415 t['\uFE9B'] = '\u062B'; 46416 t['\uFE9C'] = '\u062B'; 46417 t['\uFE9D'] = '\u062C'; 46418 t['\uFE9E'] = '\u062C'; 46419 t['\uFE9F'] = '\u062C'; 46420 t['\uFEA0'] = '\u062C'; 46421 t['\uFEA1'] = '\u062D'; 46422 t['\uFEA2'] = '\u062D'; 46423 t['\uFEA3'] = '\u062D'; 46424 t['\uFEA4'] = '\u062D'; 46425 t['\uFEA5'] = '\u062E'; 46426 t['\uFEA6'] = '\u062E'; 46427 t['\uFEA7'] = '\u062E'; 46428 t['\uFEA8'] = '\u062E'; 46429 t['\uFEA9'] = '\u062F'; 46430 t['\uFEAA'] = '\u062F'; 46431 t['\uFEAB'] = '\u0630'; 46432 t['\uFEAC'] = '\u0630'; 46433 t['\uFEAD'] = '\u0631'; 46434 t['\uFEAE'] = '\u0631'; 46435 t['\uFEAF'] = '\u0632'; 46436 t['\uFEB0'] = '\u0632'; 46437 t['\uFEB1'] = '\u0633'; 46438 t['\uFEB2'] = '\u0633'; 46439 t['\uFEB3'] = '\u0633'; 46440 t['\uFEB4'] = '\u0633'; 46441 t['\uFEB5'] = '\u0634'; 46442 t['\uFEB6'] = '\u0634'; 46443 t['\uFEB7'] = '\u0634'; 46444 t['\uFEB8'] = '\u0634'; 46445 t['\uFEB9'] = '\u0635'; 46446 t['\uFEBA'] = '\u0635'; 46447 t['\uFEBB'] = '\u0635'; 46448 t['\uFEBC'] = '\u0635'; 46449 t['\uFEBD'] = '\u0636'; 46450 t['\uFEBE'] = '\u0636'; 46451 t['\uFEBF'] = '\u0636'; 46452 t['\uFEC0'] = '\u0636'; 46453 t['\uFEC1'] = '\u0637'; 46454 t['\uFEC2'] = '\u0637'; 46455 t['\uFEC3'] = '\u0637'; 46456 t['\uFEC4'] = '\u0637'; 46457 t['\uFEC5'] = '\u0638'; 46458 t['\uFEC6'] = '\u0638'; 46459 t['\uFEC7'] = '\u0638'; 46460 t['\uFEC8'] = '\u0638'; 46461 t['\uFEC9'] = '\u0639'; 46462 t['\uFECA'] = '\u0639'; 46463 t['\uFECB'] = '\u0639'; 46464 t['\uFECC'] = '\u0639'; 46465 t['\uFECD'] = '\u063A'; 46466 t['\uFECE'] = '\u063A'; 46467 t['\uFECF'] = '\u063A'; 46468 t['\uFED0'] = '\u063A'; 46469 t['\uFED1'] = '\u0641'; 46470 t['\uFED2'] = '\u0641'; 46471 t['\uFED3'] = '\u0641'; 46472 t['\uFED4'] = '\u0641'; 46473 t['\uFED5'] = '\u0642'; 46474 t['\uFED6'] = '\u0642'; 46475 t['\uFED7'] = '\u0642'; 46476 t['\uFED8'] = '\u0642'; 46477 t['\uFED9'] = '\u0643'; 46478 t['\uFEDA'] = '\u0643'; 46479 t['\uFEDB'] = '\u0643'; 46480 t['\uFEDC'] = '\u0643'; 46481 t['\uFEDD'] = '\u0644'; 46482 t['\uFEDE'] = '\u0644'; 46483 t['\uFEDF'] = '\u0644'; 46484 t['\uFEE0'] = '\u0644'; 46485 t['\uFEE1'] = '\u0645'; 46486 t['\uFEE2'] = '\u0645'; 46487 t['\uFEE3'] = '\u0645'; 46488 t['\uFEE4'] = '\u0645'; 46489 t['\uFEE5'] = '\u0646'; 46490 t['\uFEE6'] = '\u0646'; 46491 t['\uFEE7'] = '\u0646'; 46492 t['\uFEE8'] = '\u0646'; 46493 t['\uFEE9'] = '\u0647'; 46494 t['\uFEEA'] = '\u0647'; 46495 t['\uFEEB'] = '\u0647'; 46496 t['\uFEEC'] = '\u0647'; 46497 t['\uFEED'] = '\u0648'; 46498 t['\uFEEE'] = '\u0648'; 46499 t['\uFEEF'] = '\u0649'; 46500 t['\uFEF0'] = '\u0649'; 46501 t['\uFEF1'] = '\u064A'; 46502 t['\uFEF2'] = '\u064A'; 46503 t['\uFEF3'] = '\u064A'; 46504 t['\uFEF4'] = '\u064A'; 46505 t['\uFEF5'] = '\u0644\u0622'; 46506 t['\uFEF6'] = '\u0644\u0622'; 46507 t['\uFEF7'] = '\u0644\u0623'; 46508 t['\uFEF8'] = '\u0644\u0623'; 46509 t['\uFEF9'] = '\u0644\u0625'; 46510 t['\uFEFA'] = '\u0644\u0625'; 46511 t['\uFEFB'] = '\u0644\u0627'; 46512 t['\uFEFC'] = '\u0644\u0627'; 46513}); 46514function reverseIfRtl(chars) { 46515 var charsLength = chars.length; 46516 if (charsLength <= 1 || !isRTLRangeFor(chars.charCodeAt(0))) { 46517 return chars; 46518 } 46519 var s = ''; 46520 for (var ii = charsLength - 1; ii >= 0; ii--) { 46521 s += chars[ii]; 46522 } 46523 return s; 46524} 46525exports.mapSpecialUnicodeValues = mapSpecialUnicodeValues; 46526exports.reverseIfRtl = reverseIfRtl; 46527exports.getUnicodeRangeFor = getUnicodeRangeFor; 46528exports.getNormalizedUnicodes = getNormalizedUnicodes; 46529exports.getUnicodeForGlyph = getUnicodeForGlyph; 46530 46531/***/ }), 46532/* 180 */ 46533/***/ (function(module, exports, __w_pdfjs_require__) { 46534 46535"use strict"; 46536 46537 46538Object.defineProperty(exports, "__esModule", { 46539 value: true 46540}); 46541exports.FontRendererFactory = void 0; 46542 46543var _util = __w_pdfjs_require__(6); 46544 46545var _cff_parser = __w_pdfjs_require__(174); 46546 46547var _glyphlist = __w_pdfjs_require__(177); 46548 46549var _encodings = __w_pdfjs_require__(176); 46550 46551var _stream = __w_pdfjs_require__(157); 46552 46553function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 46554 46555function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } 46556 46557function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } 46558
46559function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } 46560 46561function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } 46562 46563function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } 46564 46565function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 46566 46567function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 46568 46569function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 46570 46571var FontRendererFactory = function FontRendererFactoryClosure() { 46572 function getLong(data, offset) { 46573 return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; 46574 } 46575 46576 function getUshort(data, offset) { 46577 return data[offset] << 8 | data[offset + 1]; 46578 } 46579 46580 function parseCmap(data, start, end) { 46581 var offset = getUshort(data, start + 2) === 1 ? getLong(data, start + 8) : getLong(data, start + 16); 46582 var format = getUshort(data, start + offset); 46583 var ranges, p, i; 46584 46585 if (format === 4) { 46586 getUshort(data, start + offset + 2); 46587 var segCount = getUshort(data, start + offset + 6) >> 1; 46588 p = start + offset + 14; 46589 ranges = []; 46590 46591 for (i = 0; i < segCount; i++, p += 2) { 46592 ranges[i] = { 46593 end: getUshort(data, p) 46594 }; 46595 } 46596 46597 p += 2; 46598 46599 for (i = 0; i < segCount; i++, p += 2) { 46600 ranges[i].start = getUshort(data, p); 46601 } 46602 46603 for (i = 0; i < segCount; i++, p += 2) { 46604 ranges[i].idDelta = getUshort(data, p); 46605 } 46606 46607 for (i = 0; i < segCount; i++, p += 2) { 46608 var idOffset = getUshort(data, p); 46609 46610 if (idOffset === 0) { 46611 continue; 46612 } 46613 46614 ranges[i].ids = []; 46615 46616 for (var j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) { 46617 ranges[i].ids[j] = getUshort(data, p + idOffset); 46618 idOffset += 2; 46619 } 46620 } 46621 46622 return ranges; 46623 } else if (format === 12) { 46624 getLong(data, start + offset + 4); 46625 var groups = getLong(data, start + offset + 12); 46626 p = start + offset + 16; 46627 ranges = []; 46628 46629 for (i = 0; i < groups; i++) { 46630 ranges.push({ 46631 start: getLong(data, p), 46632 end: getLong(data, p + 4), 46633 idDelta: getLong(data, p + 8) - getLong(data, p) 46634 }); 46635 p += 12; 46636 } 46637 46638 return ranges; 46639 } 46640 46641 throw new _util.FormatError("unsupported cmap: ".concat(format)); 46642 } 46643 46644 function parseCff(data, start, end, seacAnalysisEnabled) { 46645 var properties = {}; 46646 var parser = new _cff_parser.CFFParser(new _stream.Stream(data, start, end - start), properties, seacAnalysisEnabled); 46647 var cff = parser.parse(); 46648 return { 46649 glyphs: cff.charStrings.objects, 46650 subrs: cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && cff.topDict.privateDict.subrsIndex.objects, 46651 gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects, 46652 isCFFCIDFont: cff.isCIDFont, 46653 fdSelect: cff.fdSelect, 46654 fdArray: cff.fdArray 46655 }; 46656 } 46657 46658 function parseGlyfTable(glyf, loca, isGlyphLocationsLong) { 46659 var itemSize, itemDecode; 46660 46661 if (isGlyphLocationsLong) { 46662 itemSize = 4; 46663 46664 itemDecode = function fontItemDecodeLong(data, offset) { 46665 return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; 46666 }; 46667 } else { 46668 itemSize = 2; 46669 46670 itemDecode = function fontItemDecode(data, offset) { 46671 return data[offset] << 9 | data[offset + 1] << 1; 46672 }; 46673 } 46674 46675 var glyphs = []; 46676 var startOffset = itemDecode(loca, 0); 46677 46678 for (var j = itemSize; j < loca.length; j += itemSize) { 46679 var endOffset = itemDecode(loca, j); 46680 glyphs.push(glyf.subarray(startOffset, endOffset)); 46681 startOffset = endOffset; 46682 } 46683 46684 return glyphs; 46685 } 46686 46687 function lookupCmap(ranges, unicode) { 46688 var code = unicode.codePointAt(0), 46689 gid = 0; 46690 var l = 0, 46691 r = ranges.length - 1; 46692 46693 while (l < r) { 46694 var c = l + r + 1 >> 1; 46695 46696 if (code < ranges[c].start) { 46697 r = c - 1; 46698 } else { 46699 l = c; 46700 } 46701 } 46702 46703 if (ranges[l].start <= code && code <= ranges[l].end) { 46704 gid = ranges[l].idDelta + (ranges[l].ids ? ranges[l].ids[code - ranges[l].start] : code) & 0xFFFF; 46705 } 46706 46707 return {
46708 charCode: code, 46709 glyphId: gid 46710 }; 46711 } 46712 46713 function compileGlyf(code, cmds, font) { 46714 function moveTo(x, y) { 46715 cmds.push({ 46716 cmd: 'moveTo', 46717 args: [x, y] 46718 }); 46719 } 46720 46721 function lineTo(x, y) { 46722 cmds.push({ 46723 cmd: 'lineTo', 46724 args: [x, y] 46725 }); 46726 } 46727 46728 function quadraticCurveTo(xa, ya, x, y) { 46729 cmds.push({ 46730 cmd: 'quadraticCurveTo', 46731 args: [xa, ya, x, y] 46732 }); 46733 } 46734 46735 var i = 0; 46736 var numberOfContours = (code[i] << 24 | code[i + 1] << 16) >> 16; 46737 var flags; 46738 var x = 0, 46739 y = 0; 46740 i += 10; 46741 46742 if (numberOfContours < 0) { 46743 do { 46744 flags = code[i] << 8 | code[i + 1]; 46745 var glyphIndex = code[i + 2] << 8 | code[i + 3]; 46746 i += 4; 46747 var arg1, arg2; 46748 46749 if (flags & 0x01) { 46750 arg1 = (code[i] << 24 | code[i + 1] << 16) >> 16; 46751 arg2 = (code[i + 2] << 24 | code[i + 3] << 16) >> 16; 46752 i += 4; 46753 } else { 46754 arg1 = code[i++]; 46755 arg2 = code[i++]; 46756 } 46757 46758 if (flags & 0x02) { 46759 x = arg1; 46760 y = arg2; 46761 } else { 46762 x = 0; 46763 y = 0; 46764 } 46765 46766 var scaleX = 1, 46767 scaleY = 1, 46768 scale01 = 0, 46769 scale10 = 0; 46770 46771 if (flags & 0x08) { 46772 scaleX = scaleY = (code[i] << 24 | code[i + 1] << 16) / 1073741824; 46773 i += 2; 46774 } else if (flags & 0x40) { 46775 scaleX = (code[i] << 24 | code[i + 1] << 16) / 1073741824; 46776 scaleY = (code[i + 2] << 24 | code[i + 3] << 16) / 1073741824; 46777 i += 4; 46778 } else if (flags & 0x80) { 46779 scaleX = (code[i] << 24 | code[i + 1] << 16) / 1073741824; 46780 scale01 = (code[i + 2] << 24 | code[i + 3] << 16) / 1073741824; 46781 scale10 = (code[i + 4] << 24 | code[i + 5] << 16) / 1073741824; 46782 scaleY = (code[i + 6] << 24 | code[i + 7] << 16) / 1073741824; 46783 i += 8; 46784 } 46785 46786 var subglyph = font.glyphs[glyphIndex]; 46787 46788 if (subglyph) { 46789 cmds.push({ 46790 cmd: 'save' 46791 }); 46792 cmds.push({ 46793 cmd: 'transform', 46794 args: [scaleX, scale01, scale10, scaleY, x, y] 46795 }); 46796 compileGlyf(subglyph, cmds, font); 46797 cmds.push({ 46798 cmd: 'restore' 46799 }); 46800 } 46801 } while (flags & 0x20); 46802 } else { 46803 var endPtsOfContours = []; 46804 var j, jj; 46805 46806 for (j = 0; j < numberOfContours; j++) { 46807 endPtsOfContours.push(code[i] << 8 | code[i + 1]); 46808 i += 2; 46809 } 46810 46811 var instructionLength = code[i] << 8 | code[i + 1]; 46812 i += 2 + instructionLength; 46813 var numberOfPoints = endPtsOfContours[endPtsOfContours.length - 1] + 1; 46814 var points = []; 46815 46816 while (points.length < numberOfPoints) { 46817 flags = code[i++]; 46818 var repeat = 1; 46819 46820 if (flags & 0x08) { 46821 repeat += code[i++]; 46822 } 46823 46824 while (repeat-- > 0) { 46825 points.push({ 46826 flags: flags 46827 }); 46828 } 46829 } 46830 46831 for (j = 0; j < numberOfPoints; j++) { 46832 switch (points[j].flags & 0x12) { 46833 case 0x00: 46834 x += (code[i] << 24 | code[i + 1] << 16) >> 16; 46835 i += 2; 46836 break; 46837 46838 case 0x02: 46839 x -= code[i++]; 46840 break; 46841 46842 case 0x12: 46843 x += code[i++]; 46844 break; 46845 } 46846 46847 points[j].x = x; 46848 } 46849 46850 for (j = 0; j < numberOfPoints; j++) { 46851 switch (points[j].flags & 0x24) { 46852 case 0x00: 46853 y += (code[i] << 24 | code[i + 1] << 16) >> 16; 46854 i += 2; 46855 break; 46856 46857 case 0x04: 46858 y -= code[i++]; 46859 break; 46860 46861 case 0x24: 46862 y += code[i++]; 46863 break; 46864 } 46865 46866 points[j].y = y; 46867 } 46868 46869 var startPoint = 0; 46870 46871 for (i = 0; i < numberOfContours; i++) { 46872 var endPoint = endPtsOfContours[i]; 46873 var contour = points.slice(startPoint, endPoint + 1); 46874 46875 if (contour[0].flags & 1) { 46876 contour.push(contour[0]); 46877 } else if (contour[contour.length - 1].flags & 1) { 46878 contour.unshift(contour[contour.length - 1]); 46879 } else { 46880 var p = { 46881 flags: 1, 46882 x: (contour[0].x + contour[contour.length - 1].x) / 2, 46883 y: (contour[0].y + contour[contour.length - 1].y) / 2 46884 }; 46885 contour.unshift(p); 46886 contour.push(p); 46887 } 46888 46889 moveTo(contour[0].x, contour[0].y); 46890 46891 for (j = 1, jj = contour.length; j < jj; j++) { 46892 if (contour[j].flags & 1) { 46893 lineTo(contour[j].x, contour[j].y); 46894 } else if (contour[j + 1].flags & 1) { 46895 quadraticCurveTo(contour[j].x, contour[j].y, contour[j + 1].x, contour[j + 1].y); 46896 j++; 46897 } else { 46898 quadraticCurveTo(contour[j].x, contour[j].y, (contour[j].x + contour[j + 1].x) / 2, (contour[j].y + contour[j + 1].y) / 2); 46899 } 46900 } 46901 46902 startPoint = endPoint + 1; 46903 } 46904 } 46905 } 46906 46907 function compileCharString(code, cmds, font, glyphId) { 46908 var stack = []; 46909 var x = 0, 46910 y = 0; 46911 var stems = 0; 46912 46913 function moveTo(x, y) { 46914 cmds.push({ 46915 cmd: 'moveTo', 46916 args: [x, y] 46917 }); 46918 } 46919 46920 function lineTo(x, y) { 46921 cmds.push({ 46922 cmd: 'lineTo', 46923 args: [x, y] 46924 }); 46925 } 46926 46927 function bezierCurveTo(x1, y1, x2, y2, x, y) { 46928 cmds.push({ 46929 cmd: 'bezierCurveTo', 46930 args: [x1, y1, x2, y2, x, y] 46931 }); 46932 } 46933 46934 function parse(code) { 46935 var i = 0; 46936 46937 while (i < code.length) { 46938 var stackClean = false; 46939 var v = code[i++]; 46940 var xa, xb, ya, yb, y1, y2, y3, n, subrCode; 46941 46942 switch (v) { 46943 case 1: 46944 stems += stack.length >> 1; 46945 stackClean = true; 46946 break; 46947 46948 case 3: 46949 stems += stack.length >> 1; 46950 stackClean = true; 46951 break; 46952 46953 case 4: 46954 y += stack.pop(); 46955 moveTo(x, y); 46956 stackClean = true; 46957 break; 46958 46959 case 5: 46960 while (stack.length > 0) { 46961 x += stack.shift(); 46962 y += stack.shift(); 46963 lineTo(x, y); 46964 } 46965 46966 break; 46967 46968 case 6: 46969 while (stack.length > 0) { 46970 x += stack.shift(); 46971 lineTo(x, y); 46972 46973 if (stack.length === 0) { 46974 break; 46975 } 46976 46977 y += stack.shift(); 46978 lineTo(x, y); 46979 } 46980 46981 break; 46982 46983 case 7: 46984 while (stack.length > 0) { 46985 y += stack.shift(); 46986 lineTo(x, y); 46987 46988 if (stack.length === 0) { 46989 break; 46990 } 46991 46992 x += stack.shift(); 46993 lineTo(x, y); 46994 } 46995 46996 break; 46997 46998 case 8: 46999 while (stack.length > 0) { 47000 xa = x + stack.shift(); 47001 ya = y + stack.shift(); 47002 xb = xa + stack.shift(); 47003 yb = ya + stack.shift(); 47004 x = xb + stack.shift(); 47005 y = yb + stack.shift(); 47006 bezierCurveTo(xa, ya, xb, yb, x, y); 47007 } 47008 47009 break; 47010 47011 case 10: 47012 n = stack.pop(); 47013 subrCode = null; 47014 47015 if (font.isCFFCIDFont) { 47016 var fdIndex = font.fdSelect.getFDIndex(glyphId); 47017 47018 if (fdIndex >= 0 && fdIndex < font.fdArray.length) { 47019 var fontDict = font.fdArray[fdIndex], 47020 subrs = void 0; 47021 47022 if (fontDict.privateDict && fontDict.privateDict.subrsIndex) { 47023 subrs = fontDict.privateDict.subrsIndex.objects; 47024 } 47025 47026 if (subrs) { 47027 var numSubrs = subrs.length; 47028 n += numSubrs < 1240 ? 107 : numSubrs < 33900 ? 1131 : 32768; 47029 subrCode = subrs[n]; 47030 } 47031 } else { 47032 (0, _util.warn)('Invalid fd index for glyph index.'); 47033 } 47034 } else { 47035 subrCode = font.subrs[n + font.subrsBias]; 47036 } 47037 47038 if (subrCode) { 47039 parse(subrCode); 47040 } 47041 47042 break; 47043 47044 case 11: 47045 return; 47046 47047 case 12: 47048 v = code[i++]; 47049 47050 switch (v) { 47051 case 34: 47052 xa = x + stack.shift(); 47053 xb = xa + stack.shift(); 47054 y1 = y + stack.shift(); 47055 x = xb + stack.shift(); 47056 bezierCurveTo(xa, y, xb, y1, x, y1);
vendor: 8,262 bytes, lines 47057-47326
47057 xa = x + stack.shift(); 47058 xb = xa + stack.shift(); 47059 x = xb + stack.shift(); 47060 bezierCurveTo(xa, y1, xb, y, x, y); 47061 break; 47062 47063 case 35: 47064 xa = x + stack.shift(); 47065 ya = y + stack.shift(); 47066 xb = xa + stack.shift(); 47067 yb = ya + stack.shift(); 47068 x = xb + stack.shift(); 47069 y = yb + stack.shift(); 47070 bezierCurveTo(xa, ya, xb, yb, x, y); 47071 xa = x + stack.shift(); 47072 ya = y + stack.shift(); 47073 xb = xa + stack.shift(); 47074 yb = ya + stack.shift(); 47075 x = xb + stack.shift(); 47076 y = yb + stack.shift(); 47077 bezierCurveTo(xa, ya, xb, yb, x, y); 47078 stack.pop(); 47079 break; 47080 47081 case 36: 47082 xa = x + stack.shift(); 47083 y1 = y + stack.shift(); 47084 xb = xa + stack.shift(); 47085 y2 = y1 + stack.shift(); 47086 x = xb + stack.shift(); 47087 bezierCurveTo(xa, y1, xb, y2, x, y2); 47088 xa = x + stack.shift(); 47089 xb = xa + stack.shift(); 47090 y3 = y2 + stack.shift(); 47091 x = xb + stack.shift(); 47092 bezierCurveTo(xa, y2, xb, y3, x, y); 47093 break; 47094 47095 case 37: 47096 var x0 = x, 47097 y0 = y; 47098 xa = x + stack.shift(); 47099 ya = y + stack.shift(); 47100 xb = xa + stack.shift(); 47101 yb = ya + stack.shift(); 47102 x = xb + stack.shift(); 47103 y = yb + stack.shift(); 47104 bezierCurveTo(xa, ya, xb, yb, x, y); 47105 xa = x + stack.shift(); 47106 ya = y + stack.shift(); 47107 xb = xa + stack.shift(); 47108 yb = ya + stack.shift(); 47109 x = xb; 47110 y = yb; 47111 47112 if (Math.abs(x - x0) > Math.abs(y - y0)) { 47113 x += stack.shift(); 47114 } else { 47115 y += stack.shift(); 47116 } 47117 47118 bezierCurveTo(xa, ya, xb, yb, x, y); 47119 break; 47120 47121 default: 47122 throw new _util.FormatError("unknown operator: 12 ".concat(v)); 47123 } 47124 47125 break; 47126 47127 case 14: 47128 if (stack.length >= 4) { 47129 var achar = stack.pop(); 47130 var bchar = stack.pop(); 47131 y = stack.pop(); 47132 x = stack.pop(); 47133 cmds.push({ 47134 cmd: 'save' 47135 }); 47136 cmds.push({ 47137 cmd: 'translate', 47138 args: [x, y] 47139 }); 47140 var cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[_encodings.StandardEncoding[achar]])); 47141 compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId); 47142 cmds.push({ 47143 cmd: 'restore' 47144 }); 47145 cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[_encodings.StandardEncoding[bchar]])); 47146 compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId); 47147 } 47148 47149 return; 47150 47151 case 18: 47152 stems += stack.length >> 1; 47153 stackClean = true; 47154 break; 47155 47156 case 19: 47157 stems += stack.length >> 1; 47158 i += stems + 7 >> 3; 47159 stackClean = true; 47160 break; 47161 47162 case 20: 47163 stems += stack.length >> 1; 47164 i += stems + 7 >> 3; 47165 stackClean = true; 47166 break; 47167 47168 case 21: 47169 y += stack.pop(); 47170 x += stack.pop(); 47171 moveTo(x, y); 47172 stackClean = true; 47173 break; 47174 47175 case 22: 47176 x += stack.pop(); 47177 moveTo(x, y); 47178 stackClean = true; 47179 break; 47180 47181 case 23: 47182 stems += stack.length >> 1; 47183 stackClean = true; 47184 break; 47185 47186 case 24: 47187 while (stack.length > 2) { 47188 xa = x + stack.shift(); 47189 ya = y + stack.shift(); 47190 xb = xa + stack.shift(); 47191 yb = ya + stack.shift(); 47192 x = xb + stack.shift(); 47193 y = yb + stack.shift(); 47194 bezierCurveTo(xa, ya, xb, yb, x, y); 47195 } 47196 47197 x += stack.shift(); 47198 y += stack.shift(); 47199 lineTo(x, y); 47200 break; 47201 47202 case 25: 47203 while (stack.length > 6) { 47204 x += stack.shift(); 47205 y += stack.shift(); 47206 lineTo(x, y); 47207 } 47208 47209 xa = x + stack.shift(); 47210 ya = y + stack.shift(); 47211 xb = xa + stack.shift(); 47212 yb = ya + stack.shift(); 47213 x = xb + stack.shift(); 47214 y = yb + stack.shift(); 47215 bezierCurveTo(xa, ya, xb, yb, x, y); 47216 break; 47217 47218 case 26: 47219 if (stack.length % 2) { 47220 x += stack.shift(); 47221 } 47222 47223 while (stack.length > 0) { 47224 xa = x; 47225 ya = y + stack.shift(); 47226 xb = xa + stack.shift(); 47227 yb = ya + stack.shift(); 47228 x = xb; 47229 y = yb + stack.shift(); 47230 bezierCurveTo(xa, ya, xb, yb, x, y); 47231 } 47232 47233 break; 47234 47235 case 27: 47236 if (stack.length % 2) { 47237 y += stack.shift(); 47238 } 47239 47240 while (stack.length > 0) { 47241 xa = x + stack.shift(); 47242 ya = y; 47243 xb = xa + stack.shift(); 47244 yb = ya + stack.shift(); 47245 x = xb + stack.shift(); 47246 y = yb; 47247 bezierCurveTo(xa, ya, xb, yb, x, y); 47248 } 47249 47250 break; 47251 47252 case 28: 47253 stack.push((code[i] << 24 | code[i + 1] << 16) >> 16); 47254 i += 2; 47255 break; 47256 47257 case 29: 47258 n = stack.pop() + font.gsubrsBias; 47259 subrCode = font.gsubrs[n]; 47260 47261 if (subrCode) { 47262 parse(subrCode); 47263 } 47264 47265 break; 47266 47267 case 30: 47268 while (stack.length > 0) { 47269 xa = x; 47270 ya = y + stack.shift(); 47271 xb = xa + stack.shift(); 47272 yb = ya + stack.shift(); 47273 x = xb + stack.shift(); 47274 y = yb + (stack.length === 1 ? stack.shift() : 0); 47275 bezierCurveTo(xa, ya, xb, yb, x, y); 47276 47277 if (stack.length === 0) { 47278 break; 47279 } 47280 47281 xa = x + stack.shift(); 47282 ya = y; 47283 xb = xa + stack.shift(); 47284 yb = ya + stack.shift(); 47285 y = yb + stack.shift(); 47286 x = xb + (stack.length === 1 ? stack.shift() : 0); 47287 bezierCurveTo(xa, ya, xb, yb, x, y); 47288 } 47289 47290 break; 47291 47292 case 31: 47293 while (stack.length > 0) { 47294 xa = x + stack.shift(); 47295 ya = y; 47296 xb = xa + stack.shift(); 47297 yb = ya + stack.shift(); 47298 y = yb + stack.shift(); 47299 x = xb + (stack.length === 1 ? stack.shift() : 0); 47300 bezierCurveTo(xa, ya, xb, yb, x, y); 47301 47302 if (stack.length === 0) { 47303 break; 47304 } 47305 47306 xa = x; 47307 ya = y + stack.shift(); 47308 xb = xa + stack.shift(); 47309 yb = ya + stack.shift(); 47310 x = xb + stack.shift(); 47311 y = yb + (stack.length === 1 ? stack.shift() : 0); 47312 bezierCurveTo(xa, ya, xb, yb, x, y); 47313 } 47314 47315 break; 47316 47317 default: 47318 if (v < 32) { 47319 throw new _util.FormatError("unknown operator: ".concat(v)); 47320 } 47321 47322 if (v < 247) { 47323 stack.push(v - 139); 47324 } else if (v < 251) { 47325 stack.push((v - 247) * 256 + code[i++] + 108); 47326 } else if (v < 255) {
47327 stack.push(-(v - 251) * 256 - code[i++] - 108); 47328 } else { 47329 stack.push((code[i] << 24 | code[i + 1] << 16 | code[i + 2] << 8 | code[i + 3]) / 65536); 47330 i += 4; 47331 } 47332 47333 break; 47334 } 47335 47336 if (stackClean) { 47337 stack.length = 0; 47338 } 47339 } 47340 } 47341 47342 parse(code); 47343 } 47344 47345 var NOOP = []; 47346 47347 var CompiledFont = 47348 /*#__PURE__*/ 47349 function () { 47350 function CompiledFont(fontMatrix) { 47351 _classCallCheck(this, CompiledFont); 47352 47353 if (this.constructor === CompiledFont) { 47354 (0, _util.unreachable)('Cannot initialize CompiledFont.'); 47355 } 47356 47357 this.fontMatrix = fontMatrix; 47358 this.compiledGlyphs = Object.create(null); 47359 this.compiledCharCodeToGlyphId = Object.create(null); 47360 } 47361 47362 _createClass(CompiledFont, [{ 47363 key: "getPathJs", 47364 value: function getPathJs(unicode) { 47365 var cmap = lookupCmap(this.cmap, unicode); 47366 var fn = this.compiledGlyphs[cmap.glyphId]; 47367 47368 if (!fn) { 47369 fn = this.compileGlyph(this.glyphs[cmap.glyphId], cmap.glyphId); 47370 this.compiledGlyphs[cmap.glyphId] = fn; 47371 } 47372
47373 if (this.compiledCharCodeToGlyphId[cmap.charCode] === undefined) { 47374 this.compiledCharCodeToGlyphId[cmap.charCode] = cmap.glyphId; 47375 } 47376 47377 return fn; 47378 } 47379 }, { 47380 key: "compileGlyph", 47381 value: function compileGlyph(code, glyphId) { 47382 if (!code || code.length === 0 || code[0] === 14) { 47383 return NOOP; 47384 } 47385 47386 var fontMatrix = this.fontMatrix; 47387 47388 if (this.isCFFCIDFont) { 47389 var fdIndex = this.fdSelect.getFDIndex(glyphId); 47390 47391 if (fdIndex >= 0 && fdIndex < this.fdArray.length) { 47392 var fontDict = this.fdArray[fdIndex]; 47393 fontMatrix = fontDict.getByName('FontMatrix') || _util.FONT_IDENTITY_MATRIX; 47394 } else { 47395 (0, _util.warn)('Invalid fd index for glyph index.'); 47396 } 47397 } 47398 47399 var cmds = []; 47400 cmds.push({ 47401 cmd: 'save' 47402 }); 47403 cmds.push({ 47404 cmd: 'transform', 47405 args: fontMatrix.slice() 47406 }); 47407 cmds.push({ 47408 cmd: 'scale', 47409 args: ['size', '-size'] 47410 }); 47411 this.compileGlyphImpl(code, cmds, glyphId); 47412 cmds.push({ 47413 cmd: 'restore' 47414 }); 47415 return cmds; 47416 } 47417 }, { 47418 key: "compileGlyphImpl", 47419 value: function compileGlyphImpl() { 47420 (0, _util.unreachable)('Children classes should implement this.'); 47421 } 47422 }, { 47423 key: "hasBuiltPath", 47424 value: function hasBuiltPath(unicode) { 47425 var cmap = lookupCmap(this.cmap, unicode); 47426 return this.compiledGlyphs[cmap.glyphId] !== undefined && this.compiledCharCodeToGlyphId[cmap.charCo
47426de] !== undefined; 47427 } 47428 }]); 47429 47430 return CompiledFont; 47431 }(); 47432 47433 var TrueTypeCompiled = 47434 /*#__PURE__*/ 47435 function (_CompiledFont) { 47436 _inherits(TrueTypeCompiled, _CompiledFont); 47437 47438 function TrueTypeCompiled(glyphs, cmap, fontMatrix) { 47439 var _this; 47440 47441 _classCallCheck(this, TrueTypeCompiled); 47442 47443 _this = _possibleConstructorReturn(this, _getPrototypeOf(TrueTypeCompiled).call(this, fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0])); 47444 _this.glyphs = glyphs; 47445 _this.cmap = cmap; 47446 return _this; 47447 } 47448 47449 _createClass(TrueTypeCompiled, [{ 47450 key: "compileGlyphImpl", 47451 value: function compileGlyphImpl(code, cmds) { 47452 compileGlyf(code, cmds, this); 47453 } 47454 }]); 47455 47456 return TrueTypeCompiled; 47457 }(CompiledFont); 47458 47459 var Type2Compiled = 47460 /*#__PURE__*/ 47461 function (_CompiledFont2) { 47462 _inherits(Type2Compiled, _CompiledFont2); 47463 47464 function Type2Compiled(cffInfo, cmap, fontMatrix, glyphNameMap) { 47465 var _this2; 47466 47467 _classCallCheck(this, Type2Compiled); 47468 47469 _this2 = _possibleConstructorReturn(this, _getPrototypeOf(Type2Compiled).call(this, fontMatrix || [0.001, 0, 0, 0.001, 0, 0])); 47470 _this2.glyphs = cffInfo.glyphs; 47471 _this2.gsubrs = cffInfo.gsubrs || []; 47472 _this2.subrs = cffInfo.subrs || []; 47473 _this2.cmap = cmap; 47474 _this2.glyphNameMap = glyphNameMap || (0, _glyphlist.getGlyphsUnicode)(); 47475 _this2.gsubrsBias = _this2.gsubrs.length < 1240 ? 107 : _this2.gsubrs.length < 33900 ? 1131 : 32768; 47476 _this2.subrsBias = _this2.subrs.length < 1240 ? 107 : _this2.subrs.length < 33900 ? 1131 : 32768; 47477 _this2.isCFFCIDFont = cffInfo.isCFFCIDFont; 47478 _this2.fdSelect = cffInfo.fdSelect; 47479 _this2.fdArray = cffInfo.fdArray; 47480 return _this2; 47481 } 47482 47483 _createClass(Type2Compiled, [{ 47484 key: "compileGlyphImpl", 47485 value: function compileGlyphImpl(code, cmds, glyphId) { 47486 compileCharString(code, cmds, this, glyphId); 47487 } 47488 }]); 47489 47490 return Type2Compiled; 47491 }(CompiledFont); 47492 47493 return { 47494 create: function FontRendererFactory_create(font, seacAnalysisEnabled) { 47495 var data = new Uint8Array(font.data); 47496 var cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm; 47497 var numTables = getUshort(data, 4); 47498 47499 for (var i = 0, p = 12; i < numTables; i++, p += 16) { 47500 var tag = (0, _util.bytesToString)(data.subarray(p, p + 4)); 47501 var offset = getLong(data, p + 8); 47502 var length = getLong(data, p + 12); 47503 47504 switch (tag) { 47505 case 'cmap': 47506 cmap = parseCmap(data, offset, offset + length); 47507 break; 47508 47509 case 'glyf': 47510 glyf = data.subarray(offset, offset + length); 47511 break; 47512 47513 case 'loca': 47514 loca = data.subarray(offset, offset + length); 47515 break; 47516 47517 case 'head': 47518 unitsPerEm = getUshort(data, offset + 18); 47519 indexToLocFormat = getUshort(data, offset + 50); 47520 break; 47521 47522 case 'CFF ': 47523 cff = parseCff(data, offset, offset + length, seacAnalysisEnabled); 47524 break; 47525 } 47526 } 47527 47528 if (glyf) { 47529 var fontMatrix = !unitsPerEm ? font.fontMatrix : [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]; 47530 return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); 47531 } 47532 47533 return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); 47534 } 47535 }; 47536}(); 47537 47538exports.FontRendererFactory = FontRendererFactory; 47539 47540/***/ }), 47541/* 181 */ 47542/***/ (function(module, exports, __w_pdfjs_require__) { 47543 47544"use strict"; 47545 47546 47547Object.defineProperty(exports, "__esModule", { 47548 value: true 47549}); 47550exports.Type1Parser = void 0; 47551 47552var _util = __w_pdfjs_require__(6); 47553 47554var _encodings = __w_pdfjs_require__(176); 47555 47556var _stream = __w_pdfjs_require__(157); 47557 47558var HINTING_ENABLED = false; 47559 47560var Type1CharString = function Type1CharStringClosure() { 47561 var COMMAND_MAP = { 47562 'hstem': [1], 47563 'vstem': [3], 47564 'vmoveto': [4], 47565 'rlineto': [5], 47566 'hlineto': [6], 47567 'vlineto': [7], 47568 'rrcurveto': [8], 47569 'callsubr': [10], 47570 'flex': [12, 35], 47571 'drop': [12, 18], 47572 'endchar': [14], 47573 'rmoveto': [21], 47574 'hmoveto': [22], 47575 'vhcurveto': [30], 47576 'hvcurveto': [31] 47577 }; 47578 47579 function Type1CharString() { 47580 this.width = 0; 47581 this.lsb = 0; 47582 this.flexing = false; 47583 this.output = []; 47584 this.stack = []; 47585 } 47586 47587 Type1CharString.prototype = { 47588 convert: function Type1CharString_convert(encoded, subrs, seacAnalysisEnabled) { 47589 var count = encoded.length; 47590 var error = false; 47591 var wx, sbx, subrNumber; 47592 47593 for (var i = 0; i < count; i++) { 47594 var value = encoded[i]; 47595 47596 if (value < 32) { 47597 if (value === 12) { 47598 value = (value << 8) + encoded[++i]; 47599 } 47600 47601 switch (value) { 47602 case 1: 47603 if (!HINTING_ENABLED) { 47604 this.stack = []; 47605 break; 47606 } 47607 47608 error = this.executeCommand(2, COMMAND_MAP.hstem); 47609 break; 47610 47611 case 3: 47612 if (!HINTING_ENABLED) { 47613 this.stack = []; 47614 break; 47615 } 47616 47617 error = this.executeCommand(2, COMMAND_MAP.vstem); 47618 break; 47619 47620 case 4: 47621 if (this.flexing) { 47622 if (this.stack.length < 1) { 47623 error = true; 47624 break; 47625 } 47626 47627 var dy = this.stack.pop(); 47628 this.stack.push(0, dy); 47629 break; 47630 } 47631 47632 error = this.executeCommand(1, COMMAND_MAP.vmoveto); 47633 break; 47634 47635 case 5: 47636 error = this.executeCommand(2, COMMAND_MAP.rlineto); 47637 break; 47638 47639 case 6: 47640 error = this.executeCommand(1, COMMAND_MAP.hlineto); 47641 break; 47642 47643 case 7: 47644 error = this.executeCommand(1, COMMAND_MAP.vlineto); 47645 break; 47646 47647 case 8: 47648 error = this.executeCommand(6, COMMAND_MAP.rrcurveto); 47649 break; 47650 47651 case 9: 47652 this.stack = []; 47653 break; 47654 47655 case 10: 47656 if (this.stack.length < 1) { 47657 error = true; 47658 break; 47659 } 47660 47661 subrNumber = this.stack.pop(); 47662 47663 if (!subrs[subrNumber]) { 47664 error = true; 47665 break; 47666 } 47667 47668 error = this.convert(subrs[subrNumber], subrs, seacAnalysisEnabled); 47669 break; 47670 47671 case 11: 47672 return error; 47673 47674 case 13: 47675 if (this.stack.length < 2) { 47676 error = true; 47677 break; 47678 } 47679 47680 wx = this.stack.pop(); 47681 sbx = this.stack.pop(); 47682 this.lsb = sbx; 47683 this.width = wx; 47684 this.stack.push(wx, sbx); 47685 error = this.executeCommand(2, COMMAND_MAP.hmoveto); 47686 break; 47687 47688 case 14: 47689 this.output.push(COMMAND_MAP.endchar[0]); 47690 break; 47691 47692 case 21: 47693 if (this.flexing) { 47694 break; 47695 } 47696 47697 error = this.executeCommand(2, COMMAND_MAP.rmoveto); 47698 break; 47699 47700 case 22: 47701 if (this.flexing) { 47702 this.stack.push(0); 47703 break; 47704 } 47705 47706 error = this.executeCommand(1, COMMAND_MAP.hmoveto); 47707 break; 47708 47709 case 30: 47710 error = this.executeCommand(4, COMMAND_MAP.vhcurveto); 47711 break; 47712 47713 case 31: 47714 error = this.executeCommand(4, COMMAND_MAP.hvcurveto); 47715 break; 47716 47717 case (12 << 8) + 0: 47718 this.stack = []; 47719 break; 47720 47721 case (12 << 8) + 1: 47722 if (!HINTING_ENABLED) { 47723 this.stack = []; 47724 break; 47725 } 47726 47727 error = this.executeCommand(2, COMMAND_MAP.vstem); 47728 break; 47729 47730 case (12 << 8) + 2: 47731 if (!HINTING_ENABLED) { 47732 this.stack = []; 47733 break; 47734 } 47735 47736 error = this.executeCommand(2, COMMAND_MAP.hstem); 47737 break; 47738 47739 case (12 << 8) + 6: 47740 if (seacAnalysisEnabled) { 47741 this.seac = this.stack.splice(-4, 4); 47742 error = this.executeCommand(0, COMMAND_MAP.endchar); 47743 } else { 47744 error = this.executeCommand(4, COMMAND_MAP.endchar); 47745 } 47746 47747 break; 47748 47749 case (12 << 8) + 7: 47750 if (this.stack.length < 4) { 47751 error = true; 47752 break; 47753 } 47754 47755 this.stack.pop(); 47756 wx = this.stack.pop(); 47757 var sby = this.stack.pop(); 47758 sbx = this.stack.pop(); 47759 this.lsb = sbx; 47760 this.width = wx; 47761 this.stack.push(wx, sbx, sby); 47762 error = this.executeCommand(3, COMMAND_MAP.rmoveto); 47763 break; 47764 47765 case (12 << 8) + 12: 47766 if (this.stack.length < 2) { 47767 error = true; 47768 break; 47769 } 47770 47771 var num2 = this.stack.pop(); 47772 var num1 = this.stack.pop(); 47773 this.stack.push(num1 / num2); 47774 break; 47775 47776 case (12 << 8) + 16: 47777 if (this.stack.length < 2) { 47778 error = true; 47779 break; 47780 } 47781 47782 subrNumber = this.stack.pop(); 47783 var numArgs = this.stack.pop(); 47784 47785 if (subrNumber === 0 && numArgs === 3) { 47786 var flexArgs = this.stack.splice(this.stack.length - 17, 17); 47787 this.stack.push(flexArgs[2] + flexArgs[0], flexArgs[3] + flexArgs[1], flexArgs[4], flexArgs[5], flexArgs[6], flexArgs[7], flexArgs[8], flexArgs[9], flexArgs[10], flexArgs[11], flexArgs[12], flexArgs[13], flexArgs[14]); 47788 error = this.executeCommand(13, COMMAND_MAP.flex, true); 47789 this.flexing = false; 47790 this.stack.push(flexArgs[15], flexArgs[16]); 47791 } else if (subrNumber === 1 && numArgs === 0) { 47792 this.flexing = true; 47793 } 47794 47795 break; 47796 47797 case (12 << 8) + 17: 47798 break; 47799 47800 case (12 << 8) + 33: 47801 this.stack = []; 47802 break; 47803 47804 default: 47805 (0, _util.warn)('Unknown type 1 charstring command of "' + value + '"'); 47806 break; 47807 } 47808 47809 if (error) { 47810 break; 47811 } 47812 47813 continue; 47814 } else if (value <= 246) { 47815 value = value - 139; 47816 } else if (value <= 250) { 47817 value = (value - 247) * 256 + encoded[++i] + 108; 47818 } else if (value <= 254) { 47819 value = -((value - 251) * 256) - encoded[++i] - 108; 47820 } else { 47821 value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0; 47822 } 47823 47824 this.stack.push(value); 47825 } 47826 47827 return error; 47828 }, 47829 executeCommand: function executeCommand(howManyArgs, command, keepStack) { 47830 var stackLength = this.stack.length; 47831 47832 if (howManyArgs > stackLength) { 47833 return true; 47834 } 47835 47836 var start = stackLength - howManyArgs; 47837 47838 for (var i = start; i < stackLength; i++) { 47839 var value = this.stack[i]; 47840 47841 if (Number.isInteger(value)) { 47842 this.output.push(28, value >> 8 & 0xff, value & 0xff); 47843 } else { 47844 value = 65536 * value | 0; 47845 this.output.push(255, value >> 24 & 0xFF, value >> 16 & 0xFF, value >> 8 & 0xFF, value & 0xFF); 47846 } 47847 } 47848 47849 this.output.push.apply(this.output, command); 47850 47851 if (keepStack) { 47852 this.stack.splice(start, howManyArgs); 47853 } else { 47854 this.stack.length = 0; 47855 } 47856 47857 return false; 47858 } 47859 }; 47860 return Type1CharString; 47861}();
47862 47863var Type1Parser = function Type1ParserClosure() { 47864 var EEXEC_ENCRYPT_KEY = 55665; 47865 var CHAR_STRS_ENCRYPT_KEY = 4330; 47866 47867 function isHexDigit(code) { 47868 return code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102; 47869 } 47870 47871 function decrypt(data, key, discardNumber) { 47872 if (discardNumber >= data.length) { 47873 return new Uint8Array(0); 47874 } 47875 47876 var r = key | 0, 47877 c1 = 52845, 47878 c2 = 22719, 47879 i, 47880 j; 47881 47882 for (i = 0; i < discardNumber; i++) { 47883 r = (data[i] + r) * c1 + c2 & (1 << 16) - 1; 47884 } 47885 47886 var count = data.length - discardNumber; 47887 var decrypted = new Uint8Array(count); 47888 47889 for (i = discardNumber, j = 0; j < count; i++, j++) { 47890 var value = data[i]; 47891 decrypted[j] = value ^ r >> 8; 47892 r = (value + r) * c1 + c2 & (1 << 16) - 1; 47893 } 47894 47895 return decrypted; 47896 } 47897 47898 function decryptAscii(data, key, discardNumber) { 47899 var r = key | 0, 47900 c1 = 52845, 47901 c2 = 22719; 47902 var count = data.length, 47903 maybeLength = count >>> 1; 47904 var decrypted = new Uint8Array(maybeLength); 47905 var i, j; 47906 47907 for (i = 0, j = 0; i < count; i++) { 47908 var digit1 = data[i]; 47909 47910 if (!isHexDigit(digit1)) { 47911 continue; 47912 } 47913 47914 i++; 47915 var digit2; 47916 47917 while (i < count && !isHexDigit(digit2 = data[i])) { 47918 i++; 47919 } 47920 47921 if (i < count) { 47922 var value = parseInt(String.fromCharCode(digit1, digit2), 16); 47923 decrypted[j++] = value ^ r >> 8; 47924 r = (value + r) * c1 + c2 & (1 << 16) - 1; 47925 } 47926 } 47927 47928 return Array.prototype.slice.call(decrypted, discardNumber, j); 47929 } 47930 47931 function isSpecial(c) { 47932 return c === 0x2F || c === 0x5B || c === 0x5D || c === 0x7B || c === 0x7D || c === 0x28 || c === 0x29; 47933 } 47934 47935 function Type1Parser(stream, encrypted, seacAnalysisEnabled) { 47936 if (encrypted) { 47937 var data = stream.getBytes(); 47938 var isBinary = !(isHexDigit(data[0]) && isHexDigit(data[1]) && isHexDigit(data[2]) && isHexDigit(data[3])); 47939 stream = new _stream.Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : decryptAscii(data, EEXEC_ENCRYPT_KEY, 4)); 47940 } 47941 47942 this.seacAnalysisEnabled = !!seacAnalysisEnabled; 47943 this.stream = stream; 47944 this.nextChar(); 47945 } 47946 47947 Type1Parser.prototype = { 47948 readNumberArray: function Type1Parser_readNumberArray() { 47949 this.getToken(); 47950 var array = []; 47951 47952 while (true) { 47953 var token = this.getToken(); 47954 47955 if (token === null || token === ']' || token === '}') { 47956 break; 47957 } 47958 47959 array.push(parseFloat(token || 0)); 47960 } 47961 47962 return array; 47963 }, 47964 readNumber: function Type1Parser_readNumber() { 47965 var token = this.getToken(); 47966 return parseFloat(token || 0); 47967 }, 47968 readInt: function Type1Parser_readInt() { 47969 var token = this.getToken(); 47970 return parseInt(token || 0, 10) | 0; 47971 }, 47972 readBoolean: function Type1Parser_readBoolean() { 47973 var token = this.getToken(); 47974 return token === 'true' ? 1 : 0; 47975 }, 47976 nextChar: function Type1_nextChar() { 47977 return this.currentChar = this.stream.getByte(); 47978 }, 47979 getToken: function Type1Parser_getToken() { 47980 var comment = false; 47981 var ch = this.currentChar; 47982 47983 while (true) { 47984 if (ch === -1) { 47985 return null; 47986 } 47987 47988 if (comment) { 47989 if (ch === 0x0A || ch === 0x0D) { 47990 comment = false; 47991 } 47992 } else if (ch === 0x25) { 47993 comment = true; 47994 } else if (!(0, _util.isSpace)(ch)) { 47995 break; 47996 } 47997 47998 ch = this.nextChar(); 47999 } 48000 48001 if (isSpecial(ch)) { 48002 this.nextChar(); 48003 return String.fromCharCode(ch); 48004 } 48005 48006 var token = ''; 48007 48008 do { 48009 token += String.fromCharCode(ch); 48010 ch = this.nextChar(); 48011 } while (ch >= 0 && !(0, _util.isSpace)(ch) && !isSpecial(ch)); 48012 48013 return token; 48014 }, 48015 readCharStrings: function Type1Parser_readCharStrings(bytes, lenIV) { 48016 if (lenIV === -1) { 48017 return bytes; 48018 } 48019 48020 return decrypt(bytes, CHAR_STRS_ENCRYPT_KEY, lenIV); 48021 }, 48022 extractFontProgram: function Type1Parser_extractFontProgram() { 48023 var stream = this.stream; 48024 var subrs = [], 48025 charstrings = []; 48026 var privateData = Object.create(null); 48027 privateData['lenIV'] = 4; 48028 var program = { 48029 subrs: [], 48030 charstrings: [], 48031 properties: { 48032 'privateData': privateData 48033 } 48034 }; 48035 var token, length, data, lenIV, encoded; 48036 48037 while ((token = this.getToken()) !== null) { 48038 if (token !== '/') { 48039 continue; 48040 } 48041 48042 token = this.getToken(); 48043 48044 switch (token) { 48045 case 'CharStrings': 48046 this.getToken(); 48047 this.getToken(); 48048 this.getToken(); 48049 this.getToken(); 48050 48051 while (true) { 48052 token = this.getToken(); 48053 48054 if (token === null || token === 'end') { 48055 break; 48056 } 48057 48058 if (token !== '/') { 48059 continue; 48060 } 48061 48062 var glyph = this.getToken(); 48063 length = this.readInt(); 48064 this.getToken(); 48065 data = length > 0 ? stream.getBytes(length) : new Uint8Array(0); 48066 lenIV = program.properties.privateData['lenIV']; 48067 encoded = this.readCharStrings(data, lenIV); 48068 this.nextChar(); 48069 token = this.getToken(); 48070 48071 if (token === 'noaccess') { 48072 this.getToken(); 48073 } 48074 48075 charstrings.push({ 48076 glyph: glyph, 48077 encoded: encoded 48078 }); 48079 } 48080 48081 break; 48082 48083 case 'Subrs': 48084 this.readInt(); 48085 this.getToken(); 48086 48087 while (this.getToken() === 'dup') { 48088 var index = this.readInt(); 48089 length = this.readInt(); 48090 this.getToken(); 48091 data = length > 0 ? stream.getBytes(length) : new Uint8Array(0); 48092 lenIV = program.properties.privateData['lenIV']; 48093 encoded = this.readCharStrings(data, lenIV); 48094 this.nextChar(); 48095 token = this.getToken(); 48096 48097 if (token === 'noaccess') { 48098 this.getToken(); 48099 } 48100 48101 subrs[index] = encoded; 48102 } 48103 48104 break; 48105 48106 case 'BlueValues': 48107 case 'OtherBlues': 48108 case 'FamilyBlues': 48109 case 'FamilyOtherBlues': 48110 var blueArray = this.readNumberArray(); 48111 48112 if (blueArray.length > 0 && blueArray.length % 2 === 0 && HINTING_ENABLED) { 48113 program.properties.privateData[token] = blueArray; 48114 } 48115 48116 break; 48117 48118 case 'StemSnapH': 48119 case 'StemSnapV': 48120 program.properties.privateData[token] = this.readNumberArray(); 48121 break; 48122 48123 case 'StdHW': 48124 case 'StdVW': 48125 program.properties.privateData[token] = this.readNumberArray()[0]; 48126 break; 48127
48128 case 'BlueShift': 48129 case 'lenIV': 48130 case 'BlueFuzz': 48131 case 'BlueScale': 48132 case 'LanguageGroup': 48133 case 'ExpansionFactor': 48134 program.properties.privateData[token] = this.readNumber(); 48135 break; 48136 48137 case 'ForceBold': 48138 program.properties.privateData[token] = this.readBoolean(); 48139 break; 48140 } 48141 } 48142 48143 for (var i = 0; i < charstrings.length; i++) { 48144 glyph = charstrings[i].glyph; 48145 encoded = charstrings[i].encoded; 48146 var charString = new Type1CharString(); 48147 var error = charString.convert(encoded, subrs, this.seacAnalysisEnabled); 48148 var output = charString.output; 48149 48150 if (error) { 48151 output = [14]; 48152 } 48153 48154 program.charstrings.push({ 48155 glyphName: glyph, 48156 charstring: output, 48157 width: charString.width, 48158 lsb: charString.lsb, 48159 seac: charString.seac 48160 }); 48161 } 48162 48163 return program; 48164 }, 48165 extractFontHeader: function Type1Parser_extractFontHeader(properties) { 48166 var token; 48167 48168 while ((token = this.getToken()) !== null) { 48169 if (token !== '/') { 48170 continue; 48171 } 48172 48173 token = this.getToken(); 48174 48175 switch (token) { 48176 case 'FontMatrix': 48177 var matrix = this.readNumberArray(); 48178 properties.fontMatrix = matrix; 48179 break; 48180 48181 case 'Encoding': 48182 var encodingArg = this.getToken(); 48183 var encoding; 48184 48185 if (!/^\d+$/.test(encodingArg)) { 48186 encoding = (0, _encodings.getEncoding)(encodingArg); 48187 } else { 48188 encoding = []; 48189 var size = parseInt(encodingArg, 10) | 0; 48190 this.getToken(); 48191 48192 for (var j = 0; j < size; j++) { 48193 token = this.getToken(); 48194 48195 while (token !== 'dup' && token !== 'def') { 48196 token = this.getToken(); 48197 48198 if (token === null) { 48199 return; 48200 } 48201 } 48202 48203 if (token === 'def') { 48204 break; 48205 } 48206 48207 var index = this.readInt(); 48208 this.getToken(); 48209 var glyph = this.getToken(); 48210 encoding[index] = glyph; 48211 this.getToken(); 48212 } 48213 } 48214 48215 properties.builtInEncoding = encoding; 48216 break; 48217 48218 case 'FontBBox': 48219 var fontBBox = this.readNumberArray(); 48220 properties.ascent = Math.max(fontBBox[3], fontBBox[1]); 48221 properties.descent = Math.min(fontBBox[1], fontBBox[3]); 48222 properties.ascentScaled = true; 48223 break; 48224 } 48225 } 48226 } 48227 }; 48228 return Type1Parser; 48229}(); 48230 48231exports.Type1Parser = Type1Parser; 48232 48233/***/ }), 48234/* 182 */ 48235/***/ (function(module, exports, __w_pdfjs_require__) { 48236 48237"use strict"; 48238 48239 48240Object.defineProperty(exports, "__esModule", { 48241 value: true 48242}); 48243exports.getTilingPatternIR = getTilingPatternIR; 48244exports.Pattern = void 0; 48245 48246var _util = __w_pdfjs_require__(6); 48247 48248var _colorspace = __w_pdfjs_require__(168); 48249 48250var _primitives = __w_pdfjs_require__(155); 48251 48252var ShadingType = { 48253 FUNCTION_BASED: 1, 48254 AXIAL: 2, 48255 RADIAL: 3, 48256 FREE_FORM_MESH: 4, 48257 LATTICE_FORM_MESH: 5, 48258 COONS_PATCH_MESH: 6, 48259 TENSOR_PATCH_MESH: 7 48260}; 48261 48262var Pattern = function PatternClosure() { 48263 function Pattern() { 48264 (0, _util.unreachable)('should not call Pattern constructor'); 48265 } 48266 48267 Pattern.prototype = { 48268 getPattern: function Pattern_getPattern(ctx) { 48269 (0, _util.unreachable)("Should not call Pattern.getStyle: ".concat(ctx)); 48270 } 48271 }; 48272 48273 Pattern.parseShading = function (shading, matrix, xref, res, handler, pdfFunctionFactory) { 48274 var dict = (0, _primitives.isStream)(shading) ? shading.dict : shading; 48275 var type = dict.get('ShadingType'); 48276 48277 try { 48278 switch (type) { 48279 case ShadingType.AXIAL: 48280 case ShadingType.RADIAL: 48281 return new Shadings.RadialAxial(dict, matrix, xref, res, pdfFunctionFactory); 48282 48283 case ShadingType.FREE_FORM_MESH: 48284 case ShadingType.LATTICE_FORM_MESH: 48285 case ShadingType.COONS_PATCH_MESH: 48286 case ShadingType.TENSOR_PATCH_MESH: 48287 return new Shadings.Mesh(shading, matrix, xref, res, pdfFunctionFactory); 48288 48289 default: 48290 throw new _util.FormatError('Unsupported ShadingType: ' + type); 48291 } 48292 } catch (ex) { 48293 if (ex instanceof _util.MissingDataException) { 48294 throw ex; 48295 } 48296 48297 handler.send('UnsupportedFeature', { 48298 featureId: _util.UNSUPPORTED_FEATURES.shadingPattern 48299 }); 48300 (0, _util.warn)(ex); 48301 return new Shadings.Dummy(); 48302 } 48303 }; 48304 48305 return Pattern; 48306}(); 48307 48308exports.Pattern = Pattern; 48309var Shadings = {}; 48310Shadings.SMALL_NUMBER = 1e-6; 48311
48312Shadings.RadialAxial = function RadialAxialClosure() { 48313 function RadialAxial(dict, matrix, xref, res, pdfFunctionFactory) { 48314 this.matrix = matrix; 48315 this.coordsArr = dict.getArray('Coords'); 48316 this.shadingType = dict.get('ShadingType'); 48317 this.type = 'Pattern'; 48318 var cs = dict.get('ColorSpace', 'CS'); 48319 cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory); 48320 this.cs = cs; 48321 var t0 = 0.0, 48322 t1 = 1.0; 48323 48324 if (dict.has('Domain')) { 48325 var domainArr = dict.getArray('Domain'); 48326 t0 = domainArr[0]; 48327 t1 = domainArr[1]; 48328 } 48329 48330 var extendStart = false, 48331 extendEnd = false; 48332 48333 if (dict.has('Extend')) { 48334 var extendArr = dict.getArray('Extend'); 48335 extendStart = extendArr[0]; 48336 extendEnd = extendArr[1]; 48337 } 48338 48339 if (this.shadingType === ShadingType.RADIAL && (!extendStart || !extendEnd)) { 48340 var x1 = this.coordsArr[0]; 48341 var y1 = this.coordsArr[1]; 48342 var r1 = this.coordsArr[2]; 48343 var x2 = this.coordsArr[3]; 48344 var y2 = this.coordsArr[4]; 48345 var r2 = this.coordsArr[5]; 48346 var distance = Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)); 48347 48348 if (r1 <= r2 + distance && r2 <= r1 + distance) { 48349 (0, _util.warn)('Unsupported radial gradient.'); 48350 } 48351 } 48352 48353 this.extendStart = extendStart; 48354 this.extendEnd = extendEnd; 48355 var fnObj = dict.get('Function'); 48356 var fn = pdfFunctionFactory.createFromArray(fnObj); 48357 var diff = t1 - t0; 48358 var step = diff / 10; 48359 var colorStops = this.colorStops = []; 48360 48361 if (t0 >= t1 || step <= 0) { 48362 (0, _util.info)('Bad shading domain.'); 48363 return; 48364 } 48365 48366 var color = new Float32Array(cs.numComps), 48367 ratio = new Float32Array(1); 48368 var rgbColor; 48369 48370 for (var i = t0; i <= t1; i += step) { 48371 ratio[0] = i; 48372 fn(ratio, 0, color, 0); 48373 rgbColor = cs.getRgb(color, 0); 48374 48375 var cssColor = _util.Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); 48376 48377 colorStops.push([(i - t0) / diff, cssColor]); 48378 } 48379 48380 var background = 'transparent'; 48381 48382 if (dict.has('Background')) { 48383 rgbColor = cs.getRgb(dict.get('Background'), 0); 48384 background = _util.Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]); 48385 } 48386 48387 if (!extendStart) { 48388 colorStops.unshift([0, background]); 48389 colorStops[1][0] += Shadings.SMALL_NUMBER; 48390 } 48391 48392 if (!extendEnd) { 48393 colorStops[colorStops.length - 1][0] -= Shadings.SMALL_NUMBER; 48394 colorStops.push([1, background]); 48395 } 48396 48397 this.colorStops = colorStops; 48398 } 48399 48400 RadialAxial.prototype = { 48401 getIR: function RadialAxial_getIR() { 48402 var coordsArr = this.coordsArr; 48403 var shadingType = this.shadingType; 48404 var type, p0, p1, r0, r1; 48405 48406 if (shadingType === ShadingType.AXIAL) { 48407 p0 = [coordsArr[0], coordsArr[1]]; 48408 p1 = [coordsArr[2], coordsArr[3]]; 48409 r0 = null; 48410 r1 = null; 48411 type = 'axial'; 48412 } else if (shadingType === ShadingType.RADIAL) { 48413 p0 = [coordsArr[0], coordsArr[1]]; 48414 p1 = [coordsArr[3], coordsArr[4]]; 48415 r0 = coordsArr[2]; 48416 r1 = coordsArr[5]; 48417 type = 'radial'; 48418 } else { 48419 (0, _util.unreachable)("getPattern type unknown: ".concat(shadingType)); 48420 } 48421 48422 var matrix = this.matrix; 48423 48424 if (matrix) { 48425 p0 = _util.Util.applyTransform(p0, matrix); 48426 p1 = _util.Util.applyTransform(p1, matrix); 48427 48428 if (shadingType === ShadingType.RADIAL) { 48429 var scale = _util.Util.singularValueDecompose2dScale(matrix); 48430 48431 r0 *= scale[0]; 48432 r1 *= scale[1]; 48433 } 48434 } 48435 48436 return ['RadialAxial', type, this.colorStops, p0, p1, r0, r1]; 48437 } 48438 }; 48439 return RadialAxial; 48440}(); 48441 48442Shadings.Mesh = function MeshClosure() { 48443 function MeshStreamReader(stream, context) { 48444 this.stream = stream; 48445 this.context = context; 48446 this.buffer = 0; 48447 this.bufferLength = 0; 48448 var numComps = context.numComps; 48449 this.tmpCompsBuf = new Float32Array(numComps); 48450 var csNumComps = context.colorSpace.numComps; 48451 this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : this.tmpCompsBuf; 48452 } 48453 48454 MeshStreamReader.prototype = { 48455 get hasData() { 48456 if (this.stream.end) { 48457 return this.stream.pos < this.stream.end; 48458 } 48459 48460 if (this.bufferLength > 0) { 48461 return true; 48462 } 48463 48464 var nextByte = this.stream.getByte(); 48465 48466 if (nextByte < 0) { 48467 return false; 48468 } 48469 48470 this.buffer = nextByte; 48471 this.bufferLength = 8; 48472 return true; 48473 }, 48474 48475 readBits: function MeshStreamReader_readBits(n) { 48476 var buffer = this.buffer; 48477 var bufferLength = this.bufferLength; 48478 48479 if (n === 32) { 48480 if (bufferLength === 0) { 48481 return (this.stream.getByte() << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte()) >>> 0; 48482 } 48483 48484 buffer = buffer << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte(); 48485 var nextByte = this.stream.getByte(); 48486 this.buffer = nextByte & (1 << bufferLength) - 1; 48487 return (buffer << 8 - bufferLength | (nextByte & 0xFF) >> bufferLength) >>> 0; 48488 } 48489 48490 if (n === 8 && bufferLength === 0) { 48491 return this.stream.getByte(); 48492 } 48493 48494 while (bufferLength < n) { 48495 buffer = buffer << 8 | this.stream.getByte(); 48496 bufferLength += 8; 48497 } 48498 48499 bufferLength -= n; 48500 this.bufferLength = bufferLength; 48501 this.buffer = buffer & (1 << bufferLength) - 1; 48502 return buffer >> bufferLength; 48503 },
vendor: 17,341 bytes, lines 48504-49056
48504 align: function MeshStreamReader_align() { 48505 this.buffer = 0; 48506 this.bufferLength = 0; 48507 }, 48508 readFlag: function MeshStreamReader_readFlag() { 48509 return this.readBits(this.context.bitsPerFlag); 48510 }, 48511 readCoordinate: function MeshStreamReader_readCoordinate() { 48512 var bitsPerCoordinate = this.context.bitsPerCoordinate; 48513 var xi = this.readBits(bitsPerCoordinate); 48514 var yi = this.readBits(bitsPerCoordinate); 48515 var decode = this.context.decode; 48516 var scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : 2.3283064365386963e-10; 48517 return [xi * scale * (decode[1] - decode[0]) + decode[0], yi * scale * (decode[3] - decode[2]) + decode[2]]; 48518 }, 48519 readComponents: function MeshStreamReader_readComponents() { 48520 var numComps = this.context.numComps; 48521 var bitsPerComponent = this.context.bitsPerComponent; 48522 var scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : 2.3283064365386963e-10; 48523 var decode = this.context.decode; 48524 var components = this.tmpCompsBuf; 48525 48526 for (var i = 0, j = 4; i < numComps; i++, j += 2) { 48527 var ci = this.readBits(bitsPerComponent); 48528 components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j]; 48529 } 48530 48531 var color = this.tmpCsCompsBuf; 48532 48533 if (this.context.colorFn) { 48534 this.context.colorFn(components, 0, color, 0); 48535 } 48536 48537 return this.context.colorSpace.getRgb(color, 0); 48538 } 48539 }; 48540 48541 function decodeType4Shading(mesh, reader) { 48542 var coords = mesh.coords; 48543 var colors = mesh.colors; 48544 var operators = []; 48545 var ps = []; 48546 var verticesLeft = 0; 48547 48548 while (reader.hasData) { 48549 var f = reader.readFlag(); 48550 var coord = reader.readCoordinate(); 48551 var color = reader.readComponents(); 48552 48553 if (verticesLeft === 0) { 48554 if (!(0 <= f && f <= 2)) { 48555 throw new _util.FormatError('Unknown type4 flag'); 48556 } 48557 48558 switch (f) { 48559 case 0: 48560 verticesLeft = 3; 48561 break; 48562 48563 case 1: 48564 ps.push(ps[ps.length - 2], ps[ps.length - 1]); 48565 verticesLeft = 1; 48566 break; 48567 48568 case 2: 48569 ps.push(ps[ps.length - 3], ps[ps.length - 1]); 48570 verticesLeft = 1; 48571 break; 48572 } 48573 48574 operators.push(f); 48575 } 48576 48577 ps.push(coords.length); 48578 coords.push(coord); 48579 colors.push(color); 48580 verticesLeft--; 48581 reader.align(); 48582 } 48583 48584 mesh.figures.push({ 48585 type: 'triangles', 48586 coords: new Int32Array(ps), 48587 colors: new Int32Array(ps) 48588 }); 48589 } 48590 48591 function decodeType5Shading(mesh, reader, verticesPerRow) { 48592 var coords = mesh.coords; 48593 var colors = mesh.colors; 48594 var ps = []; 48595 48596 while (reader.hasData) { 48597 var coord = reader.readCoordinate(); 48598 var color = reader.readComponents(); 48599 ps.push(coords.length); 48600 coords.push(coord); 48601 colors.push(color); 48602 } 48603 48604 mesh.figures.push({ 48605 type: 'lattice', 48606 coords: new Int32Array(ps), 48607 colors: new Int32Array(ps), 48608 verticesPerRow: verticesPerRow 48609 }); 48610 } 48611 48612 var MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3; 48613 var MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20; 48614 var TRIANGLE_DENSITY = 20; 48615 48616 var getB = function getBClosure() { 48617 function buildB(count) { 48618 var lut = []; 48619 48620 for (var i = 0; i <= count; i++) { 48621 var t = i / count, 48622 t_ = 1 - t; 48623 lut.push(new Float32Array([t_ * t_ * t_, 3 * t * t_ * t_, 3 * t * t * t_, t * t * t])); 48624 } 48625 48626 return lut; 48627 } 48628 48629 var cache = []; 48630 return function getB(count) { 48631 if (!cache[count]) { 48632 cache[count] = buildB(count); 48633 } 48634 48635 return cache[count]; 48636 }; 48637 }(); 48638 48639 function buildFigureFromPatch(mesh, index) { 48640 var figure = mesh.figures[index]; 48641 (0, _util.assert)(figure.type === 'patch', 'Unexpected patch mesh figure'); 48642 var coords = mesh.coords, 48643 colors = mesh.colors; 48644 var pi = figure.coords; 48645 var ci = figure.colors; 48646 var figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); 48647 var figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); 48648 var figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); 48649 var figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); 48650 var splitXBy = Math.ceil((figureMaxX - figureMinX) * TRIANGLE_DENSITY / (mesh.bounds[2] - mesh.bounds[0])); 48651 splitXBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy)); 48652 var splitYBy = Math.ceil((figureMaxY - figureMinY) * TRIANGLE_DENSITY / (mesh.bounds[3] - mesh.bounds[1])); 48653 splitYBy = Math.max(MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy)); 48654 var verticesPerRow = splitXBy + 1; 48655 var figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow); 48656 var figureColors = new Int32Array((splitYBy + 1) * verticesPerRow); 48657 var k = 0; 48658 var cl = new Uint8Array(3), 48659 cr = new Uint8Array(3); 48660 var c0 = colors[ci[0]], 48661 c1 = colors[ci[1]], 48662 c2 = colors[ci[2]], 48663 c3 = colors[ci[3]]; 48664 var bRow = getB(splitYBy), 48665 bCol = getB(splitXBy); 48666 48667 for (var row = 0; row <= splitYBy; row++) { 48668 cl[0] = (c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy | 0; 48669 cl[1] = (c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy | 0; 48670 cl[2] = (c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy | 0; 48671 cr[0] = (c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy | 0; 48672 cr[1] = (c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy | 0; 48673 cr[2] = (c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy | 0; 48674 48675 for (var col = 0; col <= splitXBy; col++, k++) { 48676 if ((row === 0 || row === splitYBy) && (col === 0 || col === splitXBy)) { 48677 continue; 48678 } 48679 48680 var x = 0, 48681 y = 0; 48682 var q = 0; 48683 48684 for (var i = 0; i <= 3; i++) { 48685 for (var j = 0; j <= 3; j++, q++) { 48686 var m = bRow[row][i] * bCol[col][j]; 48687 x += coords[pi[q]][0] * m; 48688 y += coords[pi[q]][1] * m; 48689 } 48690 } 48691 48692 figureCoords[k] = coords.length; 48693 coords.push([x, y]); 48694 figureColors[k] = colors.length; 48695 var newColor = new Uint8Array(3); 48696 newColor[0] = (cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy | 0; 48697 newColor[1] = (cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy | 0; 48698 newColor[2] = (cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy | 0; 48699 colors.push(newColor); 48700 } 48701 } 48702 48703 figureCoords[0] = pi[0]; 48704 figureColors[0] = ci[0]; 48705 figureCoords[splitXBy] = pi[3]; 48706 figureColors[splitXBy] = ci[1]; 48707 figureCoords[verticesPerRow * splitYBy] = pi[12]; 48708 figureColors[verticesPerRow * splitYBy] = ci[2]; 48709 figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15]; 48710 figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3]; 48711 mesh.figures[index] = { 48712 type: 'lattice', 48713 coords: figureCoords, 48714 colors: figureColors, 48715 verticesPerRow: verticesPerRow 48716 }; 48717 } 48718 48719 function decodeType6Shading(mesh, reader) { 48720 var coords = mesh.coords; 48721 var colors = mesh.colors; 48722 var ps = new Int32Array(16); 48723 var cs = new Int32Array(4); 48724 48725 while (reader.hasData) { 48726 var f = reader.readFlag(); 48727 48728 if (!(0 <= f && f <= 3)) { 48729 throw new _util.FormatError('Unknown type6 flag'); 48730 } 48731 48732 var i, ii; 48733 var pi = coords.length; 48734 48735 for (i = 0, ii = f !== 0 ? 8 : 12; i < ii; i++) { 48736 coords.push(reader.readCoordinate()); 48737 } 48738 48739 var ci = colors.length; 48740 48741 for (i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { 48742 colors.push(reader.readComponents()); 48743 } 48744 48745 var tmp1, tmp2, tmp3, tmp4; 48746 48747 switch (f) { 48748 case 0: 48749 ps[12] = pi + 3; 48750 ps[13] = pi + 4; 48751 ps[14] = pi + 5; 48752 ps[15] = pi + 6; 48753 ps[8] = pi + 2; 48754 ps[11] = pi + 7; 48755 ps[4] = pi + 1; 48756 ps[7] = pi + 8; 48757 ps[0] = pi; 48758 ps[1] = pi + 11; 48759 ps[2] = pi + 10; 48760 ps[3] = pi + 9; 48761 cs[2] = ci + 1; 48762 cs[3] = ci + 2; 48763 cs[0] = ci; 48764 cs[1] = ci + 3; 48765 break; 48766 48767 case 1: 48768 tmp1 = ps[12]; 48769 tmp2 = ps[13]; 48770 tmp3 = ps[14]; 48771 tmp4 = ps[15]; 48772 ps[12] = tmp4; 48773 ps[13] = pi + 0; 48774 ps[14] = pi + 1; 48775 ps[15] = pi + 2; 48776 ps[8] = tmp3; 48777 ps[11] = pi + 3; 48778 ps[4] = tmp2; 48779 ps[7] = pi + 4; 48780 ps[0] = tmp1; 48781 ps[1] = pi + 7; 48782 ps[2] = pi + 6; 48783 ps[3] = pi + 5; 48784 tmp1 = cs[2]; 48785 tmp2 = cs[3]; 48786 cs[2] = tmp2; 48787 cs[3] = ci; 48788 cs[0] = tmp1; 48789 cs[1] = ci + 1; 48790 break; 48791 48792 case 2: 48793 tmp1 = ps[15]; 48794 tmp2 = ps[11]; 48795 ps[12] = ps[3]; 48796 ps[13] = pi + 0; 48797 ps[14] = pi + 1; 48798 ps[15] = pi + 2; 48799 ps[8] = ps[7]; 48800 ps[11] = pi + 3; 48801 ps[4] = tmp2; 48802 ps[7] = pi + 4; 48803 ps[0] = tmp1; 48804 ps[1] = pi + 7; 48805 ps[2] = pi + 6; 48806 ps[3] = pi + 5; 48807 tmp1 = cs[3]; 48808 cs[2] = cs[1]; 48809 cs[3] = ci; 48810 cs[0] = tmp1; 48811 cs[1] = ci + 1; 48812 break; 48813 48814 case 3: 48815 ps[12] = ps[0]; 48816 ps[13] = pi + 0; 48817 ps[14] = pi + 1; 48818 ps[15] = pi + 2; 48819 ps[8] = ps[1]; 48820 ps[11] = pi + 3; 48821 ps[4] = ps[2]; 48822 ps[7] = pi + 4; 48823 ps[0] = ps[3]; 48824 ps[1] = pi + 7; 48825 ps[2] = pi + 6; 48826 ps[3] = pi + 5; 48827 cs[2] = cs[0]; 48828 cs[3] = ci; 48829 cs[0] = cs[1]; 48830 cs[1] = ci + 1; 48831 break; 48832 } 48833 48834 ps[5] = coords.length; 48835 coords.push([(-4 * coords[ps[0]][0] - coords[ps[15]][0] + 6 * (coords[ps[4]][0] + coords[ps[1]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[13]][0] + coords[ps[7]][0])) / 9, (-4 * coords[ps[0]][1] - coords[ps[15]][1] + 6 * (coords[ps[4]][1] + coords[ps[1]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[13]][1] + coords[ps[7]][1])) / 9]); 48836 ps[6] = coords.length; 48837 coords.push([(-4 * coords[ps[3]][0] - coords[ps[12]][0] + 6 * (coords[ps[2]][0] + coords[ps[7]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[4]][0] + coords[ps[14]][0])) / 9, (-4 * coords[ps[3]][1] - coords[ps[12]][1] + 6 * (coords[ps[2]][1] + coords[ps[7]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[4]][1] + coords[ps[14]][1])) / 9]); 48838 ps[9] = coords.length; 48839 coords.push([(-4 * coords[ps[12]][0] - coords[ps[3]][0] + 6 * (coords[ps[8]][0] + coords[ps[13]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[11]][0] + coords[ps[1]][0])) / 9, (-4 * coords[ps[12]][1] - coords[ps[3]][1] + 6 * (coords[ps[8]][1] + coords[ps[13]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[11]][1] + coords[ps[1]][1])) / 9]); 48840 ps[10] = coords.length; 48841 coords.push([(-4 * coords[ps[15]][0] - coords[ps[0]][0] + 6 * (coords[ps[11]][0] + coords[ps[14]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[2]][0] + coords[ps[8]][0])) / 9, (-4 * coords[ps[15]][1] - coords[ps[0]][1] + 6 * (coords[ps[11]][1] + coords[ps[14]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[2]][1] + coords[ps[8]][1])) / 9]); 48842 mesh.figures.push({ 48843 type: 'patch', 48844 coords: new Int32Array(ps), 48845 colors: new Int32Array(cs) 48846 }); 48847 } 48848 } 48849 48850 function decodeType7Shading(mesh, reader) { 48851 var coords = mesh.coords; 48852 var colors = mesh.colors; 48853 var ps = new Int32Array(16); 48854 var cs = new Int32Array(4); 48855 48856 while (reader.hasData) { 48857 var f = reader.readFlag(); 48858 48859 if (!(0 <= f && f <= 3)) { 48860 throw new _util.FormatError('Unknown type7 flag'); 48861 } 48862 48863 var i, ii; 48864 var pi = coords.length; 48865 48866 for (i = 0, ii = f !== 0 ? 12 : 16; i < ii; i++) { 48867 coords.push(reader.readCoordinate()); 48868 } 48869 48870 var ci = colors.length; 48871 48872 for (i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { 48873 colors.push(reader.readComponents()); 48874 } 48875 48876 var tmp1, tmp2, tmp3, tmp4; 48877 48878 switch (f) { 48879 case 0: 48880 ps[12] = pi + 3; 48881 ps[13] = pi + 4; 48882 ps[14] = pi + 5; 48883 ps[15] = pi + 6; 48884 ps[8] = pi + 2; 48885 ps[9] = pi + 13; 48886 ps[10] = pi + 14; 48887 ps[11] = pi + 7; 48888 ps[4] = pi + 1; 48889 ps[5] = pi + 12; 48890 ps[6] = pi + 15; 48891 ps[7] = pi + 8; 48892 ps[0] = pi; 48893 ps[1] = pi + 11; 48894 ps[2] = pi + 10; 48895 ps[3] = pi + 9; 48896 cs[2] = ci + 1; 48897 cs[3] = ci + 2; 48898 cs[0] = ci; 48899 cs[1] = ci + 3; 48900 break; 48901 48902 case 1: 48903 tmp1 = ps[12]; 48904 tmp2 = ps[13]; 48905 tmp3 = ps[14]; 48906 tmp4 = ps[15]; 48907 ps[12] = tmp4; 48908 ps[13] = pi + 0; 48909 ps[14] = pi + 1; 48910 ps[15] = pi + 2; 48911 ps[8] = tmp3; 48912 ps[9] = pi + 9; 48913 ps[10] = pi + 10; 48914 ps[11] = pi + 3; 48915 ps[4] = tmp2; 48916 ps[5] = pi + 8; 48917 ps[6] = pi + 11; 48918 ps[7] = pi + 4; 48919 ps[0] = tmp1; 48920 ps[1] = pi + 7; 48921 ps[2] = pi + 6; 48922 ps[3] = pi + 5; 48923 tmp1 = cs[2]; 48924 tmp2 = cs[3]; 48925 cs[2] = tmp2; 48926 cs[3] = ci; 48927 cs[0] = tmp1; 48928 cs[1] = ci + 1; 48929 break; 48930 48931 case 2: 48932 tmp1 = ps[15]; 48933 tmp2 = ps[11]; 48934 ps[12] = ps[3]; 48935 ps[13] = pi + 0; 48936 ps[14] = pi + 1; 48937 ps[15] = pi + 2; 48938 ps[8] = ps[7]; 48939 ps[9] = pi + 9; 48940 ps[10] = pi + 10; 48941 ps[11] = pi + 3; 48942 ps[4] = tmp2; 48943 ps[5] = pi + 8; 48944 ps[6] = pi + 11; 48945 ps[7] = pi + 4; 48946 ps[0] = tmp1; 48947 ps[1] = pi + 7; 48948 ps[2] = pi + 6; 48949 ps[3] = pi + 5; 48950 tmp1 = cs[3]; 48951 cs[2] = cs[1]; 48952 cs[3] = ci; 48953 cs[0] = tmp1; 48954 cs[1] = ci + 1; 48955 break; 48956 48957 case 3: 48958 ps[12] = ps[0]; 48959 ps[13] = pi + 0; 48960 ps[14] = pi + 1; 48961 ps[15] = pi + 2; 48962 ps[8] = ps[1]; 48963 ps[9] = pi + 9; 48964 ps[10] = pi + 10; 48965 ps[11] = pi + 3; 48966 ps[4] = ps[2]; 48967 ps[5] = pi + 8; 48968 ps[6] = pi + 11; 48969 ps[7] = pi + 4; 48970 ps[0] = ps[3]; 48971 ps[1] = pi + 7; 48972 ps[2] = pi + 6; 48973 ps[3] = pi + 5; 48974 cs[2] = cs[0]; 48975 cs[3] = ci; 48976 cs[0] = cs[1]; 48977 cs[1] = ci + 1; 48978 break; 48979 } 48980 48981 mesh.figures.push({ 48982 type: 'patch', 48983 coords: new Int32Array(ps), 48984 colors: new Int32Array(cs) 48985 }); 48986 } 48987 } 48988 48989 function updateBounds(mesh) { 48990 var minX = mesh.coords[0][0], 48991 minY = mesh.coords[0][1], 48992 maxX = minX, 48993 maxY = minY; 48994 48995 for (var i = 1, ii = mesh.coords.length; i < ii; i++) { 48996 var x = mesh.coords[i][0], 48997 y = mesh.coords[i][1]; 48998 minX = minX > x ? x : minX; 48999 minY = minY > y ? y : minY; 49000 maxX = maxX < x ? x : maxX; 49001 maxY = maxY < y ? y : maxY; 49002 } 49003 49004 mesh.bounds = [minX, minY, maxX, maxY]; 49005 } 49006 49007 function packData(mesh) { 49008 var i, ii, j, jj; 49009 var coords = mesh.coords; 49010 var coordsPacked = new Float32Array(coords.length * 2); 49011 49012 for (i = 0, j = 0, ii = coords.length; i < ii; i++) { 49013 var xy = coords[i]; 49014 coordsPacked[j++] = xy[0]; 49015 coordsPacked[j++] = xy[1]; 49016 } 49017 49018 mesh.coords = coordsPacked; 49019 var colors = mesh.colors; 49020 var colorsPacked = new Uint8Array(colors.length * 3); 49021 49022 for (i = 0, j = 0, ii = colors.length; i < ii; i++) { 49023 var c = colors[i]; 49024 colorsPacked[j++] = c[0]; 49025 colorsPacked[j++] = c[1]; 49026 colorsPacked[j++] = c[2]; 49027 } 49028 49029 mesh.colors = colorsPacked; 49030 var figures = mesh.figures; 49031 49032 for (i = 0, ii = figures.length; i < ii; i++) { 49033 var figure = figures[i], 49034 ps = figure.coords, 49035 cs = figure.colors; 49036 49037 for (j = 0, jj = ps.length; j < jj; j++) { 49038 ps[j] *= 2; 49039 cs[j] *= 3; 49040 } 49041 } 49042 } 49043 49044 function Mesh(stream, matrix, xref, res, pdfFunctionFactory) { 49045 if (!(0, _primitives.isStream)(stream)) { 49046 throw new _util.FormatError('Mesh data is not a stream'); 49047 } 49048 49049 var dict = stream.dict; 49050 this.matrix = matrix; 49051 this.shadingType = dict.get('ShadingType'); 49052 this.type = 'Pattern'; 49053 this.bbox = dict.getArray('BBox'); 49054 var cs = dict.get('ColorSpace', 'CS'); 49055 cs = _colorspace.ColorSpace.parse(cs, xref, res, pdfFunctionFactory); 49056 this.cs = cs;
49057 this.background = dict.has('Background') ? cs.getRgb(dict.get('Background'), 0) : null; 49058 var fnObj = dict.get('Function'); 49059 var fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null; 49060 this.coords = []; 49061 this.colors = []; 49062 this.figures = []; 49063 var decodeContext = { 49064 bitsPerCoordinate: dict.get('BitsPerCoordinate'), 49065 bitsPerComponent: dict.get('BitsPerComponent'), 49066 bitsPerFlag: dict.get('BitsPerFlag'), 49067 decode: dict.getArray('Decode'), 49068 colorFn: fn, 49069 colorSpace: cs, 49070 numComps: fn ? 1 : cs.numComps 49071 }; 49072 var reader = new MeshStreamReader(stream, decodeContext); 49073 var patchMesh = false; 49074 49075 switch (this.shadingType) { 49076 case ShadingType.FREE_FORM_MESH: 49077 decodeType4Shading(this, reader); 49078 break; 49079 49080 case ShadingType.LATTICE_FORM_MESH: 49081 var verticesPerRow = dict.get('VerticesPerRow') | 0; 49082 49083 if (verticesPerRow < 2) { 49084 throw new _util.FormatError('Invalid VerticesPerRow'); 49085 } 49086 49087 decodeType5Shading(this, reader, verticesPerRow); 49088 break; 49089 49090 case ShadingType.COONS_PATCH_MESH: 49091 decodeType6Shading(this, reader); 49092 patchMesh = true; 49093 break; 49094 49095 case ShadingType.TENSOR_PATCH_MESH: 49096 decodeType7Shading(this, reader); 49097 patchMesh = true; 49098 break; 49099 49100 default: 49101 (0, _util.unreachable)('Unsupported mesh type.'); 49102 break; 49103 } 49104 49105 if (patchMesh) { 49106 updateBounds(this); 49107 49108 for (var i = 0, ii = this.figures.length; i < ii; i++) { 49109 buildFigureFromPatch(this, i); 49110 } 49111 } 49112 49113 updateBounds(this); 49114 packData(this); 49115 } 49116 49117 Mesh.prototype = { 49118 getIR: function Mesh_getIR() { 49119 return ['Mesh', this.shadingType, this.coords, this.colors, this.figures, this.bounds, this.matrix, this.bbox, this.background]; 49120 } 49121 }; 49122 return Mesh; 49123}(); 49124 49125Shadings.Dummy = function DummyClosure() { 49126 function Dummy() { 49127 this.type = 'Pattern'; 49128 } 49129 49130 Dummy.prototype = { 49131 getIR: function Dummy_getIR() { 49132 return ['Dummy']; 49133 } 49134 }; 49135 return Dummy; 49136}(); 49137 49138function getTilingPatternIR(operatorList, dict, args) { 49139 var matrix = dict.getArray('Matrix'); 49140 49141 var bbox = _util.Util.normalizeRect(dict.getArray('BBox')); 49142 49143 var xstep = dict.get('XStep'); 49144 var ystep = dict.get('YStep'); 49145 var paintType = dict.get('PaintType'); 49146 var tilingType = dict.get('TilingType'); 49147 49148 if (bbox[2] - bbox[0] === 0 || bbox[3] - bbox[1] === 0) { 49149 throw new _util.FormatError("Invalid getTilingPatternIR /BBox array: [".concat(bbox, "].")); 49150 } 49151 49152 return ['TilingPattern', args, operatorList, matrix, bbox, xstep, ystep, paintType, tilingType]; 49153} 49154 49155/***/ }), 49156/* 183 */ 49157/***/ (function(module, exports, __w_pdfjs_require__) { 49158 49159"use strict"; 49160 49161 49162Object.defineProperty(exports, "__esModule", { 49163 value: true 49164}); 49165exports.bidi = bidi; 49166 49167var _util = __w_pdfjs_require__(6); 49168 49169var baseTypes = ['BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'S', 'B', 'S', 'WS', 'B', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'B', 'B', 'B', 'S', 'WS', 'ON', 'ON', 'ET', 'ET', 'ET', 'ON', 'ON', 'ON', 'ON', 'ON', 'ES', 'CS', 'ES', 'CS', 'CS', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'CS', 'ON', 'ON', 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'ON', 'ON', 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'ON', 'ON', 'ON', 'ON', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'B', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'CS', 'ON', 'ET', 'ET', 'ET', 'ET', 'ON', 'ON', 'ON', 'ON', 'L', 'ON', 'ON', 'BN', 'ON', 'ON', 'ET', 'ET', 'EN', 'EN', 'ON', 'L', 'ON', 'ON', 'ON', 'EN', 'L', 'ON', 'ON', 'ON', 'ON', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'ON', 'L', 'L', 'L', 'L', 'L', 'L', 'L', 'L']; 49170var arabicTypes = ['AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'ON', 'ON', 'AL', 'ET', 'ET', 'AL', 'CS', 'AL', 'ON', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', '', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'ET', 'AN', 'AN', 'AL', 'AL', 'AL', 'NSM', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AN', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'NSM', 'NSM', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'AL', 'AL', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'EN', 'AL', 'AL', 'AL', 'AL', 'AL', 'AL']; 49171 49172function isOdd(i) { 49173 return (i & 1) !== 0; 49174} 49175 49176function isEven(i) { 49177 return (i & 1) === 0; 49178} 49179 49180function findUnequal(arr, start, value) { 49181 for (var j = start, jj = arr.length; j < jj; ++j) { 49182 if (arr[j] !== value) { 49183 return j; 49184 } 49185 } 49186 49187 return j; 49188} 49189 49190function setValues(arr, start, end, value) { 49191 for (var j = start; j < end; ++j) { 49192 arr[j] = value; 49193 } 49194} 49195 49196function reverseValues(arr, start, end) { 49197 for (var i = start, j = end - 1; i < j; ++i, --j) { 49198 var temp = arr[i]; 49199 arr[i] = arr[j]; 49200 arr[j] = temp; 49201 } 49202} 49203 49204function createBidiText(str, isLTR, vertical) { 49205 return { 49206 str: str, 49207 dir: vertical ? 'ttb' : isLTR ? 'ltr' : 'rtl' 49208 }; 49209} 49210 49211var chars = []; 49212var types = []; 49213 49214function bidi(str, startLevel, vertical) { 49215 var isLTR = true; 49216 var strLength = str.length; 49217 49218 if (strLength === 0 || vertical) { 49219 return createBidiText(str, isLTR, vertical); 49220 } 49221 49222 chars.length = strLength; 49223 types.length = strLength; 49224 var numBidi = 0; 49225 var i, ii; 49226 49227 for (i = 0; i < strLength; ++i) { 49228 chars[i] = str.charAt(i);
vendor: 7,694 bytes, lines 49229-49591
49229 var charCode = str.charCodeAt(i); 49230 var charType = 'L'; 49231 49232 if (charCode <= 0x00ff) { 49233 charType = baseTypes[charCode]; 49234 } else if (0x0590 <= charCode && charCode <= 0x05f4) { 49235 charType = 'R'; 49236 } else if (0x0600 <= charCode && charCode <= 0x06ff) { 49237 charType = arabicTypes[charCode & 0xff]; 49238 49239 if (!charType) { 49240 (0, _util.warn)('Bidi: invalid Unicode character ' + charCode.toString(16)); 49241 } 49242 } else if (0x0700 <= charCode && charCode <= 0x08AC) { 49243 charType = 'AL'; 49244 } 49245 49246 if (charType === 'R' || charType === 'AL' || charType === 'AN') { 49247 numBidi++; 49248 } 49249 49250 types[i] = charType; 49251 } 49252 49253 if (numBidi === 0) { 49254 isLTR = true; 49255 return createBidiText(str, isLTR); 49256 } 49257 49258 if (startLevel === -1) { 49259 if (numBidi / strLength < 0.3) { 49260 isLTR = true; 49261 startLevel = 0; 49262 } else { 49263 isLTR = false; 49264 startLevel = 1; 49265 } 49266 } 49267 49268 var levels = []; 49269 49270 for (i = 0; i < strLength; ++i) { 49271 levels[i] = startLevel; 49272 } 49273 49274 var e = isOdd(startLevel) ? 'R' : 'L'; 49275 var sor = e; 49276 var eor = sor; 49277 var lastType = sor; 49278 49279 for (i = 0; i < strLength; ++i) { 49280 if (types[i] === 'NSM') { 49281 types[i] = lastType; 49282 } else { 49283 lastType = types[i]; 49284 } 49285 } 49286 49287 lastType = sor; 49288 var t; 49289 49290 for (i = 0; i < strLength; ++i) { 49291 t = types[i]; 49292 49293 if (t === 'EN') { 49294 types[i] = lastType === 'AL' ? 'AN' : 'EN'; 49295 } else if (t === 'R' || t === 'L' || t === 'AL') { 49296 lastType = t; 49297 } 49298 } 49299 49300 for (i = 0; i < strLength; ++i) { 49301 t = types[i]; 49302 49303 if (t === 'AL') { 49304 types[i] = 'R'; 49305 } 49306 } 49307 49308 for (i = 1; i < strLength - 1; ++i) { 49309 if (types[i] === 'ES' && types[i - 1] === 'EN' && types[i + 1] === 'EN') { 49310 types[i] = 'EN'; 49311 } 49312 49313 if (types[i] === 'CS' && (types[i - 1] === 'EN' || types[i - 1] === 'AN') && types[i + 1] === types[i - 1]) { 49314 types[i] = types[i - 1]; 49315 } 49316 } 49317 49318 for (i = 0; i < strLength; ++i) { 49319 if (types[i] === 'EN') { 49320 var j; 49321 49322 for (j = i - 1; j >= 0; --j) { 49323 if (types[j] !== 'ET') { 49324 break; 49325 } 49326 49327 types[j] = 'EN'; 49328 } 49329 49330 for (j = i + 1; j < strLength; ++j) { 49331 if (types[j] !== 'ET') { 49332 break; 49333 } 49334 49335 types[j] = 'EN'; 49336 } 49337 } 49338 } 49339 49340 for (i = 0; i < strLength; ++i) { 49341 t = types[i]; 49342 49343 if (t === 'WS' || t === 'ES' || t === 'ET' || t === 'CS') { 49344 types[i] = 'ON'; 49345 } 49346 } 49347 49348 lastType = sor; 49349 49350 for (i = 0; i < strLength; ++i) { 49351 t = types[i]; 49352 49353 if (t === 'EN') { 49354 types[i] = lastType === 'L' ? 'L' : 'EN'; 49355 } else if (t === 'R' || t === 'L') { 49356 lastType = t; 49357 } 49358 } 49359 49360 for (i = 0; i < strLength; ++i) { 49361 if (types[i] === 'ON') { 49362 var end = findUnequal(types, i + 1, 'ON'); 49363 var before = sor; 49364 49365 if (i > 0) { 49366 before = types[i - 1]; 49367 } 49368 49369 var after = eor; 49370 49371 if (end + 1 < strLength) { 49372 after = types[end + 1]; 49373 } 49374 49375 if (before !== 'L') { 49376 before = 'R'; 49377 } 49378 49379 if (after !== 'L') { 49380 after = 'R'; 49381 } 49382 49383 if (before === after) { 49384 setValues(types, i, end, before); 49385 } 49386 49387 i = end - 1; 49388 } 49389 } 49390 49391 for (i = 0; i < strLength; ++i) { 49392 if (types[i] === 'ON') { 49393 types[i] = e; 49394 } 49395 } 49396 49397 for (i = 0; i < strLength; ++i) { 49398 t = types[i]; 49399 49400 if (isEven(levels[i])) { 49401 if (t === 'R') { 49402 levels[i] += 1; 49403 } else if (t === 'AN' || t === 'EN') { 49404 levels[i] += 2; 49405 } 49406 } else { 49407 if (t === 'L' || t === 'AN' || t === 'EN') { 49408 levels[i] += 1; 49409 } 49410 } 49411 } 49412 49413 var highestLevel = -1; 49414 var lowestOddLevel = 99; 49415 var level; 49416 49417 for (i = 0, ii = levels.length; i < ii; ++i) { 49418 level = levels[i]; 49419 49420 if (highestLevel < level) { 49421 highestLevel = level; 49422 } 49423 49424 if (lowestOddLevel > level && isOdd(level)) { 49425 lowestOddLevel = level; 49426 } 49427 } 49428 49429 for (level = highestLevel; level >= lowestOddLevel; --level) { 49430 var start = -1; 49431 49432 for (i = 0, ii = levels.length; i < ii; ++i) { 49433 if (levels[i] < level) { 49434 if (start >= 0) { 49435 reverseValues(chars, start, i); 49436 start = -1; 49437 } 49438 } else if (start < 0) { 49439 start = i; 49440 } 49441 } 49442 49443 if (start >= 0) { 49444 reverseValues(chars, start, levels.length); 49445 } 49446 } 49447 49448 for (i = 0, ii = chars.length; i < ii; ++i) { 49449 var ch = chars[i]; 49450 49451 if (ch === '<' || ch === '>') { 49452 chars[i] = ''; 49453 } 49454 } 49455 49456 return createBidiText(chars.join(''), isLTR); 49457} 49458 49459/***/ }), 49460/* 184 */ 49461/***/ (function(module, exports, __w_pdfjs_require__) { 49462 49463"use strict"; 49464 49465 49466Object.defineProperty(exports, "__esModule", { 49467 value: true 49468}); 49469exports.getMetrics = void 0; 49470 49471var _util = __w_pdfjs_require__(6); 49472 49473var getMetrics = (0, _util.getLookupTableFactory)(function (t) { 49474 t['Courier'] = 600; 49475 t['Courier-Bold'] = 600; 49476 t['Courier-BoldOblique'] = 600; 49477 t['Courier-Oblique'] = 600; 49478 t['Helvetica'] = (0, _util.getLookupTableFactory)(function (t) { 49479 t['space'] = 278; 49480 t['exclam'] = 278; 49481 t['quotedbl'] = 355; 49482 t['numbersign'] = 556; 49483 t['dollar'] = 556; 49484 t['percent'] = 889; 49485 t['ampersand'] = 667; 49486 t['quoteright'] = 222; 49487 t['parenleft'] = 333; 49488 t['parenright'] = 333; 49489 t['asterisk'] = 389; 49490 t['plus'] = 584; 49491 t['comma'] = 278; 49492 t['hyphen'] = 333; 49493 t['period'] = 278; 49494 t['slash'] = 278; 49495 t['zero'] = 556; 49496 t['one'] = 556; 49497 t['two'] = 556; 49498 t['three'] = 556; 49499 t['four'] = 556; 49500 t['five'] = 556; 49501 t['six'] = 556; 49502 t['seven'] = 556; 49503 t['eight'] = 556; 49504 t['nine'] = 556; 49505 t['colon'] = 278; 49506 t['semicolon'] = 278; 49507 t['less'] = 584; 49508 t['equal'] = 584; 49509 t['greater'] = 584; 49510 t['question'] = 556; 49511 t['at'] = 1015; 49512 t['A'] = 667; 49513 t['B'] = 667; 49514 t['C'] = 722; 49515 t['D'] = 722; 49516 t['E'] = 667; 49517 t['F'] = 611; 49518 t['G'] = 778; 49519 t['H'] = 722; 49520 t['I'] = 278; 49521 t['J'] = 500; 49522 t['K'] = 667; 49523 t['L'] = 556; 49524 t['M'] = 833; 49525 t['N'] = 722; 49526 t['O'] = 778; 49527 t['P'] = 667; 49528 t['Q'] = 778; 49529 t['R'] = 722; 49530 t['S'] = 667; 49531 t['T'] = 611; 49532 t['U'] = 722; 49533 t['V'] = 667; 49534 t['W'] = 944; 49535 t['X'] = 667; 49536 t['Y'] = 667; 49537 t['Z'] = 611; 49538 t['bracketleft'] = 278; 49539 t['backslash'] = 278; 49540 t['bracketright'] = 278; 49541 t['asciicircum'] = 469; 49542 t['underscore'] = 556; 49543 t['quoteleft'] = 222; 49544 t['a'] = 556; 49545 t['b'] = 556; 49546 t['c'] = 500; 49547 t['d'] = 556; 49548 t['e'] = 556; 49549 t['f'] = 278; 49550 t['g'] = 556; 49551 t['h'] = 556; 49552 t['i'] = 222; 49553 t['j'] = 222; 49554 t['k'] = 500; 49555 t['l'] = 222; 49556 t['m'] = 833; 49557 t['n'] = 556; 49558 t['o'] = 556; 49559 t['p'] = 556; 49560 t['q'] = 556; 49561 t['r'] = 333; 49562 t['s'] = 500; 49563 t['t'] = 278; 49564 t['u'] = 556; 49565 t['v'] = 500; 49566 t['w'] = 722; 49567 t['x'] = 500; 49568 t['y'] = 500; 49569 t['z'] = 500; 49570 t['braceleft'] = 334; 49571 t['bar'] = 260; 49572 t['braceright'] = 334; 49573 t['asciitilde'] = 584; 49574 t['exclamdown'] = 333; 49575 t['cent'] = 556; 49576 t['sterling'] = 556; 49577 t['fraction'] = 167; 49578 t['yen'] = 556; 49579 t['florin'] = 556; 49580 t['section'] = 556; 49581 t['currency'] = 556; 49582 t['quotesingle'] = 191; 49583 t['quotedblleft'] = 333; 49584 t['guillemotleft'] = 556; 49585 t['guilsinglleft'] = 333; 49586 t['guilsinglright'] = 333; 49587 t['fi'] = 500; 49588 t['fl'] = 500; 49589 t['endash'] = 556; 49590 t['dagger'] = 556; 49591 t['daggerdbl'] = 556;
49592 t['periodcentered'] = 278; 49593 t['paragraph'] = 537; 49594 t['bullet'] = 350; 49595 t['quotesinglbase'] = 222; 49596 t['quotedblbase'] = 333; 49597 t['quotedblright'] = 333; 49598 t['guillemotright'] = 556; 49599 t['ellipsis'] = 1000; 49600 t['perthousand'] = 1000; 49601 t['questiondown'] = 611; 49602 t['grave'] = 333; 49603 t['acute'] = 333; 49604 t['circumflex'] = 333; 49605 t['tilde'] = 333; 49606 t['macron'] = 333; 49607 t['breve'] = 333; 49608 t['dotaccent'] = 333; 49609 t['dieresis'] = 333; 49610 t['ring'] = 333; 49611 t['cedilla'] = 333; 49612 t['hungarumlaut'] = 333; 49613 t['ogonek'] = 333; 49614 t['caron'] = 333; 49615 t['emdash'] = 1000; 49616 t['AE'] = 1000; 49617 t['ordfeminine'] = 370; 49618 t['Lslash'] = 556; 49619 t['Oslash'] = 778; 49620 t['OE'] = 1000; 49621 t['ordmasculine'] = 365; 49622 t['ae'] = 889; 49623 t['dotlessi'] = 278; 49624 t['lslash'] = 222; 49625 t['oslash'] = 611; 49626 t['oe'] = 944; 49627 t['germandbls'] = 611; 49628 t['Idieresis'] = 278; 49629 t['eacute'] = 556; 49630 t['abreve'] = 556; 49631 t['uhungarumlaut'] = 556; 49632 t['ecaron'] = 556; 49633 t['Ydieresis'] = 667; 49634 t['divide'] = 584; 49635 t['Yacute'] = 667; 49636 t['Acircumflex'] = 667; 49637 t['aacute'] = 556; 49638 t['Ucircumflex'] = 722; 49639 t['yacute'] = 500; 49640 t['scommaaccent'] = 500; 49641 t['ecircumflex'] = 556; 49642 t['Uring'] = 722; 49643 t['Udieresis'] = 722; 49644 t['aogonek'] = 556; 49645 t['Uacute'] = 722; 49646 t['uogonek'] = 556; 49647 t['Edieresis'] = 667; 49648 t['Dcroat'] = 722; 49649 t['commaaccent'] = 250; 49650 t['copyright'] = 737; 49651 t['Emacron'] = 667; 49652 t['ccaron'] = 500; 49653 t['aring'] = 556; 49654 t['Ncommaaccent'] = 722; 49655 t['lacute'] = 222; 49656 t['agrave'] = 556; 49657 t['Tcommaaccent'] = 611; 49658 t['Cacute'] = 722; 49659 t['atilde'] = 556; 49660 t['Edotaccent'] = 667; 49661 t['scaron'] = 500; 49662 t['scedilla'] = 500; 49663 t['iacute'] = 278; 49664 t['lozenge'] = 471; 49665 t['Rcaron'] = 722; 49666 t['Gcommaaccent'] = 778; 49667 t['ucircumflex'] = 556; 49668 t['acircumflex'] = 556; 49669 t['Amacron'] = 667; 49670 t['rcaron'] = 333; 49671 t['ccedilla'] = 500; 49672 t['Zdotaccent'] = 611; 49673 t['Thorn'] = 667; 49674 t['Omacron'] = 778; 49675 t['Racute'] = 722; 49676 t['Sacute'] = 667; 49677 t['dcaron'] = 643; 49678 t['Umacron'] = 722; 49679 t['uring'] = 556; 49680 t['threesuperior'] = 333; 49681 t['Ograve'] = 778; 49682 t['Agrave'] = 667; 49683 t['Abreve'] = 667; 49684 t['multiply'] = 584; 49685 t['uacute'] = 556; 49686 t['Tcaron'] = 611; 49687 t['partialdiff'] = 476; 49688 t['ydieresis'] = 500; 49689 t['Nacute'] = 722; 49690 t['icircumflex'] = 278; 49691 t['Ecircumflex'] = 667; 49692 t['adieresis'] = 556; 49693 t['edieresis'] = 556; 49694 t['cacute'] = 500; 49695 t['nacute'] = 556; 49696 t['umacron'] = 556; 49697 t['Ncaron'] = 722; 49698 t['Iacute'] = 278; 49699 t['plusminus'] = 584; 49700 t['brokenbar'] = 260; 49701 t['registered'] = 737; 49702 t['Gbreve'] = 778; 49703 t['Idotaccent'] = 278; 49704 t['summation'] = 600; 49705 t['Egrave'] = 667; 49706 t['racute'] = 333; 49707 t['omacron'] = 556; 49708 t['Zacute'] = 611; 49709 t['Zcaron'] = 611; 49710 t['greaterequal'] = 549; 49711 t['Eth'] = 722; 49712 t['Ccedilla'] = 722; 49713 t['lcommaaccent'] = 222; 49714 t['tcaron'] = 317; 49715 t['eogonek'] = 556; 49716 t['Uogonek'] = 722; 49717 t['Aacute'] = 667; 49718 t['Adieresis'] = 667; 49719 t['egrave'] = 556; 49720 t['zacute'] = 500; 49721 t['iogonek'] = 222; 49722 t['Oacute'] = 778; 49723 t['oacute'] = 556; 49724 t['amacron'] = 556; 49725 t['sacute'] = 500; 49726 t['idieresis'] = 278; 49727 t['Ocircumflex'] = 778; 49728 t['Ugrave'] = 722; 49729 t['Delta'] = 612; 49730 t['thorn'] = 556; 49731 t['twosuperior'] = 333; 49732 t['Odieresis'] = 778; 49733 t['mu'] = 556; 49734 t['igrave'] = 278; 49735 t['ohungarumlaut'] = 556; 49736 t['Eogonek'] = 667; 49737 t['dcroat'] = 556; 49738 t['threequarters'] = 834; 49739 t['Scedilla'] = 667; 49740 t['lcaron'] = 299; 49741 t['Kcommaaccent'] = 667; 49742 t['Lacute'] = 556; 49743 t['trademark'] = 1000; 49744 t['edotaccent'] = 556; 49745 t['Igrave'] = 278; 49746 t['Imacron'] = 278; 49747 t['Lcaron'] = 556; 49748 t['onehalf'] = 834; 49749 t['lessequal'] = 549; 49750 t['ocircumflex'] = 556; 49751 t['ntilde'] = 556; 49752 t['Uhungarumlaut'] = 722; 49753 t['Eacute'] = 667; 49754 t['emacron'] = 556; 49755 t['gbreve'] = 556; 49756 t['onequarter'] = 834; 49757 t['Scaron'] = 667; 49758 t['Scommaaccent'] = 667; 49759 t['Ohungarumlaut'] = 778; 49760 t['degree'] = 400; 49761 t['ograve'] = 556; 49762 t['Ccaron'] = 722; 49763 t['ugrave'] = 556; 49764 t['radical'] = 453; 49765 t['Dcaron'] = 722; 49766 t['rcommaaccent'] = 333; 49767 t['Ntilde'] = 722; 49768 t['otilde'] = 556; 49769 t['Rcommaaccent'] = 722; 49770 t['Lcommaaccent'] = 556; 49771 t['Atilde'] = 667; 49772 t['Aogonek'] = 667; 49773 t['Aring'] = 667; 49774 t['Otilde'] = 778; 49775 t['zdotaccent'] = 500; 49776 t['Ecaron'] = 667; 49777 t['Iogonek'] = 278; 49778 t['kcommaaccent'] = 500; 49779 t['minus'] = 584; 49780 t['Icircumflex'] = 278; 49781 t['ncaron'] = 556; 49782 t['tcommaaccent'] = 278; 49783 t['logicalnot'] = 584; 49784 t['odieresis'] = 556; 49785 t['udieresis'] = 556; 49786 t['notequal'] = 549; 49787 t['gcommaaccent'] = 556; 49788 t['eth'] = 556; 49789 t['zcaron'] = 500; 49790 t['ncommaaccent'] = 556; 49791 t['onesuperior'] = 333; 49792 t['imacron'] = 278; 49793 t['Euro'] = 556; 49794 }); 49795 t['Helvetica-Bold'] = (0, _util.getLookupTableFactory)(function (t) { 49796 t['space'] = 278; 49797 t['exclam'] = 333; 49798 t['quotedbl'] = 474; 49799 t['numbersign'] = 556; 49800 t['dollar'] = 556; 49801 t['percent'] = 889; 49802 t['ampersand'] = 722; 49803 t['quoteright'] = 278; 49804 t['parenleft'] = 333; 49805 t['parenright'] = 333; 49806 t['asterisk'] = 389; 49807 t['plus'] = 584; 49808 t['comma'] = 278; 49809 t['hyphen'] = 333; 49810 t['period'] = 278; 49811 t['slash'] = 278; 49812 t['zero'] = 556; 49813 t['one'] = 556; 49814 t['two'] = 556; 49815 t['three'] = 556; 49816 t['four'] = 556; 49817 t['five'] = 556; 49818 t['six'] = 556; 49819 t['seven'] = 556; 49820 t['eight'] = 556; 49821 t['nine'] = 556; 49822 t['colon'] = 333; 49823 t['semicolon'] = 333; 49824 t['less'] = 584; 49825 t['equal'] = 584; 49826 t['greater'] = 584; 49827 t['question'] = 611; 49828 t['at'] = 975; 49829 t['A'] = 722; 49830 t['B'] = 722; 49831 t['C'] = 722; 49832 t['D'] = 722; 49833 t['E'] = 667; 49834 t['F'] = 611; 49835 t['G'] = 778; 49836 t['H'] = 722; 49837 t['I'] = 278; 49838 t['J'] = 556; 49839 t['K'] = 722; 49840 t['L'] = 611; 49841 t['M'] = 833; 49842 t['N'] = 722; 49843 t['O'] = 778; 49844 t['P'] = 667; 49845 t['Q'] = 778; 49846 t['R'] = 722; 49847 t['S'] = 667; 49848 t['T'] = 611; 49849 t['U'] = 722; 49850 t['V'] = 667; 49851 t['W'] = 944; 49852 t['X'] = 667; 49853 t['Y'] = 667; 49854 t['Z'] = 611; 49855 t['bracketleft'] = 333; 49856 t['backslash'] = 278; 49857 t['bracketright'] = 333; 49858 t['asciicircum'] = 584; 49859 t['underscore'] = 556; 49860 t['quoteleft'] = 278; 49861 t['a'] = 556; 49862 t['b'] = 611; 49863 t['c'] = 556; 49864 t['d'] = 611; 49865 t['e'] = 556; 49866 t['f'] = 333; 49867 t['g'] = 611; 49868 t['h'] = 611; 49869 t['i'] = 278; 49870 t['j'] = 278; 49871 t['k'] = 556; 49872 t['l'] = 278; 49873 t['m'] = 889; 49874 t['n'] = 611; 49875 t['o'] = 611; 49876 t['p'] = 611; 49877 t['q'] = 611; 49878 t['r'] = 389; 49879 t['s'] = 556; 49880 t['t'] = 333; 49881 t['u'] = 611; 49882 t['v'] = 556; 49883 t['w'] = 778; 49884 t['x'] = 556; 49885 t['y'] = 556; 49886 t['z'] = 500; 49887 t['braceleft'] = 389; 49888 t['bar'] = 280; 49889 t['braceright'] = 389; 49890 t['asciitilde'] = 584; 49891 t['exclamdown'] = 333; 49892 t['cent'] = 556; 49893 t['sterling'] = 556; 49894 t['fraction'] = 167; 49895 t['yen'] = 556; 49896 t['florin'] = 556; 49897 t['section'] = 556; 49898 t['currency'] = 556; 49899 t['quotesingle'] = 238; 49900 t['quotedblleft'] = 500; 49901 t['guillemotleft'] = 556; 49902 t['guilsinglleft'] = 333; 49903 t['guilsinglright'] = 333; 49904 t['fi'] = 611; 49905 t['fl'] = 611; 49906 t['endash'] = 556; 49907 t['dagger'] = 556; 49908 t['daggerdbl'] = 556;
49909 t['periodcentered'] = 278; 49910 t['paragraph'] = 556; 49911 t['bullet'] = 350; 49912 t['quotesinglbase'] = 278; 49913 t['quotedblbase'] = 500; 49914 t['quotedblright'] = 500; 49915 t['guillemotright'] = 556; 49916 t['ellipsis'] = 1000; 49917 t['perthousand'] = 1000; 49918 t['questiondown'] = 611; 49919 t['grave'] = 333; 49920 t['acute'] = 333; 49921 t['circumflex'] = 333; 49922 t['tilde'] = 333; 49923 t['macron'] = 333; 49924 t['breve'] = 333; 49925 t['dotaccent'] = 333; 49926 t['dieresis'] = 333; 49927 t['ring'] = 333; 49928 t['cedilla'] = 333; 49929 t['hungarumlaut'] = 333; 49930 t['ogonek'] = 333; 49931 t['caron'] = 333; 49932 t['emdash'] = 1000; 49933 t['AE'] = 1000; 49934 t['ordfeminine'] = 370; 49935 t['Lslash'] = 611; 49936 t['Oslash'] = 778; 49937 t['OE'] = 1000; 49938 t['ordmasculine'] = 365; 49939 t['ae'] = 889; 49940 t['dotlessi'] = 278; 49941 t['lslash'] = 278; 49942 t['oslash'] = 611; 49943 t['oe'] = 944; 49944 t['germandbls'] = 611; 49945 t['Idieresis'] = 278; 49946 t['eacute'] = 556; 49947 t['abreve'] = 556; 49948 t['uhungarumlaut'] = 611; 49949 t['ecaron'] = 556; 49950 t['Ydieresis'] = 667; 49951 t['divide'] = 584; 49952 t['Yacute'] = 667; 49953 t['Acircumflex'] = 722; 49954 t['aacute'] = 556; 49955 t['Ucircumflex'] = 722; 49956 t['yacute'] = 556; 49957 t['scommaaccent'] = 556; 49958 t['ecircumflex'] = 556; 49959 t['Uring'] = 722; 49960 t['Udieresis'] = 722; 49961 t['aogonek'] = 556; 49962 t['Uacute'] = 722; 49963 t['uogonek'] = 611; 49964 t['Edieresis'] = 667; 49965 t['Dcroat'] = 722; 49966 t['commaaccent'] = 250; 49967 t['copyright'] = 737; 49968 t['Emacron'] = 667; 49969 t['ccaron'] = 556; 49970 t['aring'] = 556; 49971 t['Ncommaaccent'] = 722; 49972 t['lacute'] = 278; 49973 t['agrave'] = 556; 49974 t['Tcommaaccent'] = 611; 49975 t['Cacute'] = 722; 49976 t['atilde'] = 556; 49977 t['Edotaccent'] = 667; 49978 t['scaron'] = 556; 49979 t['scedilla'] = 556; 49980 t['iacute'] = 278; 49981 t['lozenge'] = 494; 49982 t['Rcaron'] = 722; 49983 t['Gcommaaccent'] = 778; 49984 t['ucircumflex'] = 611; 49985 t['acircumflex'] = 556; 49986 t['Amacron'] = 722; 49987 t['rcaron'] = 389; 49988 t['ccedilla'] = 556; 49989 t['Zdotaccent'] = 611; 49990 t['Thorn'] = 667; 49991 t['Omacron'] = 778; 49992 t['Racute'] = 722; 49993 t['Sacute'] = 667; 49994 t['dcaron'] = 743; 49995 t['Umacron'] = 722; 49996 t['uring'] = 611; 49997 t['threesuperior'] = 333; 49998 t['Ograve'] = 778; 49999 t['Agrave'] = 722; 50000 t['Abreve'] = 722; 50001 t['multiply'] = 584; 50002 t['uacute'] = 611; 50003 t['Tcaron'] = 611; 50004 t['partialdiff'] = 494; 50005 t['ydieresis'] = 556; 50006 t['Nacute'] = 722; 50007 t['icircumflex'] = 278; 50008 t['Ecircumflex'] = 667; 50009 t['adieresis'] = 556; 50010 t['edieresis'] = 556; 50011 t['cacute'] = 556; 50012 t['nacute'] = 611; 50013 t['umacron'] = 611; 50014 t['Ncaron'] = 722; 50015 t['Iacute'] = 278; 50016 t['plusminus'] = 584; 50017 t['brokenbar'] = 280; 50018 t['registered'] = 737; 50019 t['Gbreve'] = 778; 50020 t['Idotaccent'] = 278; 50021 t['summation'] = 600; 50022 t['Egrave'] = 667; 50023 t['racute'] = 389; 50024 t['omacron'] = 611; 50025 t['Zacute'] = 611; 50026 t['Zcaron'] = 611; 50027 t['greaterequal'] = 549; 50028 t['Eth'] = 722; 50029 t['Ccedilla'] = 722; 50030 t['lcommaaccent'] = 278; 50031 t['tcaron'] = 389; 50032 t['eogonek'] = 556; 50033 t['Uogonek'] = 722; 50034 t['Aacute'] = 722; 50035 t['Adieresis'] = 722; 50036 t['egrave'] = 556; 50037 t['zacute'] = 500; 50038 t['iogonek'] = 278; 50039 t['Oacute'] = 778; 50040 t['oacute'] = 611; 50041 t['amacron'] = 556; 50042 t['sacute'] = 556; 50043 t['idieresis'] = 278; 50044 t['Ocircumflex'] = 778; 50045 t['Ugrave'] = 722; 50046 t['Delta'] = 612; 50047 t['thorn'] = 611; 50048 t['twosuperior'] = 333; 50049 t['Odieresis'] = 778; 50050 t['mu'] = 611; 50051 t['igrave'] = 278; 50052 t['ohungarumlaut'] = 611; 50053 t['Eogonek'] = 667; 50054 t['dcroat'] = 611; 50055 t['threequarters'] = 834; 50056 t['Scedilla'] = 667; 50057 t['lcaron'] = 400; 50058 t['Kcommaaccent'] = 722; 50059 t['Lacute'] = 611; 50060 t['trademark'] = 1000; 50061 t['edotaccent'] = 556; 50062 t['Igrave'] = 278; 50063 t['Imacron'] = 278; 50064 t['Lcaron'] = 611; 50065 t['onehalf'] = 834; 50066 t['lessequal'] = 549; 50067 t['ocircumflex'] = 611; 50068 t['ntilde'] = 611; 50069 t['Uhungarumlaut'] = 722; 50070 t['Eacute'] = 667; 50071 t['emacron'] = 556; 50072 t['gbreve'] = 611; 50073 t['onequarter'] = 834; 50074 t['Scaron'] = 667; 50075 t['Scommaaccent'] = 667; 50076 t['Ohungarumlaut'] = 778; 50077 t['degree'] = 400; 50078 t['ograve'] = 611; 50079 t['Ccaron'] = 722; 50080 t['ugrave'] = 611; 50081 t['radical'] = 549; 50082 t['Dcaron'] = 722; 50083 t['rcommaaccent'] = 389; 50084 t['Ntilde'] = 722; 50085 t['otilde'] = 611; 50086 t['Rcommaaccent'] = 722; 50087 t['Lcommaaccent'] = 611; 50088 t['Atilde'] = 722; 50089 t['Aogonek'] = 722; 50090 t['Aring'] = 722; 50091 t['Otilde'] = 778; 50092 t['zdotaccent'] = 500; 50093 t['Ecaron'] = 667; 50094 t['Iogonek'] = 278; 50095 t['kcommaaccent'] = 556; 50096 t['minus'] = 584; 50097 t['Icircumflex'] = 278; 50098 t['ncaron'] = 611; 50099 t['tcommaaccent'] = 333; 50100 t['logicalnot'] = 584; 50101 t['odieresis'] = 611; 50102 t['udieresis'] = 611; 50103 t['notequal'] = 549; 50104 t['gcommaaccent'] = 611; 50105 t['eth'] = 611; 50106 t['zcaron'] = 500; 50107 t['ncommaaccent'] = 611; 50108 t['onesuperior'] = 333; 50109 t['imacron'] = 278; 50110 t['Euro'] = 556; 50111 }); 50112 t['Helvetica-BoldOblique'] = (0, _util.getLookupTableFactory)(function (t) { 50113 t['space'] = 278; 50114 t['exclam'] = 333; 50115 t['quotedbl'] = 474; 50116 t['numbersign'] = 556; 50117 t['dollar'] = 556; 50118 t['percent'] = 889; 50119 t['ampersand'] = 722; 50120 t['quoteright'] = 278; 50121 t['parenleft'] = 333; 50122 t['parenright'] = 333; 50123 t['asterisk'] = 389; 50124 t['plus'] = 584; 50125 t['comma'] = 278; 50126 t['hyphen'] = 333; 50127 t['period'] = 278; 50128 t['slash'] = 278; 50129 t['zero'] = 556; 50130 t['one'] = 556; 50131 t['two'] = 556; 50132 t['three'] = 556; 50133 t['four'] = 556; 50134 t['five'] = 556; 50135 t['six'] = 556; 50136 t['seven'] = 556; 50137 t['eight'] = 556; 50138 t['nine'] = 556; 50139 t['colon'] = 333; 50140 t['semicolon'] = 333; 50141 t['less'] = 584; 50142 t['equal'] = 584; 50143 t['greater'] = 584; 50144 t['question'] = 611; 50145 t['at'] = 975; 50146 t['A'] = 722; 50147 t['B'] = 722; 50148 t['C'] = 722; 50149 t['D'] = 722; 50150 t['E'] = 667; 50151 t['F'] = 611; 50152 t['G'] = 778; 50153 t['H'] = 722; 50154 t['I'] = 278; 50155 t['J'] = 556; 50156 t['K'] = 722; 50157 t['L'] = 611; 50158 t['M'] = 833; 50159 t['N'] = 722; 50160 t['O'] = 778; 50161 t['P'] = 667; 50162 t['Q'] = 778; 50163 t['R'] = 722; 50164 t['S'] = 667; 50165 t['T'] = 611; 50166 t['U'] = 722; 50167 t['V'] = 667; 50168 t['W'] = 944; 50169 t['X'] = 667; 50170 t['Y'] = 667; 50171 t['Z'] = 611; 50172 t['bracketleft'] = 333; 50173 t['backslash'] = 278; 50174 t['bracketright'] = 333; 50175 t['asciicircum'] = 584; 50176 t['underscore'] = 556; 50177 t['quoteleft'] = 278; 50178 t['a'] = 556; 50179 t['b'] = 611; 50180 t['c'] = 556; 50181 t['d'] = 611; 50182 t['e'] = 556; 50183 t['f'] = 333; 50184 t['g'] = 611; 50185 t['h'] = 611; 50186 t['i'] = 278; 50187 t['j'] = 278; 50188 t['k'] = 556; 50189 t['l'] = 278; 50190 t['m'] = 889; 50191 t['n'] = 611; 50192 t['o'] = 611; 50193 t['p'] = 611; 50194 t['q'] = 611; 50195 t['r'] = 389; 50196 t['s'] = 556; 50197 t['t'] = 333; 50198 t['u'] = 611; 50199 t['v'] = 556; 50200 t['w'] = 778; 50201 t['x'] = 556; 50202 t['y'] = 556; 50203 t['z'] = 500; 50204 t['braceleft'] = 389; 50205 t['bar'] = 280; 50206 t['braceright'] = 389; 50207 t['asciitilde'] = 584; 50208 t['exclamdown'] = 333; 50209 t['cent'] = 556; 50210 t['sterling'] = 556; 50211 t['fraction'] = 167; 50212 t['yen'] = 556; 50213 t['florin'] = 556; 50214 t['section'] = 556; 50215 t['currency'] = 556; 50216 t['quotesingle'] = 238; 50217 t['quotedblleft'] = 500; 50218 t['guillemotleft'] = 556; 50219 t['guilsinglleft'] = 333; 50220 t['guilsinglright'] = 333; 50221 t['fi'] = 611; 50222 t['fl'] = 611; 50223 t['endash'] = 556; 50224 t['dagger'] = 556; 50225 t['daggerdbl'] = 556;
50226 t['periodcentered'] = 278; 50227 t['paragraph'] = 556; 50228 t['bullet'] = 350; 50229 t['quotesinglbase'] = 278; 50230 t['quotedblbase'] = 500; 50231 t['quotedblright'] = 500; 50232 t['guillemotright'] = 556; 50233 t['ellipsis'] = 1000; 50234 t['perthousand'] = 1000; 50235 t['questiondown'] = 611; 50236 t['grave'] = 333; 50237 t['acute'] = 333; 50238 t['circumflex'] = 333; 50239 t['tilde'] = 333; 50240 t['macron'] = 333; 50241 t['breve'] = 333; 50242 t['dotaccent'] = 333; 50243 t['dieresis'] = 333; 50244 t['ring'] = 333; 50245 t['cedilla'] = 333; 50246 t['hungarumlaut'] = 333; 50247 t['ogonek'] = 333; 50248 t['caron'] = 333; 50249 t['emdash'] = 1000; 50250 t['AE'] = 1000; 50251 t['ordfeminine'] = 370; 50252 t['Lslash'] = 611; 50253 t['Oslash'] = 778; 50254 t['OE'] = 1000; 50255 t['ordmasculine'] = 365; 50256 t['ae'] = 889; 50257 t['dotlessi'] = 278; 50258 t['lslash'] = 278; 50259 t['oslash'] = 611; 50260 t['oe'] = 944; 50261 t['germandbls'] = 611; 50262 t['Idieresis'] = 278; 50263 t['eacute'] = 556; 50264 t['abreve'] = 556; 50265 t['uhungarumlaut'] = 611; 50266 t['ecaron'] = 556; 50267 t['Ydieresis'] = 667; 50268 t['divide'] = 584; 50269 t['Yacute'] = 667; 50270 t['Acircumflex'] = 722; 50271 t['aacute'] = 556; 50272 t['Ucircumflex'] = 722; 50273 t['yacute'] = 556; 50274 t['scommaaccent'] = 556; 50275 t['ecircumflex'] = 556; 50276 t['Uring'] = 722; 50277 t['Udieresis'] = 722; 50278 t['aogonek'] = 556; 50279 t['Uacute'] = 722; 50280 t['uogonek'] = 611; 50281 t['Edieresis'] = 667; 50282 t['Dcroat'] = 722; 50283 t['commaaccent'] = 250; 50284 t['copyright'] = 737; 50285 t['Emacron'] = 667; 50286 t['ccaron'] = 556; 50287 t['aring'] = 556; 50288 t['Ncommaaccent'] = 722; 50289 t['lacute'] = 278; 50290 t['agrave'] = 556; 50291 t['Tcommaaccent'] = 611; 50292 t['Cacute'] = 722; 50293 t['atilde'] = 556; 50294 t['Edotaccent'] = 667; 50295 t['scaron'] = 556; 50296 t['scedilla'] = 556; 50297 t['iacute'] = 278; 50298 t['lozenge'] = 494; 50299 t['Rcaron'] = 722; 50300 t['Gcommaaccent'] = 778; 50301 t['ucircumflex'] = 611; 50302 t['acircumflex'] = 556; 50303 t['Amacron'] = 722; 50304 t['rcaron'] = 389; 50305 t['ccedilla'] = 556; 50306 t['Zdotaccent'] = 611; 50307 t['Thorn'] = 667; 50308 t['Omacron'] = 778; 50309 t['Racute'] = 722; 50310 t['Sacute'] = 667; 50311 t['dcaron'] = 743; 50312 t['Umacron'] = 722; 50313 t['uring'] = 611; 50314 t['threesuperior'] = 333; 50315 t['Ograve'] = 778; 50316 t['Agrave'] = 722; 50317 t['Abreve'] = 722; 50318 t['multiply'] = 584; 50319 t['uacute'] = 611; 50320 t['Tcaron'] = 611; 50321 t['partialdiff'] = 494; 50322 t['ydieresis'] = 556; 50323 t['Nacute'] = 722; 50324 t['icircumflex'] = 278; 50325 t['Ecircumflex'] = 667; 50326 t['adieresis'] = 556; 50327 t['edieresis'] = 556; 50328 t['cacute'] = 556; 50329 t['nacute'] = 611; 50330 t['umacron'] = 611; 50331 t['Ncaron'] = 722; 50332 t['Iacute'] = 278; 50333 t['plusminus'] = 584; 50334 t['brokenbar'] = 280; 50335 t['registered'] = 737; 50336 t['Gbreve'] = 778; 50337 t['Idotaccent'] = 278; 50338 t['summation'] = 600; 50339 t['Egrave'] = 667; 50340 t['racute'] = 389; 50341 t['omacron'] = 611; 50342 t['Zacute'] = 611; 50343 t['Zcaron'] = 611; 50344 t['greaterequal'] = 549; 50345 t['Eth'] = 722; 50346 t['Ccedilla'] = 722; 50347 t['lcommaaccent'] = 278; 50348 t['tcaron'] = 389; 50349 t['eogonek'] = 556; 50350 t['Uogonek'] = 722; 50351 t['Aacute'] = 722; 50352 t['Adieresis'] = 722; 50353 t['egrave'] = 556; 50354 t['zacute'] = 500; 50355 t['iogonek'] = 278; 50356 t['Oacute'] = 778; 50357 t['oacute'] = 611; 50358 t['amacron'] = 556; 50359 t['sacute'] = 556; 50360 t['idieresis'] = 278; 50361 t['Ocircumflex'] = 778; 50362 t['Ugrave'] = 722; 50363 t['Delta'] = 612; 50364 t['thorn'] = 611; 50365 t['twosuperior'] = 333; 50366 t['Odieresis'] = 778; 50367 t['mu'] = 611; 50368 t['igrave'] = 278; 50369 t['ohungarumlaut'] = 611; 50370 t['Eogonek'] = 667; 50371 t['dcroat'] = 611; 50372 t['threequarters'] = 834; 50373 t['Scedilla'] = 667; 50374 t['lcaron'] = 400; 50375 t['Kcommaaccent'] = 722; 50376 t['Lacute'] = 611; 50377 t['trademark'] = 1000; 50378 t['edotaccent'] = 556; 50379 t['Igrave'] = 278; 50380 t['Imacron'] = 278; 50381 t['Lcaron'] = 611; 50382 t['onehalf'] = 834; 50383 t['lessequal'] = 549; 50384 t['ocircumflex'] = 611; 50385 t['ntilde'] = 611; 50386 t['Uhungarumlaut'] = 722; 50387 t['Eacute'] = 667; 50388 t['emacron'] = 556; 50389 t['gbreve'] = 611; 50390 t['onequarter'] = 834; 50391 t['Scaron'] = 667; 50392 t['Scommaaccent'] = 667; 50393 t['Ohungarumlaut'] = 778; 50394 t['degree'] = 400; 50395 t['ograve'] = 611; 50396 t['Ccaron'] = 722; 50397 t['ugrave'] = 611; 50398 t['radical'] = 549; 50399 t['Dcaron'] = 722; 50400 t['rcommaaccent'] = 389; 50401 t['Ntilde'] = 722; 50402 t['otilde'] = 611; 50403 t['Rcommaaccent'] = 722; 50404 t['Lcommaaccent'] = 611; 50405 t['Atilde'] = 722; 50406 t['Aogonek'] = 722; 50407 t['Aring'] = 722; 50408 t['Otilde'] = 778; 50409 t['zdotaccent'] = 500; 50410 t['Ecaron'] = 667; 50411 t['Iogonek'] = 278; 50412 t['kcommaaccent'] = 556; 50413 t['minus'] = 584; 50414 t['Icircumflex'] = 278; 50415 t['ncaron'] = 611; 50416 t['tcommaaccent'] = 333; 50417 t['logicalnot'] = 584; 50418 t['odieresis'] = 611; 50419 t['udieresis'] = 611; 50420 t['notequal'] = 549; 50421 t['gcommaaccent'] = 611; 50422 t['eth'] = 611; 50423 t['zcaron'] = 500; 50424 t['ncommaaccent'] = 611; 50425 t['onesuperior'] = 333; 50426 t['imacron'] = 278; 50427 t['Euro'] = 556; 50428 }); 50429 t['Helvetica-Oblique'] = (0, _util.getLookupTableFactory)(function (t) { 50430 t['space'] = 278; 50431 t['exclam'] = 278; 50432 t['quotedbl'] = 355; 50433 t['numbersign'] = 556; 50434 t['dollar'] = 556; 50435 t['percent'] = 889; 50436 t['ampersand'] = 667; 50437 t['quoteright'] = 222; 50438 t['parenleft'] = 333; 50439 t['parenright'] = 333; 50440 t['asterisk'] = 389; 50441 t['plus'] = 584; 50442 t['comma'] = 278; 50443 t['hyphen'] = 333; 50444 t['period'] = 278; 50445 t['slash'] = 278; 50446 t['zero'] = 556; 50447 t['one'] = 556; 50448 t['two'] = 556; 50449 t['three'] = 556; 50450 t['four'] = 556; 50451 t['five'] = 556; 50452 t['six'] = 556; 50453 t['seven'] = 556; 50454 t['eight'] = 556; 50455 t['nine'] = 556; 50456 t['colon'] = 278; 50457 t['semicolon'] = 278; 50458 t['less'] = 584; 50459 t['equal'] = 584; 50460 t['greater'] = 584; 50461 t['question'] = 556; 50462 t['at'] = 1015; 50463 t['A'] = 667; 50464 t['B'] = 667; 50465 t['C'] = 722; 50466 t['D'] = 722; 50467 t['E'] = 667; 50468 t['F'] = 611; 50469 t['G'] = 778; 50470 t['H'] = 722; 50471 t['I'] = 278; 50472 t['J'] = 500; 50473 t['K'] = 667; 50474 t['L'] = 556; 50475 t['M'] = 833; 50476 t['N'] = 722; 50477 t['O'] = 778; 50478 t['P'] = 667; 50479 t['Q'] = 778; 50480 t['R'] = 722; 50481 t['S'] = 667; 50482 t['T'] = 611; 50483 t['U'] = 722; 50484 t['V'] = 667; 50485 t['W'] = 944; 50486 t['X'] = 667; 50487 t['Y'] = 667; 50488 t['Z'] = 611; 50489 t['bracketleft'] = 278; 50490 t['backslash'] = 278; 50491 t['bracketright'] = 278; 50492 t['asciicircum'] = 469; 50493 t['underscore'] = 556; 50494 t['quoteleft'] = 222; 50495 t['a'] = 556; 50496 t['b'] = 556; 50497 t['c'] = 500; 50498 t['d'] = 556; 50499 t['e'] = 556; 50500 t['f'] = 278; 50501 t['g'] = 556; 50502 t['h'] = 556; 50503 t['i'] = 222; 50504 t['j'] = 222; 50505 t['k'] = 500; 50506 t['l'] = 222; 50507 t['m'] = 833; 50508 t['n'] = 556; 50509 t['o'] = 556; 50510 t['p'] = 556; 50511 t['q'] = 556; 50512 t['r'] = 333; 50513 t['s'] = 500; 50514 t['t'] = 278; 50515 t['u'] = 556; 50516 t['v'] = 500; 50517 t['w'] = 722; 50518 t['x'] = 500; 50519 t['y'] = 500; 50520 t['z'] = 500; 50521 t['braceleft'] = 334; 50522 t['bar'] = 260; 50523 t['braceright'] = 334; 50524 t['asciitilde'] = 584; 50525 t['exclamdown'] = 333; 50526 t['cent'] = 556; 50527 t['sterling'] = 556; 50528 t['fraction'] = 167; 50529 t['yen'] = 556; 50530 t['florin'] = 556; 50531 t['section'] = 556; 50532 t['currency'] = 556; 50533 t['quotesingle'] = 191; 50534 t['quotedblleft'] = 333; 50535 t['guillemotleft'] = 556; 50536 t['guilsinglleft'] = 333; 50537 t['guilsinglright'] = 333; 50538 t['fi'] = 500; 50539 t['fl'] = 500; 50540 t['endash'] = 556; 50541 t['dagger'] = 556; 50542 t['daggerdbl'] = 556;
50543 t['periodcentered'] = 278; 50544 t['paragraph'] = 537; 50545 t['bullet'] = 350; 50546 t['quotesinglbase'] = 222; 50547 t['quotedblbase'] = 333; 50548 t['quotedblright'] = 333; 50549 t['guillemotright'] = 556; 50550 t['ellipsis'] = 1000; 50551 t['perthousand'] = 1000; 50552 t['questiondown'] = 611; 50553 t['grave'] = 333; 50554 t['acute'] = 333; 50555 t['circumflex'] = 333; 50556 t['tilde'] = 333; 50557 t['macron'] = 333; 50558 t['breve'] = 333; 50559 t['dotaccent'] = 333; 50560 t['dieresis'] = 333; 50561 t['ring'] = 333; 50562 t['cedilla'] = 333; 50563 t['hungarumlaut'] = 333; 50564 t['ogonek'] = 333; 50565 t['caron'] = 333; 50566 t['emdash'] = 1000; 50567 t['AE'] = 1000; 50568 t['ordfeminine'] = 370; 50569 t['Lslash'] = 556; 50570 t['Oslash'] = 778; 50571 t['OE'] = 1000; 50572 t['ordmasculine'] = 365; 50573 t['ae'] = 889; 50574 t['dotlessi'] = 278; 50575 t['lslash'] = 222; 50576 t['oslash'] = 611; 50577 t['oe'] = 944; 50578 t['germandbls'] = 611; 50579 t['Idieresis'] = 278; 50580 t['eacute'] = 556; 50581 t['abreve'] = 556; 50582 t['uhungarumlaut'] = 556; 50583 t['ecaron'] = 556; 50584 t['Ydieresis'] = 667; 50585 t['divide'] = 584; 50586 t['Yacute'] = 667; 50587 t['Acircumflex'] = 667; 50588 t['aacute'] = 556; 50589 t['Ucircumflex'] = 722; 50590 t['yacute'] = 500; 50591 t['scommaaccent'] = 500; 50592 t['ecircumflex'] = 556; 50593 t['Uring'] = 722; 50594 t['Udieresis'] = 722; 50595 t['aogonek'] = 556; 50596 t['Uacute'] = 722; 50597 t['uogonek'] = 556; 50598 t['Edieresis'] = 667; 50599 t['Dcroat'] = 722; 50600 t['commaaccent'] = 250; 50601 t['copyright'] = 737; 50602 t['Emacron'] = 667; 50603 t['ccaron'] = 500; 50604 t['aring'] = 556; 50605 t['Ncommaaccent'] = 722; 50606 t['lacute'] = 222; 50607 t['agrave'] = 556; 50608 t['Tcommaaccent'] = 611; 50609 t['Cacute'] = 722; 50610 t['atilde'] = 556; 50611 t['Edotaccent'] = 667; 50612 t['scaron'] = 500; 50613 t['scedilla'] = 500; 50614 t['iacute'] = 278; 50615 t['lozenge'] = 471; 50616 t['Rcaron'] = 722; 50617 t['Gcommaaccent'] = 778; 50618 t['ucircumflex'] = 556; 50619 t['acircumflex'] = 556; 50620 t['Amacron'] = 667; 50621 t['rcaron'] = 333; 50622 t['ccedilla'] = 500; 50623 t['Zdotaccent'] = 611; 50624 t['Thorn'] = 667; 50625 t['Omacron'] = 778; 50626 t['Racute'] = 722; 50627 t['Sacute'] = 667; 50628 t['dcaron'] = 643; 50629 t['Umacron'] = 722; 50630 t['uring'] = 556; 50631 t['threesuperior'] = 333; 50632 t['Ograve'] = 778; 50633 t['Agrave'] = 667; 50634 t['Abreve'] = 667; 50635 t['multiply'] = 584; 50636 t['uacute'] = 556; 50637 t['Tcaron'] = 611; 50638 t['partialdiff'] = 476; 50639 t['ydieresis'] = 500; 50640 t['Nacute'] = 722; 50641 t['icircumflex'] = 278; 50642 t['Ecircumflex'] = 667; 50643 t['adieresis'] = 556; 50644 t['edieresis'] = 556; 50645 t['cacute'] = 500; 50646 t['nacute'] = 556; 50647 t['umacron'] = 556; 50648 t['Ncaron'] = 722; 50649 t['Iacute'] = 278; 50650 t['plusminus'] = 584; 50651 t['brokenbar'] = 260; 50652 t['registered'] = 737; 50653 t['Gbreve'] = 778; 50654 t['Idotaccent'] = 278; 50655 t['summation'] = 600; 50656 t['Egrave'] = 667; 50657 t['racute'] = 333; 50658 t['omacron'] = 556; 50659 t['Zacute'] = 611; 50660 t['Zcaron'] = 611; 50661 t['greaterequal'] = 549; 50662 t['Eth'] = 722; 50663 t['Ccedilla'] = 722; 50664 t['lcommaaccent'] = 222; 50665 t['tcaron'] = 317; 50666 t['eogonek'] = 556; 50667 t['Uogonek'] = 722; 50668 t['Aacute'] = 667; 50669 t['Adieresis'] = 667; 50670 t['egrave'] = 556; 50671 t['zacute'] = 500; 50672 t['iogonek'] = 222; 50673 t['Oacute'] = 778; 50674 t['oacute'] = 556; 50675 t['amacron'] = 556; 50676 t['sacute'] = 500; 50677 t['idieresis'] = 278; 50678 t['Ocircumflex'] = 778; 50679 t['Ugrave'] = 722; 50680 t['Delta'] = 612; 50681 t['thorn'] = 556; 50682 t['twosuperior'] = 333; 50683 t['Odieresis'] = 778; 50684 t['mu'] = 556; 50685 t['igrave'] = 278; 50686 t['ohungarumlaut'] = 556; 50687 t['Eogonek'] = 667; 50688 t['dcroat'] = 556; 50689 t['threequarters'] = 834; 50690 t['Scedilla'] = 667; 50691 t['lcaron'] = 299; 50692 t['Kcommaaccent'] = 667; 50693 t['Lacute'] = 556; 50694 t['trademark'] = 1000; 50695 t['edotaccent'] = 556; 50696 t['Igrave'] = 278; 50697 t['Imacron'] = 278; 50698 t['Lcaron'] = 556; 50699 t['onehalf'] = 834; 50700 t['lessequal'] = 549; 50701 t['ocircumflex'] = 556; 50702 t['ntilde'] = 556; 50703 t['Uhungarumlaut'] = 722; 50704 t['Eacute'] = 667; 50705 t['emacron'] = 556; 50706 t['gbreve'] = 556; 50707 t['onequarter'] = 834; 50708 t['Scaron'] = 667; 50709 t['Scommaaccent'] = 667; 50710 t['Ohungarumlaut'] = 778; 50711 t['degree'] = 400; 50712 t['ograve'] = 556; 50713 t['Ccaron'] = 722; 50714 t['ugrave'] = 556; 50715 t['radical'] = 453; 50716 t['Dcaron'] = 722; 50717 t['rcommaaccent'] = 333; 50718 t['Ntilde'] = 722; 50719 t['otilde'] = 556; 50720 t['Rcommaaccent'] = 722; 50721 t['Lcommaaccent'] = 556; 50722 t['Atilde'] = 667; 50723 t['Aogonek'] = 667; 50724 t['Aring'] = 667; 50725 t['Otilde'] = 778; 50726 t['zdotaccent'] = 500; 50727 t['Ecaron'] = 667; 50728 t['Iogonek'] = 278; 50729 t['kcommaaccent'] = 500; 50730 t['minus'] = 584; 50731 t['Icircumflex'] = 278; 50732 t['ncaron'] = 556; 50733 t['tcommaaccent'] = 278; 50734 t['logicalnot'] = 584; 50735 t['odieresis'] = 556; 50736 t['udieresis'] = 556; 50737 t['notequal'] = 549; 50738 t['gcommaaccent'] = 556; 50739 t['eth'] = 556; 50740 t['zcaron'] = 500; 50741 t['ncommaaccent'] = 556; 50742 t['onesuperior'] = 333; 50743 t['imacron'] = 278; 50744 t['Euro'] = 556; 50745 }); 50746 t['Symbol'] = (0, _util.getLookupTableFactory)(function (t) { 50747 t['space'] = 250; 50748 t['exclam'] = 333; 50749 t['universal'] = 713; 50750 t['numbersign'] = 500; 50751 t['existential'] = 549; 50752 t['percent'] = 833; 50753 t['ampersand'] = 778; 50754 t['suchthat'] = 439; 50755 t['parenleft'] = 333; 50756 t['parenright'] = 333; 50757 t['asteriskmath'] = 500; 50758 t['plus'] = 549; 50759 t['comma'] = 250; 50760 t['minus'] = 549; 50761 t['period'] = 250; 50762 t['slash'] = 278; 50763 t['zero'] = 500; 50764 t['one'] = 500; 50765 t['two'] = 500; 50766 t['three'] = 500; 50767 t['four'] = 500; 50768 t['five'] = 500; 50769 t['six'] = 500; 50770 t['seven'] = 500; 50771 t['eight'] = 500; 50772 t['nine'] = 500; 50773 t['colon'] = 278; 50774 t['semicolon'] = 278; 50775 t['less'] = 549; 50776 t['equal'] = 549; 50777 t['greater'] = 549; 50778 t['question'] = 444; 50779 t['congruent'] = 549; 50780 t['Alpha'] = 722; 50781 t['Beta'] = 667; 50782 t['Chi'] = 722; 50783 t['Delta'] = 612; 50784 t['Epsilon'] = 611; 50785 t['Phi'] = 763; 50786 t['Gamma'] = 603; 50787 t['Eta'] = 722; 50788 t['Iota'] = 333; 50789 t['theta1'] = 631; 50790 t['Kappa'] = 722; 50791 t['Lambda'] = 686; 50792 t['Mu'] = 889; 50793 t['Nu'] = 722; 50794 t['Omicron'] = 722; 50795 t['Pi'] = 768; 50796 t['Theta'] = 741; 50797 t['Rho'] = 556;
50798 t['Sigma'] = 592; 50799 t['Tau'] = 611; 50800 t['Upsilon'] = 690; 50801 t['sigma1'] = 439; 50802 t['Omega'] = 768; 50803 t['Xi'] = 645; 50804 t['Psi'] = 795; 50805 t['Zeta'] = 611; 50806 t['bracketleft'] = 333; 50807 t['therefore'] = 863; 50808 t['bracketright'] = 333; 50809 t['perpendicular'] = 658; 50810 t['underscore'] = 500; 50811 t['radicalex'] = 500; 50812 t['alpha'] = 631; 50813 t['beta'] = 549; 50814 t['chi'] = 549; 50815 t['delta'] = 494; 50816 t['epsilon'] = 439; 50817 t['phi'] = 521; 50818 t['gamma'] = 411; 50819 t['eta'] = 603; 50820 t['iota'] = 329; 50821 t['phi1'] = 603; 50822 t['kappa'] = 549; 50823 t['lambda'] = 549; 50824 t['mu'] = 576; 50825 t['nu'] = 521; 50826 t['omicron'] = 549; 50827 t['pi'] = 549; 50828 t['theta'] = 521; 50829 t['rho'] = 549; 50830 t['sigma'] = 603; 50831 t['tau'] = 439; 50832 t['upsilon'] = 576; 50833 t['omega1'] = 713; 50834 t['omega'] = 686; 50835 t['xi'] = 493; 50836 t['psi'] = 686; 50837 t['zeta'] = 494; 50838 t['braceleft'] = 480; 50839 t['bar'] = 200; 50840 t['braceright'] = 480; 50841 t['similar'] = 549; 50842 t['Euro'] = 750; 50843 t['Upsilon1'] = 620; 50844 t['minute'] = 247; 50845 t['lessequal'] = 549; 50846 t['fraction'] = 167; 50847 t['infinity'] = 713; 50848 t['florin'] = 500; 50849 t['club'] = 753; 50850 t['diamond'] = 753; 50851 t['heart'] = 753; 50852 t['spade'] = 753; 50853 t['arrowboth'] = 1042; 50854 t['arrowleft'] = 987; 50855 t['arrowup'] = 603; 50856 t['arrowright'] = 987; 50857 t['arrowdown'] = 603; 50858 t['degree'] = 400; 50859 t['plusminus'] = 549; 50860 t['second'] = 411; 50861 t['greaterequal'] = 549; 50862 t['multiply'] = 549; 50863 t['proportional'] = 713; 50864 t['partialdiff'] = 494; 50865 t['bullet'] = 460; 50866 t['divide'] = 549; 50867 t['notequal'] = 549; 50868 t['equivalence'] = 549; 50869 t['approxequal'] = 549; 50870 t['ellipsis'] = 1000; 50871 t['arrowvertex'] = 603; 50872 t['arrowhorizex'] = 1000; 50873 t['carriagereturn'] = 658; 50874 t['aleph'] = 823; 50875 t['Ifraktur'] = 686; 50876 t['Rfraktur'] = 795; 50877 t['weierstrass'] = 987; 50878 t['circlemultiply'] = 768; 50879 t['circleplus'] = 768; 50880 t['emptyset'] = 823; 50881 t['intersection'] = 768; 50882 t['union'] = 768; 50883 t['propersuperset'] = 713; 50884 t['reflexsuperset'] = 713; 50885 t['notsubset'] = 713; 50886 t['propersubset'] = 713; 50887 t['reflexsubset'] = 713; 50888 t['element'] = 713; 50889 t['notelement'] = 713; 50890 t['angle'] = 768; 50891 t['gradient'] = 713; 50892 t['registerserif'] = 790; 50893 t['copyrightserif'] = 790; 50894 t['trademarkserif'] = 890; 50895 t['product'] = 823; 50896 t['radical'] = 549; 50897 t['dotmath'] = 250; 50898 t['logicalnot'] = 713; 50899 t['logicaland'] = 603; 50900 t['logicalor'] = 603; 50901 t['arrowdblboth'] = 1042; 50902 t['arrowdblleft'] = 987; 50903 t['arrowdblup'] = 603; 50904 t['arrowdblright'] = 987; 50905 t['arrowdbldown'] = 603; 50906 t['lozenge'] = 494; 50907 t['angleleft'] = 329; 50908 t['registersans'] = 790; 50909 t['copyrightsans'] = 790; 50910 t['trademarksans'] = 786; 50911 t['summation'] = 713; 50912 t['parenlefttp'] = 384; 50913 t['parenleftex'] = 384; 50914 t['parenleftbt'] = 384; 50915 t['bracketlefttp'] = 384; 50916 t['bracketleftex'] = 384; 50917 t['bracketleftbt'] = 384; 50918 t['bracelefttp'] = 494; 50919 t['braceleftmid'] = 494; 50920 t['braceleftbt'] = 494; 50921 t['braceex'] = 494; 50922 t['angleright'] = 329; 50923 t['integral'] = 274; 50924 t['integraltp'] = 686; 50925 t['integralex'] = 686; 50926 t['integralbt'] = 686; 50927 t['parenrighttp'] = 384; 50928 t['parenrightex'] = 384; 50929 t['parenrightbt'] = 384; 50930 t['bracketrighttp'] = 384; 50931 t['bracketrightex'] = 384; 50932 t['bracketrightbt'] = 384; 50933 t['bracerighttp'] = 494; 50934 t['bracerightmid'] = 494; 50935 t['bracerightbt'] = 494; 50936 t['apple'] = 790; 50937 }); 50938 t['Times-Roman'] = (0, _util.getLookupTableFactory)(function (t) { 50939 t['space'] = 250; 50940 t['exclam'] = 333; 50941 t['quotedbl'] = 408; 50942 t['numbersign'] = 500; 50943 t['dollar'] = 500; 50944 t['percent'] = 833; 50945 t['ampersand'] = 778; 50946 t['quoteright'] = 333; 50947 t['parenleft'] = 333; 50948 t['parenright'] = 333; 50949 t['asterisk'] = 500; 50950 t['plus'] = 564; 50951 t['comma'] = 250; 50952 t['hyphen'] = 333; 50953 t['period'] = 250; 50954 t['slash'] = 278; 50955 t['zero'] = 500; 50956 t['one'] = 500; 50957 t['two'] = 500; 50958 t['three'] = 500; 50959 t['four'] = 500; 50960 t['five'] = 500; 50961 t['six'] = 500; 50962 t['seven'] = 500; 50963 t['eight'] = 500; 50964 t['nine'] = 500; 50965 t['colon'] = 278; 50966 t['semicolon'] = 278; 50967 t['less'] = 564; 50968 t['equal'] = 564; 50969 t['greater'] = 564; 50970 t['question'] = 444; 50971 t['at'] = 921; 50972 t['A'] = 722; 50973 t['B'] = 667; 50974 t['C'] = 667; 50975 t['D'] = 722; 50976 t['E'] = 611; 50977 t['F'] = 556; 50978 t['G'] = 722; 50979 t['H'] = 722; 50980 t['I'] = 333; 50981 t['J'] = 389; 50982 t['K'] = 722; 50983 t['L'] = 611; 50984 t['M'] = 889; 50985 t['N'] = 722; 50986 t['O'] = 722; 50987 t['P'] = 556; 50988 t['Q'] = 722; 50989 t['R'] = 667; 50990 t['S'] = 556; 50991 t['T'] = 611; 50992 t['U'] = 722; 50993 t['V'] = 722; 50994 t['W'] = 944; 50995 t['X'] = 722; 50996 t['Y'] = 722; 50997 t['Z'] = 611; 50998 t['bracketleft'] = 333; 50999 t['backslash'] = 278; 51000 t['bracketright'] = 333; 51001 t['asciicircum'] = 469; 51002 t['underscore'] = 500; 51003 t['quoteleft'] = 333; 51004 t['a'] = 444; 51005 t['b'] = 500; 51006 t['c'] = 444; 51007 t['d'] = 500; 51008 t['e'] = 444; 51009 t['f'] = 333; 51010 t['g'] = 500; 51011 t['h'] = 500; 51012 t['i'] = 278; 51013 t['j'] = 278; 51014 t['k'] = 500; 51015 t['l'] = 278; 51016 t['m'] = 778; 51017 t['n'] = 500; 51018 t['o'] = 500; 51019 t['p'] = 500; 51020 t['q'] = 500; 51021 t['r'] = 333; 51022 t['s'] = 389; 51023 t['t'] = 278; 51024 t['u'] = 500; 51025 t['v'] = 500; 51026 t['w'] = 722; 51027 t['x'] = 500; 51028 t['y'] = 500; 51029 t['z'] = 444; 51030 t['braceleft'] = 480; 51031 t['bar'] = 200; 51032 t['braceright'] = 480; 51033 t['asciitilde'] = 541; 51034 t['exclamdown'] = 333; 51035 t['cent'] = 500; 51036 t['sterling'] = 500; 51037 t['fraction'] = 167; 51038 t['yen'] = 500; 51039 t['florin'] = 500; 51040 t['section'] = 500; 51041 t['currency'] = 500; 51042 t['quotesingle'] = 180; 51043 t['quotedblleft'] = 444; 51044 t['guillemotleft'] = 500; 51045 t['guilsinglleft'] = 333; 51046 t['guilsinglright'] = 333; 51047 t['fi'] = 556; 51048 t['fl'] = 556; 51049 t['endash'] = 500; 51050 t['dagger'] = 500; 51051 t['daggerdbl'] = 500;
51052 t['periodcentered'] = 250; 51053 t['paragraph'] = 453; 51054 t['bullet'] = 350; 51055 t['quotesinglbase'] = 333; 51056 t['quotedblbase'] = 444; 51057 t['quotedblright'] = 444; 51058 t['guillemotright'] = 500; 51059 t['ellipsis'] = 1000; 51060 t['perthousand'] = 1000; 51061 t['questiondown'] = 444; 51062 t['grave'] = 333; 51063 t['acute'] = 333; 51064 t['circumflex'] = 333; 51065 t['tilde'] = 333; 51066 t['macron'] = 333; 51067 t['breve'] = 333; 51068 t['dotaccent'] = 333; 51069 t['dieresis'] = 333; 51070 t['ring'] = 333; 51071 t['cedilla'] = 333; 51072 t['hungarumlaut'] = 333; 51073 t['ogonek'] = 333; 51074 t['caron'] = 333; 51075 t['emdash'] = 1000; 51076 t['AE'] = 889; 51077 t['ordfeminine'] = 276; 51078 t['Lslash'] = 611; 51079 t['Oslash'] = 722; 51080 t['OE'] = 889; 51081 t['ordmasculine'] = 310; 51082 t['ae'] = 667; 51083 t['dotlessi'] = 278; 51084 t['lslash'] = 278; 51085 t['oslash'] = 500; 51086 t['oe'] = 722; 51087 t['germandbls'] = 500; 51088 t['Idieresis'] = 333; 51089 t['eacute'] = 444; 51090 t['abreve'] = 444; 51091 t['uhungarumlaut'] = 500; 51092 t['ecaron'] = 444; 51093 t['Ydieresis'] = 722; 51094 t['divide'] = 564; 51095 t['Yacute'] = 722; 51096 t['Acircumflex'] = 722; 51097 t['aacute'] = 444; 51098 t['Ucircumflex'] = 722; 51099 t['yacute'] = 500; 51100 t['scommaaccent'] = 389; 51101 t['ecircumflex'] = 444; 51102 t['Uring'] = 722; 51103 t['Udieresis'] = 722; 51104 t['aogonek'] = 444; 51105 t['Uacute'] = 722; 51106 t['uogonek'] = 500; 51107 t['Edieresis'] = 611; 51108 t['Dcroat'] = 722; 51109 t['commaaccent'] = 250; 51110 t['copyright'] = 760; 51111 t['Emacron'] = 611; 51112 t['ccaron'] = 444; 51113 t['aring'] = 444; 51114 t['Ncommaaccent'] = 722; 51115 t['lacute'] = 278; 51116 t['agrave'] = 444; 51117 t['Tcommaaccent'] = 611; 51118 t['Cacute'] = 667; 51119 t['atilde'] = 444; 51120 t['Edotaccent'] = 611; 51121 t['scaron'] = 389; 51122 t['scedilla'] = 389; 51123 t['iacute'] = 278; 51124 t['lozenge'] = 471; 51125 t['Rcaron'] = 667; 51126 t['Gcommaaccent'] = 722; 51127 t['ucircumflex'] = 500; 51128 t['acircumflex'] = 444; 51129 t['Amacron'] = 722; 51130 t['rcaron'] = 333; 51131 t['ccedilla'] = 444; 51132 t['Zdotaccent'] = 611; 51133 t['Thorn'] = 556; 51134 t['Omacron'] = 722; 51135 t['Racute'] = 667; 51136 t['Sacute'] = 556; 51137 t['dcaron'] = 588; 51138 t['Umacron'] = 722; 51139 t['uring'] = 500; 51140 t['threesuperior'] = 300; 51141 t['Ograve'] = 722; 51142 t['Agrave'] = 722; 51143 t['Abreve'] = 722; 51144 t['multiply'] = 564; 51145 t['uacute'] = 500; 51146 t['Tcaron'] = 611; 51147 t['partialdiff'] = 476; 51148 t['ydieresis'] = 500; 51149 t['Nacute'] = 722; 51150 t['icircumflex'] = 278; 51151 t['Ecircumflex'] = 611; 51152 t['adieresis'] = 444; 51153 t['edieresis'] = 444; 51154 t['cacute'] = 444; 51155 t['nacute'] = 500; 51156 t['umacron'] = 500; 51157 t['Ncaron'] = 722; 51158 t['Iacute'] = 333; 51159 t['plusminus'] = 564; 51160 t['brokenbar'] = 200; 51161 t['registered'] = 760; 51162 t['Gbreve'] = 722; 51163 t['Idotaccent'] = 333; 51164 t['summation'] = 600; 51165 t['Egrave'] = 611; 51166 t['racute'] = 333; 51167 t['omacron'] = 500; 51168 t['Zacute'] = 611; 51169 t['Zcaron'] = 611; 51170 t['greaterequal'] = 549; 51171 t['Eth'] = 722; 51172 t['Ccedilla'] = 667; 51173 t['lcommaaccent'] = 278; 51174 t['tcaron'] = 326; 51175 t['eogonek'] = 444; 51176 t['Uogonek'] = 722; 51177 t['Aacute'] = 722; 51178 t['Adieresis'] = 722; 51179 t['egrave'] = 444; 51180 t['zacute'] = 444; 51181 t['iogonek'] = 278; 51182 t['Oacute'] = 722; 51183 t['oacute'] = 500; 51184 t['amacron'] = 444; 51185 t['sacute'] = 389; 51186 t['idieresis'] = 278; 51187 t['Ocircumflex'] = 722; 51188 t['Ugrave'] = 722; 51189 t['Delta'] = 612; 51190 t['thorn'] = 500; 51191 t['twosuperior'] = 300; 51192 t['Odieresis'] = 722; 51193 t['mu'] = 500; 51194 t['igrave'] = 278; 51195 t['ohungarumlaut'] = 500; 51196 t['Eogonek'] = 611; 51197 t['dcroat'] = 500; 51198 t['threequarters'] = 750; 51199 t['Scedilla'] = 556; 51200 t['lcaron'] = 344; 51201 t['Kcommaaccent'] = 722; 51202 t['Lacute'] = 611; 51203 t['trademark'] = 980; 51204 t['edotaccent'] = 444; 51205 t['Igrave'] = 333; 51206 t['Imacron'] = 333; 51207 t['Lcaron'] = 611; 51208 t['onehalf'] = 750; 51209 t['lessequal'] = 549; 51210 t['ocircumflex'] = 500; 51211 t['ntilde'] = 500; 51212 t['Uhungarumlaut'] = 722; 51213 t['Eacute'] = 611; 51214 t['emacron'] = 444; 51215 t['gbreve'] = 500; 51216 t['onequarter'] = 750; 51217 t['Scaron'] = 556; 51218 t['Scommaaccent'] = 556; 51219 t['Ohungarumlaut'] = 722; 51220 t['degree'] = 400; 51221 t['ograve'] = 500; 51222 t['Ccaron'] = 667; 51223 t['ugrave'] = 500; 51224 t['radical'] = 453; 51225 t['Dcaron'] = 722; 51226 t['rcommaaccent'] = 333; 51227 t['Ntilde'] = 722; 51228 t['otilde'] = 500; 51229 t['Rcommaaccent'] = 667; 51230 t['Lcommaaccent'] = 611; 51231 t['Atilde'] = 722; 51232 t['Aogonek'] = 722; 51233 t['Aring'] = 722; 51234 t['Otilde'] = 722; 51235 t['zdotaccent'] = 444; 51236 t['Ecaron'] = 611; 51237 t['Iogonek'] = 333; 51238 t['kcommaaccent'] = 500; 51239 t['minus'] = 564; 51240 t['Icircumflex'] = 333; 51241 t['ncaron'] = 500; 51242 t['tcommaaccent'] = 278; 51243 t['logicalnot'] = 564; 51244 t['odieresis'] = 500; 51245 t['udieresis'] = 500; 51246 t['notequal'] = 549; 51247 t['gcommaaccent'] = 500; 51248 t['eth'] = 500; 51249 t['zcaron'] = 444; 51250 t['ncommaaccent'] = 500; 51251 t['onesuperior'] = 300; 51252 t['imacron'] = 278; 51253 t['Euro'] = 500; 51254 }); 51255 t['Times-Bold'] = (0, _util.getLookupTableFactory)(function (t) { 51256 t['space'] = 250; 51257 t['exclam'] = 333; 51258 t['quotedbl'] = 555; 51259 t['numbersign'] = 500; 51260 t['dollar'] = 500; 51261 t['percent'] = 1000; 51262 t['ampersand'] = 833; 51263 t['quoteright'] = 333; 51264 t['parenleft'] = 333; 51265 t['parenright'] = 333; 51266 t['asterisk'] = 500; 51267 t['plus'] = 570; 51268 t['comma'] = 250; 51269 t['hyphen'] = 333; 51270 t['period'] = 250; 51271 t['slash'] = 278; 51272 t['zero'] = 500; 51273 t['one'] = 500; 51274 t['two'] = 500; 51275 t['three'] = 500; 51276 t['four'] = 500; 51277 t['five'] = 500; 51278 t['six'] = 500; 51279 t['seven'] = 500; 51280 t['eight'] = 500; 51281 t['nine'] = 500; 51282 t['colon'] = 333; 51283 t['semicolon'] = 333; 51284 t['less'] = 570; 51285 t['equal'] = 570; 51286 t['greater'] = 570; 51287 t['question'] = 500; 51288 t['at'] = 930; 51289 t['A'] = 722; 51290 t['B'] = 667; 51291 t['C'] = 722; 51292 t['D'] = 722; 51293 t['E'] = 667; 51294 t['F'] = 611; 51295 t['G'] = 778; 51296 t['H'] = 778; 51297 t['I'] = 389; 51298 t['J'] = 500; 51299 t['K'] = 778; 51300 t['L'] = 667; 51301 t['M'] = 944; 51302 t['N'] = 722; 51303 t['O'] = 778; 51304 t['P'] = 611; 51305 t['Q'] = 778; 51306 t['R'] = 722; 51307 t['S'] = 556; 51308 t['T'] = 667; 51309 t['U'] = 722; 51310 t['V'] = 722; 51311 t['W'] = 1000; 51312 t['X'] = 722; 51313 t['Y'] = 722; 51314 t['Z'] = 667; 51315 t['bracketleft'] = 333; 51316 t['backslash'] = 278; 51317 t['bracketright'] = 333; 51318 t['asciicircum'] = 581; 51319 t['underscore'] = 500; 51320 t['quoteleft'] = 333; 51321 t['a'] = 500; 51322 t['b'] = 556; 51323 t['c'] = 444; 51324 t['d'] = 556; 51325 t['e'] = 444; 51326 t['f'] = 333; 51327 t['g'] = 500; 51328 t['h'] = 556; 51329 t['i'] = 278; 51330 t['j'] = 333; 51331 t['k'] = 556; 51332 t['l'] = 278; 51333 t['m'] = 833; 51334 t['n'] = 556; 51335 t['o'] = 500; 51336 t['p'] = 556; 51337 t['q'] = 556; 51338 t['r'] = 444; 51339 t['s'] = 389; 51340 t['t'] = 333; 51341 t['u'] = 556; 51342 t['v'] = 500; 51343 t['w'] = 722; 51344 t['x'] = 500; 51345 t['y'] = 500; 51346 t['z'] = 444; 51347 t['braceleft'] = 394; 51348 t['bar'] = 220; 51349 t['braceright'] = 394; 51350 t['asciitilde'] = 520; 51351 t['exclamdown'] = 333; 51352 t['cent'] = 500; 51353 t['sterling'] = 500; 51354 t['fraction'] = 167; 51355 t['yen'] = 500; 51356 t['florin'] = 500; 51357 t['section'] = 500; 51358 t['currency'] = 500; 51359 t['quotesingle'] = 278; 51360 t['quotedblleft'] = 500; 51361 t['guillemotleft'] = 500; 51362 t['guilsinglleft'] = 333; 51363 t['guilsinglright'] = 333; 51364 t['fi'] = 556; 51365 t['fl'] = 556; 51366 t['endash'] = 500; 51367 t['dagger'] = 500; 51368 t['daggerdbl'] = 500;
51369 t['periodcentered'] = 250; 51370 t['paragraph'] = 540; 51371 t['bullet'] = 350; 51372 t['quotesinglbase'] = 333; 51373 t['quotedblbase'] = 500; 51374 t['quotedblright'] = 500; 51375 t['guillemotright'] = 500; 51376 t['ellipsis'] = 1000; 51377 t['perthousand'] = 1000; 51378 t['questiondown'] = 500; 51379 t['grave'] = 333; 51380 t['acute'] = 333; 51381 t['circumflex'] = 333; 51382 t['tilde'] = 333; 51383 t['macron'] = 333; 51384 t['breve'] = 333; 51385 t['dotaccent'] = 333; 51386 t['dieresis'] = 333; 51387 t['ring'] = 333; 51388 t['cedilla'] = 333; 51389 t['hungarumlaut'] = 333; 51390 t['ogonek'] = 333; 51391 t['caron'] = 333; 51392 t['emdash'] = 1000; 51393 t['AE'] = 1000; 51394 t['ordfeminine'] = 300; 51395 t['Lslash'] = 667; 51396 t['Oslash'] = 778; 51397 t['OE'] = 1000; 51398 t['ordmasculine'] = 330; 51399 t['ae'] = 722; 51400 t['dotlessi'] = 278; 51401 t['lslash'] = 278; 51402 t['oslash'] = 500; 51403 t['oe'] = 722; 51404 t['germandbls'] = 556; 51405 t['Idieresis'] = 389; 51406 t['eacute'] = 444; 51407 t['abreve'] = 500; 51408 t['uhungarumlaut'] = 556; 51409 t['ecaron'] = 444; 51410 t['Ydieresis'] = 722; 51411 t['divide'] = 570; 51412 t['Yacute'] = 722; 51413 t['Acircumflex'] = 722; 51414 t['aacute'] = 500; 51415 t['Ucircumflex'] = 722; 51416 t['yacute'] = 500; 51417 t['scommaaccent'] = 389; 51418 t['ecircumflex'] = 444; 51419 t['Uring'] = 722; 51420 t['Udieresis'] = 722; 51421 t['aogonek'] = 500; 51422 t['Uacute'] = 722; 51423 t['uogonek'] = 556; 51424 t['Edieresis'] = 667; 51425 t['Dcroat'] = 722; 51426 t['commaaccent'] = 250; 51427 t['copyright'] = 747; 51428 t['Emacron'] = 667; 51429 t['ccaron'] = 444; 51430 t['aring'] = 500; 51431 t['Ncommaaccent'] = 722; 51432 t['lacute'] = 278; 51433 t['agrave'] = 500; 51434 t['Tcommaaccent'] = 667; 51435 t['Cacute'] = 722; 51436 t['atilde'] = 500; 51437 t['Edotaccent'] = 667; 51438 t['scaron'] = 389; 51439 t['scedilla'] = 389; 51440 t['iacute'] = 278; 51441 t['lozenge'] = 494; 51442 t['Rcaron'] = 722; 51443 t['Gcommaaccent'] = 778; 51444 t['ucircumflex'] = 556; 51445 t['acircumflex'] = 500; 51446 t['Amacron'] = 722; 51447 t['rcaron'] = 444; 51448 t['ccedilla'] = 444; 51449 t['Zdotaccent'] = 667; 51450 t['Thorn'] = 611; 51451 t['Omacron'] = 778; 51452 t['Racute'] = 722; 51453 t['Sacute'] = 556; 51454 t['dcaron'] = 672; 51455 t['Umacron'] = 722; 51456 t['uring'] = 556; 51457 t['threesuperior'] = 300; 51458 t['Ograve'] = 778; 51459 t['Agrave'] = 722; 51460 t['Abreve'] = 722; 51461 t['multiply'] = 570; 51462 t['uacute'] = 556; 51463 t['Tcaron'] = 667; 51464 t['partialdiff'] = 494; 51465 t['ydieresis'] = 500; 51466 t['Nacute'] = 722; 51467 t['icircumflex'] = 278; 51468 t['Ecircumflex'] = 667; 51469 t['adieresis'] = 500; 51470 t['edieresis'] = 444; 51471 t['cacute'] = 444; 51472 t['nacute'] = 556; 51473 t['umacron'] = 556; 51474 t['Ncaron'] = 722; 51475 t['Iacute'] = 389; 51476 t['plusminus'] = 570; 51477 t['brokenbar'] = 220; 51478 t['registered'] = 747; 51479 t['Gbreve'] = 778; 51480 t['Idotaccent'] = 389; 51481 t['summation'] = 600; 51482 t['Egrave'] = 667; 51483 t['racute'] = 444; 51484 t['omacron'] = 500; 51485 t['Zacute'] = 667; 51486 t['Zcaron'] = 667; 51487 t['greaterequal'] = 549; 51488 t['Eth'] = 722; 51489 t['Ccedilla'] = 722; 51490 t['lcommaaccent'] = 278; 51491 t['tcaron'] = 416; 51492 t['eogonek'] = 444; 51493 t['Uogonek'] = 722; 51494 t['Aacute'] = 722; 51495 t['Adieresis'] = 722; 51496 t['egrave'] = 444; 51497 t['zacute'] = 444; 51498 t['iogonek'] = 278; 51499 t['Oacute'] = 778; 51500 t['oacute'] = 500; 51501 t['amacron'] = 500; 51502 t['sacute'] = 389; 51503 t['idieresis'] = 278; 51504 t['Ocircumflex'] = 778; 51505 t['Ugrave'] = 722; 51506 t['Delta'] = 612; 51507 t['thorn'] = 556; 51508 t['twosuperior'] = 300; 51509 t['Odieresis'] = 778; 51510 t['mu'] = 556; 51511 t['igrave'] = 278; 51512 t['ohungarumlaut'] = 500; 51513 t['Eogonek'] = 667; 51514 t['dcroat'] = 556; 51515 t['threequarters'] = 750; 51516 t['Scedilla'] = 556; 51517 t['lcaron'] = 394; 51518 t['Kcommaaccent'] = 778; 51519 t['Lacute'] = 667; 51520 t['trademark'] = 1000; 51521 t['edotaccent'] = 444; 51522 t['Igrave'] = 389; 51523 t['Imacron'] = 389; 51524 t['Lcaron'] = 667; 51525 t['onehalf'] = 750; 51526 t['lessequal'] = 549; 51527 t['ocircumflex'] = 500; 51528 t['ntilde'] = 556; 51529 t['Uhungarumlaut'] = 722; 51530 t['Eacute'] = 667; 51531 t['emacron'] = 444; 51532 t['gbreve'] = 500; 51533 t['onequarter'] = 750; 51534 t['Scaron'] = 556; 51535 t['Scommaaccent'] = 556; 51536 t['Ohungarumlaut'] = 778; 51537 t['degree'] = 400; 51538 t['ograve'] = 500; 51539 t['Ccaron'] = 722; 51540 t['ugrave'] = 556; 51541 t['radical'] = 549; 51542 t['Dcaron'] = 722; 51543 t['rcommaaccent'] = 444; 51544 t['Ntilde'] = 722; 51545 t['otilde'] = 500; 51546 t['Rcommaaccent'] = 722; 51547 t['Lcommaaccent'] = 667; 51548 t['Atilde'] = 722; 51549 t['Aogonek'] = 722; 51550 t['Aring'] = 722; 51551 t['Otilde'] = 778; 51552 t['zdotaccent'] = 444; 51553 t['Ecaron'] = 667; 51554 t['Iogonek'] = 389; 51555 t['kcommaaccent'] = 556; 51556 t['minus'] = 570; 51557 t['Icircumflex'] = 389; 51558 t['ncaron'] = 556; 51559 t['tcommaaccent'] = 333; 51560 t['logicalnot'] = 570; 51561 t['odieresis'] = 500; 51562 t['udieresis'] = 556; 51563 t['notequal'] = 549; 51564 t['gcommaaccent'] = 500; 51565 t['eth'] = 500; 51566 t['zcaron'] = 444; 51567 t['ncommaaccent'] = 556; 51568 t['onesuperior'] = 300; 51569 t['imacron'] = 278; 51570 t['Euro'] = 500; 51571 }); 51572 t['Times-BoldItalic'] = (0, _util.getLookupTableFactory)(function (t) { 51573 t['space'] = 250; 51574 t['exclam'] = 389; 51575 t['quotedbl'] = 555; 51576 t['numbersign'] = 500; 51577 t['dollar'] = 500; 51578 t['percent'] = 833; 51579 t['ampersand'] = 778; 51580 t['quoteright'] = 333; 51581 t['parenleft'] = 333; 51582 t['parenright'] = 333; 51583 t['asterisk'] = 500; 51584 t['plus'] = 570; 51585 t['comma'] = 250; 51586 t['hyphen'] = 333; 51587 t['period'] = 250; 51588 t['slash'] = 278; 51589 t['zero'] = 500; 51590 t['one'] = 500; 51591 t['two'] = 500; 51592 t['three'] = 500; 51593 t['four'] = 500; 51594 t['five'] = 500; 51595 t['six'] = 500; 51596 t['seven'] = 500; 51597 t['eight'] = 500; 51598 t['nine'] = 500; 51599 t['colon'] = 333; 51600 t['semicolon'] = 333; 51601 t['less'] = 570; 51602 t['equal'] = 570; 51603 t['greater'] = 570; 51604 t['question'] = 500; 51605 t['at'] = 832; 51606 t['A'] = 667; 51607 t['B'] = 667; 51608 t['C'] = 667; 51609 t['D'] = 722; 51610 t['E'] = 667; 51611 t['F'] = 667; 51612 t['G'] = 722; 51613 t['H'] = 778; 51614 t['I'] = 389; 51615 t['J'] = 500; 51616 t['K'] = 667; 51617 t['L'] = 611; 51618 t['M'] = 889; 51619 t['N'] = 722; 51620 t['O'] = 722; 51621 t['P'] = 611; 51622 t['Q'] = 722; 51623 t['R'] = 667; 51624 t['S'] = 556; 51625 t['T'] = 611; 51626 t['U'] = 722; 51627 t['V'] = 667; 51628 t['W'] = 889; 51629 t['X'] = 667; 51630 t['Y'] = 611; 51631 t['Z'] = 611; 51632 t['bracketleft'] = 333; 51633 t['backslash'] = 278; 51634 t['bracketright'] = 333; 51635 t['asciicircum'] = 570; 51636 t['underscore'] = 500; 51637 t['quoteleft'] = 333; 51638 t['a'] = 500; 51639 t['b'] = 500; 51640 t['c'] = 444; 51641 t['d'] = 500; 51642 t['e'] = 444; 51643 t['f'] = 333; 51644 t['g'] = 500; 51645 t['h'] = 556; 51646 t['i'] = 278; 51647 t['j'] = 278; 51648 t['k'] = 500; 51649 t['l'] = 278; 51650 t['m'] = 778; 51651 t['n'] = 556; 51652 t['o'] = 500; 51653 t['p'] = 500; 51654 t['q'] = 500; 51655 t['r'] = 389; 51656 t['s'] = 389; 51657 t['t'] = 278; 51658 t['u'] = 556; 51659 t['v'] = 444; 51660 t['w'] = 667; 51661 t['x'] = 500; 51662 t['y'] = 444; 51663 t['z'] = 389; 51664 t['braceleft'] = 348; 51665 t['bar'] = 220; 51666 t['braceright'] = 348; 51667 t['asciitilde'] = 570; 51668 t['exclamdown'] = 389; 51669 t['cent'] = 500; 51670 t['sterling'] = 500; 51671 t['fraction'] = 167; 51672 t['yen'] = 500; 51673 t['florin'] = 500; 51674 t['section'] = 500; 51675 t['currency'] = 500; 51676 t['quotesingle'] = 278; 51677 t['quotedblleft'] = 500; 51678 t['guillemotleft'] = 500; 51679 t['guilsinglleft'] = 333; 51680 t['guilsinglright'] = 333; 51681 t['fi'] = 556; 51682 t['fl'] = 556; 51683 t['endash'] = 500; 51684 t['dagger'] = 500; 51685 t['daggerdbl'] = 500;
51686 t['periodcentered'] = 250; 51687 t['paragraph'] = 500; 51688 t['bullet'] = 350; 51689 t['quotesinglbase'] = 333; 51690 t['quotedblbase'] = 500; 51691 t['quotedblright'] = 500; 51692 t['guillemotright'] = 500; 51693 t['ellipsis'] = 1000; 51694 t['perthousand'] = 1000; 51695 t['questiondown'] = 500; 51696 t['grave'] = 333; 51697 t['acute'] = 333; 51698 t['circumflex'] = 333; 51699 t['tilde'] = 333; 51700 t['macron'] = 333; 51701 t['breve'] = 333; 51702 t['dotaccent'] = 333; 51703 t['dieresis'] = 333; 51704 t['ring'] = 333; 51705 t['cedilla'] = 333; 51706 t['hungarumlaut'] = 333; 51707 t['ogonek'] = 333; 51708 t['caron'] = 333; 51709 t['emdash'] = 1000; 51710 t['AE'] = 944; 51711 t['ordfeminine'] = 266; 51712 t['Lslash'] = 611; 51713 t['Oslash'] = 722; 51714 t['OE'] = 944; 51715 t['ordmasculine'] = 300; 51716 t['ae'] = 722; 51717 t['dotlessi'] = 278; 51718 t['lslash'] = 278; 51719 t['oslash'] = 500; 51720 t['oe'] = 722; 51721 t['germandbls'] = 500; 51722 t['Idieresis'] = 389; 51723 t['eacute'] = 444; 51724 t['abreve'] = 500; 51725 t['uhungarumlaut'] = 556; 51726 t['ecaron'] = 444; 51727 t['Ydieresis'] = 611; 51728 t['divide'] = 570; 51729 t['Yacute'] = 611; 51730 t['Acircumflex'] = 667; 51731 t['aacute'] = 500; 51732 t['Ucircumflex'] = 722; 51733 t['yacute'] = 444; 51734 t['scommaaccent'] = 389; 51735 t['ecircumflex'] = 444; 51736 t['Uring'] = 722; 51737 t['Udieresis'] = 722; 51738 t['aogonek'] = 500; 51739 t['Uacute'] = 722; 51740 t['uogonek'] = 556; 51741 t['Edieresis'] = 667; 51742 t['Dcroat'] = 722; 51743 t['commaaccent'] = 250; 51744 t['copyright'] = 747; 51745 t['Emacron'] = 667; 51746 t['ccaron'] = 444; 51747 t['aring'] = 500; 51748 t['Ncommaaccent'] = 722; 51749 t['lacute'] = 278; 51750 t['agrave'] = 500; 51751 t['Tcommaaccent'] = 611; 51752 t['Cacute'] = 667; 51753 t['atilde'] = 500; 51754 t['Edotaccent'] = 667; 51755 t['scaron'] = 389; 51756 t['scedilla'] = 389; 51757 t['iacute'] = 278; 51758 t['lozenge'] = 494; 51759 t['Rcaron'] = 667; 51760 t['Gcommaaccent'] = 722; 51761 t['ucircumflex'] = 556; 51762 t['acircumflex'] = 500; 51763 t['Amacron'] = 667; 51764 t['rcaron'] = 389; 51765 t['ccedilla'] = 444; 51766 t['Zdotaccent'] = 611; 51767 t['Thorn'] = 611; 51768 t['Omacron'] = 722; 51769 t['Racute'] = 667; 51770 t['Sacute'] = 556; 51771 t['dcaron'] = 608; 51772 t['Umacron'] = 722; 51773 t['uring'] = 556; 51774 t['threesuperior'] = 300; 51775 t['Ograve'] = 722; 51776 t['Agrave'] = 667; 51777 t['Abreve'] = 667; 51778 t['multiply'] = 570; 51779 t['uacute'] = 556; 51780 t['Tcaron'] = 611; 51781 t['partialdiff'] = 494; 51782 t['ydieresis'] = 444; 51783 t['Nacute'] = 722; 51784 t['icircumflex'] = 278; 51785 t['Ecircumflex'] = 667; 51786 t['adieresis'] = 500; 51787 t['edieresis'] = 444; 51788 t['cacute'] = 444; 51789 t['nacute'] = 556; 51790 t['umacron'] = 556; 51791 t['Ncaron'] = 722; 51792 t['Iacute'] = 389; 51793 t['plusminus'] = 570; 51794 t['brokenbar'] = 220; 51795 t['registered'] = 747; 51796 t['Gbreve'] = 722; 51797 t['Idotaccent'] = 389; 51798 t['summation'] = 600; 51799 t['Egrave'] = 667; 51800 t['racute'] = 389; 51801 t['omacron'] = 500; 51802 t['Zacute'] = 611; 51803 t['Zcaron'] = 611; 51804 t['greaterequal'] = 549; 51805 t['Eth'] = 722; 51806 t['Ccedilla'] = 667; 51807 t['lcommaaccent'] = 278; 51808 t['tcaron'] = 366; 51809 t['eogonek'] = 444; 51810 t['Uogonek'] = 722; 51811 t['Aacute'] = 667; 51812 t['Adieresis'] = 667; 51813 t['egrave'] = 444; 51814 t['zacute'] = 389; 51815 t['iogonek'] = 278; 51816 t['Oacute'] = 722; 51817 t['oacute'] = 500; 51818 t['amacron'] = 500; 51819 t['sacute'] = 389; 51820 t['idieresis'] = 278; 51821 t['Ocircumflex'] = 722; 51822 t['Ugrave'] = 722; 51823 t['Delta'] = 612; 51824 t['thorn'] = 500; 51825 t['twosuperior'] = 300; 51826 t['Odieresis'] = 722; 51827 t['mu'] = 576; 51828 t['igrave'] = 278; 51829 t['ohungarumlaut'] = 500; 51830 t['Eogonek'] = 667; 51831 t['dcroat'] = 500; 51832 t['threequarters'] = 750; 51833 t['Scedilla'] = 556; 51834 t['lcaron'] = 382; 51835 t['Kcommaaccent'] = 667; 51836 t['Lacute'] = 611; 51837 t['trademark'] = 1000; 51838 t['edotaccent'] = 444; 51839 t['Igrave'] = 389; 51840 t['Imacron'] = 389; 51841 t['Lcaron'] = 611; 51842 t['onehalf'] = 750; 51843 t['lessequal'] = 549; 51844 t['ocircumflex'] = 500; 51845 t['ntilde'] = 556; 51846 t['Uhungarumlaut'] = 722; 51847 t['Eacute'] = 667; 51848 t['emacron'] = 444; 51849 t['gbreve'] = 500; 51850 t['onequarter'] = 750; 51851 t['Scaron'] = 556; 51852 t['Scommaaccent'] = 556; 51853 t['Ohungarumlaut'] = 722; 51854 t['degree'] = 400; 51855 t['ograve'] = 500; 51856 t['Ccaron'] = 667; 51857 t['ugrave'] = 556; 51858 t['radical'] = 549; 51859 t['Dcaron'] = 722; 51860 t['rcommaaccent'] = 389; 51861 t['Ntilde'] = 722; 51862 t['otilde'] = 500; 51863 t['Rcommaaccent'] = 667; 51864 t['Lcommaaccent'] = 611; 51865 t['Atilde'] = 667; 51866 t['Aogonek'] = 667; 51867 t['Aring'] = 667; 51868 t['Otilde'] = 722; 51869 t['zdotaccent'] = 389; 51870 t['Ecaron'] = 667; 51871 t['Iogonek'] = 389; 51872 t['kcommaaccent'] = 500; 51873 t['minus'] = 606; 51874 t['Icircumflex'] = 389; 51875 t['ncaron'] = 556; 51876 t['tcommaaccent'] = 278; 51877 t['logicalnot'] = 606; 51878 t['odieresis'] = 500; 51879 t['udieresis'] = 556; 51880 t['notequal'] = 549; 51881 t['gcommaaccent'] = 500; 51882 t['eth'] = 500; 51883 t['zcaron'] = 389; 51884 t['ncommaaccent'] = 556; 51885 t['onesuperior'] = 300; 51886 t['imacron'] = 278; 51887 t['Euro'] = 500; 51888 }); 51889 t['Times-Italic'] = (0, _util.getLookupTableFactory)(function (t) { 51890 t['space'] = 250; 51891 t['exclam'] = 333; 51892 t['quotedbl'] = 420; 51893 t['numbersign'] = 500; 51894 t['dollar'] = 500; 51895 t['percent'] = 833; 51896 t['ampersand'] = 778; 51897 t['quoteright'] = 333; 51898 t['parenleft'] = 333; 51899 t['parenright'] = 333; 51900 t['asterisk'] = 500; 51901 t['plus'] = 675; 51902 t['comma'] = 250; 51903 t['hyphen'] = 333; 51904 t['period'] = 250; 51905 t['slash'] = 278; 51906 t['zero'] = 500; 51907 t['one'] = 500; 51908 t['two'] = 500; 51909 t['three'] = 500; 51910 t['four'] = 500; 51911 t['five'] = 500; 51912 t['six'] = 500; 51913 t['seven'] = 500; 51914 t['eight'] = 500; 51915 t['nine'] = 500; 51916 t['colon'] = 333; 51917 t['semicolon'] = 333; 51918 t['less'] = 675; 51919 t['equal'] = 675; 51920 t['greater'] = 675; 51921 t['question'] = 500; 51922 t['at'] = 920; 51923 t['A'] = 611; 51924 t['B'] = 611; 51925 t['C'] = 667; 51926 t['D'] = 722; 51927 t['E'] = 611; 51928 t['F'] = 611; 51929 t['G'] = 722; 51930 t['H'] = 722; 51931 t['I'] = 333; 51932 t['J'] = 444; 51933 t['K'] = 667; 51934 t['L'] = 556; 51935 t['M'] = 833; 51936 t['N'] = 667; 51937 t['O'] = 722; 51938 t['P'] = 611; 51939 t['Q'] = 722; 51940 t['R'] = 611; 51941 t['S'] = 500; 51942 t['T'] = 556; 51943 t['U'] = 722; 51944 t['V'] = 611; 51945 t['W'] = 833; 51946 t['X'] = 611; 51947 t['Y'] = 556; 51948 t['Z'] = 556; 51949 t['bracketleft'] = 389; 51950 t['backslash'] = 278; 51951 t['bracketright'] = 389; 51952 t['asciicircum'] = 422; 51953 t['underscore'] = 500; 51954 t['quoteleft'] = 333; 51955 t['a'] = 500; 51956 t['b'] = 500; 51957 t['c'] = 444; 51958 t['d'] = 500; 51959 t['e'] = 444; 51960 t['f'] = 278; 51961 t['g'] = 500; 51962 t['h'] = 500; 51963 t['i'] = 278; 51964 t['j'] = 278; 51965 t['k'] = 444; 51966 t['l'] = 278; 51967 t['m'] = 722; 51968 t['n'] = 500; 51969 t['o'] = 500; 51970 t['p'] = 500; 51971 t['q'] = 500; 51972 t['r'] = 389; 51973 t['s'] = 389; 51974 t['t'] = 278; 51975 t['u'] = 500; 51976 t['v'] = 444; 51977 t['w'] = 667; 51978 t['x'] = 444; 51979 t['y'] = 444; 51980 t['z'] = 389; 51981 t['braceleft'] = 400; 51982 t['bar'] = 275; 51983 t['braceright'] = 400; 51984 t['asciitilde'] = 541; 51985 t['exclamdown'] = 389; 51986 t['cent'] = 500; 51987 t['sterling'] = 500; 51988 t['fraction'] = 167; 51989 t['yen'] = 500; 51990 t['florin'] = 500; 51991 t['section'] = 500; 51992 t['currency'] = 500; 51993 t['quotesingle'] = 214; 51994 t['quotedblleft'] = 556; 51995 t['guillemotleft'] = 500; 51996 t['guilsinglleft'] = 333; 51997 t['guilsinglright'] = 333; 51998 t['fi'] = 500; 51999 t['fl'] = 500; 52000 t['endash'] = 500; 52001 t['dagger'] = 500; 52002 t['daggerdbl'] = 500;
52003 t['periodcentered'] = 250; 52004 t['paragraph'] = 523; 52005 t['bullet'] = 350; 52006 t['quotesinglbase'] = 333; 52007 t['quotedblbase'] = 556; 52008 t['quotedblright'] = 556; 52009 t['guillemotright'] = 500; 52010 t['ellipsis'] = 889; 52011 t['perthousand'] = 1000; 52012 t['questiondown'] = 500; 52013 t['grave'] = 333; 52014 t['acute'] = 333; 52015 t['circumflex'] = 333; 52016 t['tilde'] = 333; 52017 t['macron'] = 333; 52018 t['breve'] = 333; 52019 t['dotaccent'] = 333; 52020 t['dieresis'] = 333; 52021 t['ring'] = 333; 52022 t['cedilla'] = 333; 52023 t['hungarumlaut'] = 333; 52024 t['ogonek'] = 333; 52025 t['caron'] = 333; 52026 t['emdash'] = 889; 52027 t['AE'] = 889; 52028 t['ordfeminine'] = 276; 52029 t['Lslash'] = 556; 52030 t['Oslash'] = 722; 52031 t['OE'] = 944; 52032 t['ordmasculine'] = 310; 52033 t['ae'] = 667; 52034 t['dotlessi'] = 278; 52035 t['lslash'] = 278; 52036 t['oslash'] = 500; 52037 t['oe'] = 667; 52038 t['germandbls'] = 500; 52039 t['Idieresis'] = 333; 52040 t['eacute'] = 444; 52041 t['abreve'] = 500; 52042 t['uhungarumlaut'] = 500; 52043 t['ecaron'] = 444; 52044 t['Ydieresis'] = 556; 52045 t['divide'] = 675; 52046 t['Yacute'] = 556; 52047 t['Acircumflex'] = 611; 52048 t['aacute'] = 500; 52049 t['Ucircumflex'] = 722; 52050 t['yacute'] = 444; 52051 t['scommaaccent'] = 389; 52052 t['ecircumflex'] = 444; 52053 t['Uring'] = 722; 52054 t['Udieresis'] = 722; 52055 t['aogonek'] = 500; 52056 t['Uacute'] = 722; 52057 t['uogonek'] = 500; 52058 t['Edieresis'] = 611; 52059 t['Dcroat'] = 722; 52060 t['commaaccent'] = 250; 52061 t['copyright'] = 760; 52062 t['Emacron'] = 611; 52063 t['ccaron'] = 444; 52064 t['aring'] = 500; 52065 t['Ncommaaccent'] = 667; 52066 t['lacute'] = 278; 52067 t['agrave'] = 500; 52068 t['Tcommaaccent'] = 556; 52069 t['Cacute'] = 667; 52070 t['atilde'] = 500; 52071 t['Edotaccent'] = 611; 52072 t['scaron'] = 389; 52073 t['scedilla'] = 389; 52074 t['iacute'] = 278; 52075 t['lozenge'] = 471; 52076 t['Rcaron'] = 611; 52077 t['Gcommaaccent'] = 722; 52078 t['ucircumflex'] = 500; 52079 t['acircumflex'] = 500; 52080 t['Amacron'] = 611; 52081 t['rcaron'] = 389; 52082 t['ccedilla'] = 444; 52083 t['Zdotaccent'] = 556; 52084 t['Thorn'] = 611; 52085 t['Omacron'] = 722; 52086 t['Racute'] = 611; 52087 t['Sacute'] = 500; 52088 t['dcaron'] = 544; 52089 t['Umacron'] = 722; 52090 t['uring'] = 500; 52091 t['threesuperior'] = 300; 52092 t['Ograve'] = 722; 52093 t['Agrave'] = 611; 52094 t['Abreve'] = 611; 52095 t['multiply'] = 675; 52096 t['uacute'] = 500; 52097 t['Tcaron'] = 556; 52098 t['partialdiff'] = 476; 52099 t['ydieresis'] = 444; 52100 t['Nacute'] = 667; 52101 t['icircumflex'] = 278; 52102 t['Ecircumflex'] = 611; 52103 t['adieresis'] = 500; 52104 t['edieresis'] = 444; 52105 t['cacute'] = 444; 52106 t['nacute'] = 500; 52107 t['umacron'] = 500; 52108 t['Ncaron'] = 667; 52109 t['Iacute'] = 333; 52110 t['plusminus'] = 675; 52111 t['brokenbar'] = 275; 52112 t['registered'] = 760; 52113 t['Gbreve'] = 722; 52114 t['Idotaccent'] = 333; 52115 t['summation'] = 600; 52116 t['Egrave'] = 611; 52117 t['racute'] = 389; 52118 t['omacron'] = 500; 52119 t['Zacute'] = 556; 52120 t['Zcaron'] = 556; 52121 t['greaterequal'] = 549; 52122 t['Eth'] = 722; 52123 t['Ccedilla'] = 667; 52124 t['lcommaaccent'] = 278; 52125 t['tcaron'] = 300; 52126 t['eogonek'] = 444; 52127 t['Uogonek'] = 722; 52128 t['Aacute'] = 611; 52129 t['Adieresis'] = 611; 52130 t['egrave'] = 444; 52131 t['zacute'] = 389; 52132 t['iogonek'] = 278; 52133 t['Oacute'] = 722; 52134 t['oacute'] = 500; 52135 t['amacron'] = 500; 52136 t['sacute'] = 389; 52137 t['idieresis'] = 278; 52138 t['Ocircumflex'] = 722; 52139 t['Ugrave'] = 722; 52140 t['Delta'] = 612; 52141 t['thorn'] = 500; 52142 t['twosuperior'] = 300; 52143 t['Odieresis'] = 722; 52144 t['mu'] = 500; 52145 t['igrave'] = 278; 52146 t['ohungarumlaut'] = 500; 52147 t['Eogonek'] = 611; 52148 t['dcroat'] = 500; 52149 t['threequarters'] = 750; 52150 t['Scedilla'] = 500; 52151 t['lcaron'] = 300; 52152 t['Kcommaaccent'] = 667; 52153 t['Lacute'] = 556; 52154 t['trademark'] = 980; 52155 t['edotaccent'] = 444; 52156 t['Igrave'] = 333; 52157 t['Imacron'] = 333; 52158 t['Lcaron'] = 611; 52159 t['onehalf'] = 750; 52160 t['lessequal'] = 549; 52161 t['ocircumflex'] = 500; 52162 t['ntilde'] = 500; 52163 t['Uhungarumlaut'] = 722; 52164 t['Eacute'] = 611; 52165 t['emacron'] = 444; 52166 t['gbreve'] = 500; 52167 t['onequarter'] = 750; 52168 t['Scaron'] = 500; 52169 t['Scommaaccent'] = 500; 52170 t['Ohungarumlaut'] = 722; 52171 t['degree'] = 400; 52172 t['ograve'] = 500; 52173 t['Ccaron'] = 667; 52174 t['ugrave'] = 500; 52175 t['radical'] = 453; 52176 t['Dcaron'] = 722; 52177 t['rcommaaccent'] = 389; 52178 t['Ntilde'] = 667; 52179 t['otilde'] = 500; 52180 t['Rcommaaccent'] = 611; 52181 t['Lcommaaccent'] = 556; 52182 t['Atilde'] = 611; 52183 t['Aogonek'] = 611; 52184 t['Aring'] = 611; 52185 t['Otilde'] = 722; 52186 t['zdotaccent'] = 389; 52187 t['Ecaron'] = 611; 52188 t['Iogonek'] = 333; 52189 t['kcommaaccent'] = 444; 52190 t['minus'] = 675; 52191 t['Icircumflex'] = 333; 52192 t['ncaron'] = 500; 52193 t['tcommaaccent'] = 278; 52194 t['logicalnot'] = 675; 52195 t['odieresis'] = 500; 52196 t['udieresis'] = 500; 52197 t['notequal'] = 549; 52198 t['gcommaaccent'] = 500; 52199 t['eth'] = 500; 52200 t['zcaron'] = 389; 52201 t['ncommaaccent'] = 500; 52202 t['onesuperior'] = 300; 52203 t['imacron'] = 278; 52204 t['Euro'] = 500; 52205 }); 52206 t['ZapfDingbats'] = (0, _util.getLookupTableFactory)(function (t) { 52207 t['space'] = 278; 52208 t['a1'] = 974; 52209 t['a2'] = 961; 52210 t['a202'] = 974; 52211 t['a3'] = 980; 52212 t['a4'] = 719; 52213 t['a5'] = 789; 52214 t['a119'] = 790; 52215 t['a118'] = 791; 52216 t['a117'] = 690; 52217 t['a11'] = 960; 52218 t['a12'] = 939; 52219 t['a13'] = 549; 52220 t['a14'] = 855; 52221 t['a15'] = 911; 52222 t['a16'] = 933; 52223 t['a105'] = 911; 52224 t['a17'] = 945; 52225 t['a18'] = 974; 52226 t['a19'] = 755; 52227 t['a20'] = 846; 52228 t['a21'] = 762; 52229 t['a22'] = 761; 52230 t['a23'] = 571; 52231 t['a24'] = 677; 52232 t['a25'] = 763; 52233 t['a26'] = 760; 52234 t['a27'] = 759; 52235 t['a28'] = 754; 52236 t['a6'] = 494; 52237 t['a7'] = 552; 52238 t['a8'] = 537; 52239 t['a9'] = 577; 52240 t['a10'] = 692; 52241 t['a29'] = 786; 52242 t['a30'] = 788; 52243 t['a31'] = 788; 52244 t['a32'] = 790; 52245 t['a33'] = 793; 52246 t['a34'] = 794; 52247 t['a35'] = 816; 52248 t['a36'] = 823; 52249 t['a37'] = 789; 52250 t['a38'] = 841; 52251 t['a39'] = 823; 52252 t['a40'] = 833; 52253 t['a41'] = 816; 52254 t['a42'] = 831; 52255 t['a43'] = 923; 52256 t['a44'] = 744; 52257 t['a45'] = 723; 52258 t['a46'] = 749; 52259 t['a47'] = 790; 52260 t['a48'] = 792; 52261 t['a49'] = 695; 52262 t['a50'] = 776; 52263 t['a51'] = 768; 52264 t['a52'] = 792; 52265 t['a53'] = 759; 52266 t['a54'] = 707; 52267 t['a55'] = 708; 52268 t['a56'] = 682; 52269 t['a57'] = 701; 52270 t['a58'] = 826; 52271 t['a59'] = 815; 52272 t['a60'] = 789; 52273 t['a61'] = 789; 52274 t['a62'] = 707; 52275 t['a63'] = 687; 52276 t['a64'] = 696; 52277 t['a65'] = 689; 52278 t['a66'] = 786; 52279 t['a67'] = 787; 52280 t['a68'] = 713; 52281 t['a69'] = 791; 52282 t['a70'] = 785; 52283 t['a71'] = 791; 52284 t['a72'] = 873; 52285 t['a73'] = 761; 52286 t['a74'] = 762; 52287 t['a203'] = 762; 52288 t['a75'] = 759; 52289 t['a204'] = 759; 52290 t['a76'] = 892; 52291 t['a77'] = 892; 52292 t['a78'] = 788; 52293 t['a79'] = 784; 52294 t['a81'] = 438; 52295 t['a82'] = 138; 52296 t['a83'] = 277; 52297 t['a84'] = 415; 52298 t['a97'] = 392; 52299 t['a98'] = 392; 52300 t['a99'] = 668; 52301 t['a100'] = 668; 52302 t['a89'] = 390; 52303 t['a90'] = 390; 52304 t['a93'] = 317; 52305 t['a94'] = 317; 52306 t['a91'] = 276; 52307 t['a92'] = 276; 52308 t['a205'] = 509;
52309 t['a85'] = 509; 52310 t['a206'] = 410; 52311 t['a86'] = 410; 52312 t['a87'] = 234; 52313 t['a88'] = 234; 52314 t['a95'] = 334; 52315 t['a96'] = 334; 52316 t['a101'] = 732; 52317 t['a102'] = 544; 52318 t['a103'] = 544; 52319 t['a104'] = 910; 52320 t['a106'] = 667; 52321 t['a107'] = 760; 52322 t['a108'] = 760; 52323 t['a112'] = 776; 52324 t['a111'] = 595; 52325 t['a110'] = 694; 52326 t['a109'] = 626; 52327 t['a120'] = 788; 52328 t['a121'] = 788; 52329 t['a122'] = 788; 52330 t['a123'] = 788; 52331 t['a124'] = 788; 52332 t['a125'] = 788; 52333 t['a126'] = 788; 52334 t['a127'] = 788; 52335 t['a128'] = 788; 52336 t['a129'] = 788; 52337 t['a130'] = 788; 52338 t['a131'] = 788; 52339 t['a132'] = 788; 52340 t['a133'] = 788; 52341 t['a134'] = 788; 52342 t['a135'] = 788; 52343 t['a136'] = 788; 52344 t['a137'] = 788; 52345 t['a138'] = 788; 52346 t['a139'] = 788; 52347 t['a140'] = 788; 52348 t['a141'] = 788; 52349 t['a142'] = 788; 52350 t['a143'] = 788; 52351 t['a144'] = 788; 52352 t['a145'] = 788; 52353 t['a146'] = 788; 52354 t['a147'] = 788; 52355 t['a148'] = 788; 52356 t['a149'] = 788; 52357 t['a150'] = 788; 52358 t['a151'] = 788; 52359 t['a152'] = 788; 52360 t['a153'] = 788; 52361 t['a154'] = 788; 52362 t['a155'] = 788; 52363 t['a156'] = 788; 52364 t['a157'] = 788; 52365 t['a158'] = 788; 52366 t['a159'] = 788; 52367 t['a160'] = 894; 52368 t['a161'] = 838; 52369 t['a163'] = 1016; 52370 t['a164'] = 458; 52371 t['a196'] = 748; 52372 t['a165'] = 924; 52373 t['a192'] = 748; 52374 t['a166'] = 918; 52375 t['a167'] = 927; 52376 t['a168'] = 928; 52377 t['a169'] = 928; 52378 t['a170'] = 834; 52379 t['a171'] = 873; 52380 t['a172'] = 828; 52381 t['a173'] = 924; 52382 t['a162'] = 924; 52383 t['a174'] = 917; 52384 t['a175'] = 930; 52385 t['a176'] = 931; 52386 t['a177'] = 463; 52387 t['a178'] = 883; 52388 t['a179'] = 836; 52389 t['a193'] = 836; 52390 t['a180'] = 867; 52391 t['a199'] = 867; 52392 t['a181'] = 696; 52393 t['a200'] = 696; 52394 t['a182'] = 874; 52395 t['a201'] = 874; 52396 t['a183'] = 760; 52397 t['a184'] = 946; 52398 t['a197'] = 771; 52399 t['a185'] = 865; 52400 t['a194'] = 771; 52401 t['a198'] = 888; 52402 t['a186'] = 967; 52403 t['a195'] = 888; 52404 t['a187'] = 831; 52405 t['a188'] = 873; 52406 t['a189'] = 927; 52407 t['a190'] = 970; 52408 t['a191'] = 918; 52409 }); 52410}); 52411exports.getMetrics = getMetrics; 52412 52413/***/ }), 52414/* 185 */ 52415/***/ (function(module, exports, __w_pdfjs_require__) { 52416 52417"use strict"; 52418 52419 52420Object.defineProperty(exports, "__esModule", { 52421 value: true 52422}); 52423exports.isPDFFunction = isPDFFunction; 52424exports.PostScriptCompiler = exports.PostScriptEvaluator = exports.PDFFunctionFactory = void 0; 52425 52426var _util = __w_pdfjs_require__(6); 52427 52428var _primitives = __w_pdfjs_require__(155); 52429 52430var _ps_parser = __w_pdfjs_require__(186); 52431 52432function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 52433 52434function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 52435 52436function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 52437 52438function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 52439 52440var IsEvalSupportedCached = { 52441 get value() { 52442 return (0, _util.shadow)(this, 'value', (0, _util.isEvalSupported)()); 52443 } 52444 52445}; 52446 52447var PDFFunctionFactory = 52448/*#__PURE__*/ 52449function () { 52450 function PDFFunctionFactory(_ref) { 52451 var xref = _ref.xref, 52452 _ref$isEvalSupported = _ref.isEvalSupported, 52453 isEvalSupported = _ref$isEvalSupported === void 0 ? true : _ref$isEvalSupported; 52454 52455 _classCallCheck(this, PDFFunctionFactory); 52456 52457 this.xref = xref; 52458 this.isEvalSupported = isEvalSupported !== false; 52459 } 52460 52461 _createClass(PDFFunctionFactory, [{ 52462 key: "create", 52463 value: function create(fn) { 52464 return PDFFunction.parse({ 52465 xref: this.xref, 52466 isEvalSupported: this.isEvalSupported, 52467 fn: fn 52468 }); 52469 } 52470 }, { 52471 key: "createFromArray", 52472 value: function createFromArray(fnObj) { 52473 return PDFFunction.parseArray({ 52474 xref: this.xref, 52475 isEvalSupported: this.isEvalSupported, 52476 fnObj: fnObj 52477 }); 52478 } 52479 }]); 52480 52481 return PDFFunctionFactory;
52482}(); 52483 52484exports.PDFFunctionFactory = PDFFunctionFactory; 52485 52486function toNumberArray(arr) { 52487 if (!Array.isArray(arr)) { 52488 return null; 52489 } 52490 52491 var length = arr.length; 52492 52493 for (var i = 0; i < length; i++) { 52494 if (typeof arr[i] !== 'number') { 52495 var result = new Array(length); 52496 52497 for (var _i = 0; _i < length; _i++) { 52498 result[_i] = +arr[_i]; 52499 } 52500 52501 return result; 52502 } 52503 } 52504 52505 return arr; 52506} 52507 52508var PDFFunction = function PDFFunctionClosure() { 52509 var CONSTRUCT_SAMPLED = 0; 52510 var CONSTRUCT_INTERPOLATED = 2; 52511 var CONSTRUCT_STICHED = 3; 52512 var CONSTRUCT_POSTSCRIPT = 4; 52513 return { 52514 getSampleArray: function getSampleArray(size, outputSize, bps, stream) { 52515 var i, ii; 52516 var length = 1; 52517 52518 for (i = 0, ii = size.length; i < ii; i++) { 52519 length *= size[i]; 52520 } 52521 52522 length *= outputSize; 52523 var array = new Array(length); 52524 var codeSize = 0; 52525 var codeBuf = 0; 52526 var sampleMul = 1.0 / (Math.pow(2.0, bps) - 1); 52527 var strBytes = stream.getBytes((length * bps + 7) / 8); 52528 var strIdx = 0; 52529 52530 for (i = 0; i < length; i++) { 52531 while (codeSize < bps) { 52532 codeBuf <<= 8; 52533 codeBuf |= strBytes[strIdx++]; 52534 codeSize += 8; 52535 } 52536 52537 codeSize -= bps; 52538 array[i] = (codeBuf >> codeSize) * sampleMul; 52539 codeBuf &= (1 << codeSize) - 1; 52540 } 52541 52542 return array; 52543 }, 52544 getIR: function getIR(_ref2) { 52545 var xref = _ref2.xref, 52546 isEvalSupported = _ref2.isEvalSupported, 52547 fn = _ref2.fn; 52548 var dict = fn.dict; 52549 52550 if (!dict) { 52551 dict = fn; 52552 } 52553 52554 var types = [this.constructSampled, null, this.constructInterpolated, this.constructStiched, this.constructPostScript]; 52555 var typeNum = dict.get('FunctionType'); 52556 var typeFn = types[typeNum]; 52557 52558 if (!typeFn) { 52559 throw new _util.FormatError('Unknown type of function'); 52560 } 52561 52562 return typeFn.call(this, { 52563 xref: xref, 52564 isEvalSupported: isEvalSupported, 52565 fn: fn, 52566 dict: dict 52567 }); 52568 }, 52569 fromIR: function fromIR(_ref3) { 52570 var xref = _ref3.xref, 52571 isEvalSupported = _ref3.isEvalSupported, 52572 IR = _ref3.IR; 52573 var type = IR[0]; 52574 52575 switch (type) { 52576 case CONSTRUCT_SAMPLED: 52577 return this.constructSampledFromIR({ 52578 xref: xref, 52579 isEvalSupported: isEvalSupported, 52580 IR: IR 52581 }); 52582 52583 case CONSTRUCT_INTERPOLATED: 52584 return this.constructInterpolatedFromIR({ 52585 xref: xref, 52586 isEvalSupported: isEvalSupported, 52587 IR: IR 52588 }); 52589 52590 case CONSTRUCT_STICHED: 52591 return this.constructStichedFromIR({ 52592 xref: xref, 52593 isEvalSupported: isEvalSupported, 52594 IR: IR 52595 }); 52596 52597 default: 52598 return this.constructPostScriptFromIR({ 52599 xref: xref, 52600 isEvalSupported: isEvalSupported, 52601 IR: IR 52602 }); 52603 } 52604 }, 52605 parse: function parse(_ref4) { 52606 var xref = _ref4.xref, 52607 isEvalSupported = _ref4.isEvalSupported, 52608 fn = _ref4.fn; 52609 var IR = this.getIR({ 52610 xref: xref, 52611 isEvalSupported: isEvalSupported, 52612 fn: fn 52613 }); 52614 return this.fromIR({ 52615 xref: xref, 52616 isEvalSupported: isEvalSupported, 52617 IR: IR 52618 }); 52619 }, 52620 parseArray: function parseArray(_ref5) { 52621 var xref = _ref5.xref, 52622 isEvalSupported = _ref5.isEvalSupported, 52623 fnObj = _ref5.fnObj; 52624 52625 if (!Array.isArray(fnObj)) { 52626 return this.parse({ 52627 xref: xref, 52628 isEvalSupported: isEvalSupported, 52629 fn: fnObj 52630 }); 52631 } 52632 52633 var fnArray = []; 52634 52635 for (var j = 0, jj = fnObj.length; j < jj; j++) { 52636 fnArray.push(this.parse({ 52637 xref: xref, 52638 isEvalSupported: isEvalSupported, 52639 fn: xref.fetchIfRef(fnObj[j]) 52640 })); 52641 } 52642
vendor: 5,110 bytes, lines 52643-52804
52643 return function (src, srcOffset, dest, destOffset) { 52644 for (var i = 0, ii = fnArray.length; i < ii; i++) { 52645 fnArray[i](src, srcOffset, dest, destOffset + i); 52646 } 52647 }; 52648 }, 52649 constructSampled: function constructSampled(_ref6) { 52650 var xref = _ref6.xref, 52651 isEvalSupported = _ref6.isEvalSupported, 52652 fn = _ref6.fn, 52653 dict = _ref6.dict; 52654 52655 function toMultiArray(arr) { 52656 var inputLength = arr.length; 52657 var out = []; 52658 var index = 0; 52659 52660 for (var i = 0; i < inputLength; i += 2) { 52661 out[index] = [arr[i], arr[i + 1]]; 52662 ++index; 52663 } 52664 52665 return out; 52666 } 52667 52668 var domain = toNumberArray(dict.getArray('Domain')); 52669 var range = toNumberArray(dict.getArray('Range')); 52670 52671 if (!domain || !range) { 52672 throw new _util.FormatError('No domain or range'); 52673 } 52674 52675 var inputSize = domain.length / 2; 52676 var outputSize = range.length / 2; 52677 domain = toMultiArray(domain); 52678 range = toMultiArray(range); 52679 var size = toNumberArray(dict.getArray('Size')); 52680 var bps = dict.get('BitsPerSample'); 52681 var order = dict.get('Order') || 1; 52682 52683 if (order !== 1) { 52684 (0, _util.info)('No support for cubic spline interpolation: ' + order); 52685 } 52686 52687 var encode = toNumberArray(dict.getArray('Encode')); 52688 52689 if (!encode) { 52690 encode = []; 52691 52692 for (var i = 0; i < inputSize; ++i) { 52693 encode.push([0, size[i] - 1]); 52694 } 52695 } else { 52696 encode = toMultiArray(encode); 52697 } 52698 52699 var decode = toNumberArray(dict.getArray('Decode')); 52700 52701 if (!decode) { 52702 decode = range; 52703 } else { 52704 decode = toMultiArray(decode); 52705 } 52706 52707 var samples = this.getSampleArray(size, outputSize, bps, fn); 52708 return [CONSTRUCT_SAMPLED, inputSize, domain, encode, decode, samples, size, outputSize, Math.pow(2, bps) - 1, range]; 52709 }, 52710 constructSampledFromIR: function constructSampledFromIR(_ref7) { 52711 var xref = _ref7.xref, 52712 isEvalSupported = _ref7.isEvalSupported, 52713 IR = _ref7.IR; 52714 52715 function interpolate(x, xmin, xmax, ymin, ymax) { 52716 return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); 52717 } 52718 52719 return function constructSampledFromIRResult(src, srcOffset, dest, destOffset) { 52720 var m = IR[1]; 52721 var domain = IR[2]; 52722 var encode = IR[3]; 52723 var decode = IR[4]; 52724 var samples = IR[5]; 52725 var size = IR[6]; 52726 var n = IR[7]; 52727 var range = IR[9]; 52728 var cubeVertices = 1 << m; 52729 var cubeN = new Float64Array(cubeVertices); 52730 var cubeVertex = new Uint32Array(cubeVertices); 52731 var i, j; 52732 52733 for (j = 0; j < cubeVertices; j++) { 52734 cubeN[j] = 1; 52735 } 52736 52737 var k = n, 52738 pos = 1; 52739 52740 for (i = 0; i < m; ++i) { 52741 var domain_2i = domain[i][0]; 52742 var domain_2i_1 = domain[i][1]; 52743 var xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); 52744 var e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); 52745 var size_i = size[i]; 52746 e = Math.min(Math.max(e, 0), size_i - 1); 52747 var e0 = e < size_i - 1 ? Math.floor(e) : e - 1; 52748 var n0 = e0 + 1 - e; 52749 var n1 = e - e0; 52750 var offset0 = e0 * k; 52751 var offset1 = offset0 + k; 52752 52753 for (j = 0; j < cubeVertices; j++) { 52754 if (j & pos) { 52755 cubeN[j] *= n1; 52756 cubeVertex[j] += offset1; 52757 } else { 52758 cubeN[j] *= n0; 52759 cubeVertex[j] += offset0; 52760 } 52761 } 52762 52763 k *= size_i; 52764 pos <<= 1; 52765 } 52766 52767 for (j = 0; j < n; ++j) { 52768 var rj = 0; 52769 52770 for (i = 0; i < cubeVertices; i++) { 52771 rj += samples[cubeVertex[i] + j] * cubeN[i]; 52772 } 52773 52774 rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); 52775 dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]); 52776 } 52777 }; 52778 }, 52779 constructInterpolated: function constructInterpolated(_ref8) { 52780 var xref = _ref8.xref, 52781 isEvalSupported = _ref8.isEvalSupported, 52782 fn = _ref8.fn, 52783 dict = _ref8.dict; 52784 var c0 = toNumberArray(dict.getArray('C0')) || [0]; 52785 var c1 = toNumberArray(dict.getArray('C1')) || [1]; 52786 var n = dict.get('N'); 52787 var length = c0.length; 52788 var diff = []; 52789 52790 for (var i = 0; i < length; ++i) { 52791 diff.push(c1[i] - c0[i]); 52792 } 52793 52794 return [CONSTRUCT_INTERPOLATED, c0, diff, n]; 52795 }, 52796 constructInterpolatedFromIR: function constructInterpolatedFromIR(_ref9) { 52797 var xref = _ref9.xref, 52798 isEvalSupported = _ref9.isEvalSupported, 52799 IR = _ref9.IR; 52800 var c0 = IR[1]; 52801 var diff = IR[2]; 52802 var n = IR[3]; 52803 var length = diff.length; 52804 return function constructInterpolatedFromIRResult(src, srcOffset, dest, destOff
52804set) { 52805 var x = n === 1 ? src[srcOffset] : Math.pow(src[srcOffset], n); 52806 52807 for (var j = 0; j < length; ++j) { 52808 dest[destOffset + j] = c0[j] + x * diff[j]; 52809 } 52810 }; 52811 }, 52812 constructStiched: function constructStiched(_ref10) { 52813 var xref = _ref10.xref, 52814 isEvalSupported = _ref10.isEvalSupported, 52815 fn = _ref10.fn, 52816 dict = _ref10.dict; 52817 var domain = toNumberArray(dict.getArray('Domain')); 52818 52819 if (!domain) { 52820 throw new _util.FormatError('No domain'); 52821 } 52822 52823 var inputSize = domain.length / 2; 52824 52825 if (inputSize !== 1) { 52826 throw new _util.FormatError('Bad domain for stiched function'); 52827 } 52828 52829 var fnRefs = dict.get('Functions'); 52830 var fns = []; 52831 52832 for (var i = 0, ii = fnRefs.length; i < ii; ++i) { 52833 fns.push(this.parse({ 52834 xref: xref, 52835 isEvalSupported: isEvalSupported, 52836 fn: xref.fetchIfRef(fnRefs[i]) 52837 })); 52838 } 52839 52840 var bounds = toNumberArray(dict.getArray('Bounds')); 52841 var encode = toNumberArray(dict.getArray('Encode')); 52842 return [CONSTRUCT_STICHED, domain, bounds, encode, fns]; 52843 }, 52844 constructStichedFromIR: function constructStichedFromIR(_ref11) { 52845 var xref = _ref11.xref, 52846 isEvalSupported = _ref11.isEvalSupported, 52847 IR = _ref11.IR; 52848 var domain = IR[1]; 52849 var bounds = IR[2]; 52850 var encode = IR[3]; 52851 var fns = IR[4]; 52852 var tmpBuf = new Float32Array(1); 52853 return function constructStichedFromIRResult(src, srcOffset, dest, destOffset) { 52854 var clip = function constructStichedFromIRClip(v, min, max) { 52855 if (v > max) { 52856 v = max; 52857 } else if (v < min) { 52858 v = min; 52859 } 52860 52861 return v; 52862 }; 52863 52864 var v = clip(src[srcOffset], domain[0], domain[1]); 52865 52866 for (var i = 0, ii = bounds.length; i < ii; ++i) { 52867 if (v < bounds[i]) { 52868 break; 52869 } 52870 } 52871 52872 var dmin = domain[0]; 52873 52874 if (i > 0) { 52875 dmin = bounds[i - 1]; 52876 } 52877 52878 var dmax = domain[1]; 52879 52880 if (i < bounds.length) { 52881 dmax = bounds[i]; 52882 } 52883 52884 var rmin = encode[2 * i]; 52885 var rmax = encode[2 * i + 1]; 52886 tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); 52887 fns[i](tmpBuf, 0, dest, destOffset); 52888 }; 52889 }, 52890 constructPostScript: function constructPostScript(_ref12) { 52891 var xref = _ref12.xref, 52892 isEvalSupported = _ref12.isEvalSupported, 52893 fn = _ref12.fn, 52894 dict = _ref12.dict; 52895 var domain = toNumberArray(dict.getArray('Domain')); 52896 var range = toNumberArray(dict.getArray('Range')); 52897 52898 if (!domain) { 52899 throw new _util.FormatError('No domain.'); 52900 } 52901 52902 if (!range) { 52903 throw new _util.FormatError('No range.'); 52904 } 52905 52906 var lexer = new _ps_parser.PostScriptLexer(fn); 52907 var parser = new _ps_parser.PostScriptParser(lexer); 52908 var code = parser.parse(); 52909 return [CONSTRUCT_POSTSCRIPT, domain, range, code]; 52910 }, 52911 constructPostScriptFromIR: function constructPostScriptFromIR(_ref13) { 52912 var xref = _ref13.xref, 52913 isEvalSupported = _ref13.isEvalSupported, 52914 IR = _ref13.IR; 52915 var domain = IR[1]; 52916 var range = IR[2]; 52917 var code = IR[3]; 52918 52919 if (isEvalSupported && IsEvalSupportedCached.value) { 52920 var compiled = new PostScriptCompiler().compile(code, domain, range); 52921 52922 if (compiled) { 52923 return new Function('src', 'srcOffset', 'dest', 'destOffset', compiled); 52924 } 52925 } 52926 52927 (0, _util.info)('Unable to compile PS function'); 52928 var numOutputs = range.length >> 1; 52929 var numInputs = domain.length >> 1; 52930 var evaluator = new PostScriptEvaluator(code); 52931 var cache = Object.create(null); 52932 var MAX_CACHE_SIZE = 2048 * 4; 52933 var cache_available = MAX_CACHE_SIZE; 52934 var tmpBuf = new Float32Array(numInputs); 52935 return function constructPostScriptFromIRResult(src, srcOffset, dest, destOff
vendor: 4,206 bytes, lines 52935-53106
52935set) { 52936 var i, value; 52937 var key = ''; 52938 var input = tmpBuf; 52939 52940 for (i = 0; i < numInputs; i++) { 52941 value = src[srcOffset + i]; 52942 input[i] = value; 52943 key += value + '_'; 52944 } 52945 52946 var cachedValue = cache[key]; 52947 52948 if (cachedValue !== undefined) { 52949 dest.set(cachedValue, destOffset); 52950 return; 52951 } 52952 52953 var output = new Float32Array(numOutputs); 52954 var stack = evaluator.execute(input); 52955 var stackIndex = stack.length - numOutputs; 52956 52957 for (i = 0; i < numOutputs; i++) { 52958 value = stack[stackIndex + i]; 52959 var bound = range[i * 2]; 52960 52961 if (value < bound) { 52962 value = bound; 52963 } else { 52964 bound = range[i * 2 + 1]; 52965 52966 if (value > bound) { 52967 value = bound; 52968 } 52969 } 52970 52971 output[i] = value; 52972 } 52973 52974 if (cache_available > 0) { 52975 cache_available--; 52976 cache[key] = output; 52977 } 52978 52979 dest.set(output, destOffset); 52980 }; 52981 } 52982 }; 52983}(); 52984 52985function isPDFFunction(v) { 52986 var fnDict; 52987 52988 if (_typeof(v) !== 'object') { 52989 return false; 52990 } else if ((0, _primitives.isDict)(v)) { 52991 fnDict = v; 52992 } else if ((0, _primitives.isStream)(v)) { 52993 fnDict = v.dict; 52994 } else { 52995 return false; 52996 } 52997 52998 return fnDict.has('FunctionType'); 52999} 53000 53001var PostScriptStack = function PostScriptStackClosure() { 53002 var MAX_STACK_SIZE = 100; 53003 53004 function PostScriptStack(initialStack) { 53005 this.stack = !initialStack ? [] : Array.prototype.slice.call(initialStack, 0); 53006 } 53007 53008 PostScriptStack.prototype = { 53009 push: function PostScriptStack_push(value) { 53010 if (this.stack.length >= MAX_STACK_SIZE) { 53011 throw new Error('PostScript function stack overflow.'); 53012 } 53013 53014 this.stack.push(value); 53015 }, 53016 pop: function PostScriptStack_pop() { 53017 if (this.stack.length <= 0) { 53018 throw new Error('PostScript function stack underflow.'); 53019 } 53020 53021 return this.stack.pop(); 53022 }, 53023 copy: function PostScriptStack_copy(n) { 53024 if (this.stack.length + n >= MAX_STACK_SIZE) { 53025 throw new Error('PostScript function stack overflow.'); 53026 } 53027 53028 var stack = this.stack; 53029 53030 for (var i = stack.length - n, j = n - 1; j >= 0; j--, i++) { 53031 stack.push(stack[i]); 53032 } 53033 }, 53034 index: function PostScriptStack_index(n) { 53035 this.push(this.stack[this.stack.length - n - 1]); 53036 }, 53037 roll: function PostScriptStack_roll(n, p) { 53038 var stack = this.stack; 53039 var l = stack.length - n; 53040 var r = stack.length - 1, 53041 c = l + (p - Math.floor(p / n) * n), 53042 i, 53043 j, 53044 t; 53045 53046 for (i = l, j = r; i < j; i++, j--) { 53047 t = stack[i]; 53048 stack[i] = stack[j]; 53049 stack[j] = t; 53050 } 53051 53052 for (i = l, j = c - 1; i < j; i++, j--) { 53053 t = stack[i]; 53054 stack[i] = stack[j]; 53055 stack[j] = t; 53056 } 53057 53058 for (i = c, j = r; i < j; i++, j--) { 53059 t = stack[i]; 53060 stack[i] = stack[j]; 53061 stack[j] = t; 53062 } 53063 } 53064 }; 53065 return PostScriptStack; 53066}(); 53067 53068var PostScriptEvaluator = function PostScriptEvaluatorClosure() { 53069 function PostScriptEvaluator(operators) { 53070 this.operators = operators; 53071 } 53072 53073 PostScriptEvaluator.prototype = { 53074 execute: function PostScriptEvaluator_execute(initialStack) { 53075 var stack = new PostScriptStack(initialStack); 53076 var counter = 0; 53077 var operators = this.operators; 53078 var length = operators.length; 53079 var operator, a, b; 53080 53081 while (counter < length) { 53082 operator = operators[counter++]; 53083 53084 if (typeof operator === 'number') { 53085 stack.push(operator); 53086 continue; 53087 } 53088 53089 switch (operator) { 53090 case 'jz': 53091 b = stack.pop(); 53092 a = stack.pop(); 53093 53094 if (!a) { 53095 counter = b; 53096 } 53097 53098 break; 53099 53100 case 'j': 53101 a = stack.pop(); 53102 counter = a; 53103 break; 53104 53105 case 'abs': 53106 a = stack.pop();
vendor: 5,548 bytes, lines 53107-53356
53107 stack.push(Math.abs(a)); 53108 break; 53109 53110 case 'add': 53111 b = stack.pop(); 53112 a = stack.pop(); 53113 stack.push(a + b); 53114 break; 53115 53116 case 'and': 53117 b = stack.pop(); 53118 a = stack.pop(); 53119 53120 if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { 53121 stack.push(a && b); 53122 } else { 53123 stack.push(a & b); 53124 } 53125 53126 break; 53127 53128 case 'atan': 53129 a = stack.pop(); 53130 stack.push(Math.atan(a)); 53131 break; 53132 53133 case 'bitshift': 53134 b = stack.pop(); 53135 a = stack.pop(); 53136 53137 if (a > 0) { 53138 stack.push(a << b); 53139 } else { 53140 stack.push(a >> b); 53141 } 53142 53143 break; 53144 53145 case 'ceiling': 53146 a = stack.pop(); 53147 stack.push(Math.ceil(a)); 53148 break; 53149 53150 case 'copy': 53151 a = stack.pop(); 53152 stack.copy(a); 53153 break; 53154 53155 case 'cos': 53156 a = stack.pop(); 53157 stack.push(Math.cos(a)); 53158 break; 53159 53160 case 'cvi': 53161 a = stack.pop() | 0; 53162 stack.push(a); 53163 break; 53164 53165 case 'cvr': 53166 break; 53167 53168 case 'div': 53169 b = stack.pop(); 53170 a = stack.pop(); 53171 stack.push(a / b); 53172 break; 53173 53174 case 'dup': 53175 stack.copy(1); 53176 break; 53177 53178 case 'eq': 53179 b = stack.pop(); 53180 a = stack.pop(); 53181 stack.push(a === b); 53182 break; 53183 53184 case 'exch': 53185 stack.roll(2, 1); 53186 break; 53187 53188 case 'exp': 53189 b = stack.pop(); 53190 a = stack.pop(); 53191 stack.push(Math.pow(a, b)); 53192 break; 53193 53194 case 'false': 53195 stack.push(false); 53196 break; 53197 53198 case 'floor': 53199 a = stack.pop(); 53200 stack.push(Math.floor(a)); 53201 break; 53202 53203 case 'ge': 53204 b = stack.pop(); 53205 a = stack.pop(); 53206 stack.push(a >= b); 53207 break; 53208 53209 case 'gt': 53210 b = stack.pop(); 53211 a = stack.pop(); 53212 stack.push(a > b); 53213 break; 53214 53215 case 'idiv': 53216 b = stack.pop(); 53217 a = stack.pop(); 53218 stack.push(a / b | 0); 53219 break; 53220 53221 case 'index': 53222 a = stack.pop(); 53223 stack.index(a); 53224 break; 53225 53226 case 'le': 53227 b = stack.pop(); 53228 a = stack.pop(); 53229 stack.push(a <= b); 53230 break; 53231 53232 case 'ln': 53233 a = stack.pop(); 53234 stack.push(Math.log(a)); 53235 break; 53236 53237 case 'log': 53238 a = stack.pop(); 53239 stack.push(Math.log(a) / Math.LN10); 53240 break; 53241 53242 case 'lt': 53243 b = stack.pop(); 53244 a = stack.pop(); 53245 stack.push(a < b); 53246 break; 53247 53248 case 'mod': 53249 b = stack.pop(); 53250 a = stack.pop(); 53251 stack.push(a % b); 53252 break; 53253 53254 case 'mul': 53255 b = stack.pop(); 53256 a = stack.pop(); 53257 stack.push(a * b); 53258 break; 53259 53260 case 'ne': 53261 b = stack.pop(); 53262 a = stack.pop(); 53263 stack.push(a !== b); 53264 break; 53265 53266 case 'neg': 53267 a = stack.pop(); 53268 stack.push(-a); 53269 break; 53270 53271 case 'not': 53272 a = stack.pop(); 53273 53274 if ((0, _util.isBool)(a)) { 53275 stack.push(!a); 53276 } else { 53277 stack.push(~a); 53278 } 53279 53280 break; 53281 53282 case 'or': 53283 b = stack.pop(); 53284 a = stack.pop(); 53285 53286 if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { 53287 stack.push(a || b); 53288 } else { 53289 stack.push(a | b); 53290 } 53291 53292 break; 53293 53294 case 'pop': 53295 stack.pop(); 53296 break; 53297 53298 case 'roll': 53299 b = stack.pop(); 53300 a = stack.pop(); 53301 stack.roll(a, b); 53302 break; 53303 53304 case 'round': 53305 a = stack.pop(); 53306 stack.push(Math.round(a)); 53307 break; 53308 53309 case 'sin': 53310 a = stack.pop(); 53311 stack.push(Math.sin(a)); 53312 break; 53313 53314 case 'sqrt': 53315 a = stack.pop(); 53316 stack.push(Math.sqrt(a)); 53317 break; 53318 53319 case 'sub': 53320 b = stack.pop(); 53321 a = stack.pop(); 53322 stack.push(a - b); 53323 break; 53324 53325 case 'true': 53326 stack.push(true); 53327 break; 53328 53329 case 'truncate': 53330 a = stack.pop(); 53331 a = a < 0 ? Math.ceil(a) : Math.floor(a); 53332 stack.push(a); 53333 break; 53334 53335 case 'xor': 53336 b = stack.pop(); 53337 a = stack.pop(); 53338 53339 if ((0, _util.isBool)(a) && (0, _util.isBool)(b)) { 53340 stack.push(a !== b); 53341 } else { 53342 stack.push(a ^ b); 53343 } 53344 53345 break; 53346 53347 default: 53348 throw new _util.FormatError("Unknown operator ".concat(operator)); 53349 } 53350 } 53351 53352 return stack.stack; 53353 } 53354 }; 53355 return PostScriptEvaluator; 53356}();
vendor: 10,895 bytes, lines 53357-53750
53357 53358exports.PostScriptEvaluator = PostScriptEvaluator; 53359 53360var PostScriptCompiler = function PostScriptCompilerClosure() { 53361 function AstNode(type) { 53362 this.type = type; 53363 } 53364 53365 AstNode.prototype.visit = function (visitor) { 53366 (0, _util.unreachable)('abstract method'); 53367 }; 53368 53369 function AstArgument(index, min, max) { 53370 AstNode.call(this, 'args'); 53371 this.index = index; 53372 this.min = min; 53373 this.max = max; 53374 } 53375 53376 AstArgument.prototype = Object.create(AstNode.prototype); 53377 53378 AstArgument.prototype.visit = function (visitor) { 53379 visitor.visitArgument(this); 53380 }; 53381 53382 function AstLiteral(number) { 53383 AstNode.call(this, 'literal'); 53384 this.number = number; 53385 this.min = number; 53386 this.max = number; 53387 } 53388 53389 AstLiteral.prototype = Object.create(AstNode.prototype); 53390 53391 AstLiteral.prototype.visit = function (visitor) { 53392 visitor.visitLiteral(this); 53393 }; 53394 53395 function AstBinaryOperation(op, arg1, arg2, min, max) { 53396 AstNode.call(this, 'binary'); 53397 this.op = op; 53398 this.arg1 = arg1; 53399 this.arg2 = arg2; 53400 this.min = min; 53401 this.max = max; 53402 } 53403 53404 AstBinaryOperation.prototype = Object.create(AstNode.prototype); 53405 53406 AstBinaryOperation.prototype.visit = function (visitor) { 53407 visitor.visitBinaryOperation(this); 53408 }; 53409 53410 function AstMin(arg, max) { 53411 AstNode.call(this, 'max'); 53412 this.arg = arg; 53413 this.min = arg.min; 53414 this.max = max; 53415 } 53416 53417 AstMin.prototype = Object.create(AstNode.prototype); 53418 53419 AstMin.prototype.visit = function (visitor) { 53420 visitor.visitMin(this); 53421 }; 53422 53423 function AstVariable(index, min, max) { 53424 AstNode.call(this, 'var'); 53425 this.index = index; 53426 this.min = min; 53427 this.max = max; 53428 } 53429 53430 AstVariable.prototype = Object.create(AstNode.prototype); 53431 53432 AstVariable.prototype.visit = function (visitor) { 53433 visitor.visitVariable(this); 53434 }; 53435 53436 function AstVariableDefinition(variable, arg) { 53437 AstNode.call(this, 'definition'); 53438 this.variable = variable; 53439 this.arg = arg; 53440 } 53441 53442 AstVariableDefinition.prototype = Object.create(AstNode.prototype); 53443 53444 AstVariableDefinition.prototype.visit = function (visitor) { 53445 visitor.visitVariableDefinition(this); 53446 }; 53447 53448 function ExpressionBuilderVisitor() { 53449 this.parts = []; 53450 } 53451 53452 ExpressionBuilderVisitor.prototype = { 53453 visitArgument: function visitArgument(arg) { 53454 this.parts.push('Math.max(', arg.min, ', Math.min(', arg.max, ', src[srcOffset + ', arg.index, ']))'); 53455 }, 53456 visitVariable: function visitVariable(variable) { 53457 this.parts.push('v', variable.index); 53458 }, 53459 visitLiteral: function visitLiteral(literal) { 53460 this.parts.push(literal.number); 53461 }, 53462 visitBinaryOperation: function visitBinaryOperation(operation) { 53463 this.parts.push('('); 53464 operation.arg1.visit(this); 53465 this.parts.push(' ', operation.op, ' '); 53466 operation.arg2.visit(this); 53467 this.parts.push(')'); 53468 }, 53469 visitVariableDefinition: function visitVariableDefinition(definition) { 53470 this.parts.push('var '); 53471 definition.variable.visit(this); 53472 this.parts.push(' = '); 53473 definition.arg.visit(this); 53474 this.parts.push(';'); 53475 }, 53476 visitMin: function visitMin(max) { 53477 this.parts.push('Math.min('); 53478 max.arg.visit(this); 53479 this.parts.push(', ', max.max, ')'); 53480 }, 53481 toString: function toString() { 53482 return this.parts.join(''); 53483 } 53484 }; 53485 53486 function buildAddOperation(num1, num2) { 53487 if (num2.type === 'literal' && num2.number === 0) { 53488 return num1; 53489 } 53490 53491 if (num1.type === 'literal' && num1.number === 0) { 53492 return num2; 53493 } 53494 53495 if (num2.type === 'literal' && num1.type === 'literal') { 53496 return new AstLiteral(num1.number + num2.number); 53497 } 53498 53499 return new AstBinaryOperation('+', num1, num2, num1.min + num2.min, num1.max + num2.max); 53500 } 53501 53502 function buildMulOperation(num1, num2) { 53503 if (num2.type === 'literal') { 53504 if (num2.number === 0) { 53505 return new AstLiteral(0); 53506 } else if (num2.number === 1) { 53507 return num1; 53508 } else if (num1.type === 'literal') { 53509 return new AstLiteral(num1.number * num2.number); 53510 } 53511 } 53512 53513 if (num1.type === 'literal') { 53514 if (num1.number === 0) { 53515 return new AstLiteral(0); 53516 } else if (num1.number === 1) { 53517 return num2; 53518 } 53519 } 53520 53521 var min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); 53522 var max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); 53523 return new AstBinaryOperation('*', num1, num2, min, max); 53524 } 53525 53526 function buildSubOperation(num1, num2) { 53527 if (num2.type === 'literal') { 53528 if (num2.number === 0) { 53529 return num1; 53530 } else if (num1.type === 'literal') { 53531 return new AstLiteral(num1.number - num2.number); 53532 } 53533 } 53534 53535 if (num2.type === 'binary' && num2.op === '-' && num1.type === 'literal' && num1.number === 1 && num2.arg1.type === 'literal' && num2.arg1.number === 1) { 53536 return num2.arg2; 53537 } 53538 53539 return new AstBinaryOperation('-', num1, num2, num1.min - num2.max, num1.max - num2.min); 53540 } 53541 53542 function buildMinOperation(num1, max) { 53543 if (num1.min >= max) { 53544 return new AstLiteral(max); 53545 } else if (num1.max <= max) { 53546 return num1; 53547 } 53548 53549 return new AstMin(num1, max); 53550 } 53551 53552 function PostScriptCompiler() {} 53553 53554 PostScriptCompiler.prototype = { 53555 compile: function PostScriptCompiler_compile(code, domain, range) { 53556 var stack = []; 53557 var i, ii; 53558 var instructions = []; 53559 var inputSize = domain.length >> 1, 53560 outputSize = range.length >> 1; 53561 var lastRegister = 0; 53562 var n, j; 53563 var num1, num2, ast1, ast2, tmpVar, item; 53564 53565 for (i = 0; i < inputSize; i++) { 53566 stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); 53567 } 53568 53569 for (i = 0, ii = code.length; i < ii; i++) { 53570 item = code[i]; 53571 53572 if (typeof item === 'number') { 53573 stack.push(new AstLiteral(item)); 53574 continue; 53575 } 53576 53577 switch (item) { 53578 case 'add': 53579 if (stack.length < 2) { 53580 return null; 53581 } 53582 53583 num2 = stack.pop(); 53584 num1 = stack.pop(); 53585 stack.push(buildAddOperation(num1, num2)); 53586 break; 53587 53588 case 'cvr': 53589 if (stack.length < 1) { 53590 return null; 53591 } 53592 53593 break; 53594 53595 case 'mul': 53596 if (stack.length < 2) { 53597 return null; 53598 } 53599 53600 num2 = stack.pop(); 53601 num1 = stack.pop(); 53602 stack.push(buildMulOperation(num1, num2)); 53603 break; 53604 53605 case 'sub': 53606 if (stack.length < 2) { 53607 return null; 53608 } 53609 53610 num2 = stack.pop(); 53611 num1 = stack.pop(); 53612 stack.push(buildSubOperation(num1, num2)); 53613 break; 53614 53615 case 'exch': 53616 if (stack.length < 2) { 53617 return null; 53618 } 53619 53620 ast1 = stack.pop(); 53621 ast2 = stack.pop(); 53622 stack.push(ast1, ast2); 53623 break; 53624 53625 case 'pop': 53626 if (stack.length < 1) { 53627 return null; 53628 } 53629 53630 stack.pop(); 53631 break; 53632 53633 case 'index': 53634 if (stack.length < 1) { 53635 return null; 53636 } 53637 53638 num1 = stack.pop(); 53639 53640 if (num1.type !== 'literal') { 53641 return null; 53642 } 53643 53644 n = num1.number; 53645 53646 if (n < 0 || !Number.isInteger(n) || stack.length < n) { 53647 return null; 53648 } 53649 53650 ast1 = stack[stack.length - n - 1]; 53651 53652 if (ast1.type === 'literal' || ast1.type === 'var') { 53653 stack.push(ast1); 53654 break; 53655 } 53656 53657 tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); 53658 stack[stack.length - n - 1] = tmpVar; 53659 stack.push(tmpVar); 53660 instructions.push(new AstVariableDefinition(tmpVar, ast1)); 53661 break; 53662 53663 case 'dup': 53664 if (stack.length < 1) { 53665 return null; 53666 } 53667 53668 if (typeof code[i + 1] === 'number' && code[i + 2] === 'gt' && code[i + 3] === i + 7 && code[i + 4] === 'jz' && code[i + 5] === 'pop' && code[i + 6] === code[i + 1]) { 53669 num1 = stack.pop(); 53670 stack.push(buildMinOperation(num1, code[i + 1])); 53671 i += 6; 53672 break; 53673 } 53674 53675 ast1 = stack[stack.length - 1]; 53676 53677 if (ast1.type === 'literal' || ast1.type === 'var') { 53678 stack.push(ast1); 53679 break; 53680 } 53681 53682 tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); 53683 stack[stack.length - 1] = tmpVar; 53684 stack.push(tmpVar); 53685 instructions.push(new AstVariableDefinition(tmpVar, ast1)); 53686 break; 53687 53688 case 'roll': 53689 if (stack.length < 2) { 53690 return null; 53691 } 53692 53693 num2 = stack.pop(); 53694 num1 = stack.pop(); 53695 53696 if (num2.type !== 'literal' || num1.type !== 'literal') { 53697 return null; 53698 } 53699 53700 j = num2.number; 53701 n = num1.number; 53702 53703 if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) { 53704 return null; 53705 } 53706 53707 j = (j % n + n) % n; 53708 53709 if (j === 0) { 53710 break; 53711 } 53712 53713 Array.prototype.push.apply(stack, stack.splice(stack.length - n, n - j)); 53714 break; 53715 53716 default: 53717 return null; 53718 } 53719 } 53720 53721 if (stack.length !== outputSize) { 53722 return null; 53723 } 53724 53725 var result = []; 53726 instructions.forEach(function (instruction) { 53727 var statementBuilder = new ExpressionBuilderVisitor(); 53728 instruction.visit(statementBuilder); 53729 result.push(statementBuilder.toString()); 53730 }); 53731 stack.forEach(function (expr, i) { 53732 var statementBuilder = new ExpressionBuilderVisitor(); 53733 expr.visit(statementBuilder); 53734 var min = range[i * 2], 53735 max = range[i * 2 + 1]; 53736 var out = [statementBuilder.toString()]; 53737 53738 if (min > expr.min) { 53739 out.unshift('Math.max(', min, ', '); 53740 out.push(')'); 53741 } 53742 53743 if (max < expr.max) { 53744 out.unshift('Math.min(', max, ', '); 53745 out.push(')'); 53746 } 53747 53748 out.unshift('dest[destOffset + ', i, '] = '); 53749 out.push(';'); 53750 result.push(out.join(''));
53751 }); 53752 return result.join('\n'); 53753 } 53754 }; 53755 return PostScriptCompiler; 53756}(); 53757 53758exports.PostScriptCompiler = PostScriptCompiler; 53759 53760/***/ }), 53761/* 186 */ 53762/***/ (function(module, exports, __w_pdfjs_require__) { 53763 53764"use strict"; 53765 53766 53767Object.defineProperty(exports, "__esModule", { 53768 value: true 53769}); 53770exports.PostScriptParser = exports.PostScriptLexer = void 0; 53771 53772var _util = __w_pdfjs_require__(6); 53773 53774var _primitives = __w_pdfjs_require__(155); 53775 53776function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 53777 53778function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } 53779 53780function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } 53781 53782var PostScriptParser = 53783/*#__PURE__*/ 53784function () { 53785 function PostScriptParser(lexer) { 53786 _classCallCheck(this, PostScriptParser); 53787 53788 this.lexer = lexer; 53789 this.operators = []; 53790 this.token = null; 53791 this.prev = null; 53792 } 53793 53794 _createClass(PostScriptParser, [{ 53795 key: "nextToken", 53796 value: function nextToken() { 53797 this.prev = this.token; 53798 this.token = this.lexer.getToken(); 53799 } 53800 }, { 53801 key: "accept", 53802 value: function accept(type) { 53803 if (this.token.type === type) { 53804 this.nextToken(); 53805 return true; 53806 } 53807 53808 return false; 53809 } 53810 }, { 53811 key: "expect", 53812 value: function expect(type) { 53813 if (this.accept(type)) { 53814 return true; 53815 } 53816 53817 throw new _util.FormatError("Unexpected symbol: found ".concat(this.token.type, " expected ").concat(type, ".")); 53818 } 53819 }, { 53820 key: "parse", 53821 value: function parse() { 53822 this.nextToken(); 53823 this.expect(PostScriptTokenTypes.LBRACE); 53824 this.parseBlock(); 53825 this.expect(PostScriptTokenTypes.RBRACE); 53826 return this.operators; 53827 } 53828 }, { 53829 key: "parseBlock", 53830 value: function parseBlock() { 53831 while (true) { 53832 if (this.accept(PostScriptTokenTypes.NUMBER)) { 53833 this.operators.push(this.prev.value); 53834 } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { 53835 this.operators.push(this.prev.value); 53836 } else if (this.accept(PostScriptTokenTypes.LBRACE)) { 53837 this.parseCondition(); 53838 } else { 53839 return; 53840 } 53841 } 53842 } 53843 }, { 53844 key: "parseCondition", 53845 value: function parseCondition() { 53846 var conditionLocation = this.operators.length; 53847 this.operators.push(null, null); 53848 this.parseBlock(); 53849 this.expect(PostScriptTokenTypes.RBRACE); 53850 53851 if (this.accept(PostScriptTokenTypes.IF)) { 53852 this.operators[conditionLocation] = this.operators.length; 53853 this.operators[conditionLocation + 1] = 'jz'; 53854 } else if (this.accept(PostScriptTokenTypes.LBRACE)) { 53855 var jumpLocation = this.operators.length; 53856 this.operators.push(null, null); 53857 var endOfTrue = this.operators.length; 53858 this.parseBlock(); 53859 this.expect(PostScriptTokenTypes.RBRACE); 53860 this.expect(PostScriptTokenTypes.IFELSE); 53861 this.operators[jumpLocation] = this.operators.length; 53862 this.operators[jumpLocation + 1] = 'j'; 53863 this.operators[conditionLocation] = endOfTrue; 53864 this.operators[conditionLocation + 1] = 'jz'; 53865 } else { 53866 throw new _util.FormatError('PS Function: error parsing conditional.'); 53867 } 53868 } 53869 }]); 53870 53871 return PostScriptParser; 53872}(); 53873 53874exports.PostScriptParser = PostScriptParser; 53875var PostScriptTokenTypes = { 53876 LBRACE: 0, 53877 RBRACE: 1, 53878 NUMBER: 2, 53879 OPERATOR: 3, 53880 IF: 4, 53881 IFELSE: 5 53882}; 53883 53884var PostScriptToken = function PostScriptTokenClosure() { 53885 var opCache = Object.create(null); 53886 53887 var PostScriptToken = 53888 /*#__PURE__*/ 53889 function () { 53890 function PostScriptToken(type, value) { 53891 _classCallCheck(this, PostScriptToken); 53892 53893 this.type = type; 53894 this.value = value; 53895 } 53896 53897 _createClass(PostScriptToken, null, [{ 53898 key: "getOperator", 53899 value: function getOperator(op) { 53900 var opValue = opCache[op]; 53901 53902 if (opValue) { 53903 return opValue; 53904 } 53905 53906 return opCache[op] = new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); 53907 } 53908 }, { 53909 key: "LBRACE", 53910 get: function get() { 53911 return (0, _util.shadow)(this, 'LBRACE', new PostScriptToken(PostScriptTokenTypes.LBRACE, '{')); 53912 } 53913 }, { 53914 key: "RBRACE", 53915 get: function get() { 53916 return (0, _util.shadow)(this, 'RBRACE', new PostScriptToken(PostScriptTokenTypes.RBRACE, '}')); 53917 } 53918 }, { 53919 key: "IF", 53920 get: function get() { 53921 return (0, _util.shadow)(this, 'IF', new PostScriptToken(PostScriptTokenTypes.IF, 'IF')); 53922 } 53923 }, { 53924 key: "IFELSE", 53925 get: function get() { 53926 return (0, _util.shadow)(this, 'IFELSE', new PostScriptToken(PostScriptTokenTypes.IFELSE, 'IFELSE')); 53927 } 53928 }]); 53929 53930 return PostScriptToken; 53931 }(); 53932 53933 return PostScriptToken; 53934}(); 53935 53936var PostScriptLexer = 53937/*#__PURE__*/ 53938function () { 53939 function PostScriptLexer(stream) { 53940 _classCallCheck(this, PostScriptLexer); 53941 53942 this.stream = stream; 53943 this.nextChar(); 53944 this.strBuf = []; 53945 } 53946 53947 _createClass(PostScriptLexer, [{ 53948 key: "nextChar", 53949 value: function nextChar() { 53950 return this.currentChar = this.stream.getByte(); 53951 } 53952 }, { 53953 key: "getToken", 53954 value: function getToken() { 53955 var comment = false; 53956 var ch = this.currentChar; 53957 53958 while (true) { 53959 if (ch < 0) { 53960 return _primitives.EOF; 53961 } 53962 53963 if (comment) { 53964 if (ch === 0x0A || ch === 0x0D) { 53965 comment = false; 53966 } 53967 } else if (ch === 0x25) { 53968 comment = true; 53969 } else if (!(0, _util.isSpace)(ch)) { 53970 break; 53971 } 53972 53973 ch = this.nextChar(); 53974 } 53975 53976 switch (ch | 0) { 53977 case 0x30: 53978 case 0x31: 53979 case 0x32: 53980 case 0x33: 53981 case 0x34: 53982 case 0x35: 53983 case 0x36: 53984 case 0x37: 53985 case 0x38: 53986 case 0x39: 53987 case 0x2B: 53988 case 0x2D: 53989 case 0x2E: 53990 return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); 53991 53992 case 0x7B: 53993 this.nextChar(); 53994 return PostScriptToken.LBRACE; 53995 53996 case 0x7D: 53997 this.nextChar(); 53998 return PostScriptToken.RBRACE; 53999 } 54000 54001 var strBuf = this.strBuf; 54002 strBuf.length = 0; 54003 strBuf[0] = String.fromCharCode(ch); 54004 54005 while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5A || ch >= 0x61 && ch <= 0x7A)) { 54006 strBuf.push(String.fromCharCode(ch)); 54007 } 54008 54009 var str = strBuf.join(''); 54010 54011 switch (str.toLowerCase()) { 54012 case 'if': 54013 return PostScriptToken.IF; 54014 54015 case 'ifelse': 54016 return PostScriptToken.IFELSE; 54017 54018 default: 54019 return PostScriptToken.getOperator(str); 54020 } 54021 } 54022 }, { 54023 key: "getNumber", 54024 value: function getNumber() { 54025 var ch = this.currentChar; 54026 var strBuf = this.strBuf; 54027 strBuf.length = 0; 54028 strBuf[0] = String.fromCharCode(ch); 54029 54030 while ((ch = this.nextChar()) >= 0) { 54031 if (ch >= 0x30 && ch <= 0x39 || ch === 0x2D || ch === 0x2E) { 54032 strBuf.push(String.fromCharCode(ch)); 54033 } else { 54034 break; 54035 } 54036 } 54037 54038 var value = parseFloat(strBuf.join(''));
54039 54040 if (isNaN(value)) { 54041 throw new _util.FormatError("Invalid floating point number: ".concat(value)); 54042 } 54043 54044 return value; 54045 } 54046 }]); 54047 54048 return PostScriptLexer; 54049}(); 54050 54051exports.PostScriptLexer = PostScriptLexer; 54052 54053/***/ }), 54054/* 187 */ 54055/***/ (function(module, exports, __w_pdfjs_require__) { 54056 54057"use strict"; 54058 54059 54060Object.defineProperty(exports, "__esModule", { 54061 value: true 54062}); 54063exports.MurmurHash3_64 = void 0; 54064 54065var _util = __w_pdfjs_require__(6); 54066 54067var MurmurHash3_64 = function MurmurHash3_64Closure(seed) { 54068 var MASK_HIGH = 0xffff0000; 54069 var MASK_LOW = 0xffff; 54070 54071 function MurmurHash3_64(seed) { 54072 var SEED = 0xc3d2e1f0; 54073 this.h1 = seed ? seed & 0xffffffff : SEED; 54074 this.h2 = seed ? seed & 0xffffffff : SEED; 54075 } 54076 54077 MurmurHash3_64.prototype = { 54078 update: function MurmurHash3_64_update(input) { 54079 var data, length; 54080 54081 if ((0, _util.isString)(input)) { 54082 data = new Uint8Array(input.length * 2); 54083 length = 0; 54084 54085 for (var i = 0, ii = input.length; i < ii; i++) { 54086 var code = input.charCodeAt(i); 54087 54088 if (code <= 0xff) { 54089 data[length++] = code; 54090 } else { 54091 data[length++] = code >>> 8; 54092 data[length++] = code & 0xff; 54093 } 54094 } 54095 } else if ((0, _util.isArrayBuffer)(input)) { 54096 data = input; 54097 length = data.byteLength; 54098 } else { 54099 throw new Error('Wrong data format in MurmurHash3_64_update. ' + 'Input must be a string or array.'); 54100 } 54101 54102 var blockCounts = length >> 2; 54103 var tailLength = length - blockCounts * 4; 54104 var dataUint32 = new Uint32Array(data.buffer, 0, blockCounts); 54105 var k1 = 0; 54106 var k2 = 0; 54107 var h1 = this.h1; 54108 var h2 = this.h2; 54109 var C1 = 0xcc9e2d51; 54110 var C2 = 0x1b873593; 54111 var C1_LOW = C1 & MASK_LOW; 54112 var C2_LOW = C2 & MASK_LOW; 54113 54114 for (var _i = 0; _i < blockCounts; _i++) { 54115 if (_i & 1) { 54116 k1 = dataUint32[_i]; 54117 k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; 54118 k1 = k1 << 15 | k1 >>> 17; 54119 k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; 54120 h1 ^= k1; 54121 h1 = h1 << 13 | h1 >>> 19; 54122 h1 = h1 * 5 + 0xe6546b64; 54123 } else { 54124 k2 = dataUint32[_i]; 54125 k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW; 54126 k2 = k2 << 15 | k2 >>> 17; 54127 k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW; 54128 h2 ^= k2; 54129 h2 = h2 << 13 | h2 >>> 19; 54130 h2 = h2 * 5 + 0xe6546b64; 54131 } 54132 } 54133 54134 k1 = 0; 54135 54136 switch (tailLength) { 54137 case 3: 54138 k1 ^= data[blockCounts * 4 + 2] << 16; 54139 54140 case 2: 54141 k1 ^= data[blockCounts * 4 + 1] << 8; 54142 54143 case 1: 54144 k1 ^= data[blockCounts * 4]; 54145 k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; 54146 k1 = k1 << 15 | k1 >>> 17; 54147 k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; 54148 54149 if (blockCounts & 1) { 54150 h1 ^= k1; 54151 } else { 54152 h2 ^= k1; 54153 } 54154 54155 } 54156 54157 this.h1 = h1; 54158 this.h2 = h2; 54159 return this; 54160 }, 54161 hexdigest: function MurmurHash3_64_hexdigest() { 54162 var h1 = this.h1; 54163 var h2 = this.h2; 54164 h1 ^= h2 >>> 1; 54165 h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW; 54166 h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16; 54167 h1 ^= h2 >>> 1; 54168 h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW; 54169 h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16; 54170 h1 ^= h2 >>> 1; 54171 54172 for (var i = 0, arr = [h1, h2], str = ''; i < arr.length; i++) { 54173 var hex = (arr[i] >>> 0).toString(16); 54174 54175 while (hex.length < 8) { 54176 hex = '0' + hex; 54177 } 54178 54179 str += hex; 54180 } 54181 54182 return str; 54183 } 54184 }; 54185 return MurmurHash3_64; 54186}(); 54187 54188exports.MurmurHash3_64 = MurmurHash3_64; 54189 54190/***/ }), 54191/* 188 */ 54192/***/ (function(module, exports, __w_pdfjs_require__) { 54193 54194"use strict"; 54195 54196 54197Object.defineProperty(exports, "__esModule", { 54198 value: true 54199}); 54200exports.PDFImage = void 0; 54201 54202var _util = __w_pdfjs_require__(6); 54203 54204var _primitives = __w_pdfjs_require__(155); 54205 54206var _colorspace = __w_pdfjs_require__(168); 54207 54208var _stream = __w_pdfjs_require__(157); 54209 54210var _jpeg_stream = __w_pdfjs_require__(163); 54211 54212var _jpx = __w_pdfjs_require__(166); 54213 54214function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } 54215 54216function _nonIterableRest() { throw new TypeError("Invalid attempt to de
vendor: 5,862 bytes, lines 54216-54379
54216structure non-iterable instance"); } 54217 54218function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } 54219 54220function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 54221 54222var PDFImage = function PDFImageClosure() { 54223 function handleImageData(image, nativeDecoder) { 54224 if (nativeDecoder && nativeDecoder.canDecode(image)) { 54225 return nativeDecoder.decode(image).catch(function (reason) { 54226 (0, _util.warn)('Native image decoding failed -- trying to recover: ' + (reason && reason.message)); 54227 return image; 54228 }); 54229 } 54230 54231 return Promise.resolve(image); 54232 } 54233 54234 function decodeAndClamp(value, addend, coefficient, max) { 54235 value = addend + value * coefficient; 54236 return value < 0 ? 0 : value > max ? max : value; 54237 } 54238 54239 function resizeImageMask(src, bpc, w1, h1, w2, h2) { 54240 var length = w2 * h2; 54241 var dest = bpc <= 8 ? new Uint8Array(length) : bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length); 54242 var xRatio = w1 / w2; 54243 var yRatio = h1 / h2; 54244 var i, 54245 j, 54246 py, 54247 newIndex = 0, 54248 oldIndex; 54249 var xScaled = new Uint16Array(w2); 54250 var w1Scanline = w1; 54251 54252 for (i = 0; i < w2; i++) { 54253 xScaled[i] = Math.floor(i * xRatio); 54254 } 54255 54256 for (i = 0; i < h2; i++) { 54257 py = Math.floor(i * yRatio) * w1Scanline; 54258 54259 for (j = 0; j < w2; j++) { 54260 oldIndex = py + xScaled[j]; 54261 dest[newIndex++] = src[oldIndex]; 54262 } 54263 } 54264 54265 return dest; 54266 } 54267 54268 function PDFImage(_ref) { 54269 var xref = _ref.xref, 54270 res = _ref.res, 54271 image = _ref.image, 54272 _ref$isInline = _ref.isInline, 54273 isInline = _ref$isInline === void 0 ? false : _ref$isInline, 54274 _ref$smask = _ref.smask, 54275 smask = _ref$smask === void 0 ? null : _ref$smask, 54276 _ref$mask = _ref.mask, 54277 mask = _ref$mask === void 0 ? null : _ref$mask, 54278 _ref$isMask = _ref.isMask, 54279 isMask = _ref$isMask === void 0 ? false : _ref$isMask, 54280 pdfFunctionFactory = _ref.pdfFunctionFactory; 54281 this.image = image; 54282 var dict = image.dict; 54283 var filter = dict.get('Filter'); 54284 54285 if ((0, _primitives.isName)(filter)) { 54286 switch (filter.name) { 54287 case 'JPXDecode': 54288 var jpxImage = new _jpx.JpxImage(); 54289 jpxImage.parseImageProperties(image.stream); 54290 image.stream.reset(); 54291 image.width = jpxImage.width; 54292 image.height = jpxImage.height; 54293 image.bitsPerComponent = jpxImage.bitsPerComponent; 54294 image.numComps = jpxImage.componentsCount; 54295 break; 54296 54297 case 'JBIG2Decode': 54298 image.bitsPerComponent = 1; 54299 image.numComps = 1; 54300 break; 54301 } 54302 } 54303 54304 var width = dict.get('Width', 'W'); 54305 var height = dict.get('Height', 'H'); 54306 54307 if (Number.isInteger(image.width) && image.width > 0 && Number.isInteger(image.height) && image.height > 0 && (image.width !== width || image.height !== height)) { 54308 (0, _util.warn)('PDFImage - using the Width/Height of the image data, ' + 'rather than the image dictionary.'); 54309 width = image.width; 54310 height = image.height; 54311 } 54312 54313 if (width < 1 || height < 1) { 54314 throw new _util.FormatError("Invalid image width: ".concat(width, " or ") + "height: ".concat(height)); 54315 } 54316 54317 this.width = width; 54318 this.height = height; 54319 this.interpolate = dict.get('Interpolate', 'I') || false; 54320 this.imageMask = dict.get('ImageMask', 'IM') || false; 54321 this.matte = dict.get('Matte') || false; 54322 var bitsPerComponent = image.bitsPerComponent; 54323 54324 if (!bitsPerComponent) { 54325 bitsPerComponent = dict.get('BitsPerComponent', 'BPC'); 54326 54327 if (!bitsPerComponent) { 54328 if (this.imageMask) { 54329 bitsPerComponent = 1; 54330 } else { 54331 throw new _util.FormatError("Bits per component missing in image: ".concat(this.imageMask)); 54332 } 54333 } 54334 } 54335 54336 this.bpc = bitsPerComponent; 54337 54338 if (!this.imageMask) { 54339 var colorSpace = dict.get('ColorSpace', 'CS'); 54340 54341 if (!colorSpace) { 54342 (0, _util.info)('JPX images (which do not require color spaces)'); 54343 54344 switch (image.numComps) { 54345 case 1: 54346 colorSpace = _primitives.Name.get('DeviceGray'); 54347 break; 54348 54349 case 3: 54350 colorSpace = _primitives.Name.get('DeviceRGB'); 54351 break; 54352 54353 case 4: 54354 colorSpace = _primitives.Name.get('DeviceCMYK'); 54355 break; 54356 54357 default: 54358 throw new Error("JPX images with ".concat(image.numComps, " ") + 'color components not supported.'); 54359 } 54360 } 54361 54362 var resources = isInline ? res : null; 54363 this.colorSpace = _colorspace.ColorSpace.parse(colorSpace, xref, resources, pdfFunctionFactory); 54364 this.numComps = this.colorSpace.numComps; 54365 } 54366 54367 this.decode = dict.getArray('Decode', 'D'); 54368 this.needsDecode = false; 54369 54370 if (this.decode && (this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode, bitsPerComponent) || isMask && !_colorspace.ColorSpace.isDefaultDecode(this.decode, 1))) { 54371 this.needsDecode = true; 54372 var max = (1 << bitsPerComponent) - 1; 54373 this.decodeCoefficients = []; 54374 this.decodeAddends = []; 54375 var isIndexed = this.colorSpace && this.colorSpace.name === 'Indexed'; 54376 54377 for (var i = 0, j = 0; i < this.decode.length; i += 2, ++j) { 54378 var dmin = this.decode[i]; 54379 var dmax = this.decode[i + 1];
54380 this.decodeCoefficients[j] = isIndexed ? (dmax - dmin) / max : dmax - dmin; 54381 this.decodeAddends[j] = isIndexed ? dmin : max * dmin; 54382 } 54383 } 54384 54385 if (smask) { 54386 this.smask = new PDFImage({ 54387 xref: xref, 54388 res: res, 54389 image: smask, 54390 isInline: isInline, 54391 pdfFunctionFactory: pdfFunctionFactory 54392 }); 54393 } else if (mask) { 54394 if ((0, _primitives.isStream)(mask)) { 54395 var maskDict = mask.dict, 54396 imageMask = maskDict.get('ImageMask', 'IM'); 54397 54398 if (!imageMask) { 54399 (0, _util.warn)('Ignoring /Mask in image without /ImageMask.'); 54400 } else { 54401 this.mask = new PDFImage({ 54402 xref: xref, 54403 res: res, 54404 image: mask, 54405 isInline: isInline, 54406 isMask: true, 54407 pdfFunctionFactory: pdfFunctionFactory 54408 }); 54409 } 54410 } else { 54411 this.mask = mask; 54412 } 54413 } 54414 } 54415 54416 PDFImage.buildImage = function (_ref2) { 54417 var handler = _ref2.handler, 54418 xref = _ref2.xref, 54419 res = _ref2.res, 54420 image = _ref2.image, 54421 _ref2$isInline = _ref2.isInline, 54422 isInline = _ref2$isInline === void 0 ? false : _ref2$isInline, 54423 _ref2$nativeDecoder = _ref2.nativeDecoder, 54424 nativeDecoder = _ref2$nativeDecoder === void 0 ? null : _ref2$nativeDecoder, 54425 pdfFunctionFactory = _ref2.pdfFunctionFactory; 54426 var imagePromise = handleImageData(image, nativeDecoder); 54427 var smaskPromise; 54428 var maskPromise; 54429 var smask = image.dict.get('SMask'); 54430 var mask = image.dict.get('Mask'); 54431 54432 if (smask) { 54433 smaskPromise = handleImageData(smask, nativeDecoder); 54434 maskPromise = Promise.resolve(null); 54435 } else { 54436 smaskPromise = Promise.resolve(null); 54437 54438 if (mask) { 54439 if ((0, _primitives.isStream)(mask)) { 54440 maskPromise = handleImageData(mask, nativeDecoder); 54441 } else if (Array.isArray(mask)) { 54442 maskPromise = Promise.resolve(mask); 54443 } else { 54444 (0, _util.warn)('Unsupported mask format.'); 54445 maskPromise = Promise.resolve(null); 54446 } 54447 } else { 54448 maskPromise = Promise.resolve(null); 54449 } 54450 } 54451 54452 return Promise.all([imagePromise, smaskPromise, maskPromise]).then(function (_ref3) { 54453 var _ref4 = _slicedToArray(_ref3, 3), 54454 imageData = _ref4[0], 54455 smaskData = _ref4[1], 54456 maskData = _ref4[2]; 54457 54458 return new PDFImage({ 54459 xref: xref, 54460 res: res, 54461 image: imageData, 54462 isInline: isInline, 54463 smask: smaskData, 54464 mask: maskData, 54465 pdfFunctionFactory: pdfFunctionFactory 54466 }); 54467 }); 54468 }; 54469 54470 PDFImage.createMask = function (_ref5) { 54471 var imgArray = _ref5.imgArray, 54472 width = _ref5.width, 54473 height = _ref5.height, 54474 imageIsFromDecodeStream = _ref5.imageIsFromDecodeStream, 54475 inverseDecode = _ref5.inverseDecode; 54476 var computedLength = (width + 7 >> 3) * height; 54477 var actualLength = imgArray.byteLength; 54478 var haveFullData = computedLength === actualLength; 54479 var data, i; 54480 54481 if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) { 54482 data = imgArray; 54483 } else if (!inverseDecode) { 54484 data = new Uint8ClampedArray(actualLength); 54485 data.set(imgArray); 54486 } else { 54487 data = new Uint8ClampedArray(computedLength); 54488 data.set(imgArray); 54489 54490 for (i = actualLength; i < computedLength; i++) { 54491 data[i] = 0xff; 54492 } 54493 } 54494 54495 if (inverseDecode) { 54496 for (i = 0; i < actualLength; i++) { 54497 data[i] ^= 0xFF; 54498 } 54499 } 54500 54501 return { 54502 data: data, 54503 width: width, 54504 height: height 54505 }; 54506 }; 54507 54508 PDFImage.prototype = { 54509 get drawWidth() { 54510 return Math.max(this.width, this.smask && this.smask.width || 0, this.mask && this.mask.width || 0); 54511 }, 54512 54513 get drawHeight() { 54514 return Math.max(this.height, this.smask && this.smask.height || 0, this.mask && this.mask.height || 0); 54515 }, 54516 54517 decodeBuffer: function decodeBuffer(buffer) { 54518 var bpc = this.bpc; 54519 var numComps = this.numComps; 54520 var decodeAddends = this.decodeAddends; 54521 var decodeCoefficients = this.decodeCoefficients; 54522 var max = (1 << bpc) - 1; 54523 var i, ii; 54524 54525 if (bpc === 1) { 54526 for (i = 0, ii = buffer.length; i < ii; i++) { 54527 buffer[i] = +!buffer[i]; 54528 } 54529 54530 return; 54531 } 54532 54533 var index = 0; 54534 54535 for (i = 0, ii = this.width * this.height; i < ii; i++) { 54536 for (var j = 0; j < numComps; j++) { 54537 buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max); 54538 index++; 54539 } 54540 } 54541 }, 54542 getComponents: function getComponents(buffer) { 54543 var bpc = this.bpc; 54544 54545 if (bpc === 8) { 54546 return buffer; 54547 } 54548 54549 var width = this.width; 54550 var height = this.height; 54551 var numComps = this.numComps;
vendor: 7,846 bytes, lines 54552-54794
54552 var length = width * height * numComps; 54553 var bufferPos = 0; 54554 var output = bpc <= 8 ? new Uint8Array(length) : bpc <= 16 ? new Uint16Array(length) : new Uint32Array(length); 54555 var rowComps = width * numComps; 54556 var max = (1 << bpc) - 1; 54557 var i = 0, 54558 ii, 54559 buf; 54560 54561 if (bpc === 1) { 54562 var mask, loop1End, loop2End; 54563 54564 for (var j = 0; j < height; j++) { 54565 loop1End = i + (rowComps & ~7); 54566 loop2End = i + rowComps; 54567 54568 while (i < loop1End) { 54569 buf = buffer[bufferPos++]; 54570 output[i] = buf >> 7 & 1; 54571 output[i + 1] = buf >> 6 & 1; 54572 output[i + 2] = buf >> 5 & 1; 54573 output[i + 3] = buf >> 4 & 1; 54574 output[i + 4] = buf >> 3 & 1; 54575 output[i + 5] = buf >> 2 & 1; 54576 output[i + 6] = buf >> 1 & 1; 54577 output[i + 7] = buf & 1; 54578 i += 8; 54579 } 54580 54581 if (i < loop2End) { 54582 buf = buffer[bufferPos++]; 54583 mask = 128; 54584 54585 while (i < loop2End) { 54586 output[i++] = +!!(buf & mask); 54587 mask >>= 1; 54588 } 54589 } 54590 } 54591 } else { 54592 var bits = 0; 54593 buf = 0; 54594 54595 for (i = 0, ii = length; i < ii; ++i) { 54596 if (i % rowComps === 0) { 54597 buf = 0; 54598 bits = 0; 54599 } 54600 54601 while (bits < bpc) { 54602 buf = buf << 8 | buffer[bufferPos++]; 54603 bits += 8; 54604 } 54605 54606 var remainingBits = bits - bpc; 54607 var value = buf >> remainingBits; 54608 output[i] = value < 0 ? 0 : value > max ? max : value; 54609 buf = buf & (1 << remainingBits) - 1; 54610 bits = remainingBits; 54611 } 54612 } 54613 54614 return output; 54615 }, 54616 fillOpacity: function fillOpacity(rgbaBuf, width, height, actualHeight, image) { 54617 var smask = this.smask; 54618 var mask = this.mask; 54619 var alphaBuf, sw, sh, i, ii, j; 54620 54621 if (smask) { 54622 sw = smask.width; 54623 sh = smask.height; 54624 alphaBuf = new Uint8ClampedArray(sw * sh); 54625 smask.fillGrayBuffer(alphaBuf); 54626 54627 if (sw !== width || sh !== height) { 54628 alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height); 54629 } 54630 } else if (mask) { 54631 if (mask instanceof PDFImage) { 54632 sw = mask.width; 54633 sh = mask.height; 54634 alphaBuf = new Uint8ClampedArray(sw * sh); 54635 mask.numComps = 1; 54636 mask.fillGrayBuffer(alphaBuf); 54637 54638 for (i = 0, ii = sw * sh; i < ii; ++i) { 54639 alphaBuf[i] = 255 - alphaBuf[i]; 54640 } 54641 54642 if (sw !== width || sh !== height) { 54643 alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height); 54644 } 54645 } else if (Array.isArray(mask)) { 54646 alphaBuf = new Uint8ClampedArray(width * height); 54647 var numComps = this.numComps; 54648 54649 for (i = 0, ii = width * height; i < ii; ++i) { 54650 var opacity = 0; 54651 var imageOffset = i * numComps; 54652 54653 for (j = 0; j < numComps; ++j) { 54654 var color = image[imageOffset + j]; 54655 var maskOffset = j * 2; 54656 54657 if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { 54658 opacity = 255; 54659 break; 54660 } 54661 } 54662 54663 alphaBuf[i] = opacity; 54664 } 54665 } else { 54666 throw new _util.FormatError('Unknown mask format.'); 54667 } 54668 } 54669 54670 if (alphaBuf) { 54671 for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { 54672 rgbaBuf[j] = alphaBuf[i]; 54673 } 54674 } else { 54675 for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { 54676 rgbaBuf[j] = 255; 54677 } 54678 } 54679 }, 54680 undoPreblend: function undoPreblend(buffer, width, height) { 54681 var matte = this.smask && this.smask.matte; 54682 54683 if (!matte) { 54684 return; 54685 } 54686 54687 var matteRgb = this.colorSpace.getRgb(matte, 0); 54688 var matteR = matteRgb[0]; 54689 var matteG = matteRgb[1]; 54690 var matteB = matteRgb[2]; 54691 var length = width * height * 4; 54692 54693 for (var i = 0; i < length; i += 4) { 54694 var alpha = buffer[i + 3]; 54695 54696 if (alpha === 0) { 54697 buffer[i] = 255; 54698 buffer[i + 1] = 255; 54699 buffer[i + 2] = 255; 54700 continue; 54701 } 54702 54703 var k = 255 / alpha; 54704 buffer[i] = (buffer[i] - matteR) * k + matteR; 54705 buffer[i + 1] = (buffer[i + 1] - matteG) * k + matteG; 54706 buffer[i + 2] = (buffer[i + 2] - matteB) * k + matteB; 54707 } 54708 }, 54709 createImageData: function createImageData() { 54710 var forceRGBA = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; 54711 var drawWidth = this.drawWidth; 54712 var drawHeight = this.drawHeight; 54713 var imgData = { 54714 width: drawWidth, 54715 height: drawHeight, 54716 kind: 0, 54717 data: null 54718 }; 54719 var numComps = this.numComps; 54720 var originalWidth = this.width; 54721 var originalHeight = this.height; 54722 var bpc = this.bpc; 54723 var rowBytes = originalWidth * numComps * bpc + 7 >> 3; 54724 var imgArray; 54725 54726 if (!forceRGBA) { 54727 var kind; 54728 54729 if (this.colorSpace.name === 'DeviceGray' && bpc === 1) { 54730 kind = _util.ImageKind.GRAYSCALE_1BPP; 54731 } else if (this.colorSpace.name === 'DeviceRGB' && bpc === 8 && !this.needsDecode) { 54732 kind = _util.ImageKind.RGB_24BPP; 54733 } 54734 54735 if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { 54736 imgData.kind = kind; 54737 imgArray = this.getImageBytes(originalHeight * rowBytes); 54738 54739 if (this.image instanceof _stream.DecodeStream) { 54740 imgData.data = imgArray; 54741 } else { 54742 var newArray = new Uint8ClampedArray(imgArray.length); 54743 newArray.set(imgArray); 54744 imgData.data = newArray; 54745 } 54746 54747 if (this.needsDecode) { 54748 (0, _util.assert)(kind === _util.ImageKind.GRAYSCALE_1BPP, 'PDFImage.createImageData: The image must be grayscale.'); 54749 var buffer = imgData.data; 54750 54751 for (var i = 0, ii = buffer.length; i < ii; i++) { 54752 buffer[i] ^= 0xff; 54753 } 54754 } 54755 54756 return imgData; 54757 } 54758 54759 if (this.image instanceof _jpeg_stream.JpegStream && !this.smask && !this.mask) { 54760 var imageLength = originalHeight * rowBytes; 54761 54762 switch (this.colorSpace.name) { 54763 case 'DeviceGray': 54764 imageLength *= 3; 54765 54766 case 'DeviceRGB': 54767 case 'DeviceCMYK': 54768 imgData.kind = _util.ImageKind.RGB_24BPP; 54769 imgData.data = this.getImageBytes(imageLength, drawWidth, drawHeight, true); 54770 return imgData; 54771 } 54772 } 54773 } 54774 54775 imgArray = this.getImageBytes(originalHeight * rowBytes); 54776 var actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight; 54777 var comps = this.getComponents(imgArray); 54778 var alpha01, maybeUndoPreblend; 54779 54780 if (!forceRGBA && !this.smask && !this.mask) { 54781 imgData.kind = _util.ImageKind.RGB_24BPP; 54782 imgData.data = new Uint8ClampedArray(drawWidth * drawHeight * 3); 54783 alpha01 = 0; 54784 maybeUndoPreblend = false; 54785 } else { 54786 imgData.kind = _util.ImageKind.RGBA_32BPP; 54787 imgData.data = new Uint8ClampedArray(drawWidth * drawHeight * 4); 54788 alpha01 = 1; 54789 maybeUndoPreblend = true; 54790 this.fillOpacity(imgData.data, drawWidth, drawHeight, actualHeight, comps); 54791 } 54792 54793 if (this.needsDecode) { 54794 this.decodeBuffer(comps);
54795 } 54796 54797 this.colorSpace.fillRgb(imgData.data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01); 54798 54799 if (maybeUndoPreblend) { 54800 this.undoPreblend(imgData.data, drawWidth, actualHeight); 54801 } 54802 54803 return imgData; 54804 }, 54805 fillGrayBuffer: function fillGrayBuffer(buffer) { 54806 var numComps = this.numComps; 54807 54808 if (numComps !== 1) { 54809 throw new _util.FormatError("Reading gray scale from a color image: ".concat(numComps)); 54810 } 54811 54812 var width = this.width; 54813 var height = this.height; 54814 var bpc = this.bpc; 54815 var rowBytes = width * numComps * bpc + 7 >> 3; 54816 var imgArray = this.getImageBytes(height * rowBytes); 54817 var comps = this.getComponents(imgArray); 54818 var i, length; 54819 54820 if (bpc === 1) { 54821 length = width * height; 54822 54823 if (this.needsDecode) { 54824 for (i = 0; i < length; ++i) { 54825 buffer[i] = comps[i] - 1 & 255; 54826 } 54827 } else { 54828 for (i = 0; i < length; ++i) { 54829 buffer[i] = -comps[i] & 255; 54830 } 54831 } 54832 54833 return; 54834 } 54835 54836 if (this.needsDecode) { 54837 this.decodeBuffer(comps); 54838 } 54839 54840 length = width * height; 54841 var scale = 255 / ((1 << bpc) - 1); 54842 54843 for (i = 0; i < length; ++i) { 54844 buffer[i] = scale * comps[i]; 54845 } 54846 }, 54847 getImageBytes: function getImageBytes(length, drawWidth, drawHeight) { 54848 var forceRGB = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; 54849 this.image.reset(); 54850 this.image.drawWidth = drawWidth || this.width; 54851 this.image.drawHeight = drawHeight || this.height; 54852 this.image.forceRGB = !!forceRGB; 54853 return this.image.getBytes(length, true); 54854 } 54855 }; 54856 return PDFImage; 54857}();
54858 54859exports.PDFImage = PDFImage; 54860 54861/***/ }), 54862/* 189 */ 54863/***/ (function(module, exports, __w_pdfjs_require__) { 54864 54865"use strict"; 54866 54867 54868Object.defineProperty(exports, "__esModule", { 54869 value: true 54870}); 54871exports.MessageHandler = MessageHandler; 54872 54873var _regenerator = _interopRequireDefault(__w_pdfjs_require__(2)); 54874 54875var _util = __w_pdfjs_require__(6); 54876 54877function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 54878 54879function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } 54880 54881function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } 54882 54883function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } 54884 54885function resolveCall(_x, _x2) { 54886 return _resolveCall.apply(this, arguments); 54887} 54888 54889function _resolveCall() { 54890 _resolveCall = _asyncToGenerator( 54891 /*#__PURE__*/ 54892 _regenerator.default.mark(function _callee(fn, args) { 54893 var thisArg, 54894 _args = arguments; 54895 return _regenerator.default.wrap(function _callee$(_context) { 54896 while (1) { 54897 switch (_context.prev = _context.next) { 54898 case 0: 54899 thisArg = _args.length > 2 && _args[2] !== undefined ? _args[2] : null; 54900 54901 if (fn) { 54902 _context.next = 3; 54903 break; 54904 } 54905 54906 return _context.abrupt("return"); 54907 54908 case 3: 54909 return _context.abrupt("return", fn.apply(thisArg, args)); 54910 54911 case 4: 54912 case "end": 54913 return _context.stop(); 54914 } 54915 } 54916 }, _callee, this); 54917 })); 54918 return _resolveCall.apply(this, arguments); 54919} 54920 54921function wrapReason(reason) { 54922 if (_typeof(reason) !== 'object') { 54923 return reason; 54924 } 54925 54926 switch (reason.name) { 54927 case 'AbortException': 54928 return new _util.AbortException(reason.message); 54929 54930 case 'MissingPDFException': 54931 return new _util.MissingPDFException(reason.message); 54932 54933 case 'UnexpectedResponseException': 54934 return new _util.UnexpectedResponseException(reason.message, reason.status); 54935 54936 default: 54937 return new _util.UnknownErrorException(reason.message, reason.details); 54938 } 54939} 54940 54941function makeReasonSerializable(reason) { 54942 if (!(reason instanceof Error) || reason instanceof _util.AbortException || reason instanceof _util.MissingPDFException || reason instanceof _util.UnexpectedResponseException || reason instanceof _util.UnknownErrorException) { 54943 return reason; 54944 } 54945 54946 return new _util.UnknownErrorException(reason.message, reason.toString()); 54947} 54948 54949function resolveOrReject(capability, success, reason) { 54950 if (success) { 54951 capability.resolve(); 54952 } else { 54953 capability.reject(reason); 54954 } 54955} 54956 54957function finalize(promise) { 54958 return Promise.resolve(promise).catch(function () {}); 54959} 54960 54961function MessageHandler(sourceName, targetName, comObj) { 54962 var _this = this; 54963 54964 this.sourceName = sourceName; 54965 this.targetName = targetName; 54966 this.comObj = comObj; 54967 this.callbackId = 1; 54968 this.streamId = 1; 54969 this.postMessageTransfers = true; 54970 this.streamSinks = Object.create(null); 54971 this.streamControllers = Object.create(null); 54972 var callbacksCapabilities = this.callbacksCapabilities = Object.create(null); 54973 var ah = this.actionHandler = Object.create(null); 54974 54975 this._onComObjOnMessage = function (event) { 54976 var data = event.data; 54977 54978 if (data.targetName !== _this.sourceName) { 54979 return; 54980 } 54981 54982 if (data.stream) { 54983 _this._processStreamMessage(data); 54984 } else if (data.isReply) { 54985 var callbackId = data.callbackId; 54986 54987 if (data.callbackId in callbacksCapabilities) { 54988 var callback = callbacksCapabilities[callbackId]; 54989 delete callbacksCapabilities[callbackId]; 54990 54991 if ('error' in data) { 54992 callback.reject(wrapReason(data.error)); 54993 } else { 54994 callback.resolve(data.data); 54995 } 54996 } else { 54997 throw new Error("Cannot resolve callback ".concat(callbackId)); 54998 } 54999 } else if (data.action in ah) { 55000 var action = ah[data.action]; 55001 55002 if (data.callbackId) { 55003 var _sourceName = _this.sourceName; 55004 var _targetName = data.sourceName; 55005 Promise.resolve().then(function () { 55006 return action[0].call(action[1], data.data); 55007 }).then(function (result) { 55008 comObj.postMessage({ 55009 sourceName: _sourceName, 55010 targetName: _targetName, 55011 isReply: true, 55012 callbackId: data.callbackId, 55013 data: result 55014 }); 55015 }, function (reason) { 55016 comObj.postMessage({ 55017 sourceName: _sourceName, 55018 targetName: _targetName, 55019 isReply: true, 55020 callbackId: data.callbackId, 55021 error: makeReasonSerializable(reason) 55022 }); 55023 }); 55024 } else if (data.streamId) { 55025 _this._createStreamSink(data); 55026 } else { 55027 action[0].call(action[1], data.data); 55028 } 55029 } else { 55030 throw new Error("Unknown action from worker: ".concat(data.action)); 55031 } 55032 }; 55033 55034 comObj.addEventListener('message', this._onComObjOnMessage); 55035} 55036 55037MessageHandler.prototype = { 55038 on: function on(actionName, handler, scope) { 55039 var ah = this.actionHandler; 55040 55041 if (ah[actionName]) { 55042 throw new Error("There is already an actionName called \"".concat(actionName, "\"")); 55043 } 55044 55045 ah[actionName] = [handler, scope]; 55046 }, 55047 send: function send(actionName, data, transfers) { 55048 var message = { 55049 sourceName: this.sourceName, 55050 targetName: this.targetName, 55051 action: actionName, 55052 data: data 55053 }; 55054 this.postMessage(message, transfers); 55055 },
55056 sendWithPromise: function sendWithPromise(actionName, data, transfers) { 55057 var callbackId = this.callbackId++; 55058 var message = { 55059 sourceName: this.sourceName, 55060 targetName: this.targetName, 55061 action: actionName, 55062 data: data, 55063 callbackId: callbackId 55064 }; 55065 var capability = (0, _util.createPromiseCapability)(); 55066 this.callbacksCapabilities[callbackId] = capability; 55067 55068 try { 55069 this.postMessage(message, transfers); 55070 } catch (e) { 55071 capability.reject(e); 55072 } 55073 55074 return capability.promise; 55075 }, 55076 sendWithStream: function sendWithStream(actionName, data, queueingStrategy, transfers) { 55077 var _this2 = this; 55078 55079 var streamId = this.streamId++; 55080 var sourceName = this.sourceName; 55081 var targetName = this.targetName; 55082 return new _util.ReadableStream({ 55083 start: function start(controller) { 55084 var startCapability = (0, _util.createPromiseCapability)(); 55085 _this2.streamControllers[streamId] = { 55086 controller: controller, 55087 startCall: startCapability, 55088 isClosed: false 55089 }; 55090 55091 _this2.postMessage({ 55092 sourceName: sourceName, 55093 targetName: targetName, 55094 action: actionName, 55095 streamId: streamId, 55096 data: data, 55097 desiredSize: controller.desiredSize 55098 }); 55099 55100 return startCapability.promise; 55101 }, 55102 pull: function pull(controller) { 55103 var pullCapability = (0, _util.createPromiseCapability)(); 55104 _this2.streamControllers[streamId].pullCall = pullCapability; 55105 55106 _this2.postMessage({ 55107 sourceName: sourceName, 55108 targetName: targetName, 55109 stream: 'pull', 55110 streamId: streamId, 55111 desiredSize: controller.desiredSize 55112 }); 55113 55114 return pullCapability.promise; 55115 }, 55116 cancel: function cancel(reason) { 55117 var cancelCapability = (0, _util.createPromiseCapability)(); 55118 _this2.streamControllers[streamId].cancelCall = cancelCapability; 55119 _this2.streamControllers[streamId].isClosed = true; 55120 55121 _this2.postMessage({ 55122 sourceName: sourceName, 55123 targetName: targetName, 55124 stream: 'cancel', 55125 reason: reason, 55126 streamId: streamId 55127 }); 55128 55129 return cancelCapability.promise; 55130 } 55131 }, queueingStrategy); 55132 }, 55133 _createStreamSink: function _createStreamSink(data) { 55134 var _this3 = this; 55135 55136 var self = this; 55137 var action = this.actionHandler[data.action]; 55138 var streamId = data.streamId; 55139 var desiredSize = data.desiredSize; 55140 var sourceName = this.sourceName; 55141 var targetName = data.sourceName; 55142 var capability = (0, _util.createPromiseCapability)(); 55143 55144 var sendStreamRequest = function sendStreamRequest(_ref) { 55145 var stream = _ref.stream, 55146 chunk = _ref.chunk, 55147 transfers = _ref.transfers, 55148 success = _ref.success, 55149 reason = _ref.reason; 55150 55151 _this3.postMessage({ 55152 sourceName: sourceName, 55153 targetName: targetName, 55154 stream: stream, 55155 streamId: streamId, 55156 chunk: chunk, 55157 success: success, 55158 reason: reason 55159 }, transfers); 55160 }; 55161 55162 var streamSink = { 55163 enqueue: function enqueue(chunk) { 55164 var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1; 55165 var transfers = arguments.length > 2 ? arguments[2] : undefined; 55166 55167 if (this.isCancelled) { 55168 return; 55169 } 55170 55171 var lastDesiredSize = this.desiredSize; 55172 this.desiredSize -= size; 55173 55174 if (lastDesiredSize > 0 && this.desiredSize <= 0) { 55175 this.sinkCapability = (0, _util.createPromiseCapability)(); 55176 this.ready = this.sinkCapability.promise; 55177 } 55178 55179 sendStreamRequest({ 55180 stream: 'enqueue', 55181 chunk: chunk, 55182 transfers: transfers 55183 }); 55184 }, 55185 close: function close() { 55186 if (this.isCancelled) { 55187 return; 55188 } 55189 55190 this.isCancelled = true;
55191 sendStreamRequest({ 55192 stream: 'close' 55193 }); 55194 delete self.streamSinks[streamId]; 55195 }, 55196 error: function error(reason) { 55197 if (this.isCancelled) { 55198 return; 55199 } 55200 55201 this.isCancelled = true; 55202 sendStreamRequest({ 55203 stream: 'error', 55204 reason: reason 55205 }); 55206 }, 55207 sinkCapability: capability, 55208 onPull: null, 55209 onCancel: null, 55210 isCancelled: false, 55211 desiredSize: desiredSize, 55212 ready: null 55213 }; 55214 streamSink.sinkCapability.resolve(); 55215 streamSink.ready = streamSink.sinkCapability.promise; 55216 this.streamSinks[streamId] = streamSink; 55217 resolveCall(action[0], [data.data, streamSink], action[1]).then(function () { 55218 sendStreamRequest({ 55219 stream: 'start_complete', 55220 success: true 55221 }); 55222 }, function (reason) { 55223 sendStreamRequest({ 55224 stream: 'start_complete', 55225 success: false, 55226 reason: reason 55227 }); 55228 }); 55229 }, 55230 _processStreamMessage: function _processStreamMessage(data) { 55231 var _this4 = this; 55232 55233 var sourceName = this.sourceName; 55234 var targetName = data.sourceName; 55235 var streamId = data.streamId; 55236 55237 var sendStreamResponse = function sendStreamResponse(_ref2) { 55238 var stream = _ref2.stream, 55239 success = _ref2.success, 55240 reason = _ref2.reason; 55241 55242 _this4.comObj.postMessage({ 55243 sourceName: sourceName, 55244 targetName: targetName, 55245 stream: stream, 55246 success: success, 55247 streamId: streamId, 55248 reason: reason 55249 }); 55250 }; 55251 55252 var deleteStreamController = function deleteStreamController() { 55253 Promise.all([_this4.streamControllers[data.streamId].startCall, _this4.streamControllers[data.streamId].pullCall, _this4.streamControllers[data.streamId].cancelCall].map(function (capability) { 55254 return capability && finalize(capability.promise); 55255 })).then(function () { 55256 delete _this4.streamControllers[data.streamId]; 55257 }); 55258 }; 55259 55260 switch (data.stream) { 55261 case 'start_complete': 55262 resolveOrReject(this.streamControllers[data.streamId].startCall, data.success, wrapReason(data.reason)); 55263 break; 55264 55265 case 'pull_complete': 55266 resolveOrReject(this.streamControllers[data.streamId].pullCall, data.success, wrapReason(data.reason)); 55267 break; 55268 55269 case 'pull': 55270 if (!this.streamSinks[data.streamId]) { 55271 sendStreamResponse({ 55272 stream: 'pull_complete', 55273 success: true 55274 }); 55275 break; 55276 } 55277 55278 if (this.streamSinks[data.streamId].desiredSize <= 0 && data.desiredSize > 0) { 55279 this.streamSinks[data.streamId].sinkCapability.resolve(); 55280 } 55281 55282 this.streamSinks[data.streamId].desiredSize = data.desiredSize; 55283 resolveCall(this.streamSinks[data.streamId].onPull).then(function () { 55284 sendStreamResponse({ 55285 stream: 'pull_complete', 55286 success: true 55287 }); 55288 }, function (reason) { 55289 sendStreamResponse({ 55290 stream: 'pull_complete', 55291 success: false, 55292 reason: reason 55293 }); 55294 }); 55295 break; 55296 55297 case 'enqueue': 55298 (0, _util.assert)(this.streamControllers[data.streamId], 'enqueue should have stream controller'); 55299 55300 if (!this.streamControllers[data.streamId].isClosed) { 55301 this.streamControllers[data.streamId].controller.enqueue(data.chunk); 55302 } 55303 55304 break; 55305 55306 case 'close': 55307 (0, _util.assert)(this.streamControllers[data.streamId], 'close should have stream controller'); 55308 55309 if (this.streamControllers[data.streamId].isClosed) { 55310 break; 55311 } 55312 55313 this.streamControllers[data.streamId].isClosed = true; 55314 this.streamControllers[data.streamId].controller.close(); 55315 deleteStreamController(); 55316 break; 55317 55318 case 'error': 55319 (0, _util.assert)(this.streamControllers[data.streamId], 'error should have stream controller'); 55320 this.streamControllers[data.streamId].controller.error(wrapReason(data.reason)); 55321 deleteStreamController(); 55322 break; 55323 55324 case 'cancel_complete': 55325 resolveOrReject(this.streamControllers[data.streamId].cancelCall, data.success, wrapReason(data.reason)); 55326 deleteStreamController(); 55327 break; 55328 55329 case 'cancel': 55330 if (!this.streamSinks[data.streamId]) { 55331 break; 55332 } 55333 55334 resolveCall(this.streamSinks[data.streamId].onCancel, [wrapReason(data.reason)]).then(function () { 55335 sendStreamResponse({ 55336 stream: 'cancel_complete', 55337 success: true 55338 }); 55339 }, function (reason) { 55340 sendStreamResponse({ 55341 stream: 'cancel_complete', 55342 success: false, 55343 reason: reason 55344 }); 55345 }); 55346 this.streamSinks[data.streamId].sinkCapability.reject(wrapReason(data.reason)); 55347 this.streamSinks[data.streamId].isCancelled = true; 55348 delete this.streamSinks[data.streamId]; 55349 break; 55350 55351 default: 55352 throw new Error('Unexpected stream case'); 55353 } 55354 }, 55355 postMessage: function postMessage(message, transfers) { 55356 if (transfers && this.postMessageTransfers) { 55357 this.comObj.postMessage(message, transfers); 55358 } else { 55359 this.comObj.postMessage(message); 55360 } 55361 }, 55362 destroy: function destroy() { 55363 this.comObj.removeEventListener('message', this._onComObjOnMessage); 55364 } 55365}; 55366 55367/***/ }) 55368/******/ ]); 55369});�
vendor: 39 bytes, lines 55369-55370
55369 55370//# sourceMappingURL=pdf.worker.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.