@poe-platform/safe-bash 0.1.744 → 0.1.746
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/README.md +10 -1
- package/dist/image-ast/browser/sharp.d.ts +1 -1
- package/dist/image-ast/index.js +133 -35
- package/dist/image-ast/sharp.d.ts +1 -1
- package/dist/safe-bash/chunks/{chunk-2CO4WCMK.js → chunk-3ZNXN3XO.js} +434 -245
- package/dist/safe-bash/chunks/{chunk-2F7Q532M.js → chunk-4GK4FAT6.js} +3 -3
- package/dist/safe-bash/chunks/{chunk-WCNFCN2G.js → chunk-BS6QFRNX.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-IZZ7KX4E.js → chunk-JCXAGOEK.js} +40 -3
- package/dist/safe-bash/chunks/{chunk-WN7FYUWU.js → chunk-MC2KZY3D.js} +26 -13
- package/dist/safe-bash/chunks/{chunk-I3DOFJSJ.js → chunk-MUWJPSGN.js} +2 -2
- package/dist/safe-bash/chunks/{chunk-7RP6WOWK.js → chunk-OF2PDE3W.js} +2 -2
- package/dist/safe-bash/chunks/{pdf-renderer-3TVUXNBT.js → pdf-renderer-4APIM7F7.js} +2 -2
- package/dist/safe-bash/chunks/{src-5VZS2ZKB.js → src-T2WAWJXF.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-DRCPJVZF.js → chunk-44N2IRVP.js} +17 -5
- package/dist/safe-bash/command-chunks/{chunk-LYKC7WJB.js → chunk-6742OVAC.js} +37 -3
- package/dist/safe-bash/command-chunks/{chunk-BMBXSLVX.js → chunk-6QU5OLPJ.js} +2 -2
- package/dist/safe-bash/command-chunks/{chunk-YHANNN7I.js → chunk-S3BO2NJT.js} +7 -0
- package/dist/safe-bash/commands/basic.d.ts +2 -0
- package/dist/safe-bash/commands/basic.js +236 -9
- package/dist/safe-bash/commands/pr/index.browser.js +1 -1
- package/dist/safe-bash/commands/streams.js +9 -56
- package/dist/safe-bash/commands/table-text/index.js +5 -1
- package/dist/safe-bash/commands/text.js +13 -2
- package/dist/safe-bash/commands/time-env/shared.js +2 -2
- package/dist/safe-bash/commands/time-env/sleep.js +6 -4
- package/dist/safe-bash/commands/timeout/index.d.ts +7 -0
- package/dist/safe-bash/commands/timeout/index.js +52 -32
- package/dist/safe-bash/commands/timeout/scheduler.js +7 -6
- package/dist/safe-bash/core.browser.js +3475 -883
- package/dist/safe-bash/opt-in/commands/shuf/random.js +2 -3
- package/dist/safe-bash/opt-in/shell/extensions/read/index.js +1 -2
- package/dist/safe-bash/opt-in/shell/extensions/trap/index.d.ts +1 -2
- package/dist/safe-bash/opt-in/shell/extensions/trap/index.js +1 -8
- package/dist/safe-bash/playwright/adapter.d.ts +2 -0
- package/dist/safe-bash/playwright/capability-events.d.ts +7 -0
- package/dist/safe-bash/playwright/capability-events.js +11 -3
- package/dist/safe-bash/playwright/controller.d.ts +14 -0
- package/dist/safe-bash/playwright/controller.js +36 -8
- package/dist/safe-bash/playwright/index.d.ts +1 -0
- package/dist/safe-bash/playwright/index.js +1 -0
- package/dist/safe-bash/playwright/private-target-transport.d.ts +1 -0
- package/dist/safe-bash/playwright/private-target-transport.js +21 -21
- package/dist/safe-bash/shell/runtime.d.ts +34 -2
- package/dist/safe-bash/shell/runtime.js +4107 -947
- package/dist/safe-bash/shell/sync-jq-expression.d.ts +6 -0
- package/dist/safe-bash/shell/sync-jq-expression.js +46 -0
- package/dist/safe-bash-command-cal/index.js +32 -12
- package/dist/safe-bash-command-hostname/index.js +22 -7
- package/dist/safe-bash-command-id/index.js +28 -9
- package/dist/safe-bash-command-pandoc/command.js +1 -1
- package/dist/safe-bash-command-pandoc/index.js +1 -1
- package/dist/safe-bash-command-ssconvert/command.d.ts +2 -2
- package/dist/safe-bash-command-ssconvert/contracts.d.ts +4 -0
- package/dist/safe-bash-command-ssconvert/engine.d.ts +2 -2
- package/dist/safe-bash-command-ssconvert/index.js +421 -237
- package/dist/safe-bash-command-whoami/index.js +26 -12
- package/dist/safe-bash-command-wkhtmltopdf/index.js +24 -11
- package/dist/safe-bash-command-wkhtmltopdf/limits.d.ts +1 -1
- package/dist/safe-bash-command-wkhtmltopdf/resources.d.ts +1 -1
- package/dist/safe-bash-query-engine/index.js +3 -3
- package/dist/safe-bash-query-engine/interpreter.js +1 -1
- package/dist/safe-bash-query-engine/parser.js +1 -1
- package/dist/safe-bash-query-engine/query-core.js +3 -3
- package/dist/safe-playwright-cloudflare/browser-private-transport.js +8 -13
- package/dist/safe-playwright-cloudflare/browser-storage-control.js +13 -4
- package/dist/safe-playwright-cloudflare/browser-trace-archive.js +1 -1
- package/package.json +18 -14
- package/dist/image-ast/streams/node.d.ts +0 -10
- package/dist/image-ast/streams/node.js +0 -5
- package/dist/image-ast/streams/web.js +0 -94
|
@@ -27222,9 +27222,9 @@ function parseExpression(source, options) {
|
|
|
27222
27222
|
}
|
|
27223
27223
|
let sheetRelative;
|
|
27224
27224
|
const readSheet = () => {
|
|
27225
|
+
if (grammar3.bracketReferences && grammar3.absoluteSheetReferences) sheetRelative = source[offset] !== "$";
|
|
27226
|
+
if (grammar3.absoluteSheetReferences && source[offset] === "$") offset++;
|
|
27225
27227
|
if (grammar3.bracketReferences) {
|
|
27226
|
-
if (grammar3.absoluteSheetReferences) sheetRelative = source[offset] !== "$";
|
|
27227
|
-
if (grammar3.absoluteSheetReferences && source[offset] === "$") offset++;
|
|
27228
27228
|
if (source[offset] === "'") return quoted("'", grammar3.stringEscape);
|
|
27229
27229
|
const begin2 = offset;
|
|
27230
27230
|
while (offset < source.length && source[offset] !== grammar3.sheetSeparator && !" []:' \r\n".includes(source[offset])) offset++;
|
|
@@ -27232,7 +27232,6 @@ function parseExpression(source, options) {
|
|
|
27232
27232
|
}
|
|
27233
27233
|
if (grammar3.unquotedSheets) {
|
|
27234
27234
|
const begin2 = offset;
|
|
27235
|
-
if (grammar3.absoluteSheetReferences && source[offset] === "$") offset++;
|
|
27236
27235
|
while (letter(source[offset]) || digit(source[offset])) offset++;
|
|
27237
27236
|
return source.slice(begin2, offset);
|
|
27238
27237
|
}
|
|
@@ -27256,7 +27255,6 @@ function parseExpression(source, options) {
|
|
|
27256
27255
|
return {};
|
|
27257
27256
|
}
|
|
27258
27257
|
offset++;
|
|
27259
|
-
if (grammar3.absoluteSheetReferences && !grammar3.bracketReferences && sheet.startsWith("$")) sheet = sheet.slice(1);
|
|
27260
27258
|
if (sheet.startsWith("[")) {
|
|
27261
27259
|
const close = sheet.indexOf("]");
|
|
27262
27260
|
if (close >= 0) {
|
|
@@ -29124,6 +29122,383 @@ var chartDataTypes = Object.freeze(Object.fromEntries(Object.entries({
|
|
|
29124
29122
|
GODataMatrixVal: { storage: "literal", dimensions: 2 }
|
|
29125
29123
|
}).map(([name5, descriptor3]) => [name5, Object.freeze(descriptor3)])));
|
|
29126
29124
|
|
|
29125
|
+
// packages/safe-bash-command-ssconvert/src/workbook/hyperlinks.ts
|
|
29126
|
+
init_platform();
|
|
29127
|
+
|
|
29128
|
+
// packages/safe-bash-command-ssconvert/src/codecs/odf-write-support.ts
|
|
29129
|
+
init_platform();
|
|
29130
|
+
import { parseXmlSteps } from "@poe-platform/safe-fs/core";
|
|
29131
|
+
var urn = "urn:oasis:names:tc:opendocument:xmlns:";
|
|
29132
|
+
var odfEncryptionNamespace = "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0";
|
|
29133
|
+
var odfNamespaces = {
|
|
29134
|
+
xml: "http://www.w3.org/XML/1998/namespace",
|
|
29135
|
+
office: urn + "office:1.0",
|
|
29136
|
+
style: urn + "style:1.0",
|
|
29137
|
+
text: urn + "text:1.0",
|
|
29138
|
+
table: urn + "table:1.0",
|
|
29139
|
+
draw: urn + "drawing:1.0",
|
|
29140
|
+
fo: urn + "xsl-fo-compatible:1.0",
|
|
29141
|
+
xlink: "http://www.w3.org/1999/xlink",
|
|
29142
|
+
dc: "http://purl.org/dc/elements/1.1/",
|
|
29143
|
+
meta: urn + "meta:1.0",
|
|
29144
|
+
number: urn + "datastyle:1.0",
|
|
29145
|
+
svg: urn + "svg-compatible:1.0",
|
|
29146
|
+
chart: urn + "chart:1.0",
|
|
29147
|
+
config: urn + "config:1.0",
|
|
29148
|
+
form: urn + "form:1.0",
|
|
29149
|
+
script: urn + "script:1.0",
|
|
29150
|
+
of: urn + "of:1.2",
|
|
29151
|
+
manifest: urn + "manifest:1.0",
|
|
29152
|
+
gnm: "http://www.gnumeric.org/odf-extension/1.0",
|
|
29153
|
+
calcext: "urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
|
|
29154
|
+
};
|
|
29155
|
+
function odfObject(value3) {
|
|
29156
|
+
return value3 !== null && typeof value3 === "object" && !Array.isArray(value3) ? value3 : void 0;
|
|
29157
|
+
}
|
|
29158
|
+
function odfAttributes(value3, namespace5) {
|
|
29159
|
+
const source = odfObject(value3)?.attributes;
|
|
29160
|
+
if (Array.isArray(source)) return Object.fromEntries(source.flatMap((a3) => {
|
|
29161
|
+
const v2 = odfObject(a3);
|
|
29162
|
+
return typeof v2?.name === "string" && typeof v2.value === "string" && (namespace5 === void 0 || v2.namespace === namespace5) ? [[v2.name, v2.value]] : [];
|
|
29163
|
+
}));
|
|
29164
|
+
if (namespace5 !== void 0) return {};
|
|
29165
|
+
return Object.fromEntries(Object.entries(odfObject(source) ?? {}).filter((entry2) => typeof entry2[1] === "string"));
|
|
29166
|
+
}
|
|
29167
|
+
function odfChildren(value3) {
|
|
29168
|
+
const source = odfObject(value3)?.children;
|
|
29169
|
+
return Array.isArray(source) ? source : [];
|
|
29170
|
+
}
|
|
29171
|
+
function createOdfXml(context2, extended) {
|
|
29172
|
+
let work = 0, nodes = 0;
|
|
29173
|
+
const encoder2 = new TextEncoder(), names2 = /* @__PURE__ */ new Set();
|
|
29174
|
+
const declarations = {
|
|
29175
|
+
...Object.fromEntries(Object.entries(odfNamespaces).map(([prefix2, uri]) => ["xmlns:" + prefix2, uri])),
|
|
29176
|
+
"xmlns:loext": odfEncryptionNamespace
|
|
29177
|
+
};
|
|
29178
|
+
function charge(amount = 1) {
|
|
29179
|
+
context2.signal.throwIfAborted();
|
|
29180
|
+
if (!Number.isSafeInteger(amount) || amount < 0 || amount > (context2.limits.workbookWork ?? Infinity) - work)
|
|
29181
|
+
throw new SsconvertError("resource-limit", "ssconvert OpenDocument work limit exceeded");
|
|
29182
|
+
work += amount;
|
|
29183
|
+
}
|
|
29184
|
+
function name5(value3) {
|
|
29185
|
+
charge(value3.length);
|
|
29186
|
+
if (names2.has(value3)) return;
|
|
29187
|
+
try {
|
|
29188
|
+
const parser = parseXmlSteps(`<${value3} ${Object.entries(declarations).map(([k, v2]) => `${k}="${v2}"`).join(" ")}/>`, { maxNodes: 1, maxAttributes: 100 });
|
|
29189
|
+
let step = parser.next();
|
|
29190
|
+
while (!step.done) step = parser.next();
|
|
29191
|
+
if (step.value.name !== value3 || step.value.children.length) throw new Error("name");
|
|
29192
|
+
} catch {
|
|
29193
|
+
throw new SsconvertError("invalid-request", "Invalid OpenDocument XML name");
|
|
29194
|
+
}
|
|
29195
|
+
names2.add(value3);
|
|
29196
|
+
}
|
|
29197
|
+
function escape3(value3) {
|
|
29198
|
+
charge(value3.length);
|
|
29199
|
+
let result2 = "";
|
|
29200
|
+
for (const c4 of value3) {
|
|
29201
|
+
const code2 = c4.codePointAt(0);
|
|
29202
|
+
if (code2 < 32 && !" \n\r".includes(c4) || code2 === 65534 || code2 === 65535 || code2 >= 55296 && code2 <= 57343)
|
|
29203
|
+
throw new SsconvertError("unsupported-feature", "Unsupported ssconvert feature: non-XML OpenDocument character");
|
|
29204
|
+
result2 += c4 === "&" ? "&" : c4 === "<" ? "<" : c4 === ">" ? ">" : c4 === '"' ? """ : c4 === "\r" ? " " : c4 === "\n" ? " " : c4 === " " ? "	" : c4;
|
|
29205
|
+
}
|
|
29206
|
+
return result2;
|
|
29207
|
+
}
|
|
29208
|
+
function element2(tag3, attributes4 = {}, content2 = "") {
|
|
29209
|
+
charge();
|
|
29210
|
+
if (++nodes > (context2.limits.workbookNodes ?? Infinity))
|
|
29211
|
+
throw new SsconvertError("resource-limit", "ssconvert OpenDocument XML nodes limit exceeded");
|
|
29212
|
+
name5(tag3);
|
|
29213
|
+
let result2 = "<" + tag3;
|
|
29214
|
+
for (const [key2, value3] of Object.entries(attributes4)) if (value3 !== void 0) {
|
|
29215
|
+
if (!key2.startsWith("xmlns:")) name5(key2);
|
|
29216
|
+
result2 += ` ${key2}="${escape3(String(value3))}"`;
|
|
29217
|
+
}
|
|
29218
|
+
result2 += content2 ? ">" + content2 + "</" + tag3 + ">" : "/>";
|
|
29219
|
+
if (result2.length > context2.limits.outputBytes || encoder2.encode(result2).length > context2.limits.outputBytes)
|
|
29220
|
+
throw new SsconvertError("resource-limit", "ssconvert OpenDocument output bytes limit exceeded");
|
|
29221
|
+
return result2;
|
|
29222
|
+
}
|
|
29223
|
+
function text2(value3) {
|
|
29224
|
+
charge(value3.length);
|
|
29225
|
+
let result2 = "", plain = "";
|
|
29226
|
+
function flush() {
|
|
29227
|
+
result2 += escape3(plain);
|
|
29228
|
+
plain = "";
|
|
29229
|
+
}
|
|
29230
|
+
for (let i4 = 0; i4 < value3.length; i4++) {
|
|
29231
|
+
const c4 = value3[i4];
|
|
29232
|
+
if (c4 === " ") {
|
|
29233
|
+
flush();
|
|
29234
|
+
let count = 1;
|
|
29235
|
+
while (value3[i4 + 1] === " ") {
|
|
29236
|
+
i4++;
|
|
29237
|
+
count++;
|
|
29238
|
+
}
|
|
29239
|
+
result2 += element2("text:s", count > 1 ? { "text:c": count } : {});
|
|
29240
|
+
} else if (c4 === " " || c4 === "\n") {
|
|
29241
|
+
flush();
|
|
29242
|
+
result2 += element2(c4 === " " ? "text:tab" : "text:line-break");
|
|
29243
|
+
} else plain += c4;
|
|
29244
|
+
}
|
|
29245
|
+
flush();
|
|
29246
|
+
return result2;
|
|
29247
|
+
}
|
|
29248
|
+
const active = /* @__PURE__ */ new Set();
|
|
29249
|
+
function retained2(value3, depth = 0, hyperlink, hyperlinkContent = false) {
|
|
29250
|
+
charge();
|
|
29251
|
+
const v2 = odfObject(value3);
|
|
29252
|
+
if (!v2 || typeof v2.name !== "string" || typeof v2.namespace !== "string") return "";
|
|
29253
|
+
if (depth > (context2.limits.xmlDepth ?? Infinity)) throw new SsconvertError("resource-limit", "ssconvert OpenDocument metadata depth limit exceeded");
|
|
29254
|
+
if (active.has(v2)) throw new SsconvertError("invalid-request", "Invalid cyclic OpenDocument metadata");
|
|
29255
|
+
const prefix2 = Object.entries(odfNamespaces).find(([, uri]) => uri === v2.namespace)?.[0];
|
|
29256
|
+
if (!prefix2 || !extended && ["gnm", "calcext"].includes(prefix2)) return "";
|
|
29257
|
+
active.add(v2);
|
|
29258
|
+
try {
|
|
29259
|
+
const attributes4 = {};
|
|
29260
|
+
if (Array.isArray(v2.attributes)) for (const a3 of v2.attributes) {
|
|
29261
|
+
charge();
|
|
29262
|
+
const attribute5 = odfObject(a3);
|
|
29263
|
+
if (typeof attribute5?.name !== "string" || typeof attribute5.value !== "string" || typeof attribute5.namespace !== "string") continue;
|
|
29264
|
+
const p2 = Object.entries(odfNamespaces).find(([, uri]) => uri === attribute5.namespace)?.[0];
|
|
29265
|
+
if (attribute5.namespace && (!p2 || !extended && ["gnm", "calcext"].includes(p2))) continue;
|
|
29266
|
+
attributes4[(p2 ? p2 + ":" : "") + attribute5.name] = attribute5.value;
|
|
29267
|
+
}
|
|
29268
|
+
if (prefix2 === "text" && v2.name === "a" && attributes4["xlink:href"] !== void 0 && hyperlink)
|
|
29269
|
+
attributes4["xlink:href"] = hyperlink(attributes4["xlink:href"]);
|
|
29270
|
+
const children7 = odfChildren(v2);
|
|
29271
|
+
const childHyperlinkContent = Boolean(hyperlink) && prefix2 === "text" && v2.name === "a" && attributes4["xlink:href"] !== void 0;
|
|
29272
|
+
const content2 = Array.isArray(v2.content) ? v2.content.map((c4) => {
|
|
29273
|
+
charge();
|
|
29274
|
+
const item = odfObject(c4);
|
|
29275
|
+
if (item?.kind === "text" && typeof item.text === "string") return escape3(item.text);
|
|
29276
|
+
if (item?.kind !== "element") return "";
|
|
29277
|
+
if (item.index === void 0) return retained2(item.value, depth + 1, hyperlink, childHyperlinkContent);
|
|
29278
|
+
if (typeof item.index !== "number" || !Number.isSafeInteger(item.index) || item.index < 0 || item.index >= children7.length)
|
|
29279
|
+
throw new SsconvertError("invalid-request", "Invalid OpenDocument metadata child index");
|
|
29280
|
+
return retained2(children7[item.index], depth + 1, hyperlink, childHyperlinkContent);
|
|
29281
|
+
}).join("") : (typeof v2.text === "string" ? escape3(v2.text) : "") + children7.map((c4) => retained2(c4, depth + 1, hyperlink, childHyperlinkContent)).join("");
|
|
29282
|
+
if (hyperlinkContent && prefix2 === "text" && !content2 && !children7.length) {
|
|
29283
|
+
if (v2.name === "s" && Object.keys(attributes4).every((key2) => key2 === "text:c")) {
|
|
29284
|
+
const count = Number(attributes4["text:c"] ?? "1");
|
|
29285
|
+
if (!Number.isSafeInteger(count) || count < 0) throw new SsconvertError("invalid-request", "Invalid OpenDocument whitespace count");
|
|
29286
|
+
if (count > context2.limits.outputBytes) throw new SsconvertError("resource-limit", "ssconvert OpenDocument output bytes limit exceeded");
|
|
29287
|
+
charge(count);
|
|
29288
|
+
return " ".repeat(count);
|
|
29289
|
+
}
|
|
29290
|
+
if (!Object.keys(attributes4).length && (v2.name === "tab" || v2.name === "line-break"))
|
|
29291
|
+
return escape3(v2.name === "tab" ? " " : "\n");
|
|
29292
|
+
}
|
|
29293
|
+
return element2(prefix2 + ":" + v2.name, attributes4, content2);
|
|
29294
|
+
} finally {
|
|
29295
|
+
active.delete(v2);
|
|
29296
|
+
}
|
|
29297
|
+
}
|
|
29298
|
+
function document6(tag3, body) {
|
|
29299
|
+
return '<?xml version="1.0" encoding="UTF-8"?>\n' + element2(tag3, { ...declarations, "xmlns:loext": void 0, "office:version": "1.2" }, body);
|
|
29300
|
+
}
|
|
29301
|
+
return { element: element2, escape: escape3, text: text2, retained: retained2, document: document6, charge };
|
|
29302
|
+
}
|
|
29303
|
+
|
|
29304
|
+
// packages/safe-bash-command-ssconvert/src/codecs/odf-hyperlinks.ts
|
|
29305
|
+
init_platform();
|
|
29306
|
+
var linkGrammar = { ...excelGrammar, id: "odf-hyperlink", sheetSeparator: ".", absoluteSheetReferences: true };
|
|
29307
|
+
function decodeFragment(source, charge) {
|
|
29308
|
+
let result2 = "";
|
|
29309
|
+
for (let at = 0; at < source.length; ) {
|
|
29310
|
+
charge();
|
|
29311
|
+
const high = "0123456789abcdef".indexOf(source[at + 1]?.toLowerCase() ?? " ");
|
|
29312
|
+
const low = "0123456789abcdef".indexOf(source[at + 2]?.toLowerCase() ?? " ");
|
|
29313
|
+
if (source[at] !== "%" || high < 0 || low < 0) {
|
|
29314
|
+
result2 += source[at++];
|
|
29315
|
+
continue;
|
|
29316
|
+
}
|
|
29317
|
+
const octet = high * 16 + low;
|
|
29318
|
+
const length = octet >= 192 && octet <= 223 ? 6 : octet >= 224 && octet <= 239 ? 9 : octet >= 240 && octet <= 244 ? 12 : 3;
|
|
29319
|
+
const encoded2 = source.slice(at, at + length);
|
|
29320
|
+
try {
|
|
29321
|
+
result2 += decodeURIComponent(encoded2);
|
|
29322
|
+
at += length;
|
|
29323
|
+
} catch {
|
|
29324
|
+
result2 += source.slice(at, at + 3).toUpperCase();
|
|
29325
|
+
at += 3;
|
|
29326
|
+
}
|
|
29327
|
+
}
|
|
29328
|
+
return result2;
|
|
29329
|
+
}
|
|
29330
|
+
function encodeFragment(source) {
|
|
29331
|
+
return "#" + encodeURI(source).split("#").join("%23").split("?").join("%3F");
|
|
29332
|
+
}
|
|
29333
|
+
function translateOdfHyperlink(source, direction2, charge, sheetNames = []) {
|
|
29334
|
+
charge(source.length);
|
|
29335
|
+
if (direction2 === "normalize" && !source.startsWith("#")) return source;
|
|
29336
|
+
function findSheet(name5) {
|
|
29337
|
+
const folded = foldSheetName(name5);
|
|
29338
|
+
return sheetNames.find((candidate) => {
|
|
29339
|
+
charge(candidate.length);
|
|
29340
|
+
return foldSheetName(candidate) === folded;
|
|
29341
|
+
});
|
|
29342
|
+
}
|
|
29343
|
+
let target = direction2 !== "export" && source.startsWith("#") ? source.slice(1) : source;
|
|
29344
|
+
if (direction2 !== "export") {
|
|
29345
|
+
target = decodeFragment(target, charge);
|
|
29346
|
+
const separator2 = target.indexOf(" (");
|
|
29347
|
+
if (separator2 > 0 && target.endsWith(")")) {
|
|
29348
|
+
const name5 = target.slice(0, separator2), sheet = findSheet(target.slice(separator2 + 2, -1));
|
|
29349
|
+
if (sheet !== void 0) {
|
|
29350
|
+
const qualified = quoteNativeSheet(sheet) + "!" + name5;
|
|
29351
|
+
const parsed2 = parseExpression("=" + qualified, { position: { sheet, row: 0, column: 0 }, onWork: charge });
|
|
29352
|
+
if (parsed2.ok && parsed2.document.root.kind === "name" && parsed2.document.root.name === name5 && parsed2.document.root.sheet === sheet)
|
|
29353
|
+
return direction2 === "import" ? qualified : encodeFragment(target);
|
|
29354
|
+
}
|
|
29355
|
+
}
|
|
29356
|
+
}
|
|
29357
|
+
const parsed = parseExpression("=" + target, {
|
|
29358
|
+
grammar: direction2 !== "export" ? linkGrammar : gnumericGrammar,
|
|
29359
|
+
position: { sheet: "", row: 0, column: 0 },
|
|
29360
|
+
onWork: charge
|
|
29361
|
+
});
|
|
29362
|
+
if (parsed.ok) {
|
|
29363
|
+
const node3 = parsed.document.root;
|
|
29364
|
+
if (node3.kind === "name" && node3.workbook === void 0 || node3.kind === "reference" && !node3.label && node3.first.workbook === void 0 && node3.last?.workbook === void 0) {
|
|
29365
|
+
const sheet = direction2 !== "import" && node3.kind === "name" && node3.sheet !== void 0 ? findSheet(node3.sheet) : void 0;
|
|
29366
|
+
if (sheet !== void 0 && node3.kind === "name") return encodeFragment(node3.name + " (" + sheet + ")");
|
|
29367
|
+
if (direction2 !== "normalize") target = serializeExpression(parsed.document, direction2 === "import" ? { ...gnumericGrammar, quoteSheetName: quoteNativeSheet } : linkGrammar, false, true).slice(1);
|
|
29368
|
+
}
|
|
29369
|
+
}
|
|
29370
|
+
return direction2 === "import" ? target : direction2 === "normalize" ? source : encodeFragment(target);
|
|
29371
|
+
}
|
|
29372
|
+
|
|
29373
|
+
// packages/safe-bash-command-ssconvert/src/workbook/hyperlinks.ts
|
|
29374
|
+
function rewriteWorkbookHyperlinks(book, names2, context2) {
|
|
29375
|
+
let work = 0;
|
|
29376
|
+
const maximum = context2.limits.workbookWork ?? context2.limits.inputBytes + context2.limits.cells * 32;
|
|
29377
|
+
function charge(amount = 1) {
|
|
29378
|
+
context2.signal.throwIfAborted();
|
|
29379
|
+
if (amount > maximum - work) throw new SsconvertError("resource-limit", "ssconvert hyperlink work limit exceeded");
|
|
29380
|
+
work += amount;
|
|
29381
|
+
}
|
|
29382
|
+
const sheets = [...book.sheets, ...book.detachedSheets ?? []].map((sheet2) => sheet2.name);
|
|
29383
|
+
const changes = new Map(sheets.flatMap((name5) => {
|
|
29384
|
+
charge(name5.length);
|
|
29385
|
+
const next = names2.get(foldSheetName(name5));
|
|
29386
|
+
return next === void 0 || next === name5 ? [] : [[foldSheetName(name5), next]];
|
|
29387
|
+
}));
|
|
29388
|
+
if (!changes.size) return book;
|
|
29389
|
+
const renamedSheets = sheets.map((name5) => names2.get(foldSheetName(name5)) ?? name5);
|
|
29390
|
+
function target(source, odf) {
|
|
29391
|
+
charge(source.length);
|
|
29392
|
+
if (odf && !source.startsWith("#")) return source;
|
|
29393
|
+
const native = odf ? translateOdfHyperlink(source, "import", charge, sheets) : source;
|
|
29394
|
+
const parsed = parseExpression("=" + native, { position: { sheet: "", row: 0, column: 0 }, onWork: charge, signal: context2.signal });
|
|
29395
|
+
if (!parsed.ok) return source;
|
|
29396
|
+
const node3 = parsed.document.root;
|
|
29397
|
+
const spellings = node3.kind === "name" && node3.workbook === void 0 ? [node3.sheet] : node3.kind === "reference" && !node3.label && node3.first.workbook === void 0 && node3.last?.workbook === void 0 ? [node3.first.sheet, node3.last?.sheet] : [];
|
|
29398
|
+
const replacements = /* @__PURE__ */ new Map();
|
|
29399
|
+
for (const spelling of spellings) if (spelling !== void 0) {
|
|
29400
|
+
charge(spelling.length);
|
|
29401
|
+
const name5 = changes.get(foldSheetName(spelling));
|
|
29402
|
+
if (name5 !== void 0 && name5 !== spelling) replacements.set(spelling, name5);
|
|
29403
|
+
}
|
|
29404
|
+
if (!replacements.size) return source;
|
|
29405
|
+
const rewritten = rewriteReferences(parsed.document, { sheets: replacements, signal: context2.signal }).slice(1);
|
|
29406
|
+
charge(rewritten.length);
|
|
29407
|
+
return odf ? translateOdfHyperlink(rewritten, "export", charge, renamedSheets) : rewritten;
|
|
29408
|
+
}
|
|
29409
|
+
function xml2(value3, odf, root, implicitNamespace = false) {
|
|
29410
|
+
let result2 = value3;
|
|
29411
|
+
const pending = [{ value: value3, role: root, depth: 0, assign: (next) => {
|
|
29412
|
+
result2 = next;
|
|
29413
|
+
} }];
|
|
29414
|
+
while (pending.length) {
|
|
29415
|
+
const item = pending.pop();
|
|
29416
|
+
charge();
|
|
29417
|
+
const node3 = odfObject(item.value);
|
|
29418
|
+
if (!node3 || typeof node3.name !== "string" || node3.name !== item.role) continue;
|
|
29419
|
+
const validNamespace = odf ? node3.namespace === odfNamespaces.text || node3.namespace === "http://openoffice.org/2000/text" : node3.namespace === "http://www.gnumeric.org/v10.dtd" || implicitNamespace && (node3.namespace === void 0 || node3.namespace === "");
|
|
29420
|
+
if (!validNamespace) continue;
|
|
29421
|
+
if (item.depth > (context2.limits.xmlDepth ?? Infinity)) throw new SsconvertError("resource-limit", "ssconvert hyperlink depth limit exceeded");
|
|
29422
|
+
const updated = { ...node3 };
|
|
29423
|
+
item.assign(updated);
|
|
29424
|
+
const attributes4 = odfObject(node3.attributes);
|
|
29425
|
+
const list = Array.isArray(node3.attributes) ? node3.attributes : [];
|
|
29426
|
+
const field = (name5, namespace5) => {
|
|
29427
|
+
if (attributes4 && !namespace5 && typeof attributes4[name5] === "string") return attributes4[name5];
|
|
29428
|
+
for (const value4 of list) {
|
|
29429
|
+
charge();
|
|
29430
|
+
const attribute5 = odfObject(value4);
|
|
29431
|
+
if (attribute5?.name === name5 && attribute5.namespace === namespace5 && typeof attribute5.value === "string") return attribute5.value;
|
|
29432
|
+
}
|
|
29433
|
+
return void 0;
|
|
29434
|
+
};
|
|
29435
|
+
const link = odf ? node3.name === "a" : node3.name === "HyperLink" && field("type", "") === "GnmHLinkCurWB";
|
|
29436
|
+
if (link) {
|
|
29437
|
+
const name5 = odf ? "href" : "target", namespace5 = odf ? odfNamespaces.xlink : "";
|
|
29438
|
+
const source = field(name5, namespace5);
|
|
29439
|
+
if (source !== void 0) {
|
|
29440
|
+
const rewritten = target(source, odf);
|
|
29441
|
+
updated.attributes = attributes4 ? { ...attributes4, [name5]: rewritten } : list.map((value4) => {
|
|
29442
|
+
charge();
|
|
29443
|
+
const attribute5 = odfObject(value4);
|
|
29444
|
+
return attribute5?.name === name5 && attribute5.namespace === namespace5 ? { ...attribute5, value: rewritten } : value4;
|
|
29445
|
+
});
|
|
29446
|
+
}
|
|
29447
|
+
}
|
|
29448
|
+
const childRole = odf ? void 0 : node3.name === "Styles" ? "StyleRegion" : node3.name === "StyleRegion" ? "Style" : node3.name === "Style" ? "HyperLink" : "";
|
|
29449
|
+
const enqueue = (value4, assign) => {
|
|
29450
|
+
charge();
|
|
29451
|
+
const child7 = odfObject(value4);
|
|
29452
|
+
if (typeof child7?.name === "string") pending.push({ value: value4, role: childRole ?? child7.name, depth: item.depth + 1, assign });
|
|
29453
|
+
};
|
|
29454
|
+
if (Array.isArray(node3.children)) {
|
|
29455
|
+
const children7 = [...node3.children];
|
|
29456
|
+
updated.children = children7;
|
|
29457
|
+
children7.forEach((child7, index2) => enqueue(child7, (next) => {
|
|
29458
|
+
children7[index2] = next;
|
|
29459
|
+
}));
|
|
29460
|
+
}
|
|
29461
|
+
if (odf && Array.isArray(node3.content)) {
|
|
29462
|
+
const content2 = [...node3.content];
|
|
29463
|
+
updated.content = content2;
|
|
29464
|
+
content2.forEach((value4, index2) => {
|
|
29465
|
+
charge();
|
|
29466
|
+
const entry2 = odfObject(value4);
|
|
29467
|
+
if (entry2?.kind === "element" && entry2.index === void 0 && entry2.value !== void 0)
|
|
29468
|
+
enqueue(entry2.value, (next) => {
|
|
29469
|
+
content2[index2] = { ...entry2, value: next };
|
|
29470
|
+
});
|
|
29471
|
+
});
|
|
29472
|
+
}
|
|
29473
|
+
}
|
|
29474
|
+
return result2;
|
|
29475
|
+
}
|
|
29476
|
+
const style2 = (value3) => {
|
|
29477
|
+
charge();
|
|
29478
|
+
return value3?.gnumeric === void 0 ? value3 : { ...value3, gnumeric: xml2(value3.gnumeric, false, "Style", true) };
|
|
29479
|
+
};
|
|
29480
|
+
const sheet = (value3) => ({
|
|
29481
|
+
...value3,
|
|
29482
|
+
cells: value3.cells.map((cell) => {
|
|
29483
|
+
charge();
|
|
29484
|
+
return { ...cell, ...cell.style ? { style: style2(cell.style) } : {} };
|
|
29485
|
+
}),
|
|
29486
|
+
...value3.rows ? { rows: value3.rows.map((row) => ({ ...row, ...row.style ? { style: style2(row.style) } : {} })) } : {},
|
|
29487
|
+
...value3.columns ? { columns: value3.columns.map((column) => ({ ...column, ...column.style ? { style: style2(column.style) } : {} })) } : {},
|
|
29488
|
+
...value3.unsupportedRecords ? { unsupportedRecords: value3.unsupportedRecords.map((record7) => {
|
|
29489
|
+
charge();
|
|
29490
|
+
if (record7.disposition !== "retained" || record7.data === void 0) return record7;
|
|
29491
|
+
if (record7.source === "Gnumeric_XmlIO:sax" && record7.kind === "Styles") return { ...record7, data: xml2(record7.data, false, "Styles") };
|
|
29492
|
+
if (record7.kind === "p" && (record7.source === "Gnumeric_OpenCalc:openoffice" || record7.source === "odf:cell-content")) {
|
|
29493
|
+
const data4 = odfObject(record7.data);
|
|
29494
|
+
return data4?.xml === void 0 ? { ...record7, data: xml2(record7.data, true, "p") } : { ...record7, data: { ...data4, xml: xml2(data4.xml, true, "p") } };
|
|
29495
|
+
}
|
|
29496
|
+
return record7;
|
|
29497
|
+
}) } : {}
|
|
29498
|
+
});
|
|
29499
|
+
return { ...book, sheets: book.sheets.map(sheet), ...book.detachedSheets ? { detachedSheets: book.detachedSheets.map(sheet) } : {} };
|
|
29500
|
+
}
|
|
29501
|
+
|
|
29127
29502
|
// packages/safe-bash-command-ssconvert/src/formulas/workbook.ts
|
|
29128
29503
|
function rewriteWorkbook(book, context2, rewrite) {
|
|
29129
29504
|
let work = 0;
|
|
@@ -29181,14 +29556,14 @@ function renameWorkbookSheet(book, sheetId, name5, context2) {
|
|
|
29181
29556
|
if (!sheet || !name5 || name5.includes("\0") || book.sheets.some((s) => s.id !== sheetId && foldSheetName(s.name) === foldSheetName(name5)))
|
|
29182
29557
|
throw new SsconvertError("invalid-request", "Invalid sheet rename");
|
|
29183
29558
|
if (sheet.name === name5) return book;
|
|
29184
|
-
const renamed = rewriteWorkbook(book, context2, (document6) => {
|
|
29559
|
+
const renamed = rewriteWorkbookHyperlinks(rewriteWorkbook(book, context2, (document6) => {
|
|
29185
29560
|
const spellings = /* @__PURE__ */ new Map();
|
|
29186
29561
|
visitFormula(document6.root, (node3) => {
|
|
29187
29562
|
const names2 = node3.kind === "reference" ? [node3.first.sheet, node3.last?.sheet] : node3.kind === "name" ? [node3.sheet] : [];
|
|
29188
29563
|
for (const spelling of names2) if (spelling !== void 0 && foldSheetName(spelling) === foldSheetName(sheet.name)) spellings.set(spelling, name5);
|
|
29189
29564
|
});
|
|
29190
29565
|
return rewriteReferences(document6, { sheets: spellings, signal: context2.signal });
|
|
29191
|
-
});
|
|
29566
|
+
}), /* @__PURE__ */ new Map([[foldSheetName(sheet.name), name5]]), context2);
|
|
29192
29567
|
return snapshotWorkbook({
|
|
29193
29568
|
...renamed,
|
|
29194
29569
|
sheets: renamed.sheets.map((s) => s.id === sheetId ? { ...s, name: name5 } : s),
|
|
@@ -29198,15 +29573,15 @@ function renameWorkbookSheet(book, sheetId, name5, context2) {
|
|
|
29198
29573
|
function remapWorkbookSheets(book, mapping, context2) {
|
|
29199
29574
|
context2.signal.throwIfAborted();
|
|
29200
29575
|
book = snapshotWorkbook(book, context2.limits);
|
|
29201
|
-
const names2 = new Map(book.sheets.map((sheet) => [foldSheetName(sheet.name), mapping.get(sheet.id)?.name ?? sheet.name]));
|
|
29202
|
-
const rewritten = rewriteWorkbook(book, context2, (document6) => {
|
|
29576
|
+
const names2 = new Map([...book.sheets, ...book.detachedSheets ?? []].map((sheet) => [foldSheetName(sheet.name), mapping.get(sheet.id)?.name ?? sheet.name]));
|
|
29577
|
+
const rewritten = rewriteWorkbookHyperlinks(rewriteWorkbook(book, context2, (document6) => {
|
|
29203
29578
|
const spellings = /* @__PURE__ */ new Map();
|
|
29204
29579
|
visitFormula(document6.root, (node3) => {
|
|
29205
29580
|
const refs = node3.kind === "reference" ? [node3.first.sheet, node3.last?.sheet] : node3.kind === "name" ? [node3.sheet] : [];
|
|
29206
29581
|
for (const spelling of refs) if (spelling !== void 0 && names2.has(foldSheetName(spelling))) spellings.set(spelling, names2.get(foldSheetName(spelling)));
|
|
29207
29582
|
});
|
|
29208
29583
|
return rewriteReferences(document6, { sheets: spellings, signal: context2.signal });
|
|
29209
|
-
});
|
|
29584
|
+
}), names2, context2);
|
|
29210
29585
|
const id = (value3) => mapping.get(value3)?.id ?? value3;
|
|
29211
29586
|
const renamedTitles = new Map(book.sheets.flatMap((sheet) => {
|
|
29212
29587
|
const target = mapping.get(sheet.id);
|
|
@@ -35342,7 +35717,7 @@ var german = Object.freeze({
|
|
|
35342
35717
|
shortWeekdays: Object.freeze(["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"])
|
|
35343
35718
|
});
|
|
35344
35719
|
function formattingLocale(name5) {
|
|
35345
|
-
if (["C", "POSIX", "C.UTF-8", "C.utf8", "en_US", "en_US.UTF-8"].includes(name5)) return english;
|
|
35720
|
+
if (["C", "POSIX", "C.UTF-8", "C.utf8", "en_US", "en_US.UTF-8", "en_US.utf8"].includes(name5)) return english;
|
|
35346
35721
|
if (["de_DE", "de_DE.UTF-8", "de_DE.utf8"].includes(name5)) return german;
|
|
35347
35722
|
throw new SsconvertError("unsupported-feature", "Unsupported ssconvert feature: uncaptured format locale");
|
|
35348
35723
|
}
|
|
@@ -51587,7 +51962,7 @@ init_platform();
|
|
|
51587
51962
|
|
|
51588
51963
|
// packages/safe-bash-command-ssconvert/src/codecs/xlsx-write-support.ts
|
|
51589
51964
|
init_platform();
|
|
51590
|
-
import { parseXmlSteps } from "@poe-platform/safe-fs/core";
|
|
51965
|
+
import { parseXmlSteps as parseXmlSteps2 } from "@poe-platform/safe-fs/core";
|
|
51591
51966
|
|
|
51592
51967
|
// packages/safe-bash-command-ssconvert/src/codecs/xlsx-strings.ts
|
|
51593
51968
|
init_platform();
|
|
@@ -51660,7 +52035,7 @@ function createXlsxXml(context2) {
|
|
|
51660
52035
|
try {
|
|
51661
52036
|
if (parts.length > 2) throw new Error("qualified name");
|
|
51662
52037
|
for (const part of parts) {
|
|
51663
|
-
const parser =
|
|
52038
|
+
const parser = parseXmlSteps2(`<${part}/>`, { maxNodes: 1, maxAttributes: 1 });
|
|
51664
52039
|
let step = parser.next();
|
|
51665
52040
|
while (!step.done) step = parser.next();
|
|
51666
52041
|
if (step.value.name !== part || step.value.namespace || step.value.children.length || step.value.attributes.length)
|
|
@@ -52118,7 +52493,7 @@ init_platform();
|
|
|
52118
52493
|
|
|
52119
52494
|
// packages/safe-bash-command-ssconvert/src/codecs/xlsx.ts
|
|
52120
52495
|
init_platform();
|
|
52121
|
-
import { parseXmlSteps as
|
|
52496
|
+
import { parseXmlSteps as parseXmlSteps3, XmlLimitError } from "@poe-platform/safe-fs/core";
|
|
52122
52497
|
|
|
52123
52498
|
// packages/safe-bash-command-ssconvert/src/codecs/xlsx-schema.ts
|
|
52124
52499
|
init_platform();
|
|
@@ -53937,7 +54312,10 @@ var capturedLocales = Object.freeze({
|
|
|
53937
54312
|
C: "C",
|
|
53938
54313
|
POSIX: "C",
|
|
53939
54314
|
"C.UTF-8": "C.UTF-8",
|
|
53940
|
-
"C.utf8": "C.UTF-8"
|
|
54315
|
+
"C.utf8": "C.UTF-8",
|
|
54316
|
+
en_US: "en_US",
|
|
54317
|
+
"en_US.UTF-8": "en_US.UTF-8",
|
|
54318
|
+
"en_US.utf8": "en_US.UTF-8"
|
|
53941
54319
|
});
|
|
53942
54320
|
function localeCategory(environment, category) {
|
|
53943
54321
|
const env2 = environment.env;
|
|
@@ -55357,7 +55735,7 @@ async function openPackage(bytes, context2) {
|
|
|
55357
55735
|
const text2 = new TextDecoder(encoding, { fatal: true }).decode(plain);
|
|
55358
55736
|
textBytes += plain.length;
|
|
55359
55737
|
if (textBytes > (context2.limits.workbookTextBytes ?? bounds2.maxTotalBytes)) limit("XML text");
|
|
55360
|
-
const parser =
|
|
55738
|
+
const parser = parseXmlSteps3(text2, {
|
|
55361
55739
|
expectedEncoding: encoding,
|
|
55362
55740
|
maxDepth: context2.limits.xmlDepth ?? Infinity,
|
|
55363
55741
|
maxNodes: (context2.limits.workbookNodes ?? Infinity) - nodes,
|
|
@@ -74436,7 +74814,8 @@ function encodeText(text2, charset, transliterate, context2) {
|
|
|
74436
74814
|
const suffixTransliteration = parts.length > 1 && parts.slice(1).every((part) => part.toLowerCase() === "translit");
|
|
74437
74815
|
if (suffixTransliteration) transliterate = true;
|
|
74438
74816
|
const base = suffixTransliteration ? parts[0] : charset;
|
|
74439
|
-
const
|
|
74817
|
+
const locale = base === "" ? converterLocale(context2.environment) : void 0;
|
|
74818
|
+
const name5 = base === "" ? locale === "C" ? "ascii" : locale === "en_US" ? "iso-8859-1" : "utf-8" : encodingName(base);
|
|
74440
74819
|
const admit2 = (length) => {
|
|
74441
74820
|
context2.signal.throwIfAborted();
|
|
74442
74821
|
if (length > context2.limits.outputBytes)
|
|
@@ -77554,7 +77933,7 @@ function rk(bits3) {
|
|
|
77554
77933
|
|
|
77555
77934
|
// packages/safe-bash-command-ssconvert/src/codecs/spreadsheetml.ts
|
|
77556
77935
|
init_platform();
|
|
77557
|
-
import { parseXmlSteps as
|
|
77936
|
+
import { parseXmlSteps as parseXmlSteps4, XmlLimitError as XmlLimitError2 } from "@poe-platform/safe-fs/core";
|
|
77558
77937
|
|
|
77559
77938
|
// packages/safe-bash-command-ssconvert/src/codecs/spreadsheetml-metadata.ts
|
|
77560
77939
|
init_platform();
|
|
@@ -77796,7 +78175,7 @@ async function document3(bytes, context2, probe = false) {
|
|
|
77796
78175
|
const at = text2.indexOf(declared, encodingAt + 8);
|
|
77797
78176
|
text2 = text2.slice(0, at) + "UTF-8" + text2.slice(at + declared.length);
|
|
77798
78177
|
} else text2 = new TextDecoder(encoding, { fatal: true }).decode(bytes);
|
|
77799
|
-
const parser =
|
|
78178
|
+
const parser = parseXmlSteps4(text2, {
|
|
77800
78179
|
expectedEncoding: encoding,
|
|
77801
78180
|
maxDepth: context2.limits.xmlDepth ?? Infinity,
|
|
77802
78181
|
maxNodes: context2.limits.workbookNodes ?? Infinity,
|
|
@@ -86418,6 +86797,13 @@ function probeLotus(bytes, context2) {
|
|
|
86418
86797
|
return (b3.u16(0) === 0 || b3.u16(0) === 255) && ([1028, 1029, 1030].includes(version2) ? length === 2 : [4098, 4099, 4100, 4101].includes(version2) && length >= 19);
|
|
86419
86798
|
}
|
|
86420
86799
|
var lmbcsDoubleByteCodepages = { 16: 932, 17: 949, 18: 950, 19: 936 };
|
|
86800
|
+
function decodeSheetName(bytes) {
|
|
86801
|
+
const zero = bytes.indexOf(0);
|
|
86802
|
+
return Array.from(zero < 0 ? bytes : bytes.subarray(0, zero), (byte) => {
|
|
86803
|
+
const character = singleByteTables["windows-1252"][byte];
|
|
86804
|
+
return character === "\uFFFF" ? String.fromCharCode(byte) : character;
|
|
86805
|
+
}).join("");
|
|
86806
|
+
}
|
|
86421
86807
|
async function lmbcs(bytes, group, context2) {
|
|
86422
86808
|
let text2 = "";
|
|
86423
86809
|
const warn = async (message) => context2.diagnostic?.({ code: "lotus", severity: "warning", message });
|
|
@@ -86878,6 +87264,15 @@ async function readLotus(bytes, context2) {
|
|
|
86878
87264
|
active = -1;
|
|
86879
87265
|
continue;
|
|
86880
87266
|
}
|
|
87267
|
+
if (version2 >= 4099 && version2 <= 4101 && id === 35) {
|
|
87268
|
+
consumeOperation();
|
|
87269
|
+
if (length < 5) await warn(`Record with type 0x23 has wrong length ${length}.`);
|
|
87270
|
+
else {
|
|
87271
|
+
const name5 = decodeSheetName(data4.bytes.subarray(4));
|
|
87272
|
+
if (name5) sheet(data4.u16(2)).name = name5;
|
|
87273
|
+
}
|
|
87274
|
+
continue;
|
|
87275
|
+
}
|
|
86881
87276
|
if (id === (modern ? 9 : 11)) {
|
|
86882
87277
|
consumeOperation();
|
|
86883
87278
|
if (length < (modern ? 26 : 24)) {
|
|
@@ -87072,11 +87467,11 @@ async function readLotus(bytes, context2) {
|
|
|
87072
87467
|
else {
|
|
87073
87468
|
const subtype = data4.u16(0);
|
|
87074
87469
|
if (subtype === 14e3) {
|
|
87075
|
-
|
|
87470
|
+
consumeOperation();
|
|
87471
|
+
if (length < 5) await warn(`Record with type 0x1b has wrong length ${length}.`);
|
|
87076
87472
|
else {
|
|
87077
|
-
|
|
87078
|
-
|
|
87079
|
-
sheet(data4.u8(2)).name = new TextDecoder().decode(zero < 0 ? nameBytes : nameBytes.subarray(0, zero));
|
|
87473
|
+
const name5 = decodeSheetName(data4.bytes.subarray(4));
|
|
87474
|
+
if (name5) sheet(data4.u16(2)).name = name5;
|
|
87080
87475
|
}
|
|
87081
87476
|
} else if (subtype === 4001) {
|
|
87082
87477
|
if (length < 24) await warn(`Record with type 0x1b has wrong length ${length}.`);
|
|
@@ -89969,53 +90364,6 @@ function prepareOdfFormulaLabels(book, context2, tick) {
|
|
|
89969
90364
|
return { book, documents: documents2 };
|
|
89970
90365
|
}
|
|
89971
90366
|
|
|
89972
|
-
// packages/safe-bash-command-ssconvert/src/codecs/odf-hyperlinks.ts
|
|
89973
|
-
init_platform();
|
|
89974
|
-
var linkGrammar = { ...excelGrammar, id: "odf-hyperlink", sheetSeparator: "." };
|
|
89975
|
-
function translateOdfHyperlink(source, direction2, charge, sheetNames = []) {
|
|
89976
|
-
charge(source.length);
|
|
89977
|
-
if (direction2 === "normalize" && !source.startsWith("#")) return source;
|
|
89978
|
-
function findSheet(name5) {
|
|
89979
|
-
const folded = foldSheetName(name5);
|
|
89980
|
-
return sheetNames.find((candidate) => {
|
|
89981
|
-
charge(candidate.length);
|
|
89982
|
-
return foldSheetName(candidate) === folded;
|
|
89983
|
-
});
|
|
89984
|
-
}
|
|
89985
|
-
let target = direction2 !== "export" && source.startsWith("#") ? source.slice(1) : source;
|
|
89986
|
-
if (direction2 !== "export") {
|
|
89987
|
-
try {
|
|
89988
|
-
target = decodeURIComponent(target);
|
|
89989
|
-
} catch {
|
|
89990
|
-
if (direction2 === "normalize") return source;
|
|
89991
|
-
}
|
|
89992
|
-
const separator2 = target.indexOf(" (");
|
|
89993
|
-
if (separator2 > 0 && target.endsWith(")")) {
|
|
89994
|
-
const name5 = target.slice(0, separator2), sheet = findSheet(target.slice(separator2 + 2, -1));
|
|
89995
|
-
if (sheet !== void 0) {
|
|
89996
|
-
const qualified = quoteNativeSheet(sheet) + "!" + name5;
|
|
89997
|
-
const parsed2 = parseExpression("=" + qualified, { position: { sheet, row: 0, column: 0 }, onWork: charge });
|
|
89998
|
-
if (parsed2.ok && parsed2.document.root.kind === "name" && parsed2.document.root.name === name5 && parsed2.document.root.sheet === sheet)
|
|
89999
|
-
return direction2 === "import" ? qualified : source;
|
|
90000
|
-
}
|
|
90001
|
-
}
|
|
90002
|
-
}
|
|
90003
|
-
const parsed = parseExpression("=" + target, {
|
|
90004
|
-
grammar: direction2 !== "export" ? linkGrammar : gnumericGrammar,
|
|
90005
|
-
position: { sheet: "", row: 0, column: 0 },
|
|
90006
|
-
onWork: charge
|
|
90007
|
-
});
|
|
90008
|
-
if (parsed.ok) {
|
|
90009
|
-
const node3 = parsed.document.root;
|
|
90010
|
-
if (node3.kind === "name" && node3.workbook === void 0 || node3.kind === "reference" && !node3.label && node3.first.workbook === void 0 && node3.last?.workbook === void 0) {
|
|
90011
|
-
const sheet = direction2 !== "import" && node3.kind === "name" && node3.sheet !== void 0 ? findSheet(node3.sheet) : void 0;
|
|
90012
|
-
if (sheet !== void 0 && node3.kind === "name") return "#" + encodeURI(node3.name + " (" + sheet + ")");
|
|
90013
|
-
if (direction2 !== "normalize") target = serializeExpression(parsed.document, direction2 === "import" ? { ...gnumericGrammar, quoteSheetName: quoteNativeSheet } : linkGrammar, false, true).slice(1);
|
|
90014
|
-
}
|
|
90015
|
-
}
|
|
90016
|
-
return direction2 === "import" ? target : direction2 === "normalize" ? source : "#" + encodeURI(target);
|
|
90017
|
-
}
|
|
90018
|
-
|
|
90019
90367
|
// packages/safe-bash-command-ssconvert/src/codecs/odf-schema.ts
|
|
90020
90368
|
init_platform();
|
|
90021
90369
|
var odfReaderStates = {
|
|
@@ -90129,6 +90477,7 @@ TEXT_SPAN TEXT_LINE_BREAK OO_NS_TEXT line-break
|
|
|
90129
90477
|
TEXT_SPAN TEXT_TAB OO_NS_TEXT tab
|
|
90130
90478
|
TEXT_SPAN TEXT_ADDR OO_NS_TEXT a
|
|
90131
90479
|
TEXT_ADDR TEXT_S OO_NS_TEXT s
|
|
90480
|
+
TEXT_ADDR TEXT_LINE_BREAK OO_NS_TEXT line-break
|
|
90132
90481
|
TEXT_ADDR TEXT_TAB OO_NS_TEXT tab
|
|
90133
90482
|
TEXT_ADDR TEXT_SPAN OO_NS_TEXT span
|
|
90134
90483
|
CONTENT_VALIDATION HELP_MESSAGE OO_NS_TABLE help-message
|
|
@@ -90572,13 +90921,13 @@ MASTER_PAGE_FOOTER MASTER_PAGE_HF_P OO_NS_TEXT p`
|
|
|
90572
90921
|
|
|
90573
90922
|
// packages/safe-bash-command-ssconvert/src/codecs/odf-metadata.ts
|
|
90574
90923
|
init_platform();
|
|
90575
|
-
var
|
|
90924
|
+
var urn2 = "urn:oasis:names:tc:opendocument:xmlns:";
|
|
90576
90925
|
var ns = {
|
|
90577
|
-
table: [
|
|
90578
|
-
office: [
|
|
90579
|
-
text: [
|
|
90580
|
-
style: [
|
|
90581
|
-
fo: [
|
|
90926
|
+
table: [urn2 + "table:1.0", "http://openoffice.org/2000/table"],
|
|
90927
|
+
office: [urn2 + "office:1.0", "http://openoffice.org/2000/office"],
|
|
90928
|
+
text: [urn2 + "text:1.0", "http://openoffice.org/2000/text"],
|
|
90929
|
+
style: [urn2 + "style:1.0", "http://openoffice.org/2000/style"],
|
|
90930
|
+
fo: [urn2 + "xsl-fo-compatible:1.0", "http://www.w3.org/1999/XSL/Format"],
|
|
90582
90931
|
dc: ["http://purl.org/dc/elements/1.1/"],
|
|
90583
90932
|
xlink: ["http://www.w3.org/1999/xlink"],
|
|
90584
90933
|
gnm: ["http://www.gnumeric.org/odf-extension/1.0"]
|
|
@@ -90893,170 +91242,6 @@ function readOdfLabelRanges(parent, sheets, context2, charge) {
|
|
|
90893
91242
|
});
|
|
90894
91243
|
}
|
|
90895
91244
|
|
|
90896
|
-
// packages/safe-bash-command-ssconvert/src/codecs/odf-write-support.ts
|
|
90897
|
-
init_platform();
|
|
90898
|
-
import { parseXmlSteps as parseXmlSteps4 } from "@poe-platform/safe-fs/core";
|
|
90899
|
-
var urn2 = "urn:oasis:names:tc:opendocument:xmlns:";
|
|
90900
|
-
var odfEncryptionNamespace = "urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0";
|
|
90901
|
-
var odfNamespaces = {
|
|
90902
|
-
xml: "http://www.w3.org/XML/1998/namespace",
|
|
90903
|
-
office: urn2 + "office:1.0",
|
|
90904
|
-
style: urn2 + "style:1.0",
|
|
90905
|
-
text: urn2 + "text:1.0",
|
|
90906
|
-
table: urn2 + "table:1.0",
|
|
90907
|
-
draw: urn2 + "drawing:1.0",
|
|
90908
|
-
fo: urn2 + "xsl-fo-compatible:1.0",
|
|
90909
|
-
xlink: "http://www.w3.org/1999/xlink",
|
|
90910
|
-
dc: "http://purl.org/dc/elements/1.1/",
|
|
90911
|
-
meta: urn2 + "meta:1.0",
|
|
90912
|
-
number: urn2 + "datastyle:1.0",
|
|
90913
|
-
svg: urn2 + "svg-compatible:1.0",
|
|
90914
|
-
chart: urn2 + "chart:1.0",
|
|
90915
|
-
config: urn2 + "config:1.0",
|
|
90916
|
-
form: urn2 + "form:1.0",
|
|
90917
|
-
script: urn2 + "script:1.0",
|
|
90918
|
-
of: urn2 + "of:1.2",
|
|
90919
|
-
manifest: urn2 + "manifest:1.0",
|
|
90920
|
-
gnm: "http://www.gnumeric.org/odf-extension/1.0",
|
|
90921
|
-
calcext: "urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0"
|
|
90922
|
-
};
|
|
90923
|
-
function odfObject(value3) {
|
|
90924
|
-
return value3 !== null && typeof value3 === "object" && !Array.isArray(value3) ? value3 : void 0;
|
|
90925
|
-
}
|
|
90926
|
-
function odfAttributes(value3, namespace5) {
|
|
90927
|
-
const source = odfObject(value3)?.attributes;
|
|
90928
|
-
if (Array.isArray(source)) return Object.fromEntries(source.flatMap((a3) => {
|
|
90929
|
-
const v2 = odfObject(a3);
|
|
90930
|
-
return typeof v2?.name === "string" && typeof v2.value === "string" && (namespace5 === void 0 || v2.namespace === namespace5) ? [[v2.name, v2.value]] : [];
|
|
90931
|
-
}));
|
|
90932
|
-
if (namespace5 !== void 0) return {};
|
|
90933
|
-
return Object.fromEntries(Object.entries(odfObject(source) ?? {}).filter((entry2) => typeof entry2[1] === "string"));
|
|
90934
|
-
}
|
|
90935
|
-
function odfChildren(value3) {
|
|
90936
|
-
const source = odfObject(value3)?.children;
|
|
90937
|
-
return Array.isArray(source) ? source : [];
|
|
90938
|
-
}
|
|
90939
|
-
function createOdfXml(context2, extended) {
|
|
90940
|
-
let work = 0, nodes = 0;
|
|
90941
|
-
const encoder2 = new TextEncoder(), names2 = /* @__PURE__ */ new Set();
|
|
90942
|
-
const declarations = {
|
|
90943
|
-
...Object.fromEntries(Object.entries(odfNamespaces).map(([prefix2, uri]) => ["xmlns:" + prefix2, uri])),
|
|
90944
|
-
"xmlns:loext": odfEncryptionNamespace
|
|
90945
|
-
};
|
|
90946
|
-
function charge(amount = 1) {
|
|
90947
|
-
context2.signal.throwIfAborted();
|
|
90948
|
-
if (!Number.isSafeInteger(amount) || amount < 0 || amount > (context2.limits.workbookWork ?? Infinity) - work)
|
|
90949
|
-
throw new SsconvertError("resource-limit", "ssconvert OpenDocument work limit exceeded");
|
|
90950
|
-
work += amount;
|
|
90951
|
-
}
|
|
90952
|
-
function name5(value3) {
|
|
90953
|
-
charge(value3.length);
|
|
90954
|
-
if (names2.has(value3)) return;
|
|
90955
|
-
try {
|
|
90956
|
-
const parser = parseXmlSteps4(`<${value3} ${Object.entries(declarations).map(([k, v2]) => `${k}="${v2}"`).join(" ")}/>`, { maxNodes: 1, maxAttributes: 100 });
|
|
90957
|
-
let step = parser.next();
|
|
90958
|
-
while (!step.done) step = parser.next();
|
|
90959
|
-
if (step.value.name !== value3 || step.value.children.length) throw new Error("name");
|
|
90960
|
-
} catch {
|
|
90961
|
-
throw new SsconvertError("invalid-request", "Invalid OpenDocument XML name");
|
|
90962
|
-
}
|
|
90963
|
-
names2.add(value3);
|
|
90964
|
-
}
|
|
90965
|
-
function escape3(value3) {
|
|
90966
|
-
charge(value3.length);
|
|
90967
|
-
let result2 = "";
|
|
90968
|
-
for (const c4 of value3) {
|
|
90969
|
-
const code2 = c4.codePointAt(0);
|
|
90970
|
-
if (code2 < 32 && !" \n\r".includes(c4) || code2 === 65534 || code2 === 65535 || code2 >= 55296 && code2 <= 57343)
|
|
90971
|
-
throw new SsconvertError("unsupported-feature", "Unsupported ssconvert feature: non-XML OpenDocument character");
|
|
90972
|
-
result2 += c4 === "&" ? "&" : c4 === "<" ? "<" : c4 === ">" ? ">" : c4 === '"' ? """ : c4 === "\r" ? " " : c4 === "\n" ? " " : c4 === " " ? "	" : c4;
|
|
90973
|
-
}
|
|
90974
|
-
return result2;
|
|
90975
|
-
}
|
|
90976
|
-
function element2(tag3, attributes4 = {}, content2 = "") {
|
|
90977
|
-
charge();
|
|
90978
|
-
if (++nodes > (context2.limits.workbookNodes ?? Infinity))
|
|
90979
|
-
throw new SsconvertError("resource-limit", "ssconvert OpenDocument XML nodes limit exceeded");
|
|
90980
|
-
name5(tag3);
|
|
90981
|
-
let result2 = "<" + tag3;
|
|
90982
|
-
for (const [key2, value3] of Object.entries(attributes4)) if (value3 !== void 0) {
|
|
90983
|
-
if (!key2.startsWith("xmlns:")) name5(key2);
|
|
90984
|
-
result2 += ` ${key2}="${escape3(String(value3))}"`;
|
|
90985
|
-
}
|
|
90986
|
-
result2 += content2 ? ">" + content2 + "</" + tag3 + ">" : "/>";
|
|
90987
|
-
if (result2.length > context2.limits.outputBytes || encoder2.encode(result2).length > context2.limits.outputBytes)
|
|
90988
|
-
throw new SsconvertError("resource-limit", "ssconvert OpenDocument output bytes limit exceeded");
|
|
90989
|
-
return result2;
|
|
90990
|
-
}
|
|
90991
|
-
function text2(value3) {
|
|
90992
|
-
charge(value3.length);
|
|
90993
|
-
let result2 = "", plain = "";
|
|
90994
|
-
function flush() {
|
|
90995
|
-
result2 += escape3(plain);
|
|
90996
|
-
plain = "";
|
|
90997
|
-
}
|
|
90998
|
-
for (let i4 = 0; i4 < value3.length; i4++) {
|
|
90999
|
-
const c4 = value3[i4];
|
|
91000
|
-
if (c4 === " ") {
|
|
91001
|
-
flush();
|
|
91002
|
-
let count = 1;
|
|
91003
|
-
while (value3[i4 + 1] === " ") {
|
|
91004
|
-
i4++;
|
|
91005
|
-
count++;
|
|
91006
|
-
}
|
|
91007
|
-
result2 += element2("text:s", count > 1 ? { "text:c": count } : {});
|
|
91008
|
-
} else if (c4 === " " || c4 === "\n") {
|
|
91009
|
-
flush();
|
|
91010
|
-
result2 += element2(c4 === " " ? "text:tab" : "text:line-break");
|
|
91011
|
-
} else plain += c4;
|
|
91012
|
-
}
|
|
91013
|
-
flush();
|
|
91014
|
-
return result2;
|
|
91015
|
-
}
|
|
91016
|
-
const active = /* @__PURE__ */ new Set();
|
|
91017
|
-
function retained2(value3, depth = 0, hyperlink) {
|
|
91018
|
-
charge();
|
|
91019
|
-
const v2 = odfObject(value3);
|
|
91020
|
-
if (!v2 || typeof v2.name !== "string" || typeof v2.namespace !== "string") return "";
|
|
91021
|
-
if (depth > (context2.limits.xmlDepth ?? Infinity)) throw new SsconvertError("resource-limit", "ssconvert OpenDocument metadata depth limit exceeded");
|
|
91022
|
-
if (active.has(v2)) throw new SsconvertError("invalid-request", "Invalid cyclic OpenDocument metadata");
|
|
91023
|
-
const prefix2 = Object.entries(odfNamespaces).find(([, uri]) => uri === v2.namespace)?.[0];
|
|
91024
|
-
if (!prefix2 || !extended && ["gnm", "calcext"].includes(prefix2)) return "";
|
|
91025
|
-
active.add(v2);
|
|
91026
|
-
try {
|
|
91027
|
-
const attributes4 = {};
|
|
91028
|
-
if (Array.isArray(v2.attributes)) for (const a3 of v2.attributes) {
|
|
91029
|
-
charge();
|
|
91030
|
-
const attribute5 = odfObject(a3);
|
|
91031
|
-
if (typeof attribute5?.name !== "string" || typeof attribute5.value !== "string" || typeof attribute5.namespace !== "string") continue;
|
|
91032
|
-
const p2 = Object.entries(odfNamespaces).find(([, uri]) => uri === attribute5.namespace)?.[0];
|
|
91033
|
-
if (attribute5.namespace && (!p2 || !extended && ["gnm", "calcext"].includes(p2))) continue;
|
|
91034
|
-
attributes4[(p2 ? p2 + ":" : "") + attribute5.name] = attribute5.value;
|
|
91035
|
-
}
|
|
91036
|
-
if (prefix2 === "text" && v2.name === "a" && attributes4["xlink:href"] !== void 0 && hyperlink)
|
|
91037
|
-
attributes4["xlink:href"] = hyperlink(attributes4["xlink:href"]);
|
|
91038
|
-
const children7 = odfChildren(v2);
|
|
91039
|
-
const content2 = Array.isArray(v2.content) ? v2.content.map((c4) => {
|
|
91040
|
-
charge();
|
|
91041
|
-
const item = odfObject(c4);
|
|
91042
|
-
if (item?.kind === "text" && typeof item.text === "string") return escape3(item.text);
|
|
91043
|
-
if (item?.kind !== "element") return "";
|
|
91044
|
-
if (item.index === void 0) return retained2(item.value, depth + 1, hyperlink);
|
|
91045
|
-
if (typeof item.index !== "number" || !Number.isSafeInteger(item.index) || item.index < 0 || item.index >= children7.length)
|
|
91046
|
-
throw new SsconvertError("invalid-request", "Invalid OpenDocument metadata child index");
|
|
91047
|
-
return retained2(children7[item.index], depth + 1, hyperlink);
|
|
91048
|
-
}).join("") : (typeof v2.text === "string" ? escape3(v2.text) : "") + children7.map((c4) => retained2(c4, depth + 1, hyperlink)).join("");
|
|
91049
|
-
return element2(prefix2 + ":" + v2.name, attributes4, content2);
|
|
91050
|
-
} finally {
|
|
91051
|
-
active.delete(v2);
|
|
91052
|
-
}
|
|
91053
|
-
}
|
|
91054
|
-
function document6(tag3, body) {
|
|
91055
|
-
return '<?xml version="1.0" encoding="UTF-8"?>\n' + element2(tag3, { ...declarations, "xmlns:loext": void 0, "office:version": "1.2" }, body);
|
|
91056
|
-
}
|
|
91057
|
-
return { element: element2, escape: escape3, text: text2, retained: retained2, document: document6, charge };
|
|
91058
|
-
}
|
|
91059
|
-
|
|
91060
91245
|
// packages/safe-bash-command-ssconvert/src/codecs/odf-encrypted-write.ts
|
|
91061
91246
|
init_platform();
|
|
91062
91247
|
var iterations = 1024;
|
|
@@ -93091,8 +93276,9 @@ function createOdfWriter(profile) {
|
|
|
93091
93276
|
}
|
|
93092
93277
|
}
|
|
93093
93278
|
xml2.charge(originalParagraphs.size);
|
|
93094
|
-
const renderedText = cell.displayedText ?? await renderCellText(cell, book, context2),
|
|
93279
|
+
const renderedText = cell.displayedText ?? await renderCellText(cell, book, context2), paragraph = originalParagraphs.get(key2) ?? [...originalParagraphs.values()].find((p2) => row >= p2.range.startRow && row <= p2.range.endRow && start >= p2.range.startColumn && start <= p2.range.endColumn);
|
|
93095
93280
|
const link = meta?.link ?? links.get(key2);
|
|
93281
|
+
const rendered2 = link ? xml2.escape(renderedText) : xml2.text(renderedText);
|
|
93096
93282
|
content2 += paragraph?.text === renderedText ? paragraph.xml : e("text:p", {}, link ? e("text:a", link, rendered2) : rendered2);
|
|
93097
93283
|
}
|
|
93098
93284
|
const next = !cell && !merge && meta ? Math.min(meta.range.endColumn + 1, stops.find((s) => s > start) ?? meta.range.endColumn + 1) : start + 1;
|
|
@@ -159338,7 +159524,7 @@ function bounded2(value3, maximum, name5) {
|
|
|
159338
159524
|
if (!Number.isSafeInteger(value3) || value3 < 0 || value3 > maximum)
|
|
159339
159525
|
throw new SsconvertError("resource-limit", `ssconvert ${name5} limit exceeded`);
|
|
159340
159526
|
}
|
|
159341
|
-
function createEngine(supplied) {
|
|
159527
|
+
function createEngine(supplied = {}) {
|
|
159342
159528
|
const config2 = {
|
|
159343
159529
|
...supplied,
|
|
159344
159530
|
...supplied.entropy === void 0 ? {} : { entropy: Object.freeze({ read: supplied.entropy.read.bind(supplied.entropy) }) },
|
|
@@ -159346,16 +159532,19 @@ function createEngine(supplied) {
|
|
|
159346
159532
|
...supplied.fonts === void 0 ? {} : { fonts: Object.freeze({ resolve: supplied.fonts.resolve.bind(supplied.fonts) }) },
|
|
159347
159533
|
...supplied.password === void 0 ? {} : { password: Object.freeze({ read: supplied.password.read.bind(supplied.password) }) },
|
|
159348
159534
|
...supplied.runtimeFunctions === void 0 ? {} : { runtimeFunctions: snapshotRuntimeFunctions(supplied.runtimeFunctions) },
|
|
159535
|
+
codecs: supplied.codecs ?? [],
|
|
159349
159536
|
limits: Object.freeze({ ...defaultSsconvertLimits, ...supplied.limits }),
|
|
159350
159537
|
environment: Object.freeze({
|
|
159351
159538
|
...supplied.environment,
|
|
159352
|
-
|
|
159353
|
-
|
|
159539
|
+
locale: supplied.environment?.locale ?? "C",
|
|
159540
|
+
timezone: supplied.environment?.timezone ?? "UTC",
|
|
159541
|
+
cwd: supplied.filesystem?.cwd ?? supplied.environment?.cwd ?? supplied.environment?.env?.PWD ?? "/",
|
|
159542
|
+
env: Object.freeze({ ...supplied.environment?.env })
|
|
159354
159543
|
})
|
|
159355
159544
|
};
|
|
159356
159545
|
if (config2.datasource && Object.hasOwn(config2.runtimeFunctions ?? {}, "ATL_LAST"))
|
|
159357
159546
|
throw new TypeError("Conflicting ssconvert datasource runtime function: ATL_LAST");
|
|
159358
|
-
if ((supplied.filesystem?.cwd !== void 0 || supplied.environment
|
|
159547
|
+
if ((supplied.filesystem?.cwd !== void 0 || supplied.environment?.cwd !== void 0) && (!config2.environment.cwd.startsWith("/") || config2.environment.cwd.includes("\0")))
|
|
159359
159548
|
throw new TypeError("ssconvert cwd must be an absolute VFS path");
|
|
159360
159549
|
for (const name5 of ["inputBytes", "outputBytes", "cells", "sheets", "operations"]) {
|
|
159361
159550
|
const value3 = config2.limits[name5];
|
|
@@ -164083,4 +164272,4 @@ tslib/tslib.js:
|
|
|
164083
164272
|
@noble/ciphers/utils.js:
|
|
164084
164273
|
(*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) *)
|
|
164085
164274
|
*/
|
|
164086
|
-
//# sourceMappingURL=chunk-
|
|
164275
|
+
//# sourceMappingURL=chunk-3ZNXN3XO.js.map
|