@poe-platform/safe-bash 0.1.774 → 0.1.776
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/image-ast/index.browser.js +12 -12
- package/dist/image-ast/index.js +12 -12
- package/dist/pdf-ast/index.js +12 -12
- package/dist/safe-bash/command-chunks/{chunk-PM63UJE6.js → chunk-3444RZLY.js} +12 -12
- package/dist/safe-bash/command-chunks/{chunk-HH5QPKIN.js → chunk-QLYJUVVM.js} +1 -1
- package/dist/safe-bash/command-chunks/{chunk-4ZHDCMQX.js → chunk-ZY6PMCW5.js} +2 -2
- package/dist/safe-bash/core.browser.js +1 -10
- package/dist/safe-bash/shell/runtime.js +3 -12
- package/dist/safe-bash-command-ffmpeg/index.js +826 -820
- package/dist/safe-bash-command-git/git_rust.wasm +0 -0
- package/dist/safe-bash-command-git/wasm.generated.js +1 -1
- package/dist/safe-bash-command-imagemagick/index.js +2 -2
- package/dist/safe-bash-command-pandoc/command.js +3 -3
- package/dist/safe-bash-command-pandoc/index.js +3 -3
- package/dist/safe-bash-command-pdfimages/index.js +12 -12
- package/dist/safe-bash-command-pdfinfo/index.js +12 -12
- package/dist/safe-bash-command-pdftk/index.js +12 -12
- package/dist/safe-bash-command-pdftoppm/index.js +12 -12
- package/dist/safe-bash-command-pdftotext/index.js +12 -12
- package/dist/safe-bash-command-qpdf/index.js +12 -12
- package/dist/safe-bash-command-sips/index.js +2 -2
- package/dist/safe-bash-command-soffice/index.js +1 -1
- package/dist/safe-bash-command-ssconvert/index.js +12 -12
- package/dist/safe-bash-command-wkhtmltopdf/index.js +12 -12
- package/package.json +2 -2
- package/third-party/pdf-ast/THIRD_PARTY_NOTICES.md +7 -0
|
@@ -45697,21 +45697,23 @@ function resolvePageFonts(doc, resourcesDict) {
|
|
|
45697
45697
|
}
|
|
45698
45698
|
}
|
|
45699
45699
|
} else {
|
|
45700
|
-
const stdName = normalizeStandard14FontName(baseFont);
|
|
45701
|
-
const stdMetrics = STANDARD_14_FONTS[stdName];
|
|
45702
|
-
defaultWidth = stdMetrics.defaultWidth;
|
|
45703
|
-
for (const [codeStr, wVal] of Object.entries(stdMetrics.widthsByCode)) {
|
|
45704
|
-
widths.set(Number(codeStr), wVal);
|
|
45705
|
-
}
|
|
45706
45700
|
const firstCharNode = doc.resolve(dictGet(fObj, "FirstChar"));
|
|
45707
45701
|
const widthsArr = doc.resolveArray(dictGet(fObj, "Widths"));
|
|
45708
|
-
if (
|
|
45702
|
+
if (widthsArr) {
|
|
45703
|
+
const descriptor = doc.resolveDict(dictGet(fObj, "FontDescriptor"));
|
|
45704
|
+
const missingWidth = descriptor ? doc.resolve(dictGet(descriptor, "MissingWidth")) : void 0;
|
|
45705
|
+
defaultWidth = (missingWidth?.kind === "number" ? missingWidth.value : 0) * type3Scale1000;
|
|
45706
|
+
const firstChar = firstCharNode?.kind === "number" ? firstCharNode.value : 0;
|
|
45709
45707
|
for (let k = 0; k < widthsArr.items.length; k++) {
|
|
45710
45708
|
const wItem = doc.resolve(widthsArr.items[k]);
|
|
45711
45709
|
if (wItem?.kind === "number") {
|
|
45712
|
-
widths.set(
|
|
45710
|
+
widths.set(firstChar + k, wItem.value * type3Scale1000);
|
|
45713
45711
|
}
|
|
45714
45712
|
}
|
|
45713
|
+
} else {
|
|
45714
|
+
const stdMetrics = STANDARD_14_FONTS[normalizeStandard14FontName(baseFont)];
|
|
45715
|
+
defaultWidth = stdMetrics.defaultWidth;
|
|
45716
|
+
for (const [codeStr, wVal] of Object.entries(stdMetrics.widthsByCode)) widths.set(Number(codeStr), wVal);
|
|
45715
45717
|
}
|
|
45716
45718
|
}
|
|
45717
45719
|
let embeddedCff;
|
|
@@ -46467,13 +46469,11 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
46467
46469
|
}
|
|
46468
46470
|
if (font?.cmap) {
|
|
46469
46471
|
if (!font.isTwoByteCid) {
|
|
46470
|
-
const stdName2 = normalizeStandard14FontName(font.baseFont);
|
|
46471
|
-
const stdMetrics2 = STANDARD_14_FONTS[stdName2];
|
|
46472
46472
|
const out2 = [];
|
|
46473
46473
|
for (let i = 0; i < bytes.length; i++) {
|
|
46474
46474
|
const code = bytes[i];
|
|
46475
46475
|
const unicode = font.cmap.map.get(code) ?? (font.differences.has(code) ? font.differences.get(code) : decodeWinAnsiByte(code));
|
|
46476
|
-
const advance1000 = font.widths.get(code) ??
|
|
46476
|
+
const advance1000 = font.widths.get(code) ?? font.defaultWidth;
|
|
46477
46477
|
out2.push({ charCode: code, isSpace: code === 32, unicode, advance1000 });
|
|
46478
46478
|
}
|
|
46479
46479
|
return out2;
|
|
@@ -46505,7 +46505,7 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
46505
46505
|
for (let i = 0; i < bytes.length; i++) {
|
|
46506
46506
|
const code = bytes[i];
|
|
46507
46507
|
const unicode = font?.differences.get(code) ?? decodeWinAnsiByte(code);
|
|
46508
|
-
const advance1000 = font
|
|
46508
|
+
const advance1000 = font ? font.widths.get(code) ?? font.defaultWidth : stdMetrics.widthsByCode[code] ?? stdMetrics.defaultWidth;
|
|
46509
46509
|
out.push({ charCode: code, isSpace: code === 32, unicode, advance1000 });
|
|
46510
46510
|
}
|
|
46511
46511
|
return out;
|
package/dist/image-ast/index.js
CHANGED
|
@@ -45697,21 +45697,23 @@ function resolvePageFonts(doc, resourcesDict) {
|
|
|
45697
45697
|
}
|
|
45698
45698
|
}
|
|
45699
45699
|
} else {
|
|
45700
|
-
const stdName = normalizeStandard14FontName(baseFont);
|
|
45701
|
-
const stdMetrics = STANDARD_14_FONTS[stdName];
|
|
45702
|
-
defaultWidth = stdMetrics.defaultWidth;
|
|
45703
|
-
for (const [codeStr, wVal] of Object.entries(stdMetrics.widthsByCode)) {
|
|
45704
|
-
widths.set(Number(codeStr), wVal);
|
|
45705
|
-
}
|
|
45706
45700
|
const firstCharNode = doc.resolve(dictGet(fObj, "FirstChar"));
|
|
45707
45701
|
const widthsArr = doc.resolveArray(dictGet(fObj, "Widths"));
|
|
45708
|
-
if (
|
|
45702
|
+
if (widthsArr) {
|
|
45703
|
+
const descriptor = doc.resolveDict(dictGet(fObj, "FontDescriptor"));
|
|
45704
|
+
const missingWidth = descriptor ? doc.resolve(dictGet(descriptor, "MissingWidth")) : void 0;
|
|
45705
|
+
defaultWidth = (missingWidth?.kind === "number" ? missingWidth.value : 0) * type3Scale1000;
|
|
45706
|
+
const firstChar = firstCharNode?.kind === "number" ? firstCharNode.value : 0;
|
|
45709
45707
|
for (let k = 0; k < widthsArr.items.length; k++) {
|
|
45710
45708
|
const wItem = doc.resolve(widthsArr.items[k]);
|
|
45711
45709
|
if (wItem?.kind === "number") {
|
|
45712
|
-
widths.set(
|
|
45710
|
+
widths.set(firstChar + k, wItem.value * type3Scale1000);
|
|
45713
45711
|
}
|
|
45714
45712
|
}
|
|
45713
|
+
} else {
|
|
45714
|
+
const stdMetrics = STANDARD_14_FONTS[normalizeStandard14FontName(baseFont)];
|
|
45715
|
+
defaultWidth = stdMetrics.defaultWidth;
|
|
45716
|
+
for (const [codeStr, wVal] of Object.entries(stdMetrics.widthsByCode)) widths.set(Number(codeStr), wVal);
|
|
45715
45717
|
}
|
|
45716
45718
|
}
|
|
45717
45719
|
let embeddedCff;
|
|
@@ -46467,13 +46469,11 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
46467
46469
|
}
|
|
46468
46470
|
if (font?.cmap) {
|
|
46469
46471
|
if (!font.isTwoByteCid) {
|
|
46470
|
-
const stdName2 = normalizeStandard14FontName(font.baseFont);
|
|
46471
|
-
const stdMetrics2 = STANDARD_14_FONTS[stdName2];
|
|
46472
46472
|
const out2 = [];
|
|
46473
46473
|
for (let i = 0; i < bytes.length; i++) {
|
|
46474
46474
|
const code = bytes[i];
|
|
46475
46475
|
const unicode = font.cmap.map.get(code) ?? (font.differences.has(code) ? font.differences.get(code) : decodeWinAnsiByte(code));
|
|
46476
|
-
const advance1000 = font.widths.get(code) ??
|
|
46476
|
+
const advance1000 = font.widths.get(code) ?? font.defaultWidth;
|
|
46477
46477
|
out2.push({ charCode: code, isSpace: code === 32, unicode, advance1000 });
|
|
46478
46478
|
}
|
|
46479
46479
|
return out2;
|
|
@@ -46505,7 +46505,7 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
46505
46505
|
for (let i = 0; i < bytes.length; i++) {
|
|
46506
46506
|
const code = bytes[i];
|
|
46507
46507
|
const unicode = font?.differences.get(code) ?? decodeWinAnsiByte(code);
|
|
46508
|
-
const advance1000 = font
|
|
46508
|
+
const advance1000 = font ? font.widths.get(code) ?? font.defaultWidth : stdMetrics.widthsByCode[code] ?? stdMetrics.defaultWidth;
|
|
46509
46509
|
out.push({ charCode: code, isSpace: code === 32, unicode, advance1000 });
|
|
46510
46510
|
}
|
|
46511
46511
|
return out;
|
package/dist/pdf-ast/index.js
CHANGED
|
@@ -38413,21 +38413,23 @@ function resolvePageFonts(doc, resourcesDict) {
|
|
|
38413
38413
|
}
|
|
38414
38414
|
}
|
|
38415
38415
|
} else {
|
|
38416
|
-
const stdName = normalizeStandard14FontName(baseFont);
|
|
38417
|
-
const stdMetrics = STANDARD_14_FONTS[stdName];
|
|
38418
|
-
defaultWidth = stdMetrics.defaultWidth;
|
|
38419
|
-
for (const [codeStr, wVal] of Object.entries(stdMetrics.widthsByCode)) {
|
|
38420
|
-
widths.set(Number(codeStr), wVal);
|
|
38421
|
-
}
|
|
38422
38416
|
const firstCharNode = doc.resolve(dictGet(fObj, "FirstChar"));
|
|
38423
38417
|
const widthsArr = doc.resolveArray(dictGet(fObj, "Widths"));
|
|
38424
|
-
if (
|
|
38418
|
+
if (widthsArr) {
|
|
38419
|
+
const descriptor = doc.resolveDict(dictGet(fObj, "FontDescriptor"));
|
|
38420
|
+
const missingWidth = descriptor ? doc.resolve(dictGet(descriptor, "MissingWidth")) : void 0;
|
|
38421
|
+
defaultWidth = (missingWidth?.kind === "number" ? missingWidth.value : 0) * type3Scale1000;
|
|
38422
|
+
const firstChar = firstCharNode?.kind === "number" ? firstCharNode.value : 0;
|
|
38425
38423
|
for (let k = 0; k < widthsArr.items.length; k++) {
|
|
38426
38424
|
const wItem = doc.resolve(widthsArr.items[k]);
|
|
38427
38425
|
if (wItem?.kind === "number") {
|
|
38428
|
-
widths.set(
|
|
38426
|
+
widths.set(firstChar + k, wItem.value * type3Scale1000);
|
|
38429
38427
|
}
|
|
38430
38428
|
}
|
|
38429
|
+
} else {
|
|
38430
|
+
const stdMetrics = STANDARD_14_FONTS[normalizeStandard14FontName(baseFont)];
|
|
38431
|
+
defaultWidth = stdMetrics.defaultWidth;
|
|
38432
|
+
for (const [codeStr, wVal] of Object.entries(stdMetrics.widthsByCode)) widths.set(Number(codeStr), wVal);
|
|
38431
38433
|
}
|
|
38432
38434
|
}
|
|
38433
38435
|
let embeddedCff;
|
|
@@ -39183,13 +39185,11 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
39183
39185
|
}
|
|
39184
39186
|
if (font?.cmap) {
|
|
39185
39187
|
if (!font.isTwoByteCid) {
|
|
39186
|
-
const stdName2 = normalizeStandard14FontName(font.baseFont);
|
|
39187
|
-
const stdMetrics2 = STANDARD_14_FONTS[stdName2];
|
|
39188
39188
|
const out2 = [];
|
|
39189
39189
|
for (let i = 0; i < bytes.length; i++) {
|
|
39190
39190
|
const code = bytes[i];
|
|
39191
39191
|
const unicode = font.cmap.map.get(code) ?? (font.differences.has(code) ? font.differences.get(code) : decodeWinAnsiByte(code));
|
|
39192
|
-
const advance1000 = font.widths.get(code) ??
|
|
39192
|
+
const advance1000 = font.widths.get(code) ?? font.defaultWidth;
|
|
39193
39193
|
out2.push({ charCode: code, isSpace: code === 32, unicode, advance1000 });
|
|
39194
39194
|
}
|
|
39195
39195
|
return out2;
|
|
@@ -39221,7 +39221,7 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
39221
39221
|
for (let i = 0; i < bytes.length; i++) {
|
|
39222
39222
|
const code = bytes[i];
|
|
39223
39223
|
const unicode = font?.differences.get(code) ?? decodeWinAnsiByte(code);
|
|
39224
|
-
const advance1000 = font
|
|
39224
|
+
const advance1000 = font ? font.widths.get(code) ?? font.defaultWidth : stdMetrics.widthsByCode[code] ?? stdMetrics.defaultWidth;
|
|
39225
39225
|
out.push({ charCode: code, isSpace: code === 32, unicode, advance1000 });
|
|
39226
39226
|
}
|
|
39227
39227
|
return out;
|
|
@@ -34209,21 +34209,23 @@ function resolvePageFonts(doc, resourcesDict) {
|
|
|
34209
34209
|
}
|
|
34210
34210
|
}
|
|
34211
34211
|
} else {
|
|
34212
|
-
const stdName = normalizeStandard14FontName(baseFont);
|
|
34213
|
-
const stdMetrics = STANDARD_14_FONTS[stdName];
|
|
34214
|
-
defaultWidth = stdMetrics.defaultWidth;
|
|
34215
|
-
for (const [codeStr, wVal] of Object.entries(stdMetrics.widthsByCode)) {
|
|
34216
|
-
widths.set(Number(codeStr), wVal);
|
|
34217
|
-
}
|
|
34218
34212
|
const firstCharNode = doc.resolve(dictGet(fObj, "FirstChar"));
|
|
34219
34213
|
const widthsArr = doc.resolveArray(dictGet(fObj, "Widths"));
|
|
34220
|
-
if (
|
|
34214
|
+
if (widthsArr) {
|
|
34215
|
+
const descriptor = doc.resolveDict(dictGet(fObj, "FontDescriptor"));
|
|
34216
|
+
const missingWidth = descriptor ? doc.resolve(dictGet(descriptor, "MissingWidth")) : void 0;
|
|
34217
|
+
defaultWidth = (missingWidth?.kind === "number" ? missingWidth.value : 0) * type3Scale1000;
|
|
34218
|
+
const firstChar = firstCharNode?.kind === "number" ? firstCharNode.value : 0;
|
|
34221
34219
|
for (let k = 0; k < widthsArr.items.length; k++) {
|
|
34222
34220
|
const wItem = doc.resolve(widthsArr.items[k]);
|
|
34223
34221
|
if (wItem?.kind === "number") {
|
|
34224
|
-
widths.set(
|
|
34222
|
+
widths.set(firstChar + k, wItem.value * type3Scale1000);
|
|
34225
34223
|
}
|
|
34226
34224
|
}
|
|
34225
|
+
} else {
|
|
34226
|
+
const stdMetrics = STANDARD_14_FONTS[normalizeStandard14FontName(baseFont)];
|
|
34227
|
+
defaultWidth = stdMetrics.defaultWidth;
|
|
34228
|
+
for (const [codeStr, wVal] of Object.entries(stdMetrics.widthsByCode)) widths.set(Number(codeStr), wVal);
|
|
34227
34229
|
}
|
|
34228
34230
|
}
|
|
34229
34231
|
let embeddedCff;
|
|
@@ -34979,13 +34981,11 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
34979
34981
|
}
|
|
34980
34982
|
if (font?.cmap) {
|
|
34981
34983
|
if (!font.isTwoByteCid) {
|
|
34982
|
-
const stdName2 = normalizeStandard14FontName(font.baseFont);
|
|
34983
|
-
const stdMetrics2 = STANDARD_14_FONTS[stdName2];
|
|
34984
34984
|
const out2 = [];
|
|
34985
34985
|
for (let i = 0; i < bytes.length; i++) {
|
|
34986
34986
|
const code = bytes[i];
|
|
34987
34987
|
const unicode = font.cmap.map.get(code) ?? (font.differences.has(code) ? font.differences.get(code) : decodeWinAnsiByte(code));
|
|
34988
|
-
const advance1000 = font.widths.get(code) ??
|
|
34988
|
+
const advance1000 = font.widths.get(code) ?? font.defaultWidth;
|
|
34989
34989
|
out2.push({ charCode: code, isSpace: code === 32, unicode, advance1000 });
|
|
34990
34990
|
}
|
|
34991
34991
|
return out2;
|
|
@@ -35017,7 +35017,7 @@ function evaluateContentStreamToDisplayList(params) {
|
|
|
35017
35017
|
for (let i = 0; i < bytes.length; i++) {
|
|
35018
35018
|
const code = bytes[i];
|
|
35019
35019
|
const unicode = font?.differences.get(code) ?? decodeWinAnsiByte(code);
|
|
35020
|
-
const advance1000 = font
|
|
35020
|
+
const advance1000 = font ? font.widths.get(code) ?? font.defaultWidth : stdMetrics.widthsByCode[code] ?? stdMetrics.defaultWidth;
|
|
35021
35021
|
out.push({ charCode: code, isSpace: code === 32, unicode, advance1000 });
|
|
35022
35022
|
}
|
|
35023
35023
|
return out;
|
|
@@ -48,11 +48,11 @@ import {
|
|
|
48
48
|
trimImage,
|
|
49
49
|
unflattenImage,
|
|
50
50
|
unpremultiplyRgbaImage
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-QLYJUVVM.js";
|
|
52
52
|
import {
|
|
53
53
|
PdfDocument,
|
|
54
54
|
encodePng
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-3444RZLY.js";
|
|
56
56
|
import {
|
|
57
57
|
createLuaFilterCapability
|
|
58
58
|
} from "./chunk-Y2KHC6TZ.js";
|
|
@@ -85539,15 +85539,6 @@ ${prefix2} line ${offset + line}: \`${source.split("\n")[line - 1] ?? ""}'
|
|
|
85539
85539
|
let hasFileOperand = false;
|
|
85540
85540
|
const parseSecSpec = (v) => {
|
|
85541
85541
|
if (v === "a" || v === "t" || v === "n") return { style: v };
|
|
85542
|
-
if (v.startsWith("p") && v.length > 1) {
|
|
85543
|
-
const source = syncPosixRegexSource(v.slice(1));
|
|
85544
|
-
if (source === void 0) return void 0;
|
|
85545
|
-
try {
|
|
85546
|
-
return { style: "p", re: new RegExp(source) };
|
|
85547
|
-
} catch {
|
|
85548
|
-
return void 0;
|
|
85549
|
-
}
|
|
85550
|
-
}
|
|
85551
85542
|
return void 0;
|
|
85552
85543
|
};
|
|
85553
85544
|
for (let i = 0; i < opArgs.length; i++) {
|
|
@@ -85669,7 +85660,7 @@ ${prefix2} line ${offset + line}: \`${source.split("\n")[line - 1] ?? ""}'
|
|
|
85669
85660
|
}
|
|
85670
85661
|
} else {
|
|
85671
85662
|
blankCount = 0;
|
|
85672
|
-
numbered = curSpec.style === "t" && l.length > 0
|
|
85663
|
+
numbered = curSpec.style === "t" && l.length > 0;
|
|
85673
85664
|
}
|
|
85674
85665
|
if (!numbered) {
|
|
85675
85666
|
out.push(l.length === 0 && sep === " " ? " ".repeat(width + 1) : unnumberedPrefix + l);
|
|
@@ -31710,17 +31710,8 @@ export class Runtime {
|
|
|
31710
31710
|
const parseSecSpec = (v) => {
|
|
31711
31711
|
if (v === "a" || v === "t" || v === "n")
|
|
31712
31712
|
return { style: v };
|
|
31713
|
-
|
|
31714
|
-
|
|
31715
|
-
if (source === undefined)
|
|
31716
|
-
return undefined;
|
|
31717
|
-
try {
|
|
31718
|
-
return { style: "p", re: new RegExp(source) };
|
|
31719
|
-
}
|
|
31720
|
-
catch {
|
|
31721
|
-
return undefined;
|
|
31722
|
-
}
|
|
31723
|
-
}
|
|
31713
|
+
// Pattern numbering uses the command's bounded, byte-oriented BRE engine.
|
|
31714
|
+
// JavaScript RegExp cannot preserve that dialect or its execution limits.
|
|
31724
31715
|
return undefined;
|
|
31725
31716
|
};
|
|
31726
31717
|
for (let i = 0; i < opArgs.length; i++) {
|
|
@@ -31888,7 +31879,7 @@ export class Runtime {
|
|
|
31888
31879
|
}
|
|
31889
31880
|
else {
|
|
31890
31881
|
blankCount = 0;
|
|
31891
|
-
numbered =
|
|
31882
|
+
numbered = curSpec.style === "t" && l.length > 0;
|
|
31892
31883
|
}
|
|
31893
31884
|
if (!numbered) {
|
|
31894
31885
|
out.push(l.length === 0 && sep === "\t" ? " ".repeat(width + 1) : unnumberedPrefix + l);
|