Commit 5734c037 authored by Calixte's avatar Calixte
Browse files

Bug 1826379 - Update PDF.js to new version...

Bug 1826379 - Update PDF.js to new version 184076fe7acfae9c1e5938151d5d4f95e9e94ea5 r=pdfjs-reviewers,marco

Differential Revision: https://phabricator.services.mozilla.com/D174652
parent a226fa31
Loading
Loading
Loading
Loading
+12 −22
Original line number Diff line number Diff line
@@ -935,7 +935,7 @@ function getDocument(src) {
  }
  const fetchDocParams = {
    docId,
    apiVersion: '3.5.80',
    apiVersion: '3.6.9',
    data,
    password,
    disableAutoFetch,
@@ -1282,7 +1282,6 @@ class PDFPageProxy {
    intent = "display",
    annotationMode = _util.AnnotationMode.ENABLE,
    transform = null,
    canvasFactory = null,
    background = null,
    optionalContentConfigPromise = null,
    annotationCanvasMap = null,
@@ -1348,7 +1347,7 @@ class PDFPageProxy {
      annotationCanvasMap,
      operatorList: intentState.operatorList,
      pageIndex: this._pageIndex,
      canvasFactory: canvasFactory || this._transport.canvasFactory,
      canvasFactory: this._transport.canvasFactory,
      filterFactory: this._transport.filterFactory,
      useRequestAnimationFrame: !intentPrint,
      pdfBug: this._pdfBug,
@@ -1405,13 +1404,11 @@ class PDFPageProxy {
    return intentState.opListReadCapability.promise;
  }
  streamTextContent({
    disableCombineTextItems = false,
    includeMarkedContent = false
  } = {}) {
    const TEXT_CONTENT_CHUNK_SIZE = 100;
    return this._transport.messageHandler.sendWithStream("GetTextContent", {
      pageIndex: this._pageIndex,
      combineTextItems: disableCombineTextItems !== true,
      includeMarkedContent: includeMarkedContent === true
    }, {
      highWaterMark: TEXT_CONTENT_CHUNK_SIZE,
@@ -2145,19 +2142,12 @@ class WorkerTransport {
            this.commonObjs.resolve(id, exportedError);
            break;
          }
          let fontRegistry = null;
          if (params.pdfBug && globalThis.FontInspector?.enabled) {
            fontRegistry = {
              registerFont(font, url) {
                globalThis.FontInspector.fontAdded(font, url);
              }
            };
          }
          const inspectFont = params.pdfBug && globalThis.FontInspector?.enabled ? (font, url) => globalThis.FontInspector.fontAdded(font, url) : null;
          const font = new _font_loader.FontFaceObject(exportedData, {
            isEvalSupported: params.isEvalSupported,
            disableFontFace: params.disableFontFace,
            ignoreErrors: params.ignoreErrors,
            fontRegistry
            inspectFont
          });
          this.fontLoader.bind(font).catch(reason => {
            return messageHandler.sendWithPromise("FontFallback", {
@@ -2617,9 +2607,9 @@ class InternalRenderTask {
    }
  }
}
const version = '3.5.80';
const version = '3.6.9';
exports.version = version;
const build = 'b1e0253f2';
const build = '184076fe7';
exports.build = build;

/***/ }),
@@ -4729,7 +4719,7 @@ class FontFaceObject {
    isEvalSupported = true,
    disableFontFace = false,
    ignoreErrors = false,
    fontRegistry = null
    inspectFont = null
  }) {
    this.compiledGlyphs = Object.create(null);
    for (const i in translatedData) {
@@ -4738,7 +4728,7 @@ class FontFaceObject {
    this.isEvalSupported = isEvalSupported !== false;
    this.disableFontFace = disableFontFace === true;
    this.ignoreErrors = ignoreErrors === true;
    this.fontRegistry = fontRegistry;
    this._inspectFont = inspectFont;
  }
  createNativeFontFace() {
    if (!this.data || this.disableFontFace) {
@@ -4756,7 +4746,7 @@ class FontFaceObject {
      }
      nativeFontFace = new FontFace(this.cssFontInfo.fontFamily, this.data, css);
    }
    this.fontRegistry?.registerFont(this);
    this._inspectFont?.(this);
    return nativeFontFace;
  }
  createFontFaceRule() {
@@ -4775,7 +4765,7 @@ class FontFaceObject {
      }
      rule = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${css}src:${url}}`;
    }
    this.fontRegistry?.registerFont(this, url);
    this._inspectFont?.(this, url);
    return rule;
  }
  getPathGenerator(objs, character) {
@@ -13243,8 +13233,8 @@ var _annotation_layer = __w_pdfjs_require__(26);
var _worker_options = __w_pdfjs_require__(14);
var _svg = __w_pdfjs_require__(29);
var _xfa_layer = __w_pdfjs_require__(28);
const pdfjsVersion = '3.5.80';
const pdfjsBuild = 'b1e0253f2';
const pdfjsVersion = '3.6.9';
const pdfjsBuild = '184076fe7';
})();

/******/ 	return __webpack_exports__;
+7 −7
Original line number Diff line number Diff line
@@ -1237,7 +1237,7 @@ class AForm {
    if (!actions) {
      actions = [];
      this._dateActionsCache.set(cFormat, actions);
      cFormat.replace(/(d+)|(m+)|(y+)|(H+)|(M+)|(s+)/g, function (match, d, m, y, H, M, s) {
      cFormat.replaceAll(/(d+)|(m+)|(y+)|(H+)|(M+)|(s+)/g, function (match, d, m, y, H, M, s) {
        if (d) {
          actions.push((n, date) => {
            if (n >= 1 && n <= 31) {
@@ -3764,7 +3764,7 @@ class Util extends _pdf_object.PDFObject {
    const ZERO = 4;
    const HASH = 8;
    let i = 0;
    return args[0].replace(pattern, function (match, nDecSep, cFlags, nWidth, nPrecision, cConvChar) {
    return args[0].replaceAll(pattern, function (match, nDecSep, cFlags, nWidth, nPrecision, cConvChar) {
      if (cConvChar !== "d" && cConvChar !== "f" && cConvChar !== "s" && cConvChar !== "x") {
        const buf = ["%"];
        for (const str of [nDecSep, cFlags, nWidth, nPrecision, cConvChar]) {
@@ -3956,7 +3956,7 @@ class Util extends _pdf_object.PDFObject {
      seconds: oDate.getSeconds()
    };
    const patterns = /(mmmm|mmm|mm|m|dddd|ddd|dd|d|yyyy|yy|HH|H|hh|h|MM|M|ss|s|tt|t|\\.)/g;
    return cFormat.replace(patterns, function (match, pattern) {
    return cFormat.replaceAll(patterns, function (match, pattern) {
      if (pattern in handlers) {
        return handlers[pattern](data);
      }
@@ -4175,10 +4175,10 @@ class Util extends _pdf_object.PDFObject {
          }
        }
      };
      const escapedFormat = cFormat.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
      const escapedFormat = cFormat.replaceAll(/[.*+\-?^${}()|[\]\\]/g, "\\$&");
      const patterns = /(mmmm|mmm|mm|m|dddd|ddd|dd|d|yyyy|yy|HH|H|hh|h|MM|M|ss|s|tt|t)/g;
      const actions = [];
      const re = escapedFormat.replace(patterns, function (match, patternElement) {
      const re = escapedFormat.replaceAll(patterns, function (match, patternElement) {
        const {
          pattern,
          action
@@ -4258,8 +4258,8 @@ Object.defineProperty(exports, "initSandbox", ({
  }
}));
var _initialization = __w_pdfjs_require__(1);
const pdfjsVersion = '3.5.80';
const pdfjsBuild = 'b1e0253f2';
const pdfjsVersion = '3.6.9';
const pdfjsBuild = '184076fe7';
})();

/******/ 	return __webpack_exports__;
+79 −65
Original line number Diff line number Diff line
@@ -101,7 +101,7 @@ class WorkerMessageHandler {
      docId,
      apiVersion
    } = docParams;
    const workerVersion = '3.5.80';
    const workerVersion = '3.6.9';
    if (apiVersion !== workerVersion) {
      throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
    }
@@ -482,6 +482,7 @@ class WorkerMessageHandler {
              }
            });
          }
          const lastXRefStreamPos = xref.lastXRefStreamPos;
          newXrefInfo = {
            rootRef: xref.trailer.getRaw("Root") || null,
            encryptRef: xref.trailer.getRaw("Encrypt") || null,
@@ -489,7 +490,7 @@ class WorkerMessageHandler {
            infoRef: xref.trailer.getRaw("Info") || null,
            info: infoObj,
            fileIds: xref.trailer.get("ID") || null,
            startXRef,
            startXRef: lastXRefStreamPos === null ? startXRef : lastXRefStreamPos,
            filename
          };
        }
@@ -541,7 +542,10 @@ class WorkerMessageHandler {
      });
    });
    handler.on("GetTextContent", function (data, sink) {
      const pageIndex = data.pageIndex;
      const {
        pageIndex,
        includeMarkedContent
      } = data;
      pdfManager.getPage(pageIndex).then(function (page) {
        const task = new WorkerTask("GetTextContent: page " + pageIndex);
        startWorkerTask(task);
@@ -550,8 +554,7 @@ class WorkerMessageHandler {
          handler,
          task,
          sink,
          includeMarkedContent: data.includeMarkedContent,
          combineTextItems: data.combineTextItems
          includeMarkedContent
        }).then(function () {
          finishWorkerTask(task);
          if (start) {
@@ -1623,7 +1626,7 @@ function escapePDFName(str) {
  return buffer.join("");
}
function escapeString(str) {
  return str.replace(/([()\\\n\r])/g, match => {
  return str.replaceAll(/([()\\\n\r])/g, match => {
    if (match === "\n") {
      return "\\n";
    } else if (match === "\r") {
@@ -1658,7 +1661,7 @@ function _collectJS(entry, xref, list, parents) {
      } else if (typeof js === "string") {
        code = js;
      }
      code = code && (0, _util.stringToPDFString)(code).replace(/\u0000/g, "");
      code = code && (0, _util.stringToPDFString)(code).replaceAll("\x00", "");
      if (code) {
        list.push(code);
      }
@@ -1757,20 +1760,17 @@ function validateCSSFont(cssFontInfo) {
    fontWeight,
    italicAngle
  } = cssFontInfo;
  if (/^".*"$/.test(fontFamily)) {
    if (/[^\\]"/.test(fontFamily.slice(1, fontFamily.length - 1))) {
      (0, _util.warn)(`XFA - FontFamily contains some unescaped ": ${fontFamily}.`);
      return false;
    }
  } else if (/^'.*'$/.test(fontFamily)) {
    if (/[^\\]'/.test(fontFamily.slice(1, fontFamily.length - 1))) {
      (0, _util.warn)(`XFA - FontFamily contains some unescaped ': ${fontFamily}.`);
  const m = /^("|').*("|')$/.exec(fontFamily);
  if (m && m[1] === m[2]) {
    const re = new RegExp(`[^\\\\]${m[1]}`);
    if (re.test(fontFamily.slice(1, -1))) {
      (0, _util.warn)(`XFA - FontFamily contains unescaped ${m[1]}: ${fontFamily}.`);
      return false;
    }
  } else {
    for (const ident of fontFamily.split(/[ \t]+/)) {
      if (/^(\d|(-(\d|-)))/.test(ident) || !/^[\w-\\]+$/.test(ident)) {
        (0, _util.warn)(`XFA - FontFamily contains some invalid <custom-ident>: ${fontFamily}.`);
        (0, _util.warn)(`XFA - FontFamily contains invalid <custom-ident>: ${fontFamily}.`);
        return false;
      }
    }
@@ -1783,7 +1783,7 @@ function validateCSSFont(cssFontInfo) {
}
function recoverJsURL(str) {
  const URL_OPEN_METHODS = ["app.launchURL", "window.open", "xfa.host.gotoURL"];
  const regex = new RegExp("^\\s*(" + URL_OPEN_METHODS.join("|").split(".").join("\\.") + ")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))", "i");
  const regex = new RegExp("^\\s*(" + URL_OPEN_METHODS.join("|").replaceAll(".", "\\.") + ")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))", "i");
  const jsUrl = regex.exec(str);
  if (jsUrl && jsUrl[2]) {
    const url = jsUrl[2];
@@ -3258,8 +3258,7 @@ class Page {
    handler,
    task,
    includeMarkedContent,
    sink,
    combineTextItems
    sink
  }) {
    const contentStreamPromise = this.getContentStream();
    const resourcesPromise = this.loadResources(["ExtGState", "Font", "Properties", "XObject"]);
@@ -3281,7 +3280,6 @@ class Page {
        task,
        resources: this.resources,
        includeMarkedContent,
        combineTextItems,
        sink,
        viewBox: this.view
      });
@@ -3734,7 +3732,7 @@ class PDFDocument {
        continue;
      }
      let fontFamily = descriptor.get("FontFamily");
      fontFamily = fontFamily.replace(/[ ]+(\d)/g, "$1");
      fontFamily = fontFamily.replaceAll(/[ ]+(\d)/g, "$1");
      const fontWeight = descriptor.get("FontWeight");
      const italicAngle = -descriptor.get("ItalicAngle");
      const cssFontInfo = {
@@ -4783,7 +4781,6 @@ class Annotation {
      task,
      resources,
      includeMarkedContent: true,
      combineTextItems: true,
      sink,
      viewBox
    });
@@ -9843,7 +9840,6 @@ class PartialEvaluator {
    task,
    resources,
    stateManager = null,
    combineTextItems = false,
    includeMarkedContent = false,
    sink,
    seenStyles = new Set(),
@@ -9898,6 +9894,7 @@ class PartialEvaluator {
    const NEGATIVE_SPACE_FACTOR = -0.2;
    const SPACE_IN_FLOW_MIN_FACTOR = 0.102;
    const SPACE_IN_FLOW_MAX_FACTOR = 0.6;
    const VERTICAL_SHIFT_RATIO = 0.25;
    const self = this;
    const xref = this.xref;
    const showSpacedTextBuffer = [];
@@ -10019,7 +10016,7 @@ class PartialEvaluator {
      if (shiftedX < 0 || shiftedX > viewBox[2] || shiftedY < 0 || shiftedY > viewBox[3]) {
        return false;
      }
      if (!combineTextItems || !textState.font || !textContentItem.prevTransform) {
      if (!textState.font || !textContentItem.prevTransform) {
        return true;
      }
      let lastPosX = textContentItem.prevTransform[4];
@@ -10089,6 +10086,9 @@ class PartialEvaluator {
            textContentItem.height += advanceY;
          }
        }
        if (Math.abs(advanceX) > textContentItem.width * VERTICAL_SHIFT_RATIO) {
          flushTextContentItem();
        }
        return true;
      }
      const advanceX = (posX - lastPosX) / textContentItem.textAdvanceScale;
@@ -10128,6 +10128,9 @@ class PartialEvaluator {
          textContentItem.width += advanceX;
        }
      }
      if (Math.abs(advanceY) > textContentItem.height * VERTICAL_SHIFT_RATIO) {
        flushTextContentItem();
      }
      return true;
    }
    function buildTextContentItem({
@@ -10480,7 +10483,6 @@ class PartialEvaluator {
                task,
                resources: xobj.dict.get("Resources") || resources,
                stateManager: xObjStateManager,
                combineTextItems,
                includeMarkedContent,
                sink: sinkWrapper,
                seenStyles,
@@ -10757,6 +10759,15 @@ class PartialEvaluator {
            code = unicode;
          }
          break;
        default:
          switch (glyphName) {
            case "f_h":
            case "f_t":
            case "T_h":
              toUnicode[charcode] = glyphName.replaceAll("_", "");
              continue;
          }
          break;
      }
      if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) {
        if (baseEncodingName && code === +charcode) {
@@ -10793,14 +10804,19 @@ class PartialEvaluator {
        fetchBuiltInCMap: this._fetchBuiltInCMapBound,
        useCMap: null
      });
      const toUnicode = [];
      const toUnicode = [],
        buf = [];
      properties.cMap.forEach(function (charcode, cid) {
        if (cid > 0xffff) {
          throw new _util.FormatError("Max size of CID is 65,535");
        }
        const ucs2 = ucs2CMap.lookup(cid);
        if (ucs2) {
          toUnicode[charcode] = String.fromCharCode((ucs2.charCodeAt(0) << 8) + ucs2.charCodeAt(1));
          buf.length = 0;
          for (let i = 0, ii = ucs2.length; i < ii; i += 2) {
            buf.push((ucs2.charCodeAt(i) << 8) + ucs2.charCodeAt(i + 1));
          }
          toUnicode[charcode] = String.fromCharCode(...buf);
        }
      });
      return new _to_unicode_map.ToUnicodeMap(toUnicode);
@@ -11150,7 +11166,7 @@ class PartialEvaluator {
        if (!(baseFontName instanceof _primitives.Name)) {
          throw new _util.FormatError("Base font is not specified");
        }
        baseFontName = baseFontName.name.replace(/[,_]/g, "-");
        baseFontName = baseFontName.name.replaceAll(/[,_]/g, "-");
        const metrics = this.getBaseFontMetrics(baseFontName);
        const fontNameWoStyle = baseFontName.split("-")[0];
        const flags = (this.isSerifFont(fontNameWoStyle) ? _fonts_utils.FontFlags.Serif : 0) | (metrics.monospace ? _fonts_utils.FontFlags.FixedPitch : 0) | ((0, _standard_fonts.getSymbolsFonts)()[fontNameWoStyle] ? _fonts_utils.FontFlags.Symbolic : _fonts_utils.FontFlags.Nonsymbolic);
@@ -21321,7 +21337,7 @@ function createPostTable(properties) {
  return "\x00\x03\x00\x00" + (0, _util.string32)(angle) + "\x00\x00" + "\x00\x00" + (0, _util.string32)(properties.fixedPitch ? 1 : 0) + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + "\x00\x00\x00\x00";
}
function createPostscriptName(name) {
  return name.replace(/[^\x21-\x7E]|[[\](){}<>/%]/g, "").slice(0, 63);
  return name.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g, "").slice(0, 63);
}
function createNameTable(name, proto) {
  if (!proto) {
@@ -21371,7 +21387,7 @@ class Font {
    this._glyphCache = Object.create(null);
    let isSerifFont = !!(properties.flags & _fonts_utils.FontFlags.Serif);
    if (!isSerifFont && !properties.isSimulatedFlags) {
      const baseName = name.replace(/[,_]/g, "-").split("-")[0],
      const baseName = name.replaceAll(/[,_]/g, "-").split("-")[0],
        serifFonts = (0, _standard_fonts.getSerifFonts)();
      for (const namePart of baseName.split("+")) {
        if (serifFonts[namePart]) {
@@ -21693,7 +21709,7 @@ class Font {
        const [nameTable] = readNameTable(potentialTables.name);
        for (let j = 0, jj = nameTable.length; j < jj; j++) {
          for (let k = 0, kk = nameTable[j].length; k < kk; k++) {
            const nameEntry = nameTable[j][k] && nameTable[j][k].replace(/\s/g, "");
            const nameEntry = nameTable[j][k] && nameTable[j][k].replaceAll(/\s/g, "");
            if (!nameEntry) {
              continue;
            }
@@ -24855,7 +24871,7 @@ function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) {
  return charCodeToGlyphId;
}
function normalizeFontName(name) {
  return name.replace(/[,_]/g, "-").replace(/\s/g, "");
  return name.replaceAll(/[,_]/g, "-").replaceAll(/\s/g, "");
}
/***/ }),
@@ -31435,7 +31451,7 @@ class Type1CharString {
            subrNumber = this.stack.pop();
            const numArgs = this.stack.pop();
            if (subrNumber === 0 && numArgs === 3) {
              const flexArgs = this.stack.splice(this.stack.length - 17, 17);
              const flexArgs = this.stack.splice(-17, 17);
              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]);
              error = this.executeCommand(13, COMMAND_MAP.flex, true);
              this.flexing = false;
@@ -33426,9 +33442,7 @@ class PDFFunction {
}
function isPDFFunction(v) {
  let fnDict;
  if (typeof v !== "object") {
    return false;
  } else if (v instanceof _primitives.Dict) {
  if (v instanceof _primitives.Dict) {
    fnDict = v;
  } else if (v instanceof _base_stream.BaseStream) {
    fnDict = v.dict;
@@ -36736,7 +36750,7 @@ function isWhitespaceString(s) {
}
class XMLParserBase {
  _resolveEntities(s) {
    return s.replace(/&([^;]+);/g, (all, entity) => {
    return s.replaceAll(/&([^;]+);/g, (all, entity) => {
      if (entity.substring(0, 2) === "#x") {
        return String.fromCodePoint(parseInt(entity.substring(2), 16));
      } else if (entity.substring(0, 1) === "#") {
@@ -39291,7 +39305,7 @@ class Catalog {
      if (javaScript === null) {
        javaScript = new Map();
      }
      js = (0, _util.stringToPDFString)(js).replace(/\u0000/g, "");
      js = (0, _util.stringToPDFString)(js).replaceAll("\x00", "");
      javaScript.set(name, js);
    }
    if (obj instanceof _primitives.Dict && obj.has("JavaScript")) {
@@ -40013,7 +40027,7 @@ class FileSpec {
  get filename() {
    if (!this._filename && this.root) {
      const filename = pickPlatformItem(this.root) || "unnamed";
      this._filename = (0, _util.stringToPDFString)(filename).replace(/\\\\/g, "\\").replace(/\\\//g, "/").replace(/\\/g, "/");
      this._filename = (0, _util.stringToPDFString)(filename).replaceAll("\\\\", "\\").replaceAll("\\/", "/").replaceAll("\\", "/");
    }
    return this._filename;
  }
@@ -40071,10 +40085,10 @@ class MetadataParser {
    }
  }
  _repair(data) {
    return data.replace(/^[^<]+/, "").replace(/>\\376\\377([^<]+)/g, function (all, codes) {
      const bytes = codes.replace(/\\([0-3])([0-7])([0-7])/g, function (code, d1, d2, d3) {
    return data.replace(/^[^<]+/, "").replaceAll(/>\\376\\377([^<]+)/g, function (all, codes) {
      const bytes = codes.replaceAll(/\\([0-3])([0-7])([0-7])/g, function (code, d1, d2, d3) {
        return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1);
      }).replace(/&(amp|apos|gt|lt|quot);/g, function (str, name) {
      }).replaceAll(/&(amp|apos|gt|lt|quot);/g, function (str, name) {
        switch (name) {
          case "amp":
            return "&";
@@ -41159,9 +41173,9 @@ class XFAObject {
    if (usehref) {
      ref = usehref;
      if (usehref.startsWith("#som(") && usehref.endsWith(")")) {
        somExpression = usehref.slice("#som(".length, usehref.length - 1);
        somExpression = usehref.slice("#som(".length, -1);
      } else if (usehref.startsWith(".#som(") && usehref.endsWith(")")) {
        somExpression = usehref.slice(".#som(".length, usehref.length - 1);
        somExpression = usehref.slice(".#som(".length, -1);
      } else if (usehref.startsWith("#")) {
        id = usehref.slice(1);
      } else if (usehref.startsWith(".#")) {
@@ -41680,7 +41694,7 @@ const dimConverters = {
const measurementPattern = /([+-]?\d+\.?\d*)(.*)/;
function stripQuotes(str) {
  if (str.startsWith("'") || str.startsWith('"')) {
    return str.slice(1, str.length - 1);
    return str.slice(1, -1);
  }
  return str;
}
@@ -46848,7 +46862,7 @@ class Text extends _xfa_object.ContentObject {
  }
  [_xfa_object.$finalize]() {
    if (typeof this[_xfa_object.$content] === "string") {
      this[_xfa_object.$content] = this[_xfa_object.$content].replace(/\r\n/g, "\n");
      this[_xfa_object.$content] = this[_xfa_object.$content].replaceAll("\r\n", "\n");
    }
  }
  [_xfa_object.$getExtra]() {
@@ -48454,7 +48468,7 @@ class FontFinder {
      return font;
    }
    const pattern = /,|-|_| |bolditalic|bold|italic|regular|it/gi;
    let name = fontName.replace(pattern, "");
    let name = fontName.replaceAll(pattern, "");
    font = this.fonts.get(name);
    if (font) {
      this.cache.set(fontName, font);
@@ -48463,28 +48477,28 @@ class FontFinder {
    name = name.toLowerCase();
    const maybe = [];
    for (const [family, pdfFont] of this.fonts.entries()) {
      if (family.replace(pattern, "").toLowerCase().startsWith(name)) {
      if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
        maybe.push(pdfFont);
      }
    }
    if (maybe.length === 0) {
      for (const [, pdfFont] of this.fonts.entries()) {
        if (pdfFont.regular.name && pdfFont.regular.name.replace(pattern, "").toLowerCase().startsWith(name)) {
        if (pdfFont.regular.name && pdfFont.regular.name.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
          maybe.push(pdfFont);
        }
      }
    }
    if (maybe.length === 0) {
      name = name.replace(/psmt|mt/gi, "");
      name = name.replaceAll(/psmt|mt/gi, "");
      for (const [family, pdfFont] of this.fonts.entries()) {
        if (family.replace(pattern, "").toLowerCase().startsWith(name)) {
        if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
          maybe.push(pdfFont);
        }
      }
    }
    if (maybe.length === 0) {
      for (const pdfFont of this.fonts.values()) {
        if (pdfFont.regular.name && pdfFont.regular.name.replace(pattern, "").toLowerCase().startsWith(name)) {
        if (pdfFont.regular.name && pdfFont.regular.name.replaceAll(pattern, "").toLowerCase().startsWith(name)) {
          maybe.push(pdfFont);
        }
      }
@@ -51294,9 +51308,9 @@ class XhtmlObject extends _xfa_object.XmlObject {
  }
  [_xfa_object.$onText](str, richText = false) {
    if (!richText) {
      str = str.replace(crlfRegExp, "");
      str = str.replaceAll(crlfRegExp, "");
      if (!this.style.includes("xfa-spacerun:yes")) {
        str = str.replace(spacesRegExp, " ");
        str = str.replaceAll(spacesRegExp, " ");
      }
    } else {
      this[$richText] = true;
@@ -51398,7 +51412,7 @@ class XhtmlObject extends _xfa_object.XmlObject {
    }
    let value;
    if (this[$richText]) {
      value = this[_xfa_object.$content] ? this[_xfa_object.$content].replace(crlfForRichTextRegExp, "\n") : undefined;
      value = this[_xfa_object.$content] ? this[_xfa_object.$content].replaceAll(crlfForRichTextRegExp, "\n") : undefined;
    } else {
      value = this[_xfa_object.$content] || undefined;
    }
@@ -51719,7 +51733,7 @@ class XRef {
    this.stream = stream;
    this.pdfManager = pdfManager;
    this.entries = [];
    this.xrefstms = Object.create(null);
    this._xrefStms = new Set();
    this._cacheMap = new Map();
    this._pendingRefs = new _primitives.RefSet();
    this._newPersistentRefNum = null;
@@ -52088,7 +52102,7 @@ class XRef {
        const xrefTagOffset = skipUntil(content, 0, xrefBytes);
        if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) {
          xrefStms.push(position - stream.start);
          this.xrefstms[position - stream.start] = 1;
          this._xrefStms.add(position - stream.start);
        }
        position += contentLength;
      } else if (token.startsWith("trailer") && (token.length === 7 || /\s/.test(token[7]))) {
@@ -52205,12 +52219,9 @@ class XRef {
            this.topDict = dict;
          }
          obj = dict.get("XRefStm");
          if (Number.isInteger(obj)) {
            const pos = obj;
            if (!(pos in this.xrefstms)) {
              this.xrefstms[pos] = 1;
              this.startXRefQueue.push(pos);
            }
          if (Number.isInteger(obj) && !this._xrefStms.has(obj)) {
            this._xrefStms.add(obj);
            this.startXRefQueue.push(obj);
          }
        } else if (Number.isInteger(obj)) {
          if (!Number.isInteger(parser.getObj()) || !(0, _primitives.isCmd)(parser.getObj(), "obj") || !((obj = parser.getObj()) instanceof _base_stream.BaseStream)) {
@@ -52248,6 +52259,9 @@ class XRef {
    }
    throw new _core_utils.XRefParseException();
  }
  get lastXRefStreamPos() {
    return this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null;
  }
  getEntry(i) {
    const xrefEntry = this.entries[i];
    if (xrefEntry && !xrefEntry.free && xrefEntry.offset) {
@@ -53015,8 +53029,8 @@ Object.defineProperty(exports, "WorkerMessageHandler", ({
  }
}));
var _worker = __w_pdfjs_require__(1);
const pdfjsVersion = '3.5.80';
const pdfjsBuild = 'b1e0253f2';
const pdfjsVersion = '3.6.9';
const pdfjsBuild = '184076fe7';
})();
/******/ 	return __webpack_exports__;
+1 −4
Original line number Diff line number Diff line
@@ -36,12 +36,9 @@
  padding: 3px;
}
#PDFBug .panels {
  bottom: 0;
  left: 0;
  inset: 27px 0 0;
  overflow: auto;
  position: absolute;
  right: 0;
  top: 27px;
}
#PDFBug .panels > div {
  padding: 5px;
+8 −20
Original line number Diff line number Diff line
@@ -28,10 +28,7 @@
.textLayer {
  position: absolute;
  text-align: initial;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  inset: 0;
  overflow: hidden;
  opacity: 0.25;
  line-height: 1;
@@ -96,10 +93,7 @@
.textLayer .endOfContent {
  display: block;
  position: absolute;
  left: 0;
  top: 100%;
  right: 0;
  bottom: 0;
  inset: 100% 0 0;
  z-index: -1;
  cursor: default;
  user-select: none;
@@ -829,6 +823,10 @@
  cursor: var(--editorInk-editing-cursor);
}

.annotationEditorLayer :is(.freeTextEditor, .inkEditor)[draggable="true"] {
  cursor: move;
}

.annotationEditorLayer .selectedEditor {
  outline: var(--focus-outline);
  resize: none;
@@ -1147,26 +1145,16 @@ body {

#mainContainer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  min-width: 350px;
}

#viewerContainer {
  overflow: auto;
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  inset: 0;
  outline: none;
}
#viewerContainer {
  transition-duration: var(--sidebar-transition-duration);
  transition-timing-function: var(--sidebar-transition-timing-function);
}

.dialogButton {
  border: none;
Loading