kordoc 4.22.1 → 4.22.3
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 +12 -5
- package/dist/{-FYKHW5G6.js → -AOWV7MNY.js} +11 -11
- package/dist/{chunk-QH4B3PL7.js → chunk-24YLYR6Q.js} +4 -4
- package/dist/{chunk-OSFB5SQS.cjs → chunk-2BCQVQO2.cjs} +3 -3
- package/dist/{chunk-OSFB5SQS.cjs.map → chunk-2BCQVQO2.cjs.map} +1 -1
- package/dist/{chunk-5VBAHUGC.js → chunk-3ANXRVI2.js} +3 -3
- package/dist/{chunk-IB5TO2CO.js → chunk-3H2IEU4V.js} +2 -2
- package/dist/{chunk-MDS3GH43.js → chunk-4NQ4EZEE.js} +14 -4
- package/dist/chunk-4NQ4EZEE.js.map +1 -0
- package/dist/{chunk-7FASIFQP.js → chunk-6LIBF2ZB.js} +2 -2
- package/dist/{chunk-5SVJU22Z.js → chunk-6QBBGZST.js} +2 -2
- package/dist/{chunk-YE4IN3D7.js → chunk-7XITVUAK.js} +11 -11
- package/dist/{chunk-M4JC7TXG.js → chunk-AXX5AQT4.js} +4 -4
- package/dist/{chunk-AIAIBNIB.js → chunk-BS2XWGT5.js} +2 -2
- package/dist/{chunk-TSZQ4LMV.js → chunk-DKJ2RNDG.js} +2 -2
- package/dist/{chunk-7RND4SNB.js → chunk-FDFXL7VJ.js} +3 -3
- package/dist/{chunk-3SPOIAST.js → chunk-IRNWAHHZ.js} +2 -2
- package/dist/{chunk-SMPK5TUQ.js → chunk-J5PYESLX.js} +14 -4
- package/dist/chunk-J5PYESLX.js.map +1 -0
- package/dist/{chunk-5FD3LAKC.js → chunk-KBGNPGVY.js} +2 -2
- package/dist/{chunk-DOBJ7BW5.js → chunk-M2X766AY.js} +2 -2
- package/dist/{chunk-ME4NQSLE.js → chunk-MEIQ476H.js} +2 -2
- package/dist/{chunk-M2CBEXHN.cjs → chunk-MI655NV5.cjs} +2 -2
- package/dist/{chunk-M2CBEXHN.cjs.map → chunk-MI655NV5.cjs.map} +1 -1
- package/dist/{chunk-EXVTF6XE.cjs → chunk-NJEMRAIF.cjs} +24 -24
- package/dist/{chunk-EXVTF6XE.cjs.map → chunk-NJEMRAIF.cjs.map} +1 -1
- package/dist/{chunk-ZECSXHYP.cjs → chunk-NLGOMLGU.cjs} +188 -166
- package/dist/{chunk-ZECSXHYP.cjs.map → chunk-NLGOMLGU.cjs.map} +1 -1
- package/dist/{chunk-B35C5HJK.cjs → chunk-O3OS6FAW.cjs} +3 -3
- package/dist/{chunk-B35C5HJK.cjs.map → chunk-O3OS6FAW.cjs.map} +1 -1
- package/dist/{chunk-3H5QG6I2.js → chunk-O5E25RHU.js} +2 -2
- package/dist/{chunk-MGJYVNDX.js → chunk-OIF5HRVP.js} +29 -7
- package/dist/{chunk-JHHXTNZQ.js.map → chunk-OIF5HRVP.js.map} +1 -1
- package/dist/{chunk-RO7AORMO.cjs → chunk-SJ5OZXEL.cjs} +23 -13
- package/dist/chunk-SJ5OZXEL.cjs.map +1 -0
- package/dist/{chunk-JHHXTNZQ.js → chunk-SKRWKVVW.js} +28 -6
- package/dist/chunk-SKRWKVVW.js.map +1 -0
- package/dist/{chunk-LHO7E3RW.js → chunk-UCLDUUBX.js} +2 -2
- package/dist/{chunk-IK4W2M4P.js → chunk-VJCQOSMT.js} +2 -2
- package/dist/{chunk-ATODI25J.js → chunk-X45Q7EAC.js} +2 -2
- package/dist/{chunk-R37TFXMP.js → chunk-YOGMCRM7.js} +108 -29
- package/dist/chunk-YOGMCRM7.js.map +1 -0
- package/dist/chunks-7KXTS7IV.js +10 -0
- package/dist/cli.js +30 -30
- package/dist/{formula-PYDSQGLS.cjs → formula-5V2WG4BH.cjs} +9 -9
- package/dist/{formula-PYDSQGLS.cjs.map → formula-5V2WG4BH.cjs.map} +1 -1
- package/dist/{formula-RUS4SF3O.js → formula-C26FMMGO.js} +3 -3
- package/dist/{formula-JBTYYSKB.js → formula-W4OL33YQ.js} +4 -4
- package/dist/{image-ocr-PLNNCEOR.cjs → image-ocr-BELHEWPX.cjs} +17 -17
- package/dist/{image-ocr-PLNNCEOR.cjs.map → image-ocr-BELHEWPX.cjs.map} +1 -1
- package/dist/{image-ocr-QJT4EIQU.js → image-ocr-NSQ34Y6T.js} +9 -9
- package/dist/{image-ocr-VA6WV6E4.js → image-ocr-T72HMX2W.js} +6 -6
- package/dist/index.cjs +507 -428
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +108 -29
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +22 -22
- package/dist/{model-bundle-U2YY7ATC.js → model-bundle-34T2LJB4.js} +5 -5
- package/dist/{models-BOJ2SFCR.js → models-TQH5EM6V.js} +5 -5
- package/dist/{parse-worker-v2-ZHMFK3U3.js → parse-worker-v2-YEYLILGJ.js} +12 -12
- package/dist/{parser-A2EWLK2J.js → parser-E6BG3ECD.js} +133 -27
- package/dist/parser-E6BG3ECD.js.map +1 -0
- package/dist/{parser-6337Z4U2.cjs → parser-OAXCXVQ4.cjs} +383 -277
- package/dist/parser-OAXCXVQ4.cjs.map +1 -0
- package/dist/{parser-HM6N7J4R.js → parser-SJHCBL7T.js} +136 -30
- package/dist/parser-SJHCBL7T.js.map +1 -0
- package/dist/{pdf-ocr-JDER5BHI.js → pdf-ocr-LGPSJM22.js} +6 -6
- package/dist/pdf-ocr-RKXDY3ZA.cjs +31 -0
- package/dist/{pdf-ocr-PGXNUFU7.cjs.map → pdf-ocr-RKXDY3ZA.cjs.map} +1 -1
- package/dist/{pdf-ocr-MEVC6HXG.js → pdf-ocr-T5ASSUKK.js} +9 -9
- package/dist/{profile-io-OJ23SPYO.js → profile-io-KMCAFTMG.js} +3 -3
- package/dist/{rasterize-76CWCLSU.js → rasterize-M52AKY7R.js} +3 -3
- package/dist/{redact-doc-EZQIHRVT.js → redact-doc-SWJC27LL.js} +11 -11
- package/dist/{render-JZFJPFWK.js → render-45AB5YZR.js} +7 -7
- package/dist/seal-7KWG6VHS.js +10 -0
- package/dist/{setup-RIVS74JN.js → setup-5PBMUI6M.js} +3 -3
- package/dist/visual-OMJNXLNZ.js +21 -0
- package/dist/{watch-WMH222E5.js → watch-QOGKV52T.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-MDS3GH43.js.map +0 -1
- package/dist/chunk-MGJYVNDX.js.map +0 -1
- package/dist/chunk-R37TFXMP.js.map +0 -1
- package/dist/chunk-RO7AORMO.cjs.map +0 -1
- package/dist/chunk-SMPK5TUQ.js.map +0 -1
- package/dist/chunks-4XIAEJEX.js +0 -10
- package/dist/parser-6337Z4U2.cjs.map +0 -1
- package/dist/parser-A2EWLK2J.js.map +0 -1
- package/dist/parser-HM6N7J4R.js.map +0 -1
- package/dist/pdf-ocr-PGXNUFU7.cjs +0 -31
- package/dist/seal-P2NOP4LC.js +0 -10
- package/dist/visual-R5GGZBTU.js +0 -21
- /package/dist/{-FYKHW5G6.js.map → -AOWV7MNY.js.map} +0 -0
- /package/dist/{chunk-QH4B3PL7.js.map → chunk-24YLYR6Q.js.map} +0 -0
- /package/dist/{chunk-5VBAHUGC.js.map → chunk-3ANXRVI2.js.map} +0 -0
- /package/dist/{chunk-IB5TO2CO.js.map → chunk-3H2IEU4V.js.map} +0 -0
- /package/dist/{chunk-7FASIFQP.js.map → chunk-6LIBF2ZB.js.map} +0 -0
- /package/dist/{chunk-5SVJU22Z.js.map → chunk-6QBBGZST.js.map} +0 -0
- /package/dist/{chunk-YE4IN3D7.js.map → chunk-7XITVUAK.js.map} +0 -0
- /package/dist/{chunk-M4JC7TXG.js.map → chunk-AXX5AQT4.js.map} +0 -0
- /package/dist/{chunk-AIAIBNIB.js.map → chunk-BS2XWGT5.js.map} +0 -0
- /package/dist/{chunk-TSZQ4LMV.js.map → chunk-DKJ2RNDG.js.map} +0 -0
- /package/dist/{chunk-7RND4SNB.js.map → chunk-FDFXL7VJ.js.map} +0 -0
- /package/dist/{chunk-3SPOIAST.js.map → chunk-IRNWAHHZ.js.map} +0 -0
- /package/dist/{chunk-5FD3LAKC.js.map → chunk-KBGNPGVY.js.map} +0 -0
- /package/dist/{chunk-DOBJ7BW5.js.map → chunk-M2X766AY.js.map} +0 -0
- /package/dist/{chunk-ME4NQSLE.js.map → chunk-MEIQ476H.js.map} +0 -0
- /package/dist/{chunk-3H5QG6I2.js.map → chunk-O5E25RHU.js.map} +0 -0
- /package/dist/{chunk-LHO7E3RW.js.map → chunk-UCLDUUBX.js.map} +0 -0
- /package/dist/{chunk-IK4W2M4P.js.map → chunk-VJCQOSMT.js.map} +0 -0
- /package/dist/{chunk-ATODI25J.js.map → chunk-X45Q7EAC.js.map} +0 -0
- /package/dist/{chunks-4XIAEJEX.js.map → chunks-7KXTS7IV.js.map} +0 -0
- /package/dist/{formula-RUS4SF3O.js.map → formula-C26FMMGO.js.map} +0 -0
- /package/dist/{formula-JBTYYSKB.js.map → formula-W4OL33YQ.js.map} +0 -0
- /package/dist/{image-ocr-QJT4EIQU.js.map → image-ocr-NSQ34Y6T.js.map} +0 -0
- /package/dist/{image-ocr-VA6WV6E4.js.map → image-ocr-T72HMX2W.js.map} +0 -0
- /package/dist/{model-bundle-U2YY7ATC.js.map → model-bundle-34T2LJB4.js.map} +0 -0
- /package/dist/{models-BOJ2SFCR.js.map → models-TQH5EM6V.js.map} +0 -0
- /package/dist/{parse-worker-v2-ZHMFK3U3.js.map → parse-worker-v2-YEYLILGJ.js.map} +0 -0
- /package/dist/{pdf-ocr-JDER5BHI.js.map → pdf-ocr-LGPSJM22.js.map} +0 -0
- /package/dist/{pdf-ocr-MEVC6HXG.js.map → pdf-ocr-T5ASSUKK.js.map} +0 -0
- /package/dist/{profile-io-OJ23SPYO.js.map → profile-io-KMCAFTMG.js.map} +0 -0
- /package/dist/{rasterize-76CWCLSU.js.map → rasterize-M52AKY7R.js.map} +0 -0
- /package/dist/{redact-doc-EZQIHRVT.js.map → redact-doc-SWJC27LL.js.map} +0 -0
- /package/dist/{render-JZFJPFWK.js.map → render-45AB5YZR.js.map} +0 -0
- /package/dist/{seal-P2NOP4LC.js.map → seal-7KWG6VHS.js.map} +0 -0
- /package/dist/{setup-RIVS74JN.js.map → setup-5PBMUI6M.js.map} +0 -0
- /package/dist/{visual-R5GGZBTU.js.map → visual-OMJNXLNZ.js.map} +0 -0
- /package/dist/{watch-WMH222E5.js.map → watch-QOGKV52T.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunk2BCQVQO2cjs = require('./chunk-2BCQVQO2.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkJ55UQC5Hcjs = require('./chunk-J55UQC5H.cjs');
|
|
@@ -37,7 +37,7 @@ var _chunkJ55UQC5Hcjs = require('./chunk-J55UQC5H.cjs');
|
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _chunkSJ5OZXELcjs = require('./chunk-SJ5OZXEL.cjs');
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
|
|
@@ -55,14 +55,14 @@ var _chunkRO7AORMOcjs = require('./chunk-RO7AORMO.cjs');
|
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
58
|
-
var
|
|
58
|
+
var _chunkMI655NV5cjs = require('./chunk-MI655NV5.cjs');
|
|
59
59
|
|
|
60
60
|
|
|
61
61
|
var _chunkGS7T56RPcjs = require('./chunk-GS7T56RP.cjs');
|
|
62
62
|
|
|
63
63
|
// src/plain-markdown.ts
|
|
64
64
|
function toPlainMarkdown(md2) {
|
|
65
|
-
return
|
|
65
|
+
return _chunkSJ5OZXELcjs.plainScripts.call(void 0, md2).replace(/!\[[^\]\n]*\]\([^)\n]*\)/g, "").replace(/<img\b[^>]*>/gi, "").replace(/(?<!!)\[([^\]\n]*)\]\((?:https?|mailto|ftp):[^)\s]*\)/g, "$1").replace(/(?<!\\)<\/?u>/g, "").replace(/(?<!\\)\*\*(?=\S)([^\n]*?\S)(?<!\\)\*\*/g, "$1").replace(/(<br>)+(?=<\/t[dh]>)/g, "").replace(/[ \t]+$/gm, "").replace(/\n{3,}/g, "\n\n").trim();
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// src/html-tables.ts
|
|
@@ -596,9 +596,9 @@ function rawTextContent(node, depth = 0) {
|
|
|
596
596
|
}
|
|
597
597
|
|
|
598
598
|
// src/hwpx/parser-shared.ts
|
|
599
|
-
var MAX_DECOMPRESS_SIZE =
|
|
599
|
+
var MAX_DECOMPRESS_SIZE = _chunkMI655NV5cjs.unzipLimitBytes.call(void 0, 256 * 1024 * 1024);
|
|
600
600
|
var MAX_ZIP_ENTRIES = 500;
|
|
601
|
-
var ZipBombError = class extends
|
|
601
|
+
var ZipBombError = class extends _chunkMI655NV5cjs.KordocError {
|
|
602
602
|
constructor(message) {
|
|
603
603
|
super(message);
|
|
604
604
|
this.name = "ZipBombError";
|
|
@@ -648,7 +648,7 @@ function createSectionShared() {
|
|
|
648
648
|
function createXmlParser(warnings) {
|
|
649
649
|
return new (0, _xmldom.DOMParser)({
|
|
650
650
|
onError(level, msg2) {
|
|
651
|
-
if (level === "fatalError") throw new (0,
|
|
651
|
+
if (level === "fatalError") throw new (0, _chunkMI655NV5cjs.KordocError)(`XML \uD30C\uC2F1 \uC2E4\uD328: ${msg2}`);
|
|
652
652
|
_optionalChain([warnings, 'optionalAccess', _5 => _5.push, 'call', _6 => _6({ code: "MALFORMED_XML", message: `XML ${level === "warning" ? "\uACBD\uACE0" : "\uC624\uB958"}: ${msg2}` })]);
|
|
653
653
|
}
|
|
654
654
|
});
|
|
@@ -683,13 +683,13 @@ function parseEncryptionManifest(manifestXml) {
|
|
|
683
683
|
const startKey = attrOf(inner, "start-key-generation-name");
|
|
684
684
|
const checksumType = attrOf(inner, "checksum-type");
|
|
685
685
|
if (algorithm !== AES256_CBC) {
|
|
686
|
-
throw new (0,
|
|
686
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWPX \uC554\uD638\uD654 \uBC29\uC2DD\uC785\uB2C8\uB2E4: ${_nullishCoalesce(algorithm, () => ( "(\uBBF8\uC0C1)"))}`);
|
|
687
687
|
}
|
|
688
688
|
if (startKey !== START_KEY_SHA256) {
|
|
689
|
-
throw new (0,
|
|
689
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWPX \uC2DC\uC791\uD0A4 \uC0DD\uC131 \uBC29\uC2DD\uC785\uB2C8\uB2E4: ${_nullishCoalesce(startKey, () => ( "(\uBBF8\uC0C1)"))}`);
|
|
690
690
|
}
|
|
691
691
|
if (!_optionalChain([checksumType, 'optionalAccess', _10 => _10.endsWith, 'call', _11 => _11(CHECKSUM_SHA256_1K)])) {
|
|
692
|
-
throw new (0,
|
|
692
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWPX \uCCB4\uD06C\uC12C \uBC29\uC2DD\uC785\uB2C8\uB2E4: ${_nullishCoalesce(checksumType, () => ( "(\uBBF8\uC0C1)"))}`);
|
|
693
693
|
}
|
|
694
694
|
const iterations = parseInt(_nullishCoalesce(attrOf(inner, "iteration-count"), () => ( "")), 10);
|
|
695
695
|
const keySize = parseInt(_nullishCoalesce(attrOf(inner, "key-size"), () => ( "")), 10);
|
|
@@ -697,10 +697,10 @@ function parseEncryptionManifest(manifestXml) {
|
|
|
697
697
|
const salt = Buffer.from(_nullishCoalesce(attrOf(inner, "salt"), () => ( "")), "base64");
|
|
698
698
|
const checksum = Buffer.from(_nullishCoalesce(attrOf(inner, "checksum"), () => ( "")), "base64");
|
|
699
699
|
if (!(iterations > 0 && iterations <= MAX_ITERATION_COUNT)) {
|
|
700
|
-
throw new (0,
|
|
700
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`HWPX \uC554\uD638\uD654 \uBC18\uBCF5 \uD69F\uC218\uAC00 \uD5C8\uC6A9 \uBC94\uC704\uB97C \uBC97\uC5B4\uB0AC\uC2B5\uB2C8\uB2E4: ${iterations}`);
|
|
701
701
|
}
|
|
702
702
|
if (keySize !== 32 || iv.length !== 16 || salt.length === 0 || checksum.length !== 32) {
|
|
703
|
-
throw new (0,
|
|
703
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`HWPX \uC554\uD638\uD654 \uD30C\uB77C\uBBF8\uD130\uAC00 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 (${path})`);
|
|
704
704
|
}
|
|
705
705
|
entries.push({ path, checksum, iv, salt, iterations, keySize });
|
|
706
706
|
}
|
|
@@ -734,12 +734,12 @@ async function decryptHwpxInPlace(zip, manifestXml, password) {
|
|
|
734
734
|
for (const entry of entries) {
|
|
735
735
|
const file = zip.file(entry.path);
|
|
736
736
|
if (!file) {
|
|
737
|
-
throw new (0,
|
|
737
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`\uC554\uD638 \uBAA9\uB85D\uC5D0 \uC788\uB294 \uD30C\uC77C\uC774 \uBB38\uC11C\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4: ${entry.path}`);
|
|
738
738
|
}
|
|
739
739
|
const raw = await readZipEntry(file, "uint8array", used);
|
|
740
740
|
const plain4 = decryptEntry(Buffer.from(raw.buffer, raw.byteOffset, raw.length), entry, startKey);
|
|
741
741
|
if (!plain4) {
|
|
742
|
-
throw new (0,
|
|
742
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("\uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uAC70\uB098 \uC554\uD638\uD654 \uB370\uC774\uD130\uAC00 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
743
743
|
}
|
|
744
744
|
used += plain4.length;
|
|
745
745
|
if (used > MAX_DECOMPRESS_SIZE) throw new ZipBombError("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
@@ -805,10 +805,10 @@ async function extractHwpxStyles(zip, decompressed) {
|
|
|
805
805
|
const xml = await readZipEntry(file, "text", _optionalChain([decompressed, 'optionalAccess', _12 => _12.total]));
|
|
806
806
|
if (decompressed) {
|
|
807
807
|
decompressed.total += xml.length * 2;
|
|
808
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
808
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkMI655NV5cjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
809
809
|
}
|
|
810
810
|
const parser = createXmlParser();
|
|
811
|
-
const doc = parser.parseFromString(
|
|
811
|
+
const doc = parser.parseFromString(_chunkMI655NV5cjs.stripDtd.call(void 0, xml), "text/xml");
|
|
812
812
|
if (!doc.documentElement) continue;
|
|
813
813
|
const domDoc = doc;
|
|
814
814
|
parseCharProperties(domDoc, result.charProperties);
|
|
@@ -1021,9 +1021,9 @@ function detectHwpxHeadings(blocks, styleMap, tocTexts) {
|
|
|
1021
1021
|
let level = 0;
|
|
1022
1022
|
if (baseFontSize > 0 && _optionalChain([block, 'access', _21 => _21.style, 'optionalAccess', _22 => _22.fontSize])) {
|
|
1023
1023
|
const ratio = block.style.fontSize / baseFontSize;
|
|
1024
|
-
if (ratio >=
|
|
1025
|
-
else if (ratio >=
|
|
1026
|
-
else if (ratio >=
|
|
1024
|
+
if (ratio >= _chunkSJ5OZXELcjs.HEADING_RATIO_H1) level = 1;
|
|
1025
|
+
else if (ratio >= _chunkSJ5OZXELcjs.HEADING_RATIO_H2) level = 2;
|
|
1026
|
+
else if (ratio >= _chunkSJ5OZXELcjs.HEADING_RATIO_H3) level = 3;
|
|
1027
1027
|
}
|
|
1028
1028
|
const compactText = text.replace(/\s+/g, "");
|
|
1029
1029
|
if (/^제\d+[조장절편]/.test(compactText) && text.length <= 50) {
|
|
@@ -1758,7 +1758,7 @@ function resolveParaHeading(paraEl, ctx) {
|
|
|
1758
1758
|
|
|
1759
1759
|
// src/hwpx/table-build.ts
|
|
1760
1760
|
function buildTableWithCellMeta(state, keepAnchoredEmptyCols, keepEmptyParagraphs) {
|
|
1761
|
-
const table2 =
|
|
1761
|
+
const table2 = _chunkSJ5OZXELcjs.buildTable.call(void 0, state.rows, { keepAnchoredEmptyCols, keepEmptyParagraphs });
|
|
1762
1762
|
if (state.caption) table2.caption = state.caption;
|
|
1763
1763
|
if (state.sourceId) table2.sourceId = state.sourceId;
|
|
1764
1764
|
if (_optionalChain([state, 'access', _32 => _32.captionBlocks, 'optionalAccess', _33 => _33.length])) table2.captionBlocks = state.captionBlocks;
|
|
@@ -1787,7 +1787,7 @@ function buildTableWithCellMeta(state, keepAnchoredEmptyCols, keepEmptyParagraph
|
|
|
1787
1787
|
for (const src of row) {
|
|
1788
1788
|
if (!src.edges || src.rowAddr === void 0 || src.colAddr === void 0) continue;
|
|
1789
1789
|
const cand = _optionalChain([table2, 'access', _37 => _37.cells, 'access', _38 => _38[src.rowAddr], 'optionalAccess', _39 => _39[src.colAddr]]);
|
|
1790
|
-
if (cand && anchors2.includes(cand))
|
|
1790
|
+
if (cand && anchors2.includes(cand)) _chunkSJ5OZXELcjs.CELL_EDGES.set(cand, src.edges);
|
|
1791
1791
|
}
|
|
1792
1792
|
}
|
|
1793
1793
|
const claimed = /* @__PURE__ */ new Set();
|
|
@@ -1837,7 +1837,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
|
|
|
1837
1837
|
const cell2 = parentTable.cell;
|
|
1838
1838
|
(cell2.blocks ??= []).push(block);
|
|
1839
1839
|
cell2.hasStructure = true;
|
|
1840
|
-
let flat =
|
|
1840
|
+
let flat = _chunkSJ5OZXELcjs.convertTableToText.call(void 0, newTable.rows);
|
|
1841
1841
|
if (newTable.caption) flat = newTable.caption + (flat ? "\n" + flat : "");
|
|
1842
1842
|
if (flat) {
|
|
1843
1843
|
const inlineJoin = newTable.inline === true && cell2.lineOpen === true;
|
|
@@ -2071,7 +2071,7 @@ function extractRunSpans(para2, ctx, mode, requireMixed) {
|
|
|
2071
2071
|
const tkids = rc.childNodes;
|
|
2072
2072
|
for (let k = 0; k < (_nullishCoalesce(_optionalChain([tkids, 'optionalAccess', _47 => _47.length]), () => ( 0))); k++) {
|
|
2073
2073
|
const tk = tkids[k];
|
|
2074
|
-
if (tk.nodeType === 3 || tk.nodeType === 4) text +=
|
|
2074
|
+
if (tk.nodeType === 3 || tk.nodeType === 4) text += _chunkSJ5OZXELcjs.escapeLiteralTags.call(void 0, _chunkSJ5OZXELcjs.escapeLiteralDollar.call(void 0, tk.textContent || ""));
|
|
2075
2075
|
else if (tk.nodeType === 1) {
|
|
2076
2076
|
const ttag = (tk.tagName || tk.localName || "").replace(/^[^:]+:/, "");
|
|
2077
2077
|
if (ttag === "tab" || ttag === "fwSpace" || ttag === "hwSpace" || ttag === "nbSpace") text += " ";
|
|
@@ -2091,7 +2091,7 @@ function extractRunSpans(para2, ctx, mode, requireMixed) {
|
|
|
2091
2091
|
const span2 = { text };
|
|
2092
2092
|
if (mode !== "foreign" && prId === KORDOC_CHAR_CODE) span2.code = true;
|
|
2093
2093
|
else {
|
|
2094
|
-
if (_optionalChain([cp, 'optionalAccess', _48 => _48.script])) span2.text =
|
|
2094
|
+
if (_optionalChain([cp, 'optionalAccess', _48 => _48.script])) span2.text = _chunkSJ5OZXELcjs.wrapScript.call(void 0, text, cp.script);
|
|
2095
2095
|
if (_optionalChain([cp, 'optionalAccess', _49 => _49.bold])) span2.bold = true;
|
|
2096
2096
|
if (_optionalChain([cp, 'optionalAccess', _50 => _50.italic])) span2.italic = true;
|
|
2097
2097
|
if (_optionalChain([cp, 'optionalAccess', _51 => _51.strike])) span2.strike = true;
|
|
@@ -2111,7 +2111,7 @@ function extractRunSpans(para2, ctx, mode, requireMixed) {
|
|
|
2111
2111
|
}
|
|
2112
2112
|
}
|
|
2113
2113
|
if (requireMixed && !merged.some((s) => s.strike || s.underline) && !merged.some((s) => !(s.bold || s.italic || s.code))) return null;
|
|
2114
|
-
for (const s of merged) s.text =
|
|
2114
|
+
for (const s of merged) s.text = _chunkSJ5OZXELcjs.tidyScriptTags.call(void 0, s.text);
|
|
2115
2115
|
return merged;
|
|
2116
2116
|
}
|
|
2117
2117
|
function gongmunDepthFromIndent(para2, left, ctx) {
|
|
@@ -2138,7 +2138,7 @@ function gongmunDepthFromIndent(para2, left, ctx) {
|
|
|
2138
2138
|
// src/hwpx/section-walker.ts
|
|
2139
2139
|
function parseSectionXml(xml, styleMap, warnings, sectionNum, shared) {
|
|
2140
2140
|
const parser = createXmlParser(warnings);
|
|
2141
|
-
const doc = parser.parseFromString(
|
|
2141
|
+
const doc = parser.parseFromString(_chunkMI655NV5cjs.stripDtd.call(void 0, xml), "text/xml");
|
|
2142
2142
|
if (!doc.documentElement) return [];
|
|
2143
2143
|
const ctx = { styleMap, warnings, sectionNum, shared: _nullishCoalesce(shared, () => ( createSectionShared())) };
|
|
2144
2144
|
ctx.shared.track.deleteDepth = 0;
|
|
@@ -2239,8 +2239,8 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
|
|
|
2239
2239
|
const cs = isNaN(rawCs) ? 1 : rawCs;
|
|
2240
2240
|
const rawRs = parseInt(el.getAttribute("rowSpan") || "1", 10);
|
|
2241
2241
|
const rs = isNaN(rawRs) ? 1 : rawRs;
|
|
2242
|
-
tableCtx.cell.colSpan = clampSpan(cs,
|
|
2243
|
-
tableCtx.cell.rowSpan = clampSpan(rs,
|
|
2242
|
+
tableCtx.cell.colSpan = clampSpan(cs, _chunkSJ5OZXELcjs.MAX_COLS);
|
|
2243
|
+
tableCtx.cell.rowSpan = clampSpan(rs, _chunkSJ5OZXELcjs.MAX_ROWS);
|
|
2244
2244
|
}
|
|
2245
2245
|
break;
|
|
2246
2246
|
case "p": {
|
|
@@ -2563,7 +2563,7 @@ function buildSubListTable(el, ctx, depth) {
|
|
|
2563
2563
|
const sink = [];
|
|
2564
2564
|
const st = { rows: [], currentRow: [], cell: null, sourceId: _nullishCoalesce(el.getAttribute("id"), () => ( void 0)) };
|
|
2565
2565
|
walkSection(el, sink, st, [], ctx, depth + 1);
|
|
2566
|
-
let flat =
|
|
2566
|
+
let flat = _chunkSJ5OZXELcjs.convertTableToText.call(void 0, st.rows);
|
|
2567
2567
|
if (st.caption) flat = st.caption + (flat ? "\n" + flat : "");
|
|
2568
2568
|
const built = [];
|
|
2569
2569
|
completeTable(st, [], built, ctx);
|
|
@@ -2727,7 +2727,7 @@ function extractHyperlinkHref(fieldBegin) {
|
|
|
2727
2727
|
let url = (ch.textContent || "").trim();
|
|
2728
2728
|
if (!url) continue;
|
|
2729
2729
|
url = url.replace(/^https?:\/\/(?=https?:\/\/)/i, "");
|
|
2730
|
-
const safe =
|
|
2730
|
+
const safe = _chunkMI655NV5cjs.sanitizeHref.call(void 0, url);
|
|
2731
2731
|
if (safe) return safe;
|
|
2732
2732
|
}
|
|
2733
2733
|
return void 0;
|
|
@@ -2883,7 +2883,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
|
|
|
2883
2883
|
_optionalChain([ctx, 'access', _112 => _112.warnings, 'optionalAccess', _113 => _113.push, 'call', _114 => _114({ page: ctx.page, message: "\uBCC0\uACBD\uCD94\uC801 \uC0AD\uC81C \uD14D\uC2A4\uD2B8 \uCD9C\uB825 \uC81C\uC678", code: "HIDDEN_TEXT_FILTERED" })]);
|
|
2884
2884
|
}
|
|
2885
2885
|
} else {
|
|
2886
|
-
text +=
|
|
2886
|
+
text += _chunkSJ5OZXELcjs.escapeLiteralTags.call(void 0, _chunkSJ5OZXELcjs.escapeLiteralDollar.call(void 0, t.replace(/\x1E/g, "")));
|
|
2887
2887
|
}
|
|
2888
2888
|
continue;
|
|
2889
2889
|
}
|
|
@@ -2936,7 +2936,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
|
|
|
2936
2936
|
case "hyperlink": {
|
|
2937
2937
|
const url = child.getAttribute("url") || child.getAttribute("href") || "";
|
|
2938
2938
|
if (url) {
|
|
2939
|
-
const safe =
|
|
2939
|
+
const safe = _chunkMI655NV5cjs.sanitizeHref.call(void 0, url);
|
|
2940
2940
|
if (safe) href = safe;
|
|
2941
2941
|
}
|
|
2942
2942
|
walk(child, depth + 1);
|
|
@@ -3030,7 +3030,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
|
|
|
3030
3030
|
walk(child, depth + 1);
|
|
3031
3031
|
if (script && linkRanges.length === nLinks && openFields.length === nOpen && runHasOnlyText(child)) {
|
|
3032
3032
|
const added = text.slice(start);
|
|
3033
|
-
if (added && !/[\x1E\n$]/.test(added)) text = text.slice(0, start) +
|
|
3033
|
+
if (added && !/[\x1E\n$]/.test(added)) text = text.slice(0, start) + _chunkSJ5OZXELcjs.wrapScript.call(void 0, added, script);
|
|
3034
3034
|
}
|
|
3035
3035
|
break;
|
|
3036
3036
|
}
|
|
@@ -3053,7 +3053,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
|
|
|
3053
3053
|
}
|
|
3054
3054
|
if (applied.length) href = void 0;
|
|
3055
3055
|
}
|
|
3056
|
-
text =
|
|
3056
|
+
text = _chunkSJ5OZXELcjs.tidyScriptTags.call(void 0, text);
|
|
3057
3057
|
const toc = takeTocLeaders(text);
|
|
3058
3058
|
text = toc.text;
|
|
3059
3059
|
const tocEntry = toc.tocEntry;
|
|
@@ -3167,7 +3167,7 @@ function decompressStream(data) {
|
|
|
3167
3167
|
return _zlib.inflateRawSync.call(void 0, data, opts);
|
|
3168
3168
|
}
|
|
3169
3169
|
function parseFileHeader(data) {
|
|
3170
|
-
if (data.length < 40) throw new (0,
|
|
3170
|
+
if (data.length < 40) throw new (0, _chunkMI655NV5cjs.KordocError)("FileHeader\uAC00 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4 (\uCD5C\uC18C 40\uBC14\uC774\uD2B8)");
|
|
3171
3171
|
const sig = data.subarray(0, 32).toString("utf8").replace(/\0+$/, "");
|
|
3172
3172
|
return {
|
|
3173
3173
|
signature: sig,
|
|
@@ -3694,13 +3694,13 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
3694
3694
|
}
|
|
3695
3695
|
const allCandidates = resolvedPath ? [resolvedPath, ...candidates] : candidates;
|
|
3696
3696
|
for (const path of allCandidates) {
|
|
3697
|
-
if (
|
|
3697
|
+
if (_chunkMI655NV5cjs.isPathTraversal.call(void 0, path)) continue;
|
|
3698
3698
|
const file = zip.file(path);
|
|
3699
3699
|
if (!file) continue;
|
|
3700
3700
|
try {
|
|
3701
3701
|
const data = await readZipEntry(file, "uint8array", decompressed.total);
|
|
3702
3702
|
decompressed.total += data.length;
|
|
3703
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3703
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkMI655NV5cjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3704
3704
|
const ext = path.includes(".") ? path.split(".").pop() || "png" : "png";
|
|
3705
3705
|
const extMime = imageExtToMime(ext);
|
|
3706
3706
|
const mimeType = extMime === "image/svg+xml" && /<script|\son[a-z]+\s*=|javascript:|<foreignObject/i.test(Buffer.from(data).toString("utf8")) ? "application/octet-stream" : extMime;
|
|
@@ -3711,7 +3711,7 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
3711
3711
|
usedPaths.add(path);
|
|
3712
3712
|
break;
|
|
3713
3713
|
} catch (err) {
|
|
3714
|
-
if (err instanceof
|
|
3714
|
+
if (err instanceof _chunkMI655NV5cjs.KordocError) throw err;
|
|
3715
3715
|
}
|
|
3716
3716
|
}
|
|
3717
3717
|
if (!img) _optionalChain([warnings, 'optionalAccess', _128 => _128.push, 'call', _129 => _129({ page: block.pageNumber, message: `\uC774\uBBF8\uC9C0 \uD30C\uC77C \uC5C6\uC74C: ${ref}`, code: "SKIPPED_IMAGE" })]);
|
|
@@ -3731,13 +3731,13 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
3731
3731
|
if (sweepUnreferenced) {
|
|
3732
3732
|
const binEntries = zip.file(/(?:^|\/)BinData\//i);
|
|
3733
3733
|
for (const file of binEntries) {
|
|
3734
|
-
if (file.dir || usedPaths.has(file.name) ||
|
|
3734
|
+
if (file.dir || usedPaths.has(file.name) || _chunkMI655NV5cjs.isPathTraversal.call(void 0, file.name)) continue;
|
|
3735
3735
|
const basename = file.name.slice(file.name.lastIndexOf("/") + 1);
|
|
3736
3736
|
if (_optionalChain([deletedRefs, 'optionalAccess', _130 => _130.has, 'call', _131 => _131(file.name)]) || _optionalChain([deletedRefs, 'optionalAccess', _132 => _132.has, 'call', _133 => _133(basename)]) || _optionalChain([deletedRefs, 'optionalAccess', _134 => _134.has, 'call', _135 => _135(file.name.replace(/\.[^/.]+$/, ""))]) || _optionalChain([deletedRefs, 'optionalAccess', _136 => _136.has, 'call', _137 => _137(basename.replace(/\.[^.]+$/, ""))])) continue;
|
|
3737
3737
|
try {
|
|
3738
3738
|
const data = await readZipEntry(file, "uint8array", decompressed.total);
|
|
3739
3739
|
decompressed.total += data.length;
|
|
3740
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3740
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkMI655NV5cjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3741
3741
|
const ext = file.name.includes(".") ? file.name.split(".").pop() || "" : "";
|
|
3742
3742
|
let mimeType = imageExtToMime(ext);
|
|
3743
3743
|
if (mimeType === "application/octet-stream") {
|
|
@@ -3751,7 +3751,7 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
3751
3751
|
images.push(img);
|
|
3752
3752
|
blocks.push({ type: "image", text: filename, imageData: { data, mimeType, filename: file.name } });
|
|
3753
3753
|
} catch (err) {
|
|
3754
|
-
if (err instanceof
|
|
3754
|
+
if (err instanceof _chunkMI655NV5cjs.KordocError) throw err;
|
|
3755
3755
|
_optionalChain([warnings, 'optionalAccess', _138 => _138.push, 'call', _139 => _139({ message: `\uC774\uBBF8\uC9C0 \uCD94\uCD9C \uC2E4\uD328: ${file.name}`, code: "SKIPPED_IMAGE" })]);
|
|
3756
3756
|
}
|
|
3757
3757
|
}
|
|
@@ -3802,7 +3802,7 @@ function extractFromBrokenZip(buffer, options) {
|
|
|
3802
3802
|
}
|
|
3803
3803
|
const nameBytes = data.slice(pos + 30, pos + 30 + nameLen);
|
|
3804
3804
|
const name = new TextDecoder().decode(nameBytes);
|
|
3805
|
-
if (
|
|
3805
|
+
if (_chunkMI655NV5cjs.isPathTraversal.call(void 0, name)) {
|
|
3806
3806
|
pos = fileStart + compSize;
|
|
3807
3807
|
continue;
|
|
3808
3808
|
}
|
|
@@ -3820,7 +3820,7 @@ function extractFromBrokenZip(buffer, options) {
|
|
|
3820
3820
|
continue;
|
|
3821
3821
|
}
|
|
3822
3822
|
totalDecompressed += content.length * 2;
|
|
3823
|
-
if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3823
|
+
if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0, _chunkMI655NV5cjs.KordocError)("\uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC");
|
|
3824
3824
|
sectionNum++;
|
|
3825
3825
|
const secBlocks = parseSectionXml(content, void 0, warnings, sectionNum, shared);
|
|
3826
3826
|
for (const b of secBlocks) b.pageNumber = sectionNum;
|
|
@@ -3829,9 +3829,9 @@ function extractFromBrokenZip(buffer, options) {
|
|
|
3829
3829
|
continue;
|
|
3830
3830
|
}
|
|
3831
3831
|
}
|
|
3832
|
-
if (blocks.length === 0) throw new (0,
|
|
3832
|
+
if (blocks.length === 0) throw new (0, _chunkMI655NV5cjs.KordocError)("\uC190\uC0C1\uB41C HWPX\uC5D0\uC11C \uC139\uC158 \uB370\uC774\uD130\uB97C \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
3833
3833
|
applyPageText(blocks, shared);
|
|
3834
|
-
const markdown =
|
|
3834
|
+
const markdown = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _140 => _140.tableFormat]) });
|
|
3835
3835
|
return { markdown, blocks, warnings: warnings.length > 0 ? warnings : void 0 };
|
|
3836
3836
|
}
|
|
3837
3837
|
async function readKordocLayout(zip) {
|
|
@@ -3856,11 +3856,11 @@ async function resolveSectionPaths(zip) {
|
|
|
3856
3856
|
if (paths.length > 0) return paths;
|
|
3857
3857
|
}
|
|
3858
3858
|
const sectionFiles = zip.file(/[Ss]ection\d+\.xml$/);
|
|
3859
|
-
return sectionFiles.map((f) => f.name).sort(
|
|
3859
|
+
return sectionFiles.map((f) => f.name).sort(_chunkMI655NV5cjs.compareSectionPaths);
|
|
3860
3860
|
}
|
|
3861
3861
|
function parseSectionPathsFromManifest(xml) {
|
|
3862
3862
|
const parser = createXmlParser();
|
|
3863
|
-
const doc = parser.parseFromString(
|
|
3863
|
+
const doc = parser.parseFromString(_chunkMI655NV5cjs.stripDtd.call(void 0, xml), "text/xml");
|
|
3864
3864
|
const opf = "http://www.idpf.org/2007/opf/";
|
|
3865
3865
|
const namespacedItems = doc.getElementsByTagNameNS(opf, "item");
|
|
3866
3866
|
const namespacedSpine = doc.getElementsByTagNameNS(opf, "itemref");
|
|
@@ -3870,7 +3870,7 @@ function parseSectionPathsFromManifest(xml) {
|
|
|
3870
3870
|
for (let i = 0; i < items.length; i++) {
|
|
3871
3871
|
const item = items[i];
|
|
3872
3872
|
const id = item.getAttribute("id") || "";
|
|
3873
|
-
const href =
|
|
3873
|
+
const href = _chunkMI655NV5cjs.normalizeSectionHref.call(void 0, item.getAttribute("href") || "");
|
|
3874
3874
|
if (id && href) idToHref.set(id, href);
|
|
3875
3875
|
}
|
|
3876
3876
|
if (spine.length > 0) {
|
|
@@ -3881,7 +3881,7 @@ function parseSectionPathsFromManifest(xml) {
|
|
|
3881
3881
|
}
|
|
3882
3882
|
if (ordered.length > 0) return ordered;
|
|
3883
3883
|
}
|
|
3884
|
-
return Array.from(idToHref.values()).sort(
|
|
3884
|
+
return Array.from(idToHref.values()).sort(_chunkMI655NV5cjs.compareSectionPaths);
|
|
3885
3885
|
}
|
|
3886
3886
|
|
|
3887
3887
|
// src/hwpx/metadata.ts
|
|
@@ -3893,7 +3893,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
|
|
|
3893
3893
|
const xml = await readZipEntry(file, "text", _optionalChain([decompressed, 'optionalAccess', _144 => _144.total]));
|
|
3894
3894
|
if (decompressed) {
|
|
3895
3895
|
decompressed.total += xml.length * 2;
|
|
3896
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3896
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunkMI655NV5cjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3897
3897
|
}
|
|
3898
3898
|
return xml;
|
|
3899
3899
|
};
|
|
@@ -3915,7 +3915,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
|
|
|
3915
3915
|
}
|
|
3916
3916
|
}
|
|
3917
3917
|
function parseOpfMetadata(xml, metadata) {
|
|
3918
|
-
const root = createXmlParser().parseFromString(
|
|
3918
|
+
const root = createXmlParser().parseFromString(_chunkMI655NV5cjs.stripDtd.call(void 0, xml), "text/xml").documentElement;
|
|
3919
3919
|
const md2 = root ? findChildByLocalName(root, "metadata") : null;
|
|
3920
3920
|
if (!md2) return;
|
|
3921
3921
|
let title;
|
|
@@ -3948,7 +3948,7 @@ function isoDate(s) {
|
|
|
3948
3948
|
}
|
|
3949
3949
|
function parseDublinCoreMetadata(xml, metadata) {
|
|
3950
3950
|
const parser = createXmlParser();
|
|
3951
|
-
const doc = parser.parseFromString(
|
|
3951
|
+
const doc = parser.parseFromString(_chunkMI655NV5cjs.stripDtd.call(void 0, xml), "text/xml");
|
|
3952
3952
|
if (!doc.documentElement) return;
|
|
3953
3953
|
const getText = (tagNames) => {
|
|
3954
3954
|
for (const tag of tagNames) {
|
|
@@ -3987,7 +3987,7 @@ function assignSectionPage(block, sectionNum) {
|
|
|
3987
3987
|
}
|
|
3988
3988
|
}
|
|
3989
3989
|
async function parseHwpxDocument(buffer, options) {
|
|
3990
|
-
|
|
3990
|
+
_chunkMI655NV5cjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
|
|
3991
3991
|
let zip;
|
|
3992
3992
|
try {
|
|
3993
3993
|
zip = await _jszip2.default.loadAsync(buffer);
|
|
@@ -3996,7 +3996,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3996
3996
|
}
|
|
3997
3997
|
const actualEntryCount = Object.keys(zip.files).length;
|
|
3998
3998
|
if (actualEntryCount > MAX_ZIP_ENTRIES) {
|
|
3999
|
-
throw new (0,
|
|
3999
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("ZIP \uC5D4\uD2B8\uB9AC \uC218 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
4000
4000
|
}
|
|
4001
4001
|
const manifestFile = zip.file("META-INF/manifest.xml");
|
|
4002
4002
|
if (manifestFile) {
|
|
@@ -4016,7 +4016,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
4016
4016
|
}
|
|
4017
4017
|
const hpfFile = zip.file("Contents/content.hpf");
|
|
4018
4018
|
const hpf = hpfFile ? await readZipEntry(hpfFile, "text").catch(() => "") : "";
|
|
4019
|
-
throw new (0,
|
|
4019
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(
|
|
4020
4020
|
/\bdistribution="1"/.test(_nullishCoalesce(hpf, () => ( ""))) ? "\uBC30\uD3EC\uC6A9\uC73C\uB85C \uC554\uD638\uD654\uB41C HWPX \uD30C\uC77C\uC785\uB2C8\uB2E4 (\uBC30\uD3EC\uC6A9 \uBCF5\uD638\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC74C). \uD55C\uCEF4\uC624\uD53C\uC2A4\uC5D0\uC11C \uC77C\uBC18 \uBB38\uC11C\uB85C \uC800\uC7A5\uD55C \uB4A4 \uC5EC\uC138\uC694." : "\uC554\uD638\uB85C \uBCF4\uD638\uB41C HWPX \uD30C\uC77C\uC785\uB2C8\uB2E4. password \uC635\uC158\uC5D0 \uC5F4\uAE30 \uC554\uD638\uB97C \uC9C0\uC815\uD558\uC138\uC694."
|
|
4021
4021
|
);
|
|
4022
4022
|
}
|
|
@@ -4028,7 +4028,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
4028
4028
|
const styleMap = await extractHwpxStyles(zip, decompressed);
|
|
4029
4029
|
const warnings = [];
|
|
4030
4030
|
const sectionPaths = await resolveSectionPaths(zip);
|
|
4031
|
-
if (sectionPaths.length === 0) throw new (0,
|
|
4031
|
+
if (sectionPaths.length === 0) throw new (0, _chunkMI655NV5cjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
4032
4032
|
let allBlocks = [];
|
|
4033
4033
|
const shared = createSectionShared();
|
|
4034
4034
|
shared.kordocLayout = await readKordocLayout(zip);
|
|
@@ -4072,10 +4072,10 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
4072
4072
|
const blocks = allBlocks;
|
|
4073
4073
|
applyPageText(blocks, shared);
|
|
4074
4074
|
const images = await extractImagesFromZip(zip, blocks, decompressed, warnings, !_optionalChain([options, 'optionalAccess', _173 => _173.pages]), shared.track.deletedImageRefs);
|
|
4075
|
-
const shown = _optionalChain([options, 'optionalAccess', _174 => _174.layoutTables]) === "keep" ? blocks :
|
|
4075
|
+
const shown = _optionalChain([options, 'optionalAccess', _174 => _174.layoutTables]) === "keep" ? blocks : _chunkSJ5OZXELcjs.unframeLayoutTables.call(void 0, blocks, !!_optionalChain([options, 'optionalAccess', _175 => _175.keepTrailingEmptyCols]));
|
|
4076
4076
|
detectHwpxHeadings(shown, styleMap, shared.tocTexts);
|
|
4077
4077
|
const outline = shown.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
|
|
4078
|
-
const markdown =
|
|
4078
|
+
const markdown = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, shown, { tableFormat: _optionalChain([options, 'optionalAccess', _176 => _176.tableFormat]) });
|
|
4079
4079
|
return { markdown, blocks: shown, metadata, outline: outline.length > 0 ? outline : void 0, warnings: warnings.length > 0 ? warnings : void 0, images: images.length > 0 ? images : void 0 };
|
|
4080
4080
|
}
|
|
4081
4081
|
|
|
@@ -4842,7 +4842,7 @@ function decryptPasswordStream(raw, password) {
|
|
|
4842
4842
|
var TAG_DOCUMENT_PROPERTIES = 16;
|
|
4843
4843
|
var TAG_ID_MAPPINGS2 = 17;
|
|
4844
4844
|
function assertDecryptedDocInfo(data, readRecords3) {
|
|
4845
|
-
const wrong = () => new (0,
|
|
4845
|
+
const wrong = () => new (0, _chunkMI655NV5cjs.KordocError)("\uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uAC70\uB098 \uC554\uD638\uD654 \uB370\uC774\uD130\uAC00 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
4846
4846
|
let records;
|
|
4847
4847
|
try {
|
|
4848
4848
|
records = readRecords3(data);
|
|
@@ -4854,7 +4854,7 @@ function assertDecryptedDocInfo(data, readRecords3) {
|
|
|
4854
4854
|
}
|
|
4855
4855
|
function assertSupportedEncryptVersion(version) {
|
|
4856
4856
|
if (version !== SUPPORTED_ENCRYPT_VERSION) {
|
|
4857
|
-
throw new (0,
|
|
4857
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(
|
|
4858
4858
|
`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWP \uC554\uD638\uD654 \uBC84\uC804\uC785\uB2C8\uB2E4 (EncryptVersion=${version}, \uC9C0\uC6D0: ${SUPPORTED_ENCRYPT_VERSION})`
|
|
4859
4859
|
);
|
|
4860
4860
|
}
|
|
@@ -5297,7 +5297,7 @@ function emitParagraphBlocks(p) {
|
|
|
5297
5297
|
return blocks;
|
|
5298
5298
|
}
|
|
5299
5299
|
function tableFlatText(table2) {
|
|
5300
|
-
const flat =
|
|
5300
|
+
const flat = _chunkSJ5OZXELcjs.convertTableToText.call(void 0, table2.cells);
|
|
5301
5301
|
return table2.caption ? table2.caption + (flat ? "\n" + flat : "") : flat;
|
|
5302
5302
|
}
|
|
5303
5303
|
function blocksPlainText(blocks, sep) {
|
|
@@ -5378,8 +5378,8 @@ ${cell2.text}` : cell2.text;
|
|
|
5378
5378
|
}
|
|
5379
5379
|
function buildAddressedTable(cells, rows, cols, keepAnchoredEmptyCols) {
|
|
5380
5380
|
for (const c of cells) {
|
|
5381
|
-
rows = Math.max(rows, Math.min((_nullishCoalesce(c.rowAddr, () => ( 0))) + 1,
|
|
5382
|
-
cols = Math.max(cols, Math.min((_nullishCoalesce(c.colAddr, () => ( 0))) + 1,
|
|
5381
|
+
rows = Math.max(rows, Math.min((_nullishCoalesce(c.rowAddr, () => ( 0))) + 1, _chunkSJ5OZXELcjs.MAX_ROWS));
|
|
5382
|
+
cols = Math.max(cols, Math.min((_nullishCoalesce(c.colAddr, () => ( 0))) + 1, _chunkSJ5OZXELcjs.MAX_COLS));
|
|
5383
5383
|
}
|
|
5384
5384
|
const placed = resolveCellOverlaps(cells, rows, cols);
|
|
5385
5385
|
const byRow = Array.from({ length: rows }, () => []);
|
|
@@ -5387,12 +5387,12 @@ function buildAddressedTable(cells, rows, cols, keepAnchoredEmptyCols) {
|
|
|
5387
5387
|
const r = _nullishCoalesce(c.rowAddr, () => ( 0));
|
|
5388
5388
|
if (r < rows && (_nullishCoalesce(c.colAddr, () => ( 0))) < cols) byRow[r].push(c);
|
|
5389
5389
|
}
|
|
5390
|
-
const table2 =
|
|
5390
|
+
const table2 = _chunkSJ5OZXELcjs.buildTable.call(void 0, byRow, { keepAnchoredEmptyCols });
|
|
5391
5391
|
if (table2.rows === 0) return null;
|
|
5392
5392
|
for (const c of placed) {
|
|
5393
5393
|
if (c.edges) {
|
|
5394
5394
|
const at = _optionalChain([table2, 'access', _183 => _183.cells, 'access', _184 => _184[_nullishCoalesce(c.rowAddr, () => ( 0))], 'optionalAccess', _185 => _185[_nullishCoalesce(c.colAddr, () => ( 0))]]);
|
|
5395
|
-
if (at)
|
|
5395
|
+
if (at) _chunkSJ5OZXELcjs.CELL_EDGES.set(at, c.edges);
|
|
5396
5396
|
}
|
|
5397
5397
|
if (!_optionalChain([c, 'access', _186 => _186.blocks, 'optionalAccess', _187 => _187.length]) && !c.isHeader) continue;
|
|
5398
5398
|
const target = _optionalChain([table2, 'access', _188 => _188.cells, 'access', _189 => _189[_nullishCoalesce(c.rowAddr, () => ( 0))], 'optionalAccess', _190 => _190[_nullishCoalesce(c.colAddr, () => ( 0))]]);
|
|
@@ -5594,7 +5594,7 @@ function parseParagraph(records, start, end, ctx) {
|
|
|
5594
5594
|
continue;
|
|
5595
5595
|
}
|
|
5596
5596
|
if (!ctrl.href) continue;
|
|
5597
|
-
const href =
|
|
5597
|
+
const href = _chunkMI655NV5cjs.sanitizeHref.call(void 0, ctrl.href);
|
|
5598
5598
|
if (!href) continue;
|
|
5599
5599
|
if (!anchor.trim() || anchor.includes(INLINE_TABLE_MARK)) continue;
|
|
5600
5600
|
text = text.slice(0, r.start) + `[${anchor}](${href})` + text.slice(r.end);
|
|
@@ -5603,7 +5603,7 @@ function parseParagraph(records, start, end, ctx) {
|
|
|
5603
5603
|
}
|
|
5604
5604
|
if (text.includes(LITERAL_DOLLAR_MARK)) text = text.replaceAll(LITERAL_DOLLAR_MARK, "\\$");
|
|
5605
5605
|
text = resolveLiteralLt(text);
|
|
5606
|
-
text =
|
|
5606
|
+
text = _chunkSJ5OZXELcjs.tidyScriptTags.call(void 0, text);
|
|
5607
5607
|
const toc = takeTocLeaders(text);
|
|
5608
5608
|
text = toc.text;
|
|
5609
5609
|
let headingLevel = 0;
|
|
@@ -5823,7 +5823,7 @@ function hyperlinkUrlFromCommand(command) {
|
|
|
5823
5823
|
}
|
|
5824
5824
|
var A4_HEIGHT = 84188;
|
|
5825
5825
|
function keepUnlessPageSpanning(table2, cells) {
|
|
5826
|
-
if (!cells.some((c) => c.pageSpanning))
|
|
5826
|
+
if (!cells.some((c) => c.pageSpanning)) _chunkSJ5OZXELcjs.markNonLayoutTable.call(void 0, table2);
|
|
5827
5827
|
}
|
|
5828
5828
|
function parseTableControl(ctrl, records, ctx) {
|
|
5829
5829
|
if (ctx.depth >= MAX_NEST_DEPTH) return null;
|
|
@@ -5835,8 +5835,8 @@ function parseTableControl(ctrl, records, ctx) {
|
|
|
5835
5835
|
let tableIdx = -1;
|
|
5836
5836
|
for (let i2 = childStart; i2 < childEnd; i2++) {
|
|
5837
5837
|
if (records[i2].tagId === TAG_TABLE && records[i2].level === directLevel && records[i2].data.length >= 8) {
|
|
5838
|
-
rows = Math.min(records[i2].data.readUInt16LE(4),
|
|
5839
|
-
cols = Math.min(records[i2].data.readUInt16LE(6),
|
|
5838
|
+
rows = Math.min(records[i2].data.readUInt16LE(4), _chunkSJ5OZXELcjs.MAX_ROWS);
|
|
5839
|
+
cols = Math.min(records[i2].data.readUInt16LE(6), _chunkSJ5OZXELcjs.MAX_COLS);
|
|
5840
5840
|
tableIdx = i2;
|
|
5841
5841
|
break;
|
|
5842
5842
|
}
|
|
@@ -5880,11 +5880,11 @@ function parseTableControl(ctrl, records, ctx) {
|
|
|
5880
5880
|
return table3;
|
|
5881
5881
|
}
|
|
5882
5882
|
if (rows === 0 || cols === 0) {
|
|
5883
|
-
rows = Math.min(cells.length,
|
|
5883
|
+
rows = Math.min(cells.length, _chunkSJ5OZXELcjs.MAX_ROWS);
|
|
5884
5884
|
cols = 1;
|
|
5885
5885
|
}
|
|
5886
5886
|
const cellRows = arrangeCells(rows, cols, cells);
|
|
5887
|
-
const table2 =
|
|
5887
|
+
const table2 = _chunkSJ5OZXELcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: ctx.doc.keepTrailingEmptyCols });
|
|
5888
5888
|
if (caption && table2.rows > 0) table2.caption = caption;
|
|
5889
5889
|
if (sourceId && table2.rows > 0) table2.sourceId = sourceId;
|
|
5890
5890
|
keepUnlessPageSpanning(table2, cells);
|
|
@@ -5903,8 +5903,8 @@ function parseCell(records, lhIdx, end, ctx) {
|
|
|
5903
5903
|
rowAddr = rec.data.readUInt16LE(10);
|
|
5904
5904
|
const cs = rec.data.readUInt16LE(12);
|
|
5905
5905
|
const rs = rec.data.readUInt16LE(14);
|
|
5906
|
-
if (cs > 0) colSpan = Math.min(cs,
|
|
5907
|
-
if (rs > 0) rowSpan = Math.min(rs,
|
|
5906
|
+
if (cs > 0) colSpan = Math.min(cs, _chunkSJ5OZXELcjs.MAX_COLS);
|
|
5907
|
+
if (rs > 0) rowSpan = Math.min(rs, _chunkSJ5OZXELcjs.MAX_ROWS);
|
|
5908
5908
|
}
|
|
5909
5909
|
const blocks = ctx.depth < MAX_NEST_DEPTH ? parseParagraphList(records, lhIdx + 1, end, { ...ctx, depth: ctx.depth + 1 }) : [];
|
|
5910
5910
|
const { text, hasStructure } = cellTextFromBlocks(blocks);
|
|
@@ -6053,7 +6053,7 @@ function openHwp5Container(buffer, options) {
|
|
|
6053
6053
|
lenientCfb = parseLenientCfb(buffer);
|
|
6054
6054
|
warnings.push({ message: "\uC190\uC0C1\uB41C CFB \uCEE8\uD14C\uC774\uB108 \u2014 lenient \uBAA8\uB4DC\uB85C \uBCF5\uAD6C", code: "LENIENT_CFB_RECOVERY" });
|
|
6055
6055
|
} catch (e24) {
|
|
6056
|
-
throw new (0,
|
|
6056
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328 (strict \uBC0F lenient \uBAA8\uB450)");
|
|
6057
6057
|
}
|
|
6058
6058
|
}
|
|
6059
6059
|
const readRawStream = (path) => {
|
|
@@ -6064,14 +6064,14 @@ function openHwp5Container(buffer, options) {
|
|
|
6064
6064
|
return lenientCfb.findStream(path);
|
|
6065
6065
|
};
|
|
6066
6066
|
const headerData = readRawStream("/FileHeader");
|
|
6067
|
-
if (!headerData) throw new (0,
|
|
6067
|
+
if (!headerData) throw new (0, _chunkMI655NV5cjs.KordocError)("FileHeader \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
|
|
6068
6068
|
const header = parseFileHeader(headerData);
|
|
6069
|
-
if (header.signature !== "HWP Document File") throw new (0,
|
|
6070
|
-
if (header.flags & FLAG_DRM) throw new (0,
|
|
6069
|
+
if (header.signature !== "HWP Document File") throw new (0, _chunkMI655NV5cjs.KordocError)("HWP \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
6070
|
+
if (header.flags & FLAG_DRM) throw new (0, _chunkMI655NV5cjs.KordocError)("DRM \uBCF4\uD638\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
6071
6071
|
const encrypted = (header.flags & FLAG_ENCRYPTED) !== 0;
|
|
6072
6072
|
if (encrypted) {
|
|
6073
6073
|
if (!_optionalChain([options, 'optionalAccess', _214 => _214.password])) {
|
|
6074
|
-
throw new (0,
|
|
6074
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("\uC554\uD638\uB85C \uBCF4\uD638\uB41C HWP \uBB38\uC11C\uC785\uB2C8\uB2E4. password \uC635\uC158\uC5D0 \uC5F4\uAE30 \uC554\uD638\uB97C \uC9C0\uC815\uD558\uC138\uC694.");
|
|
6075
6075
|
}
|
|
6076
6076
|
assertSupportedEncryptVersion(readEncryptVersion(headerData));
|
|
6077
6077
|
}
|
|
@@ -6085,12 +6085,12 @@ function openHwp5Container(buffer, options) {
|
|
|
6085
6085
|
const distribution = (header.flags & FLAG_DISTRIBUTION) !== 0;
|
|
6086
6086
|
if (encrypted) {
|
|
6087
6087
|
const rawDocInfo = findStream("/DocInfo");
|
|
6088
|
-
if (!rawDocInfo) throw new (0,
|
|
6088
|
+
if (!rawDocInfo) throw new (0, _chunkMI655NV5cjs.KordocError)("DocInfo \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
|
|
6089
6089
|
let docInfoData;
|
|
6090
6090
|
try {
|
|
6091
6091
|
docInfoData = compressed ? decompressStream(rawDocInfo) : rawDocInfo;
|
|
6092
6092
|
} catch (e25) {
|
|
6093
|
-
throw new (0,
|
|
6093
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("\uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uAC70\uB098 \uC554\uD638\uD654 \uB370\uC774\uD130\uAC00 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
6094
6094
|
}
|
|
6095
6095
|
assertDecryptedDocInfo(docInfoData, readRecords);
|
|
6096
6096
|
}
|
|
@@ -6115,10 +6115,10 @@ function readHwp5SectionRecords(c, sections, warnings) {
|
|
|
6115
6115
|
try {
|
|
6116
6116
|
const data = !c.distribution && c.compressed ? decompressStream(Buffer.from(sections[si])) : Buffer.from(sections[si]);
|
|
6117
6117
|
totalDecompressed += data.length;
|
|
6118
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
6118
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkMI655NV5cjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
6119
6119
|
out.push(readRecords(data));
|
|
6120
6120
|
} catch (secErr) {
|
|
6121
|
-
if (secErr instanceof
|
|
6121
|
+
if (secErr instanceof _chunkMI655NV5cjs.KordocError) throw secErr;
|
|
6122
6122
|
out.push(null);
|
|
6123
6123
|
warnings.push({ page: si + 1, message: `\uC139\uC158 ${si + 1} \uD30C\uC2F1 \uC2E4\uD328: ${secErr instanceof Error ? secErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "PARTIAL_PARSE" });
|
|
6124
6124
|
}
|
|
@@ -6138,7 +6138,7 @@ function parseHwp5Document(buffer, options) {
|
|
|
6138
6138
|
if (cfb) extractHwp5Metadata(cfb, metadata);
|
|
6139
6139
|
const docInfo = cfb && !encrypted ? parseDocInfoStream(cfb, compressed) : parseDocInfoFromStream(findStream("/DocInfo"), compressed);
|
|
6140
6140
|
const sections = readHwp5SectionStreams(c);
|
|
6141
|
-
if (sections.length === 0) throw new (0,
|
|
6141
|
+
if (sections.length === 0) throw new (0, _chunkMI655NV5cjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
6142
6142
|
const sectionRecords = readHwp5SectionRecords(c, sections, warnings);
|
|
6143
6143
|
const sectionDetects = sectionRecords.map((r) => r ? detectHwp5SectionPages(r) : null);
|
|
6144
6144
|
const sectionTableIds = [];
|
|
@@ -6182,7 +6182,7 @@ function parseHwp5Document(buffer, options) {
|
|
|
6182
6182
|
parsedSections++;
|
|
6183
6183
|
_optionalChain([options, 'optionalAccess', _219 => _219.onProgress, 'optionalCall', _220 => _220(parsedSections, sections.length)]);
|
|
6184
6184
|
} catch (secErr) {
|
|
6185
|
-
if (secErr instanceof
|
|
6185
|
+
if (secErr instanceof _chunkMI655NV5cjs.KordocError) throw secErr;
|
|
6186
6186
|
warnings.push({ page: si + 1, message: `\uC139\uC158 ${si + 1} \uD30C\uC2F1 \uC2E4\uD328: ${secErr instanceof Error ? secErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "PARTIAL_PARSE" });
|
|
6187
6187
|
} finally {
|
|
6188
6188
|
pageBase += detect2.pages;
|
|
@@ -6193,10 +6193,10 @@ function parseHwp5Document(buffer, options) {
|
|
|
6193
6193
|
}
|
|
6194
6194
|
const blocks = [...doc.headerBlocks, ...bodyBlocks, ...doc.footerBlocks];
|
|
6195
6195
|
const images = cfb ? extractHwp5Images(cfb.FileIndex, blocks, warnings, !pageFilter, encrypted ? findStream : void 0) : extractHwp5ImagesLenient(lenientCfb, blocks, warnings, !pageFilter, encrypted ? findStream : void 0);
|
|
6196
|
-
let flatBlocks =
|
|
6197
|
-
if (_optionalChain([options, 'optionalAccess', _221 => _221.layoutTables]) !== "keep") flatBlocks =
|
|
6196
|
+
let flatBlocks = _chunkSJ5OZXELcjs.flattenLayoutTables.call(void 0, blocks);
|
|
6197
|
+
if (_optionalChain([options, 'optionalAccess', _221 => _221.layoutTables]) !== "keep") flatBlocks = _chunkSJ5OZXELcjs.unframeLayoutTables.call(void 0, flatBlocks, !!_optionalChain([options, 'optionalAccess', _222 => _222.keepTrailingEmptyCols]));
|
|
6198
6198
|
if (_optionalChain([options, 'optionalAccess', _223 => _223.dedupeRunningHeaders])) {
|
|
6199
|
-
const deduped =
|
|
6199
|
+
const deduped = _chunkSJ5OZXELcjs.dedupeRunningHeaders.call(void 0, flatBlocks);
|
|
6200
6200
|
const removed = flatBlocks.length - deduped.length;
|
|
6201
6201
|
if (removed > 0) warnings.push({ message: `\uBC18\uBCF5 \uB7EC\uB2DD \uD5E4\uB354 ${removed}\uAC1C \uC81C\uAC70`, code: "HIDDEN_TEXT_FILTERED" });
|
|
6202
6202
|
flatBlocks = deduped;
|
|
@@ -6205,10 +6205,10 @@ function parseHwp5Document(buffer, options) {
|
|
|
6205
6205
|
detectHwp5Headings(flatBlocks, docInfo, doc.tocTexts);
|
|
6206
6206
|
}
|
|
6207
6207
|
const outline = flatBlocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
|
|
6208
|
-
let markdown =
|
|
6208
|
+
let markdown = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, flatBlocks, { tableFormat: _optionalChain([options, 'optionalAccess', _224 => _224.tableFormat]) });
|
|
6209
6209
|
if (_optionalChain([options, 'optionalAccess', _225 => _225.inlineImages]) && options.images !== false && images.length > 0) {
|
|
6210
6210
|
try {
|
|
6211
|
-
markdown =
|
|
6211
|
+
markdown = _chunk2BCQVQO2cjs.inlineImagesIntoMarkdown.call(void 0, markdown, images, { compress: true });
|
|
6212
6212
|
} catch (inlineErr) {
|
|
6213
6213
|
warnings.push({ message: `\uC774\uBBF8\uC9C0 \uC778\uB77C\uC778 \uC2E4\uD328 \u2014 \uC6D0\uBCF8 \uD30C\uC77C \uCC38\uC870\uB85C \uD3F4\uBC31: ${inlineErr instanceof Error ? inlineErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "SKIPPED_IMAGE" });
|
|
6214
6214
|
}
|
|
@@ -6272,9 +6272,9 @@ function detectHwp5Headings(blocks, docInfo, tocTexts) {
|
|
|
6272
6272
|
let level = 0;
|
|
6273
6273
|
if (_optionalChain([block, 'access', _232 => _232.style, 'optionalAccess', _233 => _233.fontSize]) && baseFontSize > 0) {
|
|
6274
6274
|
const ratio = block.style.fontSize / baseFontSize;
|
|
6275
|
-
if (ratio >=
|
|
6276
|
-
else if (ratio >=
|
|
6277
|
-
else if (ratio >=
|
|
6275
|
+
if (ratio >= _chunkSJ5OZXELcjs.HEADING_RATIO_H1) level = 1;
|
|
6276
|
+
else if (ratio >= _chunkSJ5OZXELcjs.HEADING_RATIO_H2) level = 2;
|
|
6277
|
+
else if (ratio >= _chunkSJ5OZXELcjs.HEADING_RATIO_H3) level = 3;
|
|
6278
6278
|
}
|
|
6279
6279
|
if (/^제\d+[장절편]\s/.test(text) && text.length <= 50) {
|
|
6280
6280
|
if (level === 0) level = 2;
|
|
@@ -6406,7 +6406,7 @@ function findSectionsLenient(lcfb) {
|
|
|
6406
6406
|
const raw = _nullishCoalesce(lcfb.findStream(`/BodyText/Section${i}`), () => ( lcfb.findStream(`Section${i}`)));
|
|
6407
6407
|
if (!raw) break;
|
|
6408
6408
|
totalBytes += raw.length;
|
|
6409
|
-
if (totalBytes > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
6409
|
+
if (totalBytes > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkMI655NV5cjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
6410
6410
|
sections.push({ idx: i, content: raw });
|
|
6411
6411
|
}
|
|
6412
6412
|
if (sections.length === 0) {
|
|
@@ -6417,7 +6417,7 @@ function findSectionsLenient(lcfb) {
|
|
|
6417
6417
|
const raw = lcfb.findStream(e.name);
|
|
6418
6418
|
if (raw) {
|
|
6419
6419
|
totalBytes += raw.length;
|
|
6420
|
-
if (totalBytes > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
6420
|
+
if (totalBytes > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkMI655NV5cjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
6421
6421
|
sections.push({ idx, content: raw });
|
|
6422
6422
|
}
|
|
6423
6423
|
}
|
|
@@ -6434,7 +6434,7 @@ function findViewTextSectionsLenient(lcfb, compressed) {
|
|
|
6434
6434
|
try {
|
|
6435
6435
|
const content = decryptViewText(raw, compressed);
|
|
6436
6436
|
totalDecompressed += content.length;
|
|
6437
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
6437
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunkMI655NV5cjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
6438
6438
|
sections.push({ idx: i, content });
|
|
6439
6439
|
} catch (e32) {
|
|
6440
6440
|
break;
|
|
@@ -18934,25 +18934,25 @@ function desEcbDecrypt(data, key) {
|
|
|
18934
18934
|
}
|
|
18935
18935
|
function readLayout(data) {
|
|
18936
18936
|
if (data.length < FIXED_HEADER_BYTES) {
|
|
18937
|
-
throw new (0,
|
|
18937
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("HWP3 \uC554\uD638 \uBB38\uC11C: \uD5E4\uB354\uAC00 \uC798\uB838\uC2B5\uB2C8\uB2E4");
|
|
18938
18938
|
}
|
|
18939
18939
|
const infoBlockLength = data[INFO_BLOCK_LENGTH_OFFSET] | data[INFO_BLOCK_LENGTH_OFFSET + 1] << 8;
|
|
18940
18940
|
const payloadOffset = FIXED_HEADER_BYTES + infoBlockLength;
|
|
18941
18941
|
if (payloadOffset >= data.length) {
|
|
18942
|
-
throw new (0,
|
|
18942
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("HWP3 \uC554\uD638 \uBB38\uC11C: \uBCF8\uBB38\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
18943
18943
|
}
|
|
18944
18944
|
return { payloadOffset, compressed: data[COMPRESSION_FLAG_OFFSET] !== 0 };
|
|
18945
18945
|
}
|
|
18946
18946
|
function decryptHwp3Document(input, password) {
|
|
18947
18947
|
const { payloadOffset, compressed } = readLayout(input);
|
|
18948
18948
|
if (!compressed) {
|
|
18949
|
-
throw new (0,
|
|
18949
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWP3 \uC554\uD638\uD654 \uBC29\uC2DD\uC785\uB2C8\uB2E4 (\uC555\uCD95\uB418\uC9C0 \uC54A\uC740 \uC554\uD638 \uBCF8\uBB38)");
|
|
18950
18950
|
}
|
|
18951
18951
|
const source = Buffer.from(input);
|
|
18952
18952
|
const payload = source.subarray(payloadOffset);
|
|
18953
18953
|
const aligned = payload.subarray(0, payload.length - payload.length % 8);
|
|
18954
18954
|
if (aligned.length === 0) {
|
|
18955
|
-
throw new (0,
|
|
18955
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("HWP3 \uC554\uD638 \uBB38\uC11C: \uBCF8\uBB38\uC774 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4");
|
|
18956
18956
|
}
|
|
18957
18957
|
const decrypted = desEcbDecrypt(aligned, deriveDesKey(password));
|
|
18958
18958
|
let inflated;
|
|
@@ -18960,14 +18960,14 @@ function decryptHwp3Document(input, password) {
|
|
|
18960
18960
|
inflated = _zlib.inflateRawSync.call(void 0, decrypted, { maxOutputLength: MAX_DECOMPRESSED_BYTES });
|
|
18961
18961
|
} catch (err) {
|
|
18962
18962
|
if (_optionalChain([err, 'optionalAccess', _248 => _248.code]) === "ERR_BUFFER_TOO_LARGE") {
|
|
18963
|
-
throw new (0,
|
|
18963
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(
|
|
18964
18964
|
`HWP3 \uC554\uD638 \uBCF8\uBB38\uC758 \uC555\uCD95 \uD574\uC81C \uACB0\uACFC\uAC00 \uCD5C\uB300 \uD5C8\uC6A9 \uD06C\uAE30(${MAX_DECOMPRESSED_BYTES / 1024 / 1024}MB)\uB97C \uCD08\uACFC\uD588\uC2B5\uB2C8\uB2E4`
|
|
18965
18965
|
);
|
|
18966
18966
|
}
|
|
18967
|
-
throw new (0,
|
|
18967
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("\uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uAC70\uB098 \uC554\uD638\uD654 \uB370\uC774\uD130\uAC00 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
18968
18968
|
}
|
|
18969
18969
|
if (inflated.length <= PASSWORD_PREFIX_BYTES) {
|
|
18970
|
-
throw new (0,
|
|
18970
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("\uBE44\uBC00\uBC88\uD638\uAC00 \uC77C\uCE58\uD558\uC9C0 \uC54A\uAC70\uB098 \uC554\uD638\uD654 \uB370\uC774\uD130\uAC00 \uC190\uC0C1\uB418\uC5C8\uC2B5\uB2C8\uB2E4.");
|
|
18971
18971
|
}
|
|
18972
18972
|
const body = inflated.subarray(PASSWORD_PREFIX_BYTES);
|
|
18973
18973
|
const out = Buffer.concat([source.subarray(0, payloadOffset), body]);
|
|
@@ -19024,9 +19024,9 @@ function hwp3CellGrid(info, count) {
|
|
|
19024
19024
|
const col = edgeAt(xs, g3.x), row = edgeAt(ys, g3.y);
|
|
19025
19025
|
const c2 = nextX[k] !== void 0 ? edgeAt(xs, nextX[k]) : xs.length - 1;
|
|
19026
19026
|
const r2 = nextY[k] !== void 0 ? edgeAt(ys, nextY[k]) : ys.length - 1;
|
|
19027
|
-
return { row, col, rowSpan: Math.min(Math.max(1, r2 - row),
|
|
19027
|
+
return { row, col, rowSpan: Math.min(Math.max(1, r2 - row), _chunkSJ5OZXELcjs.MAX_ROWS), colSpan: Math.min(Math.max(1, c2 - col), _chunkSJ5OZXELcjs.MAX_COLS) };
|
|
19028
19028
|
});
|
|
19029
|
-
return { rows: Math.min(Math.max(1, ys.length - 1),
|
|
19029
|
+
return { rows: Math.min(Math.max(1, ys.length - 1), _chunkSJ5OZXELcjs.MAX_ROWS), cols: Math.min(Math.max(1, xs.length - 1), _chunkSJ5OZXELcjs.MAX_COLS), cells };
|
|
19030
19030
|
}
|
|
19031
19031
|
|
|
19032
19032
|
// src/hwp3/parser.ts
|
|
@@ -19067,7 +19067,7 @@ function parseHwp3Document(buffer, options) {
|
|
|
19067
19067
|
let source = Buffer.from(buffer);
|
|
19068
19068
|
if (isEncryptedHwp3(source)) {
|
|
19069
19069
|
if (!_optionalChain([options, 'optionalAccess', _249 => _249.password])) {
|
|
19070
|
-
throw new (0,
|
|
19070
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(
|
|
19071
19071
|
"\uC554\uD638\uB85C \uBCF4\uD638\uB41C HWP3 \uBB38\uC11C\uC785\uB2C8\uB2E4. password \uC635\uC158\uC5D0 \uC5F4\uAE30 \uC554\uD638\uB97C \uC9C0\uC815\uD558\uC138\uC694."
|
|
19072
19072
|
);
|
|
19073
19073
|
}
|
|
@@ -19084,10 +19084,10 @@ function parseHwp3Document(buffer, options) {
|
|
|
19084
19084
|
body = _zlib.inflateRawSync.call(void 0, tail, { maxOutputLength: MAX_DECOMPRESS_SIZE3 });
|
|
19085
19085
|
} catch (err) {
|
|
19086
19086
|
if (_optionalChain([err, 'optionalAccess', _250 => _250.code]) === "ERR_BUFFER_TOO_LARGE") {
|
|
19087
|
-
throw new (0,
|
|
19087
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`HWP3 \uC555\uCD95 \uD574\uC81C \uACB0\uACFC\uAC00 \uCD5C\uB300 \uD5C8\uC6A9 \uD06C\uAE30(${MAX_DECOMPRESS_SIZE3 / 1024 / 1024}MB)\uB97C \uCD08\uACFC\uD588\uC2B5\uB2C8\uB2E4`);
|
|
19088
19088
|
}
|
|
19089
19089
|
const msg2 = err instanceof Error ? err.message : String(err);
|
|
19090
|
-
throw new (0,
|
|
19090
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`HWP3 \uC555\uCD95 \uD574\uC81C \uC2E4\uD328: ${msg2}`);
|
|
19091
19091
|
}
|
|
19092
19092
|
} else {
|
|
19093
19093
|
body = tail;
|
|
@@ -19110,7 +19110,7 @@ function parseHwp3Document(buffer, options) {
|
|
|
19110
19110
|
const names = new Map([...ctx.picIds].map(([name, id]) => [id, name]));
|
|
19111
19111
|
dropMissingPictures(allBlocks, binData, names, warnings);
|
|
19112
19112
|
const images = resolveImageBlocks(binData, allBlocks, warnings, true);
|
|
19113
|
-
const blocks =
|
|
19113
|
+
const blocks = _chunkSJ5OZXELcjs.flattenLayoutTables.call(void 0, allBlocks);
|
|
19114
19114
|
const metadata = {
|
|
19115
19115
|
title: header.title || void 0,
|
|
19116
19116
|
author: header.author || void 0,
|
|
@@ -19118,10 +19118,10 @@ function parseHwp3Document(buffer, options) {
|
|
|
19118
19118
|
createdAt: header.date || void 0,
|
|
19119
19119
|
version: "3.0"
|
|
19120
19120
|
};
|
|
19121
|
-
let markdown =
|
|
19121
|
+
let markdown = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _251 => _251.tableFormat]) });
|
|
19122
19122
|
if (_optionalChain([options, 'optionalAccess', _252 => _252.inlineImages]) && options.images !== false && images.length > 0) {
|
|
19123
19123
|
try {
|
|
19124
|
-
markdown =
|
|
19124
|
+
markdown = _chunk2BCQVQO2cjs.inlineImagesIntoMarkdown.call(void 0, markdown, images, { compress: true });
|
|
19125
19125
|
} catch (inlineErr) {
|
|
19126
19126
|
warnings.push({ message: `\uC774\uBBF8\uC9C0 \uC778\uB77C\uC778 \uC2E4\uD328 \u2014 \uC6D0\uBCF8 \uD30C\uC77C \uCC38\uC870\uB85C \uD3F4\uBC31: ${inlineErr instanceof Error ? inlineErr.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`, code: "SKIPPED_IMAGE" });
|
|
19127
19127
|
}
|
|
@@ -19253,7 +19253,7 @@ function parseCharStream(reader, charCount, ctx, para2) {
|
|
|
19253
19253
|
continue;
|
|
19254
19254
|
}
|
|
19255
19255
|
if (ch >= 32) {
|
|
19256
|
-
para2.text +=
|
|
19256
|
+
para2.text += _chunkSJ5OZXELcjs.escapeLiteralTags.call(void 0, _chunkSJ5OZXELcjs.escapeLiteralDollar.call(void 0, _nullishCoalesce(decodeJohabText(ch), () => ( ""))));
|
|
19257
19257
|
continue;
|
|
19258
19258
|
}
|
|
19259
19259
|
if (ch === 9) {
|
|
@@ -19488,7 +19488,7 @@ function isDistributionSentinel(markdown) {
|
|
|
19488
19488
|
// src/xlsx/sheet-blocks.ts
|
|
19489
19489
|
var MAX_SHEET_COLS = 16384;
|
|
19490
19490
|
function sheetRowCap(cols) {
|
|
19491
|
-
return Math.floor(
|
|
19491
|
+
return Math.floor(_chunkSJ5OZXELcjs.MAX_TABLE_CELLS / Math.max(1, cols));
|
|
19492
19492
|
}
|
|
19493
19493
|
function sheetToBlocks(sheetName, rows, maxCol, merges, sheetIndex, warnings, keepAnchoredEmptyCols) {
|
|
19494
19494
|
const blocks = [];
|
|
@@ -19519,7 +19519,7 @@ function sheetToBlocks(sheetName, rows, maxCol, merges, sheetIndex, warnings, ke
|
|
|
19519
19519
|
if (keepRows.length > rowCap) {
|
|
19520
19520
|
warnings.push({
|
|
19521
19521
|
page: sheetIndex + 1,
|
|
19522
|
-
message: `\uC2DC\uD2B8 "${sheetName}": ${keepRows.length}\uD589 \xD7 ${keepCols.length}\uC5F4 \uC911 \uC55E ${rowCap}\uD589\uB9CC \uD45C\uB85C \uB0C8\uC2B5\uB2C8\uB2E4 (\uD45C \uCE78 \uC0C1\uD55C ${
|
|
19522
|
+
message: `\uC2DC\uD2B8 "${sheetName}": ${keepRows.length}\uD589 \xD7 ${keepCols.length}\uC5F4 \uC911 \uC55E ${rowCap}\uD589\uB9CC \uD45C\uB85C \uB0C8\uC2B5\uB2C8\uB2E4 (\uD45C \uCE78 \uC0C1\uD55C ${_chunkSJ5OZXELcjs.MAX_TABLE_CELLS})`,
|
|
19523
19523
|
code: "TRUNCATED_TABLE"
|
|
19524
19524
|
});
|
|
19525
19525
|
keepRows.length = rowCap;
|
|
@@ -19553,14 +19553,14 @@ function sheetToBlocks(sheetName, rows, maxCol, merges, sheetIndex, warnings, ke
|
|
|
19553
19553
|
}
|
|
19554
19554
|
cellRows.push(row);
|
|
19555
19555
|
}
|
|
19556
|
-
const table2 =
|
|
19556
|
+
const table2 = _chunkSJ5OZXELcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols, maxRows: rowCap, maxCols: keepCols.length });
|
|
19557
19557
|
if (table2.rows > 0) blocks.push({ type: "table", table: table2, pageNumber: sheetIndex + 1 });
|
|
19558
19558
|
return blocks;
|
|
19559
19559
|
}
|
|
19560
19560
|
|
|
19561
19561
|
// src/xlsx/parser.ts
|
|
19562
19562
|
var MAX_SHEETS = 100;
|
|
19563
|
-
var MAX_DECOMPRESS_SIZE4 =
|
|
19563
|
+
var MAX_DECOMPRESS_SIZE4 = _chunkMI655NV5cjs.unzipLimitBytes.call(void 0, 100 * 1024 * 1024);
|
|
19564
19564
|
var MAX_SHEET_ROWS = 1048576;
|
|
19565
19565
|
function cleanNumericValue(raw) {
|
|
19566
19566
|
if (!/^-?\d+\.\d+$/.test(raw)) return raw;
|
|
@@ -19597,7 +19597,7 @@ function getTextContent(el) {
|
|
|
19597
19597
|
return _nullishCoalesce(_optionalChain([el, 'access', _268 => _268.textContent, 'optionalAccess', _269 => _269.trim, 'call', _270 => _270()]), () => ( ""));
|
|
19598
19598
|
}
|
|
19599
19599
|
function parseXml(text) {
|
|
19600
|
-
return new (0, _xmldom.DOMParser)().parseFromString(
|
|
19600
|
+
return new (0, _xmldom.DOMParser)().parseFromString(_chunkMI655NV5cjs.stripDtd.call(void 0, text), "text/xml");
|
|
19601
19601
|
}
|
|
19602
19602
|
function collectRichText(root) {
|
|
19603
19603
|
let out = "";
|
|
@@ -19608,7 +19608,7 @@ function collectRichText(root) {
|
|
|
19608
19608
|
const el = children[i];
|
|
19609
19609
|
const local = el.localName || _optionalChain([el, 'access', _271 => _271.tagName, 'optionalAccess', _272 => _272.replace, 'call', _273 => _273(/^[^:]+:/, "")]) || "";
|
|
19610
19610
|
if (local === "rPh") continue;
|
|
19611
|
-
if (local === "t") out +=
|
|
19611
|
+
if (local === "t") out += _chunkSJ5OZXELcjs.escapeLiteralTags.call(void 0, _chunkSJ5OZXELcjs.escapeLiteralDollar.call(void 0, _nullishCoalesce(el.textContent, () => ( ""))));
|
|
19612
19612
|
else walk(el);
|
|
19613
19613
|
}
|
|
19614
19614
|
};
|
|
@@ -19819,12 +19819,12 @@ function parseWorksheet(xml, sharedStrings, dateXfs, date1904) {
|
|
|
19819
19819
|
return { rows, merges, maxCol };
|
|
19820
19820
|
}
|
|
19821
19821
|
async function parseXlsxDocument(buffer, options) {
|
|
19822
|
-
|
|
19822
|
+
_chunkMI655NV5cjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE4);
|
|
19823
19823
|
const zip = await _jszip2.default.loadAsync(buffer);
|
|
19824
19824
|
const warnings = [];
|
|
19825
19825
|
const workbookFile = zip.file("xl/workbook.xml");
|
|
19826
19826
|
if (!workbookFile) {
|
|
19827
|
-
throw new (0,
|
|
19827
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 XLSX \uD30C\uC77C: xl/workbook.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
19828
19828
|
}
|
|
19829
19829
|
let sharedStrings = [];
|
|
19830
19830
|
const ssFile = zip.file("xl/sharedStrings.xml");
|
|
@@ -19833,7 +19833,7 @@ async function parseXlsxDocument(buffer, options) {
|
|
|
19833
19833
|
}
|
|
19834
19834
|
const { sheets, date1904 } = parseWorkbook(await readZipEntry(workbookFile, "text"));
|
|
19835
19835
|
if (sheets.length === 0) {
|
|
19836
|
-
throw new (0,
|
|
19836
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("XLSX \uD30C\uC77C\uC5D0 \uC2DC\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
19837
19837
|
}
|
|
19838
19838
|
let dateXfs = /* @__PURE__ */ new Map();
|
|
19839
19839
|
const stylesFile = zip.file("xl/styles.xml");
|
|
@@ -19917,7 +19917,7 @@ async function parseXlsxDocument(buffer, options) {
|
|
|
19917
19917
|
} catch (e35) {
|
|
19918
19918
|
}
|
|
19919
19919
|
}
|
|
19920
|
-
const markdown =
|
|
19920
|
+
const markdown = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _278 => _278.tableFormat]) });
|
|
19921
19921
|
return { markdown, blocks, metadata, warnings: warnings.length > 0 ? warnings : void 0 };
|
|
19922
19922
|
}
|
|
19923
19923
|
|
|
@@ -20231,14 +20231,14 @@ function extractSheetCells(records, bofIndex, sst, convertNum) {
|
|
|
20231
20231
|
const h = readCellHeader(rec.data);
|
|
20232
20232
|
if (h && rec.data.length >= 10) {
|
|
20233
20233
|
const isst = rec.data.readUInt32LE(6);
|
|
20234
|
-
cells.push({ row: h.row, col: h.col, value:
|
|
20234
|
+
cells.push({ row: h.row, col: h.col, value: _chunkSJ5OZXELcjs.escapeLiteralTags.call(void 0, _chunkSJ5OZXELcjs.escapeLiteralDollar.call(void 0, _nullishCoalesce(sst[isst], () => ( "")))) });
|
|
20235
20235
|
}
|
|
20236
20236
|
break;
|
|
20237
20237
|
}
|
|
20238
20238
|
case OP_LABEL: {
|
|
20239
20239
|
const h = readCellHeader(rec.data);
|
|
20240
20240
|
if (h) {
|
|
20241
|
-
cells.push({ row: h.row, col: h.col, value:
|
|
20241
|
+
cells.push({ row: h.row, col: h.col, value: _chunkSJ5OZXELcjs.escapeLiteralTags.call(void 0, _chunkSJ5OZXELcjs.escapeLiteralDollar.call(void 0, decodeLabelString(rec.data))) });
|
|
20242
20242
|
}
|
|
20243
20243
|
break;
|
|
20244
20244
|
}
|
|
@@ -20254,7 +20254,7 @@ function extractSheetCells(records, bofIndex, sst, convertNum) {
|
|
|
20254
20254
|
cells.push({
|
|
20255
20255
|
row: h.row,
|
|
20256
20256
|
col: h.col,
|
|
20257
|
-
value:
|
|
20257
|
+
value: _chunkSJ5OZXELcjs.escapeLiteralTags.call(void 0, _chunkSJ5OZXELcjs.escapeLiteralDollar.call(void 0, decodeFormulaStringRecord(next.data)))
|
|
20258
20258
|
});
|
|
20259
20259
|
i = j;
|
|
20260
20260
|
} else {
|
|
@@ -20366,11 +20366,11 @@ function processGlobals(records) {
|
|
|
20366
20366
|
const xfFmtIds = [];
|
|
20367
20367
|
const firstBof = records[0];
|
|
20368
20368
|
if (!firstBof || firstBof.opcode !== OP_BOF) {
|
|
20369
|
-
throw new (0,
|
|
20369
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("XLS: \uCCAB \uB808\uCF54\uB4DC\uAC00 BOF\uAC00 \uC544\uB2D8");
|
|
20370
20370
|
}
|
|
20371
20371
|
const bof = decodeBof(firstBof.data);
|
|
20372
20372
|
if (!bof || bof.dt !== DT_GLOBALS) {
|
|
20373
|
-
throw new (0,
|
|
20373
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("XLS: Globals \uC11C\uBE0C\uC2A4\uD2B8\uB9BC BOF \uB204\uB77D");
|
|
20374
20374
|
}
|
|
20375
20375
|
let i = 1;
|
|
20376
20376
|
while (i < records.length) {
|
|
@@ -20454,28 +20454,28 @@ async function parseXlsDocument(buffer, options) {
|
|
|
20454
20454
|
try {
|
|
20455
20455
|
cfb = parseLenientCfb(buf);
|
|
20456
20456
|
} catch (e) {
|
|
20457
|
-
throw new (0,
|
|
20457
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(
|
|
20458
20458
|
`XLS: OLE2 \uC2DC\uADF8\uB2C8\uCC98 \uAC80\uC99D \uC2E4\uD328 \u2014 ${e instanceof Error ? e.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`
|
|
20459
20459
|
);
|
|
20460
20460
|
}
|
|
20461
20461
|
const wb = _nullishCoalesce(cfb.findStream("/Workbook"), () => ( cfb.findStream("/Book")));
|
|
20462
20462
|
if (!wb) {
|
|
20463
|
-
throw new (0,
|
|
20463
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("XLS: Workbook \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC74C (BIFF5 \uB610\uB294 \uBE44\uD45C\uC900 \uD30C\uC77C)");
|
|
20464
20464
|
}
|
|
20465
20465
|
const records = readRecords2(wb);
|
|
20466
20466
|
if (records.length === 0) {
|
|
20467
|
-
throw new (0,
|
|
20467
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("XLS: \uC2DC\uADF8\uB2C8\uCC98 \uB808\uCF54\uB4DC\uAC00 \uC5C6\uC74C (Workbook \uC2A4\uD2B8\uB9BC \uC190\uC0C1)");
|
|
20468
20468
|
}
|
|
20469
20469
|
const firstBof = decodeBof(records[0].data);
|
|
20470
20470
|
if (firstBof && firstBof.vers !== 1536) {
|
|
20471
|
-
throw new (0,
|
|
20471
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(
|
|
20472
20472
|
`XLS: BIFF8(0x0600)\uB9CC \uC9C0\uC6D0 \u2014 \uBCF8 \uD30C\uC77C\uC740 0x${firstBof.vers.toString(16)}`
|
|
20473
20473
|
);
|
|
20474
20474
|
}
|
|
20475
20475
|
const globals = processGlobals(records);
|
|
20476
20476
|
const warnings = [];
|
|
20477
20477
|
if (globals.encrypted) {
|
|
20478
|
-
throw new (0,
|
|
20478
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("XLS \uD30C\uC77C\uC774 \uC554\uD638\uD654\uB418\uC5B4 \uC788\uC5B4 \uD30C\uC2F1\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
20479
20479
|
}
|
|
20480
20480
|
const convertNum = globals.dateXfs.size > 0 ? (n, ixfe) => {
|
|
20481
20481
|
const kind = globals.dateXfs.get(ixfe);
|
|
@@ -20526,7 +20526,7 @@ async function parseXlsDocument(buffer, options) {
|
|
|
20526
20526
|
pageCount: totalSheets
|
|
20527
20527
|
};
|
|
20528
20528
|
return {
|
|
20529
|
-
markdown:
|
|
20529
|
+
markdown: _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, allBlocks, { tableFormat: _optionalChain([options, 'optionalAccess', _283 => _283.tableFormat]) }),
|
|
20530
20530
|
blocks: allBlocks,
|
|
20531
20531
|
metadata,
|
|
20532
20532
|
warnings: warnings.length > 0 ? warnings : void 0
|
|
@@ -20965,7 +20965,7 @@ function isDisplayMath(el) {
|
|
|
20965
20965
|
}
|
|
20966
20966
|
|
|
20967
20967
|
// src/docx/parser.ts
|
|
20968
|
-
var MAX_DECOMPRESS_SIZE5 =
|
|
20968
|
+
var MAX_DECOMPRESS_SIZE5 = _chunkMI655NV5cjs.unzipLimitBytes.call(void 0, 100 * 1024 * 1024);
|
|
20969
20969
|
var MEDIA_PART_RE = /^word\/(?:media|embeddings)\//;
|
|
20970
20970
|
var NEVER_READ_RE = /^word\/(?:embeddings\/.*|media\/.+\.(?:mp4|m4v|mov|avi|wmv|mpe?g|mkv|webm|mp3|wav|m4a|wma|aac|ogg|flac|mid|bin))$/i;
|
|
20971
20971
|
function matchesLocal(el, localName3) {
|
|
@@ -21023,7 +21023,7 @@ function getAttr(el, localName3) {
|
|
|
21023
21023
|
return null;
|
|
21024
21024
|
}
|
|
21025
21025
|
function parseXml2(text) {
|
|
21026
|
-
return new (0, _xmldom.DOMParser)().parseFromString(
|
|
21026
|
+
return new (0, _xmldom.DOMParser)().parseFromString(_chunkMI655NV5cjs.stripDtd.call(void 0, text), "text/xml");
|
|
21027
21027
|
}
|
|
21028
21028
|
function parseStyles(xml) {
|
|
21029
21029
|
const doc = parseXml2(xml);
|
|
@@ -21159,7 +21159,7 @@ function parseFootnotes(xml) {
|
|
|
21159
21159
|
const runs = findElements(p, "r");
|
|
21160
21160
|
for (const r of runs) {
|
|
21161
21161
|
const tElements = getChildElements(r, "t");
|
|
21162
|
-
for (const t of tElements) texts.push(
|
|
21162
|
+
for (const t of tElements) texts.push(_chunkSJ5OZXELcjs.escapeLiteralTags.call(void 0, _chunkSJ5OZXELcjs.escapeLiteralDollar.call(void 0, _nullishCoalesce(t.textContent, () => ( "")))));
|
|
21163
21163
|
}
|
|
21164
21164
|
}
|
|
21165
21165
|
notes.set(id, texts.join("").trim());
|
|
@@ -21190,7 +21190,7 @@ function collectOmmlRoots(p) {
|
|
|
21190
21190
|
function extractRun(r) {
|
|
21191
21191
|
let text = "";
|
|
21192
21192
|
for (const el of effectiveChildElements(r)) {
|
|
21193
|
-
if (matchesLocal(el, "t")) text +=
|
|
21193
|
+
if (matchesLocal(el, "t")) text += _chunkSJ5OZXELcjs.escapeLiteralTags.call(void 0, _chunkSJ5OZXELcjs.escapeLiteralDollar.call(void 0, _nullishCoalesce(el.textContent, () => ( ""))));
|
|
21194
21194
|
else if (matchesLocal(el, "br") || matchesLocal(el, "cr")) text += "\n";
|
|
21195
21195
|
else if (matchesLocal(el, "tab")) text += " ";
|
|
21196
21196
|
else if (matchesLocal(el, "sym")) text += symbolChar(getAttr(el, "font"), getAttr(el, "char"));
|
|
@@ -21203,7 +21203,7 @@ function extractRun(r) {
|
|
|
21203
21203
|
italic = getChildElements(rPrEls[0], "i").length > 0;
|
|
21204
21204
|
const va = getChildElements(rPrEls[0], "vertAlign")[0];
|
|
21205
21205
|
const v = va ? getAttr(va, "val") : null;
|
|
21206
|
-
if (v === "superscript" || v === "subscript") text =
|
|
21206
|
+
if (v === "superscript" || v === "subscript") text = _chunkSJ5OZXELcjs.wrapScript.call(void 0, text, v === "superscript" ? "sup" : "sub");
|
|
21207
21207
|
}
|
|
21208
21208
|
return { text, bold, italic };
|
|
21209
21209
|
}
|
|
@@ -21221,7 +21221,7 @@ var PAGE_FIELD_RE = /^\s*(?:PAGE|NUMPAGES|SECTIONPAGES)\b/i;
|
|
|
21221
21221
|
function makeLink(text, rawHref) {
|
|
21222
21222
|
if (!text) return "";
|
|
21223
21223
|
if (!rawHref) return text;
|
|
21224
|
-
const href =
|
|
21224
|
+
const href = _chunkMI655NV5cjs.sanitizeHref.call(void 0, rawHref);
|
|
21225
21225
|
return href ? `[${text}](${href})` : text;
|
|
21226
21226
|
}
|
|
21227
21227
|
function collectInline(p, footnotes, rels) {
|
|
@@ -21312,7 +21312,7 @@ function collectInline(p, footnotes, rels) {
|
|
|
21312
21312
|
const m = mathText(om);
|
|
21313
21313
|
if (m) parts.push(isDisplayMath(om) ? m : " " + m + " ");
|
|
21314
21314
|
}
|
|
21315
|
-
const text =
|
|
21315
|
+
const text = _chunkSJ5OZXELcjs.tidyScriptTags.call(void 0, parts.join("")).replace(/[ \t]{2,}/g, " ").trim();
|
|
21316
21316
|
return { text, bold, italic, footnoteText };
|
|
21317
21317
|
}
|
|
21318
21318
|
var COUNTERS = /* @__PURE__ */ new WeakMap();
|
|
@@ -21437,7 +21437,7 @@ ${cell2.text}` : cell2.text;
|
|
|
21437
21437
|
return { text: cell2.text, colSpan: cell2.colSpan, rowSpan, colAddr: cell2.col, rowAddr: r };
|
|
21438
21438
|
})
|
|
21439
21439
|
);
|
|
21440
|
-
const table2 =
|
|
21440
|
+
const table2 = _chunkSJ5OZXELcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keepEmptyCols });
|
|
21441
21441
|
if (table2.rows === 0 || table2.cols === 0) return null;
|
|
21442
21442
|
return { type: "table", table: table2 };
|
|
21443
21443
|
}
|
|
@@ -21486,7 +21486,7 @@ async function buildImageMap(zip, rels, doc, warnings, readBytes) {
|
|
|
21486
21486
|
let data = null;
|
|
21487
21487
|
if (readBytes) data = await readZipEntry(imgFile, "uint8array");
|
|
21488
21488
|
imgIdx++;
|
|
21489
|
-
const ext =
|
|
21489
|
+
const ext = _chunkMI655NV5cjs.partExtension.call(void 0, imgPath);
|
|
21490
21490
|
const mimeMap = {
|
|
21491
21491
|
png: "image/png",
|
|
21492
21492
|
jpg: "image/jpeg",
|
|
@@ -21585,12 +21585,12 @@ async function parseHeaderFooterBlocks(zip, doc, rels, kind, styles, numbering,
|
|
|
21585
21585
|
}
|
|
21586
21586
|
async function parseDocxDocument(buffer, options) {
|
|
21587
21587
|
const readImages = _optionalChain([options, 'optionalAccess', _319 => _319.images]) !== false;
|
|
21588
|
-
|
|
21588
|
+
_chunkMI655NV5cjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE5, void 0, { re: MEDIA_PART_RE, skip: !readImages, never: NEVER_READ_RE });
|
|
21589
21589
|
const zip = await _jszip2.default.loadAsync(buffer);
|
|
21590
21590
|
const warnings = [];
|
|
21591
21591
|
const docFile = zip.file("word/document.xml");
|
|
21592
21592
|
if (!docFile) {
|
|
21593
|
-
throw new (0,
|
|
21593
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 DOCX \uD30C\uC77C: word/document.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
21594
21594
|
}
|
|
21595
21595
|
let rels = /* @__PURE__ */ new Map();
|
|
21596
21596
|
const relsFile = zip.file("word/_rels/document.xml.rels");
|
|
@@ -21637,7 +21637,7 @@ async function parseDocxDocument(buffer, options) {
|
|
|
21637
21637
|
const doc = parseXml2(docXml);
|
|
21638
21638
|
const body = findElements(doc, "body");
|
|
21639
21639
|
if (body.length === 0) {
|
|
21640
|
-
throw new (0,
|
|
21640
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("DOCX \uBCF8\uBB38(w:body)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
21641
21641
|
}
|
|
21642
21642
|
const { imageMap, images } = await buildImageMap(zip, rels, doc, warnings, readImages);
|
|
21643
21643
|
const linkedImages = /* @__PURE__ */ new Set();
|
|
@@ -21690,7 +21690,7 @@ async function parseDocxDocument(buffer, options) {
|
|
|
21690
21690
|
}
|
|
21691
21691
|
}
|
|
21692
21692
|
const outline = blocks.filter((b) => b.type === "heading").map((b) => ({ level: _nullishCoalesce(b.level, () => ( 2)), text: _nullishCoalesce(b.text, () => ( "")) }));
|
|
21693
|
-
const markdown =
|
|
21693
|
+
const markdown = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _326 => _326.tableFormat]) });
|
|
21694
21694
|
return {
|
|
21695
21695
|
markdown,
|
|
21696
21696
|
blocks,
|
|
@@ -21704,7 +21704,7 @@ async function parseDocxDocument(buffer, options) {
|
|
|
21704
21704
|
// src/pptx/parser.ts
|
|
21705
21705
|
|
|
21706
21706
|
|
|
21707
|
-
var MAX_DECOMPRESS_SIZE6 =
|
|
21707
|
+
var MAX_DECOMPRESS_SIZE6 = _chunkMI655NV5cjs.unzipLimitBytes.call(void 0, 100 * 1024 * 1024);
|
|
21708
21708
|
var MEDIA_PART_RE2 = /^ppt\/(?:media|embeddings)\//;
|
|
21709
21709
|
var NEVER_READ_RE2 = /^ppt\/(?:embeddings\/.*|media\/.+\.(?:mp4|m4v|mov|avi|wmv|mpe?g|mkv|webm|mp3|wav|m4a|wma|aac|ogg|flac|mid|bin))$/i;
|
|
21710
21710
|
var MAX_ZIP_ENTRIES2 = 1e4;
|
|
@@ -21727,7 +21727,7 @@ var IMAGE_MIME = {
|
|
|
21727
21727
|
svg: "image/svg+xml"
|
|
21728
21728
|
};
|
|
21729
21729
|
function parseXml3(text) {
|
|
21730
|
-
return new (0, _xmldom.DOMParser)().parseFromString(
|
|
21730
|
+
return new (0, _xmldom.DOMParser)().parseFromString(_chunkMI655NV5cjs.stripDtd.call(void 0, text), "text/xml");
|
|
21731
21731
|
}
|
|
21732
21732
|
function getAttr2(el, name) {
|
|
21733
21733
|
const attrs = el.attributes;
|
|
@@ -21794,7 +21794,7 @@ async function slideParts(zip) {
|
|
|
21794
21794
|
names.sort((a, b) => Number(SLIDE_PART_RE.exec(a)[1]) - Number(SLIDE_PART_RE.exec(b)[1]));
|
|
21795
21795
|
ordered.push(...names);
|
|
21796
21796
|
}
|
|
21797
|
-
if (ordered.length > MAX_SLIDES) throw new (0,
|
|
21797
|
+
if (ordered.length > MAX_SLIDES) throw new (0, _chunkMI655NV5cjs.KordocError)(`PPTX \uC2AC\uB77C\uC774\uB4DC \uC218 \uCD08\uACFC: ${ordered.length} (\uCD5C\uB300 ${MAX_SLIDES})`);
|
|
21798
21798
|
return ordered;
|
|
21799
21799
|
}
|
|
21800
21800
|
function paragraphText(p) {
|
|
@@ -21805,12 +21805,12 @@ function paragraphText(p) {
|
|
|
21805
21805
|
const t = findChildByLocalName(child, "t");
|
|
21806
21806
|
const rPr = findChildByLocalName(child, "rPr");
|
|
21807
21807
|
const baseline = Number(rPr ? _nullishCoalesce(getAttr2(rPr, "baseline"), () => ( 0)) : 0);
|
|
21808
|
-
if (t) text +=
|
|
21808
|
+
if (t) text += _chunkSJ5OZXELcjs.wrapScript.call(void 0, _chunkSJ5OZXELcjs.escapeLiteralTags.call(void 0, _chunkSJ5OZXELcjs.escapeLiteralDollar.call(void 0, rawTextContent(t))), baseline > 0 ? "sup" : baseline < 0 ? "sub" : null);
|
|
21809
21809
|
} else if (name === "br") {
|
|
21810
21810
|
text += " ";
|
|
21811
21811
|
}
|
|
21812
21812
|
}
|
|
21813
|
-
return
|
|
21813
|
+
return _chunkSJ5OZXELcjs.tidyScriptTags.call(void 0, text.replace(/\s+/g, " ").trim());
|
|
21814
21814
|
}
|
|
21815
21815
|
function bodyParagraphs(txBody) {
|
|
21816
21816
|
const out = [];
|
|
@@ -21871,7 +21871,7 @@ function parseTable2(tbl2, page, keepEmptyCols) {
|
|
|
21871
21871
|
});
|
|
21872
21872
|
return cells;
|
|
21873
21873
|
});
|
|
21874
|
-
const table2 =
|
|
21874
|
+
const table2 = _chunkSJ5OZXELcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keepEmptyCols });
|
|
21875
21875
|
if (table2.rows === 0 || table2.cols === 0) return null;
|
|
21876
21876
|
return { type: "table", table: table2, pageNumber: page };
|
|
21877
21877
|
}
|
|
@@ -21884,7 +21884,7 @@ async function pictureBlock(pic, ctx) {
|
|
|
21884
21884
|
if (!filename) {
|
|
21885
21885
|
const file = ctx.zip.file(rel.target);
|
|
21886
21886
|
if (!file) return null;
|
|
21887
|
-
const ext =
|
|
21887
|
+
const ext = _chunkMI655NV5cjs.partExtension.call(void 0, rel.target);
|
|
21888
21888
|
filename = `image_${String(ctx.imageNames.size + 1).padStart(3, "0")}.${ext}`;
|
|
21889
21889
|
try {
|
|
21890
21890
|
if (_optionalChain([ctx, 'access', _330 => _330.options, 'optionalAccess', _331 => _331.images]) !== false) {
|
|
@@ -21962,10 +21962,10 @@ async function notesText(zip, rels) {
|
|
|
21962
21962
|
return texts.join(" ");
|
|
21963
21963
|
}
|
|
21964
21964
|
async function parsePptxDocument(buffer, options) {
|
|
21965
|
-
|
|
21965
|
+
_chunkMI655NV5cjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE6, MAX_ZIP_ENTRIES2, { re: MEDIA_PART_RE2, skip: _optionalChain([options, 'optionalAccess', _334 => _334.images]) === false, never: NEVER_READ_RE2 });
|
|
21966
21966
|
const zip = await _jszip2.default.loadAsync(buffer);
|
|
21967
21967
|
if (!zip.file("ppt/presentation.xml")) {
|
|
21968
|
-
throw new (0,
|
|
21968
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 PPTX \uD30C\uC77C: ppt/presentation.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
21969
21969
|
}
|
|
21970
21970
|
const warnings = [];
|
|
21971
21971
|
const blocks = [];
|
|
@@ -22012,7 +22012,7 @@ async function parsePptxDocument(buffer, options) {
|
|
|
22012
22012
|
}
|
|
22013
22013
|
const outline = blocks.filter((b) => b.type === "heading").map((b) => ({ level: _nullishCoalesce(b.level, () => ( 2)), text: _nullishCoalesce(b.text, () => ( "")), pageNumber: b.pageNumber }));
|
|
22014
22014
|
return {
|
|
22015
|
-
markdown:
|
|
22015
|
+
markdown: _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _336 => _336.tableFormat]) }),
|
|
22016
22016
|
blocks,
|
|
22017
22017
|
metadata,
|
|
22018
22018
|
outline: outline.length > 0 ? outline : void 0,
|
|
@@ -22028,11 +22028,11 @@ var MAX_TABLE_COLS = 500;
|
|
|
22028
22028
|
var MAX_HWPML_BYTES = 50 * 1024 * 1024;
|
|
22029
22029
|
function parseHwpmlDocument(buffer, options) {
|
|
22030
22030
|
if (buffer.byteLength > MAX_HWPML_BYTES) {
|
|
22031
|
-
throw new (0,
|
|
22031
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`HWPML \uD30C\uC77C \uD06C\uAE30 \uCD08\uACFC (${(buffer.byteLength / 1024 / 1024).toFixed(1)}MB > 50MB)`);
|
|
22032
22032
|
}
|
|
22033
22033
|
const text = new TextDecoder("utf-8").decode(buffer).replace(/^\uFEFF/, "");
|
|
22034
22034
|
const normalized = text.replace(/ /g, " ");
|
|
22035
|
-
const xml =
|
|
22035
|
+
const xml = _chunkMI655NV5cjs.stripDtd.call(void 0, normalized);
|
|
22036
22036
|
const warnings = [];
|
|
22037
22037
|
const parser = new (0, _xmldom.DOMParser)({
|
|
22038
22038
|
onError: (_level, msg2) => {
|
|
@@ -22072,7 +22072,7 @@ function parseHwpmlDocument(buffer, options) {
|
|
|
22072
22072
|
parseSection2(el, blocks, paraShapeMap, sectionIdx, warnings, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _338 => _338.keepTrailingEmptyCols]), () => ( false)));
|
|
22073
22073
|
}
|
|
22074
22074
|
const outline = blocks.filter((b) => b.type === "heading" && b.text).map((b) => ({ level: _nullishCoalesce(b.level, () => ( 1)), text: b.text, pageNumber: b.pageNumber }));
|
|
22075
|
-
const markdown =
|
|
22075
|
+
const markdown = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _339 => _339.tableFormat]) });
|
|
22076
22076
|
return {
|
|
22077
22077
|
markdown,
|
|
22078
22078
|
blocks,
|
|
@@ -22179,7 +22179,7 @@ function collectCharText(node, parts, depth = 0) {
|
|
|
22179
22179
|
if (tag === "CHAR") {
|
|
22180
22180
|
for (const c of Array.from(el.childNodes)) {
|
|
22181
22181
|
const t = c.nodeType === 1 ? localName(c) === "TAB" ? " " : rawTextContent(c) : c.nodeType === 3 || c.nodeType === 4 ? _nullishCoalesce(c.nodeValue, () => ( "")) : "";
|
|
22182
|
-
if (t) parts.push(
|
|
22182
|
+
if (t) parts.push(_chunkSJ5OZXELcjs.escapeLiteralTags.call(void 0, t));
|
|
22183
22183
|
}
|
|
22184
22184
|
} else if (tag === "TABLE" || tag === "PICTURE" || tag === "SHAPEOBJECT") {
|
|
22185
22185
|
} else if (tag === "AUTONUM") {
|
|
@@ -22239,7 +22239,7 @@ function buildHmlTable(el, warnings, keep, tableDepth) {
|
|
|
22239
22239
|
const r = Math.min(Math.max(_nullishCoalesce(cell2.rowAddr, () => ( 0)), 0), rowCount - 1);
|
|
22240
22240
|
cellRows[r].push(cell2);
|
|
22241
22241
|
}
|
|
22242
|
-
const table2 =
|
|
22242
|
+
const table2 = _chunkSJ5OZXELcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keep });
|
|
22243
22243
|
if (structured.length > 0) {
|
|
22244
22244
|
const claimed = /* @__PURE__ */ new Set();
|
|
22245
22245
|
for (const { ctx, cellBlocks } of structured) {
|
|
@@ -24002,7 +24002,7 @@ function fillClickHereInXml(xml, cursor, blockedLabels) {
|
|
|
24002
24002
|
};
|
|
24003
24003
|
}
|
|
24004
24004
|
async function extractClickHereFields(hwpxBuffer) {
|
|
24005
|
-
|
|
24005
|
+
_chunkMI655NV5cjs.precheckZipSize.call(void 0, hwpxBuffer);
|
|
24006
24006
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
24007
24007
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort();
|
|
24008
24008
|
const fields = [];
|
|
@@ -24038,7 +24038,7 @@ function readZipEntries(buf) {
|
|
|
24038
24038
|
}
|
|
24039
24039
|
function localDataStart(view, localOffset) {
|
|
24040
24040
|
if (view.getUint32(localOffset, true) !== LOCAL_SIG) {
|
|
24041
|
-
throw new (0,
|
|
24041
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
24042
24042
|
}
|
|
24043
24043
|
const nameLen = view.getUint16(localOffset + 26, true);
|
|
24044
24044
|
const extraLen = view.getUint16(localOffset + 28, true);
|
|
@@ -24068,19 +24068,19 @@ function parseCentralDirectory(buf) {
|
|
|
24068
24068
|
}
|
|
24069
24069
|
}
|
|
24070
24070
|
}
|
|
24071
|
-
if (eocdOffset < 0) throw new (0,
|
|
24071
|
+
if (eocdOffset < 0) throw new (0, _chunkMI655NV5cjs.KordocError)("ZIP EOCD\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
24072
24072
|
const totalEntries = view.getUint16(eocdOffset + 10, true);
|
|
24073
24073
|
const cdSize = view.getUint32(eocdOffset + 12, true);
|
|
24074
24074
|
const cdOffset = view.getUint32(eocdOffset + 16, true);
|
|
24075
|
-
if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0,
|
|
24075
|
+
if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0, _chunkMI655NV5cjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
24076
24076
|
if (eocdOffset >= 20 && view.getUint32(eocdOffset - 20, true) === ZIP64_EOCD_LOC_SIG) {
|
|
24077
|
-
throw new (0,
|
|
24077
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
24078
24078
|
}
|
|
24079
24079
|
const decoder = new TextDecoder("utf-8");
|
|
24080
24080
|
const entries = [];
|
|
24081
24081
|
let pos = cdOffset;
|
|
24082
24082
|
for (let i = 0; i < totalEntries; i++) {
|
|
24083
|
-
if (view.getUint32(pos, true) !== CD_SIG) throw new (0,
|
|
24083
|
+
if (view.getUint32(pos, true) !== CD_SIG) throw new (0, _chunkMI655NV5cjs.KordocError)("ZIP Central Directory \uC190\uC0C1");
|
|
24084
24084
|
const flags = view.getUint16(pos + 8, true);
|
|
24085
24085
|
const method = view.getUint16(pos + 10, true);
|
|
24086
24086
|
const crc = view.getUint32(pos + 16, true);
|
|
@@ -24091,7 +24091,7 @@ function parseCentralDirectory(buf) {
|
|
|
24091
24091
|
const commentLen = view.getUint16(pos + 32, true);
|
|
24092
24092
|
const localOffset = view.getUint32(pos + 42, true);
|
|
24093
24093
|
if (compSize === 4294967295 || uncompSize === 4294967295 || localOffset === 4294967295) {
|
|
24094
|
-
throw new (0,
|
|
24094
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
24095
24095
|
}
|
|
24096
24096
|
const name = decoder.decode(buf.subarray(pos + 46, pos + 46 + nameLen));
|
|
24097
24097
|
const cdEnd = pos + 46 + nameLen + extraLen + commentLen;
|
|
@@ -24120,11 +24120,11 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
24120
24120
|
const { entries, cdOffset, eocdOffset } = parseCentralDirectory(original);
|
|
24121
24121
|
const view = new DataView(original.buffer, original.byteOffset, original.byteLength);
|
|
24122
24122
|
for (const name of replacements.keys()) {
|
|
24123
|
-
if (!entries.some((e) => e.name === name)) throw new (0,
|
|
24123
|
+
if (!entries.some((e) => e.name === name)) throw new (0, _chunkMI655NV5cjs.KordocError)(`ZIP\uC5D0 \uC5C6\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
|
|
24124
24124
|
}
|
|
24125
24125
|
if (additions) {
|
|
24126
24126
|
for (const name of additions.keys()) {
|
|
24127
|
-
if (entries.some((e) => e.name === name)) throw new (0,
|
|
24127
|
+
if (entries.some((e) => e.name === name)) throw new (0, _chunkMI655NV5cjs.KordocError)(`ZIP\uC5D0 \uC774\uBBF8 \uC788\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
|
|
24128
24128
|
}
|
|
24129
24129
|
}
|
|
24130
24130
|
const byLocal = [...entries].sort((a, b) => a.localOffset - b.localOffset);
|
|
@@ -24143,7 +24143,7 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
24143
24143
|
offset += seg.length;
|
|
24144
24144
|
continue;
|
|
24145
24145
|
}
|
|
24146
|
-
if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0,
|
|
24146
|
+
if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0, _chunkMI655NV5cjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
24147
24147
|
const nameLen = view.getUint16(e.localOffset + 26, true);
|
|
24148
24148
|
const extraLen = view.getUint16(e.localOffset + 28, true);
|
|
24149
24149
|
const headerLen = 30 + nameLen + extraLen;
|
|
@@ -24151,7 +24151,7 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
24151
24151
|
const hview = new DataView(header.buffer, header.byteOffset, header.byteLength);
|
|
24152
24152
|
const method = e.method;
|
|
24153
24153
|
if (method !== 0 && method !== 8) {
|
|
24154
|
-
throw new (0,
|
|
24154
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 ZIP \uC555\uCD95 \uBC29\uC2DD(method=${method}): ${e.name} \u2014 STORE(0)/DEFLATE(8)\uB9CC \uAD50\uCCB4 \uAC00\uB2A5`);
|
|
24155
24155
|
}
|
|
24156
24156
|
const compData = method === 0 ? newData : new Uint8Array(_zlib.deflateRawSync.call(void 0, newData));
|
|
24157
24157
|
const crc = crc32(newData);
|
|
@@ -24249,11 +24249,11 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
24249
24249
|
// src/form/filler-hwpx.ts
|
|
24250
24250
|
async function fillHwpx(hwpxBuffer, values, blockedLabels) {
|
|
24251
24251
|
const u8 = new Uint8Array(hwpxBuffer);
|
|
24252
|
-
|
|
24252
|
+
_chunkMI655NV5cjs.precheckZipSize.call(void 0, hwpxBuffer);
|
|
24253
24253
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
24254
24254
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort();
|
|
24255
24255
|
if (sectionPaths.length === 0) {
|
|
24256
|
-
throw new (0,
|
|
24256
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
24257
24257
|
}
|
|
24258
24258
|
const warnings = [];
|
|
24259
24259
|
const normalizedValues = normalizeValues(values, warnings);
|
|
@@ -24645,7 +24645,7 @@ var MIN_SIDE = 24;
|
|
|
24645
24645
|
async function ocrEmbeddedImages(blocks, options, warnings) {
|
|
24646
24646
|
const ocr = _optionalChain([options, 'optionalAccess', _485 => _485.ocr]);
|
|
24647
24647
|
if (ocr !== true && ocr !== "force" && typeof ocr !== "function") return false;
|
|
24648
|
-
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-
|
|
24648
|
+
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-BELHEWPX.cjs")));
|
|
24649
24649
|
let inserted = false, unreadable = 0;
|
|
24650
24650
|
let failed = null;
|
|
24651
24651
|
const walk = async (list, depth) => {
|
|
@@ -24686,7 +24686,7 @@ async function ocrEmbeddedImages(blocks, options, warnings) {
|
|
|
24686
24686
|
function ocrBytes(img) {
|
|
24687
24687
|
const mime = img.mimeType.toLowerCase();
|
|
24688
24688
|
if (mime.includes("wmf") || mime.includes("emf")) return null;
|
|
24689
|
-
if (mime.includes("bmp")) return
|
|
24689
|
+
if (mime.includes("bmp")) return _chunk2BCQVQO2cjs.bmpToPng.call(void 0, img.data);
|
|
24690
24690
|
return img.data;
|
|
24691
24691
|
}
|
|
24692
24692
|
async function tooSmall(bytes) {
|
|
@@ -24855,7 +24855,7 @@ function classifyTableTree(blocks) {
|
|
|
24855
24855
|
return blocks;
|
|
24856
24856
|
}
|
|
24857
24857
|
function chooseTableRepresentation(table2, opts = {}) {
|
|
24858
|
-
const structured = hasMerged(table2) ||
|
|
24858
|
+
const structured = hasMerged(table2) || _chunkSJ5OZXELcjs.hasStructuredCellContent.call(void 0, table2);
|
|
24859
24859
|
if (opts.smartVisual && _optionalChain([table2, 'access', _501 => _501.classification, 'optionalAccess', _502 => _502.kind]) === "non-tabular-layout") return "visual";
|
|
24860
24860
|
return structured ? "html" : "gfm";
|
|
24861
24861
|
}
|
|
@@ -35434,21 +35434,22 @@ var FORBID_START = /* @__PURE__ */ new Set([..."!%),.:;?]}\xA2\xB0\u2032\u2033\u
|
|
|
35434
35434
|
var FORBID_END = /* @__PURE__ */ new Set([..."$([{\xA3\xA5\u3008\u300A\u300C\u300E\u3010\u3014$([{\u20A9"]);
|
|
35435
35435
|
var HANCOM_FORBID_START = /* @__PURE__ */ new Set([..."!%),.:;>?]^`}~\xB0\xB7\u3009\u300B\u300D\u300F\u3011\u3015\u3017\u3019\u301B\u30FB\uFF01\uFF05\uFF09\uFF0C\uFF0E\uFF1A\uFF1B\uFF1E\uFF1F\uFF3D\uFF3E\uFF40\uFF5D\uFF5E\uFF65\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308E\u30A1\u30A3\u30A5\u30A7\u30A9\u30C3\u30E3\u30E5\u30E7\u30EE\u30F5\u30F6\u3001\u3002\u3003\u3005\u30FC\u309B\u309C\u309D\u309E\u30FD\u30FE\u2019\u201D\u2024\u2025\u2026\u2030\u2031\u2032\u2033\u2034\u2035\u2036\u2037\u2103\u2109"]);
|
|
35436
35436
|
var HANCOM_FORBID_END = /* @__PURE__ */ new Set([..."(<[\\{\xA7\u2018\u201C\u3008\u300A\u300C\u300E\u3010\u3014\u3016\u3018\u301A\uFF04\uFF08\uFF1C\uFF3B\uFF3C\uFF5B\uFFE0\uFFE1\uFFE5\uFFE6$\xA2\xA3\xA4\xA5\u09F2\u09F3\u0E3F", ...Array.from({ length: 13 }, (_, i) => String.fromCharCode(8352 + i))]);
|
|
35437
|
+
var isWrapSpace = (ch) => ch === " " || ch === "\u2005";
|
|
35437
35438
|
function prepareWrap(text, mode, opts) {
|
|
35438
35439
|
const widthEm = widthFnOf(_optionalChain([opts, 'optionalAccess', _508 => _508.faceClass])), spaceEm = _nullishCoalesce(_optionalChain([opts, 'optionalAccess', _509 => _509.spaceEm]), () => ( SPACE_EM_FIXED));
|
|
35439
35440
|
const advances = [], steps = [];
|
|
35440
35441
|
let i = 0;
|
|
35441
35442
|
for (const ch of text) {
|
|
35442
35443
|
const cp = ch.codePointAt(0);
|
|
35443
|
-
advances[i] = isSpaceCp(cp) ? spaceEm : widthEm(cp);
|
|
35444
|
+
advances[i] = cp === 8197 ? 250 : isSpaceCp(cp) ? spaceEm : widthEm(cp);
|
|
35444
35445
|
steps[i] = ch.length;
|
|
35445
35446
|
i += ch.length;
|
|
35446
35447
|
}
|
|
35447
35448
|
return { units: splitWrapUnits(text, mode), advances, steps };
|
|
35448
35449
|
}
|
|
35449
35450
|
function splitWrapUnits(text, mode, latinBreak = false) {
|
|
35450
|
-
if (latinBreak) return _nullishCoalesce(text.match(mode === "keep" ? / +|[\x21-\x7e]|[^ \x21-\x7e]+/gu : / +|[^ ](?:\u00a0[^ \u00a0]?)*/gu), () => ( []));
|
|
35451
|
-
return _nullishCoalesce(text.match(mode === "keep" ? / +|\ufdd0+(?=[^ \ufdd0])|[^ ]+/gu : / +|\u2060*(?:[\x21-\x7e\u00a1-\u024f\u2018-\u201f]+|[^ ])(?:\u00a0(?:[\x21-\x7e\u00a1-\u024f\u2018-\u201f]+|[^ \u00a0])?)*/gu), () => ( []));
|
|
35451
|
+
if (latinBreak) return _nullishCoalesce(text.match(mode === "keep" ? /[ \u2005]+|[\x21-\x7e]|[^ \u2005\x21-\x7e]+/gu : /[ \u2005]+|[^ \u2005](?:\u00a0[^ \u2005\u00a0]?)*/gu), () => ( []));
|
|
35452
|
+
return _nullishCoalesce(text.match(mode === "keep" ? /[ \u2005]+|\ufdd0+(?=[^ \u2005\ufdd0])|[^ \u2005]+/gu : /[ \u2005]+|\u2060*(?:[\x21-\x7e\u00a1-\u024f\u2018-\u201f]+|[^ \u2005])(?:\u00a0(?:[\x21-\x7e\u00a1-\u024f\u2018-\u201f]+|[^ \u2005\u00a0])?)*/gu), () => ( []));
|
|
35452
35453
|
}
|
|
35453
35454
|
function simulateWrap(text, firstWidth, contWidth, height, ratioPct, mode = "keep", opts) {
|
|
35454
35455
|
if (!_optionalChain([opts, 'optionalAccess', _510 => _510.prepared]) && text.includes("\n")) {
|
|
@@ -35495,7 +35496,7 @@ function simulateWrap(text, firstWidth, contWidth, height, ratioPct, mode = "kee
|
|
|
35495
35496
|
if (unitW) return (_nullishCoalesce(unitW[i], () => ( 0))) + (ch.length === 2 ? _nullishCoalesce(unitW[i + 1], () => ( 0)) : 0);
|
|
35496
35497
|
if (prepared) return prepared.advances[i] * (1 + spacing / 100) * k;
|
|
35497
35498
|
const cp = ch.codePointAt(0);
|
|
35498
|
-
return (isSpaceCp(cp) ? spaceEm : widthEm(cp)) * (1 + spacing / 100) * k;
|
|
35499
|
+
return (cp === 8197 ? 250 : isSpaceCp(cp) ? spaceEm : widthEm(cp)) * (1 + spacing / 100) * k;
|
|
35499
35500
|
};
|
|
35500
35501
|
const rangeW = (from, to) => {
|
|
35501
35502
|
let w = 0;
|
|
@@ -35528,11 +35529,11 @@ function simulateWrap(text, firstWidth, contWidth, height, ratioPct, mode = "kee
|
|
|
35528
35529
|
const u = text[unitPos];
|
|
35529
35530
|
const prevStart = (end) => end - (end >= 2 && /[\uDC00-\uDFFF]/.test(text[end - 1]) && /[\uD800-\uDBFF]/.test(text[end - 2]) ? 2 : 1);
|
|
35530
35531
|
const old = _optionalChain([opts, 'optionalAccess', _533 => _533.before2024]);
|
|
35531
|
-
const splitIn = _optionalChain([opts, 'optionalAccess', _534 => _534.kinsoku]) === "hancom" && split && u !== void 0 && u
|
|
35532
|
+
const splitIn = _optionalChain([opts, 'optionalAccess', _534 => _534.kinsoku]) === "hancom" && split && u !== void 0 && !isWrapSpace(u) && !isWrapSpace(text[bp - 1]);
|
|
35532
35533
|
const inWord = old && splitIn;
|
|
35533
|
-
if (!splitIn && u !== void 0 && forbidStart.has(u) && prevStart(bp) > lineStart() && text[bp - 1]
|
|
35534
|
+
if (!splitIn && u !== void 0 && forbidStart.has(u) && prevStart(bp) > lineStart() && !isWrapSpace(text[bp - 1])) {
|
|
35534
35535
|
bp = prevStart(bp);
|
|
35535
|
-
if (old && forbidStart.has(text[bp]) && prevStart(bp) > lineStart() && text[bp - 1]
|
|
35536
|
+
if (old && forbidStart.has(text[bp]) && prevStart(bp) > lineStart() && !isWrapSpace(text[bp - 1])) bp = prevStart(bp);
|
|
35536
35537
|
}
|
|
35537
35538
|
while (!inWord && bp - 1 >= lineStart() && forbidEnd.has(text[bp - 1])) bp--;
|
|
35538
35539
|
if (bp <= lineStart()) bp = unitPos;
|
|
@@ -35543,8 +35544,8 @@ function simulateWrap(text, firstWidth, contWidth, height, ratioPct, mode = "kee
|
|
|
35543
35544
|
lineEnded = false;
|
|
35544
35545
|
placed = unitPos > bp ? 1 : 0;
|
|
35545
35546
|
for (let i = bp; i < unitPos; i++) {
|
|
35546
|
-
if (text[i]
|
|
35547
|
-
else if (condense > 0 && (realSeen || !hancom)) spaceW += rangeW(i, i + 1) - (_nullishCoalesce(_optionalChain([spAt, 'optionalAccess', _535 => _535[i]]), () => ( 0)));
|
|
35547
|
+
if (!isWrapSpace(text[i])) realSeen = true;
|
|
35548
|
+
else if (text[i] === " " && condense > 0 && (realSeen || !hancom)) spaceW += rangeW(i, i + 1) - (_nullishCoalesce(_optionalChain([spAt, 'optionalAccess', _535 => _535[i]]), () => ( 0)));
|
|
35548
35549
|
}
|
|
35549
35550
|
lineW = rangeW(bp, unitPos) + w;
|
|
35550
35551
|
};
|
|
@@ -35558,16 +35559,16 @@ function simulateWrap(text, firstWidth, contWidth, height, ratioPct, mode = "kee
|
|
|
35558
35559
|
lineW = leadW;
|
|
35559
35560
|
};
|
|
35560
35561
|
for (const u of units) {
|
|
35561
|
-
if (u[0]
|
|
35562
|
+
if (isWrapSpace(u[0])) {
|
|
35562
35563
|
if (hancom) {
|
|
35563
35564
|
let k2 = 0;
|
|
35564
35565
|
for (; k2 < u.length; k2++) {
|
|
35565
35566
|
if (!lineEnded && lineW >= avail) lineEnded = true;
|
|
35566
|
-
if (lineEnded && k2 >= 2 && pos + k2 > lineStart()) break;
|
|
35567
|
+
if (lineEnded && (k2 >= 2 || u[k2] === "\u2005") && pos + k2 > lineStart()) break;
|
|
35567
35568
|
if (!lineEnded) {
|
|
35568
35569
|
const sw2 = rangeW(pos + k2, pos + k2 + 1);
|
|
35569
35570
|
lineW += sw2;
|
|
35570
|
-
if (realSeen) spaceW += sw2 - (_nullishCoalesce(_optionalChain([spAt, 'optionalAccess', _536 => _536[pos + k2]]), () => ( 0)));
|
|
35571
|
+
if (realSeen && u[k2] === " ") spaceW += sw2 - (_nullishCoalesce(_optionalChain([spAt, 'optionalAccess', _536 => _536[pos + k2]]), () => ( 0)));
|
|
35571
35572
|
}
|
|
35572
35573
|
}
|
|
35573
35574
|
if (k2 < u.length) breakAt(pos + k2, rangeW(pos + k2, pos + u.length));
|
|
@@ -35576,7 +35577,7 @@ function simulateWrap(text, firstWidth, contWidth, height, ratioPct, mode = "kee
|
|
|
35576
35577
|
}
|
|
35577
35578
|
const sw = rangeW(pos, pos + u.length);
|
|
35578
35579
|
lineW += sw;
|
|
35579
|
-
spaceW +=
|
|
35580
|
+
for (let k2 = 0; k2 < u.length; k2++) if (u[k2] === " ") spaceW += rangeW(pos + k2, pos + k2 + 1);
|
|
35580
35581
|
pos += u.length;
|
|
35581
35582
|
continue;
|
|
35582
35583
|
}
|
|
@@ -35847,7 +35848,7 @@ function findAgency(name) {
|
|
|
35847
35848
|
}
|
|
35848
35849
|
function agencyStyle(name) {
|
|
35849
35850
|
const s = findAgency(name);
|
|
35850
|
-
if (!s) throw new (0,
|
|
35851
|
+
if (!s) throw new (0, _chunkMI655NV5cjs.KordocError)(`agency: \uC2E4\uCE21 \uC11C\uC2DD\uC774 \uC5C6\uB294 \uAE30\uAD00\uC785\uB2C8\uB2E4 "${name}" \u2014 ${AGENCY_COMMON_NAME} \uB610\uB294 ${agencyNames().join("\xB7")}`);
|
|
35851
35852
|
return s;
|
|
35852
35853
|
}
|
|
35853
35854
|
function applyAgency(opts, preset) {
|
|
@@ -36911,7 +36912,7 @@ function needsGaejosikAssets(gongmun) {
|
|
|
36911
36912
|
}
|
|
36912
36913
|
function assertFiniteRange(name, value, min, max) {
|
|
36913
36914
|
if (!Number.isFinite(value) || value < min || value > max) {
|
|
36914
|
-
throw new (0,
|
|
36915
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`${name} must be a finite number between ${min} and ${max}`);
|
|
36915
36916
|
}
|
|
36916
36917
|
}
|
|
36917
36918
|
function validateGongmunOptions(opts) {
|
|
@@ -36929,10 +36930,10 @@ function validateGongmunOptions(opts) {
|
|
|
36929
36930
|
assertFiniteRange(`margins.${side}`, value, 0, 200);
|
|
36930
36931
|
}
|
|
36931
36932
|
if (opts.margins.left + opts.margins.right >= 210) {
|
|
36932
|
-
throw new (0,
|
|
36933
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("margins.left + margins.right must be less than 210");
|
|
36933
36934
|
}
|
|
36934
36935
|
if (opts.margins.top + opts.margins.bottom >= 297) {
|
|
36935
|
-
throw new (0,
|
|
36936
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("margins.top + margins.bottom must be less than 297");
|
|
36936
36937
|
}
|
|
36937
36938
|
}
|
|
36938
36939
|
if (opts.sizes) {
|
|
@@ -36941,24 +36942,24 @@ function validateGongmunOptions(opts) {
|
|
|
36941
36942
|
}
|
|
36942
36943
|
}
|
|
36943
36944
|
if (opts.approval && opts.approval.length > 6) {
|
|
36944
|
-
throw new (0,
|
|
36945
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("approval must contain at most 6 labels");
|
|
36945
36946
|
}
|
|
36946
36947
|
if (opts.checklist && typeof opts.checklist === "object") {
|
|
36947
36948
|
const nums = [..._nullishCoalesce(opts.checklist.na, () => ( [])), ...Object.keys(_nullishCoalesce(opts.checklist.notes, () => ( {}))).map(Number)];
|
|
36948
36949
|
for (const n of nums) {
|
|
36949
|
-
if (!Number.isInteger(n) || n < 1 || n > CHECKLIST_ITEMS) throw new (0,
|
|
36950
|
+
if (!Number.isInteger(n) || n < 1 || n > CHECKLIST_ITEMS) throw new (0, _chunkMI655NV5cjs.KordocError)(`checklist: item number must be an integer between 1 and ${CHECKLIST_ITEMS} (got ${n})`);
|
|
36950
36951
|
}
|
|
36951
36952
|
}
|
|
36952
36953
|
if (opts.levels) {
|
|
36953
36954
|
for (const [key, st] of Object.entries(opts.levels)) {
|
|
36954
36955
|
const depth = Number(key);
|
|
36955
36956
|
if (!Number.isInteger(depth) || depth < 0 || depth >= GONGMUN_LEVEL_COUNT) {
|
|
36956
|
-
throw new (0,
|
|
36957
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`levels: depth must be an integer between 0 and ${GONGMUN_LEVEL_COUNT - 1} (got "${key}")`);
|
|
36957
36958
|
}
|
|
36958
|
-
if (!st || typeof st !== "object") throw new (0,
|
|
36959
|
+
if (!st || typeof st !== "object") throw new (0, _chunkMI655NV5cjs.KordocError)(`levels.${key} must be an object {font, pt, bold}`);
|
|
36959
36960
|
if (st.pt !== void 0) assertFiniteRange(`levels.${key}.pt`, st.pt, 6, 60);
|
|
36960
36961
|
if (st.font !== void 0 && (typeof st.font !== "string" || !st.font.trim())) {
|
|
36961
|
-
throw new (0,
|
|
36962
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`levels.${key}.font must be a non-empty string`);
|
|
36962
36963
|
}
|
|
36963
36964
|
}
|
|
36964
36965
|
}
|
|
@@ -37016,7 +37017,7 @@ function resolveChecklist(c, preset) {
|
|
|
37016
37017
|
function hexColorOption(name, value) {
|
|
37017
37018
|
if (value === void 0) return void 0;
|
|
37018
37019
|
const v = value.trim();
|
|
37019
|
-
if (!/^#[0-9a-fA-F]{6}$/.test(v)) throw new (0,
|
|
37020
|
+
if (!/^#[0-9a-fA-F]{6}$/.test(v)) throw new (0, _chunkMI655NV5cjs.KordocError)(`${name} must be a #RRGGBB color (got "${value}")`);
|
|
37020
37021
|
return v.toUpperCase();
|
|
37021
37022
|
}
|
|
37022
37023
|
function resolveGongmun(input) {
|
|
@@ -37760,7 +37761,7 @@ function parseInlineMarkdown(text) {
|
|
|
37760
37761
|
else spans.push(...emphasisSpans(m[0]));
|
|
37761
37762
|
} else {
|
|
37762
37763
|
const anchor = m[2] || m[3];
|
|
37763
|
-
const href = _nullishCoalesce(
|
|
37764
|
+
const href = _nullishCoalesce(_chunkMI655NV5cjs.sanitizeHref.call(void 0, m[3].trim()), () => ( void 0));
|
|
37764
37765
|
const sub = emphasisSpans(anchor);
|
|
37765
37766
|
if (href) for (const s of sub) s.href = href;
|
|
37766
37767
|
spans.push(...sub);
|
|
@@ -37981,7 +37982,7 @@ function assertSequentialIds(rows, label, startId) {
|
|
|
37981
37982
|
const m = rows[i].match(/\bid="(\d+)"/);
|
|
37982
37983
|
const got = m ? Number(m[1]) : NaN;
|
|
37983
37984
|
if (got !== startId + i) {
|
|
37984
|
-
throw new (0,
|
|
37985
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(
|
|
37985
37986
|
`\uB0B4\uBD80 \uC624\uB958: ${label} id \uD30C\uD2F0\uC158 \uB4DC\uB9AC\uD504\uD2B8 \u2014 ${startId + i} \uC704\uCE58\uC5D0 id=${m ? m[1] : "?"} \uBC29\uCD9C. id \uC0C1\uC218(gen-ids)\uC640 \uC2E4\uC81C \uBC29\uCD9C \uC218\uAC00 \uC5B4\uAE0B\uB0AC\uB2E4 (GJ_CHAR_COUNT\uB958 \uCE74\uC6B4\uD2B8\xB7base \uC0B0\uC220 \uD655\uC778)`
|
|
37986
37987
|
);
|
|
37987
37988
|
}
|
|
@@ -38072,7 +38073,7 @@ function buildCharProperties(theme, gongmun, ratioVariants = [], extraCharPrXmls
|
|
|
38072
38073
|
}
|
|
38073
38074
|
const expectedBase = charVariantBase(richAssets, !!gongmun);
|
|
38074
38075
|
if (rows.length !== expectedBase) {
|
|
38075
|
-
throw new (0,
|
|
38076
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(
|
|
38076
38077
|
`\uB0B4\uBD80 \uC624\uB958: charPr \uAE30\uBCF8 \uBE14\uB85D \uBC29\uCD9C \uC218(${rows.length}) \u2260 charVariantBase(${expectedBase}) \u2014 gen-header \uBC29\uCD9C \uD589\uACFC gen-ids \uCE74\uC6B4\uD2B8 \uC0C1\uC218\uAC00 \uC5B4\uAE0B\uB0AC\uB2E4`
|
|
38077
38078
|
);
|
|
38078
38079
|
}
|
|
@@ -39081,7 +39082,7 @@ function bestSimInRange(arr, from, to, target) {
|
|
|
39081
39082
|
return best;
|
|
39082
39083
|
}
|
|
39083
39084
|
function normForMatch(text) {
|
|
39084
|
-
return
|
|
39085
|
+
return _chunkSJ5OZXELcjs.sanitizeText.call(void 0, text.replace(/\\\$/g, "$").replace(/\\(?=<\/?(?:u|sup|sub)>)/g, "")).replace(/\s+/g, " ").trim();
|
|
39085
39086
|
}
|
|
39086
39087
|
function unescapeGfm(text) {
|
|
39087
39088
|
return text.replace(/\\([~*_`|#<$\\])/g, "$1");
|
|
@@ -39103,7 +39104,7 @@ function replicateGfmTable(table2) {
|
|
|
39103
39104
|
const cell2 = _optionalChain([cells, 'access', _632 => _632[r], 'optionalAccess', _633 => _633[c]]);
|
|
39104
39105
|
if (!cell2) continue;
|
|
39105
39106
|
display[r][c] = {
|
|
39106
|
-
text:
|
|
39107
|
+
text: _chunkSJ5OZXELcjs.escapeGfm.call(void 0, _chunkSJ5OZXELcjs.sanitizeText.call(void 0, cell2.text)).replace(/(?<!\\)\|/g, "\\|").replace(/\r\n|\r|\n/g, "<br>"),
|
|
39107
39108
|
gridR: r,
|
|
39108
39109
|
gridC: c
|
|
39109
39110
|
};
|
|
@@ -39143,16 +39144,16 @@ function replicateCellInnerHtml(cell2) {
|
|
|
39143
39144
|
if (_optionalChain([cell2, 'access', _634 => _634.blocks, 'optionalAccess', _635 => _635.length])) {
|
|
39144
39145
|
return cell2.blocks.map((b) => {
|
|
39145
39146
|
if (b.type === "table" && b.table) {
|
|
39146
|
-
const cap = b.table.caption ?
|
|
39147
|
-
return (cap ?
|
|
39147
|
+
const cap = b.table.caption ? _chunkSJ5OZXELcjs.sanitizeText.call(void 0, b.table.caption) : "";
|
|
39148
|
+
return (cap ? _chunkSJ5OZXELcjs.escapeHtmlCellText.call(void 0, cap) + "<br>" : "") + replicateTableToHtml(b.table);
|
|
39148
39149
|
}
|
|
39149
|
-
if (b.type === "image" && b.text) return `<img src="${
|
|
39150
|
-
const note =
|
|
39151
|
-
const t = (
|
|
39152
|
-
return ((t ?
|
|
39150
|
+
if (b.type === "image" && b.text) return `<img src="${_chunkMI655NV5cjs.escapeHtml.call(void 0, b.text, true)}" alt="image">`;
|
|
39151
|
+
const note = _chunkSJ5OZXELcjs.noteTableHtml.call(void 0, b);
|
|
39152
|
+
const t = (_chunkSJ5OZXELcjs.sanitizeText.call(void 0, _chunkSJ5OZXELcjs.visibleText.call(void 0, b)) + (note ? "" : _chunkSJ5OZXELcjs.noteSuffix.call(void 0, b))).trim();
|
|
39153
|
+
return ((t ? _chunkSJ5OZXELcjs.escapeHtmlCellText.call(void 0, t).replace(/\n/g, "<br>") : "") + note).trim();
|
|
39153
39154
|
}).filter(Boolean).join("<br>");
|
|
39154
39155
|
}
|
|
39155
|
-
return
|
|
39156
|
+
return _chunkSJ5OZXELcjs.escapeHtmlCellText.call(void 0, _chunkSJ5OZXELcjs.sanitizeText.call(void 0, cell2.text)).replace(/\n/g, "<br>");
|
|
39156
39157
|
}
|
|
39157
39158
|
function replicateTableToHtml(table2) {
|
|
39158
39159
|
const rows = replicateHtmlTable(table2);
|
|
@@ -39229,7 +39230,7 @@ function parseHtmlTable(raw) {
|
|
|
39229
39230
|
const cs = parseInt(_optionalChain([attrs, 'access', _638 => _638.match, 'call', _639 => _639(/colspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _640 => _640[1]]) || "1", 10);
|
|
39230
39231
|
const rs = parseInt(_optionalChain([attrs, 'access', _641 => _641.match, 'call', _642 => _642(/rowspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _643 => _643[1]]) || "1", 10);
|
|
39231
39232
|
cellStart = m.index + m[0].length;
|
|
39232
|
-
cellInfo = { colSpan: clampSpan(isNaN(cs) ? 1 : cs,
|
|
39233
|
+
cellInfo = { colSpan: clampSpan(isNaN(cs) ? 1 : cs, _chunkSJ5OZXELcjs.MAX_COLS), rowSpan: clampSpan(isNaN(rs) ? 1 : rs, _chunkSJ5OZXELcjs.MAX_ROWS) };
|
|
39233
39234
|
} else if (cellStart >= 0 && cellInfo && currentRow) {
|
|
39234
39235
|
currentRow.push({ inner: raw.slice(cellStart, m.index), colSpan: cellInfo.colSpan, rowSpan: cellInfo.rowSpan });
|
|
39235
39236
|
cellStart = -1;
|
|
@@ -39254,11 +39255,11 @@ function htmlCellInnerToLines(inner) {
|
|
|
39254
39255
|
work = work.replace(/<img\s(?:"[^"]*"|'[^']*'|[^>"'])*?>/gi, (tag) => {
|
|
39255
39256
|
const m = /\bsrc\s*=\s*(?:"([^"]*)"|'([^']*)')/i.exec(tag);
|
|
39256
39257
|
const src = _nullishCoalesce(_optionalChain([m, 'optionalAccess', _644 => _644[1]]), () => ( _optionalChain([m, 'optionalAccess', _645 => _645[2]])));
|
|
39257
|
-
if (src) imgSrcs.push(
|
|
39258
|
+
if (src) imgSrcs.push(_chunkMI655NV5cjs.unescapeHtml.call(void 0, src));
|
|
39258
39259
|
return "";
|
|
39259
39260
|
});
|
|
39260
39261
|
}
|
|
39261
|
-
const lines = work.split(/<br\s*\/?>/gi).map((s) =>
|
|
39262
|
+
const lines = work.split(/<br\s*\/?>/gi).map((s) => _chunkMI655NV5cjs.unescapeHtml.call(void 0, s).trim()).filter((s) => s.length > 0);
|
|
39262
39263
|
return { lines, hadNonText, imgSrcs };
|
|
39263
39264
|
}
|
|
39264
39265
|
function splitCellByTopLevelTables(html) {
|
|
@@ -40074,8 +40075,8 @@ function layoutHtmlRows(rows) {
|
|
|
40074
40075
|
let c = 0;
|
|
40075
40076
|
for (const cell2 of rows[r].cells) {
|
|
40076
40077
|
while (occupied.has(`${r},${c}`)) c++;
|
|
40077
|
-
const colSpan = clampSpan(cell2.colSpan,
|
|
40078
|
-
const rowSpan = clampSpan(cell2.rowSpan,
|
|
40078
|
+
const colSpan = clampSpan(cell2.colSpan, _chunkSJ5OZXELcjs.MAX_COLS);
|
|
40079
|
+
const rowSpan = clampSpan(cell2.rowSpan, _chunkSJ5OZXELcjs.MAX_ROWS);
|
|
40079
40080
|
placed.push({ r, c, colSpan, rowSpan, inner: cell2.inner, isHeader: rows[r].tag === "th" });
|
|
40080
40081
|
for (let dr = 0; dr < rowSpan; dr++) {
|
|
40081
40082
|
for (let dc = 0; dc < colSpan; dc++) occupied.add(`${r + dr},${c + dc}`);
|
|
@@ -42410,7 +42411,7 @@ function builtinTemplateDir() {
|
|
|
42410
42411
|
for (const c of candidates) {
|
|
42411
42412
|
if (_fs.existsSync.call(void 0, _path.join.call(void 0, c, BUILTIN_TEMPLATES[0].file))) return c;
|
|
42412
42413
|
}
|
|
42413
|
-
throw new (0,
|
|
42414
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("\uB0B4\uC7A5 templates \uB514\uB809\uD1A0\uB9AC\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 (\uD328\uD0A4\uC9C0 \uC124\uCE58\uAC00 \uC190\uC0C1\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4)");
|
|
42414
42415
|
}
|
|
42415
42416
|
function readBuiltinTemplate(t) {
|
|
42416
42417
|
const buf = _fs.readFileSync.call(void 0, _path.join.call(void 0, builtinTemplateDir(), t.file));
|
|
@@ -42886,12 +42887,12 @@ function buildFloatPicXml(itemId, sizeHu, posXHu, posYHu, ids) {
|
|
|
42886
42887
|
return `<hp:pic xmlns:hc="http://www.hancom.co.kr/hwpml/2011/core" id="${ids.id}" zOrder="0" numberingType="PICTURE" textWrap="IN_FRONT_OF_TEXT" textFlow="BOTH_SIDES" lock="0" dropcapstyle="None" href="" groupLevel="0" instid="${ids.instid}" reverse="0"><hp:offset x="0" y="0"/><hp:orgSz width="${w}" height="${h}"/><hp:curSz width="${w}" height="${h}"/><hp:flip horizontal="0" vertical="0"/><hp:rotationInfo angle="0" centerX="${Math.round(w / 2)}" centerY="${Math.round(h / 2)}" rotateimage="1"/><hp:renderingInfo><hc:transMatrix e1="1" e2="0" e3="0" e4="0" e5="1" e6="0"/><hc:scaMatrix e1="1" e2="0" e3="0" e4="0" e5="1" e6="0"/><hc:rotMatrix e1="1" e2="0" e3="0" e4="0" e5="1" e6="0"/></hp:renderingInfo><hp:imgRect><hc:pt0 x="0" y="0"/><hc:pt1 x="${w}" y="0"/><hc:pt2 x="${w}" y="${h}"/><hc:pt3 x="0" y="${h}"/></hp:imgRect><hp:imgClip left="0" right="${w}" top="0" bottom="${h}"/><hp:inMargin left="0" right="0" top="0" bottom="0"/><hp:imgDim dimwidth="${w}" dimheight="${h}"/><hc:img binaryItemIDRef="${itemId}" bright="0" contrast="0" effect="REAL_PIC" alpha="0"/><hp:effects/><hp:sz width="${w}" widthRelTo="ABSOLUTE" height="${h}" heightRelTo="ABSOLUTE" protect="0"/><hp:pos treatAsChar="0" affectLSpacing="0" flowWithText="0" allowOverlap="1" holdAnchorAndSO="0" vertRelTo="PARA" horzRelTo="COLUMN" vertAlign="TOP" horzAlign="LEFT" vertOffset="${posYHu}" horzOffset="${posXHu}"/><hp:outMargin left="0" right="0" top="0" bottom="0"/><hp:shapeComment>kordoc seal</hp:shapeComment></hp:pic>`;
|
|
42887
42888
|
}
|
|
42888
42889
|
async function placeSealHwpx(hwpxBuffer, ops) {
|
|
42889
|
-
if (ops.length === 0) throw new (0,
|
|
42890
|
+
if (ops.length === 0) throw new (0, _chunkMI655NV5cjs.KordocError)("place_seal: \uBC30\uCE58\uD560 \uB3C4\uC7A5\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
42890
42891
|
const u8 = new Uint8Array(hwpxBuffer);
|
|
42891
|
-
|
|
42892
|
+
_chunkMI655NV5cjs.precheckZipSize.call(void 0, hwpxBuffer);
|
|
42892
42893
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
42893
42894
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort((a, b) => Number(_nullishCoalesce(_optionalChain([a, 'access', _856 => _856.match, 'call', _857 => _857(/(\d+)\.xml$/i), 'optionalAccess', _858 => _858[1]]), () => ( 0))) - Number(_nullishCoalesce(_optionalChain([b, 'access', _859 => _859.match, 'call', _860 => _860(/(\d+)\.xml$/i), 'optionalAccess', _861 => _861[1]]), () => ( 0))));
|
|
42894
|
-
if (sectionPaths.length === 0) throw new (0,
|
|
42895
|
+
if (sectionPaths.length === 0) throw new (0, _chunkMI655NV5cjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
42895
42896
|
const manifestPath = Object.keys(zip.files).find((name) => /\.hpf$/i.test(name));
|
|
42896
42897
|
const headerPath = Object.keys(zip.files).find((name) => /(^|\/)header\.xml$/i.test(name));
|
|
42897
42898
|
const styles = headerPath ? parseRenderStyles(await readZipEntry(zip.file(headerPath), "text")) : null;
|
|
@@ -42932,11 +42933,11 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
42932
42933
|
const manifestItems = [];
|
|
42933
42934
|
const placed = [];
|
|
42934
42935
|
for (const op of ops) {
|
|
42935
|
-
if (!op.anchor) throw new (0,
|
|
42936
|
-
if (!op.image || op.image.length === 0) throw new (0,
|
|
42936
|
+
if (!op.anchor) throw new (0, _chunkMI655NV5cjs.KordocError)("place_seal: anchor \uBB38\uAD6C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
42937
|
+
if (!op.image || op.image.length === 0) throw new (0, _chunkMI655NV5cjs.KordocError)("place_seal: \uB3C4\uC7A5 \uC774\uBBF8\uC9C0\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
42937
42938
|
const ext = (_nullishCoalesce(op.ext, () => ( "png"))).toLowerCase();
|
|
42938
|
-
if (!MIME[ext]) throw new (0,
|
|
42939
|
-
if (!imageMagicMatches(op.image, ext)) throw new (0,
|
|
42939
|
+
if (!MIME[ext]) throw new (0, _chunkMI655NV5cjs.KordocError)(`place_seal: \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC774\uBBF8\uC9C0 \uD655\uC7A5\uC790 .${ext} (png/jpg/bmp/gif)`);
|
|
42940
|
+
if (!imageMagicMatches(op.image, ext)) throw new (0, _chunkMI655NV5cjs.KordocError)(`place_seal: \uC774\uBBF8\uC9C0 \uB0B4\uC6A9\uC774 .${ext} \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 (\uB9E4\uC9C1\uBC14\uC774\uD2B8 \uBD88\uC77C\uCE58)`);
|
|
42940
42941
|
const wantOcc = _nullishCoalesce(op.occurrence, () => ( 0));
|
|
42941
42942
|
let found = null;
|
|
42942
42943
|
let total = 0;
|
|
@@ -42969,7 +42970,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
42969
42970
|
}
|
|
42970
42971
|
}
|
|
42971
42972
|
}
|
|
42972
|
-
throw new (0,
|
|
42973
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(
|
|
42973
42974
|
`place_seal: \uC575\uCEE4 "${op.anchor}" ${wantOcc}\uBC88\uC9F8 \uB4F1\uC7A5\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4 (\uBCF8\uBB38 \uB0B4 ${total}\uD68C \uB4F1\uC7A5 \u2014 occurrence 0..${Math.max(0, total - 1)})`
|
|
42974
42975
|
);
|
|
42975
42976
|
}
|
|
@@ -42977,7 +42978,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
42977
42978
|
const xml = sectionXmls[si];
|
|
42978
42979
|
const run = anchorRunInfo(xml, site.para, op.anchor);
|
|
42979
42980
|
if (!run) {
|
|
42980
|
-
throw new (0,
|
|
42981
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`place_seal: \uC575\uCEE4 "${op.anchor}" \uBB38\uB2E8\uC5D0\uC11C run\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4`);
|
|
42981
42982
|
}
|
|
42982
42983
|
const charPrHeight = _nullishCoalesce(_optionalChain([styles, 'optionalAccess', _862 => _862.charPr, 'access', _863 => _863.get, 'call', _864 => _864(run.charPr), 'optionalAccess', _865 => _865.height]), () => ( 1e3));
|
|
42983
42984
|
const fontPt = charPrHeight / 100;
|
|
@@ -43255,7 +43256,7 @@ function pick(map, keys) {
|
|
|
43255
43256
|
return out;
|
|
43256
43257
|
}
|
|
43257
43258
|
async function hwpxToProfile(input) {
|
|
43258
|
-
const buf = input instanceof ArrayBuffer ? input :
|
|
43259
|
+
const buf = input instanceof ArrayBuffer ? input : _chunkMI655NV5cjs.toArrayBuffer.call(void 0, input);
|
|
43259
43260
|
const zip = await _jszip2.default.loadAsync(buf);
|
|
43260
43261
|
const parser = createXmlParser();
|
|
43261
43262
|
const headerFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( _optionalChain([zip, 'access', _890 => _890.file, 'call', _891 => _891(/[Hh]eader\.xml$/), 'optionalAccess', _892 => _892[0]])));
|
|
@@ -44228,7 +44229,7 @@ function patchTableRows(input) {
|
|
|
44228
44229
|
const cells = input.editedCells(ins.ei);
|
|
44229
44230
|
if (!cells) return skip("\uC0BD\uC785 \uD589\uC5D0 \uC774\uBBF8\uC9C0/\uC911\uCCA9\uD45C \uD3EC\uD568 \u2014 \uD589 \uCD94\uAC00 \uBBF8\uC9C0\uC6D0");
|
|
44230
44231
|
for (const cell2 of cells) {
|
|
44231
|
-
const unstable = cell2.lines.find((l) =>
|
|
44232
|
+
const unstable = cell2.lines.find((l) => _chunkSJ5OZXELcjs.sanitizeText.call(void 0, l) !== l);
|
|
44232
44233
|
if (unstable !== void 0) return skip("\uC0BD\uC785 \uD589\uC5D0 \uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uBBF8\uC9C0\uC6D0");
|
|
44233
44234
|
}
|
|
44234
44235
|
const tmplCells = scanTable.rows[template];
|
|
@@ -44423,14 +44424,14 @@ function buildEmbeddedLineSplices(para2, xml, newLines) {
|
|
|
44423
44424
|
}
|
|
44424
44425
|
if (text !== para2.text || !/[\r\n]/.test(text) || /<br\s*\/?\s*>/i.test(text)) return null;
|
|
44425
44426
|
const lines = text.split(/\r\n|\r|\n/);
|
|
44426
|
-
if (lines.length !== newLines.length || lines.some((line) => !line.trim() ||
|
|
44427
|
+
if (lines.length !== newLines.length || lines.some((line) => !line.trim() || _chunkSJ5OZXELcjs.sanitizeText.call(void 0, line) !== line.trim())) return null;
|
|
44427
44428
|
const splices = [];
|
|
44428
44429
|
let offset = 0;
|
|
44429
44430
|
for (let i = 0; i < lines.length; i++) {
|
|
44430
44431
|
const line = lines[i];
|
|
44431
44432
|
const orig = line.trim();
|
|
44432
44433
|
const next = newLines[i];
|
|
44433
|
-
if (
|
|
44434
|
+
if (_chunkSJ5OZXELcjs.sanitizeText.call(void 0, next) !== next || /[\r\n]/.test(next) || /[\uD800-\uDFFF]/u.test(next) || decodeXmlEntities(escapeXmlText(next)) !== next) return null;
|
|
44434
44435
|
let prefix = 0;
|
|
44435
44436
|
while (prefix < orig.length && prefix < next.length && orig[prefix] === next[prefix]) prefix++;
|
|
44436
44437
|
if (prefix > 0 && /[\uD800-\uDBFF]/.test(orig[prefix - 1]) && /[\uDC00-\uDFFF]/.test(_nullishCoalesce(orig[prefix], () => ( "")))) prefix--;
|
|
@@ -44830,12 +44831,12 @@ function stripCellTokens(text) {
|
|
|
44830
44831
|
}
|
|
44831
44832
|
function patchTextChunkTable(table2, scanTable, orig, edited, ctx, skip) {
|
|
44832
44833
|
if (table2.rows === 1 && table2.cols === 1) {
|
|
44833
|
-
const content =
|
|
44834
|
+
const content = _chunkSJ5OZXELcjs.sanitizeText.call(void 0, table2.cells[0][0].text);
|
|
44834
44835
|
const replicaLines = content.split(/\n/).map((line) => {
|
|
44835
44836
|
const t = line.trim();
|
|
44836
44837
|
if (!t) return "";
|
|
44837
|
-
if (/^\d+\.\s/.test(t)) return `**${
|
|
44838
|
-
return
|
|
44838
|
+
if (/^\d+\.\s/.test(t)) return `**${_chunkSJ5OZXELcjs.escapeGfm.call(void 0, t)}**`;
|
|
44839
|
+
return _chunkSJ5OZXELcjs.escapeGfm.call(void 0, t);
|
|
44839
44840
|
}).filter(Boolean);
|
|
44840
44841
|
if (replicaLines.join("\n") !== orig.lines.join("\n")) return skip("\uD45C \uC88C\uD45C \uC7AC\uD604 \uBD88\uC77C\uCE58 \u2014 \uB9E4\uD551 \uC2E0\uB8B0 \uBD88\uAC00");
|
|
44841
44842
|
if (extractCellTokens(orig.raw) !== extractCellTokens(edited.raw)) return skip("\uC140 \uB0B4 \uC774\uBBF8\uC9C0 \uBCC0\uACBD\uC740 \uBBF8\uC9C0\uC6D0");
|
|
@@ -44849,7 +44850,7 @@ function patchTextChunkTable(table2, scanTable, orig, edited, ctx, skip) {
|
|
|
44849
44850
|
if (table2.cols === 1 && table2.rows >= 2) {
|
|
44850
44851
|
const replica = [];
|
|
44851
44852
|
for (let r = 0; r < table2.rows; r++) {
|
|
44852
|
-
const line =
|
|
44853
|
+
const line = _chunkSJ5OZXELcjs.escapeGfm.call(void 0, _chunkSJ5OZXELcjs.sanitizeText.call(void 0, table2.cells[r][0].text)).replace(/\n/g, " ");
|
|
44853
44854
|
if (line) replica.push({ line, gridR: r });
|
|
44854
44855
|
}
|
|
44855
44856
|
if (replica.map((x) => x.line).join("\n") !== orig.lines.join("\n")) return skip("\uD45C \uC88C\uD45C \uC7AC\uD604 \uBD88\uC77C\uCE58 \u2014 \uB9E4\uD551 \uC2E0\uB8B0 \uBD88\uAC00");
|
|
@@ -44903,7 +44904,7 @@ function applyCellEdit(table2, scanTable, gridR, gridC, newLines, ctx, before2,
|
|
|
44903
44904
|
}
|
|
44904
44905
|
const splices = [];
|
|
44905
44906
|
let sectionIndex = -1;
|
|
44906
|
-
const unstable = newLines.find((l) =>
|
|
44907
|
+
const unstable = newLines.find((l) => _chunkSJ5OZXELcjs.sanitizeText.call(void 0, l) !== l);
|
|
44907
44908
|
if (unstable !== void 0) return skip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uD328\uCE58 \uC2DC \uC6D0\uBB38 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0");
|
|
44908
44909
|
if (nonEmpty.length === 0) {
|
|
44909
44910
|
if (newLines.length === 0) return 0;
|
|
@@ -45027,7 +45028,7 @@ async function resolveSectionEntryNames(zip) {
|
|
|
45027
45028
|
const paths = parseSectionPathsFromManifest(xml).filter((p) => zip.file(p) !== null);
|
|
45028
45029
|
if (paths.length > 0) return paths;
|
|
45029
45030
|
}
|
|
45030
|
-
return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(
|
|
45031
|
+
return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(_chunkMI655NV5cjs.compareSectionPaths);
|
|
45031
45032
|
}
|
|
45032
45033
|
|
|
45033
45034
|
// src/roundtrip/hwp5-patch.ts
|
|
@@ -45814,7 +45815,7 @@ function patchParagraph(block, orig, edited, ctx, skip) {
|
|
|
45814
45815
|
}
|
|
45815
45816
|
const origPlain = block.text != null ? block.text : restoreBr(textUnitToPlain(orig.raw, block));
|
|
45816
45817
|
if (newPlain === origPlain) return skip("\uD14D\uC2A4\uD2B8 \uC678 \uBCC0\uACBD(\uD5E4\uB529 \uB808\uBCA8/\uC11C\uC2DD)\uB9CC \uAC10\uC9C0 \u2014 \uC2A4\uD0C0\uC77C \uBCC0\uACBD\uC740 \uBBF8\uC9C0\uC6D0");
|
|
45817
|
-
if (
|
|
45818
|
+
if (_chunkSJ5OZXELcjs.sanitizeText.call(void 0, newPlain) !== newPlain) {
|
|
45818
45819
|
return skip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uD328\uCE58 \uC2DC \uC6D0\uBB38 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0");
|
|
45819
45820
|
}
|
|
45820
45821
|
let origMd = restoreBr(textUnitToPlain(orig.raw, block));
|
|
@@ -45861,7 +45862,7 @@ function patchGfmCells(scanTable, orig, edited, ctx, skip) {
|
|
|
45861
45862
|
cellSkip("\uC140 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58 \u2014 \uC18C\uC2A4\uB9F5 \uC2E0\uB8B0 \uBD88\uAC00");
|
|
45862
45863
|
continue;
|
|
45863
45864
|
}
|
|
45864
|
-
if (afterEach.some((l) =>
|
|
45865
|
+
if (afterEach.some((l) => _chunkSJ5OZXELcjs.sanitizeText.call(void 0, l) !== l)) {
|
|
45865
45866
|
cellSkip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uBBF8\uC9C0\uC6D0");
|
|
45866
45867
|
continue;
|
|
45867
45868
|
}
|
|
@@ -45889,7 +45890,7 @@ function patchGfmCells(scanTable, orig, edited, ctx, skip) {
|
|
|
45889
45890
|
cellSkip("\uC140 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58 \u2014 \uC18C\uC2A4\uB9F5 \uC2E0\uB8B0 \uBD88\uAC00");
|
|
45890
45891
|
break;
|
|
45891
45892
|
}
|
|
45892
|
-
if (
|
|
45893
|
+
if (_chunkSJ5OZXELcjs.sanitizeText.call(void 0, after2) !== after2) {
|
|
45893
45894
|
cellSkip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uBBF8\uC9C0\uC6D0");
|
|
45894
45895
|
break;
|
|
45895
45896
|
}
|
|
@@ -45945,12 +45946,12 @@ function patchHtmlCells5(table2, scanTable, orig, edited, ctx, skip) {
|
|
|
45945
45946
|
}
|
|
45946
45947
|
function patchTextChunk5(table2, scanTable, orig, edited, ctx, skip) {
|
|
45947
45948
|
if (table2.rows === 1 && table2.cols === 1) {
|
|
45948
|
-
const content =
|
|
45949
|
+
const content = _chunkSJ5OZXELcjs.sanitizeText.call(void 0, table2.cells[0][0].text);
|
|
45949
45950
|
const replicaLines = content.split(/\n/).map((line) => {
|
|
45950
45951
|
const t = line.trim();
|
|
45951
45952
|
if (!t) return "";
|
|
45952
|
-
if (/^\d+\.\s/.test(t)) return `**${
|
|
45953
|
-
return
|
|
45953
|
+
if (/^\d+\.\s/.test(t)) return `**${_chunkSJ5OZXELcjs.escapeGfm.call(void 0, t)}**`;
|
|
45954
|
+
return _chunkSJ5OZXELcjs.escapeGfm.call(void 0, t);
|
|
45954
45955
|
}).filter(Boolean);
|
|
45955
45956
|
if (replicaLines.join("\n") !== orig.lines.join("\n")) return skip("\uD45C \uC88C\uD45C \uC7AC\uD604 \uBD88\uC77C\uCE58 \u2014 \uB9E4\uD551 \uC2E0\uB8B0 \uBD88\uAC00");
|
|
45956
45957
|
if (extractCellTokens(orig.raw) !== extractCellTokens(edited.raw)) return skip("\uC140 \uB0B4 \uC774\uBBF8\uC9C0 \uBCC0\uACBD\uC740 \uBBF8\uC9C0\uC6D0");
|
|
@@ -45964,7 +45965,7 @@ function patchTextChunk5(table2, scanTable, orig, edited, ctx, skip) {
|
|
|
45964
45965
|
if (table2.cols === 1 && table2.rows >= 2) {
|
|
45965
45966
|
const replica = [];
|
|
45966
45967
|
for (let r = 0; r < table2.rows; r++) {
|
|
45967
|
-
const line =
|
|
45968
|
+
const line = _chunkSJ5OZXELcjs.escapeGfm.call(void 0, _chunkSJ5OZXELcjs.sanitizeText.call(void 0, table2.cells[r][0].text)).replace(/\n/g, " ");
|
|
45968
45969
|
if (line) replica.push({ line, gridR: r });
|
|
45969
45970
|
}
|
|
45970
45971
|
if (replica.map((x) => x.line).join("\n") !== orig.lines.join("\n")) return skip("\uD45C \uC88C\uD45C \uC7AC\uD604 \uBD88\uC77C\uCE58 \u2014 \uB9E4\uD551 \uC2E0\uB8B0 \uBD88\uAC00");
|
|
@@ -46005,7 +46006,7 @@ function applyCellEdit5(table2, scanTable, gridR, gridC, newLines, ctx, before2,
|
|
|
46005
46006
|
if (origLineCount !== void 0 && nonEmpty.length > 0 && origLineCount !== nonEmpty.length) {
|
|
46006
46007
|
return skip("\uC140 \uC904 \uACBD\uACC4 \uB9E4\uD551 \uBAA8\uD638 (\uBB38\uB2E8 \uB0B4 \uC904\uBC14\uAFC8) \u2014 \uBBF8\uC9C0\uC6D0");
|
|
46007
46008
|
}
|
|
46008
|
-
const unstable = newLines.find((l) =>
|
|
46009
|
+
const unstable = newLines.find((l) => _chunkSJ5OZXELcjs.sanitizeText.call(void 0, l) !== l);
|
|
46009
46010
|
if (unstable !== void 0) return skip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uD328\uCE58 \uC2DC \uC6D0\uBB38 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0");
|
|
46010
46011
|
const targets = nonEmpty.length > 0 ? nonEmpty : cell2.paras;
|
|
46011
46012
|
if (targets.length === 0) return skip("\uC140\uC5D0 \uBB38\uB2E8\uC774 \uC5C6\uC74C \u2014 \uBBF8\uC9C0\uC6D0");
|
|
@@ -46407,12 +46408,12 @@ function buildOrigUnits(blocks) {
|
|
|
46407
46408
|
const block = blocks[i];
|
|
46408
46409
|
let consume = 1;
|
|
46409
46410
|
let chunk;
|
|
46410
|
-
if (block.type === "paragraph" && block.text && /^\[별표\s*\d+/.test(
|
|
46411
|
+
if (block.type === "paragraph" && block.text && /^\[별표\s*\d+/.test(_chunkSJ5OZXELcjs.sanitizeText.call(void 0, block.text))) {
|
|
46411
46412
|
const next = blocks[i + 1];
|
|
46412
46413
|
if (_optionalChain([next, 'optionalAccess', _967 => _967.type]) === "paragraph" && next.text && /관련\)?$/.test(next.text)) consume = 2;
|
|
46413
|
-
chunk =
|
|
46414
|
+
chunk = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, blocks.slice(i, i + consume));
|
|
46414
46415
|
} else {
|
|
46415
|
-
chunk =
|
|
46416
|
+
chunk = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, [block]);
|
|
46416
46417
|
}
|
|
46417
46418
|
if (chunk) {
|
|
46418
46419
|
const subUnits = splitMarkdownUnits(chunk);
|
|
@@ -46696,7 +46697,7 @@ function patchParagraphUnit(block, orig, edited, ctx, skip) {
|
|
|
46696
46697
|
}
|
|
46697
46698
|
}
|
|
46698
46699
|
if (newPlain === origPlain) return skip("\uD14D\uC2A4\uD2B8 \uC678 \uBCC0\uACBD(\uD5E4\uB529 \uB808\uBCA8/\uC11C\uC2DD)\uB9CC \uAC10\uC9C0 \u2014 \uC2A4\uD0C0\uC77C \uBCC0\uACBD\uC740 \uBBF8\uC9C0\uC6D0");
|
|
46699
|
-
if (
|
|
46700
|
+
if (_chunkSJ5OZXELcjs.sanitizeText.call(void 0, newPlain) !== newPlain && _chunkSJ5OZXELcjs.sanitizeText.call(void 0, origPlain) === origPlain) {
|
|
46700
46701
|
return skip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uD328\uCE58 \uC2DC \uC6D0\uBB38 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0");
|
|
46701
46702
|
}
|
|
46702
46703
|
const xml = _optionalChain([ctx, 'access', _979 => _979.scans, 'access', _980 => _980[mapping.para.sectionIndex], 'optionalAccess', _981 => _981.xml]);
|
|
@@ -46713,14 +46714,14 @@ function textUnitToPlain(raw, block) {
|
|
|
46713
46714
|
}
|
|
46714
46715
|
function textUnitInline(raw, block) {
|
|
46715
46716
|
let text = raw.split("\n").map((l) => l.trim()).filter(Boolean).join(" ");
|
|
46716
|
-
if (block.type === "heading" || block.text && /^\[별표\s*\d+/.test(
|
|
46717
|
+
if (block.type === "heading" || block.text && /^\[별표\s*\d+/.test(_chunkSJ5OZXELcjs.sanitizeText.call(void 0, block.text))) {
|
|
46717
46718
|
text = text.replace(/^#{1,6}\s+/, "");
|
|
46718
46719
|
}
|
|
46719
46720
|
if (block.href) {
|
|
46720
46721
|
const linkMatch = text.match(/^\[([\s\S]*)\]\([^)]*\)$/);
|
|
46721
46722
|
if (linkMatch) text = linkMatch[1];
|
|
46722
46723
|
}
|
|
46723
|
-
if (/^\*[^*][\s\S]*\*$/.test(text) && block.text && /^\([^)]*조[^)]*관련\)$/.test(
|
|
46724
|
+
if (/^\*[^*][\s\S]*\*$/.test(text) && block.text && /^\([^)]*조[^)]*관련\)$/.test(_chunkSJ5OZXELcjs.sanitizeText.call(void 0, block.text))) {
|
|
46724
46725
|
text = text.slice(1, -1);
|
|
46725
46726
|
}
|
|
46726
46727
|
return text;
|
|
@@ -49268,7 +49269,7 @@ function blocksToChunks(blocks, options) {
|
|
|
49268
49269
|
const granularity = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1012 => _1012.granularity]), () => ( "section"));
|
|
49269
49270
|
const includeCells = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1013 => _1013.includeTableCells]), () => ( false));
|
|
49270
49271
|
const mdOptions = { tableFormat: _optionalChain([options, 'optionalAccess', _1014 => _1014.tableFormat]) };
|
|
49271
|
-
if (_optionalChain([options, 'optionalAccess', _1015 => _1015.tableFormat]) === "gfm")
|
|
49272
|
+
if (_optionalChain([options, 'optionalAccess', _1015 => _1015.tableFormat]) === "gfm") _chunkSJ5OZXELcjs.assignTableIds.call(void 0, blocks);
|
|
49272
49273
|
const chunks = [];
|
|
49273
49274
|
const headingStack = [];
|
|
49274
49275
|
const listStack = [];
|
|
@@ -49282,12 +49283,12 @@ function blocksToChunks(blocks, options) {
|
|
|
49282
49283
|
let run = null;
|
|
49283
49284
|
const flushRun = () => {
|
|
49284
49285
|
if (!run) return;
|
|
49285
|
-
push("text", run.breadcrumb,
|
|
49286
|
+
push("text", run.breadcrumb, _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, run.blocks, mdOptions), [run.start, run.end], run.page);
|
|
49286
49287
|
run = null;
|
|
49287
49288
|
};
|
|
49288
49289
|
for (let i = 0; i < blocks.length; i++) {
|
|
49289
49290
|
const block = blocks[i];
|
|
49290
|
-
const md2 =
|
|
49291
|
+
const md2 = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, [block], mdOptions);
|
|
49291
49292
|
if (!md2) continue;
|
|
49292
49293
|
if (block.type === "heading") {
|
|
49293
49294
|
flushRun();
|
|
@@ -49375,7 +49376,7 @@ function u8ToArrayBuffer2(u8) {
|
|
|
49375
49376
|
return u8.buffer.slice(u8.byteOffset, u8.byteOffset + u8.byteLength);
|
|
49376
49377
|
}
|
|
49377
49378
|
function irCellLines(text) {
|
|
49378
|
-
return stripCellTokens(
|
|
49379
|
+
return stripCellTokens(_chunkSJ5OZXELcjs.sanitizeText.call(void 0, text)).split("\n").map((s) => s.trim()).filter(Boolean);
|
|
49379
49380
|
}
|
|
49380
49381
|
var HwpxSession = (_class10 = class _HwpxSession {
|
|
49381
49382
|
|
|
@@ -49635,7 +49636,7 @@ var HwpxSession = (_class10 = class _HwpxSession {
|
|
|
49635
49636
|
if (newPlain === "") {
|
|
49636
49637
|
return skip("\uBE14\uB85D \uBE44\uC6B0\uAE30/\uC0AD\uC81C\uB294 \uBBF8\uC9C0\uC6D0 (v1) \u2014 \uC6D0\uBCF8 \uC720\uC9C0");
|
|
49637
49638
|
}
|
|
49638
|
-
if (
|
|
49639
|
+
if (_chunkSJ5OZXELcjs.sanitizeText.call(void 0, newPlain) !== newPlain) {
|
|
49639
49640
|
return skip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uD328\uCE58 \uC2DC \uC6D0\uBB38 \uBCF4\uC874 \uBD88\uAC00\uB85C \uBBF8\uC9C0\uC6D0");
|
|
49640
49641
|
}
|
|
49641
49642
|
const splices = buildParagraphSplices(mapping.para, newPlain, _optionalChain([st, 'access', _1035 => _1035.scans, 'access', _1036 => _1036[mapping.para.sectionIndex], 'optionalAccess', _1037 => _1037.xml]));
|
|
@@ -49730,7 +49731,7 @@ var md = new (0, _markdownit2.default)({
|
|
|
49730
49731
|
});
|
|
49731
49732
|
var SAFE_RAW_TAG = /^(?:<\/?(?:table|thead|tbody|tfoot|tr|th|td|u)>|<br\s*\/?>|<(?:th|td)(?: (?:colspan|rowspan)="[1-9]\d*"){1,2}>|<img src="(?:images\/(?:[^"'<>\/\s]+\/)?)?image_\d+\.(?:png|jpe?g|gif|webp|bmp)" alt="image">)$/i;
|
|
49732
49733
|
function sanitizeRawHtml(raw) {
|
|
49733
|
-
return raw.replace(/<[^>]*>|</g, (tag) => SAFE_RAW_TAG.test(tag) ? tag :
|
|
49734
|
+
return raw.replace(/<[^>]*>|</g, (tag) => SAFE_RAW_TAG.test(tag) ? tag : _chunkMI655NV5cjs.escapeHtml.call(void 0, tag));
|
|
49734
49735
|
}
|
|
49735
49736
|
md.renderer.rules.html_block = (tokens, idx) => sanitizeRawHtml(tokens[idx].content);
|
|
49736
49737
|
md.renderer.rules.html_inline = (tokens, idx) => sanitizeRawHtml(tokens[idx].content);
|
|
@@ -49738,7 +49739,7 @@ function renderHtml(markdown, options) {
|
|
|
49738
49739
|
const preset = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1041 => _1041.preset]), () => ( "default"));
|
|
49739
49740
|
const css = PRESETS[preset] + (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _1042 => _1042.extraCss]), () => ( "")));
|
|
49740
49741
|
const body = md.render(markdown);
|
|
49741
|
-
const watermark = _optionalChain([options, 'optionalAccess', _1043 => _1043.watermark]) ? `<div class="watermark">${
|
|
49742
|
+
const watermark = _optionalChain([options, 'optionalAccess', _1043 => _1043.watermark]) ? `<div class="watermark">${_chunkMI655NV5cjs.escapeHtml.call(void 0, options.watermark)}</div>` : "";
|
|
49742
49743
|
const watermarkCss = _optionalChain([options, 'optionalAccess', _1044 => _1044.watermark]) ? `
|
|
49743
49744
|
.watermark {
|
|
49744
49745
|
position: fixed;
|
|
@@ -49792,13 +49793,13 @@ async function htmlToPdf(html, options) {
|
|
|
49792
49793
|
try {
|
|
49793
49794
|
puppeteer = await Promise.resolve().then(() => _interopRequireWildcard(require("puppeteer-core")));
|
|
49794
49795
|
} catch (e42) {
|
|
49795
|
-
throw new (0,
|
|
49796
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(
|
|
49796
49797
|
"PDF \uC0DD\uC131\uC5D0 puppeteer-core\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. \uC124\uCE58: npm install puppeteer-core"
|
|
49797
49798
|
);
|
|
49798
49799
|
}
|
|
49799
49800
|
const executablePath = _nullishCoalesce(process.env.PUPPETEER_EXECUTABLE_PATH, () => ( findChromiumPath()));
|
|
49800
49801
|
if (!executablePath) {
|
|
49801
|
-
throw new (0,
|
|
49802
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(
|
|
49802
49803
|
"Chromium \uC2E4\uD589 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. PUPPETEER_EXECUTABLE_PATH \uD658\uACBD\uBCC0\uC218\uB97C \uC124\uC815\uD558\uC138\uC694."
|
|
49803
49804
|
);
|
|
49804
49805
|
}
|
|
@@ -49853,7 +49854,7 @@ async function markdownToPdf(markdown, options) {
|
|
|
49853
49854
|
return htmlToPdf(html, options);
|
|
49854
49855
|
}
|
|
49855
49856
|
async function blocksToPdf(blocks, options) {
|
|
49856
|
-
const markdown =
|
|
49857
|
+
const markdown = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, blocks);
|
|
49857
49858
|
return markdownToPdf(markdown, options);
|
|
49858
49859
|
}
|
|
49859
49860
|
|
|
@@ -49976,7 +49977,7 @@ function findFirst(el, name, depth = 0) {
|
|
|
49976
49977
|
}
|
|
49977
49978
|
var FORM_TAGS = /* @__PURE__ */ new Set(["checkBtn", "radioBtn", "btn", "comboBox", "listBox", "edit", "scrollBar"]);
|
|
49978
49979
|
var OBJ_TAGS = /* @__PURE__ */ new Set(["tbl", "pic", "container", "equation", "rect", "ellipse", "polygon", "curv", "curve", "line", "arc", "ole", "textart", ...FORM_TAGS]);
|
|
49979
|
-
var CHAR_CTRL_1SLOT = /* @__PURE__ */ new Set(["lineBreak", "hyphen", "nbSpace", "fwSpace"]);
|
|
49980
|
+
var CHAR_CTRL_1SLOT = /* @__PURE__ */ new Set(["lineBreak", "hyphen", "hypen", "nbSpace", "fwSpace"]);
|
|
49980
49981
|
var noteFmtCache = /* @__PURE__ */ new WeakMap();
|
|
49981
49982
|
function sectionNoteFormats2(p) {
|
|
49982
49983
|
const root = _optionalChain([p, 'access', _1054 => _1054.ownerDocument, 'optionalAccess', _1055 => _1055.documentElement]);
|
|
@@ -50721,6 +50722,60 @@ function nextParaNumber(counters, geom) {
|
|
|
50721
50722
|
});
|
|
50722
50723
|
}
|
|
50723
50724
|
|
|
50725
|
+
// src/render/reflow-cache.ts
|
|
50726
|
+
function cachedParagraphBottom(lsa, bodyFlow) {
|
|
50727
|
+
let bottom = Number.NEGATIVE_INFINITY, previousV = Number.NEGATIVE_INFINITY;
|
|
50728
|
+
for (let i = 0; i < lsa.childNodes.length; i++) {
|
|
50729
|
+
const seg = lsa.childNodes[i];
|
|
50730
|
+
if (seg.nodeType !== 1 || seg.localName !== "lineseg") continue;
|
|
50731
|
+
const num4 = (name, fallback = 0) => toInt32(_nullishCoalesce(seg.getAttribute(name), () => ( void 0)), fallback);
|
|
50732
|
+
const v = num4("vertpos");
|
|
50733
|
+
if (bodyFlow && v < previousV) bottom = Number.NEGATIVE_INFINITY;
|
|
50734
|
+
bottom = Math.max(bottom, v + Math.max(num4("vertsize", 1e3), num4("textheight", 1e3)) + num4("spacing"));
|
|
50735
|
+
previousV = v;
|
|
50736
|
+
}
|
|
50737
|
+
return bottom;
|
|
50738
|
+
}
|
|
50739
|
+
|
|
50740
|
+
// src/render/reflow-fragments.ts
|
|
50741
|
+
function appendNarrowLineFragments(parent, seg, free, box, flow) {
|
|
50742
|
+
if (!free || !box) return false;
|
|
50743
|
+
const parts = free.filter(([a, b]) => b - a >= 1440);
|
|
50744
|
+
if (parts.length < 2 || parts.at(-1)[0] !== box[0] || parts.at(-1)[1] - box[0] !== box[1]) return false;
|
|
50745
|
+
const { text, widths, spacings, slots, start, end } = flow;
|
|
50746
|
+
if (/[\t\n\u00a0\u2005\ufdd0\ufffc]/.test(text.slice(start, end))) return false;
|
|
50747
|
+
let ink = start;
|
|
50748
|
+
while (ink < end && (text[ink] === " " || text[ink] === "\u2060" && widths[ink] === 0)) ink++;
|
|
50749
|
+
if (text.slice(ink, end).includes("\u2060")) return false;
|
|
50750
|
+
if (ink === end || parts.slice(0, -1).some(([a, b]) => (_nullishCoalesce(widths[ink], () => ( 0))) - (_nullishCoalesce(spacings[ink], () => ( 0))) <= b - a)) return false;
|
|
50751
|
+
const fragments = [];
|
|
50752
|
+
let cursor = start;
|
|
50753
|
+
for (const [a, b] of parts.slice(0, -1)) {
|
|
50754
|
+
const offset = cursor;
|
|
50755
|
+
let w = 0;
|
|
50756
|
+
while (cursor < ink && w + widths[cursor] <= b - a) w += widths[cursor++];
|
|
50757
|
+
fragments.push({ offset, x: a, width: b - a });
|
|
50758
|
+
}
|
|
50759
|
+
let rest = 0;
|
|
50760
|
+
for (let i = cursor; i < end; i++) rest += widths[i];
|
|
50761
|
+
let last = end - 1;
|
|
50762
|
+
if (last > cursor && /[\uDC00-\uDFFF]/.test(text[last])) last--;
|
|
50763
|
+
rest -= _nullishCoalesce(spacings[last], () => ( 0));
|
|
50764
|
+
if (rest > box[1] + 0.5) return false;
|
|
50765
|
+
let next = end;
|
|
50766
|
+
while (next < text.length && text[next] === " ") next++;
|
|
50767
|
+
if (next < text.length && rest + (_nullishCoalesce(widths[next], () => ( 0))) - (_nullishCoalesce(spacings[next], () => ( 0))) <= box[1] + 0.5) return false;
|
|
50768
|
+
fragments.push({ offset: cursor, x: box[0], width: box[1] });
|
|
50769
|
+
fragments.forEach((f, i) => {
|
|
50770
|
+
const part = seg.cloneNode(false);
|
|
50771
|
+
if (i > 0) part.setAttribute("textpos", String(slots[f.offset]));
|
|
50772
|
+
part.setAttribute("horzpos", String(f.x));
|
|
50773
|
+
part.setAttribute("horzsize", String(f.width));
|
|
50774
|
+
parent.appendChild(part);
|
|
50775
|
+
});
|
|
50776
|
+
return true;
|
|
50777
|
+
}
|
|
50778
|
+
|
|
50724
50779
|
// src/render/reflow.ts
|
|
50725
50780
|
var geomMemo = (styles) => ({ cell: /* @__PURE__ */ new WeakMap(), table: /* @__PURE__ */ new WeakMap(), paraGeom: styles.paraGeom });
|
|
50726
50781
|
var LINESEG_FLAGS = "393216";
|
|
@@ -51042,10 +51097,11 @@ function reflowPara(p, doc, styles, areaW, startV, mode, zones = [], nums = /* @
|
|
|
51042
51097
|
}
|
|
51043
51098
|
const lineBox = [];
|
|
51044
51099
|
const lineParts = [];
|
|
51100
|
+
const collisionHeights = [];
|
|
51045
51101
|
const boxAt = (i) => {
|
|
51046
51102
|
if (!zones.length) return void 0;
|
|
51047
51103
|
if (i in lineBox) return lineBox[i];
|
|
51048
|
-
const y0 = textStartV + i * pitch, y1 = y0 + height;
|
|
51104
|
+
const y0 = textStartV + i * pitch, y1 = y0 + Math.max(height, _nullishCoalesce(collisionHeights[i], () => ( 0)));
|
|
51049
51105
|
let free = [[marginL, marginL + avail]], hit = false, flow = "BOTH_SIDES";
|
|
51050
51106
|
for (const z of zones) {
|
|
51051
51107
|
if (!(y1 > z.top && y0 < z.bottom)) continue;
|
|
@@ -51105,7 +51161,26 @@ function reflowPara(p, doc, styles, areaW, startV, mode, zones = [], nums = /* @
|
|
|
51105
51161
|
lineParts.length = 0;
|
|
51106
51162
|
}
|
|
51107
51163
|
}
|
|
51108
|
-
const
|
|
51164
|
+
const wrapLines = () => text.length === 0 ? { lines: 1, starts: [0], lastLineWidth: 0 } : simulateWrap(text, firstWrapWidth, contWidth, height, 100, paraMode, { widths, spacings, condensePct: condenseUse, kinsoku: "hancom", before2024: styles.before2024, lineWidth, latinBreak: geom.latinBreak, rightTabs });
|
|
51165
|
+
let wrap = wrapLines();
|
|
51166
|
+
if (zones.length) for (let pass = 0; pass < text.length; pass++) {
|
|
51167
|
+
let changed = false;
|
|
51168
|
+
for (const o of m.objs) if (o.inline) {
|
|
51169
|
+
const k = realIdx.indexOf(o.index), om = findChildByLocalName(o.el, "outMargin");
|
|
51170
|
+
if (k < 0) continue;
|
|
51171
|
+
let li = 0;
|
|
51172
|
+
for (let j = 1; j < wrap.starts.length; j++) if (wrap.starts[j] <= k) li = j;
|
|
51173
|
+
const h = num3(om, "top") + effHOf(o) + num3(om, "bottom");
|
|
51174
|
+
if (h > Math.max(height, _nullishCoalesce(collisionHeights[li], () => ( 0)))) {
|
|
51175
|
+
collisionHeights[li] = h;
|
|
51176
|
+
changed = true;
|
|
51177
|
+
}
|
|
51178
|
+
}
|
|
51179
|
+
if (!changed) break;
|
|
51180
|
+
lineBox.length = 0;
|
|
51181
|
+
lineParts.length = 0;
|
|
51182
|
+
wrap = wrapLines();
|
|
51183
|
+
}
|
|
51109
51184
|
const lineObjH = new Array(wrap.starts.length).fill(0);
|
|
51110
51185
|
const lineObjAsc = new Array(wrap.starts.length).fill(0);
|
|
51111
51186
|
const lineObjLs = new Array(wrap.starts.length).fill(false);
|
|
@@ -51119,8 +51194,9 @@ function reflowPara(p, doc, styles, areaW, startV, mode, zones = [], nums = /* @
|
|
|
51119
51194
|
const om = findChildByLocalName(o.el, "outMargin");
|
|
51120
51195
|
const li = lineOf(o.index);
|
|
51121
51196
|
const h = num3(om, "top") + effHOf(o) + num3(om, "bottom");
|
|
51197
|
+
if (o.tag === "tbl" && li > 0 && o.omL + o.width + o.omR > (_nullishCoalesce(_optionalChain([lineWidth, 'optionalCall', _1164 => _1164(li - 1)]), () => ( (li === 1 ? firstWrapWidth : contWidth)))) && /^[\u2060\ufdd0]+$/.test(text.slice(wrap.starts[li - 1], wrap.starts[li]))) collisionHeights[li - 1] = Math.max(_nullishCoalesce(collisionHeights[li - 1], () => ( 0)), h);
|
|
51122
51198
|
lineObjH[li] = Math.max(lineObjH[li], h);
|
|
51123
|
-
if (_optionalChain([findChildByLocalName, 'call',
|
|
51199
|
+
if (_optionalChain([findChildByLocalName, 'call', _1165 => _1165(o.el, "pos"), 'optionalAccess', _1166 => _1166.getAttribute, 'call', _1167 => _1167("affectLSpacing")]) === "1") lineObjLs[li] = true;
|
|
51124
51200
|
const bl = o.tag === "equation" ? Number(o.el.getAttribute("baseLine")) : NaN;
|
|
51125
51201
|
lineObjAsc[li] = Math.max(lineObjAsc[li], Math.round(h * (Number.isFinite(bl) ? bl / 100 : BASELINE_RATIO)));
|
|
51126
51202
|
}
|
|
@@ -51128,13 +51204,13 @@ function reflowPara(p, doc, styles, areaW, startV, mode, zones = [], nums = /* @
|
|
|
51128
51204
|
let v = textStartV;
|
|
51129
51205
|
let firstAcc = 0;
|
|
51130
51206
|
const textposOf = wrap.starts.map((startReal, li) => li === 0 ? 0 : startReal < realIdx.length ? realIdx[startReal] : realIdx.length ? m.chars.length : 0);
|
|
51131
|
-
const heightOf = (prId) => (prId != null ? _optionalChain([styles, 'access',
|
|
51207
|
+
const heightOf = (prId) => (prId != null ? _optionalChain([styles, 'access', _1168 => _1168.charPr, 'access', _1169 => _1169.get, 'call', _1170 => _1170(prId), 'optionalAccess', _1171 => _1171.height]) : void 0) || 0;
|
|
51132
51208
|
const lineTextH = (li) => {
|
|
51133
51209
|
const s = textposOf[li], last = li === wrap.starts.length - 1, e = last ? m.chars.length : textposOf[li + 1];
|
|
51134
51210
|
let h = 0;
|
|
51135
51211
|
for (let k = s; k < e; k++) h = Math.max(h, heightOf(m.chars[k].prId));
|
|
51136
51212
|
for (const r of m.runs) if (r.at >= s && (last ? r.at <= e : r.at < e)) h = Math.max(h, heightOf(r.prId));
|
|
51137
|
-
if (li === 0 && _optionalChain([bu, 'optionalAccess',
|
|
51213
|
+
if (li === 0 && _optionalChain([bu, 'optionalAccess', _1172 => _1172.charPrId]) != null) h = Math.max(h, heightOf(bu.charPrId));
|
|
51138
51214
|
return h || height;
|
|
51139
51215
|
};
|
|
51140
51216
|
const fontLineOf = (li) => {
|
|
@@ -51161,7 +51237,7 @@ function reflowPara(p, doc, styles, areaW, startV, mode, zones = [], nums = /* @
|
|
|
51161
51237
|
const c = m.chars[k];
|
|
51162
51238
|
if (!c.ch) continue;
|
|
51163
51239
|
const st = c.prId != null ? styles.charPr.get(c.prId) : void 0;
|
|
51164
|
-
const f = _optionalChain([st, 'optionalAccess',
|
|
51240
|
+
const f = _optionalChain([st, 'optionalAccess', _1173 => _1173.borderFill]) != null ? styles.borderFill.get(st.borderFill) : void 0;
|
|
51165
51241
|
if (!f || !f.top && !f.bottom) continue;
|
|
51166
51242
|
const t = f.top ? Math.trunc(f.top.widthPt * 100) : 0, b = f.bottom ? Math.trunc(f.bottom.widthPt * 100) : 0;
|
|
51167
51243
|
top = Math.max(top, st.height + t);
|
|
@@ -51196,24 +51272,32 @@ function reflowPara(p, doc, styles, areaW, startV, mode, zones = [], nums = /* @
|
|
|
51196
51272
|
}
|
|
51197
51273
|
}
|
|
51198
51274
|
const vertpos = v;
|
|
51275
|
+
const occupiedH = Math.max(lineH, _nullishCoalesce(collisionHeights[li], () => ( 0)));
|
|
51199
51276
|
v += lineH + spacing;
|
|
51200
51277
|
const isFirst = li === 0;
|
|
51201
51278
|
const seg = doc.createElement("hp:lineseg");
|
|
51202
51279
|
seg.setAttribute("textpos", String(textpos));
|
|
51203
51280
|
seg.setAttribute("vertpos", String(vertpos));
|
|
51204
|
-
seg.setAttribute("vertsize", String(
|
|
51281
|
+
seg.setAttribute("vertsize", String(occupiedH === textH && boxAll > textH0 ? Math.max(textH0, boxTop) : occupiedH));
|
|
51205
51282
|
seg.setAttribute("textheight", String(lineH));
|
|
51206
51283
|
seg.setAttribute("baseline", String(geom.vertAlign === "TOP" ? 0 : geom.vertAlign === "CENTER" ? Math.floor(lineH / 2) : geom.vertAlign === "BOTTOM" ? lineH : Math.max(fl ? fl[1] : Math.round(textH0 * BASELINE_RATIO), lineObjAsc[li])));
|
|
51207
51284
|
seg.setAttribute("spacing", String(spacing));
|
|
51208
51285
|
let box = boxAt(li);
|
|
51209
|
-
const fit = wrap.starts.length === 1 && lineObjH[li] === 0 ? _optionalChain([lineParts, 'access',
|
|
51286
|
+
const fit = wrap.starts.length === 1 && lineObjH[li] === 0 ? _optionalChain([lineParts, 'access', _1174 => _1174[li], 'optionalAccess', _1175 => _1175.filter, 'call', _1176 => _1176(([a, b]) => b - a >= 1440)]) : void 0;
|
|
51210
51287
|
const parts = fit && fit.length > 1 && natW <= fit[0][1] - fit[0][0] - Math.max(0, geom.marginIntent) ? fit : void 0;
|
|
51211
51288
|
if (parts) box = [parts[0][0], parts[0][1] - parts[0][0]];
|
|
51212
51289
|
seg.setAttribute("horzpos", String(box ? box[0] : isFirst ? marginL : contHorz));
|
|
51213
51290
|
seg.setAttribute("horzsize", String(box ? box[1] : isFirst ? firstWidth : contSegWidth));
|
|
51214
51291
|
seg.setAttribute("flags", LINESEG_FLAGS);
|
|
51292
|
+
if (paraMode === "charAll" && !inlineAt.size && !geom.marginIntent && !bulletW && !condenseUse && appendNarrowLineFragments(
|
|
51293
|
+
lsa,
|
|
51294
|
+
seg,
|
|
51295
|
+
lineParts[li],
|
|
51296
|
+
box,
|
|
51297
|
+
{ text, widths, spacings, slots: realIdx, start: wrap.starts[li], end: _nullishCoalesce(wrap.starts[li + 1], () => ( text.length)) }
|
|
51298
|
+
)) continue;
|
|
51215
51299
|
lsa.appendChild(seg);
|
|
51216
|
-
for (const [a, b] of _nullishCoalesce(_optionalChain([parts, 'optionalAccess',
|
|
51300
|
+
for (const [a, b] of _nullishCoalesce(_optionalChain([parts, 'optionalAccess', _1177 => _1177.slice, 'call', _1178 => _1178(1)]), () => ( []))) {
|
|
51217
51301
|
const more = seg.cloneNode(false);
|
|
51218
51302
|
more.setAttribute("textpos", String(m.chars.length + 1));
|
|
51219
51303
|
more.setAttribute("horzpos", String(a));
|
|
@@ -51232,9 +51316,9 @@ function paperOrigin(p) {
|
|
|
51232
51316
|
const d = p.ownerDocument;
|
|
51233
51317
|
const hit = originMemo.get(d);
|
|
51234
51318
|
if (hit) return hit;
|
|
51235
|
-
const pagePr = _nullishCoalesce(_optionalChain([p, 'access',
|
|
51319
|
+
const pagePr = _nullishCoalesce(_optionalChain([p, 'access', _1179 => _1179.ownerDocument, 'optionalAccess', _1180 => _1180.getElementsByTagName, 'call', _1181 => _1181("hp:pagePr"), 'access', _1182 => _1182[0]]), () => ( null));
|
|
51236
51320
|
const mg = pagePr ? findChildByLocalName(pagePr, "margin") : null;
|
|
51237
|
-
const tb = _optionalChain([pagePr, 'optionalAccess',
|
|
51321
|
+
const tb = _optionalChain([pagePr, 'optionalAccess', _1183 => _1183.getAttribute, 'call', _1184 => _1184("gutterType")]) === "TOP_BOTTOM", gut = num3(mg, "gutter");
|
|
51238
51322
|
const o = [num3(mg, "left", 8504) + (tb ? 0 : gut), num3(mg, "top", 5668) + num3(mg, "header") + (tb ? gut : 0), num3(pagePr, "width", 59528)];
|
|
51239
51323
|
originMemo.set(d, o);
|
|
51240
51324
|
return o;
|
|
@@ -51251,7 +51335,7 @@ function pageTopBand(p) {
|
|
|
51251
51335
|
for (const o of elements2(run)) {
|
|
51252
51336
|
if (!OBJ_TAGS.has(ln2(o)) || o.getAttribute("textWrap") !== "TOP_AND_BOTTOM") continue;
|
|
51253
51337
|
const pos = findChildByLocalName(o, "pos");
|
|
51254
|
-
if (_optionalChain([pos, 'optionalAccess',
|
|
51338
|
+
if (_optionalChain([pos, 'optionalAccess', _1185 => _1185.getAttribute, 'call', _1186 => _1186("treatAsChar")]) === "1" || _optionalChain([pos, 'optionalAccess', _1187 => _1187.getAttribute, 'call', _1188 => _1188("vertRelTo")]) !== "PAGE" || (_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _1189 => _1189.getAttribute, 'call', _1190 => _1190("vertAlign")]), () => ( "TOP"))) !== "TOP") continue;
|
|
51255
51339
|
const om = findChildByLocalName(o, "outMargin"), sz = findChildByLocalName(o, "sz");
|
|
51256
51340
|
const h = ln2(o) === "tbl" ? Math.max(num3(sz, "height"), measureTableHeight(o)) : num3(sz, "height");
|
|
51257
51341
|
const vo = Math.max(0, num3(pos, "vertOffset"));
|
|
@@ -51307,7 +51391,7 @@ function footNoteHeights(p, ownOnly = false) {
|
|
|
51307
51391
|
let a = fn.parentNode, inSplit = false;
|
|
51308
51392
|
while (a && a !== p) {
|
|
51309
51393
|
const e = a;
|
|
51310
|
-
if (ln2(e) === "tbl" && (e.getAttribute("pageBreak") === "CELL" || e.getAttribute("pageBreak") === "TABLE") && _optionalChain([findChildByLocalName, 'call',
|
|
51394
|
+
if (ln2(e) === "tbl" && (e.getAttribute("pageBreak") === "CELL" || e.getAttribute("pageBreak") === "TABLE") && _optionalChain([findChildByLocalName, 'call', _1191 => _1191(e, "pos"), 'optionalAccess', _1192 => _1192.getAttribute, 'call', _1193 => _1193("treatAsChar")]) !== "1") inSplit = true;
|
|
51311
51395
|
a = a.parentNode;
|
|
51312
51396
|
}
|
|
51313
51397
|
if (inSplit) continue;
|
|
@@ -51336,7 +51420,7 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
|
|
|
51336
51420
|
let prevPlaced;
|
|
51337
51421
|
const bodyFlow = areaW === counter.bodyW && bodyH > 0;
|
|
51338
51422
|
const vis = bodyH > 0 ? findFirst(container, "visibility") : null;
|
|
51339
|
-
const hideFirstEmpty = _optionalChain([vis, 'optionalAccess',
|
|
51423
|
+
const hideFirstEmpty = _optionalChain([vis, 'optionalAccess', _1194 => _1194.getAttribute, 'call', _1195 => _1195("hideFirstEmptyLine")]) === "1";
|
|
51340
51424
|
let hidPrev = 0;
|
|
51341
51425
|
const cellW = areaW;
|
|
51342
51426
|
let cellCols = 1, cellCol = 0;
|
|
@@ -51361,7 +51445,7 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
|
|
|
51361
51445
|
reflowSubListsIn(p, doc, styles, mode, counter, reflowBlockFlow, bodyFlow ? areaW : void 0);
|
|
51362
51446
|
const g3 = styles.paraGeom.get(_nullishCoalesce(p.getAttribute("paraPrIDRef"), () => ( "")));
|
|
51363
51447
|
const cursorBefore = cursorV;
|
|
51364
|
-
let startV = Math.max(cursorV + prevSpaceAfter + (_nullishCoalesce(_optionalChain([g3, 'optionalAccess',
|
|
51448
|
+
let startV = Math.max(cursorV + prevSpaceAfter + (_nullishCoalesce(_optionalChain([g3, 'optionalAccess', _1196 => _1196.spaceBefore]), () => ( 0))), floatFloor);
|
|
51365
51449
|
floatFloor = 0;
|
|
51366
51450
|
if (bodyH > 0) {
|
|
51367
51451
|
const [top, bot] = pageTopBand(p);
|
|
@@ -51384,21 +51468,16 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
|
|
|
51384
51468
|
if (!res) {
|
|
51385
51469
|
const lsa = findChildByLocalName(p, "linesegarray");
|
|
51386
51470
|
if (lsa) {
|
|
51387
|
-
|
|
51388
|
-
for (const seg of elements2(lsa)) {
|
|
51389
|
-
if (ln2(seg) !== "lineseg") continue;
|
|
51390
|
-
const th = Math.max(num3(seg, "vertsize", 1e3), num3(seg, "textheight", 1e3));
|
|
51391
|
-
bottom = Math.max(bottom, num3(seg, "vertpos") + th + num3(seg, "spacing"));
|
|
51392
|
-
}
|
|
51471
|
+
const bottom = cachedParagraphBottom(lsa, bodyFlow);
|
|
51393
51472
|
if (Number.isFinite(bottom)) {
|
|
51394
51473
|
cursorV = bottom;
|
|
51395
|
-
prevSpaceAfter = _nullishCoalesce(_optionalChain([g3, 'optionalAccess',
|
|
51474
|
+
prevSpaceAfter = _nullishCoalesce(_optionalChain([g3, 'optionalAccess', _1197 => _1197.spaceAfter]), () => ( 0));
|
|
51396
51475
|
}
|
|
51397
51476
|
}
|
|
51398
51477
|
continue;
|
|
51399
51478
|
}
|
|
51400
51479
|
const paraH = res.paraBottom - startV;
|
|
51401
|
-
const explicitBreak = bodyH > 0 && startV > 0 && (p.getAttribute("pageBreak") === "1" || p.getAttribute("columnBreak") === "1" || !!_optionalChain([g3, 'optionalAccess',
|
|
51480
|
+
const explicitBreak = bodyH > 0 && startV > 0 && (p.getAttribute("pageBreak") === "1" || p.getAttribute("columnBreak") === "1" || !!_optionalChain([g3, 'optionalAccess', _1198 => _1198.pageBreakBefore]));
|
|
51402
51481
|
const lines = bodyH > 0 ? elements2(_nullishCoalesce(findChildByLocalName(p, "linesegarray"), () => ( p))).filter((e) => ln2(e) === "lineseg") : [];
|
|
51403
51482
|
const reserve = bodyH > 0 ? pageBottomReserve(p) : 0;
|
|
51404
51483
|
const fns = bodyH > 0 ? footNoteHeights(p) : [];
|
|
@@ -51433,9 +51512,9 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
|
|
|
51433
51512
|
let cut = -1;
|
|
51434
51513
|
if (!explicitBreak && !firstOver && lines.length > 1) {
|
|
51435
51514
|
cut = lines.findIndex((seg, i) => i > 0 && lineBottom(seg) > limAt(i) && num3(seg, "vertsize") <= bodyH);
|
|
51436
|
-
if (cut > 0 && _optionalChain([g3, 'optionalAccess',
|
|
51515
|
+
if (cut > 0 && _optionalChain([g3, 'optionalAccess', _1199 => _1199.widowOrphan]) && lines.length >= 3 && cut === lines.length - 1) cut--;
|
|
51437
51516
|
}
|
|
51438
|
-
const orphan = cut === 1 && !!_optionalChain([g3, 'optionalAccess',
|
|
51517
|
+
const orphan = cut === 1 && !!_optionalChain([g3, 'optionalAccess', _1200 => _1200.widowOrphan]) || cut > 0 && !!_optionalChain([g3, 'optionalAccess', _1201 => _1201.keepLines]);
|
|
51439
51518
|
if (cut > 0 && !orphan) {
|
|
51440
51519
|
for (let i = cut; i < lines.length; i++) {
|
|
51441
51520
|
const seg = lines[i];
|
|
@@ -51455,7 +51534,7 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
|
|
|
51455
51534
|
const lsa = findChildByLocalName(p, "linesegarray");
|
|
51456
51535
|
if (lsa) p.removeChild(lsa);
|
|
51457
51536
|
const zb = zones.length;
|
|
51458
|
-
const sb0 = _nullishCoalesce(_optionalChain([g3, 'optionalAccess',
|
|
51537
|
+
const sb0 = _nullishCoalesce(_optionalChain([g3, 'optionalAccess', _1202 => _1202.spaceBefore]), () => ( 0));
|
|
51459
51538
|
let moveRes = reflowPara(p, doc, styles, areaW, sb0, mode, zones, new Map([...numsBefore].map(([k, v]) => [k, v.slice()])), true, bodyH);
|
|
51460
51539
|
const lsaM = findChildByLocalName(p, "linesegarray"), sM = lsaM ? elements2(lsaM).find((e) => ln2(e) === "lineseg") : void 0;
|
|
51461
51540
|
const vM = sM ? num3(sM, "vertpos") : sb0;
|
|
@@ -51475,7 +51554,7 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
|
|
|
51475
51554
|
}
|
|
51476
51555
|
}
|
|
51477
51556
|
} else {
|
|
51478
|
-
const top = _nullishCoalesce(_optionalChain([g3, 'optionalAccess',
|
|
51557
|
+
const top = _nullishCoalesce(_optionalChain([g3, 'optionalAccess', _1203 => _1203.spaceBefore]), () => ( 0));
|
|
51479
51558
|
shiftParaVert(p, top - startV);
|
|
51480
51559
|
cursorV = paraH + top;
|
|
51481
51560
|
if (bodyH > 0 && (top + paraH > bodyH || squareTableOver(p, top, bodyH))) {
|
|
@@ -51487,7 +51566,7 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
|
|
|
51487
51566
|
splitPage = true;
|
|
51488
51567
|
}
|
|
51489
51568
|
}
|
|
51490
|
-
if (_optionalChain([prevPlaced, 'optionalAccess',
|
|
51569
|
+
if (_optionalChain([prevPlaced, 'optionalAccess', _1204 => _1204.keepWithNext]) && prevPlaced.startV > prevPlaced.top) {
|
|
51491
51570
|
shiftParaVert(prevPlaced.p, prevPlaced.top - prevPlaced.startV);
|
|
51492
51571
|
const base = prevPlaced.top + prevPlaced.h + prevPlaced.spaceAfter;
|
|
51493
51572
|
shiftParaVert(p, base);
|
|
@@ -51502,7 +51581,7 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
|
|
|
51502
51581
|
const tVo = tEl ? num3(findChildByLocalName(tEl, "pos"), "vertOffset") : 0;
|
|
51503
51582
|
const tOm = tEl ? findChildByLocalName(tEl, "outMargin") : null;
|
|
51504
51583
|
if (tEl && tVo > 0 && tVo < 2 ** 31 && num3(tOm, "top") + measureTableHeight(tEl) + num3(tOm, "bottom") <= bodyH) {
|
|
51505
|
-
const tTop = startV - (_nullishCoalesce(_optionalChain([g3, 'optionalAccess',
|
|
51584
|
+
const tTop = startV - (_nullishCoalesce(_optionalChain([g3, 'optionalAccess', _1205 => _1205.spaceBefore]), () => ( 0))) + tVo;
|
|
51506
51585
|
zones.push({ top: tTop, bottom: Math.max(bodyH + 1, tTop + 1), left: -1e9, right: 1e9, flow: "BOTH_SIDES", carry: split });
|
|
51507
51586
|
floatFloor = 0;
|
|
51508
51587
|
cursorV = res.textBottom;
|
|
@@ -51529,9 +51608,9 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
|
|
|
51529
51608
|
zones.length = 0;
|
|
51530
51609
|
splitPage = true;
|
|
51531
51610
|
}
|
|
51532
|
-
} else if (bodyH > 0 && off === 0 && bandTableOver(p, startV - (_nullishCoalesce(_optionalChain([g3, 'optionalAccess',
|
|
51611
|
+
} else if (bodyH > 0 && off === 0 && bandTableOver(p, startV - (_nullishCoalesce(_optionalChain([g3, 'optionalAccess', _1206 => _1206.spaceBefore]), () => ( 0))), lim)) {
|
|
51533
51612
|
const BU = BUH;
|
|
51534
|
-
const split4 = splitFloatTableRemainder(p, startV - (_nullishCoalesce(_optionalChain([g3, 'optionalAccess',
|
|
51613
|
+
const split4 = splitFloatTableRemainder(p, startV - (_nullishCoalesce(_optionalChain([g3, 'optionalAccess', _1207 => _1207.spaceBefore]), () => ( 0))), BU ? limOwn : lim, bodyH, styles, true, BU ? { n0: pageNotes + fnsOwn.length, s0: pageFoot + ownSum, area: footArea } : void 0);
|
|
51535
51614
|
if (split4 !== void 0) {
|
|
51536
51615
|
cursorV = 0;
|
|
51537
51616
|
floatFloor = split4;
|
|
@@ -51549,7 +51628,7 @@ function reflowBlockFlow(container, doc, styles, areaW, mode, counter, bodyH) {
|
|
|
51549
51628
|
}
|
|
51550
51629
|
const keepCursor = hidden && !explicitBreak;
|
|
51551
51630
|
hidPrev = hidden ? hidPrev + 1 : 0;
|
|
51552
|
-
prevPlaced = off === 0 && !(explicitBreak || firstOver || orphan) ? { p, startV, top: _nullishCoalesce(_optionalChain([g3, 'optionalAccess',
|
|
51631
|
+
prevPlaced = off === 0 && !(explicitBreak || firstOver || orphan) ? { p, startV, top: _nullishCoalesce(_optionalChain([g3, 'optionalAccess', _1208 => _1208.spaceBefore]), () => ( 0)), h: paraH, spaceAfter: res.spaceAfter, keepWithNext: !!_optionalChain([g3, 'optionalAccess', _1209 => _1209.keepWithNext]) } : void 0;
|
|
51553
51632
|
const moved = explicitBreak || firstOver || orphan || off !== 0;
|
|
51554
51633
|
pageLimit = reserve > 0 ? bodyH - reserve : moved ? bodyH : Math.min(pageLimit, reserve > 0 ? bodyH - reserve : pageLimit);
|
|
51555
51634
|
if (moved && refs.length && cut > 0 && !orphan && !explicitBreak && !firstOver) {
|
|
@@ -51649,7 +51728,7 @@ function flowEndNotes(root, bodyH) {
|
|
|
51649
51728
|
if (done.has(f) || raw0 < f.bottom) continue;
|
|
51650
51729
|
done.add(f);
|
|
51651
51730
|
if (!(base + f.lineBottom - shift <= bodyH && base + f.bottom - shift > bodyH)) continue;
|
|
51652
|
-
if (_optionalChain([f, 'access',
|
|
51731
|
+
if (_optionalChain([f, 'access', _1210 => _1210.rows, 'optionalAccess', _1211 => _1211.length]) && _optionalChain([f, 'access', _1212 => _1212.el, 'optionalAccess', _1213 => _1213.getAttribute, 'call', _1214 => _1214("pageBreak")]) === "CELL") {
|
|
51653
51732
|
let yy = base + f.bottom - f.carry - shift + f.outT, k = 0;
|
|
51654
51733
|
while (k < f.rows.length && yy + f.rows[k] <= bodyH) yy += f.rows[k++];
|
|
51655
51734
|
if (k === f.rows.length) continue;
|
|
@@ -51915,7 +51994,7 @@ function pageStories(root, masters, paraPages, pageCount, pageBase, geom) {
|
|
|
51915
51994
|
const declarations = [];
|
|
51916
51995
|
const hidden = /* @__PURE__ */ new Map();
|
|
51917
51996
|
for (const p of elements(root)) if (ln(p) === "p") {
|
|
51918
|
-
const page = _nullishCoalesce(_optionalChain([paraPages, 'access',
|
|
51997
|
+
const page = _nullishCoalesce(_optionalChain([paraPages, 'access', _1215 => _1215.get, 'call', _1216 => _1216(p), 'optionalAccess', _1217 => _1217[0]]), () => ( 0));
|
|
51919
51998
|
for (const run of elements(p)) if (ln(run) === "run") {
|
|
51920
51999
|
for (const ctrl of elements(run)) if (ln(ctrl) === "ctrl") {
|
|
51921
52000
|
for (const el of elements(ctrl)) {
|
|
@@ -51935,7 +52014,7 @@ function pageStories(root, masters, paraPages, pageCount, pageBase, geom) {
|
|
|
51935
52014
|
const out = [];
|
|
51936
52015
|
for (let page = 0; page < pageCount; page++) {
|
|
51937
52016
|
const n = pageBase + page + 1;
|
|
51938
|
-
const hides = (name) => _optionalChain([hidden, 'access',
|
|
52017
|
+
const hides = (name) => _optionalChain([hidden, 'access', _1218 => _1218.get, 'call', _1219 => _1219(page), 'optionalAccess', _1220 => _1220.has, 'call', _1221 => _1221(name)]) === true || page === 0 && num2(visibility, `hideFirst${name}`) !== 0;
|
|
51939
52018
|
if (!hides("MasterPage")) {
|
|
51940
52019
|
const matching = masters.filter((m) => m.getAttribute("type") === (n % 2 ? "ODD" : "EVEN"));
|
|
51941
52020
|
const both = masters.filter((m) => (m.getAttribute("type") || "BOTH") === "BOTH");
|
|
@@ -51964,7 +52043,7 @@ function footNoteStories(root, paraPages, geom) {
|
|
|
51964
52043
|
const above = num2(sp, "aboveLine", 850), below = num2(sp, "belowLine", 567), between = num2(sp, "betweenNotes", 283);
|
|
51965
52044
|
const byPage = /* @__PURE__ */ new Map();
|
|
51966
52045
|
for (const p of elements(root)) if (ln(p) === "p") {
|
|
51967
|
-
const page = _nullishCoalesce(_optionalChain([paraPages, 'access',
|
|
52046
|
+
const page = _nullishCoalesce(_optionalChain([paraPages, 'access', _1222 => _1222.get, 'call', _1223 => _1223(p), 'optionalAccess', _1224 => _1224[0]]), () => ( 0));
|
|
51968
52047
|
for (const run of elements(p)) if (ln(run) === "run") {
|
|
51969
52048
|
for (const ctrl of elements(run)) if (ln(ctrl) === "ctrl") {
|
|
51970
52049
|
const fn = findChildByLocalName(ctrl, "footNote");
|
|
@@ -51982,12 +52061,12 @@ function footNoteStories(root, paraPages, geom) {
|
|
|
51982
52061
|
}
|
|
51983
52062
|
}
|
|
51984
52063
|
const stories = [], rules = [];
|
|
51985
|
-
const lenAttr = num2(line, "length", -1), widthMm = Number.parseFloat(_nullishCoalesce(_optionalChain([line, 'optionalAccess',
|
|
51986
|
-
const lineType = _nullishCoalesce(_optionalChain([line, 'optionalAccess',
|
|
52064
|
+
const lenAttr = num2(line, "length", -1), widthMm = Number.parseFloat(_nullishCoalesce(_optionalChain([line, 'optionalAccess', _1225 => _1225.getAttribute, 'call', _1226 => _1226("width")]), () => ( "0.12"))) || 0.12;
|
|
52065
|
+
const lineType = _nullishCoalesce(_optionalChain([line, 'optionalAccess', _1227 => _1227.getAttribute, 'call', _1228 => _1228("type")]), () => ( "SOLID"));
|
|
51987
52066
|
for (const [page, notes] of byPage) {
|
|
51988
52067
|
const area = above + below + notes.reduce((a, n) => a + n.h, 0) + between * (notes.length - 1);
|
|
51989
52068
|
const top = geom.MT + geom.BODY_H - area;
|
|
51990
|
-
if (lineType !== "NONE") rules.push({ page, x: geom.ML, y: top + above, length: lenAttr > 0 ? lenAttr : 14173, widthMm, color: _nullishCoalesce(_optionalChain([line, 'optionalAccess',
|
|
52069
|
+
if (lineType !== "NONE") rules.push({ page, x: geom.ML, y: top + above, length: lenAttr > 0 ? lenAttr : 14173, widthMm, color: _nullishCoalesce(_optionalChain([line, 'optionalAccess', _1229 => _1229.getAttribute, 'call', _1230 => _1230("color")]), () => ( "#000000")) });
|
|
51991
52070
|
let y = top + above + below;
|
|
51992
52071
|
for (const n of notes) {
|
|
51993
52072
|
stories.push({ sub: n.sub, page, x: geom.ML, y, width: geom.BODY_W });
|
|
@@ -52023,8 +52102,8 @@ function endNoteLayout(root, paraPages, geom) {
|
|
|
52023
52102
|
let col = nCol > 1 ? Math.min(nCol - 1, Math.max(0, Math.round(num2(last.seg, "horzpos") / (colW + gap)))) : 0;
|
|
52024
52103
|
let y = num2(last.seg, "vertpos") + num2(last.seg, "vertsize") + above;
|
|
52025
52104
|
const rules = [];
|
|
52026
|
-
const lenAttr = num2(line, "length", -1), widthMm = Number.parseFloat(_nullishCoalesce(_optionalChain([line, 'optionalAccess',
|
|
52027
|
-
if ((_nullishCoalesce(_optionalChain([line, 'optionalAccess',
|
|
52105
|
+
const lenAttr = num2(line, "length", -1), widthMm = Number.parseFloat(_nullishCoalesce(_optionalChain([line, 'optionalAccess', _1231 => _1231.getAttribute, 'call', _1232 => _1232("width")]), () => ( "0.12"))) || 0.12;
|
|
52106
|
+
if ((_nullishCoalesce(_optionalChain([line, 'optionalAccess', _1233 => _1233.getAttribute, 'call', _1234 => _1234("type")]), () => ( "SOLID"))) !== "NONE") rules.push({ page, x: geom.ML + col * (colW + gap), y: geom.MT + y, length: lenAttr > 0 ? lenAttr : 14173, widthMm, color: _nullishCoalesce(_optionalChain([line, 'optionalAccess', _1235 => _1235.getAttribute, 'call', _1236 => _1236("color")]), () => ( "#000000")) });
|
|
52028
52107
|
y += below;
|
|
52029
52108
|
const next = () => {
|
|
52030
52109
|
if (++col >= nCol) {
|
|
@@ -52118,7 +52197,7 @@ function planTableRows(tbl2, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan,
|
|
|
52118
52197
|
return st.length >= 2 && st.reduce((a, f) => a + f.h, 0) > h;
|
|
52119
52198
|
});
|
|
52120
52199
|
if (BODY_H <= 0 || ty + rowY[nRows] <= pageBottom + slack && !stackOver) return plain4();
|
|
52121
|
-
if (_optionalChain([findChildByLocalName, 'call',
|
|
52200
|
+
if (_optionalChain([findChildByLocalName, 'call', _1237 => _1237(tbl2, "pos"), 'optionalAccess', _1238 => _1238.getAttribute, 'call', _1239 => _1239("treatAsChar")]) === "1") {
|
|
52122
52201
|
const declared = num2(findChildByLocalName(tbl2, "sz"), "height") || rowY[nRows];
|
|
52123
52202
|
if (ty - MT < 2e3 || ty + declared <= pageBottom + slack) return plain4();
|
|
52124
52203
|
return rowH.map((h, r) => [{ page: 1, y: MT + rowY[r], h }]);
|
|
@@ -52174,7 +52253,7 @@ function planTableRows(tbl2, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan,
|
|
|
52174
52253
|
const b = (_nullishCoalesce(boxes.get(c.el), () => ( []))).find((x) => x.part === k);
|
|
52175
52254
|
if (!b) continue;
|
|
52176
52255
|
const f = floatSpan(b.seg, y + c.marginT);
|
|
52177
|
-
if (_optionalChain([f, 'optionalAccess',
|
|
52256
|
+
if (_optionalChain([f, 'optionalAccess', _1240 => _1240.el]) && f.pages > 0 && f.pages > lead && Math.abs(contTop + c.marginT + b.top - b.origin - f.endY) < 3e3) {
|
|
52178
52257
|
lead = f.pages;
|
|
52179
52258
|
place = /* @__PURE__ */ new Map([[f.el, y + c.marginT]]);
|
|
52180
52259
|
led.add(b.seg);
|
|
@@ -52191,8 +52270,8 @@ function planTableRows(tbl2, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan,
|
|
|
52191
52270
|
for (const c of rowCells) {
|
|
52192
52271
|
const bs = _nullishCoalesce(boxes.get(c.el), () => ( []));
|
|
52193
52272
|
const inK = bs.filter((b) => b.part === k), next = bs.find((b) => b.part > k);
|
|
52194
|
-
const from = _nullishCoalesce(_nullishCoalesce(_optionalChain([inK, 'access',
|
|
52195
|
-
range.set(c.el, [from, _nullishCoalesce(_optionalChain([next, 'optionalAccess',
|
|
52273
|
+
const from = _nullishCoalesce(_nullishCoalesce(_optionalChain([inK, 'access', _1241 => _1241[0], 'optionalAccess', _1242 => _1242.origin]), () => ( _optionalChain([next, 'optionalAccess', _1243 => _1243.origin]))), () => ( Number.POSITIVE_INFINITY));
|
|
52274
|
+
range.set(c.el, [from, _nullishCoalesce(_optionalChain([next, 'optionalAccess', _1244 => _1244.top]), () => ( Number.POSITIVE_INFINITY))]);
|
|
52196
52275
|
if (inK.length) ext = Math.max(ext, inK[inK.length - 1].bottom - from + c.marginT + c.marginB);
|
|
52197
52276
|
if (inK.length && next) toNext = Math.max(toNext, next.top - from + c.marginT + c.marginB);
|
|
52198
52277
|
}
|
|
@@ -52203,7 +52282,7 @@ function planTableRows(tbl2, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan,
|
|
|
52203
52282
|
if (!last) {
|
|
52204
52283
|
let span2 = 0, spanEnd = 0;
|
|
52205
52284
|
if (floatSpan) for (const c of rowCells) {
|
|
52206
|
-
const bs = (_nullishCoalesce(boxes.get(c.el), () => ( []))).filter((b) => b.part === k), from = _nullishCoalesce(_optionalChain([bs, 'access',
|
|
52285
|
+
const bs = (_nullishCoalesce(boxes.get(c.el), () => ( []))).filter((b) => b.part === k), from = _nullishCoalesce(_optionalChain([bs, 'access', _1245 => _1245[0], 'optionalAccess', _1246 => _1246.origin]), () => ( 0));
|
|
52207
52286
|
for (const b of bs) {
|
|
52208
52287
|
if (led.has(b.seg)) continue;
|
|
52209
52288
|
const f = floatSpan(b.seg, y + c.marginT + b.top - from);
|
|
@@ -52368,7 +52447,7 @@ function objectGeometry(el, x, y, w, h, boxW = w, boxH = h) {
|
|
|
52368
52447
|
function shapeFill(el, defs, images, warn) {
|
|
52369
52448
|
const brush = findChildByLocalName(el, "fillBrush");
|
|
52370
52449
|
const win = brush && findChildByLocalName(brush, "winBrush");
|
|
52371
|
-
const face = _optionalChain([win, 'optionalAccess',
|
|
52450
|
+
const face = _optionalChain([win, 'optionalAccess', _1247 => _1247.getAttribute, 'call', _1248 => _1248("faceColor")]);
|
|
52372
52451
|
if (docColor(face)) return esc(face);
|
|
52373
52452
|
const grad = brush && findChildByLocalName(brush, "gradation");
|
|
52374
52453
|
if (grad) {
|
|
@@ -52419,8 +52498,8 @@ function shapeGeometry(o, boxX, boxY, defs, images, warn, local = false) {
|
|
|
52419
52498
|
const geometry = local ? { x: boxX, y: boxY, w, h, bbox: { x: boxX, y: boxY, w, h }, transform: "" } : objectGeometry(el, boxX, boxY, w, h, o.width || w, o.height || h);
|
|
52420
52499
|
const { x, y } = geometry;
|
|
52421
52500
|
const sx = ow > 0 ? w / ow : 1, sy = oh > 0 ? h / oh : 1;
|
|
52422
|
-
const line = findChildByLocalName(el, "lineShape"), style = _nullishCoalesce(_optionalChain([line, 'optionalAccess',
|
|
52423
|
-
const color = esc(docColor(_optionalChain([line, 'optionalAccess',
|
|
52501
|
+
const line = findChildByLocalName(el, "lineShape"), style = _nullishCoalesce(_optionalChain([line, 'optionalAccess', _1249 => _1249.getAttribute, 'call', _1250 => _1250("style")]), () => ( "SOLID"));
|
|
52502
|
+
const color = esc(docColor(_optionalChain([line, 'optionalAccess', _1251 => _1251.getAttribute, 'call', _1252 => _1252("color")]), "#000000"));
|
|
52424
52503
|
const strokeW = style === "NONE" ? 0 : Math.max(0.2, num2(line, "width", 33) / 100 * 2.834645);
|
|
52425
52504
|
const dash = /DASH|DOT/.test(style) ? ` stroke-dasharray="${style.includes("DOT") ? "1,1.5" : "3,1.5"}"` : "";
|
|
52426
52505
|
const keepWidth = local ? ` vector-effect="non-scaling-stroke"` : "";
|
|
@@ -52499,9 +52578,9 @@ function planLines(m, styles, numText = "") {
|
|
|
52499
52578
|
const align = _nullishCoalesce((m.paraPrId != null ? styles.paraAlign.get(m.paraPrId) : void 0), () => ( "JUSTIFY"));
|
|
52500
52579
|
const geom = m.paraPrId != null ? styles.paraGeom.get(m.paraPrId) : void 0;
|
|
52501
52580
|
const hang = geom && geom.marginIntent < 0 ? -geom.marginIntent : 0;
|
|
52502
|
-
const bu = _nullishCoalesce(_optionalChain([geom, 'optionalAccess',
|
|
52503
|
-
const firstPr = _nullishCoalesce(_optionalChain([m, 'access',
|
|
52504
|
-
const bst = _nullishCoalesce((_optionalChain([bu, 'optionalAccess',
|
|
52581
|
+
const bu = _nullishCoalesce(_optionalChain([geom, 'optionalAccess', _1253 => _1253.bullet]), () => ( (numText && _optionalChain([geom, 'optionalAccess', _1254 => _1254.number]) ? { ch: numText, ...geom.number } : void 0)));
|
|
52582
|
+
const firstPr = _nullishCoalesce(_optionalChain([m, 'access', _1255 => _1255.chars, 'access', _1256 => _1256.find, 'call', _1257 => _1257((c) => c.ch !== ""), 'optionalAccess', _1258 => _1258.prId]), () => ( null));
|
|
52583
|
+
const bst = _nullishCoalesce((_optionalChain([bu, 'optionalAccess', _1259 => _1259.charPrId]) != null ? styles.charPr.get(bu.charPrId) : firstPr != null ? styles.charPr.get(firstPr) : void 0), () => ( DEFAULT_CHAR));
|
|
52505
52584
|
const bulletW = bu ? measureTextWidth(bu.ch, bst.height, bst.ratio, { spacingPct: bst.spacing, faceClass: faceClassOf(bst.face) }) + (bu.offsetPct ? Math.trunc(bst.height * bu.offset / 100) : bu.offset) : 0;
|
|
52506
52585
|
const plans = [];
|
|
52507
52586
|
for (let i = 0; i < m.segs.length; i++) {
|
|
@@ -52509,8 +52588,8 @@ function planLines(m, styles, numText = "") {
|
|
|
52509
52588
|
const start = seg.textpos;
|
|
52510
52589
|
const end = i + 1 < m.segs.length ? m.segs[i + 1].textpos : Math.max(m.chars.length, start);
|
|
52511
52590
|
const tabs = /* @__PURE__ */ new Map();
|
|
52512
|
-
const lead = i === 0 ? Math.max(_nullishCoalesce(_optionalChain([geom, 'optionalAccess',
|
|
52513
|
-
let x = (i === 0 ? Math.max(_nullishCoalesce(_optionalChain([geom, 'optionalAccess',
|
|
52591
|
+
const lead = i === 0 ? Math.max(_nullishCoalesce(_optionalChain([geom, 'optionalAccess', _1260 => _1260.marginIntent]), () => ( 0)), 0) + bulletW : hang + (_optionalChain([bu, 'optionalAccess', _1261 => _1261.autoIndent]) ? bulletW : 0);
|
|
52592
|
+
let x = (i === 0 ? Math.max(_nullishCoalesce(_optionalChain([geom, 'optionalAccess', _1262 => _1262.marginIntent]), () => ( 0)), 0) : hang) + (i === 0 || _optionalChain([bu, 'optionalAccess', _1263 => _1263.autoIndent]) ? bulletW : 0);
|
|
52514
52593
|
let fixedTo = start;
|
|
52515
52594
|
let fixedW = 0;
|
|
52516
52595
|
for (let k = start; k < end && k < m.chars.length; k++) {
|
|
@@ -52606,7 +52685,7 @@ function drawPara(p, ox, oy, areaW, ctx, depth, segPages) {
|
|
|
52606
52685
|
let i = plan.start;
|
|
52607
52686
|
let cursor = ox + seg.horzpos + plan.xoff;
|
|
52608
52687
|
const y = oy + seg.vertpos + seg.baseline;
|
|
52609
|
-
const pva = m.paraPrId != null ? _optionalChain([ctx, 'access',
|
|
52688
|
+
const pva = m.paraPrId != null ? _optionalChain([ctx, 'access', _1264 => _1264.styles, 'access', _1265 => _1265.paraGeom, 'access', _1266 => _1266.get, 'call', _1267 => _1267(m.paraPrId), 'optionalAccess', _1268 => _1268.vertAlign]) : void 0;
|
|
52610
52689
|
const glyphY = (h) => y + (pva === "CENTER" ? Math.round(h * 0.35) : pva === "BOTTOM" ? -Math.round(h * 0.15) : 0);
|
|
52611
52690
|
if (plan.bullet) {
|
|
52612
52691
|
const bs = _nullishCoalesce((plan.bullet.prId != null ? ctx.styles.charPr.get(plan.bullet.prId) : void 0), () => ( DEFAULT_CHAR));
|
|
@@ -52691,7 +52770,7 @@ function drawPara(p, ox, oy, areaW, ctx, depth, segPages) {
|
|
|
52691
52770
|
if (st.italic) attrs.push(`font-style="italic"`);
|
|
52692
52771
|
if (st.underline) attrs.push(`text-decoration="underline"`);
|
|
52693
52772
|
if (st.color) attrs.push(`fill="${escapeXml7(st.color)}"`);
|
|
52694
|
-
emit(ctx, `<text ${attrs.join(" ")}>${escapeXml7(
|
|
52773
|
+
emit(ctx, `<text ${attrs.join(" ")}>${escapeXml7(_chunkSJ5OZXELcjs.mapPuaText.call(void 0, text))}</text>`);
|
|
52695
52774
|
ctx.stats.texts++;
|
|
52696
52775
|
}
|
|
52697
52776
|
return sw;
|
|
@@ -52760,26 +52839,26 @@ function drawPara(p, ox, oy, areaW, ctx, depth, segPages) {
|
|
|
52760
52839
|
anchorLineH = pl.seg.textheight;
|
|
52761
52840
|
}
|
|
52762
52841
|
let objBaseV = baseV;
|
|
52763
|
-
const pTop = depth === 0 ? _optionalChain([ctx, 'access',
|
|
52842
|
+
const pTop = depth === 0 ? _optionalChain([ctx, 'access', _1269 => _1269.paraTops, 'optionalAccess', _1270 => _1270.get, 'call', _1271 => _1271(p)]) : void 0;
|
|
52764
52843
|
const wrapA = _nullishCoalesce(o.el.getAttribute("textWrap"), () => ( "TOP_AND_BOTTOM"));
|
|
52765
52844
|
const top0 = _nullishCoalesce(pTop, () => ( (depth > 0 && wrapA !== "TOP_AND_BOTTOM" ? cellParaTop(p, ctx.styles.paraGeom) : void 0)));
|
|
52766
52845
|
if (top0 !== void 0 && wrapA !== "TOP_AND_BOTTOM") {
|
|
52767
|
-
const start = top0 + (m.paraPrId != null ? _nullishCoalesce(_optionalChain([ctx, 'access',
|
|
52846
|
+
const start = top0 + (m.paraPrId != null ? _nullishCoalesce(_optionalChain([ctx, 'access', _1272 => _1272.styles, 'access', _1273 => _1273.paraGeom, 'access', _1274 => _1274.get, 'call', _1275 => _1275(m.paraPrId), 'optionalAccess', _1276 => _1276.spaceBefore]), () => ( 0)) : 0);
|
|
52768
52847
|
if (baseV > start + 100) {
|
|
52769
52848
|
objBaseV = start;
|
|
52770
52849
|
if (anchorLineV === baseV) anchorLineV = start;
|
|
52771
52850
|
}
|
|
52772
52851
|
}
|
|
52773
|
-
const tbFloats = m.objs.filter((q) => !q.inline && (_nullishCoalesce(q.el.getAttribute("textWrap"), () => ( "TOP_AND_BOTTOM"))) === "TOP_AND_BOTTOM" && (_nullishCoalesce(_optionalChain([findChildByLocalName, 'call',
|
|
52852
|
+
const tbFloats = m.objs.filter((q) => !q.inline && (_nullishCoalesce(q.el.getAttribute("textWrap"), () => ( "TOP_AND_BOTTOM"))) === "TOP_AND_BOTTOM" && (_nullishCoalesce(_optionalChain([findChildByLocalName, 'call', _1277 => _1277(q.el, "pos"), 'optionalAccess', _1278 => _1278.getAttribute, 'call', _1279 => _1279("vertRelTo")]), () => ( "PARA"))) === "PARA").length;
|
|
52774
52853
|
const stay = tbFloats < 2 && !m.objs.some((q) => q.inline) && !m.chars.some((c) => c.ch !== "" && !c.nb && c.ch.trim() !== "");
|
|
52775
|
-
const sbA = m.paraPrId != null ? _nullishCoalesce(_optionalChain([ctx, 'access',
|
|
52854
|
+
const sbA = m.paraPrId != null ? _nullishCoalesce(_optionalChain([ctx, 'access', _1280 => _1280.styles, 'access', _1281 => _1281.paraGeom, 'access', _1282 => _1282.get, 'call', _1283 => _1283(m.paraPrId), 'optionalAccess', _1284 => _1284.spaceBefore]), () => ( 0)) : 0;
|
|
52776
52855
|
const firstLine = anchorLineV === void 0 || anchorLineV === baseV;
|
|
52777
52856
|
let { x, y } = anchorObject(o, ax, oy, objBaseV, aw, ctx, anchorLineV, stay ? sbA : false, firstLine && pTop !== void 0 && pTop < baseV ? pTop : void 0, firstLine ? void 0 : anchorLineH);
|
|
52778
52857
|
if (depth === 0 && tbFloats >= 2 && wrapA === "TOP_AND_BOTTOM") {
|
|
52779
52858
|
if (!tbStack) {
|
|
52780
52859
|
tbStack = /* @__PURE__ */ new Map();
|
|
52781
52860
|
let below = 0;
|
|
52782
|
-
const stackable = m.objs.filter((q) => !q.inline && (_nullishCoalesce(q.el.getAttribute("textWrap"), () => ( "TOP_AND_BOTTOM"))) === "TOP_AND_BOTTOM" && (_nullishCoalesce(_optionalChain([findChildByLocalName, 'call',
|
|
52861
|
+
const stackable = m.objs.filter((q) => !q.inline && (_nullishCoalesce(q.el.getAttribute("textWrap"), () => ( "TOP_AND_BOTTOM"))) === "TOP_AND_BOTTOM" && (_nullishCoalesce(_optionalChain([findChildByLocalName, 'call', _1285 => _1285(q.el, "pos"), 'optionalAccess', _1286 => _1286.getAttribute, 'call', _1287 => _1287("vertRelTo")]), () => ( "PARA"))) === "PARA" && _optionalChain([findChildByLocalName, 'call', _1288 => _1288(q.el, "pos"), 'optionalAccess', _1289 => _1289.getAttribute, 'call', _1290 => _1290("allowOverlap")]) !== "1");
|
|
52783
52862
|
for (const q of stackable.length >= 2 ? stackable.sort((a, b) => a.index - b.index) : []) {
|
|
52784
52863
|
const omQ = findChildByLocalName(q.el, "outMargin"), raw = num2(findChildByLocalName(q.el, "pos"), "vertOffset");
|
|
52785
52864
|
const top = Math.max(below, raw >= 2 ** 31 ? raw - 2 ** 32 : raw);
|
|
@@ -52790,7 +52869,7 @@ function drawPara(p, ox, oy, areaW, ctx, depth, segPages) {
|
|
|
52790
52869
|
const st = tbStack.get(o.el);
|
|
52791
52870
|
if (st !== void 0) y = oy + (_nullishCoalesce(pTop, () => ( 0))) + st;
|
|
52792
52871
|
}
|
|
52793
|
-
const moved = _optionalChain([ctx, 'access',
|
|
52872
|
+
const moved = _optionalChain([ctx, 'access', _1291 => _1291.objPlace, 'optionalAccess', _1292 => _1292.get, 'call', _1293 => _1293(o.el)]);
|
|
52794
52873
|
if (moved) {
|
|
52795
52874
|
const pg = ctx.page;
|
|
52796
52875
|
ctx.page = moved.page;
|
|
@@ -52809,7 +52888,7 @@ function cellParaTop(p, geom) {
|
|
|
52809
52888
|
const segs = lsa ? elements(lsa).filter((e) => ln(e) === "lineseg") : [];
|
|
52810
52889
|
if (!segs.length) return void 0;
|
|
52811
52890
|
const last = segs[segs.length - 1];
|
|
52812
|
-
return num2(last, "vertpos") + num2(last, "vertsize") + num2(last, "spacing") + (_nullishCoalesce(_optionalChain([geom, 'access',
|
|
52891
|
+
return num2(last, "vertpos") + num2(last, "vertsize") + num2(last, "spacing") + (_nullishCoalesce(_optionalChain([geom, 'access', _1294 => _1294.get, 'call', _1295 => _1295(_nullishCoalesce(prev.getAttribute("paraPrIDRef"), () => ( ""))), 'optionalAccess', _1296 => _1296.spaceAfter]), () => ( 0)));
|
|
52813
52892
|
}
|
|
52814
52893
|
function anchorObject(o, ox, oy, baseV, areaW, ctx, anchorLineV, stayLine = false, paraStartV, laterLineH) {
|
|
52815
52894
|
const { PW, PH, ML, MT, BODY_W, BODY_H } = ctx.geom;
|
|
@@ -52845,7 +52924,7 @@ function anchorObject(o, ox, oy, baseV, areaW, ctx, anchorLineV, stayLine = fals
|
|
|
52845
52924
|
if (hrel === "PAGE") {
|
|
52846
52925
|
x = ha === "RIGHT" ? ML + BODY_W - w - ho - omR : ha === "CENTER" ? ML + (BODY_W - w) / 2 + ho : ML + ho + omL;
|
|
52847
52926
|
} else if (hrel === "PAPER") {
|
|
52848
|
-
x = (ha === "RIGHT" ? PW - w - ho - omR : ha === "CENTER" ? (PW - w) / 2 + ho : ho + omL) - (_nullishCoalesce(_optionalChain([ctx, 'access',
|
|
52927
|
+
x = (ha === "RIGHT" ? PW - w - ho - omR : ha === "CENTER" ? (PW - w) / 2 + ho : ho + omL) - (_nullishCoalesce(_optionalChain([ctx, 'access', _1297 => _1297.bodyDx, 'optionalCall', _1298 => _1298(ctx.page)]), () => ( 0)));
|
|
52849
52928
|
} else {
|
|
52850
52929
|
x = ha === "RIGHT" ? ox + areaW - w - ho - omR : ha === "CENTER" ? ox + (areaW - w) / 2 + ho : ox + ho + omL;
|
|
52851
52930
|
}
|
|
@@ -52890,7 +52969,7 @@ function drawObject(o, x, y, baseV, areaW, ctx, depth) {
|
|
|
52890
52969
|
drawObject(sub, x + num2(off, "x"), y + num2(off, "y"), baseV, areaW, ctx, depth + 1);
|
|
52891
52970
|
}
|
|
52892
52971
|
} else if (o.tag === "equation") {
|
|
52893
|
-
const script = _nullishCoalesce(_optionalChain([findChildByLocalName, 'call',
|
|
52972
|
+
const script = _nullishCoalesce(_optionalChain([findChildByLocalName, 'call', _1299 => _1299(o.el, "script"), 'optionalAccess', _1300 => _1300.textContent]), () => ( ""));
|
|
52894
52973
|
const text = script ? latexToPlain(hwpEquationToLatex(script)) : "";
|
|
52895
52974
|
if (text && o.width > 0) {
|
|
52896
52975
|
const bl = Number(o.el.getAttribute("baseLine")), size = num2(o.el, "baseUnit", 1e3);
|
|
@@ -52993,7 +53072,7 @@ function tableContPages(tbl2, ty, MT, BODY_H, memo, slack = 0, floatSpan, nested
|
|
|
52993
53072
|
}
|
|
52994
53073
|
function cellFloatSpan(MT, BODY_H, memo, slack) {
|
|
52995
53074
|
return (seg, top) => {
|
|
52996
|
-
const lsa = seg.parentNode, p = _optionalChain([lsa, 'optionalAccess',
|
|
53075
|
+
const lsa = seg.parentNode, p = _optionalChain([lsa, 'optionalAccess', _1301 => _1301.parentNode]);
|
|
52997
53076
|
if (!p || ln(p) !== "p") return void 0;
|
|
52998
53077
|
const segs = elements(lsa).filter((e) => ln(e) === "lineseg"), k = segs.indexOf(seg);
|
|
52999
53078
|
const m = buildPara(p);
|
|
@@ -53001,10 +53080,10 @@ function cellFloatSpan(MT, BODY_H, memo, slack) {
|
|
|
53001
53080
|
for (const o of m.objs) {
|
|
53002
53081
|
if (o.tag !== "tbl" || o.inline) continue;
|
|
53003
53082
|
const pos = findChildByLocalName(o.el, "pos");
|
|
53004
|
-
if ((_nullishCoalesce(_optionalChain([pos, 'optionalAccess',
|
|
53083
|
+
if ((_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _1302 => _1302.getAttribute, 'call', _1303 => _1303("vertRelTo")]), () => ( "PARA"))) !== "PARA") continue;
|
|
53005
53084
|
const segK = Math.max(0, m.segs.findIndex((sg, i) => sg.textpos <= o.index && (i === m.segs.length - 1 || m.segs[i + 1].textpos > o.index)));
|
|
53006
53085
|
if (segK !== k) continue;
|
|
53007
|
-
const ty = top + num2(findChildByLocalName(o.el, "outMargin"), "top") + Math.max(0, toInt32(_nullishCoalesce(_optionalChain([pos, 'optionalAccess',
|
|
53086
|
+
const ty = top + num2(findChildByLocalName(o.el, "outMargin"), "top") + Math.max(0, toInt32(_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _1304 => _1304.getAttribute, 'call', _1305 => _1305("vertOffset")]), () => ( void 0)), 0));
|
|
53008
53087
|
const span2 = tableContPages(o.el, ty, MT, BODY_H, memo, slack, cellFloatSpan(MT, BODY_H, memo, slack), true);
|
|
53009
53088
|
if (span2.pages > 0 && (!best || span2.pages > best.pages)) best = { ...span2, el: o.el };
|
|
53010
53089
|
}
|
|
@@ -53036,7 +53115,7 @@ function drawTable(tbl2, tx, ty, ctx, depth) {
|
|
|
53036
53115
|
let hdrRows = 0;
|
|
53037
53116
|
if (tbl2.getAttribute("repeatHeader") === "1") while (hdrRows < nRows && cells.some((c) => c.ra === hdrRows) && cells.filter((c) => c.ra === hdrRows).every((c) => c.el.getAttribute("header") === "1")) hdrRows++;
|
|
53038
53117
|
const slack = ctx.geom.PH - ctx.geom.MT - ctx.geom.BODY_H;
|
|
53039
|
-
const splitHere = depth === 1 || !!ctx.splitCell && _optionalChain([findChildByLocalName, 'call',
|
|
53118
|
+
const splitHere = depth === 1 || !!ctx.splitCell && _optionalChain([findChildByLocalName, 'call', _1306 => _1306(tbl2, "pos"), 'optionalAccess', _1307 => _1307.getAttribute, 'call', _1308 => _1308("treatAsChar")]) !== "1";
|
|
53040
53119
|
const plan = splitHere ? planTableRows(tbl2, cells, rowH, ty, ctx.geom.MT, ctx.geom.BODY_H, slack, cellFloatSpan(ctx.geom.MT, ctx.geom.BODY_H, ctx.extentMemo, slack), depth !== 1) : rowH.map((h, r) => [{ page: 0, y: ty + rowY[r], h }]);
|
|
53041
53120
|
const splitSaved = ctx.splitCell;
|
|
53042
53121
|
ctx.splitCell = false;
|
|
@@ -53058,7 +53137,7 @@ function drawTable(tbl2, tx, ty, ctx, depth) {
|
|
|
53058
53137
|
for (const g3 of geom) {
|
|
53059
53138
|
ctx.page = g3.page;
|
|
53060
53139
|
const bf = g3.c.bfId != null ? ctx.styles.borderFill.get(g3.c.bfId) : void 0;
|
|
53061
|
-
if (_optionalChain([bf, 'optionalAccess',
|
|
53140
|
+
if (_optionalChain([bf, 'optionalAccess', _1309 => _1309.fill])) emit(ctx, `<rect x="${pt2(g3.x)}" y="${pt2(g3.y)}" width="${pt2(g3.w)}" height="${pt2(g3.h)}" fill="${escapeXml7(bf.fill)}"/>`);
|
|
53062
53141
|
}
|
|
53063
53142
|
for (const g3 of geom) {
|
|
53064
53143
|
const { c } = g3;
|
|
@@ -53069,13 +53148,13 @@ function drawTable(tbl2, tx, ty, ctx, depth) {
|
|
|
53069
53148
|
const boxes = cellLineBoxes(c);
|
|
53070
53149
|
const contV = new Map(boxes.map((b) => [b.seg, b.top]));
|
|
53071
53150
|
const pieceOf = (v) => Math.max(0, g3.pieces.findIndex((pc) => {
|
|
53072
|
-
const r = _optionalChain([pc, 'access',
|
|
53151
|
+
const r = _optionalChain([pc, 'access', _1310 => _1310.range, 'optionalAccess', _1311 => _1311.get, 'call', _1312 => _1312(c.el)]);
|
|
53073
53152
|
return !!r && v >= r[0] && v < r[1];
|
|
53074
53153
|
}));
|
|
53075
53154
|
const va2 = _nullishCoalesce(c.sub.getAttribute("vertAlign"), () => ( "TOP"));
|
|
53076
53155
|
const pieceOff = g3.pieces.map((pc, k) => {
|
|
53077
53156
|
if (va2 === "TOP") return 0;
|
|
53078
|
-
const from = _nullishCoalesce(_optionalChain([pc, 'access',
|
|
53157
|
+
const from = _nullishCoalesce(_optionalChain([pc, 'access', _1313 => _1313.range, 'optionalAccess', _1314 => _1314.get, 'call', _1315 => _1315(c.el), 'optionalAccess', _1316 => _1316[0]]), () => ( 0));
|
|
53079
53158
|
const bottoms = boxes.filter((b) => pieceOf(b.top) === k).map((b) => b.bottom - from);
|
|
53080
53159
|
if (!bottoms.length) return 0;
|
|
53081
53160
|
const free = pc.h - c.marginT - c.marginB - Math.max(...bottoms);
|
|
@@ -53088,7 +53167,7 @@ function drawTable(tbl2, tx, ty, ctx, depth) {
|
|
|
53088
53167
|
const pages = segs.map((sg) => {
|
|
53089
53168
|
const v = _nullishCoalesce(contV.get(sg), () => ( num2(sg, "vertpos")));
|
|
53090
53169
|
const k = pieceOf(v);
|
|
53091
|
-
const pc = g3.pieces[k], from = _nullishCoalesce(_optionalChain([pc, 'access',
|
|
53170
|
+
const pc = g3.pieces[k], from = _nullishCoalesce(_optionalChain([pc, 'access', _1317 => _1317.range, 'optionalAccess', _1318 => _1318.get, 'call', _1319 => _1319(c.el), 'optionalAccess', _1320 => _1320[0]]), () => ( 0));
|
|
53092
53171
|
sg.setAttribute("vertpos", String(v - from + pc.y + c.marginT + pieceOff[k] - base));
|
|
53093
53172
|
return startPage + pc.page;
|
|
53094
53173
|
});
|
|
@@ -53180,7 +53259,7 @@ function drawPic(pic, x, y, ctx) {
|
|
|
53180
53259
|
}
|
|
53181
53260
|
function drawPicFrame(pic, x, y, w, h, transform, ctx) {
|
|
53182
53261
|
const img = findFirst(pic, "img");
|
|
53183
|
-
const ref = _optionalChain([img, 'optionalAccess',
|
|
53262
|
+
const ref = _optionalChain([img, 'optionalAccess', _1321 => _1321.getAttribute, 'call', _1322 => _1322("binaryItemIDRef")]);
|
|
53184
53263
|
const loaded = ref != null ? ctx.images.get(ref) : void 0;
|
|
53185
53264
|
const imgId = ctx.regions.add("image", bboxOf(ctx, x, y, w, h), { sourceId: _nullishCoalesce(ref, () => ( void 0)), parentId: parentId(ctx) });
|
|
53186
53265
|
emit(ctx, regionOpenTag(imgId, "image", pageNo(ctx)));
|
|
@@ -53226,12 +53305,12 @@ function readSectionGeom(root) {
|
|
|
53226
53305
|
const pagePr = findFirst(root, "pagePr");
|
|
53227
53306
|
const margin = pagePr ? findChildByLocalName(pagePr, "margin") : null;
|
|
53228
53307
|
let PW = num2(pagePr, "width", 59528), PH = num2(pagePr, "height", 84188);
|
|
53229
|
-
if (_optionalChain([pagePr, 'optionalAccess',
|
|
53308
|
+
if (_optionalChain([pagePr, 'optionalAccess', _1323 => _1323.getAttribute, 'call', _1324 => _1324("landscape")]) === "NARROWLY" && PW < PH) {
|
|
53230
53309
|
const t = PW;
|
|
53231
53310
|
PW = PH;
|
|
53232
53311
|
PH = t;
|
|
53233
53312
|
}
|
|
53234
|
-
const gutterType = _nullishCoalesce(_optionalChain([pagePr, 'optionalAccess',
|
|
53313
|
+
const gutterType = _nullishCoalesce(_optionalChain([pagePr, 'optionalAccess', _1325 => _1325.getAttribute, 'call', _1326 => _1326("gutterType")]), () => ( "LEFT_ONLY")), gutter = num2(margin, "gutter", 0);
|
|
53235
53314
|
const gL = gutterType === "TOP_BOTTOM" ? 0 : gutter, gT = gutterType === "TOP_BOTTOM" ? gutter : 0;
|
|
53236
53315
|
const ML = num2(margin, "left", 8504) + gL;
|
|
53237
53316
|
const MT = num2(margin, "top", 5668) + num2(margin, "header", 0) + gT;
|
|
@@ -53362,7 +53441,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
53362
53441
|
for (const o of m0.objs) {
|
|
53363
53442
|
if (o.tag !== "tbl") continue;
|
|
53364
53443
|
const pos = findChildByLocalName(o.el, "pos"), om = findChildByLocalName(o.el, "outMargin");
|
|
53365
|
-
if (!o.inline && (_nullishCoalesce(_optionalChain([pos, 'optionalAccess',
|
|
53444
|
+
if (!o.inline && (_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _1327 => _1327.getAttribute, 'call', _1328 => _1328("vertRelTo")]), () => ( "PARA"))) !== "PARA") continue;
|
|
53366
53445
|
const segK = Math.max(0, m0.segs.findIndex((sg, k) => sg.textpos <= o.index && (k === m0.segs.length - 1 || m0.segs[k + 1].textpos > o.index)));
|
|
53367
53446
|
const segV = num2(segEls[segK], "vertpos");
|
|
53368
53447
|
const h = Math.max(o.height, measureTableHeight(o.el, ctxBase.extentMemo)), omT = num2(om, "top"), omB = num2(om, "bottom");
|
|
@@ -53370,9 +53449,9 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
53370
53449
|
const nTb = m0.objs.filter((q) => !q.inline && (_nullishCoalesce(q.el.getAttribute("textWrap"), () => ( "TOP_AND_BOTTOM"))) === "TOP_AND_BOTTOM").length;
|
|
53371
53450
|
const stay = nTb < 2 && !m0.objs.some((q) => q.inline) && !m0.chars.some((c) => c.ch !== "" && !c.nb && c.ch.trim() !== "");
|
|
53372
53451
|
const wrapP = _nullishCoalesce(o.el.getAttribute("textWrap"), () => ( "TOP_AND_BOTTOM"));
|
|
53373
|
-
const pTop = paraTops.get(p), sbP = m0.paraPrId != null ? _nullishCoalesce(_optionalChain([geom0, 'access',
|
|
53452
|
+
const pTop = paraTops.get(p), sbP = m0.paraPrId != null ? _nullishCoalesce(_optionalChain([geom0, 'access', _1329 => _1329.get, 'call', _1330 => _1330(m0.paraPrId), 'optionalAccess', _1331 => _1331.spaceBefore]), () => ( 0)) : 0;
|
|
53374
53453
|
const nonPush = wrapP !== "TOP_AND_BOTTOM" && pTop !== void 0 && segV > pTop + sbP + 100 ? pTop + sbP : void 0;
|
|
53375
|
-
const voP = Math.max(0, toInt32(_nullishCoalesce(_optionalChain([pos, 'optionalAccess',
|
|
53454
|
+
const voP = Math.max(0, toInt32(_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _1332 => _1332.getAttribute, 'call', _1333 => _1333("vertOffset")]), () => ( void 0)), 0));
|
|
53376
53455
|
const paraStart = segK === 0 && pTop !== void 0 && pTop < segV ? pTop : segV;
|
|
53377
53456
|
const ty = o.inline ? MT + segV + omT : nonPush !== void 0 ? MT + nonPush + omT + voP : MT + (stay ? segV - sbP : pushed >= -100 ? pushed : paraStart) + omT + voP;
|
|
53378
53457
|
const span2 = tableContPages(o.el, ty, MT, BODY_H, ctxBase.extentMemo, PH - MT - BODY_H, cellFloatSpan(MT, BODY_H, ctxBase.extentMemo, PH - MT - BODY_H));
|
|
@@ -53399,7 +53478,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
53399
53478
|
for (const p of elements(root)) {
|
|
53400
53479
|
if (ln(p) !== "p") continue;
|
|
53401
53480
|
const pg = paraSegPages.get(p);
|
|
53402
|
-
if (!_optionalChain([pg, 'optionalAccess',
|
|
53481
|
+
if (!_optionalChain([pg, 'optionalAccess', _1334 => _1334.length])) continue;
|
|
53403
53482
|
const pm = buildPara(p);
|
|
53404
53483
|
if (pm.objs.length || pm.chars.some((c) => c.ch.trim() !== "" || !!c.ctrlText)) lastContent = Math.max(lastContent, ...pg);
|
|
53405
53484
|
}
|
|
@@ -53416,7 +53495,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
53416
53495
|
for (const p of elements(root)) {
|
|
53417
53496
|
if (ln(p) !== "p") continue;
|
|
53418
53497
|
const pg = paraSegPages.get(p);
|
|
53419
|
-
if (!_optionalChain([pg, 'optionalAccess',
|
|
53498
|
+
if (!_optionalChain([pg, 'optionalAccess', _1335 => _1335.includes, 'call', _1336 => _1336(lastContent)])) continue;
|
|
53420
53499
|
const pm = buildPara(p);
|
|
53421
53500
|
pm.segs.forEach((sg, k) => {
|
|
53422
53501
|
if (pg[k] !== lastContent) return;
|
|
@@ -53436,7 +53515,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
53436
53515
|
const ens = endNoteLayout(root, paraSegPages, geom);
|
|
53437
53516
|
const ctx = {
|
|
53438
53517
|
...ctxBase,
|
|
53439
|
-
pages: Array.from({ length: Math.max(nPages, _nullishCoalesce(_optionalChain([ens, 'optionalAccess',
|
|
53518
|
+
pages: Array.from({ length: Math.max(nPages, _nullishCoalesce(_optionalChain([ens, 'optionalAccess', _1337 => _1337.pageCount]), () => ( 0))) }, () => []),
|
|
53440
53519
|
page: 0,
|
|
53441
53520
|
geom,
|
|
53442
53521
|
pageH,
|
|
@@ -53494,7 +53573,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
53494
53573
|
ctx.bodyDx = void 0;
|
|
53495
53574
|
wrapMirror(ctx.pages, (page) => _nullishCoalesce(bodyStart[page], () => ( 0)));
|
|
53496
53575
|
const allPages = new Map(paraSegPages);
|
|
53497
|
-
for (const e of _nullishCoalesce(_optionalChain([ens, 'optionalAccess',
|
|
53576
|
+
for (const e of _nullishCoalesce(_optionalChain([ens, 'optionalAccess', _1338 => _1338.paras]), () => ( []))) allPages.set(e.p, e.pages);
|
|
53498
53577
|
drawPageDecor(root, allPages, ctx, localCols ? nCol : 1, colW, colGap);
|
|
53499
53578
|
drawPageNumbers(root, paraSegPages, ctx);
|
|
53500
53579
|
ctx.page = 0;
|
|
@@ -53563,7 +53642,7 @@ function drawPageNumbers(root, paraPages, ctx) {
|
|
|
53563
53642
|
let decl;
|
|
53564
53643
|
const hidden = /* @__PURE__ */ new Set();
|
|
53565
53644
|
for (const p of elements(root)) if (ln(p) === "p") {
|
|
53566
|
-
const page = _nullishCoalesce(_optionalChain([paraPages, 'access',
|
|
53645
|
+
const page = _nullishCoalesce(_optionalChain([paraPages, 'access', _1339 => _1339.get, 'call', _1340 => _1340(p), 'optionalAccess', _1341 => _1341[0]]), () => ( 0));
|
|
53567
53646
|
for (const run of elements(p)) if (ln(run) === "run") {
|
|
53568
53647
|
for (const ctrl of elements(run)) if (ln(ctrl) === "ctrl") {
|
|
53569
53648
|
const pn = findChildByLocalName(ctrl, "pageNum"), ph = findChildByLocalName(ctrl, "pageHiding");
|
|
@@ -53624,22 +53703,22 @@ function renderSectionRoots(sections, input) {
|
|
|
53624
53703
|
rendered.push({ pages, PW: geom.PW, pageH, clipId: `pgclip${index}` });
|
|
53625
53704
|
ctxBase.pageBase += pages.length;
|
|
53626
53705
|
}
|
|
53627
|
-
if (rendered.length === 0) throw new (0,
|
|
53706
|
+
if (rendered.length === 0) throw new (0, _chunkMI655NV5cjs.KordocError)("\uB80C\uB354\uD560 \uAD6C\uC5ED\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
53628
53707
|
return { sections: rendered, defs: ctxBase.defs, warnings: input.warnings, stats: ctxBase.stats, regions: ctxBase.regions.regions };
|
|
53629
53708
|
}
|
|
53630
53709
|
var SVG_FONT_FAMILY = `'HCR Batang','\uD568\uCD08\uB86C\uBC14\uD0D5','Hancom Batang',AppleMyungjo,'Noto Serif CJK KR',serif`;
|
|
53631
53710
|
async function renderHwpxInternal(input, options) {
|
|
53632
|
-
const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
53711
|
+
const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1342 => _1342.maxImageBytes]), () => ( 40 * 1024 * 1024));
|
|
53633
53712
|
const ab = input instanceof Uint8Array ? input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength) : input;
|
|
53634
|
-
|
|
53713
|
+
_chunkMI655NV5cjs.precheckZipSize.call(void 0, ab, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
|
|
53635
53714
|
let zip;
|
|
53636
53715
|
try {
|
|
53637
53716
|
zip = await _jszip2.default.loadAsync(input);
|
|
53638
53717
|
} catch (e43) {
|
|
53639
|
-
throw new (0,
|
|
53718
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("HWPX(ZIP) \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 \u2014 \uB80C\uB354\uB294 HWPX\uB9CC \uC9C0\uC6D0");
|
|
53640
53719
|
}
|
|
53641
|
-
const secFiles = zip.file(/Contents\/section\d+\.xml$/i).sort((a, b) =>
|
|
53642
|
-
if (secFiles.length === 0) throw new (0,
|
|
53720
|
+
const secFiles = zip.file(/Contents\/section\d+\.xml$/i).sort((a, b) => _chunkMI655NV5cjs.compareSectionPaths.call(void 0, a.name, b.name));
|
|
53721
|
+
if (secFiles.length === 0) throw new (0, _chunkMI655NV5cjs.KordocError)("Contents/section0.xml \uC5C6\uC74C \u2014 HWPX\uAC00 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB428");
|
|
53643
53722
|
const warnings = [];
|
|
53644
53723
|
const headFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( zip.file("Contents/head.xml")));
|
|
53645
53724
|
const verFile = zip.file("version.xml");
|
|
@@ -53650,14 +53729,14 @@ async function renderHwpxInternal(input, options) {
|
|
|
53650
53729
|
const secXmls = [];
|
|
53651
53730
|
for (const f of secFiles) {
|
|
53652
53731
|
const xml = await readZipEntry(f, "text");
|
|
53653
|
-
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
53732
|
+
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0, _chunkMI655NV5cjs.KordocError)("\uC139\uC158 XML\uC774 \uD5C8\uC6A9 \uD06C\uAE30\uB97C \uCD08\uACFC");
|
|
53654
53733
|
secXmls.push(xml);
|
|
53655
53734
|
}
|
|
53656
53735
|
const masterPages = /* @__PURE__ */ new Map();
|
|
53657
53736
|
const masterXmls = [];
|
|
53658
53737
|
for (const file of zip.file(/Contents\/masterpage[^/]*\.xml$/i)) {
|
|
53659
53738
|
const xml = await readZipEntry(file, "text");
|
|
53660
|
-
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
53739
|
+
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0, _chunkMI655NV5cjs.KordocError)("\uBC14\uD0D5\uCABD XML\uC774 \uD5C8\uC6A9 \uD06C\uAE30\uB97C \uCD08\uACFC");
|
|
53661
53740
|
const root = createXmlParser().parseFromString(xml, "text/xml").documentElement;
|
|
53662
53741
|
if (root && ln(root) === "masterPage") {
|
|
53663
53742
|
masterPages.set(root.getAttribute("id") || file.name.replace(/^.*\/|\.xml$/g, ""), root);
|
|
@@ -53685,7 +53764,7 @@ async function renderHwpxInternal(input, options) {
|
|
|
53685
53764
|
let href = binmap.get(ref);
|
|
53686
53765
|
if (!href) {
|
|
53687
53766
|
const cand = zip.file(new RegExp(`BinData/.*${ref.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "i"))[0];
|
|
53688
|
-
href = _optionalChain([cand, 'optionalAccess',
|
|
53767
|
+
href = _optionalChain([cand, 'optionalAccess', _1343 => _1343.name]);
|
|
53689
53768
|
}
|
|
53690
53769
|
if (!href) continue;
|
|
53691
53770
|
const f = _nullishCoalesce(zip.file(href), () => ( zip.file("Contents/" + href)));
|
|
@@ -53707,7 +53786,7 @@ async function renderHwpxInternal(input, options) {
|
|
|
53707
53786
|
for (let si = 0; si < secXmls.length; si++) {
|
|
53708
53787
|
const secXml = secXmls[si];
|
|
53709
53788
|
const hasCache = /<(?:[A-Za-z][\w.-]*:)?linesegarray[\s/>]/.test(secXml);
|
|
53710
|
-
if (!hasCache && !_optionalChain([options, 'optionalAccess',
|
|
53789
|
+
if (!hasCache && !_optionalChain([options, 'optionalAccess', _1344 => _1344.reflow])) {
|
|
53711
53790
|
noCacheSkipped = true;
|
|
53712
53791
|
warnings.push(`\uAD6C\uC5ED ${si}: \uC870\uD310 \uCE90\uC2DC \uC5C6\uC74C \u2014 reflow \uC635\uC158 \uD544\uC694, \uC0DD\uB7B5`);
|
|
53713
53792
|
continue;
|
|
@@ -53724,11 +53803,11 @@ async function renderHwpxInternal(input, options) {
|
|
|
53724
53803
|
}
|
|
53725
53804
|
if (roots.length === 0) {
|
|
53726
53805
|
if (noCacheSkipped) {
|
|
53727
|
-
throw new (0,
|
|
53806
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("\uC870\uD310 \uCE90\uC2DC(linesegarray) \uC5C6\uC74C \u2014 \uD55C\uCEF4\uC5D0\uC11C \uC800\uC7A5\uD55C HWPX\uB9CC \uB80C\uB354 \uAC00\uB2A5 (reflow \uC635\uC158\uC73C\uB85C \uD569\uC131 \uB80C\uB354 \uAC00\uB2A5)");
|
|
53728
53807
|
}
|
|
53729
|
-
throw new (0,
|
|
53808
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("\uB80C\uB354\uD560 \uAD6C\uC5ED\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 HWPX\uAC00 \uC190\uC0C1\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4");
|
|
53730
53809
|
}
|
|
53731
|
-
return renderSectionRoots(roots, { styles, images, warnings, reflow: !!_optionalChain([options, 'optionalAccess',
|
|
53810
|
+
return renderSectionRoots(roots, { styles, images, warnings, reflow: !!_optionalChain([options, 'optionalAccess', _1345 => _1345.reflow]), reflowMode: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1346 => _1346.reflowMode]), () => ( "keep")), highlights: _optionalChain([options, 'optionalAccess', _1347 => _1347.highlights]) });
|
|
53732
53811
|
}
|
|
53733
53812
|
async function renderHwpxToSvg(input, options) {
|
|
53734
53813
|
const r = await renderHwpxInternal(input, options);
|
|
@@ -53951,7 +54030,7 @@ var FOLD_END = 42124;
|
|
|
53951
54030
|
var FOLD_SHIFT = 983040 - 40960;
|
|
53952
54031
|
function textChar(ch) {
|
|
53953
54032
|
if (ch >= FOLD_START && ch <= FOLD_END) {
|
|
53954
|
-
const mapped =
|
|
54033
|
+
const mapped = _chunkSJ5OZXELcjs.mapPuaText.call(void 0, String.fromCodePoint(ch + FOLD_SHIFT));
|
|
53955
54034
|
return /[\u{F0000}-\u{FFFFF}]/u.test(mapped) ? "" : mapped;
|
|
53956
54035
|
}
|
|
53957
54036
|
if (ch === 65534 || ch === 65535 || ch >= 55296 && ch <= 57343) return "\uFFFD";
|
|
@@ -54043,7 +54122,7 @@ function paragraphXml(records, i, j, level, ctx, depth) {
|
|
|
54043
54122
|
out += run.join("") + "</hp:run>";
|
|
54044
54123
|
run = [];
|
|
54045
54124
|
};
|
|
54046
|
-
openRun(_nullishCoalesce(_optionalChain([shapes, 'access',
|
|
54125
|
+
openRun(_nullishCoalesce(_optionalChain([shapes, 'access', _1348 => _1348[0], 'optionalAccess', _1349 => _1349[1]]), () => ( 0)));
|
|
54047
54126
|
let pos = 0, ctrlIdx = 0, o = 0;
|
|
54048
54127
|
const switchShape = () => {
|
|
54049
54128
|
while (shapeIdx + 1 < shapes.length && pos >= shapes[shapeIdx + 1][0]) {
|
|
@@ -54129,7 +54208,7 @@ function paragraphXml(records, i, j, level, ctx, depth) {
|
|
|
54129
54208
|
closeRun();
|
|
54130
54209
|
const rest = ctrls.filter((c) => !c.used && (c.id === CTRL_TBL3 || c.id === CTRL_GSO3 || c.id === CTRL_SECD2 || c.id === CTRL_COLD2));
|
|
54131
54210
|
if (rest.length > 0) {
|
|
54132
|
-
openRun(_nullishCoalesce(_optionalChain([shapes, 'access',
|
|
54211
|
+
openRun(_nullishCoalesce(_optionalChain([shapes, 'access', _1350 => _1350[0], 'optionalAccess', _1351 => _1351[1]]), () => ( 0)));
|
|
54133
54212
|
for (const c of rest) {
|
|
54134
54213
|
const el = ctrlElement(ctrls.indexOf(c), c.id);
|
|
54135
54214
|
run.push(el);
|
|
@@ -54295,14 +54374,14 @@ function hwp5SectionToXml(records, ctx) {
|
|
|
54295
54374
|
return `<hs:sec xmlns:hs="http://www.hancom.co.kr/hwpml/2011/section" xmlns:hp="http://www.hancom.co.kr/hwpml/2011/paragraph" xmlns:hc="http://www.hancom.co.kr/hwpml/2011/core">` + paragraphsXml(records, 0, records.length, 0, ctx, 0) + "</hs:sec>";
|
|
54296
54375
|
}
|
|
54297
54376
|
function renderHwp5Records(docInfo, styles, secRecords, binData, options, select, warnings = []) {
|
|
54298
|
-
const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
54377
|
+
const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1352 => _1352.maxImageBytes]), () => ( 40 * 1024 * 1024));
|
|
54299
54378
|
const MAX_TOTAL_IMAGE_BYTES = 128 * 1024 * 1024;
|
|
54300
54379
|
const images = /* @__PURE__ */ new Map();
|
|
54301
54380
|
let totalImgBytes = 0;
|
|
54302
54381
|
const imageRef = (binDataId) => {
|
|
54303
54382
|
if (binDataId <= 0) return null;
|
|
54304
|
-
const item = _optionalChain([docInfo, 'optionalAccess',
|
|
54305
|
-
if (_optionalChain([item, 'optionalAccess',
|
|
54383
|
+
const item = _optionalChain([docInfo, 'optionalAccess', _1353 => _1353.binData, 'access', _1354 => _1354[binDataId - 1]]);
|
|
54384
|
+
if (_optionalChain([item, 'optionalAccess', _1355 => _1355.kind]) === "link") return null;
|
|
54306
54385
|
const storageId = item && item.storageId > 0 ? item.storageId : binDataId;
|
|
54307
54386
|
const ref = `bin${storageId}`;
|
|
54308
54387
|
if (images.has(ref)) return ref;
|
|
@@ -54336,8 +54415,8 @@ function renderHwp5Records(docInfo, styles, secRecords, binData, options, select
|
|
|
54336
54415
|
}
|
|
54337
54416
|
roots.push({ root, index: si });
|
|
54338
54417
|
}
|
|
54339
|
-
if (roots.length === 0) throw new (0,
|
|
54340
|
-
const r = renderSectionRoots(roots, { styles, images, warnings, reflow: !!_optionalChain([options, 'optionalAccess',
|
|
54418
|
+
if (roots.length === 0) throw new (0, _chunkMI655NV5cjs.KordocError)("\uB80C\uB354\uD560 \uAD6C\uC5ED\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 HWP \uAC00 \uC190\uC0C1\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4");
|
|
54419
|
+
const r = renderSectionRoots(roots, { styles, images, warnings, reflow: !!_optionalChain([options, 'optionalAccess', _1356 => _1356.reflow]), reflowMode: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1357 => _1357.reflowMode]), () => ( "keep")), highlights: _optionalChain([options, 'optionalAccess', _1358 => _1358.highlights]) });
|
|
54341
54420
|
return assemblePageSvgs(r, "hwp", select);
|
|
54342
54421
|
}
|
|
54343
54422
|
function renderHwp5Pages(input, options, select) {
|
|
@@ -54349,7 +54428,7 @@ function renderHwp5Pages(input, options, select) {
|
|
|
54349
54428
|
const styles = buildHwp5RenderStyles(_nullishCoalesce(docInfoRecords, () => ( [])));
|
|
54350
54429
|
const docInfo = docInfoRecords ? parseDocInfo(docInfoRecords) : null;
|
|
54351
54430
|
const sections = readHwp5SectionStreams(c);
|
|
54352
|
-
if (sections.length === 0) throw new (0,
|
|
54431
|
+
if (sections.length === 0) throw new (0, _chunkMI655NV5cjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
54353
54432
|
const parseWarnings = [];
|
|
54354
54433
|
const secRecords = readHwp5SectionRecords(c, sections, parseWarnings);
|
|
54355
54434
|
for (const w of parseWarnings) warnings.push(w.message);
|
|
@@ -54435,14 +54514,14 @@ async function loadSharp() {
|
|
|
54435
54514
|
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("sharp")));
|
|
54436
54515
|
return _nullishCoalesce(mod.default, () => ( mod));
|
|
54437
54516
|
} catch (e46) {
|
|
54438
|
-
throw new (0,
|
|
54439
|
-
'PNG \uB798\uC2A4\uD130\uC5D0\uB294 sharp\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4 (npm install sharp). sharp \uC5C6\uC774 \uC4F0\uB824\uBA74 format: "svg" + output_path\uB85C SVG \uD30C\uC77C \uC800\uC7A5\uC744 \uC0AC\uC6A9\uD558\uC138\uC694.' +
|
|
54517
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(
|
|
54518
|
+
'PNG \uB798\uC2A4\uD130\uC5D0\uB294 sharp\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4 (npm install sharp). sharp \uC5C6\uC774 \uC4F0\uB824\uBA74 format: "svg" + output_path\uB85C SVG \uD30C\uC77C \uC800\uC7A5\uC744 \uC0AC\uC6A9\uD558\uC138\uC694.' + _chunkMI655NV5cjs.OPTIONAL_DEP_INSTALL_HINT
|
|
54440
54519
|
);
|
|
54441
54520
|
}
|
|
54442
54521
|
}
|
|
54443
54522
|
async function rasterizePageSvg(svg, widthPt, heightPt, options = {}) {
|
|
54444
54523
|
const sharp = await loadSharp();
|
|
54445
|
-
if (!(widthPt > 0) || !(heightPt > 0)) throw new (0,
|
|
54524
|
+
if (!(widthPt > 0) || !(heightPt > 0)) throw new (0, _chunkMI655NV5cjs.KordocError)(`\uC798\uBABB\uB41C \uD398\uC774\uC9C0 \uD06C\uAE30: ${widthPt}x${heightPt}pt`);
|
|
54446
54525
|
const maxW = _nullishCoalesce(options.maxWidthPx, () => ( 1400));
|
|
54447
54526
|
const maxH = _nullishCoalesce(options.maxHeightPx, () => ( 4e3));
|
|
54448
54527
|
const scale2 = Math.min(maxW / widthPt, maxH / heightPt, 2);
|
|
@@ -54460,11 +54539,11 @@ async function renderHtmlToPdf(html, options = {}) {
|
|
|
54460
54539
|
try {
|
|
54461
54540
|
puppeteer = await Promise.resolve().then(() => _interopRequireWildcard(require("puppeteer-core")));
|
|
54462
54541
|
} catch (e47) {
|
|
54463
|
-
throw new (0,
|
|
54542
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("PDF \uB80C\uB354\uC5D0\uB294 puppeteer-core \uAC00 \uD544\uC694\uD569\uB2C8\uB2E4 (npm install puppeteer-core). SVG/HTML/PNG \uB294 Chromium \uC5C6\uC774 \uB429\uB2C8\uB2E4");
|
|
54464
54543
|
}
|
|
54465
54544
|
const executablePath = _nullishCoalesce(_nullishCoalesce(options.browserExecutablePath, () => ( process.env.PUPPETEER_EXECUTABLE_PATH)), () => ( findChromiumPath()));
|
|
54466
54545
|
if (!executablePath) {
|
|
54467
|
-
throw new (0,
|
|
54546
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)("Chromium \uC2E4\uD589 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 browserExecutablePath \uC635\uC158 \uB610\uB294 PUPPETEER_EXECUTABLE_PATH \uD658\uACBD\uBCC0\uC218\uB97C \uC9C0\uC815\uD558\uC138\uC694");
|
|
54468
54547
|
}
|
|
54469
54548
|
const { browser, page } = await launchLockedPage(puppeteer, executablePath);
|
|
54470
54549
|
try {
|
|
@@ -54480,13 +54559,13 @@ async function renderHtmlToPdf(html, options = {}) {
|
|
|
54480
54559
|
async function loadBuffer(input) {
|
|
54481
54560
|
if (typeof input === "string") {
|
|
54482
54561
|
try {
|
|
54483
|
-
return
|
|
54562
|
+
return _chunkMI655NV5cjs.toArrayBuffer.call(void 0, await _promises.readFile.call(void 0, input));
|
|
54484
54563
|
} catch (err) {
|
|
54485
54564
|
const code = err instanceof Error && "code" in err ? err.code : void 0;
|
|
54486
|
-
throw new (0,
|
|
54565
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(code === "ENOENT" ? `\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${input}` : `\uD30C\uC77C \uC77D\uAE30 \uC2E4\uD328: ${input}`);
|
|
54487
54566
|
}
|
|
54488
54567
|
}
|
|
54489
|
-
if (Buffer.isBuffer(input)) return
|
|
54568
|
+
if (Buffer.isBuffer(input)) return _chunkMI655NV5cjs.toArrayBuffer.call(void 0, input);
|
|
54490
54569
|
if (input instanceof Uint8Array) return input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength);
|
|
54491
54570
|
return input;
|
|
54492
54571
|
}
|
|
@@ -54495,17 +54574,17 @@ async function sourceFormatOf(buffer) {
|
|
|
54495
54574
|
if (format2 === "hwpx") {
|
|
54496
54575
|
const zip = await detectZipFormat(buffer);
|
|
54497
54576
|
if (zip === "hwpx" || zip === "unknown") return "hwpx";
|
|
54498
|
-
throw new (0,
|
|
54577
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`\uB80C\uB354 \uBBF8\uC9C0\uC6D0 \uD615\uC2DD(${zip}) \u2014 \uB808\uC774\uC544\uC6C3 \uB80C\uB354\uB294 HWPX\xB7HWP \uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4`);
|
|
54499
54578
|
}
|
|
54500
54579
|
if (format2 === "hwp") return "hwp";
|
|
54501
|
-
throw new (0,
|
|
54580
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`\uB80C\uB354 \uBBF8\uC9C0\uC6D0 \uD615\uC2DD(${format2}) \u2014 \uB808\uC774\uC544\uC6C3 \uB80C\uB354\uB294 HWPX\xB7HWP \uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4`);
|
|
54502
54581
|
}
|
|
54503
54582
|
async function renderDocumentToScene(input, options = {}) {
|
|
54504
54583
|
const buffer = await loadBuffer(input);
|
|
54505
54584
|
const source = await sourceFormatOf(buffer);
|
|
54506
54585
|
const select = options.pages !== void 0 ? (pageCount) => {
|
|
54507
54586
|
const set = _chunkJ55UQC5Hcjs.parsePageRange.call(void 0, options.pages, pageCount);
|
|
54508
|
-
if (set.size === 0) throw new (0,
|
|
54587
|
+
if (set.size === 0) throw new (0, _chunkMI655NV5cjs.KordocError)(`\uC120\uD0DD\uD55C \uD398\uC774\uC9C0\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uBB38\uC11C\uB294 ${pageCount}\uCABD (pages: ${JSON.stringify(options.pages)})`);
|
|
54509
54588
|
return set;
|
|
54510
54589
|
} : void 0;
|
|
54511
54590
|
const renderOptions = { reflow: _nullishCoalesce(options.reflow, () => ( true)), reflowMode: options.reflowMode, highlights: options.highlights, maxImageBytes: options.maxImageBytes };
|
|
@@ -54541,7 +54620,7 @@ async function renderDocument(input, options) {
|
|
|
54541
54620
|
break;
|
|
54542
54621
|
}
|
|
54543
54622
|
default:
|
|
54544
|
-
throw new (0,
|
|
54623
|
+
throw new (0, _chunkMI655NV5cjs.KordocError)(`\uC54C \uC218 \uC5C6\uB294 \uB80C\uB354 \uD3EC\uB9F7: ${String(options.format)} (svg|html|png|jpeg|pdf)`);
|
|
54545
54624
|
}
|
|
54546
54625
|
return { scene, assets };
|
|
54547
54626
|
}
|
|
@@ -54571,7 +54650,7 @@ async function extractRenderedRegions(input, options = {}) {
|
|
|
54571
54650
|
const out = [];
|
|
54572
54651
|
for (const [page, items] of [...byPage.entries()].sort((a, b) => a[0] - b[0])) {
|
|
54573
54652
|
const meta = scene.pages.find((p) => p.page === page);
|
|
54574
|
-
if (!meta) throw new (0,
|
|
54653
|
+
if (!meta) throw new (0, _chunkMI655NV5cjs.KordocError)(`\uD398\uC774\uC9C0 ${page} \uBA54\uD0C0 \uC5C6\uC74C`);
|
|
54575
54654
|
const raster = await rasterizePageSvg(pageSvgs.get(page), meta.width, meta.height, { format: format2, maxWidthPx: options.maxWidthPx, quality: options.quality });
|
|
54576
54655
|
for (const { region, bbox } of items) {
|
|
54577
54656
|
const rect = cropRect(bbox, raster.scale, raster.widthPx, raster.heightPx, _nullishCoalesce(options.paddingPt, () => ( 0)));
|
|
@@ -54595,9 +54674,9 @@ function wantsCrop(kind, policy) {
|
|
|
54595
54674
|
}
|
|
54596
54675
|
async function extractTables(input, options = {}) {
|
|
54597
54676
|
const policy = _nullishCoalesce(options.policy, () => ( "non-tabular-and-uncertain"));
|
|
54598
|
-
const buffer = typeof input === "string" ?
|
|
54677
|
+
const buffer = typeof input === "string" ? _chunkMI655NV5cjs.toArrayBuffer.call(void 0, await _promises.readFile.call(void 0, input)) : Buffer.isBuffer(input) ? _chunkMI655NV5cjs.toArrayBuffer.call(void 0, input) : input;
|
|
54599
54678
|
const parsed = await parse(buffer, { classifyTables: true, layoutTables: "keep" });
|
|
54600
|
-
if (!parsed.success) throw new (0,
|
|
54679
|
+
if (!parsed.success) throw new (0, _chunkMI655NV5cjs.KordocError)(`\uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}`);
|
|
54601
54680
|
const blocks = collectTableBlocks(parsed.blocks);
|
|
54602
54681
|
const out = blocks.map((b, i) => ({
|
|
54603
54682
|
id: _nullishCoalesce(b.table.sourceId, () => ( `tbl-${i + 1}`)),
|
|
@@ -54655,22 +54734,22 @@ async function extractTables(input, options = {}) {
|
|
|
54655
54734
|
// src/index.ts
|
|
54656
54735
|
async function parse(input, options) {
|
|
54657
54736
|
let buffer;
|
|
54658
|
-
const opts = typeof input === "string" && !_optionalChain([options, 'optionalAccess',
|
|
54659
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
54737
|
+
const opts = typeof input === "string" && !_optionalChain([options, 'optionalAccess', _1359 => _1359.filePath]) ? { ...options, filePath: input } : options;
|
|
54738
|
+
if (_optionalChain([opts, 'optionalAccess', _1360 => _1360.htmlTables]) && opts.tableFormat) {
|
|
54660
54739
|
return { success: false, fileType: "unknown", error: "htmlTables \uC640 tableFormat \uC740 \uD568\uAED8 \uC4F8 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4" };
|
|
54661
54740
|
}
|
|
54662
|
-
const ocrOptionError =
|
|
54741
|
+
const ocrOptionError = _chunkSJ5OZXELcjs.validateOcrOptions.call(void 0, opts);
|
|
54663
54742
|
if (ocrOptionError) return { success: false, fileType: "unknown", error: ocrOptionError };
|
|
54664
54743
|
if (typeof input === "string") {
|
|
54665
54744
|
try {
|
|
54666
54745
|
const buf = await _promises.readFile.call(void 0, input);
|
|
54667
|
-
buffer =
|
|
54746
|
+
buffer = _chunkMI655NV5cjs.toArrayBuffer.call(void 0, buf);
|
|
54668
54747
|
} catch (err) {
|
|
54669
54748
|
const msg2 = err instanceof Error && "code" in err && err.code === "ENOENT" ? `\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${input}` : `\uD30C\uC77C \uC77D\uAE30 \uC2E4\uD328: ${input}`;
|
|
54670
|
-
return { success: false, fileType: "unknown", error: msg2, code:
|
|
54749
|
+
return { success: false, fileType: "unknown", error: msg2, code: _chunkMI655NV5cjs.classifyError.call(void 0, err) };
|
|
54671
54750
|
}
|
|
54672
54751
|
} else if (Buffer.isBuffer(input)) {
|
|
54673
|
-
buffer =
|
|
54752
|
+
buffer = _chunkMI655NV5cjs.toArrayBuffer.call(void 0, input);
|
|
54674
54753
|
} else {
|
|
54675
54754
|
buffer = input;
|
|
54676
54755
|
}
|
|
@@ -54679,23 +54758,23 @@ async function parse(input, options) {
|
|
|
54679
54758
|
}
|
|
54680
54759
|
const format2 = detectFormat(buffer);
|
|
54681
54760
|
const result = await dispatch(format2, buffer, opts);
|
|
54682
|
-
if (result.success && _optionalChain([opts, 'optionalAccess',
|
|
54761
|
+
if (result.success && _optionalChain([opts, 'optionalAccess', _1361 => _1361.images]) === false) {
|
|
54683
54762
|
delete result.images;
|
|
54684
54763
|
dropImageBytes(result.blocks);
|
|
54685
54764
|
}
|
|
54686
|
-
if (result.success && _optionalChain([opts, 'optionalAccess',
|
|
54765
|
+
if (result.success && _optionalChain([opts, 'optionalAccess', _1362 => _1362.classifyTables])) classifyTableTree(result.blocks);
|
|
54687
54766
|
let out = result;
|
|
54688
|
-
if (result.success && _optionalChain([opts, 'optionalAccess',
|
|
54767
|
+
if (result.success && _optionalChain([opts, 'optionalAccess', _1363 => _1363.pages]) && result.pageCount && _chunkJ55UQC5Hcjs.parsePageRange.call(void 0, opts.pages, result.pageCount).size === 0) {
|
|
54689
54768
|
out = { ...result, warnings: [..._nullishCoalesce(result.warnings, () => ( [])), { code: "PARTIAL_PARSE", message: `\uC694\uCCAD\uD55C \uCABD \uBC94\uC704(${opts.pages})\uAC00 \uBB38\uC11C \uCABD(1~${result.pageCount})\uACFC \uACB9\uCE58\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4` }] };
|
|
54690
54769
|
}
|
|
54691
54770
|
if (out.success && !out.pages) {
|
|
54692
|
-
const pages =
|
|
54771
|
+
const pages = _chunk2BCQVQO2cjs.blocksToPages.call(void 0, out.blocks, (bs) => _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, bs, { tableFormat: _optionalChain([opts, 'optionalAccess', _1364 => _1364.tableFormat]) }));
|
|
54693
54772
|
if (pages) out = { ...out, pages };
|
|
54694
54773
|
}
|
|
54695
|
-
if (out.success && _optionalChain([opts, 'optionalAccess',
|
|
54774
|
+
if (out.success && _optionalChain([opts, 'optionalAccess', _1365 => _1365.plain])) {
|
|
54696
54775
|
out = { ...out, markdown: toPlainMarkdown(out.markdown), ...out.pages ? { pages: out.pages.map((p) => ({ ...p, markdown: toPlainMarkdown(p.markdown) })) } : {} };
|
|
54697
54776
|
}
|
|
54698
|
-
if (out.success && _optionalChain([opts, 'optionalAccess',
|
|
54777
|
+
if (out.success && _optionalChain([opts, 'optionalAccess', _1366 => _1366.htmlTables])) {
|
|
54699
54778
|
out = { ...out, markdown: toHtmlTables(out.markdown), ...out.pages ? { pages: out.pages.map((p) => ({ ...p, markdown: toHtmlTables(p.markdown) })) } : {} };
|
|
54700
54779
|
}
|
|
54701
54780
|
return out;
|
|
@@ -54740,42 +54819,42 @@ async function dispatch(format2, buffer, opts) {
|
|
|
54740
54819
|
async function withEmbeddedImageOcr(blocks, markdown, warnings, images, options) {
|
|
54741
54820
|
const list = [..._nullishCoalesce(warnings, () => ( []))];
|
|
54742
54821
|
if (!await ocrEmbeddedImages(blocks, options, list)) return { markdown, warnings: list.length ? list : void 0 };
|
|
54743
|
-
let md2 =
|
|
54744
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
54822
|
+
let md2 = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _1367 => _1367.tableFormat]) });
|
|
54823
|
+
if (_optionalChain([options, 'optionalAccess', _1368 => _1368.inlineImages]) && options.images !== false && _optionalChain([images, 'optionalAccess', _1369 => _1369.length])) {
|
|
54745
54824
|
try {
|
|
54746
|
-
md2 =
|
|
54825
|
+
md2 = _chunk2BCQVQO2cjs.inlineImagesIntoMarkdown.call(void 0, md2, images, { compress: true });
|
|
54747
54826
|
} catch (e48) {
|
|
54748
54827
|
}
|
|
54749
54828
|
}
|
|
54750
54829
|
return { markdown: md2, warnings: list.length ? list : void 0 };
|
|
54751
54830
|
}
|
|
54752
54831
|
function scriptsOff(r, off) {
|
|
54753
|
-
return off ?
|
|
54832
|
+
return off ? _chunkSJ5OZXELcjs.stripScriptTags.call(void 0, r) : r;
|
|
54754
54833
|
}
|
|
54755
54834
|
async function parseImage(buffer, options) {
|
|
54756
54835
|
try {
|
|
54757
|
-
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-
|
|
54836
|
+
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-BELHEWPX.cjs")));
|
|
54758
54837
|
const { blocks, warnings, lines } = await parseImageDocument(buffer, options);
|
|
54759
|
-
|
|
54838
|
+
_chunkSJ5OZXELcjs.stripScriptTags.call(void 0, { blocks });
|
|
54760
54839
|
return {
|
|
54761
54840
|
success: true,
|
|
54762
54841
|
fileType: "image",
|
|
54763
|
-
markdown:
|
|
54842
|
+
markdown: _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _1370 => _1370.tableFormat]) }),
|
|
54764
54843
|
blocks,
|
|
54765
54844
|
warnings: warnings.length ? warnings : void 0,
|
|
54766
54845
|
pageCount: 1,
|
|
54767
|
-
..._optionalChain([options, 'optionalAccess',
|
|
54846
|
+
..._optionalChain([options, 'optionalAccess', _1371 => _1371.ocrLines]) ? { ocrLines: lines ? [lines] : [] } : {}
|
|
54768
54847
|
};
|
|
54769
54848
|
} catch (err) {
|
|
54770
|
-
return { success: false, fileType: "image", error:
|
|
54849
|
+
return { success: false, fileType: "image", error: _chunkMI655NV5cjs.sanitizeError.call(void 0, err), code: _chunkMI655NV5cjs.classifyError.call(void 0, err) };
|
|
54771
54850
|
}
|
|
54772
54851
|
}
|
|
54773
54852
|
async function parseHwp3(buffer, options) {
|
|
54774
54853
|
try {
|
|
54775
54854
|
const { markdown, blocks, metadata, outline, warnings, images } = parseHwp3Document(buffer, options);
|
|
54776
|
-
return { success: true, fileType: "hwp3", markdown, blocks, metadata, outline, warnings, images, pageCount: _optionalChain([metadata, 'optionalAccess',
|
|
54855
|
+
return { success: true, fileType: "hwp3", markdown, blocks, metadata, outline, warnings, images, pageCount: _optionalChain([metadata, 'optionalAccess', _1372 => _1372.pageCount]) };
|
|
54777
54856
|
} catch (err) {
|
|
54778
|
-
return { success: false, fileType: "hwp3", error:
|
|
54857
|
+
return { success: false, fileType: "hwp3", error: _chunkMI655NV5cjs.sanitizeError.call(void 0, err), code: _chunkMI655NV5cjs.classifyError.call(void 0, err) };
|
|
54779
54858
|
}
|
|
54780
54859
|
}
|
|
54781
54860
|
async function parseHwpx(buffer, options) {
|
|
@@ -54783,15 +54862,15 @@ async function parseHwpx(buffer, options) {
|
|
|
54783
54862
|
const doc = await parseHwpxDocument(buffer, options);
|
|
54784
54863
|
const { blocks, metadata, outline, images } = doc;
|
|
54785
54864
|
const { markdown, warnings } = await withEmbeddedImageOcr(blocks, doc.markdown, doc.warnings, void 0, options);
|
|
54786
|
-
return scriptsOff({ success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess',
|
|
54865
|
+
return scriptsOff({ success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _1373 => _1373.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _1374 => _1374.pageCount]) }, _optionalChain([options, 'optionalAccess', _1375 => _1375.scriptTags]) === false);
|
|
54787
54866
|
} catch (err) {
|
|
54788
|
-
return { success: false, fileType: "hwpx", error:
|
|
54867
|
+
return { success: false, fileType: "hwpx", error: _chunkMI655NV5cjs.sanitizeError.call(void 0, err), code: _chunkMI655NV5cjs.classifyError.call(void 0, err) };
|
|
54789
54868
|
}
|
|
54790
54869
|
}
|
|
54791
54870
|
async function parseHwp(buffer, options) {
|
|
54792
54871
|
try {
|
|
54793
54872
|
const { markdown, blocks, metadata, outline, warnings, images } = parseHwp5Document(Buffer.from(buffer), options);
|
|
54794
|
-
if (isDistributionSentinel(markdown) && isComFallbackAvailable() && _optionalChain([options, 'optionalAccess',
|
|
54873
|
+
if (isDistributionSentinel(markdown) && isComFallbackAvailable() && _optionalChain([options, 'optionalAccess', _1376 => _1376.filePath])) {
|
|
54795
54874
|
try {
|
|
54796
54875
|
const { pages, pageCount, warnings: comWarns } = extractTextViaCom(options.filePath);
|
|
54797
54876
|
if (pages.some((p) => p && p.trim().length > 0)) {
|
|
@@ -54810,15 +54889,15 @@ async function parseHwp(buffer, options) {
|
|
|
54810
54889
|
}
|
|
54811
54890
|
}
|
|
54812
54891
|
const ocred = await withEmbeddedImageOcr(blocks, markdown, warnings, images, options);
|
|
54813
|
-
return scriptsOff({ success: true, fileType: "hwp", markdown: ocred.markdown, blocks, metadata, outline, warnings: ocred.warnings, images: _optionalChain([images, 'optionalAccess',
|
|
54892
|
+
return scriptsOff({ success: true, fileType: "hwp", markdown: ocred.markdown, blocks, metadata, outline, warnings: ocred.warnings, images: _optionalChain([images, 'optionalAccess', _1377 => _1377.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _1378 => _1378.pageCount]) }, _optionalChain([options, 'optionalAccess', _1379 => _1379.scriptTags]) === false);
|
|
54814
54893
|
} catch (err) {
|
|
54815
|
-
return { success: false, fileType: "hwp", error:
|
|
54894
|
+
return { success: false, fileType: "hwp", error: _chunkMI655NV5cjs.sanitizeError.call(void 0, err), code: _chunkMI655NV5cjs.classifyError.call(void 0, err) };
|
|
54816
54895
|
}
|
|
54817
54896
|
}
|
|
54818
54897
|
async function parsePdf(buffer, options) {
|
|
54819
54898
|
let parsePdfDocument;
|
|
54820
54899
|
try {
|
|
54821
|
-
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-
|
|
54900
|
+
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-OAXCXVQ4.cjs")));
|
|
54822
54901
|
parsePdfDocument = mod.parsePdfDocument;
|
|
54823
54902
|
} catch (e50) {
|
|
54824
54903
|
return {
|
|
@@ -54830,59 +54909,59 @@ async function parsePdf(buffer, options) {
|
|
|
54830
54909
|
}
|
|
54831
54910
|
try {
|
|
54832
54911
|
const { markdown, blocks, metadata, outline, warnings, isImageBased, pageQuality, qualitySummary, images, pages, ocrLines } = await parsePdfDocument(buffer, options);
|
|
54833
|
-
return scriptsOff({ success: true, fileType: "pdf", markdown, blocks, metadata, outline, warnings, isImageBased, pageQuality, qualitySummary, images, pages, pageCount: _optionalChain([metadata, 'optionalAccess',
|
|
54912
|
+
return scriptsOff({ success: true, fileType: "pdf", markdown, blocks, metadata, outline, warnings, isImageBased, pageQuality, qualitySummary, images, pages, pageCount: _optionalChain([metadata, 'optionalAccess', _1380 => _1380.pageCount]), ...ocrLines ? { ocrLines } : {} }, _optionalChain([options, 'optionalAccess', _1381 => _1381.scriptTags]) !== true);
|
|
54834
54913
|
} catch (err) {
|
|
54835
54914
|
const isImageBased = err instanceof Error && "isImageBased" in err ? true : void 0;
|
|
54836
|
-
return { success: false, fileType: "pdf", error:
|
|
54915
|
+
return { success: false, fileType: "pdf", error: _chunkMI655NV5cjs.sanitizeError.call(void 0, err), code: _chunkMI655NV5cjs.classifyError.call(void 0, err), isImageBased };
|
|
54837
54916
|
}
|
|
54838
54917
|
}
|
|
54839
54918
|
async function parseXlsx(buffer, options) {
|
|
54840
54919
|
try {
|
|
54841
54920
|
const { markdown, blocks, metadata, warnings } = await parseXlsxDocument(buffer, options);
|
|
54842
|
-
return { success: true, fileType: "xlsx", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess',
|
|
54921
|
+
return { success: true, fileType: "xlsx", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _1382 => _1382.pageCount]) };
|
|
54843
54922
|
} catch (err) {
|
|
54844
|
-
return { success: false, fileType: "xlsx", error:
|
|
54923
|
+
return { success: false, fileType: "xlsx", error: _chunkMI655NV5cjs.sanitizeError.call(void 0, err), code: _chunkMI655NV5cjs.classifyError.call(void 0, err) };
|
|
54845
54924
|
}
|
|
54846
54925
|
}
|
|
54847
54926
|
async function parseXls(buffer, options) {
|
|
54848
54927
|
try {
|
|
54849
54928
|
const { markdown, blocks, metadata, warnings } = await parseXlsDocument(buffer, options);
|
|
54850
|
-
return { success: true, fileType: "xls", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess',
|
|
54929
|
+
return { success: true, fileType: "xls", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _1383 => _1383.pageCount]) };
|
|
54851
54930
|
} catch (err) {
|
|
54852
|
-
return { success: false, fileType: "xls", error:
|
|
54931
|
+
return { success: false, fileType: "xls", error: _chunkMI655NV5cjs.sanitizeError.call(void 0, err), code: _chunkMI655NV5cjs.classifyError.call(void 0, err) };
|
|
54853
54932
|
}
|
|
54854
54933
|
}
|
|
54855
54934
|
async function parseDocx(buffer, options) {
|
|
54856
54935
|
try {
|
|
54857
54936
|
const { markdown, blocks, metadata, outline, warnings, images } = await parseDocxDocument(buffer, options);
|
|
54858
|
-
return scriptsOff({ success: true, fileType: "docx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess',
|
|
54937
|
+
return scriptsOff({ success: true, fileType: "docx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _1384 => _1384.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _1385 => _1385.pageCount]) }, _optionalChain([options, 'optionalAccess', _1386 => _1386.scriptTags]) === false);
|
|
54859
54938
|
} catch (err) {
|
|
54860
|
-
return { success: false, fileType: "docx", error:
|
|
54939
|
+
return { success: false, fileType: "docx", error: _chunkMI655NV5cjs.sanitizeError.call(void 0, err), code: _chunkMI655NV5cjs.classifyError.call(void 0, err) };
|
|
54861
54940
|
}
|
|
54862
54941
|
}
|
|
54863
54942
|
async function parsePptx(buffer, options) {
|
|
54864
54943
|
try {
|
|
54865
54944
|
const { markdown, blocks, metadata, outline, warnings, images } = await parsePptxDocument(buffer, options);
|
|
54866
|
-
return scriptsOff({ success: true, fileType: "pptx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess',
|
|
54945
|
+
return scriptsOff({ success: true, fileType: "pptx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _1387 => _1387.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _1388 => _1388.pageCount]) }, _optionalChain([options, 'optionalAccess', _1389 => _1389.scriptTags]) === false);
|
|
54867
54946
|
} catch (err) {
|
|
54868
|
-
return { success: false, fileType: "pptx", error:
|
|
54947
|
+
return { success: false, fileType: "pptx", error: _chunkMI655NV5cjs.sanitizeError.call(void 0, err), code: _chunkMI655NV5cjs.classifyError.call(void 0, err) };
|
|
54869
54948
|
}
|
|
54870
54949
|
}
|
|
54871
54950
|
async function parseHwpml(buffer, options) {
|
|
54872
54951
|
try {
|
|
54873
54952
|
const { markdown, blocks, metadata, outline, warnings } = parseHwpmlDocument(buffer, options);
|
|
54874
|
-
return { success: true, fileType: "hwpml", markdown, blocks, metadata, outline, warnings, pageCount: _optionalChain([metadata, 'optionalAccess',
|
|
54953
|
+
return { success: true, fileType: "hwpml", markdown, blocks, metadata, outline, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _1390 => _1390.pageCount]) };
|
|
54875
54954
|
} catch (err) {
|
|
54876
|
-
return { success: false, fileType: "hwpml", error:
|
|
54955
|
+
return { success: false, fileType: "hwpml", error: _chunkMI655NV5cjs.sanitizeError.call(void 0, err), code: _chunkMI655NV5cjs.classifyError.call(void 0, err) };
|
|
54877
54956
|
}
|
|
54878
54957
|
}
|
|
54879
54958
|
async function fillForm(input, values, outputFormat = "markdown") {
|
|
54880
54959
|
let buffer;
|
|
54881
54960
|
if (typeof input === "string") {
|
|
54882
54961
|
const buf = await _promises.readFile.call(void 0, input);
|
|
54883
|
-
buffer =
|
|
54962
|
+
buffer = _chunkMI655NV5cjs.toArrayBuffer.call(void 0, buf);
|
|
54884
54963
|
} else if (Buffer.isBuffer(input)) {
|
|
54885
|
-
buffer =
|
|
54964
|
+
buffer = _chunkMI655NV5cjs.toArrayBuffer.call(void 0, input);
|
|
54886
54965
|
} else {
|
|
54887
54966
|
buffer = input;
|
|
54888
54967
|
}
|
|
@@ -54908,7 +54987,7 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
54908
54987
|
throw new Error(`\uC11C\uC2DD \uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}`);
|
|
54909
54988
|
}
|
|
54910
54989
|
const fill = fillFormFields(parsed.blocks, values);
|
|
54911
|
-
const markdown =
|
|
54990
|
+
const markdown = _chunkSJ5OZXELcjs.blocksToMarkdown.call(void 0, fill.blocks);
|
|
54912
54991
|
if (outputFormat === "hwpx") {
|
|
54913
54992
|
const hwpxBuffer = await markdownToHwpx(markdown);
|
|
54914
54993
|
return { output: hwpxBuffer, format: "hwpx", fill };
|
|
@@ -55007,5 +55086,5 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
55007
55086
|
|
|
55008
55087
|
|
|
55009
55088
|
|
|
55010
|
-
exports.AGENCY_COMMON_NAME = AGENCY_COMMON_NAME; exports.BUILTIN_TEMPLATES = BUILTIN_TEMPLATES; exports.DEFAULT_REDACT_RULES = DEFAULT_REDACT_RULES; exports.HwpxSession = HwpxSession; exports.PRESET_ALIAS = PRESET_ALIAS; exports.SPACE_EM_FIXED = SPACE_EM_FIXED; exports.SPACE_EM_FONT = SPACE_EM_FONT; exports.VERSION =
|
|
55089
|
+
exports.AGENCY_COMMON_NAME = AGENCY_COMMON_NAME; exports.BUILTIN_TEMPLATES = BUILTIN_TEMPLATES; exports.DEFAULT_REDACT_RULES = DEFAULT_REDACT_RULES; exports.HwpxSession = HwpxSession; exports.PRESET_ALIAS = PRESET_ALIAS; exports.SPACE_EM_FIXED = SPACE_EM_FIXED; exports.SPACE_EM_FONT = SPACE_EM_FONT; exports.VERSION = _chunkMI655NV5cjs.VERSION; exports.ValueCursor = ValueCursor; exports.agencyNames = agencyNames; exports.agencyStyle = agencyStyle; exports.applySplices = applySplices; exports.blocksToChunks = blocksToChunks; exports.blocksToMarkdown = _chunkSJ5OZXELcjs.blocksToMarkdown; exports.blocksToPages = _chunk2BCQVQO2cjs.blocksToPages; exports.blocksToPdf = blocksToPdf; exports.buildParagraphSplices = buildParagraphSplices; exports.buildRangeSplices = buildRangeSplices; exports.charWidthEm1000 = charWidthEm1000; exports.chooseTableRepresentation = chooseTableRepresentation; exports.classifyTable = classifyTable; exports.classifyTableTree = classifyTableTree; exports.collectTableBlocks = collectTableBlocks; exports.compare = compare; exports.detectFormat = detectFormat; exports.detectOle2Format = detectOle2Format; exports.detectZipFormat = detectZipFormat; exports.diffBlocks = diffBlocks; exports.extractClickHereFields = extractClickHereFields; exports.extractFormFields = extractFormFields; exports.extractFormSchema = extractFormSchema; exports.extractRenderedRegions = extractRenderedRegions; exports.extractTables = extractTables; exports.fillForm = fillForm; exports.fillFormFields = fillFormFields; exports.fillHwpx = fillHwpx; exports.fillWithUniqueGuard = fillWithUniqueGuard; exports.fitRatioForFewerLines = fitRatioForFewerLines; exports.flattenLayoutTables = _chunkSJ5OZXELcjs.flattenLayoutTables; exports.formatFillValue = formatFillValue; exports.gongmunLintWarnings = gongmunLintWarnings; exports.hasStructuredCellContent = _chunkSJ5OZXELcjs.hasStructuredCellContent; exports.hwpxToProfile = hwpxToProfile; exports.incompatibleGongmunWarnings = incompatibleGongmunWarnings; exports.inferFieldType = inferFieldType; exports.isHwpxFile = isHwpxFile; exports.isKnownFont = isKnownFont; exports.isLabelCell = isLabelCell; exports.isOldHwpFile = isOldHwpFile; exports.isPdfFile = isPdfFile; exports.isZipFile = isZipFile; exports.lintGongmunText = lintGongmunText; exports.lintMuncheText = lintMuncheText; exports.markdownToHwpx = markdownToHwpx; exports.markdownToPdf = markdownToPdf; exports.measureTextWidth = measureTextWidth; exports.muncheLintWarnings = muncheLintWarnings; exports.normalizeGongmunPreset = normalizeGongmunPreset; exports.openHwpxDocument = openHwpxDocument; exports.parse = parse; exports.parseDocx = parseDocx; exports.parseHwp = parseHwp; exports.parseHwp3 = parseHwp3; exports.parseHwpml = parseHwpml; exports.parseHwpx = parseHwpx; exports.parseImage = parseImage; exports.parsePdf = parsePdf; exports.parsePptx = parsePptx; exports.parseXls = parseXls; exports.parseXlsx = parseXlsx; exports.patchHwp = patchHwp; exports.patchHwpx = patchHwpx; exports.patchHwpxBlocks = patchHwpxBlocks; exports.placeSealHwpx = placeSealHwpx; exports.readBuiltinTemplate = readBuiltinTemplate; exports.readBuiltinTemplateSample = readBuiltinTemplateSample; exports.redactMarkdown = redactMarkdown; exports.redactText = redactText; exports.renderDocument = renderDocument; exports.renderDocumentToScene = renderDocumentToScene; exports.renderHtml = renderHtml; exports.renderHwp5Pages = renderHwp5Pages; exports.renderHwpxToSvg = renderHwpxToSvg; exports.renderSceneToHtml = renderSceneToHtml; exports.resolveBuiltinTemplate = resolveBuiltinTemplate; exports.scanSectionXml = scanSectionXml; exports.simulateWrap = simulateWrap; exports.simulateWrapKeepWord = simulateWrapKeepWord; exports.unknownFontWarnings = unknownFontWarnings; exports.usesGaejosikMunche = usesGaejosikMunche; exports.validateHwpx = validateHwpx;
|
|
55011
55090
|
//# sourceMappingURL=index.cjs.map
|