Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/wp-conte.../plugins/embedpre.../assets/pdf/build
File: script.js
constructor(stream, start, end) {
[15000] Fix | Delete
super(stream);
[15001] Fix | Delete
let path = decodeURIComponent(this._url.path);
[15002] Fix | Delete
if (fileUriRegex.test(this._url.href)) {
[15003] Fix | Delete
path = path.replace(/^\//, "");
[15004] Fix | Delete
}
[15005] Fix | Delete
const fs = NodePackages.get("fs");
[15006] Fix | Delete
this._setReadableStream(fs.createReadStream(path, {
[15007] Fix | Delete
start,
[15008] Fix | Delete
end: end - 1
[15009] Fix | Delete
}));
[15010] Fix | Delete
}
[15011] Fix | Delete
}
[15012] Fix | Delete
[15013] Fix | Delete
;// CONCATENATED MODULE: ./src/display/text_layer.js
[15014] Fix | Delete
[15015] Fix | Delete
[15016] Fix | Delete
[15017] Fix | Delete
[15018] Fix | Delete
[15019] Fix | Delete
[15020] Fix | Delete
[15021] Fix | Delete
[15022] Fix | Delete
[15023] Fix | Delete
[15024] Fix | Delete
[15025] Fix | Delete
const MAX_TEXT_DIVS_TO_RENDER = 100000;
[15026] Fix | Delete
const DEFAULT_FONT_SIZE = 30;
[15027] Fix | Delete
const DEFAULT_FONT_ASCENT = 0.8;
[15028] Fix | Delete
class TextLayer {
[15029] Fix | Delete
#capability = Promise.withResolvers();
[15030] Fix | Delete
#container = null;
[15031] Fix | Delete
#disableProcessItems = false;
[15032] Fix | Delete
#fontInspectorEnabled = !!globalThis.FontInspector?.enabled;
[15033] Fix | Delete
#lang = null;
[15034] Fix | Delete
#layoutTextParams = null;
[15035] Fix | Delete
#pageHeight = 0;
[15036] Fix | Delete
#pageWidth = 0;
[15037] Fix | Delete
#reader = null;
[15038] Fix | Delete
#rootContainer = null;
[15039] Fix | Delete
#rotation = 0;
[15040] Fix | Delete
#scale = 0;
[15041] Fix | Delete
#styleCache = Object.create(null);
[15042] Fix | Delete
#textContentItemsStr = [];
[15043] Fix | Delete
#textContentSource = null;
[15044] Fix | Delete
#textDivs = [];
[15045] Fix | Delete
#textDivProperties = new WeakMap();
[15046] Fix | Delete
#transform = null;
[15047] Fix | Delete
static #ascentCache = new Map();
[15048] Fix | Delete
static #canvasContexts = new Map();
[15049] Fix | Delete
static #pendingTextLayers = new Set();
[15050] Fix | Delete
constructor({
[15051] Fix | Delete
textContentSource,
[15052] Fix | Delete
container,
[15053] Fix | Delete
viewport
[15054] Fix | Delete
}) {
[15055] Fix | Delete
if (textContentSource instanceof ReadableStream) {
[15056] Fix | Delete
this.#textContentSource = textContentSource;
[15057] Fix | Delete
} else if (typeof textContentSource === "object") {
[15058] Fix | Delete
this.#textContentSource = new ReadableStream({
[15059] Fix | Delete
start(controller) {
[15060] Fix | Delete
controller.enqueue(textContentSource);
[15061] Fix | Delete
controller.close();
[15062] Fix | Delete
}
[15063] Fix | Delete
});
[15064] Fix | Delete
} else {
[15065] Fix | Delete
throw new Error('No "textContentSource" parameter specified.');
[15066] Fix | Delete
}
[15067] Fix | Delete
this.#container = this.#rootContainer = container;
[15068] Fix | Delete
this.#scale = viewport.scale * (globalThis.devicePixelRatio || 1);
[15069] Fix | Delete
this.#rotation = viewport.rotation;
[15070] Fix | Delete
this.#layoutTextParams = {
[15071] Fix | Delete
prevFontSize: null,
[15072] Fix | Delete
prevFontFamily: null,
[15073] Fix | Delete
div: null,
[15074] Fix | Delete
properties: null,
[15075] Fix | Delete
ctx: null
[15076] Fix | Delete
};
[15077] Fix | Delete
const {
[15078] Fix | Delete
pageWidth,
[15079] Fix | Delete
pageHeight,
[15080] Fix | Delete
pageX,
[15081] Fix | Delete
pageY
[15082] Fix | Delete
} = viewport.rawDims;
[15083] Fix | Delete
this.#transform = [1, 0, 0, -1, -pageX, pageY + pageHeight];
[15084] Fix | Delete
this.#pageWidth = pageWidth;
[15085] Fix | Delete
this.#pageHeight = pageHeight;
[15086] Fix | Delete
setLayerDimensions(container, viewport);
[15087] Fix | Delete
this.#capability.promise.catch(() => {}).then(() => {
[15088] Fix | Delete
TextLayer.#pendingTextLayers.delete(this);
[15089] Fix | Delete
this.#layoutTextParams = null;
[15090] Fix | Delete
this.#styleCache = null;
[15091] Fix | Delete
});
[15092] Fix | Delete
}
[15093] Fix | Delete
render() {
[15094] Fix | Delete
const pump = () => {
[15095] Fix | Delete
this.#reader.read().then(({
[15096] Fix | Delete
value,
[15097] Fix | Delete
done
[15098] Fix | Delete
}) => {
[15099] Fix | Delete
if (done) {
[15100] Fix | Delete
this.#capability.resolve();
[15101] Fix | Delete
return;
[15102] Fix | Delete
}
[15103] Fix | Delete
this.#lang ??= value.lang;
[15104] Fix | Delete
Object.assign(this.#styleCache, value.styles);
[15105] Fix | Delete
this.#processItems(value.items);
[15106] Fix | Delete
pump();
[15107] Fix | Delete
}, this.#capability.reject);
[15108] Fix | Delete
};
[15109] Fix | Delete
this.#reader = this.#textContentSource.getReader();
[15110] Fix | Delete
TextLayer.#pendingTextLayers.add(this);
[15111] Fix | Delete
pump();
[15112] Fix | Delete
return this.#capability.promise;
[15113] Fix | Delete
}
[15114] Fix | Delete
update({
[15115] Fix | Delete
viewport,
[15116] Fix | Delete
onBefore = null
[15117] Fix | Delete
}) {
[15118] Fix | Delete
const scale = viewport.scale * (globalThis.devicePixelRatio || 1);
[15119] Fix | Delete
const rotation = viewport.rotation;
[15120] Fix | Delete
if (rotation !== this.#rotation) {
[15121] Fix | Delete
onBefore?.();
[15122] Fix | Delete
this.#rotation = rotation;
[15123] Fix | Delete
setLayerDimensions(this.#rootContainer, {
[15124] Fix | Delete
rotation
[15125] Fix | Delete
});
[15126] Fix | Delete
}
[15127] Fix | Delete
if (scale !== this.#scale) {
[15128] Fix | Delete
onBefore?.();
[15129] Fix | Delete
this.#scale = scale;
[15130] Fix | Delete
const params = {
[15131] Fix | Delete
prevFontSize: null,
[15132] Fix | Delete
prevFontFamily: null,
[15133] Fix | Delete
div: null,
[15134] Fix | Delete
properties: null,
[15135] Fix | Delete
ctx: TextLayer.#getCtx(this.#lang)
[15136] Fix | Delete
};
[15137] Fix | Delete
for (const div of this.#textDivs) {
[15138] Fix | Delete
params.properties = this.#textDivProperties.get(div);
[15139] Fix | Delete
params.div = div;
[15140] Fix | Delete
this.#layout(params);
[15141] Fix | Delete
}
[15142] Fix | Delete
}
[15143] Fix | Delete
}
[15144] Fix | Delete
cancel() {
[15145] Fix | Delete
const abortEx = new AbortException("TextLayer task cancelled.");
[15146] Fix | Delete
this.#reader?.cancel(abortEx).catch(() => {});
[15147] Fix | Delete
this.#reader = null;
[15148] Fix | Delete
this.#capability.reject(abortEx);
[15149] Fix | Delete
}
[15150] Fix | Delete
get textDivs() {
[15151] Fix | Delete
return this.#textDivs;
[15152] Fix | Delete
}
[15153] Fix | Delete
get textContentItemsStr() {
[15154] Fix | Delete
return this.#textContentItemsStr;
[15155] Fix | Delete
}
[15156] Fix | Delete
#processItems(items) {
[15157] Fix | Delete
if (this.#disableProcessItems) {
[15158] Fix | Delete
return;
[15159] Fix | Delete
}
[15160] Fix | Delete
this.#layoutTextParams.ctx ||= TextLayer.#getCtx(this.#lang);
[15161] Fix | Delete
const textDivs = this.#textDivs,
[15162] Fix | Delete
textContentItemsStr = this.#textContentItemsStr;
[15163] Fix | Delete
for (const item of items) {
[15164] Fix | Delete
if (textDivs.length > MAX_TEXT_DIVS_TO_RENDER) {
[15165] Fix | Delete
warn("Ignoring additional textDivs for performance reasons.");
[15166] Fix | Delete
this.#disableProcessItems = true;
[15167] Fix | Delete
return;
[15168] Fix | Delete
}
[15169] Fix | Delete
if (item.str === undefined) {
[15170] Fix | Delete
if (item.type === "beginMarkedContentProps" || item.type === "beginMarkedContent") {
[15171] Fix | Delete
const parent = this.#container;
[15172] Fix | Delete
this.#container = document.createElement("span");
[15173] Fix | Delete
this.#container.classList.add("markedContent");
[15174] Fix | Delete
if (item.id !== null) {
[15175] Fix | Delete
this.#container.setAttribute("id", `${item.id}`);
[15176] Fix | Delete
}
[15177] Fix | Delete
parent.append(this.#container);
[15178] Fix | Delete
} else if (item.type === "endMarkedContent") {
[15179] Fix | Delete
this.#container = this.#container.parentNode;
[15180] Fix | Delete
}
[15181] Fix | Delete
continue;
[15182] Fix | Delete
}
[15183] Fix | Delete
textContentItemsStr.push(item.str);
[15184] Fix | Delete
this.#appendText(item);
[15185] Fix | Delete
}
[15186] Fix | Delete
}
[15187] Fix | Delete
#appendText(geom) {
[15188] Fix | Delete
const textDiv = document.createElement("span");
[15189] Fix | Delete
const textDivProperties = {
[15190] Fix | Delete
angle: 0,
[15191] Fix | Delete
canvasWidth: 0,
[15192] Fix | Delete
hasText: geom.str !== "",
[15193] Fix | Delete
hasEOL: geom.hasEOL,
[15194] Fix | Delete
fontSize: 0
[15195] Fix | Delete
};
[15196] Fix | Delete
this.#textDivs.push(textDiv);
[15197] Fix | Delete
const tx = Util.transform(this.#transform, geom.transform);
[15198] Fix | Delete
let angle = Math.atan2(tx[1], tx[0]);
[15199] Fix | Delete
const style = this.#styleCache[geom.fontName];
[15200] Fix | Delete
if (style.vertical) {
[15201] Fix | Delete
angle += Math.PI / 2;
[15202] Fix | Delete
}
[15203] Fix | Delete
const fontFamily = this.#fontInspectorEnabled && style.fontSubstitution || style.fontFamily;
[15204] Fix | Delete
const fontHeight = Math.hypot(tx[2], tx[3]);
[15205] Fix | Delete
const fontAscent = fontHeight * TextLayer.#getAscent(fontFamily, this.#lang);
[15206] Fix | Delete
let left, top;
[15207] Fix | Delete
if (angle === 0) {
[15208] Fix | Delete
left = tx[4];
[15209] Fix | Delete
top = tx[5] - fontAscent;
[15210] Fix | Delete
} else {
[15211] Fix | Delete
left = tx[4] + fontAscent * Math.sin(angle);
[15212] Fix | Delete
top = tx[5] - fontAscent * Math.cos(angle);
[15213] Fix | Delete
}
[15214] Fix | Delete
const scaleFactorStr = "calc(var(--scale-factor)*";
[15215] Fix | Delete
const divStyle = textDiv.style;
[15216] Fix | Delete
if (this.#container === this.#rootContainer) {
[15217] Fix | Delete
divStyle.left = `${(100 * left / this.#pageWidth).toFixed(2)}%`;
[15218] Fix | Delete
divStyle.top = `${(100 * top / this.#pageHeight).toFixed(2)}%`;
[15219] Fix | Delete
} else {
[15220] Fix | Delete
divStyle.left = `${scaleFactorStr}${left.toFixed(2)}px)`;
[15221] Fix | Delete
divStyle.top = `${scaleFactorStr}${top.toFixed(2)}px)`;
[15222] Fix | Delete
}
[15223] Fix | Delete
divStyle.fontSize = `${scaleFactorStr}${fontHeight.toFixed(2)}px)`;
[15224] Fix | Delete
divStyle.fontFamily = fontFamily;
[15225] Fix | Delete
textDivProperties.fontSize = fontHeight;
[15226] Fix | Delete
textDiv.setAttribute("role", "presentation");
[15227] Fix | Delete
textDiv.textContent = geom.str;
[15228] Fix | Delete
textDiv.dir = geom.dir;
[15229] Fix | Delete
if (this.#fontInspectorEnabled) {
[15230] Fix | Delete
textDiv.dataset.fontName = style.fontSubstitutionLoadedName || geom.fontName;
[15231] Fix | Delete
}
[15232] Fix | Delete
if (angle !== 0) {
[15233] Fix | Delete
textDivProperties.angle = angle * (180 / Math.PI);
[15234] Fix | Delete
}
[15235] Fix | Delete
let shouldScaleText = false;
[15236] Fix | Delete
if (geom.str.length > 1) {
[15237] Fix | Delete
shouldScaleText = true;
[15238] Fix | Delete
} else if (geom.str !== " " && geom.transform[0] !== geom.transform[3]) {
[15239] Fix | Delete
const absScaleX = Math.abs(geom.transform[0]),
[15240] Fix | Delete
absScaleY = Math.abs(geom.transform[3]);
[15241] Fix | Delete
if (absScaleX !== absScaleY && Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5) {
[15242] Fix | Delete
shouldScaleText = true;
[15243] Fix | Delete
}
[15244] Fix | Delete
}
[15245] Fix | Delete
if (shouldScaleText) {
[15246] Fix | Delete
textDivProperties.canvasWidth = style.vertical ? geom.height : geom.width;
[15247] Fix | Delete
}
[15248] Fix | Delete
this.#textDivProperties.set(textDiv, textDivProperties);
[15249] Fix | Delete
this.#layoutTextParams.div = textDiv;
[15250] Fix | Delete
this.#layoutTextParams.properties = textDivProperties;
[15251] Fix | Delete
this.#layout(this.#layoutTextParams);
[15252] Fix | Delete
if (textDivProperties.hasText) {
[15253] Fix | Delete
this.#container.append(textDiv);
[15254] Fix | Delete
}
[15255] Fix | Delete
if (textDivProperties.hasEOL) {
[15256] Fix | Delete
const br = document.createElement("br");
[15257] Fix | Delete
br.setAttribute("role", "presentation");
[15258] Fix | Delete
this.#container.append(br);
[15259] Fix | Delete
}
[15260] Fix | Delete
}
[15261] Fix | Delete
#layout(params) {
[15262] Fix | Delete
const {
[15263] Fix | Delete
div,
[15264] Fix | Delete
properties,
[15265] Fix | Delete
ctx,
[15266] Fix | Delete
prevFontSize,
[15267] Fix | Delete
prevFontFamily
[15268] Fix | Delete
} = params;
[15269] Fix | Delete
const {
[15270] Fix | Delete
style
[15271] Fix | Delete
} = div;
[15272] Fix | Delete
let transform = "";
[15273] Fix | Delete
if (properties.canvasWidth !== 0 && properties.hasText) {
[15274] Fix | Delete
const {
[15275] Fix | Delete
fontFamily
[15276] Fix | Delete
} = style;
[15277] Fix | Delete
const {
[15278] Fix | Delete
canvasWidth,
[15279] Fix | Delete
fontSize
[15280] Fix | Delete
} = properties;
[15281] Fix | Delete
if (prevFontSize !== fontSize || prevFontFamily !== fontFamily) {
[15282] Fix | Delete
ctx.font = `${fontSize * this.#scale}px ${fontFamily}`;
[15283] Fix | Delete
params.prevFontSize = fontSize;
[15284] Fix | Delete
params.prevFontFamily = fontFamily;
[15285] Fix | Delete
}
[15286] Fix | Delete
const {
[15287] Fix | Delete
width
[15288] Fix | Delete
} = ctx.measureText(div.textContent);
[15289] Fix | Delete
if (width > 0) {
[15290] Fix | Delete
transform = `scaleX(${canvasWidth * this.#scale / width})`;
[15291] Fix | Delete
}
[15292] Fix | Delete
}
[15293] Fix | Delete
if (properties.angle !== 0) {
[15294] Fix | Delete
transform = `rotate(${properties.angle}deg) ${transform}`;
[15295] Fix | Delete
}
[15296] Fix | Delete
if (transform.length > 0) {
[15297] Fix | Delete
style.transform = transform;
[15298] Fix | Delete
}
[15299] Fix | Delete
}
[15300] Fix | Delete
static cleanup() {
[15301] Fix | Delete
if (this.#pendingTextLayers.size > 0) {
[15302] Fix | Delete
return;
[15303] Fix | Delete
}
[15304] Fix | Delete
this.#ascentCache.clear();
[15305] Fix | Delete
for (const {
[15306] Fix | Delete
canvas
[15307] Fix | Delete
} of this.#canvasContexts.values()) {
[15308] Fix | Delete
canvas.remove();
[15309] Fix | Delete
}
[15310] Fix | Delete
this.#canvasContexts.clear();
[15311] Fix | Delete
}
[15312] Fix | Delete
static #getCtx(lang = null) {
[15313] Fix | Delete
let canvasContext = this.#canvasContexts.get(lang ||= "");
[15314] Fix | Delete
if (!canvasContext) {
[15315] Fix | Delete
const canvas = document.createElement("canvas");
[15316] Fix | Delete
canvas.className = "hiddenCanvasElement";
[15317] Fix | Delete
canvas.lang = lang;
[15318] Fix | Delete
document.body.append(canvas);
[15319] Fix | Delete
canvasContext = canvas.getContext("2d", {
[15320] Fix | Delete
alpha: false
[15321] Fix | Delete
});
[15322] Fix | Delete
this.#canvasContexts.set(lang, canvasContext);
[15323] Fix | Delete
}
[15324] Fix | Delete
return canvasContext;
[15325] Fix | Delete
}
[15326] Fix | Delete
static #getAscent(fontFamily, lang) {
[15327] Fix | Delete
const cachedAscent = this.#ascentCache.get(fontFamily);
[15328] Fix | Delete
if (cachedAscent) {
[15329] Fix | Delete
return cachedAscent;
[15330] Fix | Delete
}
[15331] Fix | Delete
const ctx = this.#getCtx(lang);
[15332] Fix | Delete
const savedFont = ctx.font;
[15333] Fix | Delete
ctx.canvas.width = ctx.canvas.height = DEFAULT_FONT_SIZE;
[15334] Fix | Delete
ctx.font = `${DEFAULT_FONT_SIZE}px ${fontFamily}`;
[15335] Fix | Delete
const metrics = ctx.measureText("");
[15336] Fix | Delete
let ascent = metrics.fontBoundingBoxAscent;
[15337] Fix | Delete
let descent = Math.abs(metrics.fontBoundingBoxDescent);
[15338] Fix | Delete
if (ascent) {
[15339] Fix | Delete
const ratio = ascent / (ascent + descent);
[15340] Fix | Delete
this.#ascentCache.set(fontFamily, ratio);
[15341] Fix | Delete
ctx.canvas.width = ctx.canvas.height = 0;
[15342] Fix | Delete
ctx.font = savedFont;
[15343] Fix | Delete
return ratio;
[15344] Fix | Delete
}
[15345] Fix | Delete
ctx.strokeStyle = "red";
[15346] Fix | Delete
ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);
[15347] Fix | Delete
ctx.strokeText("g", 0, 0);
[15348] Fix | Delete
let pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;
[15349] Fix | Delete
descent = 0;
[15350] Fix | Delete
for (let i = pixels.length - 1 - 3; i >= 0; i -= 4) {
[15351] Fix | Delete
if (pixels[i] > 0) {
[15352] Fix | Delete
descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE);
[15353] Fix | Delete
break;
[15354] Fix | Delete
}
[15355] Fix | Delete
}
[15356] Fix | Delete
ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);
[15357] Fix | Delete
ctx.strokeText("A", 0, DEFAULT_FONT_SIZE);
[15358] Fix | Delete
pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;
[15359] Fix | Delete
ascent = 0;
[15360] Fix | Delete
for (let i = 0, ii = pixels.length; i < ii; i += 4) {
[15361] Fix | Delete
if (pixels[i] > 0) {
[15362] Fix | Delete
ascent = DEFAULT_FONT_SIZE - Math.floor(i / 4 / DEFAULT_FONT_SIZE);
[15363] Fix | Delete
break;
[15364] Fix | Delete
}
[15365] Fix | Delete
}
[15366] Fix | Delete
ctx.canvas.width = ctx.canvas.height = 0;
[15367] Fix | Delete
ctx.font = savedFont;
[15368] Fix | Delete
const ratio = ascent ? ascent / (ascent + descent) : DEFAULT_FONT_ASCENT;
[15369] Fix | Delete
this.#ascentCache.set(fontFamily, ratio);
[15370] Fix | Delete
return ratio;
[15371] Fix | Delete
}
[15372] Fix | Delete
}
[15373] Fix | Delete
function renderTextLayer() {
[15374] Fix | Delete
deprecated("`renderTextLayer`, please use `TextLayer` instead.");
[15375] Fix | Delete
const {
[15376] Fix | Delete
textContentSource,
[15377] Fix | Delete
container,
[15378] Fix | Delete
viewport,
[15379] Fix | Delete
...rest
[15380] Fix | Delete
} = arguments[0];
[15381] Fix | Delete
const restKeys = Object.keys(rest);
[15382] Fix | Delete
if (restKeys.length > 0) {
[15383] Fix | Delete
warn("Ignoring `renderTextLayer` parameters: " + restKeys.join(", "));
[15384] Fix | Delete
}
[15385] Fix | Delete
const textLayer = new TextLayer({
[15386] Fix | Delete
textContentSource,
[15387] Fix | Delete
container,
[15388] Fix | Delete
viewport
[15389] Fix | Delete
});
[15390] Fix | Delete
const {
[15391] Fix | Delete
textDivs,
[15392] Fix | Delete
textContentItemsStr
[15393] Fix | Delete
} = textLayer;
[15394] Fix | Delete
const promise = textLayer.render();
[15395] Fix | Delete
return {
[15396] Fix | Delete
promise,
[15397] Fix | Delete
textDivs,
[15398] Fix | Delete
textContentItemsStr
[15399] Fix | Delete
};
[15400] Fix | Delete
}
[15401] Fix | Delete
function updateTextLayer() {
[15402] Fix | Delete
deprecated("`updateTextLayer`, please use `TextLayer` instead.");
[15403] Fix | Delete
}
[15404] Fix | Delete
[15405] Fix | Delete
;// CONCATENATED MODULE: ./src/display/xfa_text.js
[15406] Fix | Delete
[15407] Fix | Delete
class XfaText {
[15408] Fix | Delete
static textContent(xfa) {
[15409] Fix | Delete
const items = [];
[15410] Fix | Delete
const output = {
[15411] Fix | Delete
items,
[15412] Fix | Delete
styles: Object.create(null)
[15413] Fix | Delete
};
[15414] Fix | Delete
function walk(node) {
[15415] Fix | Delete
if (!node) {
[15416] Fix | Delete
return;
[15417] Fix | Delete
}
[15418] Fix | Delete
let str = null;
[15419] Fix | Delete
const name = node.name;
[15420] Fix | Delete
if (name === "#text") {
[15421] Fix | Delete
str = node.value;
[15422] Fix | Delete
} else if (!XfaText.shouldBuildText(name)) {
[15423] Fix | Delete
return;
[15424] Fix | Delete
} else if (node?.attributes?.textContent) {
[15425] Fix | Delete
str = node.attributes.textContent;
[15426] Fix | Delete
} else if (node.value) {
[15427] Fix | Delete
str = node.value;
[15428] Fix | Delete
}
[15429] Fix | Delete
if (str !== null) {
[15430] Fix | Delete
items.push({
[15431] Fix | Delete
str
[15432] Fix | Delete
});
[15433] Fix | Delete
}
[15434] Fix | Delete
if (!node.children) {
[15435] Fix | Delete
return;
[15436] Fix | Delete
}
[15437] Fix | Delete
for (const child of node.children) {
[15438] Fix | Delete
walk(child);
[15439] Fix | Delete
}
[15440] Fix | Delete
}
[15441] Fix | Delete
walk(xfa);
[15442] Fix | Delete
return output;
[15443] Fix | Delete
}
[15444] Fix | Delete
static shouldBuildText(name) {
[15445] Fix | Delete
return !(name === "textarea" || name === "input" || name === "option" || name === "select");
[15446] Fix | Delete
}
[15447] Fix | Delete
}
[15448] Fix | Delete
[15449] Fix | Delete
;// CONCATENATED MODULE: ./src/display/api.js
[15450] Fix | Delete
[15451] Fix | Delete
[15452] Fix | Delete
[15453] Fix | Delete
[15454] Fix | Delete
[15455] Fix | Delete
[15456] Fix | Delete
[15457] Fix | Delete
[15458] Fix | Delete
[15459] Fix | Delete
[15460] Fix | Delete
[15461] Fix | Delete
[15462] Fix | Delete
[15463] Fix | Delete
[15464] Fix | Delete
[15465] Fix | Delete
[15466] Fix | Delete
[15467] Fix | Delete
[15468] Fix | Delete
[15469] Fix | Delete
[15470] Fix | Delete
[15471] Fix | Delete
[15472] Fix | Delete
[15473] Fix | Delete
[15474] Fix | Delete
[15475] Fix | Delete
[15476] Fix | Delete
[15477] Fix | Delete
[15478] Fix | Delete
[15479] Fix | Delete
[15480] Fix | Delete
[15481] Fix | Delete
[15482] Fix | Delete
[15483] Fix | Delete
[15484] Fix | Delete
[15485] Fix | Delete
[15486] Fix | Delete
const DEFAULT_RANGE_CHUNK_SIZE = 65536;
[15487] Fix | Delete
const RENDERING_CANCELLED_TIMEOUT = 100;
[15488] Fix | Delete
const DELAYED_CLEANUP_TIMEOUT = 5000;
[15489] Fix | Delete
const DefaultCanvasFactory = isNodeJS ? NodeCanvasFactory : DOMCanvasFactory;
[15490] Fix | Delete
const DefaultCMapReaderFactory = isNodeJS ? NodeCMapReaderFactory : DOMCMapReaderFactory;
[15491] Fix | Delete
const DefaultFilterFactory = isNodeJS ? NodeFilterFactory : DOMFilterFactory;
[15492] Fix | Delete
const DefaultStandardFontDataFactory = isNodeJS ? NodeStandardFontDataFactory : DOMStandardFontDataFactory;
[15493] Fix | Delete
function getDocument(src) {
[15494] Fix | Delete
if (typeof src === "string" || src instanceof URL) {
[15495] Fix | Delete
src = {
[15496] Fix | Delete
url: src
[15497] Fix | Delete
};
[15498] Fix | Delete
} else if (src instanceof ArrayBuffer || ArrayBuffer.isView(src)) {
[15499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function