kordoc 4.24.2 → 4.24.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 -10
- package/dist/{-SRNEV7LS.js → -Q56U3KCA.js} +11 -11
- package/dist/{chunk-E7B5CXYI.js → chunk-33NZN73M.js} +2 -2
- package/dist/{chunk-NJ5RUDCW.js → chunk-3EWXRIPH.js} +3 -3
- package/dist/{chunk-NMFFIUI6.js → chunk-42FSKT7R.js} +2 -2
- package/dist/{chunk-M46PB75E.js → chunk-4X73CGIL.js} +2 -2
- package/dist/{chunk-PNSALBXH.cjs → chunk-6ZRZLV3J.cjs} +2 -2
- package/dist/{chunk-PNSALBXH.cjs.map → chunk-6ZRZLV3J.cjs.map} +1 -1
- package/dist/{chunk-W24TJJNN.js → chunk-AEEQN6L3.js} +2 -2
- package/dist/{chunk-TW3V6FSH.js → chunk-EEXIFCXC.js} +2 -2
- package/dist/{chunk-LMEF7FN5.js → chunk-EWCJCWTT.js} +2 -2
- package/dist/{chunk-MHNJOJQV.js → chunk-FZT34MUI.js} +4 -4
- package/dist/{chunk-WDSTW3BD.js → chunk-HNX2I7D6.js} +2 -2
- package/dist/{chunk-PNX5FYHC.cjs → chunk-HTG3VVET.cjs} +24 -24
- package/dist/{chunk-PNX5FYHC.cjs.map → chunk-HTG3VVET.cjs.map} +1 -1
- package/dist/{chunk-KUC5I5MB.js → chunk-HU7POUBS.js} +2 -2
- package/dist/{chunk-WJAFE3Z6.js → chunk-I2QETSZN.js} +2 -2
- package/dist/{chunk-DHMBPMKC.js → chunk-J45OVEUM.js} +139 -15
- package/dist/chunk-J45OVEUM.js.map +1 -0
- package/dist/{chunk-UNICY546.cjs → chunk-JILIA5EV.cjs} +23 -23
- package/dist/{chunk-UNICY546.cjs.map → chunk-JILIA5EV.cjs.map} +1 -1
- package/dist/{chunk-TDMBTG7U.js → chunk-KXHNIHLC.js} +2 -2
- package/dist/{chunk-JFUUFJZW.cjs → chunk-N65EY5BI.cjs} +6 -6
- package/dist/{chunk-JFUUFJZW.cjs.map → chunk-N65EY5BI.cjs.map} +1 -1
- package/dist/{chunk-4XC4O7FJ.js → chunk-NKDPCALC.js} +4 -4
- package/dist/{chunk-C6ZVB547.js → chunk-OAOM7IEI.js} +11 -11
- package/dist/{chunk-4745MFQU.js → chunk-PHZDAHZC.js} +3 -3
- package/dist/{chunk-RIRPLFPN.js → chunk-PMX5CPK5.js} +2 -2
- package/dist/{chunk-E6VBLBOO.js → chunk-Q2QKRE4P.js} +2 -2
- package/dist/{chunk-7NTMM6PO.js → chunk-TZ753B6A.js} +2 -2
- package/dist/{chunk-HLTPMSYW.cjs → chunk-VFEI2GIE.cjs} +3 -3
- package/dist/{chunk-HLTPMSYW.cjs.map → chunk-VFEI2GIE.cjs.map} +1 -1
- package/dist/{chunk-3HN65YAL.js → chunk-W6O7KBOD.js} +2 -2
- package/dist/{chunk-VPSF5LEM.js → chunk-XAZ5RGVG.js} +3 -3
- package/dist/{chunk-R2GIGE5H.js → chunk-XNNMMYFO.js} +2 -2
- package/dist/{chunk-JMOAMKAR.js → chunk-XZOAE2Q7.js} +4 -4
- package/dist/{chunk-IGG63DFK.cjs → chunk-YG4YOPK6.cjs} +3 -3
- package/dist/{chunk-IGG63DFK.cjs.map → chunk-YG4YOPK6.cjs.map} +1 -1
- package/dist/chunks-REYSCBPB.js +10 -0
- package/dist/cli.js +30 -30
- package/dist/{formula-HK2MNZ3Q.cjs → formula-2BPHF6O7.cjs} +9 -9
- package/dist/{formula-HK2MNZ3Q.cjs.map → formula-2BPHF6O7.cjs.map} +1 -1
- package/dist/{formula-DSB574H7.js → formula-EA5GDCUD.js} +4 -4
- package/dist/{formula-U2LZ67KI.js → formula-IREEAC4T.js} +3 -3
- package/dist/{image-ocr-QNIMVE5A.cjs → image-ocr-CCTE7HX3.cjs} +17 -17
- package/dist/{image-ocr-QNIMVE5A.cjs.map → image-ocr-CCTE7HX3.cjs.map} +1 -1
- package/dist/{image-ocr-J54Q3YWP.js → image-ocr-JQJC5HWK.js} +6 -6
- package/dist/{image-ocr-3QB2HLSI.js → image-ocr-LGOFUS3O.js} +9 -9
- package/dist/index.cjs +517 -393
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +139 -15
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +23 -23
- package/dist/{model-bundle-CGWU4ALC.js → model-bundle-YW62Y6UD.js} +5 -5
- package/dist/{models-A3TF3BDV.js → models-AAL3IS2R.js} +5 -5
- package/dist/{parse-worker-v2-MNUD4WAR.js → parse-worker-v2-3JAHV7NY.js} +12 -12
- package/dist/{parser-C3ARF26I.js → parser-4FCKKJ2N.js} +18 -14
- package/dist/parser-4FCKKJ2N.js.map +1 -0
- package/dist/{parser-RPAHN3OR.cjs → parser-HE45CCSG.cjs} +163 -159
- package/dist/parser-HE45CCSG.cjs.map +1 -0
- package/dist/{parser-OBGWEWSU.js → parser-ZBP5GOQK.js} +15 -11
- package/dist/parser-ZBP5GOQK.js.map +1 -0
- package/dist/pdf-ocr-7MDCLWAA.cjs +31 -0
- package/dist/{pdf-ocr-GA5QJFNK.cjs.map → pdf-ocr-7MDCLWAA.cjs.map} +1 -1
- package/dist/{pdf-ocr-K53REDNY.js → pdf-ocr-HFAEOA7W.js} +6 -6
- package/dist/{pdf-ocr-ENLVEEYL.js → pdf-ocr-Q4TPGDDI.js} +9 -9
- package/dist/{profile-io-ZGFEO7CB.js → profile-io-EDQTKLLL.js} +3 -3
- package/dist/{rasterize-QMC2SAUT.js → rasterize-VD2XGHUJ.js} +3 -3
- package/dist/{redact-doc-JH6RZZBE.js → redact-doc-TBIBQJCT.js} +11 -11
- package/dist/{render-ZGKQLKPJ.js → render-J5KAZAQH.js} +7 -7
- package/dist/seal-H2JNAZU7.js +10 -0
- package/dist/{setup-LAQGCYQ2.js → setup-5LYHCQRU.js} +3 -3
- package/dist/visual-7EO6GR3M.js +21 -0
- package/dist/{watch-7YPB4TKC.js → watch-YP4IWM75.js} +12 -12
- package/package.json +1 -1
- package/dist/chunk-DHMBPMKC.js.map +0 -1
- package/dist/chunks-AL4P5TO5.js +0 -10
- package/dist/parser-C3ARF26I.js.map +0 -1
- package/dist/parser-OBGWEWSU.js.map +0 -1
- package/dist/parser-RPAHN3OR.cjs.map +0 -1
- package/dist/pdf-ocr-GA5QJFNK.cjs +0 -31
- package/dist/seal-KMGYTJAV.js +0 -10
- package/dist/visual-4OYJFGXL.js +0 -21
- /package/dist/{-SRNEV7LS.js.map → -Q56U3KCA.js.map} +0 -0
- /package/dist/{chunk-E7B5CXYI.js.map → chunk-33NZN73M.js.map} +0 -0
- /package/dist/{chunk-NJ5RUDCW.js.map → chunk-3EWXRIPH.js.map} +0 -0
- /package/dist/{chunk-NMFFIUI6.js.map → chunk-42FSKT7R.js.map} +0 -0
- /package/dist/{chunk-M46PB75E.js.map → chunk-4X73CGIL.js.map} +0 -0
- /package/dist/{chunk-W24TJJNN.js.map → chunk-AEEQN6L3.js.map} +0 -0
- /package/dist/{chunk-TW3V6FSH.js.map → chunk-EEXIFCXC.js.map} +0 -0
- /package/dist/{chunk-LMEF7FN5.js.map → chunk-EWCJCWTT.js.map} +0 -0
- /package/dist/{chunk-MHNJOJQV.js.map → chunk-FZT34MUI.js.map} +0 -0
- /package/dist/{chunk-WDSTW3BD.js.map → chunk-HNX2I7D6.js.map} +0 -0
- /package/dist/{chunk-KUC5I5MB.js.map → chunk-HU7POUBS.js.map} +0 -0
- /package/dist/{chunk-WJAFE3Z6.js.map → chunk-I2QETSZN.js.map} +0 -0
- /package/dist/{chunk-TDMBTG7U.js.map → chunk-KXHNIHLC.js.map} +0 -0
- /package/dist/{chunk-4XC4O7FJ.js.map → chunk-NKDPCALC.js.map} +0 -0
- /package/dist/{chunk-C6ZVB547.js.map → chunk-OAOM7IEI.js.map} +0 -0
- /package/dist/{chunk-4745MFQU.js.map → chunk-PHZDAHZC.js.map} +0 -0
- /package/dist/{chunk-RIRPLFPN.js.map → chunk-PMX5CPK5.js.map} +0 -0
- /package/dist/{chunk-E6VBLBOO.js.map → chunk-Q2QKRE4P.js.map} +0 -0
- /package/dist/{chunk-7NTMM6PO.js.map → chunk-TZ753B6A.js.map} +0 -0
- /package/dist/{chunk-3HN65YAL.js.map → chunk-W6O7KBOD.js.map} +0 -0
- /package/dist/{chunk-VPSF5LEM.js.map → chunk-XAZ5RGVG.js.map} +0 -0
- /package/dist/{chunk-R2GIGE5H.js.map → chunk-XNNMMYFO.js.map} +0 -0
- /package/dist/{chunk-JMOAMKAR.js.map → chunk-XZOAE2Q7.js.map} +0 -0
- /package/dist/{chunks-AL4P5TO5.js.map → chunks-REYSCBPB.js.map} +0 -0
- /package/dist/{formula-DSB574H7.js.map → formula-EA5GDCUD.js.map} +0 -0
- /package/dist/{formula-U2LZ67KI.js.map → formula-IREEAC4T.js.map} +0 -0
- /package/dist/{image-ocr-J54Q3YWP.js.map → image-ocr-JQJC5HWK.js.map} +0 -0
- /package/dist/{image-ocr-3QB2HLSI.js.map → image-ocr-LGOFUS3O.js.map} +0 -0
- /package/dist/{model-bundle-CGWU4ALC.js.map → model-bundle-YW62Y6UD.js.map} +0 -0
- /package/dist/{models-A3TF3BDV.js.map → models-AAL3IS2R.js.map} +0 -0
- /package/dist/{parse-worker-v2-MNUD4WAR.js.map → parse-worker-v2-3JAHV7NY.js.map} +0 -0
- /package/dist/{pdf-ocr-ENLVEEYL.js.map → pdf-ocr-HFAEOA7W.js.map} +0 -0
- /package/dist/{pdf-ocr-K53REDNY.js.map → pdf-ocr-Q4TPGDDI.js.map} +0 -0
- /package/dist/{profile-io-ZGFEO7CB.js.map → profile-io-EDQTKLLL.js.map} +0 -0
- /package/dist/{rasterize-QMC2SAUT.js.map → rasterize-VD2XGHUJ.js.map} +0 -0
- /package/dist/{redact-doc-JH6RZZBE.js.map → redact-doc-TBIBQJCT.js.map} +0 -0
- /package/dist/{render-ZGKQLKPJ.js.map → render-J5KAZAQH.js.map} +0 -0
- /package/dist/{seal-KMGYTJAV.js.map → seal-H2JNAZU7.js.map} +0 -0
- /package/dist/{setup-LAQGCYQ2.js.map → setup-5LYHCQRU.js.map} +0 -0
- /package/dist/{visual-4OYJFGXL.js.map → visual-7EO6GR3M.js.map} +0 -0
- /package/dist/{watch-7YPB4TKC.js.map → watch-YP4IWM75.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkYG4YOPK6cjs = require('./chunk-YG4YOPK6.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
var _chunkJ55UQC5Hcjs = require('./chunk-J55UQC5H.cjs');
|
|
@@ -43,7 +43,7 @@ var _chunkJ55UQC5Hcjs = require('./chunk-J55UQC5H.cjs');
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
|
-
var
|
|
46
|
+
var _chunkN65EY5BIcjs = require('./chunk-N65EY5BI.cjs');
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
@@ -61,14 +61,14 @@ var _chunkJFUUFJZWcjs = require('./chunk-JFUUFJZW.cjs');
|
|
|
61
61
|
|
|
62
62
|
|
|
63
63
|
|
|
64
|
-
var
|
|
64
|
+
var _chunk6ZRZLV3Jcjs = require('./chunk-6ZRZLV3J.cjs');
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
var _chunkGS7T56RPcjs = require('./chunk-GS7T56RP.cjs');
|
|
68
68
|
|
|
69
69
|
// src/plain-markdown.ts
|
|
70
70
|
function toPlainMarkdown(md2) {
|
|
71
|
-
return
|
|
71
|
+
return _chunkN65EY5BIcjs.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();
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// src/html-tables.ts
|
|
@@ -602,9 +602,9 @@ function rawTextContent(node, depth = 0) {
|
|
|
602
602
|
}
|
|
603
603
|
|
|
604
604
|
// src/hwpx/parser-shared.ts
|
|
605
|
-
var MAX_DECOMPRESS_SIZE =
|
|
605
|
+
var MAX_DECOMPRESS_SIZE = _chunk6ZRZLV3Jcjs.unzipLimitBytes.call(void 0, 256 * 1024 * 1024);
|
|
606
606
|
var MAX_ZIP_ENTRIES = 500;
|
|
607
|
-
var ZipBombError = class extends
|
|
607
|
+
var ZipBombError = class extends _chunk6ZRZLV3Jcjs.KordocError {
|
|
608
608
|
constructor(message) {
|
|
609
609
|
super(message);
|
|
610
610
|
this.name = "ZipBombError";
|
|
@@ -654,7 +654,7 @@ function createSectionShared() {
|
|
|
654
654
|
function createXmlParser(warnings) {
|
|
655
655
|
return new (0, _xmldom.DOMParser)({
|
|
656
656
|
onError(level, msg2) {
|
|
657
|
-
if (level === "fatalError") throw new (0,
|
|
657
|
+
if (level === "fatalError") throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`XML \uD30C\uC2F1 \uC2E4\uD328: ${msg2}`);
|
|
658
658
|
_optionalChain([warnings, 'optionalAccess', _5 => _5.push, 'call', _6 => _6({ code: "MALFORMED_XML", message: `XML ${level === "warning" ? "\uACBD\uACE0" : "\uC624\uB958"}: ${msg2}` })]);
|
|
659
659
|
}
|
|
660
660
|
});
|
|
@@ -689,13 +689,13 @@ function parseEncryptionManifest(manifestXml) {
|
|
|
689
689
|
const startKey = attrOf(inner, "start-key-generation-name");
|
|
690
690
|
const checksumType = attrOf(inner, "checksum-type");
|
|
691
691
|
if (algorithm !== AES256_CBC) {
|
|
692
|
-
throw new (0,
|
|
692
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWPX \uC554\uD638\uD654 \uBC29\uC2DD\uC785\uB2C8\uB2E4: ${_nullishCoalesce(algorithm, () => ( "(\uBBF8\uC0C1)"))}`);
|
|
693
693
|
}
|
|
694
694
|
if (startKey !== START_KEY_SHA256) {
|
|
695
|
-
throw new (0,
|
|
695
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWPX \uC2DC\uC791\uD0A4 \uC0DD\uC131 \uBC29\uC2DD\uC785\uB2C8\uB2E4: ${_nullishCoalesce(startKey, () => ( "(\uBBF8\uC0C1)"))}`);
|
|
696
696
|
}
|
|
697
697
|
if (!_optionalChain([checksumType, 'optionalAccess', _10 => _10.endsWith, 'call', _11 => _11(CHECKSUM_SHA256_1K)])) {
|
|
698
|
-
throw new (0,
|
|
698
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWPX \uCCB4\uD06C\uC12C \uBC29\uC2DD\uC785\uB2C8\uB2E4: ${_nullishCoalesce(checksumType, () => ( "(\uBBF8\uC0C1)"))}`);
|
|
699
699
|
}
|
|
700
700
|
const iterations = parseInt(_nullishCoalesce(attrOf(inner, "iteration-count"), () => ( "")), 10);
|
|
701
701
|
const keySize = parseInt(_nullishCoalesce(attrOf(inner, "key-size"), () => ( "")), 10);
|
|
@@ -703,10 +703,10 @@ function parseEncryptionManifest(manifestXml) {
|
|
|
703
703
|
const salt = Buffer.from(_nullishCoalesce(attrOf(inner, "salt"), () => ( "")), "base64");
|
|
704
704
|
const checksum = Buffer.from(_nullishCoalesce(attrOf(inner, "checksum"), () => ( "")), "base64");
|
|
705
705
|
if (!(iterations > 0 && iterations <= MAX_ITERATION_COUNT)) {
|
|
706
|
-
throw new (0,
|
|
706
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`HWPX \uC554\uD638\uD654 \uBC18\uBCF5 \uD69F\uC218\uAC00 \uD5C8\uC6A9 \uBC94\uC704\uB97C \uBC97\uC5B4\uB0AC\uC2B5\uB2C8\uB2E4: ${iterations}`);
|
|
707
707
|
}
|
|
708
708
|
if (keySize !== 32 || iv.length !== 16 || salt.length === 0 || checksum.length !== 32) {
|
|
709
|
-
throw new (0,
|
|
709
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`HWPX \uC554\uD638\uD654 \uD30C\uB77C\uBBF8\uD130\uAC00 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 (${path})`);
|
|
710
710
|
}
|
|
711
711
|
entries.push({ path, checksum, iv, salt, iterations, keySize });
|
|
712
712
|
}
|
|
@@ -740,12 +740,12 @@ async function decryptHwpxInPlace(zip, manifestXml, password) {
|
|
|
740
740
|
for (const entry of entries) {
|
|
741
741
|
const file = zip.file(entry.path);
|
|
742
742
|
if (!file) {
|
|
743
|
-
throw new (0,
|
|
743
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uC554\uD638 \uBAA9\uB85D\uC5D0 \uC788\uB294 \uD30C\uC77C\uC774 \uBB38\uC11C\uC5D0 \uC5C6\uC2B5\uB2C8\uB2E4: ${entry.path}`);
|
|
744
744
|
}
|
|
745
745
|
const raw = await readZipEntry(file, "uint8array", used);
|
|
746
746
|
const plain4 = decryptEntry(Buffer.from(raw.buffer, raw.byteOffset, raw.length), entry, startKey);
|
|
747
747
|
if (!plain4) {
|
|
748
|
-
throw new (0,
|
|
748
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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.");
|
|
749
749
|
}
|
|
750
750
|
used += plain4.length;
|
|
751
751
|
if (used > MAX_DECOMPRESS_SIZE) throw new ZipBombError("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
@@ -811,10 +811,10 @@ async function extractHwpxStyles(zip, decompressed) {
|
|
|
811
811
|
const xml = await readZipEntry(file, "text", _optionalChain([decompressed, 'optionalAccess', _12 => _12.total]));
|
|
812
812
|
if (decompressed) {
|
|
813
813
|
decompressed.total += xml.length * 2;
|
|
814
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
814
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
815
815
|
}
|
|
816
816
|
const parser = createXmlParser();
|
|
817
|
-
const doc = parser.parseFromString(
|
|
817
|
+
const doc = parser.parseFromString(_chunk6ZRZLV3Jcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
818
818
|
if (!doc.documentElement) continue;
|
|
819
819
|
const domDoc = doc;
|
|
820
820
|
parseCharProperties(domDoc, result.charProperties);
|
|
@@ -1027,9 +1027,9 @@ function detectHwpxHeadings(blocks, styleMap, tocTexts) {
|
|
|
1027
1027
|
let level = 0;
|
|
1028
1028
|
if (baseFontSize > 0 && _optionalChain([block, 'access', _21 => _21.style, 'optionalAccess', _22 => _22.fontSize])) {
|
|
1029
1029
|
const ratio = block.style.fontSize / baseFontSize;
|
|
1030
|
-
if (ratio >=
|
|
1031
|
-
else if (ratio >=
|
|
1032
|
-
else if (ratio >=
|
|
1030
|
+
if (ratio >= _chunkN65EY5BIcjs.HEADING_RATIO_H1) level = 1;
|
|
1031
|
+
else if (ratio >= _chunkN65EY5BIcjs.HEADING_RATIO_H2) level = 2;
|
|
1032
|
+
else if (ratio >= _chunkN65EY5BIcjs.HEADING_RATIO_H3) level = 3;
|
|
1033
1033
|
}
|
|
1034
1034
|
const compactText = text.replace(/\s+/g, "");
|
|
1035
1035
|
if (/^제\d+[조장절편]/.test(compactText) && text.length <= 50) {
|
|
@@ -1643,11 +1643,11 @@ function formatHeadNumber(n, numFormat) {
|
|
|
1643
1643
|
// 서수 시퀀스는 생성기(gongmun.ts)와 단일 소스 (v4.0.5) — 종전 mod-14 순환은
|
|
1644
1644
|
// 15번째 형제를 다시 '가'로 만들어 한글 실렌더(가→하→거→너 단모음 연속)와 어긋났다
|
|
1645
1645
|
case "CIRCLED_DIGIT":
|
|
1646
|
-
return n <= 50 ?
|
|
1646
|
+
return n <= 50 ? _chunkN65EY5BIcjs.circledNumber.call(void 0, n - 1) : `(${n})`;
|
|
1647
1647
|
case "HANGUL_SYLLABLE":
|
|
1648
|
-
return
|
|
1648
|
+
return _chunkN65EY5BIcjs.hangulOrdinal.call(void 0, n - 1);
|
|
1649
1649
|
case "CIRCLED_HANGUL_SYLLABLE":
|
|
1650
|
-
return n <= 14 ?
|
|
1650
|
+
return n <= 14 ? _chunkN65EY5BIcjs.circledHangul.call(void 0, n - 1) : _chunkN65EY5BIcjs.hangulOrdinal.call(void 0, n - 1);
|
|
1651
1651
|
case "HANGUL_JAMO":
|
|
1652
1652
|
return HANGUL_JAMO_SEQ[(n - 1) % HANGUL_JAMO_SEQ.length];
|
|
1653
1653
|
case "CIRCLED_HANGUL_JAMO":
|
|
@@ -1661,9 +1661,9 @@ function formatHeadNumber(n, numFormat) {
|
|
|
1661
1661
|
case "CIRCLED_LATIN_SMALL":
|
|
1662
1662
|
return n <= 26 ? String.fromCodePoint(9424 + n - 1) : String.fromCharCode(97 + (n - 1) % 26);
|
|
1663
1663
|
case "ROMAN_CAPITAL":
|
|
1664
|
-
return
|
|
1664
|
+
return _chunkN65EY5BIcjs.romanNumeral.call(void 0, n, true);
|
|
1665
1665
|
case "ROMAN_SMALL":
|
|
1666
|
-
return
|
|
1666
|
+
return _chunkN65EY5BIcjs.romanNumeral.call(void 0, n, false);
|
|
1667
1667
|
default:
|
|
1668
1668
|
return String(n);
|
|
1669
1669
|
}
|
|
@@ -1711,7 +1711,7 @@ function resolveParaHeading(paraEl, ctx) {
|
|
|
1711
1711
|
|
|
1712
1712
|
// src/hwpx/table-build.ts
|
|
1713
1713
|
function buildTableWithCellMeta(state, keepAnchoredEmptyCols, keepEmptyParagraphs) {
|
|
1714
|
-
const table2 =
|
|
1714
|
+
const table2 = _chunkN65EY5BIcjs.buildTable.call(void 0, state.rows, { keepAnchoredEmptyCols, keepEmptyParagraphs });
|
|
1715
1715
|
if (state.caption) table2.caption = state.caption;
|
|
1716
1716
|
if (state.sourceId) table2.sourceId = state.sourceId;
|
|
1717
1717
|
if (_optionalChain([state, 'access', _32 => _32.captionBlocks, 'optionalAccess', _33 => _33.length])) table2.captionBlocks = state.captionBlocks;
|
|
@@ -1740,7 +1740,7 @@ function buildTableWithCellMeta(state, keepAnchoredEmptyCols, keepEmptyParagraph
|
|
|
1740
1740
|
for (const src of row) {
|
|
1741
1741
|
if (!src.edges || src.rowAddr === void 0 || src.colAddr === void 0) continue;
|
|
1742
1742
|
const cand = _optionalChain([table2, 'access', _37 => _37.cells, 'access', _38 => _38[src.rowAddr], 'optionalAccess', _39 => _39[src.colAddr]]);
|
|
1743
|
-
if (cand && anchors2.includes(cand))
|
|
1743
|
+
if (cand && anchors2.includes(cand)) _chunkN65EY5BIcjs.CELL_EDGES.set(cand, src.edges);
|
|
1744
1744
|
}
|
|
1745
1745
|
}
|
|
1746
1746
|
const claimed = /* @__PURE__ */ new Set();
|
|
@@ -1790,7 +1790,7 @@ function completeTable(newTable, tableStack, blocks, ctx) {
|
|
|
1790
1790
|
const cell2 = parentTable.cell;
|
|
1791
1791
|
(cell2.blocks ??= []).push(block);
|
|
1792
1792
|
cell2.hasStructure = true;
|
|
1793
|
-
let flat =
|
|
1793
|
+
let flat = _chunkN65EY5BIcjs.convertTableToText.call(void 0, newTable.rows);
|
|
1794
1794
|
if (newTable.caption) flat = newTable.caption + (flat ? "\n" + flat : "");
|
|
1795
1795
|
if (flat) {
|
|
1796
1796
|
const inlineJoin = newTable.inline === true && cell2.lineOpen === true;
|
|
@@ -2024,7 +2024,7 @@ function extractRunSpans(para2, ctx, mode, requireMixed) {
|
|
|
2024
2024
|
const tkids = rc.childNodes;
|
|
2025
2025
|
for (let k = 0; k < (_nullishCoalesce(_optionalChain([tkids, 'optionalAccess', _47 => _47.length]), () => ( 0))); k++) {
|
|
2026
2026
|
const tk = tkids[k];
|
|
2027
|
-
if (tk.nodeType === 3 || tk.nodeType === 4) text +=
|
|
2027
|
+
if (tk.nodeType === 3 || tk.nodeType === 4) text += _chunkN65EY5BIcjs.escapeLiteralTags.call(void 0, _chunkN65EY5BIcjs.escapeLiteralDollar.call(void 0, tk.textContent || ""));
|
|
2028
2028
|
else if (tk.nodeType === 1) {
|
|
2029
2029
|
const ttag = (tk.tagName || tk.localName || "").replace(/^[^:]+:/, "");
|
|
2030
2030
|
if (ttag === "tab" || ttag === "fwSpace" || ttag === "hwSpace" || ttag === "nbSpace") text += " ";
|
|
@@ -2044,7 +2044,7 @@ function extractRunSpans(para2, ctx, mode, requireMixed) {
|
|
|
2044
2044
|
const span2 = { text };
|
|
2045
2045
|
if (mode !== "foreign" && prId === KORDOC_CHAR_CODE) span2.code = true;
|
|
2046
2046
|
else {
|
|
2047
|
-
if (_optionalChain([cp, 'optionalAccess', _48 => _48.script])) span2.text =
|
|
2047
|
+
if (_optionalChain([cp, 'optionalAccess', _48 => _48.script])) span2.text = _chunkN65EY5BIcjs.wrapScript.call(void 0, text, cp.script);
|
|
2048
2048
|
if (_optionalChain([cp, 'optionalAccess', _49 => _49.bold])) span2.bold = true;
|
|
2049
2049
|
if (_optionalChain([cp, 'optionalAccess', _50 => _50.italic])) span2.italic = true;
|
|
2050
2050
|
if (_optionalChain([cp, 'optionalAccess', _51 => _51.strike])) span2.strike = true;
|
|
@@ -2064,7 +2064,7 @@ function extractRunSpans(para2, ctx, mode, requireMixed) {
|
|
|
2064
2064
|
}
|
|
2065
2065
|
}
|
|
2066
2066
|
if (requireMixed && !merged.some((s) => s.strike || s.underline) && !merged.some((s) => !(s.bold || s.italic || s.code))) return null;
|
|
2067
|
-
for (const s of merged) s.text =
|
|
2067
|
+
for (const s of merged) s.text = _chunkN65EY5BIcjs.tidyScriptTags.call(void 0, s.text);
|
|
2068
2068
|
return merged;
|
|
2069
2069
|
}
|
|
2070
2070
|
function gongmunDepthFromIndent(para2, left, ctx) {
|
|
@@ -2091,7 +2091,7 @@ function gongmunDepthFromIndent(para2, left, ctx) {
|
|
|
2091
2091
|
// src/hwpx/section-walker.ts
|
|
2092
2092
|
function parseSectionXml(xml, styleMap, warnings, sectionNum, shared) {
|
|
2093
2093
|
const parser = createXmlParser(warnings);
|
|
2094
|
-
const doc = parser.parseFromString(
|
|
2094
|
+
const doc = parser.parseFromString(_chunk6ZRZLV3Jcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
2095
2095
|
if (!doc.documentElement) return [];
|
|
2096
2096
|
const ctx = { styleMap, warnings, sectionNum, shared: _nullishCoalesce(shared, () => ( createSectionShared())) };
|
|
2097
2097
|
ctx.shared.track.deleteDepth = 0;
|
|
@@ -2192,8 +2192,8 @@ function walkSection(node, blocks, tableCtx, tableStack, ctx, depth = 0) {
|
|
|
2192
2192
|
const cs = isNaN(rawCs) ? 1 : rawCs;
|
|
2193
2193
|
const rawRs = parseInt(el.getAttribute("rowSpan") || "1", 10);
|
|
2194
2194
|
const rs = isNaN(rawRs) ? 1 : rawRs;
|
|
2195
|
-
tableCtx.cell.colSpan = clampSpan(cs,
|
|
2196
|
-
tableCtx.cell.rowSpan = clampSpan(rs,
|
|
2195
|
+
tableCtx.cell.colSpan = clampSpan(cs, _chunkN65EY5BIcjs.MAX_COLS);
|
|
2196
|
+
tableCtx.cell.rowSpan = clampSpan(rs, _chunkN65EY5BIcjs.MAX_ROWS);
|
|
2197
2197
|
}
|
|
2198
2198
|
break;
|
|
2199
2199
|
case "p": {
|
|
@@ -2516,7 +2516,7 @@ function buildSubListTable(el, ctx, depth) {
|
|
|
2516
2516
|
const sink = [];
|
|
2517
2517
|
const st = { rows: [], currentRow: [], cell: null, sourceId: _nullishCoalesce(el.getAttribute("id"), () => ( void 0)) };
|
|
2518
2518
|
walkSection(el, sink, st, [], ctx, depth + 1);
|
|
2519
|
-
let flat =
|
|
2519
|
+
let flat = _chunkN65EY5BIcjs.convertTableToText.call(void 0, st.rows);
|
|
2520
2520
|
if (st.caption) flat = st.caption + (flat ? "\n" + flat : "");
|
|
2521
2521
|
const built = [];
|
|
2522
2522
|
completeTable(st, [], built, ctx);
|
|
@@ -2680,7 +2680,7 @@ function extractHyperlinkHref(fieldBegin) {
|
|
|
2680
2680
|
let url = (ch.textContent || "").trim();
|
|
2681
2681
|
if (!url) continue;
|
|
2682
2682
|
url = url.replace(/^https?:\/\/(?=https?:\/\/)/i, "");
|
|
2683
|
-
const safe =
|
|
2683
|
+
const safe = _chunk6ZRZLV3Jcjs.sanitizeHref.call(void 0, url);
|
|
2684
2684
|
if (safe) return safe;
|
|
2685
2685
|
}
|
|
2686
2686
|
return void 0;
|
|
@@ -2836,7 +2836,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
|
|
|
2836
2836
|
_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" })]);
|
|
2837
2837
|
}
|
|
2838
2838
|
} else {
|
|
2839
|
-
text +=
|
|
2839
|
+
text += _chunkN65EY5BIcjs.escapeLiteralTags.call(void 0, _chunkN65EY5BIcjs.escapeLiteralDollar.call(void 0, t.replace(/\x1E/g, "")));
|
|
2840
2840
|
}
|
|
2841
2841
|
continue;
|
|
2842
2842
|
}
|
|
@@ -2881,7 +2881,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
|
|
|
2881
2881
|
break;
|
|
2882
2882
|
// 글자 겹치기 — 겹친 글은 composeText 속성에 있어 종전엔 통째로 빠졌다(법령 서식 원 번호 ⑯·⑰, 시험지 네모 번호 10)
|
|
2883
2883
|
case "compose":
|
|
2884
|
-
if (!isInDeletedRange(ctx)) text +=
|
|
2884
|
+
if (!isInDeletedRange(ctx)) text += _chunkN65EY5BIcjs.escapeLiteralTags.call(void 0, _chunkN65EY5BIcjs.escapeLiteralDollar.call(void 0, _chunkN65EY5BIcjs.composeText.call(void 0, _nullishCoalesce(child.getAttribute("composeText"), () => ( "")), (_nullishCoalesce(child.getAttribute("circleType"), () => ( "CHAR"))) !== "CHAR")));
|
|
2885
2885
|
break;
|
|
2886
2886
|
// 양식 선택 상자·라디오 단추 — 한컴이 그리는 상자 기호와 캡션 글 (종전엔 통째로 빠졌다: form-002 "원천기술형"·서울 결재 "부분공개")
|
|
2887
2887
|
// 지운 구간의 양식 단추·수식은 글처럼 내지 않는다 (최종본)
|
|
@@ -2893,7 +2893,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
|
|
|
2893
2893
|
case "hyperlink": {
|
|
2894
2894
|
const url = child.getAttribute("url") || child.getAttribute("href") || "";
|
|
2895
2895
|
if (url) {
|
|
2896
|
-
const safe =
|
|
2896
|
+
const safe = _chunk6ZRZLV3Jcjs.sanitizeHref.call(void 0, url);
|
|
2897
2897
|
if (safe) href = safe;
|
|
2898
2898
|
}
|
|
2899
2899
|
walk(child, depth + 1);
|
|
@@ -2987,7 +2987,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
|
|
|
2987
2987
|
walk(child, depth + 1);
|
|
2988
2988
|
if (script && linkRanges.length === nLinks && openFields.length === nOpen && runHasOnlyText(child)) {
|
|
2989
2989
|
const added = text.slice(start);
|
|
2990
|
-
if (added && !/[\x1E\n$]/.test(added)) text = text.slice(0, start) +
|
|
2990
|
+
if (added && !/[\x1E\n$]/.test(added)) text = text.slice(0, start) + _chunkN65EY5BIcjs.wrapScript.call(void 0, added, script);
|
|
2991
2991
|
}
|
|
2992
2992
|
break;
|
|
2993
2993
|
}
|
|
@@ -3010,7 +3010,7 @@ function extractParagraphInfo(para2, styleMap, ctx) {
|
|
|
3010
3010
|
}
|
|
3011
3011
|
if (applied.length) href = void 0;
|
|
3012
3012
|
}
|
|
3013
|
-
text =
|
|
3013
|
+
text = _chunkN65EY5BIcjs.tidyScriptTags.call(void 0, text);
|
|
3014
3014
|
const toc = takeTocLeaders(text);
|
|
3015
3015
|
text = toc.text;
|
|
3016
3016
|
const tocEntry = toc.tocEntry;
|
|
@@ -3125,7 +3125,7 @@ function decompressStream(data) {
|
|
|
3125
3125
|
return _zlib.inflateRawSync.call(void 0, data, opts);
|
|
3126
3126
|
}
|
|
3127
3127
|
function parseFileHeader(data) {
|
|
3128
|
-
if (data.length < 40) throw new (0,
|
|
3128
|
+
if (data.length < 40) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("FileHeader\uAC00 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4 (\uCD5C\uC18C 40\uBC14\uC774\uD2B8)");
|
|
3129
3129
|
const sig = data.subarray(0, 32).toString("utf8").replace(/\0+$/, "");
|
|
3130
3130
|
return {
|
|
3131
3131
|
signature: sig,
|
|
@@ -3652,13 +3652,13 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
3652
3652
|
}
|
|
3653
3653
|
const allCandidates = resolvedPath ? [resolvedPath, ...candidates] : candidates;
|
|
3654
3654
|
for (const path of allCandidates) {
|
|
3655
|
-
if (
|
|
3655
|
+
if (_chunk6ZRZLV3Jcjs.isPathTraversal.call(void 0, path)) continue;
|
|
3656
3656
|
const file = zip.file(path);
|
|
3657
3657
|
if (!file) continue;
|
|
3658
3658
|
try {
|
|
3659
3659
|
const data = await readZipEntry(file, "uint8array", decompressed.total);
|
|
3660
3660
|
decompressed.total += data.length;
|
|
3661
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3661
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3662
3662
|
const ext = path.includes(".") ? path.split(".").pop() || "png" : "png";
|
|
3663
3663
|
const extMime = imageExtToMime(ext);
|
|
3664
3664
|
const mimeType = extMime === "image/svg+xml" && /<script|\son[a-z]+\s*=|javascript:|<foreignObject/i.test(Buffer.from(data).toString("utf8")) ? "application/octet-stream" : extMime;
|
|
@@ -3669,7 +3669,7 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
3669
3669
|
usedPaths.add(path);
|
|
3670
3670
|
break;
|
|
3671
3671
|
} catch (err) {
|
|
3672
|
-
if (err instanceof
|
|
3672
|
+
if (err instanceof _chunk6ZRZLV3Jcjs.KordocError) throw err;
|
|
3673
3673
|
}
|
|
3674
3674
|
}
|
|
3675
3675
|
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" })]);
|
|
@@ -3689,13 +3689,13 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
3689
3689
|
if (sweepUnreferenced) {
|
|
3690
3690
|
const binEntries = zip.file(/(?:^|\/)BinData\//i);
|
|
3691
3691
|
for (const file of binEntries) {
|
|
3692
|
-
if (file.dir || usedPaths.has(file.name) ||
|
|
3692
|
+
if (file.dir || usedPaths.has(file.name) || _chunk6ZRZLV3Jcjs.isPathTraversal.call(void 0, file.name)) continue;
|
|
3693
3693
|
const basename = file.name.slice(file.name.lastIndexOf("/") + 1);
|
|
3694
3694
|
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;
|
|
3695
3695
|
try {
|
|
3696
3696
|
const data = await readZipEntry(file, "uint8array", decompressed.total);
|
|
3697
3697
|
decompressed.total += data.length;
|
|
3698
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3698
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3699
3699
|
const ext = file.name.includes(".") ? file.name.split(".").pop() || "" : "";
|
|
3700
3700
|
let mimeType = imageExtToMime(ext);
|
|
3701
3701
|
if (mimeType === "application/octet-stream") {
|
|
@@ -3709,7 +3709,7 @@ async function extractImagesFromZip(zip, blocks, decompressed, warnings, sweepUn
|
|
|
3709
3709
|
images.push(img);
|
|
3710
3710
|
blocks.push({ type: "image", text: filename, imageData: { data, mimeType, filename: file.name } });
|
|
3711
3711
|
} catch (err) {
|
|
3712
|
-
if (err instanceof
|
|
3712
|
+
if (err instanceof _chunk6ZRZLV3Jcjs.KordocError) throw err;
|
|
3713
3713
|
_optionalChain([warnings, 'optionalAccess', _138 => _138.push, 'call', _139 => _139({ message: `\uC774\uBBF8\uC9C0 \uCD94\uCD9C \uC2E4\uD328: ${file.name}`, code: "SKIPPED_IMAGE" })]);
|
|
3714
3714
|
}
|
|
3715
3715
|
}
|
|
@@ -3760,7 +3760,7 @@ function extractFromBrokenZip(buffer, options) {
|
|
|
3760
3760
|
}
|
|
3761
3761
|
const nameBytes = data.slice(pos + 30, pos + 30 + nameLen);
|
|
3762
3762
|
const name = new TextDecoder().decode(nameBytes);
|
|
3763
|
-
if (
|
|
3763
|
+
if (_chunk6ZRZLV3Jcjs.isPathTraversal.call(void 0, name)) {
|
|
3764
3764
|
pos = fileStart + compSize;
|
|
3765
3765
|
continue;
|
|
3766
3766
|
}
|
|
@@ -3778,7 +3778,7 @@ function extractFromBrokenZip(buffer, options) {
|
|
|
3778
3778
|
continue;
|
|
3779
3779
|
}
|
|
3780
3780
|
totalDecompressed += content.length * 2;
|
|
3781
|
-
if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3781
|
+
if (totalDecompressed > MAX_DECOMPRESS_SIZE) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC");
|
|
3782
3782
|
sectionNum++;
|
|
3783
3783
|
const secBlocks = parseSectionXml(content, void 0, warnings, sectionNum, shared);
|
|
3784
3784
|
for (const b of secBlocks) b.pageNumber = sectionNum;
|
|
@@ -3787,9 +3787,9 @@ function extractFromBrokenZip(buffer, options) {
|
|
|
3787
3787
|
continue;
|
|
3788
3788
|
}
|
|
3789
3789
|
}
|
|
3790
|
-
if (blocks.length === 0) throw new (0,
|
|
3790
|
+
if (blocks.length === 0) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uC190\uC0C1\uB41C HWPX\uC5D0\uC11C \uC139\uC158 \uB370\uC774\uD130\uB97C \uBCF5\uAD6C\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
3791
3791
|
applyPageText(blocks, shared);
|
|
3792
|
-
const markdown =
|
|
3792
|
+
const markdown = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _140 => _140.tableFormat]) });
|
|
3793
3793
|
return { markdown, blocks, warnings: warnings.length > 0 ? warnings : void 0 };
|
|
3794
3794
|
}
|
|
3795
3795
|
async function readKordocLayout(zip) {
|
|
@@ -3814,11 +3814,11 @@ async function resolveSectionPaths(zip) {
|
|
|
3814
3814
|
if (paths.length > 0) return paths;
|
|
3815
3815
|
}
|
|
3816
3816
|
const sectionFiles = zip.file(/[Ss]ection\d+\.xml$/);
|
|
3817
|
-
return sectionFiles.map((f) => f.name).sort(
|
|
3817
|
+
return sectionFiles.map((f) => f.name).sort(_chunk6ZRZLV3Jcjs.compareSectionPaths);
|
|
3818
3818
|
}
|
|
3819
3819
|
function parseSectionPathsFromManifest(xml) {
|
|
3820
3820
|
const parser = createXmlParser();
|
|
3821
|
-
const doc = parser.parseFromString(
|
|
3821
|
+
const doc = parser.parseFromString(_chunk6ZRZLV3Jcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
3822
3822
|
const opf = "http://www.idpf.org/2007/opf/";
|
|
3823
3823
|
const namespacedItems = doc.getElementsByTagNameNS(opf, "item");
|
|
3824
3824
|
const namespacedSpine = doc.getElementsByTagNameNS(opf, "itemref");
|
|
@@ -3828,7 +3828,7 @@ function parseSectionPathsFromManifest(xml) {
|
|
|
3828
3828
|
for (let i = 0; i < items.length; i++) {
|
|
3829
3829
|
const item = items[i];
|
|
3830
3830
|
const id = item.getAttribute("id") || "";
|
|
3831
|
-
const href =
|
|
3831
|
+
const href = _chunk6ZRZLV3Jcjs.normalizeSectionHref.call(void 0, item.getAttribute("href") || "");
|
|
3832
3832
|
if (id && href) idToHref.set(id, href);
|
|
3833
3833
|
}
|
|
3834
3834
|
if (spine.length > 0) {
|
|
@@ -3839,7 +3839,7 @@ function parseSectionPathsFromManifest(xml) {
|
|
|
3839
3839
|
}
|
|
3840
3840
|
if (ordered.length > 0) return ordered;
|
|
3841
3841
|
}
|
|
3842
|
-
return Array.from(idToHref.values()).sort(
|
|
3842
|
+
return Array.from(idToHref.values()).sort(_chunk6ZRZLV3Jcjs.compareSectionPaths);
|
|
3843
3843
|
}
|
|
3844
3844
|
|
|
3845
3845
|
// src/hwpx/metadata.ts
|
|
@@ -3851,7 +3851,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
|
|
|
3851
3851
|
const xml = await readZipEntry(file, "text", _optionalChain([decompressed, 'optionalAccess', _144 => _144.total]));
|
|
3852
3852
|
if (decompressed) {
|
|
3853
3853
|
decompressed.total += xml.length * 2;
|
|
3854
|
-
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
3854
|
+
if (decompressed.total > MAX_DECOMPRESS_SIZE) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("ZIP \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3855
3855
|
}
|
|
3856
3856
|
return xml;
|
|
3857
3857
|
};
|
|
@@ -3873,7 +3873,7 @@ async function extractHwpxMetadata(zip, metadata, decompressed) {
|
|
|
3873
3873
|
}
|
|
3874
3874
|
}
|
|
3875
3875
|
function parseOpfMetadata(xml, metadata) {
|
|
3876
|
-
const root = createXmlParser().parseFromString(
|
|
3876
|
+
const root = createXmlParser().parseFromString(_chunk6ZRZLV3Jcjs.stripDtd.call(void 0, xml), "text/xml").documentElement;
|
|
3877
3877
|
const md2 = root ? findChildByLocalName(root, "metadata") : null;
|
|
3878
3878
|
if (!md2) return;
|
|
3879
3879
|
let title;
|
|
@@ -3906,7 +3906,7 @@ function isoDate(s) {
|
|
|
3906
3906
|
}
|
|
3907
3907
|
function parseDublinCoreMetadata(xml, metadata) {
|
|
3908
3908
|
const parser = createXmlParser();
|
|
3909
|
-
const doc = parser.parseFromString(
|
|
3909
|
+
const doc = parser.parseFromString(_chunk6ZRZLV3Jcjs.stripDtd.call(void 0, xml), "text/xml");
|
|
3910
3910
|
if (!doc.documentElement) return;
|
|
3911
3911
|
const getText = (tagNames) => {
|
|
3912
3912
|
for (const tag of tagNames) {
|
|
@@ -3945,7 +3945,7 @@ function assignSectionPage(block, sectionNum) {
|
|
|
3945
3945
|
}
|
|
3946
3946
|
}
|
|
3947
3947
|
async function parseHwpxDocument(buffer, options) {
|
|
3948
|
-
|
|
3948
|
+
_chunk6ZRZLV3Jcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
|
|
3949
3949
|
let zip;
|
|
3950
3950
|
try {
|
|
3951
3951
|
zip = await _jszip2.default.loadAsync(buffer);
|
|
@@ -3954,7 +3954,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3954
3954
|
}
|
|
3955
3955
|
const actualEntryCount = Object.keys(zip.files).length;
|
|
3956
3956
|
if (actualEntryCount > MAX_ZIP_ENTRIES) {
|
|
3957
|
-
throw new (0,
|
|
3957
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("ZIP \uC5D4\uD2B8\uB9AC \uC218 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
3958
3958
|
}
|
|
3959
3959
|
const manifestFile = zip.file("META-INF/manifest.xml");
|
|
3960
3960
|
if (manifestFile) {
|
|
@@ -3974,7 +3974,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3974
3974
|
}
|
|
3975
3975
|
const hpfFile = zip.file("Contents/content.hpf");
|
|
3976
3976
|
const hpf = hpfFile ? await readZipEntry(hpfFile, "text").catch(() => "") : "";
|
|
3977
|
-
throw new (0,
|
|
3977
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(
|
|
3978
3978
|
/\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."
|
|
3979
3979
|
);
|
|
3980
3980
|
}
|
|
@@ -3986,7 +3986,7 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
3986
3986
|
const styleMap = await extractHwpxStyles(zip, decompressed);
|
|
3987
3987
|
const warnings = [];
|
|
3988
3988
|
const sectionPaths = await resolveSectionPaths(zip);
|
|
3989
|
-
if (sectionPaths.length === 0) throw new (0,
|
|
3989
|
+
if (sectionPaths.length === 0) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
3990
3990
|
let allBlocks = [];
|
|
3991
3991
|
const shared = createSectionShared();
|
|
3992
3992
|
shared.kordocLayout = await readKordocLayout(zip);
|
|
@@ -4030,10 +4030,10 @@ async function parseHwpxDocument(buffer, options) {
|
|
|
4030
4030
|
const blocks = allBlocks;
|
|
4031
4031
|
applyPageText(blocks, shared);
|
|
4032
4032
|
const images = await extractImagesFromZip(zip, blocks, decompressed, warnings, !_optionalChain([options, 'optionalAccess', _173 => _173.pages]), shared.track.deletedImageRefs);
|
|
4033
|
-
const shown = _optionalChain([options, 'optionalAccess', _174 => _174.layoutTables]) === "keep" ? blocks :
|
|
4033
|
+
const shown = _optionalChain([options, 'optionalAccess', _174 => _174.layoutTables]) === "keep" ? blocks : _chunkN65EY5BIcjs.unframeLayoutTables.call(void 0, blocks, !!_optionalChain([options, 'optionalAccess', _175 => _175.keepTrailingEmptyCols]));
|
|
4034
4034
|
detectHwpxHeadings(shown, styleMap, shared.tocTexts);
|
|
4035
4035
|
const outline = shown.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
|
|
4036
|
-
const markdown =
|
|
4036
|
+
const markdown = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, shown, { tableFormat: _optionalChain([options, 'optionalAccess', _176 => _176.tableFormat]) });
|
|
4037
4037
|
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 };
|
|
4038
4038
|
}
|
|
4039
4039
|
|
|
@@ -4800,7 +4800,7 @@ function decryptPasswordStream(raw, password) {
|
|
|
4800
4800
|
var TAG_DOCUMENT_PROPERTIES = 16;
|
|
4801
4801
|
var TAG_ID_MAPPINGS2 = 17;
|
|
4802
4802
|
function assertDecryptedDocInfo(data, readRecords3) {
|
|
4803
|
-
const wrong = () => new (0,
|
|
4803
|
+
const wrong = () => new (0, _chunk6ZRZLV3Jcjs.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.");
|
|
4804
4804
|
let records;
|
|
4805
4805
|
try {
|
|
4806
4806
|
records = readRecords3(data);
|
|
@@ -4812,7 +4812,7 @@ function assertDecryptedDocInfo(data, readRecords3) {
|
|
|
4812
4812
|
}
|
|
4813
4813
|
function assertSupportedEncryptVersion(version) {
|
|
4814
4814
|
if (version !== SUPPORTED_ENCRYPT_VERSION) {
|
|
4815
|
-
throw new (0,
|
|
4815
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(
|
|
4816
4816
|
`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWP \uC554\uD638\uD654 \uBC84\uC804\uC785\uB2C8\uB2E4 (EncryptVersion=${version}, \uC9C0\uC6D0: ${SUPPORTED_ENCRYPT_VERSION})`
|
|
4817
4817
|
);
|
|
4818
4818
|
}
|
|
@@ -5061,19 +5061,19 @@ var HANJA_UNITS = ["", "\u5341", "\u767E", "\u5343", "\u842C"];
|
|
|
5061
5061
|
function formatNumber(n, fmt2) {
|
|
5062
5062
|
switch (fmt2) {
|
|
5063
5063
|
case "circled":
|
|
5064
|
-
return n >= 1 ?
|
|
5064
|
+
return n >= 1 ? _chunkN65EY5BIcjs.circledNumber.call(void 0, n - 1) : String(n);
|
|
5065
5065
|
case "romanUpper":
|
|
5066
|
-
return
|
|
5066
|
+
return _chunkN65EY5BIcjs.romanNumeral.call(void 0, n, true);
|
|
5067
5067
|
case "romanLower":
|
|
5068
|
-
return
|
|
5068
|
+
return _chunkN65EY5BIcjs.romanNumeral.call(void 0, n, false);
|
|
5069
5069
|
case "latinUpper":
|
|
5070
5070
|
return formatLatin(n, true) || String(n);
|
|
5071
5071
|
case "latinLower":
|
|
5072
5072
|
return formatLatin(n, false) || String(n);
|
|
5073
5073
|
case "ganada":
|
|
5074
|
-
return n >= 1 ?
|
|
5074
|
+
return n >= 1 ? _chunkN65EY5BIcjs.hangulOrdinal.call(void 0, n - 1) : String(n);
|
|
5075
5075
|
case "circledGanada":
|
|
5076
|
-
return n >= 1 ?
|
|
5076
|
+
return n >= 1 ? _chunkN65EY5BIcjs.circledHangul.call(void 0, n - 1) : String(n);
|
|
5077
5077
|
case "jamo":
|
|
5078
5078
|
return fromTable(n, JAMO);
|
|
5079
5079
|
case "circledJamo":
|
|
@@ -5255,7 +5255,7 @@ function emitParagraphBlocks(p) {
|
|
|
5255
5255
|
return blocks;
|
|
5256
5256
|
}
|
|
5257
5257
|
function tableFlatText(table2) {
|
|
5258
|
-
const flat =
|
|
5258
|
+
const flat = _chunkN65EY5BIcjs.convertTableToText.call(void 0, table2.cells);
|
|
5259
5259
|
return table2.caption ? table2.caption + (flat ? "\n" + flat : "") : flat;
|
|
5260
5260
|
}
|
|
5261
5261
|
function blocksPlainText(blocks, sep) {
|
|
@@ -5336,8 +5336,8 @@ ${cell2.text}` : cell2.text;
|
|
|
5336
5336
|
}
|
|
5337
5337
|
function buildAddressedTable(cells, rows, cols, keepAnchoredEmptyCols) {
|
|
5338
5338
|
for (const c of cells) {
|
|
5339
|
-
rows = Math.max(rows, Math.min((_nullishCoalesce(c.rowAddr, () => ( 0))) + 1,
|
|
5340
|
-
cols = Math.max(cols, Math.min((_nullishCoalesce(c.colAddr, () => ( 0))) + 1,
|
|
5339
|
+
rows = Math.max(rows, Math.min((_nullishCoalesce(c.rowAddr, () => ( 0))) + 1, _chunkN65EY5BIcjs.MAX_ROWS));
|
|
5340
|
+
cols = Math.max(cols, Math.min((_nullishCoalesce(c.colAddr, () => ( 0))) + 1, _chunkN65EY5BIcjs.MAX_COLS));
|
|
5341
5341
|
}
|
|
5342
5342
|
const placed = resolveCellOverlaps(cells, rows, cols);
|
|
5343
5343
|
const byRow = Array.from({ length: rows }, () => []);
|
|
@@ -5345,12 +5345,12 @@ function buildAddressedTable(cells, rows, cols, keepAnchoredEmptyCols) {
|
|
|
5345
5345
|
const r = _nullishCoalesce(c.rowAddr, () => ( 0));
|
|
5346
5346
|
if (r < rows && (_nullishCoalesce(c.colAddr, () => ( 0))) < cols) byRow[r].push(c);
|
|
5347
5347
|
}
|
|
5348
|
-
const table2 =
|
|
5348
|
+
const table2 = _chunkN65EY5BIcjs.buildTable.call(void 0, byRow, { keepAnchoredEmptyCols });
|
|
5349
5349
|
if (table2.rows === 0) return null;
|
|
5350
5350
|
for (const c of placed) {
|
|
5351
5351
|
if (c.edges) {
|
|
5352
5352
|
const at = _optionalChain([table2, 'access', _183 => _183.cells, 'access', _184 => _184[_nullishCoalesce(c.rowAddr, () => ( 0))], 'optionalAccess', _185 => _185[_nullishCoalesce(c.colAddr, () => ( 0))]]);
|
|
5353
|
-
if (at)
|
|
5353
|
+
if (at) _chunkN65EY5BIcjs.CELL_EDGES.set(at, c.edges);
|
|
5354
5354
|
}
|
|
5355
5355
|
if (!_optionalChain([c, 'access', _186 => _186.blocks, 'optionalAccess', _187 => _187.length]) && !c.isHeader) continue;
|
|
5356
5356
|
const target = _optionalChain([table2, 'access', _188 => _188.cells, 'access', _189 => _189[_nullishCoalesce(c.rowAddr, () => ( 0))], 'optionalAccess', _190 => _190[_nullishCoalesce(c.colAddr, () => ( 0))]]);
|
|
@@ -5552,7 +5552,7 @@ function parseParagraph(records, start, end, ctx) {
|
|
|
5552
5552
|
continue;
|
|
5553
5553
|
}
|
|
5554
5554
|
if (!ctrl.href) continue;
|
|
5555
|
-
const href =
|
|
5555
|
+
const href = _chunk6ZRZLV3Jcjs.sanitizeHref.call(void 0, ctrl.href);
|
|
5556
5556
|
if (!href) continue;
|
|
5557
5557
|
if (!anchor.trim() || anchor.includes(INLINE_TABLE_MARK)) continue;
|
|
5558
5558
|
text = text.slice(0, r.start) + `[${anchor}](${href})` + text.slice(r.end);
|
|
@@ -5561,7 +5561,7 @@ function parseParagraph(records, start, end, ctx) {
|
|
|
5561
5561
|
}
|
|
5562
5562
|
if (text.includes(LITERAL_DOLLAR_MARK)) text = text.replaceAll(LITERAL_DOLLAR_MARK, "\\$");
|
|
5563
5563
|
text = resolveLiteralLt(text);
|
|
5564
|
-
text =
|
|
5564
|
+
text = _chunkN65EY5BIcjs.tidyScriptTags.call(void 0, text);
|
|
5565
5565
|
const toc = takeTocLeaders(text);
|
|
5566
5566
|
text = toc.text;
|
|
5567
5567
|
let headingLevel = 0;
|
|
@@ -5668,7 +5668,7 @@ function applyCtrlEffect(ctrl, records, ctx) {
|
|
|
5668
5668
|
// 글자 겹침 — ctrl id 뒤 글자 수(WORD)·겹친 글자(WCHAR[n])·테두리 종류(BYTE, 0 = 없음). 종전엔 건너뛰어 법령 서식 원 번호(⑯·⑰)가 빠졌다
|
|
5669
5669
|
case CTRL_TCPS: {
|
|
5670
5670
|
const d = ctrl.data, n = d.length >= 6 ? d.readUInt16LE(4) : 0;
|
|
5671
|
-
if (n > 0 && d.length >= 6 + 2 * n) ctrl.inlineText =
|
|
5671
|
+
if (n > 0 && d.length >= 6 + 2 * n) ctrl.inlineText = _chunkN65EY5BIcjs.composeText.call(void 0, d.toString("utf16le", 6, 6 + 2 * n), (_nullishCoalesce(d[6 + 2 * n], () => ( 0))) !== 0);
|
|
5672
5672
|
return;
|
|
5673
5673
|
}
|
|
5674
5674
|
// 숨은 설명/단 정의/쪽번호 위치/감추기/찾아보기/책갈피/덧말 — 본문 텍스트 없음 또는 의도적 스킵
|
|
@@ -5786,7 +5786,7 @@ function hyperlinkUrlFromCommand(command) {
|
|
|
5786
5786
|
}
|
|
5787
5787
|
var A4_HEIGHT = 84188;
|
|
5788
5788
|
function keepUnlessPageSpanning(table2, cells) {
|
|
5789
|
-
if (!cells.some((c) => c.pageSpanning))
|
|
5789
|
+
if (!cells.some((c) => c.pageSpanning)) _chunkN65EY5BIcjs.markNonLayoutTable.call(void 0, table2);
|
|
5790
5790
|
}
|
|
5791
5791
|
function parseTableControl(ctrl, records, ctx) {
|
|
5792
5792
|
if (ctx.depth >= MAX_NEST_DEPTH) return null;
|
|
@@ -5798,8 +5798,8 @@ function parseTableControl(ctrl, records, ctx) {
|
|
|
5798
5798
|
let tableIdx = -1;
|
|
5799
5799
|
for (let i2 = childStart; i2 < childEnd; i2++) {
|
|
5800
5800
|
if (records[i2].tagId === TAG_TABLE && records[i2].level === directLevel && records[i2].data.length >= 8) {
|
|
5801
|
-
rows = Math.min(records[i2].data.readUInt16LE(4),
|
|
5802
|
-
cols = Math.min(records[i2].data.readUInt16LE(6),
|
|
5801
|
+
rows = Math.min(records[i2].data.readUInt16LE(4), _chunkN65EY5BIcjs.MAX_ROWS);
|
|
5802
|
+
cols = Math.min(records[i2].data.readUInt16LE(6), _chunkN65EY5BIcjs.MAX_COLS);
|
|
5803
5803
|
tableIdx = i2;
|
|
5804
5804
|
break;
|
|
5805
5805
|
}
|
|
@@ -5843,11 +5843,11 @@ function parseTableControl(ctrl, records, ctx) {
|
|
|
5843
5843
|
return table3;
|
|
5844
5844
|
}
|
|
5845
5845
|
if (rows === 0 || cols === 0) {
|
|
5846
|
-
rows = Math.min(cells.length,
|
|
5846
|
+
rows = Math.min(cells.length, _chunkN65EY5BIcjs.MAX_ROWS);
|
|
5847
5847
|
cols = 1;
|
|
5848
5848
|
}
|
|
5849
5849
|
const cellRows = arrangeCells(rows, cols, cells);
|
|
5850
|
-
const table2 =
|
|
5850
|
+
const table2 = _chunkN65EY5BIcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: ctx.doc.keepTrailingEmptyCols });
|
|
5851
5851
|
if (caption && table2.rows > 0) table2.caption = caption;
|
|
5852
5852
|
if (sourceId && table2.rows > 0) table2.sourceId = sourceId;
|
|
5853
5853
|
keepUnlessPageSpanning(table2, cells);
|
|
@@ -5866,8 +5866,8 @@ function parseCell(records, lhIdx, end, ctx) {
|
|
|
5866
5866
|
rowAddr = rec.data.readUInt16LE(10);
|
|
5867
5867
|
const cs = rec.data.readUInt16LE(12);
|
|
5868
5868
|
const rs = rec.data.readUInt16LE(14);
|
|
5869
|
-
if (cs > 0) colSpan = Math.min(cs,
|
|
5870
|
-
if (rs > 0) rowSpan = Math.min(rs,
|
|
5869
|
+
if (cs > 0) colSpan = Math.min(cs, _chunkN65EY5BIcjs.MAX_COLS);
|
|
5870
|
+
if (rs > 0) rowSpan = Math.min(rs, _chunkN65EY5BIcjs.MAX_ROWS);
|
|
5871
5871
|
}
|
|
5872
5872
|
const blocks = ctx.depth < MAX_NEST_DEPTH ? parseParagraphList(records, lhIdx + 1, end, { ...ctx, depth: ctx.depth + 1 }) : [];
|
|
5873
5873
|
const { text, hasStructure } = cellTextFromBlocks(blocks);
|
|
@@ -6016,7 +6016,7 @@ function openHwp5Container(buffer, options) {
|
|
|
6016
6016
|
lenientCfb = parseLenientCfb(buffer);
|
|
6017
6017
|
warnings.push({ message: "\uC190\uC0C1\uB41C CFB \uCEE8\uD14C\uC774\uB108 \u2014 lenient \uBAA8\uB4DC\uB85C \uBCF5\uAD6C", code: "LENIENT_CFB_RECOVERY" });
|
|
6018
6018
|
} catch (e24) {
|
|
6019
|
-
throw new (0,
|
|
6019
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328 (strict \uBC0F lenient \uBAA8\uB450)");
|
|
6020
6020
|
}
|
|
6021
6021
|
}
|
|
6022
6022
|
const readRawStream = (path) => {
|
|
@@ -6027,14 +6027,14 @@ function openHwp5Container(buffer, options) {
|
|
|
6027
6027
|
return lenientCfb.findStream(path);
|
|
6028
6028
|
};
|
|
6029
6029
|
const headerData = readRawStream("/FileHeader");
|
|
6030
|
-
if (!headerData) throw new (0,
|
|
6030
|
+
if (!headerData) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("FileHeader \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
|
|
6031
6031
|
const header = parseFileHeader(headerData);
|
|
6032
|
-
if (header.signature !== "HWP Document File") throw new (0,
|
|
6033
|
-
if (header.flags & FLAG_DRM) throw new (0,
|
|
6032
|
+
if (header.signature !== "HWP Document File") throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("HWP \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
6033
|
+
if (header.flags & FLAG_DRM) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("DRM \uBCF4\uD638\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
6034
6034
|
const encrypted = (header.flags & FLAG_ENCRYPTED) !== 0;
|
|
6035
6035
|
if (encrypted) {
|
|
6036
6036
|
if (!_optionalChain([options, 'optionalAccess', _214 => _214.password])) {
|
|
6037
|
-
throw new (0,
|
|
6037
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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.");
|
|
6038
6038
|
}
|
|
6039
6039
|
assertSupportedEncryptVersion(readEncryptVersion(headerData));
|
|
6040
6040
|
}
|
|
@@ -6048,12 +6048,12 @@ function openHwp5Container(buffer, options) {
|
|
|
6048
6048
|
const distribution = (header.flags & FLAG_DISTRIBUTION) !== 0;
|
|
6049
6049
|
if (encrypted) {
|
|
6050
6050
|
const rawDocInfo = findStream("/DocInfo");
|
|
6051
|
-
if (!rawDocInfo) throw new (0,
|
|
6051
|
+
if (!rawDocInfo) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("DocInfo \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
|
|
6052
6052
|
let docInfoData;
|
|
6053
6053
|
try {
|
|
6054
6054
|
docInfoData = compressed ? decompressStream(rawDocInfo) : rawDocInfo;
|
|
6055
6055
|
} catch (e25) {
|
|
6056
|
-
throw new (0,
|
|
6056
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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.");
|
|
6057
6057
|
}
|
|
6058
6058
|
assertDecryptedDocInfo(docInfoData, readRecords);
|
|
6059
6059
|
}
|
|
@@ -6078,10 +6078,10 @@ function readHwp5SectionRecords(c, sections, warnings) {
|
|
|
6078
6078
|
try {
|
|
6079
6079
|
const data = !c.distribution && c.compressed ? decompressStream(Buffer.from(sections[si])) : Buffer.from(sections[si]);
|
|
6080
6080
|
totalDecompressed += data.length;
|
|
6081
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
6081
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
6082
6082
|
out.push(readRecords(data));
|
|
6083
6083
|
} catch (secErr) {
|
|
6084
|
-
if (secErr instanceof
|
|
6084
|
+
if (secErr instanceof _chunk6ZRZLV3Jcjs.KordocError) throw secErr;
|
|
6085
6085
|
out.push(null);
|
|
6086
6086
|
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" });
|
|
6087
6087
|
}
|
|
@@ -6101,7 +6101,7 @@ function parseHwp5Document(buffer, options) {
|
|
|
6101
6101
|
if (cfb) extractHwp5Metadata(cfb, metadata);
|
|
6102
6102
|
const docInfo = cfb && !encrypted ? parseDocInfoStream(cfb, compressed) : parseDocInfoFromStream(findStream("/DocInfo"), compressed);
|
|
6103
6103
|
const sections = readHwp5SectionStreams(c);
|
|
6104
|
-
if (sections.length === 0) throw new (0,
|
|
6104
|
+
if (sections.length === 0) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
6105
6105
|
const sectionRecords = readHwp5SectionRecords(c, sections, warnings);
|
|
6106
6106
|
const sectionDetects = sectionRecords.map((r) => r ? detectHwp5SectionPages(r) : null);
|
|
6107
6107
|
const sectionTableIds = [];
|
|
@@ -6145,7 +6145,7 @@ function parseHwp5Document(buffer, options) {
|
|
|
6145
6145
|
parsedSections++;
|
|
6146
6146
|
_optionalChain([options, 'optionalAccess', _219 => _219.onProgress, 'optionalCall', _220 => _220(parsedSections, sections.length)]);
|
|
6147
6147
|
} catch (secErr) {
|
|
6148
|
-
if (secErr instanceof
|
|
6148
|
+
if (secErr instanceof _chunk6ZRZLV3Jcjs.KordocError) throw secErr;
|
|
6149
6149
|
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" });
|
|
6150
6150
|
} finally {
|
|
6151
6151
|
pageBase += detect2.pages;
|
|
@@ -6156,10 +6156,10 @@ function parseHwp5Document(buffer, options) {
|
|
|
6156
6156
|
}
|
|
6157
6157
|
const blocks = [...doc.headerBlocks, ...bodyBlocks, ...doc.footerBlocks];
|
|
6158
6158
|
const images = cfb ? extractHwp5Images(cfb.FileIndex, blocks, warnings, !pageFilter, encrypted ? findStream : void 0) : extractHwp5ImagesLenient(lenientCfb, blocks, warnings, !pageFilter, encrypted ? findStream : void 0);
|
|
6159
|
-
let flatBlocks =
|
|
6160
|
-
if (_optionalChain([options, 'optionalAccess', _221 => _221.layoutTables]) !== "keep") flatBlocks =
|
|
6159
|
+
let flatBlocks = _chunkN65EY5BIcjs.flattenLayoutTables.call(void 0, blocks);
|
|
6160
|
+
if (_optionalChain([options, 'optionalAccess', _221 => _221.layoutTables]) !== "keep") flatBlocks = _chunkN65EY5BIcjs.unframeLayoutTables.call(void 0, flatBlocks, !!_optionalChain([options, 'optionalAccess', _222 => _222.keepTrailingEmptyCols]));
|
|
6161
6161
|
if (_optionalChain([options, 'optionalAccess', _223 => _223.dedupeRunningHeaders])) {
|
|
6162
|
-
const deduped =
|
|
6162
|
+
const deduped = _chunkN65EY5BIcjs.dedupeRunningHeaders.call(void 0, flatBlocks);
|
|
6163
6163
|
const removed = flatBlocks.length - deduped.length;
|
|
6164
6164
|
if (removed > 0) warnings.push({ message: `\uBC18\uBCF5 \uB7EC\uB2DD \uD5E4\uB354 ${removed}\uAC1C \uC81C\uAC70`, code: "HIDDEN_TEXT_FILTERED" });
|
|
6165
6165
|
flatBlocks = deduped;
|
|
@@ -6168,10 +6168,10 @@ function parseHwp5Document(buffer, options) {
|
|
|
6168
6168
|
detectHwp5Headings(flatBlocks, docInfo, doc.tocTexts);
|
|
6169
6169
|
}
|
|
6170
6170
|
const outline = flatBlocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
|
|
6171
|
-
let markdown =
|
|
6171
|
+
let markdown = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, flatBlocks, { tableFormat: _optionalChain([options, 'optionalAccess', _224 => _224.tableFormat]) });
|
|
6172
6172
|
if (_optionalChain([options, 'optionalAccess', _225 => _225.inlineImages]) && options.images !== false && images.length > 0) {
|
|
6173
6173
|
try {
|
|
6174
|
-
markdown =
|
|
6174
|
+
markdown = _chunkYG4YOPK6cjs.inlineImagesIntoMarkdown.call(void 0, markdown, images, { compress: true });
|
|
6175
6175
|
} catch (inlineErr) {
|
|
6176
6176
|
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" });
|
|
6177
6177
|
}
|
|
@@ -6235,9 +6235,9 @@ function detectHwp5Headings(blocks, docInfo, tocTexts) {
|
|
|
6235
6235
|
let level = 0;
|
|
6236
6236
|
if (_optionalChain([block, 'access', _232 => _232.style, 'optionalAccess', _233 => _233.fontSize]) && baseFontSize > 0) {
|
|
6237
6237
|
const ratio = block.style.fontSize / baseFontSize;
|
|
6238
|
-
if (ratio >=
|
|
6239
|
-
else if (ratio >=
|
|
6240
|
-
else if (ratio >=
|
|
6238
|
+
if (ratio >= _chunkN65EY5BIcjs.HEADING_RATIO_H1) level = 1;
|
|
6239
|
+
else if (ratio >= _chunkN65EY5BIcjs.HEADING_RATIO_H2) level = 2;
|
|
6240
|
+
else if (ratio >= _chunkN65EY5BIcjs.HEADING_RATIO_H3) level = 3;
|
|
6241
6241
|
}
|
|
6242
6242
|
if (/^제\d+[장절편]\s/.test(text) && text.length <= 50) {
|
|
6243
6243
|
if (level === 0) level = 2;
|
|
@@ -6369,7 +6369,7 @@ function findSectionsLenient(lcfb) {
|
|
|
6369
6369
|
const raw = _nullishCoalesce(lcfb.findStream(`/BodyText/Section${i}`), () => ( lcfb.findStream(`Section${i}`)));
|
|
6370
6370
|
if (!raw) break;
|
|
6371
6371
|
totalBytes += raw.length;
|
|
6372
|
-
if (totalBytes > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
6372
|
+
if (totalBytes > MAX_TOTAL_DECOMPRESS) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
6373
6373
|
sections.push({ idx: i, content: raw });
|
|
6374
6374
|
}
|
|
6375
6375
|
if (sections.length === 0) {
|
|
@@ -6380,7 +6380,7 @@ function findSectionsLenient(lcfb) {
|
|
|
6380
6380
|
const raw = lcfb.findStream(e.name);
|
|
6381
6381
|
if (raw) {
|
|
6382
6382
|
totalBytes += raw.length;
|
|
6383
|
-
if (totalBytes > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
6383
|
+
if (totalBytes > MAX_TOTAL_DECOMPRESS) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
6384
6384
|
sections.push({ idx, content: raw });
|
|
6385
6385
|
}
|
|
6386
6386
|
}
|
|
@@ -6397,7 +6397,7 @@ function findViewTextSectionsLenient(lcfb, compressed) {
|
|
|
6397
6397
|
try {
|
|
6398
6398
|
const content = decryptViewText(raw, compressed);
|
|
6399
6399
|
totalDecompressed += content.length;
|
|
6400
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
6400
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
6401
6401
|
sections.push({ idx: i, content });
|
|
6402
6402
|
} catch (e32) {
|
|
6403
6403
|
break;
|
|
@@ -18897,25 +18897,25 @@ function desEcbDecrypt(data, key) {
|
|
|
18897
18897
|
}
|
|
18898
18898
|
function readLayout(data) {
|
|
18899
18899
|
if (data.length < FIXED_HEADER_BYTES) {
|
|
18900
|
-
throw new (0,
|
|
18900
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("HWP3 \uC554\uD638 \uBB38\uC11C: \uD5E4\uB354\uAC00 \uC798\uB838\uC2B5\uB2C8\uB2E4");
|
|
18901
18901
|
}
|
|
18902
18902
|
const infoBlockLength = data[INFO_BLOCK_LENGTH_OFFSET] | data[INFO_BLOCK_LENGTH_OFFSET + 1] << 8;
|
|
18903
18903
|
const payloadOffset = FIXED_HEADER_BYTES + infoBlockLength;
|
|
18904
18904
|
if (payloadOffset >= data.length) {
|
|
18905
|
-
throw new (0,
|
|
18905
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("HWP3 \uC554\uD638 \uBB38\uC11C: \uBCF8\uBB38\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
18906
18906
|
}
|
|
18907
18907
|
return { payloadOffset, compressed: data[COMPRESSION_FLAG_OFFSET] !== 0 };
|
|
18908
18908
|
}
|
|
18909
18909
|
function decryptHwp3Document(input, password) {
|
|
18910
18910
|
const { payloadOffset, compressed } = readLayout(input);
|
|
18911
18911
|
if (!compressed) {
|
|
18912
|
-
throw new (0,
|
|
18912
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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)");
|
|
18913
18913
|
}
|
|
18914
18914
|
const source = Buffer.from(input);
|
|
18915
18915
|
const payload = source.subarray(payloadOffset);
|
|
18916
18916
|
const aligned = payload.subarray(0, payload.length - payload.length % 8);
|
|
18917
18917
|
if (aligned.length === 0) {
|
|
18918
|
-
throw new (0,
|
|
18918
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("HWP3 \uC554\uD638 \uBB38\uC11C: \uBCF8\uBB38\uC774 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4");
|
|
18919
18919
|
}
|
|
18920
18920
|
const decrypted = desEcbDecrypt(aligned, deriveDesKey(password));
|
|
18921
18921
|
let inflated;
|
|
@@ -18923,14 +18923,14 @@ function decryptHwp3Document(input, password) {
|
|
|
18923
18923
|
inflated = _zlib.inflateRawSync.call(void 0, decrypted, { maxOutputLength: MAX_DECOMPRESSED_BYTES });
|
|
18924
18924
|
} catch (err) {
|
|
18925
18925
|
if (_optionalChain([err, 'optionalAccess', _248 => _248.code]) === "ERR_BUFFER_TOO_LARGE") {
|
|
18926
|
-
throw new (0,
|
|
18926
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(
|
|
18927
18927
|
`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`
|
|
18928
18928
|
);
|
|
18929
18929
|
}
|
|
18930
|
-
throw new (0,
|
|
18930
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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.");
|
|
18931
18931
|
}
|
|
18932
18932
|
if (inflated.length <= PASSWORD_PREFIX_BYTES) {
|
|
18933
|
-
throw new (0,
|
|
18933
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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.");
|
|
18934
18934
|
}
|
|
18935
18935
|
const body = inflated.subarray(PASSWORD_PREFIX_BYTES);
|
|
18936
18936
|
const out = Buffer.concat([source.subarray(0, payloadOffset), body]);
|
|
@@ -18987,9 +18987,9 @@ function hwp3CellGrid(info, count) {
|
|
|
18987
18987
|
const col = edgeAt(xs, g3.x), row = edgeAt(ys, g3.y);
|
|
18988
18988
|
const c2 = nextX[k] !== void 0 ? edgeAt(xs, nextX[k]) : xs.length - 1;
|
|
18989
18989
|
const r2 = nextY[k] !== void 0 ? edgeAt(ys, nextY[k]) : ys.length - 1;
|
|
18990
|
-
return { row, col, rowSpan: Math.min(Math.max(1, r2 - row),
|
|
18990
|
+
return { row, col, rowSpan: Math.min(Math.max(1, r2 - row), _chunkN65EY5BIcjs.MAX_ROWS), colSpan: Math.min(Math.max(1, c2 - col), _chunkN65EY5BIcjs.MAX_COLS) };
|
|
18991
18991
|
});
|
|
18992
|
-
return { rows: Math.min(Math.max(1, ys.length - 1),
|
|
18992
|
+
return { rows: Math.min(Math.max(1, ys.length - 1), _chunkN65EY5BIcjs.MAX_ROWS), cols: Math.min(Math.max(1, xs.length - 1), _chunkN65EY5BIcjs.MAX_COLS), cells };
|
|
18993
18993
|
}
|
|
18994
18994
|
|
|
18995
18995
|
// src/hwp3/parser.ts
|
|
@@ -19030,7 +19030,7 @@ function parseHwp3Document(buffer, options) {
|
|
|
19030
19030
|
let source = Buffer.from(buffer);
|
|
19031
19031
|
if (isEncryptedHwp3(source)) {
|
|
19032
19032
|
if (!_optionalChain([options, 'optionalAccess', _249 => _249.password])) {
|
|
19033
|
-
throw new (0,
|
|
19033
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(
|
|
19034
19034
|
"\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."
|
|
19035
19035
|
);
|
|
19036
19036
|
}
|
|
@@ -19047,10 +19047,10 @@ function parseHwp3Document(buffer, options) {
|
|
|
19047
19047
|
body = _zlib.inflateRawSync.call(void 0, tail, { maxOutputLength: MAX_DECOMPRESS_SIZE3 });
|
|
19048
19048
|
} catch (err) {
|
|
19049
19049
|
if (_optionalChain([err, 'optionalAccess', _250 => _250.code]) === "ERR_BUFFER_TOO_LARGE") {
|
|
19050
|
-
throw new (0,
|
|
19050
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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`);
|
|
19051
19051
|
}
|
|
19052
19052
|
const msg2 = err instanceof Error ? err.message : String(err);
|
|
19053
|
-
throw new (0,
|
|
19053
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`HWP3 \uC555\uCD95 \uD574\uC81C \uC2E4\uD328: ${msg2}`);
|
|
19054
19054
|
}
|
|
19055
19055
|
} else {
|
|
19056
19056
|
body = tail;
|
|
@@ -19073,7 +19073,7 @@ function parseHwp3Document(buffer, options) {
|
|
|
19073
19073
|
const names = new Map([...ctx.picIds].map(([name, id]) => [id, name]));
|
|
19074
19074
|
dropMissingPictures(allBlocks, binData, names, warnings);
|
|
19075
19075
|
const images = resolveImageBlocks(binData, allBlocks, warnings, true);
|
|
19076
|
-
const blocks =
|
|
19076
|
+
const blocks = _chunkN65EY5BIcjs.flattenLayoutTables.call(void 0, allBlocks);
|
|
19077
19077
|
const metadata = {
|
|
19078
19078
|
title: header.title || void 0,
|
|
19079
19079
|
author: header.author || void 0,
|
|
@@ -19081,10 +19081,10 @@ function parseHwp3Document(buffer, options) {
|
|
|
19081
19081
|
createdAt: header.date || void 0,
|
|
19082
19082
|
version: "3.0"
|
|
19083
19083
|
};
|
|
19084
|
-
let markdown =
|
|
19084
|
+
let markdown = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _251 => _251.tableFormat]) });
|
|
19085
19085
|
if (_optionalChain([options, 'optionalAccess', _252 => _252.inlineImages]) && options.images !== false && images.length > 0) {
|
|
19086
19086
|
try {
|
|
19087
|
-
markdown =
|
|
19087
|
+
markdown = _chunkYG4YOPK6cjs.inlineImagesIntoMarkdown.call(void 0, markdown, images, { compress: true });
|
|
19088
19088
|
} catch (inlineErr) {
|
|
19089
19089
|
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" });
|
|
19090
19090
|
}
|
|
@@ -19216,7 +19216,7 @@ function parseCharStream(reader, charCount, ctx, para2) {
|
|
|
19216
19216
|
continue;
|
|
19217
19217
|
}
|
|
19218
19218
|
if (ch >= 32) {
|
|
19219
|
-
para2.text +=
|
|
19219
|
+
para2.text += _chunkN65EY5BIcjs.escapeLiteralTags.call(void 0, _chunkN65EY5BIcjs.escapeLiteralDollar.call(void 0, _nullishCoalesce(decodeJohabText(ch), () => ( ""))));
|
|
19220
19220
|
continue;
|
|
19221
19221
|
}
|
|
19222
19222
|
if (ch === 9) {
|
|
@@ -19451,7 +19451,7 @@ function isDistributionSentinel(markdown) {
|
|
|
19451
19451
|
// src/xlsx/sheet-blocks.ts
|
|
19452
19452
|
var MAX_SHEET_COLS = 16384;
|
|
19453
19453
|
function sheetRowCap(cols) {
|
|
19454
|
-
return Math.floor(
|
|
19454
|
+
return Math.floor(_chunkN65EY5BIcjs.MAX_TABLE_CELLS / Math.max(1, cols));
|
|
19455
19455
|
}
|
|
19456
19456
|
function sheetToBlocks(sheetName, rows, maxCol, merges, sheetIndex, warnings, keepAnchoredEmptyCols) {
|
|
19457
19457
|
const blocks = [];
|
|
@@ -19482,7 +19482,7 @@ function sheetToBlocks(sheetName, rows, maxCol, merges, sheetIndex, warnings, ke
|
|
|
19482
19482
|
if (keepRows.length > rowCap) {
|
|
19483
19483
|
warnings.push({
|
|
19484
19484
|
page: sheetIndex + 1,
|
|
19485
|
-
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 ${
|
|
19485
|
+
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 ${_chunkN65EY5BIcjs.MAX_TABLE_CELLS})`,
|
|
19486
19486
|
code: "TRUNCATED_TABLE"
|
|
19487
19487
|
});
|
|
19488
19488
|
keepRows.length = rowCap;
|
|
@@ -19516,14 +19516,14 @@ function sheetToBlocks(sheetName, rows, maxCol, merges, sheetIndex, warnings, ke
|
|
|
19516
19516
|
}
|
|
19517
19517
|
cellRows.push(row);
|
|
19518
19518
|
}
|
|
19519
|
-
const table2 =
|
|
19519
|
+
const table2 = _chunkN65EY5BIcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols, maxRows: rowCap, maxCols: keepCols.length });
|
|
19520
19520
|
if (table2.rows > 0) blocks.push({ type: "table", table: table2, pageNumber: sheetIndex + 1 });
|
|
19521
19521
|
return blocks;
|
|
19522
19522
|
}
|
|
19523
19523
|
|
|
19524
19524
|
// src/xlsx/parser.ts
|
|
19525
19525
|
var MAX_SHEETS = 100;
|
|
19526
|
-
var MAX_DECOMPRESS_SIZE4 =
|
|
19526
|
+
var MAX_DECOMPRESS_SIZE4 = _chunk6ZRZLV3Jcjs.unzipLimitBytes.call(void 0, 100 * 1024 * 1024);
|
|
19527
19527
|
var MAX_SHEET_ROWS = 1048576;
|
|
19528
19528
|
function cleanNumericValue(raw) {
|
|
19529
19529
|
if (!/^-?\d+\.\d+$/.test(raw)) return raw;
|
|
@@ -19560,7 +19560,7 @@ function getTextContent(el) {
|
|
|
19560
19560
|
return _nullishCoalesce(_optionalChain([el, 'access', _268 => _268.textContent, 'optionalAccess', _269 => _269.trim, 'call', _270 => _270()]), () => ( ""));
|
|
19561
19561
|
}
|
|
19562
19562
|
function parseXml(text) {
|
|
19563
|
-
return new (0, _xmldom.DOMParser)().parseFromString(
|
|
19563
|
+
return new (0, _xmldom.DOMParser)().parseFromString(_chunk6ZRZLV3Jcjs.stripDtd.call(void 0, text), "text/xml");
|
|
19564
19564
|
}
|
|
19565
19565
|
function collectRichText(root) {
|
|
19566
19566
|
let out = "";
|
|
@@ -19571,7 +19571,7 @@ function collectRichText(root) {
|
|
|
19571
19571
|
const el = children[i];
|
|
19572
19572
|
const local2 = el.localName || _optionalChain([el, 'access', _271 => _271.tagName, 'optionalAccess', _272 => _272.replace, 'call', _273 => _273(/^[^:]+:/, "")]) || "";
|
|
19573
19573
|
if (local2 === "rPh") continue;
|
|
19574
|
-
if (local2 === "t") out +=
|
|
19574
|
+
if (local2 === "t") out += _chunkN65EY5BIcjs.escapeLiteralTags.call(void 0, _chunkN65EY5BIcjs.escapeLiteralDollar.call(void 0, _nullishCoalesce(el.textContent, () => ( ""))));
|
|
19575
19575
|
else walk(el);
|
|
19576
19576
|
}
|
|
19577
19577
|
};
|
|
@@ -19782,12 +19782,12 @@ function parseWorksheet(xml, sharedStrings, dateXfs, date1904) {
|
|
|
19782
19782
|
return { rows, merges, maxCol };
|
|
19783
19783
|
}
|
|
19784
19784
|
async function parseXlsxDocument(buffer, options) {
|
|
19785
|
-
|
|
19785
|
+
_chunk6ZRZLV3Jcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE4);
|
|
19786
19786
|
const zip = await _jszip2.default.loadAsync(buffer);
|
|
19787
19787
|
const warnings = [];
|
|
19788
19788
|
const workbookFile = zip.file("xl/workbook.xml");
|
|
19789
19789
|
if (!workbookFile) {
|
|
19790
|
-
throw new (0,
|
|
19790
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 XLSX \uD30C\uC77C: xl/workbook.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
19791
19791
|
}
|
|
19792
19792
|
let sharedStrings = [];
|
|
19793
19793
|
const ssFile = zip.file("xl/sharedStrings.xml");
|
|
@@ -19796,7 +19796,7 @@ async function parseXlsxDocument(buffer, options) {
|
|
|
19796
19796
|
}
|
|
19797
19797
|
const { sheets, date1904 } = parseWorkbook(await readZipEntry(workbookFile, "text"));
|
|
19798
19798
|
if (sheets.length === 0) {
|
|
19799
|
-
throw new (0,
|
|
19799
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("XLSX \uD30C\uC77C\uC5D0 \uC2DC\uD2B8\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
19800
19800
|
}
|
|
19801
19801
|
let dateXfs = /* @__PURE__ */ new Map();
|
|
19802
19802
|
const stylesFile = zip.file("xl/styles.xml");
|
|
@@ -19880,7 +19880,7 @@ async function parseXlsxDocument(buffer, options) {
|
|
|
19880
19880
|
} catch (e35) {
|
|
19881
19881
|
}
|
|
19882
19882
|
}
|
|
19883
|
-
const markdown =
|
|
19883
|
+
const markdown = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _278 => _278.tableFormat]) });
|
|
19884
19884
|
return { markdown, blocks, metadata, warnings: warnings.length > 0 ? warnings : void 0 };
|
|
19885
19885
|
}
|
|
19886
19886
|
|
|
@@ -20194,14 +20194,14 @@ function extractSheetCells(records, bofIndex, sst, convertNum) {
|
|
|
20194
20194
|
const h = readCellHeader(rec.data);
|
|
20195
20195
|
if (h && rec.data.length >= 10) {
|
|
20196
20196
|
const isst = rec.data.readUInt32LE(6);
|
|
20197
|
-
cells.push({ row: h.row, col: h.col, value:
|
|
20197
|
+
cells.push({ row: h.row, col: h.col, value: _chunkN65EY5BIcjs.escapeLiteralTags.call(void 0, _chunkN65EY5BIcjs.escapeLiteralDollar.call(void 0, _nullishCoalesce(sst[isst], () => ( "")))) });
|
|
20198
20198
|
}
|
|
20199
20199
|
break;
|
|
20200
20200
|
}
|
|
20201
20201
|
case OP_LABEL: {
|
|
20202
20202
|
const h = readCellHeader(rec.data);
|
|
20203
20203
|
if (h) {
|
|
20204
|
-
cells.push({ row: h.row, col: h.col, value:
|
|
20204
|
+
cells.push({ row: h.row, col: h.col, value: _chunkN65EY5BIcjs.escapeLiteralTags.call(void 0, _chunkN65EY5BIcjs.escapeLiteralDollar.call(void 0, decodeLabelString(rec.data))) });
|
|
20205
20205
|
}
|
|
20206
20206
|
break;
|
|
20207
20207
|
}
|
|
@@ -20217,7 +20217,7 @@ function extractSheetCells(records, bofIndex, sst, convertNum) {
|
|
|
20217
20217
|
cells.push({
|
|
20218
20218
|
row: h.row,
|
|
20219
20219
|
col: h.col,
|
|
20220
|
-
value:
|
|
20220
|
+
value: _chunkN65EY5BIcjs.escapeLiteralTags.call(void 0, _chunkN65EY5BIcjs.escapeLiteralDollar.call(void 0, decodeFormulaStringRecord(next.data)))
|
|
20221
20221
|
});
|
|
20222
20222
|
i = j;
|
|
20223
20223
|
} else {
|
|
@@ -20329,11 +20329,11 @@ function processGlobals(records) {
|
|
|
20329
20329
|
const xfFmtIds = [];
|
|
20330
20330
|
const firstBof = records[0];
|
|
20331
20331
|
if (!firstBof || firstBof.opcode !== OP_BOF) {
|
|
20332
|
-
throw new (0,
|
|
20332
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("XLS: \uCCAB \uB808\uCF54\uB4DC\uAC00 BOF\uAC00 \uC544\uB2D8");
|
|
20333
20333
|
}
|
|
20334
20334
|
const bof = decodeBof(firstBof.data);
|
|
20335
20335
|
if (!bof || bof.dt !== DT_GLOBALS) {
|
|
20336
|
-
throw new (0,
|
|
20336
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("XLS: Globals \uC11C\uBE0C\uC2A4\uD2B8\uB9BC BOF \uB204\uB77D");
|
|
20337
20337
|
}
|
|
20338
20338
|
let i = 1;
|
|
20339
20339
|
while (i < records.length) {
|
|
@@ -20417,28 +20417,28 @@ async function parseXlsDocument(buffer, options) {
|
|
|
20417
20417
|
try {
|
|
20418
20418
|
cfb = parseLenientCfb(buf);
|
|
20419
20419
|
} catch (e) {
|
|
20420
|
-
throw new (0,
|
|
20420
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(
|
|
20421
20421
|
`XLS: OLE2 \uC2DC\uADF8\uB2C8\uCC98 \uAC80\uC99D \uC2E4\uD328 \u2014 ${e instanceof Error ? e.message : "\uC54C \uC218 \uC5C6\uB294 \uC624\uB958"}`
|
|
20422
20422
|
);
|
|
20423
20423
|
}
|
|
20424
20424
|
const wb = _nullishCoalesce(cfb.findStream("/Workbook"), () => ( cfb.findStream("/Book")));
|
|
20425
20425
|
if (!wb) {
|
|
20426
|
-
throw new (0,
|
|
20426
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("XLS: Workbook \uC2A4\uD2B8\uB9BC\uC774 \uC5C6\uC74C (BIFF5 \uB610\uB294 \uBE44\uD45C\uC900 \uD30C\uC77C)");
|
|
20427
20427
|
}
|
|
20428
20428
|
const records = readRecords2(wb);
|
|
20429
20429
|
if (records.length === 0) {
|
|
20430
|
-
throw new (0,
|
|
20430
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("XLS: \uC2DC\uADF8\uB2C8\uCC98 \uB808\uCF54\uB4DC\uAC00 \uC5C6\uC74C (Workbook \uC2A4\uD2B8\uB9BC \uC190\uC0C1)");
|
|
20431
20431
|
}
|
|
20432
20432
|
const firstBof = decodeBof(records[0].data);
|
|
20433
20433
|
if (firstBof && firstBof.vers !== 1536) {
|
|
20434
|
-
throw new (0,
|
|
20434
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(
|
|
20435
20435
|
`XLS: BIFF8(0x0600)\uB9CC \uC9C0\uC6D0 \u2014 \uBCF8 \uD30C\uC77C\uC740 0x${firstBof.vers.toString(16)}`
|
|
20436
20436
|
);
|
|
20437
20437
|
}
|
|
20438
20438
|
const globals = processGlobals(records);
|
|
20439
20439
|
const warnings = [];
|
|
20440
20440
|
if (globals.encrypted) {
|
|
20441
|
-
throw new (0,
|
|
20441
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("XLS \uD30C\uC77C\uC774 \uC554\uD638\uD654\uB418\uC5B4 \uC788\uC5B4 \uD30C\uC2F1\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
20442
20442
|
}
|
|
20443
20443
|
const convertNum = globals.dateXfs.size > 0 ? (n, ixfe) => {
|
|
20444
20444
|
const kind = globals.dateXfs.get(ixfe);
|
|
@@ -20489,7 +20489,7 @@ async function parseXlsDocument(buffer, options) {
|
|
|
20489
20489
|
pageCount: totalSheets
|
|
20490
20490
|
};
|
|
20491
20491
|
return {
|
|
20492
|
-
markdown:
|
|
20492
|
+
markdown: _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, allBlocks, { tableFormat: _optionalChain([options, 'optionalAccess', _283 => _283.tableFormat]) }),
|
|
20493
20493
|
blocks: allBlocks,
|
|
20494
20494
|
metadata,
|
|
20495
20495
|
warnings: warnings.length > 0 ? warnings : void 0
|
|
@@ -20928,7 +20928,7 @@ function isDisplayMath(el) {
|
|
|
20928
20928
|
}
|
|
20929
20929
|
|
|
20930
20930
|
// src/docx/parser.ts
|
|
20931
|
-
var MAX_DECOMPRESS_SIZE5 =
|
|
20931
|
+
var MAX_DECOMPRESS_SIZE5 = _chunk6ZRZLV3Jcjs.unzipLimitBytes.call(void 0, 100 * 1024 * 1024);
|
|
20932
20932
|
var MEDIA_PART_RE = /^word\/(?:media|embeddings)\//;
|
|
20933
20933
|
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;
|
|
20934
20934
|
function matchesLocal(el, localName3) {
|
|
@@ -20986,7 +20986,7 @@ function getAttr(el, localName3) {
|
|
|
20986
20986
|
return null;
|
|
20987
20987
|
}
|
|
20988
20988
|
function parseXml2(text) {
|
|
20989
|
-
return new (0, _xmldom.DOMParser)().parseFromString(
|
|
20989
|
+
return new (0, _xmldom.DOMParser)().parseFromString(_chunk6ZRZLV3Jcjs.stripDtd.call(void 0, text), "text/xml");
|
|
20990
20990
|
}
|
|
20991
20991
|
function parseStyles(xml) {
|
|
20992
20992
|
const doc = parseXml2(xml);
|
|
@@ -21122,7 +21122,7 @@ function parseFootnotes(xml) {
|
|
|
21122
21122
|
const runs = findElements(p, "r");
|
|
21123
21123
|
for (const r of runs) {
|
|
21124
21124
|
const tElements = getChildElements(r, "t");
|
|
21125
|
-
for (const t of tElements) texts.push(
|
|
21125
|
+
for (const t of tElements) texts.push(_chunkN65EY5BIcjs.escapeLiteralTags.call(void 0, _chunkN65EY5BIcjs.escapeLiteralDollar.call(void 0, _nullishCoalesce(t.textContent, () => ( "")))));
|
|
21126
21126
|
}
|
|
21127
21127
|
}
|
|
21128
21128
|
notes.set(id, texts.join("").trim());
|
|
@@ -21153,7 +21153,7 @@ function collectOmmlRoots(p) {
|
|
|
21153
21153
|
function extractRun(r) {
|
|
21154
21154
|
let text = "";
|
|
21155
21155
|
for (const el of effectiveChildElements(r)) {
|
|
21156
|
-
if (matchesLocal(el, "t")) text +=
|
|
21156
|
+
if (matchesLocal(el, "t")) text += _chunkN65EY5BIcjs.escapeLiteralTags.call(void 0, _chunkN65EY5BIcjs.escapeLiteralDollar.call(void 0, _nullishCoalesce(el.textContent, () => ( ""))));
|
|
21157
21157
|
else if (matchesLocal(el, "br") || matchesLocal(el, "cr")) text += "\n";
|
|
21158
21158
|
else if (matchesLocal(el, "tab")) text += " ";
|
|
21159
21159
|
else if (matchesLocal(el, "sym")) text += symbolChar(getAttr(el, "font"), getAttr(el, "char"));
|
|
@@ -21166,7 +21166,7 @@ function extractRun(r) {
|
|
|
21166
21166
|
italic = getChildElements(rPrEls[0], "i").length > 0;
|
|
21167
21167
|
const va = getChildElements(rPrEls[0], "vertAlign")[0];
|
|
21168
21168
|
const v = va ? getAttr(va, "val") : null;
|
|
21169
|
-
if (v === "superscript" || v === "subscript") text =
|
|
21169
|
+
if (v === "superscript" || v === "subscript") text = _chunkN65EY5BIcjs.wrapScript.call(void 0, text, v === "superscript" ? "sup" : "sub");
|
|
21170
21170
|
}
|
|
21171
21171
|
return { text, bold, italic };
|
|
21172
21172
|
}
|
|
@@ -21184,7 +21184,7 @@ var PAGE_FIELD_RE = /^\s*(?:PAGE|NUMPAGES|SECTIONPAGES)\b/i;
|
|
|
21184
21184
|
function makeLink(text, rawHref) {
|
|
21185
21185
|
if (!text) return "";
|
|
21186
21186
|
if (!rawHref) return text;
|
|
21187
|
-
const href =
|
|
21187
|
+
const href = _chunk6ZRZLV3Jcjs.sanitizeHref.call(void 0, rawHref);
|
|
21188
21188
|
return href ? `[${text}](${href})` : text;
|
|
21189
21189
|
}
|
|
21190
21190
|
function collectInline(p, footnotes, rels) {
|
|
@@ -21275,7 +21275,7 @@ function collectInline(p, footnotes, rels) {
|
|
|
21275
21275
|
const m = mathText(om);
|
|
21276
21276
|
if (m) parts.push(isDisplayMath(om) ? m : " " + m + " ");
|
|
21277
21277
|
}
|
|
21278
|
-
const text =
|
|
21278
|
+
const text = _chunkN65EY5BIcjs.tidyScriptTags.call(void 0, parts.join("")).replace(/[ \t]{2,}/g, " ").trim();
|
|
21279
21279
|
return { text, bold, italic, footnoteText };
|
|
21280
21280
|
}
|
|
21281
21281
|
var COUNTERS = /* @__PURE__ */ new WeakMap();
|
|
@@ -21400,7 +21400,7 @@ ${cell2.text}` : cell2.text;
|
|
|
21400
21400
|
return { text: cell2.text, colSpan: cell2.colSpan, rowSpan, colAddr: cell2.col, rowAddr: r };
|
|
21401
21401
|
})
|
|
21402
21402
|
);
|
|
21403
|
-
const table2 =
|
|
21403
|
+
const table2 = _chunkN65EY5BIcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keepEmptyCols });
|
|
21404
21404
|
if (table2.rows === 0 || table2.cols === 0) return null;
|
|
21405
21405
|
return { type: "table", table: table2 };
|
|
21406
21406
|
}
|
|
@@ -21449,7 +21449,7 @@ async function buildImageMap(zip, rels, doc, warnings, readBytes) {
|
|
|
21449
21449
|
let data = null;
|
|
21450
21450
|
if (readBytes) data = await readZipEntry(imgFile, "uint8array");
|
|
21451
21451
|
imgIdx++;
|
|
21452
|
-
const ext =
|
|
21452
|
+
const ext = _chunk6ZRZLV3Jcjs.partExtension.call(void 0, imgPath);
|
|
21453
21453
|
const mimeMap = {
|
|
21454
21454
|
png: "image/png",
|
|
21455
21455
|
jpg: "image/jpeg",
|
|
@@ -21548,12 +21548,12 @@ async function parseHeaderFooterBlocks(zip, doc, rels, kind, styles, numbering,
|
|
|
21548
21548
|
}
|
|
21549
21549
|
async function parseDocxDocument(buffer, options) {
|
|
21550
21550
|
const readImages = _optionalChain([options, 'optionalAccess', _319 => _319.images]) !== false;
|
|
21551
|
-
|
|
21551
|
+
_chunk6ZRZLV3Jcjs.precheckZipSize.call(void 0, buffer, MAX_DECOMPRESS_SIZE5, void 0, { re: MEDIA_PART_RE, skip: !readImages, never: NEVER_READ_RE });
|
|
21552
21552
|
const zip = await _jszip2.default.loadAsync(buffer);
|
|
21553
21553
|
const warnings = [];
|
|
21554
21554
|
const docFile = zip.file("word/document.xml");
|
|
21555
21555
|
if (!docFile) {
|
|
21556
|
-
throw new (0,
|
|
21556
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 DOCX \uD30C\uC77C: word/document.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
21557
21557
|
}
|
|
21558
21558
|
let rels = /* @__PURE__ */ new Map();
|
|
21559
21559
|
const relsFile = zip.file("word/_rels/document.xml.rels");
|
|
@@ -21600,7 +21600,7 @@ async function parseDocxDocument(buffer, options) {
|
|
|
21600
21600
|
const doc = parseXml2(docXml);
|
|
21601
21601
|
const body = findElements(doc, "body");
|
|
21602
21602
|
if (body.length === 0) {
|
|
21603
|
-
throw new (0,
|
|
21603
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("DOCX \uBCF8\uBB38(w:body)\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
21604
21604
|
}
|
|
21605
21605
|
const { imageMap, images } = await buildImageMap(zip, rels, doc, warnings, readImages);
|
|
21606
21606
|
const linkedImages = /* @__PURE__ */ new Set();
|
|
@@ -21653,7 +21653,7 @@ async function parseDocxDocument(buffer, options) {
|
|
|
21653
21653
|
}
|
|
21654
21654
|
}
|
|
21655
21655
|
const outline = blocks.filter((b) => b.type === "heading").map((b) => ({ level: _nullishCoalesce(b.level, () => ( 2)), text: _nullishCoalesce(b.text, () => ( "")) }));
|
|
21656
|
-
const markdown =
|
|
21656
|
+
const markdown = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _326 => _326.tableFormat]) });
|
|
21657
21657
|
return {
|
|
21658
21658
|
markdown,
|
|
21659
21659
|
blocks,
|
|
@@ -21667,7 +21667,7 @@ async function parseDocxDocument(buffer, options) {
|
|
|
21667
21667
|
// src/pptx/parser.ts
|
|
21668
21668
|
|
|
21669
21669
|
|
|
21670
|
-
var MAX_DECOMPRESS_SIZE6 =
|
|
21670
|
+
var MAX_DECOMPRESS_SIZE6 = _chunk6ZRZLV3Jcjs.unzipLimitBytes.call(void 0, 100 * 1024 * 1024);
|
|
21671
21671
|
var MEDIA_PART_RE2 = /^ppt\/(?:media|embeddings)\//;
|
|
21672
21672
|
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;
|
|
21673
21673
|
var MAX_ZIP_ENTRIES2 = 1e4;
|
|
@@ -21690,7 +21690,7 @@ var IMAGE_MIME = {
|
|
|
21690
21690
|
svg: "image/svg+xml"
|
|
21691
21691
|
};
|
|
21692
21692
|
function parseXml3(text) {
|
|
21693
|
-
return new (0, _xmldom.DOMParser)().parseFromString(
|
|
21693
|
+
return new (0, _xmldom.DOMParser)().parseFromString(_chunk6ZRZLV3Jcjs.stripDtd.call(void 0, text), "text/xml");
|
|
21694
21694
|
}
|
|
21695
21695
|
function getAttr2(el, name) {
|
|
21696
21696
|
const attrs = el.attributes;
|
|
@@ -21757,7 +21757,7 @@ async function slideParts(zip) {
|
|
|
21757
21757
|
names.sort((a, b) => Number(SLIDE_PART_RE.exec(a)[1]) - Number(SLIDE_PART_RE.exec(b)[1]));
|
|
21758
21758
|
ordered.push(...names);
|
|
21759
21759
|
}
|
|
21760
|
-
if (ordered.length > MAX_SLIDES) throw new (0,
|
|
21760
|
+
if (ordered.length > MAX_SLIDES) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`PPTX \uC2AC\uB77C\uC774\uB4DC \uC218 \uCD08\uACFC: ${ordered.length} (\uCD5C\uB300 ${MAX_SLIDES})`);
|
|
21761
21761
|
return ordered;
|
|
21762
21762
|
}
|
|
21763
21763
|
function paragraphText(p) {
|
|
@@ -21768,12 +21768,12 @@ function paragraphText(p) {
|
|
|
21768
21768
|
const t = findChildByLocalName(child, "t");
|
|
21769
21769
|
const rPr = findChildByLocalName(child, "rPr");
|
|
21770
21770
|
const baseline = Number(rPr ? _nullishCoalesce(getAttr2(rPr, "baseline"), () => ( 0)) : 0);
|
|
21771
|
-
if (t) text +=
|
|
21771
|
+
if (t) text += _chunkN65EY5BIcjs.wrapScript.call(void 0, _chunkN65EY5BIcjs.escapeLiteralTags.call(void 0, _chunkN65EY5BIcjs.escapeLiteralDollar.call(void 0, rawTextContent(t))), baseline > 0 ? "sup" : baseline < 0 ? "sub" : null);
|
|
21772
21772
|
} else if (name === "br") {
|
|
21773
21773
|
text += " ";
|
|
21774
21774
|
}
|
|
21775
21775
|
}
|
|
21776
|
-
return
|
|
21776
|
+
return _chunkN65EY5BIcjs.tidyScriptTags.call(void 0, text.replace(/\s+/g, " ").trim());
|
|
21777
21777
|
}
|
|
21778
21778
|
function bodyParagraphs(txBody) {
|
|
21779
21779
|
const out = [];
|
|
@@ -21834,7 +21834,7 @@ function parseTable2(tbl2, page, keepEmptyCols) {
|
|
|
21834
21834
|
});
|
|
21835
21835
|
return cells;
|
|
21836
21836
|
});
|
|
21837
|
-
const table2 =
|
|
21837
|
+
const table2 = _chunkN65EY5BIcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keepEmptyCols });
|
|
21838
21838
|
if (table2.rows === 0 || table2.cols === 0) return null;
|
|
21839
21839
|
return { type: "table", table: table2, pageNumber: page };
|
|
21840
21840
|
}
|
|
@@ -21847,7 +21847,7 @@ async function pictureBlock(pic, ctx) {
|
|
|
21847
21847
|
if (!filename) {
|
|
21848
21848
|
const file = ctx.zip.file(rel.target);
|
|
21849
21849
|
if (!file) return null;
|
|
21850
|
-
const ext =
|
|
21850
|
+
const ext = _chunk6ZRZLV3Jcjs.partExtension.call(void 0, rel.target);
|
|
21851
21851
|
filename = `image_${String(ctx.imageNames.size + 1).padStart(3, "0")}.${ext}`;
|
|
21852
21852
|
try {
|
|
21853
21853
|
if (_optionalChain([ctx, 'access', _330 => _330.options, 'optionalAccess', _331 => _331.images]) !== false) {
|
|
@@ -21925,10 +21925,10 @@ async function notesText(zip, rels) {
|
|
|
21925
21925
|
return texts.join(" ");
|
|
21926
21926
|
}
|
|
21927
21927
|
async function parsePptxDocument(buffer, options) {
|
|
21928
|
-
|
|
21928
|
+
_chunk6ZRZLV3Jcjs.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 });
|
|
21929
21929
|
const zip = await _jszip2.default.loadAsync(buffer);
|
|
21930
21930
|
if (!zip.file("ppt/presentation.xml")) {
|
|
21931
|
-
throw new (0,
|
|
21931
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uC720\uD6A8\uD558\uC9C0 \uC54A\uC740 PPTX \uD30C\uC77C: ppt/presentation.xml\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
21932
21932
|
}
|
|
21933
21933
|
const warnings = [];
|
|
21934
21934
|
const blocks = [];
|
|
@@ -21975,7 +21975,7 @@ async function parsePptxDocument(buffer, options) {
|
|
|
21975
21975
|
}
|
|
21976
21976
|
const outline = blocks.filter((b) => b.type === "heading").map((b) => ({ level: _nullishCoalesce(b.level, () => ( 2)), text: _nullishCoalesce(b.text, () => ( "")), pageNumber: b.pageNumber }));
|
|
21977
21977
|
return {
|
|
21978
|
-
markdown:
|
|
21978
|
+
markdown: _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _336 => _336.tableFormat]) }),
|
|
21979
21979
|
blocks,
|
|
21980
21980
|
metadata,
|
|
21981
21981
|
outline: outline.length > 0 ? outline : void 0,
|
|
@@ -21991,11 +21991,11 @@ var MAX_TABLE_COLS = 500;
|
|
|
21991
21991
|
var MAX_HWPML_BYTES = 50 * 1024 * 1024;
|
|
21992
21992
|
function parseHwpmlDocument(buffer, options) {
|
|
21993
21993
|
if (buffer.byteLength > MAX_HWPML_BYTES) {
|
|
21994
|
-
throw new (0,
|
|
21994
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`HWPML \uD30C\uC77C \uD06C\uAE30 \uCD08\uACFC (${(buffer.byteLength / 1024 / 1024).toFixed(1)}MB > 50MB)`);
|
|
21995
21995
|
}
|
|
21996
21996
|
const text = new TextDecoder("utf-8").decode(buffer).replace(/^\uFEFF/, "");
|
|
21997
21997
|
const normalized = text.replace(/ /g, " ");
|
|
21998
|
-
const xml =
|
|
21998
|
+
const xml = _chunk6ZRZLV3Jcjs.stripDtd.call(void 0, normalized);
|
|
21999
21999
|
const warnings = [];
|
|
22000
22000
|
const parser = new (0, _xmldom.DOMParser)({
|
|
22001
22001
|
onError: (_level, msg2) => {
|
|
@@ -22035,7 +22035,7 @@ function parseHwpmlDocument(buffer, options) {
|
|
|
22035
22035
|
parseSection2(el, blocks, paraShapeMap, sectionIdx, warnings, _nullishCoalesce(_optionalChain([options, 'optionalAccess', _338 => _338.keepTrailingEmptyCols]), () => ( false)));
|
|
22036
22036
|
}
|
|
22037
22037
|
const outline = blocks.filter((b) => b.type === "heading" && b.text).map((b) => ({ level: _nullishCoalesce(b.level, () => ( 1)), text: b.text, pageNumber: b.pageNumber }));
|
|
22038
|
-
const markdown =
|
|
22038
|
+
const markdown = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _339 => _339.tableFormat]) });
|
|
22039
22039
|
return {
|
|
22040
22040
|
markdown,
|
|
22041
22041
|
blocks,
|
|
@@ -22142,7 +22142,7 @@ function collectCharText(node, parts, depth = 0) {
|
|
|
22142
22142
|
if (tag === "CHAR") {
|
|
22143
22143
|
for (const c of Array.from(el.childNodes)) {
|
|
22144
22144
|
const t = c.nodeType === 1 ? localName(c) === "TAB" ? " " : rawTextContent(c) : c.nodeType === 3 || c.nodeType === 4 ? _nullishCoalesce(c.nodeValue, () => ( "")) : "";
|
|
22145
|
-
if (t) parts.push(
|
|
22145
|
+
if (t) parts.push(_chunkN65EY5BIcjs.escapeLiteralTags.call(void 0, t));
|
|
22146
22146
|
}
|
|
22147
22147
|
} else if (tag === "TABLE" || tag === "PICTURE" || tag === "SHAPEOBJECT") {
|
|
22148
22148
|
} else if (tag === "AUTONUM") {
|
|
@@ -22202,7 +22202,7 @@ function buildHmlTable(el, warnings, keep, tableDepth) {
|
|
|
22202
22202
|
const r = Math.min(Math.max(_nullishCoalesce(cell2.rowAddr, () => ( 0)), 0), rowCount - 1);
|
|
22203
22203
|
cellRows[r].push(cell2);
|
|
22204
22204
|
}
|
|
22205
|
-
const table2 =
|
|
22205
|
+
const table2 = _chunkN65EY5BIcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: keep });
|
|
22206
22206
|
if (structured.length > 0) {
|
|
22207
22207
|
const claimed = /* @__PURE__ */ new Set();
|
|
22208
22208
|
for (const { ctx, cellBlocks } of structured) {
|
|
@@ -23980,7 +23980,7 @@ function fillClickHereInXml(xml, cursor, blockedLabels) {
|
|
|
23980
23980
|
};
|
|
23981
23981
|
}
|
|
23982
23982
|
async function extractClickHereFields(hwpxBuffer) {
|
|
23983
|
-
|
|
23983
|
+
_chunk6ZRZLV3Jcjs.precheckZipSize.call(void 0, hwpxBuffer);
|
|
23984
23984
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
23985
23985
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort();
|
|
23986
23986
|
const fields = [];
|
|
@@ -24016,7 +24016,7 @@ function readZipEntries(buf) {
|
|
|
24016
24016
|
}
|
|
24017
24017
|
function localDataStart(view, localOffset) {
|
|
24018
24018
|
if (view.getUint32(localOffset, true) !== LOCAL_SIG) {
|
|
24019
|
-
throw new (0,
|
|
24019
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
24020
24020
|
}
|
|
24021
24021
|
const nameLen = view.getUint16(localOffset + 26, true);
|
|
24022
24022
|
const extraLen = view.getUint16(localOffset + 28, true);
|
|
@@ -24046,19 +24046,19 @@ function parseCentralDirectory(buf) {
|
|
|
24046
24046
|
}
|
|
24047
24047
|
}
|
|
24048
24048
|
}
|
|
24049
|
-
if (eocdOffset < 0) throw new (0,
|
|
24049
|
+
if (eocdOffset < 0) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("ZIP EOCD\uB97C \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
24050
24050
|
const totalEntries = view.getUint16(eocdOffset + 10, true);
|
|
24051
24051
|
const cdSize = view.getUint32(eocdOffset + 12, true);
|
|
24052
24052
|
const cdOffset = view.getUint32(eocdOffset + 16, true);
|
|
24053
|
-
if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0,
|
|
24053
|
+
if (cdOffset === 4294967295 || totalEntries === 65535) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
24054
24054
|
if (eocdOffset >= 20 && view.getUint32(eocdOffset - 20, true) === ZIP64_EOCD_LOC_SIG) {
|
|
24055
|
-
throw new (0,
|
|
24055
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
24056
24056
|
}
|
|
24057
24057
|
const decoder = new TextDecoder("utf-8");
|
|
24058
24058
|
const entries = [];
|
|
24059
24059
|
let pos = cdOffset;
|
|
24060
24060
|
for (let i = 0; i < totalEntries; i++) {
|
|
24061
|
-
if (view.getUint32(pos, true) !== CD_SIG) throw new (0,
|
|
24061
|
+
if (view.getUint32(pos, true) !== CD_SIG) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("ZIP Central Directory \uC190\uC0C1");
|
|
24062
24062
|
const flags = view.getUint16(pos + 8, true);
|
|
24063
24063
|
const method = view.getUint16(pos + 10, true);
|
|
24064
24064
|
const crc = view.getUint32(pos + 16, true);
|
|
@@ -24069,7 +24069,7 @@ function parseCentralDirectory(buf) {
|
|
|
24069
24069
|
const commentLen = view.getUint16(pos + 32, true);
|
|
24070
24070
|
const localOffset = view.getUint32(pos + 42, true);
|
|
24071
24071
|
if (compSize === 4294967295 || uncompSize === 4294967295 || localOffset === 4294967295) {
|
|
24072
|
-
throw new (0,
|
|
24072
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("ZIP64\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
24073
24073
|
}
|
|
24074
24074
|
const name = decoder.decode(buf.subarray(pos + 46, pos + 46 + nameLen));
|
|
24075
24075
|
const cdEnd = pos + 46 + nameLen + extraLen + commentLen;
|
|
@@ -24098,11 +24098,11 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
24098
24098
|
const { entries, cdOffset, eocdOffset } = parseCentralDirectory(original);
|
|
24099
24099
|
const view = new DataView(original.buffer, original.byteOffset, original.byteLength);
|
|
24100
24100
|
for (const name of replacements.keys()) {
|
|
24101
|
-
if (!entries.some((e) => e.name === name)) throw new (0,
|
|
24101
|
+
if (!entries.some((e) => e.name === name)) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`ZIP\uC5D0 \uC5C6\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
|
|
24102
24102
|
}
|
|
24103
24103
|
if (additions) {
|
|
24104
24104
|
for (const name of additions.keys()) {
|
|
24105
|
-
if (entries.some((e) => e.name === name)) throw new (0,
|
|
24105
|
+
if (entries.some((e) => e.name === name)) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`ZIP\uC5D0 \uC774\uBBF8 \uC788\uB294 \uC5D4\uD2B8\uB9AC: ${name}`);
|
|
24106
24106
|
}
|
|
24107
24107
|
}
|
|
24108
24108
|
const byLocal = [...entries].sort((a, b) => a.localOffset - b.localOffset);
|
|
@@ -24121,7 +24121,7 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
24121
24121
|
offset += seg.length;
|
|
24122
24122
|
continue;
|
|
24123
24123
|
}
|
|
24124
|
-
if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0,
|
|
24124
|
+
if (view.getUint32(e.localOffset, true) !== LOCAL_SIG) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("ZIP \uB85C\uCEEC \uD5E4\uB354 \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
24125
24125
|
const nameLen = view.getUint16(e.localOffset + 26, true);
|
|
24126
24126
|
const extraLen = view.getUint16(e.localOffset + 28, true);
|
|
24127
24127
|
const headerLen = 30 + nameLen + extraLen;
|
|
@@ -24129,7 +24129,7 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
24129
24129
|
const hview = new DataView(header.buffer, header.byteOffset, header.byteLength);
|
|
24130
24130
|
const method = e.method;
|
|
24131
24131
|
if (method !== 0 && method !== 8) {
|
|
24132
|
-
throw new (0,
|
|
24132
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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`);
|
|
24133
24133
|
}
|
|
24134
24134
|
const compData = method === 0 ? newData : new Uint8Array(_zlib.deflateRawSync.call(void 0, newData));
|
|
24135
24135
|
const crc = crc32(newData);
|
|
@@ -24227,11 +24227,11 @@ function patchZipEntries(original, replacements, additions) {
|
|
|
24227
24227
|
// src/form/filler-hwpx.ts
|
|
24228
24228
|
async function fillHwpx(hwpxBuffer, values, blockedLabels) {
|
|
24229
24229
|
const u8 = new Uint8Array(hwpxBuffer);
|
|
24230
|
-
|
|
24230
|
+
_chunk6ZRZLV3Jcjs.precheckZipSize.call(void 0, hwpxBuffer);
|
|
24231
24231
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
24232
24232
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort();
|
|
24233
24233
|
if (sectionPaths.length === 0) {
|
|
24234
|
-
throw new (0,
|
|
24234
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
24235
24235
|
}
|
|
24236
24236
|
const warnings = [];
|
|
24237
24237
|
const normalizedValues = normalizeValues(values, warnings);
|
|
@@ -24623,7 +24623,7 @@ var MIN_SIDE = 24;
|
|
|
24623
24623
|
async function ocrEmbeddedImages(blocks, options, warnings) {
|
|
24624
24624
|
const ocr = _optionalChain([options, 'optionalAccess', _491 => _491.ocr]);
|
|
24625
24625
|
if (ocr !== true && ocr !== "force" && typeof ocr !== "function") return false;
|
|
24626
|
-
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-
|
|
24626
|
+
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-CCTE7HX3.cjs")));
|
|
24627
24627
|
let inserted = false, unreadable = 0;
|
|
24628
24628
|
let failed = null;
|
|
24629
24629
|
const walk = async (list, depth) => {
|
|
@@ -24664,7 +24664,7 @@ async function ocrEmbeddedImages(blocks, options, warnings) {
|
|
|
24664
24664
|
function ocrBytes(img) {
|
|
24665
24665
|
const mime = img.mimeType.toLowerCase();
|
|
24666
24666
|
if (mime.includes("wmf") || mime.includes("emf")) return null;
|
|
24667
|
-
if (mime.includes("bmp")) return
|
|
24667
|
+
if (mime.includes("bmp")) return _chunkYG4YOPK6cjs.bmpToPng.call(void 0, img.data);
|
|
24668
24668
|
return img.data;
|
|
24669
24669
|
}
|
|
24670
24670
|
async function tooSmall(bytes) {
|
|
@@ -24833,7 +24833,7 @@ function classifyTableTree(blocks) {
|
|
|
24833
24833
|
return blocks;
|
|
24834
24834
|
}
|
|
24835
24835
|
function chooseTableRepresentation(table2, opts = {}) {
|
|
24836
|
-
const structured = hasMerged(table2) ||
|
|
24836
|
+
const structured = hasMerged(table2) || _chunkN65EY5BIcjs.hasStructuredCellContent.call(void 0, table2);
|
|
24837
24837
|
if (opts.smartVisual && _optionalChain([table2, 'access', _507 => _507.classification, 'optionalAccess', _508 => _508.kind]) === "non-tabular-layout") return "visual";
|
|
24838
24838
|
return structured ? "html" : "gfm";
|
|
24839
24839
|
}
|
|
@@ -35919,7 +35919,7 @@ function findAgency(name) {
|
|
|
35919
35919
|
}
|
|
35920
35920
|
function agencyStyle(name) {
|
|
35921
35921
|
const s = findAgency(name);
|
|
35922
|
-
if (!s) throw new (0,
|
|
35922
|
+
if (!s) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`agency: \uC2E4\uCE21 \uC11C\uC2DD\uC774 \uC5C6\uB294 \uAE30\uAD00\uC785\uB2C8\uB2E4 "${name}" \u2014 ${AGENCY_COMMON_NAME} \uB610\uB294 ${agencyNames().join("\xB7")}`);
|
|
35923
35923
|
return s;
|
|
35924
35924
|
}
|
|
35925
35925
|
function applyAgency(opts, preset) {
|
|
@@ -36983,7 +36983,7 @@ function needsGaejosikAssets(gongmun) {
|
|
|
36983
36983
|
}
|
|
36984
36984
|
function assertFiniteRange(name, value, min, max) {
|
|
36985
36985
|
if (!Number.isFinite(value) || value < min || value > max) {
|
|
36986
|
-
throw new (0,
|
|
36986
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`${name} must be a finite number between ${min} and ${max}`);
|
|
36987
36987
|
}
|
|
36988
36988
|
}
|
|
36989
36989
|
function validateGongmunOptions(opts) {
|
|
@@ -37001,10 +37001,10 @@ function validateGongmunOptions(opts) {
|
|
|
37001
37001
|
assertFiniteRange(`margins.${side}`, value, 0, 200);
|
|
37002
37002
|
}
|
|
37003
37003
|
if (opts.margins.left + opts.margins.right >= 210) {
|
|
37004
|
-
throw new (0,
|
|
37004
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("margins.left + margins.right must be less than 210");
|
|
37005
37005
|
}
|
|
37006
37006
|
if (opts.margins.top + opts.margins.bottom >= 297) {
|
|
37007
|
-
throw new (0,
|
|
37007
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("margins.top + margins.bottom must be less than 297");
|
|
37008
37008
|
}
|
|
37009
37009
|
}
|
|
37010
37010
|
if (opts.sizes) {
|
|
@@ -37013,24 +37013,24 @@ function validateGongmunOptions(opts) {
|
|
|
37013
37013
|
}
|
|
37014
37014
|
}
|
|
37015
37015
|
if (opts.approval && opts.approval.length > 6) {
|
|
37016
|
-
throw new (0,
|
|
37016
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("approval must contain at most 6 labels");
|
|
37017
37017
|
}
|
|
37018
37018
|
if (opts.checklist && typeof opts.checklist === "object") {
|
|
37019
37019
|
const nums = [..._nullishCoalesce(opts.checklist.na, () => ( [])), ...Object.keys(_nullishCoalesce(opts.checklist.notes, () => ( {}))).map(Number)];
|
|
37020
37020
|
for (const n of nums) {
|
|
37021
|
-
if (!Number.isInteger(n) || n < 1 || n > CHECKLIST_ITEMS) throw new (0,
|
|
37021
|
+
if (!Number.isInteger(n) || n < 1 || n > CHECKLIST_ITEMS) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`checklist: item number must be an integer between 1 and ${CHECKLIST_ITEMS} (got ${n})`);
|
|
37022
37022
|
}
|
|
37023
37023
|
}
|
|
37024
37024
|
if (opts.levels) {
|
|
37025
37025
|
for (const [key, st] of Object.entries(opts.levels)) {
|
|
37026
37026
|
const depth = Number(key);
|
|
37027
37027
|
if (!Number.isInteger(depth) || depth < 0 || depth >= GONGMUN_LEVEL_COUNT) {
|
|
37028
|
-
throw new (0,
|
|
37028
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`levels: depth must be an integer between 0 and ${GONGMUN_LEVEL_COUNT - 1} (got "${key}")`);
|
|
37029
37029
|
}
|
|
37030
|
-
if (!st || typeof st !== "object") throw new (0,
|
|
37030
|
+
if (!st || typeof st !== "object") throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`levels.${key} must be an object {font, pt, bold}`);
|
|
37031
37031
|
if (st.pt !== void 0) assertFiniteRange(`levels.${key}.pt`, st.pt, 6, 60);
|
|
37032
37032
|
if (st.font !== void 0 && (typeof st.font !== "string" || !st.font.trim())) {
|
|
37033
|
-
throw new (0,
|
|
37033
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`levels.${key}.font must be a non-empty string`);
|
|
37034
37034
|
}
|
|
37035
37035
|
}
|
|
37036
37036
|
}
|
|
@@ -37088,7 +37088,7 @@ function resolveChecklist(c, preset) {
|
|
|
37088
37088
|
function hexColorOption(name, value) {
|
|
37089
37089
|
if (value === void 0) return void 0;
|
|
37090
37090
|
const v = value.trim();
|
|
37091
|
-
if (!/^#[0-9a-fA-F]{6}$/.test(v)) throw new (0,
|
|
37091
|
+
if (!/^#[0-9a-fA-F]{6}$/.test(v)) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`${name} must be a #RRGGBB color (got "${value}")`);
|
|
37092
37092
|
return v.toUpperCase();
|
|
37093
37093
|
}
|
|
37094
37094
|
function resolveGongmun(input) {
|
|
@@ -37166,21 +37166,21 @@ function standardMarker(depth, n) {
|
|
|
37166
37166
|
case 0:
|
|
37167
37167
|
return `${n + 1}.`;
|
|
37168
37168
|
case 1:
|
|
37169
|
-
return `${
|
|
37169
|
+
return `${_chunkN65EY5BIcjs.hangulOrdinal.call(void 0, n)}.`;
|
|
37170
37170
|
case 2:
|
|
37171
37171
|
return `${n + 1})`;
|
|
37172
37172
|
case 3:
|
|
37173
|
-
return `${
|
|
37173
|
+
return `${_chunkN65EY5BIcjs.hangulOrdinal.call(void 0, n)})`;
|
|
37174
37174
|
case 4:
|
|
37175
37175
|
return `(${n + 1})`;
|
|
37176
37176
|
case 5:
|
|
37177
|
-
return `(${
|
|
37177
|
+
return `(${_chunkN65EY5BIcjs.hangulOrdinal.call(void 0, n)})`;
|
|
37178
37178
|
case 6:
|
|
37179
|
-
return
|
|
37179
|
+
return _chunkN65EY5BIcjs.circledNumber.call(void 0, n);
|
|
37180
37180
|
case 7:
|
|
37181
|
-
return
|
|
37181
|
+
return _chunkN65EY5BIcjs.circledHangul.call(void 0, n);
|
|
37182
37182
|
default:
|
|
37183
|
-
return
|
|
37183
|
+
return _chunkN65EY5BIcjs.circledHangul.call(void 0, n);
|
|
37184
37184
|
}
|
|
37185
37185
|
}
|
|
37186
37186
|
function reportMarker(depth, bullet2 = "\u25CB", asteriskThird = false) {
|
|
@@ -37834,7 +37834,7 @@ function parseInlineMarkdown(text) {
|
|
|
37834
37834
|
else spans.push(...emphasisSpans(m[0]));
|
|
37835
37835
|
} else {
|
|
37836
37836
|
const anchor = m[2] || m[3];
|
|
37837
|
-
const href = _nullishCoalesce(
|
|
37837
|
+
const href = _nullishCoalesce(_chunk6ZRZLV3Jcjs.sanitizeHref.call(void 0, m[3].trim()), () => ( void 0));
|
|
37838
37838
|
const sub = emphasisSpans(anchor);
|
|
37839
37839
|
if (href) for (const s of sub) s.href = href;
|
|
37840
37840
|
spans.push(...sub);
|
|
@@ -38055,7 +38055,7 @@ function assertSequentialIds(rows, label, startId) {
|
|
|
38055
38055
|
const m = rows[i].match(/\bid="(\d+)"/);
|
|
38056
38056
|
const got = m ? Number(m[1]) : NaN;
|
|
38057
38057
|
if (got !== startId + i) {
|
|
38058
|
-
throw new (0,
|
|
38058
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(
|
|
38059
38059
|
`\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)`
|
|
38060
38060
|
);
|
|
38061
38061
|
}
|
|
@@ -38146,7 +38146,7 @@ function buildCharProperties(theme, gongmun, ratioVariants = [], extraCharPrXmls
|
|
|
38146
38146
|
}
|
|
38147
38147
|
const expectedBase = charVariantBase(richAssets, !!gongmun);
|
|
38148
38148
|
if (rows.length !== expectedBase) {
|
|
38149
|
-
throw new (0,
|
|
38149
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(
|
|
38150
38150
|
`\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`
|
|
38151
38151
|
);
|
|
38152
38152
|
}
|
|
@@ -38654,7 +38654,7 @@ function variantMapper(fit, blockIdx, base = CHAR_VARIANT_BASE) {
|
|
|
38654
38654
|
const vi = fit.variants.indexOf(r);
|
|
38655
38655
|
return (id) => id >= 0 && id <= 3 ? base + vi * 4 + id : id;
|
|
38656
38656
|
}
|
|
38657
|
-
var ORDINAL_SYLLABLES = new Set(Array.from({ length: 84 }, (_, i) =>
|
|
38657
|
+
var ORDINAL_SYLLABLES = new Set(Array.from({ length: 84 }, (_, i) => _chunkN65EY5BIcjs.hangulOrdinal.call(void 0, i)));
|
|
38658
38658
|
function literalMarkerDepth(text) {
|
|
38659
38659
|
const t = text.trimStart();
|
|
38660
38660
|
let m;
|
|
@@ -39155,7 +39155,7 @@ function bestSimInRange(arr, from, to, target) {
|
|
|
39155
39155
|
return best;
|
|
39156
39156
|
}
|
|
39157
39157
|
function normForMatch(text) {
|
|
39158
|
-
return
|
|
39158
|
+
return _chunkN65EY5BIcjs.sanitizeText.call(void 0, text.replace(/\\\$/g, "$").replace(/\\(?=<\/?(?:u|sup|sub)>)/g, "")).replace(/\s+/g, " ").trim();
|
|
39159
39159
|
}
|
|
39160
39160
|
function unescapeGfm(text) {
|
|
39161
39161
|
return text.replace(/\\([~*_`|#<$\\])/g, "$1");
|
|
@@ -39177,7 +39177,7 @@ function replicateGfmTable(table2) {
|
|
|
39177
39177
|
const cell2 = _optionalChain([cells, 'access', _638 => _638[r], 'optionalAccess', _639 => _639[c]]);
|
|
39178
39178
|
if (!cell2) continue;
|
|
39179
39179
|
display[r][c] = {
|
|
39180
|
-
text:
|
|
39180
|
+
text: _chunkN65EY5BIcjs.escapeGfm.call(void 0, _chunkN65EY5BIcjs.sanitizeText.call(void 0, cell2.text)).replace(/(?<!\\)\|/g, "\\|").replace(/\r\n|\r|\n/g, "<br>"),
|
|
39181
39181
|
gridR: r,
|
|
39182
39182
|
gridC: c
|
|
39183
39183
|
};
|
|
@@ -39217,16 +39217,16 @@ function replicateCellInnerHtml(cell2) {
|
|
|
39217
39217
|
if (_optionalChain([cell2, 'access', _640 => _640.blocks, 'optionalAccess', _641 => _641.length])) {
|
|
39218
39218
|
return cell2.blocks.map((b) => {
|
|
39219
39219
|
if (b.type === "table" && b.table) {
|
|
39220
|
-
const cap = b.table.caption ?
|
|
39221
|
-
return (cap ?
|
|
39220
|
+
const cap = b.table.caption ? _chunkN65EY5BIcjs.sanitizeText.call(void 0, b.table.caption) : "";
|
|
39221
|
+
return (cap ? _chunkN65EY5BIcjs.escapeHtmlCellText.call(void 0, cap) + "<br>" : "") + replicateTableToHtml(b.table);
|
|
39222
39222
|
}
|
|
39223
|
-
if (b.type === "image" && b.text) return `<img src="${
|
|
39224
|
-
const note =
|
|
39225
|
-
const t = (
|
|
39226
|
-
return ((t ?
|
|
39223
|
+
if (b.type === "image" && b.text) return `<img src="${_chunk6ZRZLV3Jcjs.escapeHtml.call(void 0, b.text, true)}" alt="image">`;
|
|
39224
|
+
const note = _chunkN65EY5BIcjs.noteTableHtml.call(void 0, b);
|
|
39225
|
+
const t = (_chunkN65EY5BIcjs.sanitizeText.call(void 0, _chunkN65EY5BIcjs.visibleText.call(void 0, b)) + (note ? "" : _chunkN65EY5BIcjs.noteSuffix.call(void 0, b))).trim();
|
|
39226
|
+
return ((t ? _chunkN65EY5BIcjs.escapeHtmlCellText.call(void 0, t).replace(/\n/g, "<br>") : "") + note).trim();
|
|
39227
39227
|
}).filter(Boolean).join("<br>");
|
|
39228
39228
|
}
|
|
39229
|
-
return
|
|
39229
|
+
return _chunkN65EY5BIcjs.escapeHtmlCellText.call(void 0, _chunkN65EY5BIcjs.sanitizeText.call(void 0, cell2.text)).replace(/\n/g, "<br>");
|
|
39230
39230
|
}
|
|
39231
39231
|
function replicateTableToHtml(table2) {
|
|
39232
39232
|
const rows = replicateHtmlTable(table2);
|
|
@@ -39303,7 +39303,7 @@ function parseHtmlTable(raw) {
|
|
|
39303
39303
|
const cs = parseInt(_optionalChain([attrs, 'access', _644 => _644.match, 'call', _645 => _645(/colspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _646 => _646[1]]) || "1", 10);
|
|
39304
39304
|
const rs = parseInt(_optionalChain([attrs, 'access', _647 => _647.match, 'call', _648 => _648(/rowspan\s*=\s*["']?(\d+)/i), 'optionalAccess', _649 => _649[1]]) || "1", 10);
|
|
39305
39305
|
cellStart = m.index + m[0].length;
|
|
39306
|
-
cellInfo = { colSpan: clampSpan(isNaN(cs) ? 1 : cs,
|
|
39306
|
+
cellInfo = { colSpan: clampSpan(isNaN(cs) ? 1 : cs, _chunkN65EY5BIcjs.MAX_COLS), rowSpan: clampSpan(isNaN(rs) ? 1 : rs, _chunkN65EY5BIcjs.MAX_ROWS) };
|
|
39307
39307
|
} else if (cellStart >= 0 && cellInfo && currentRow) {
|
|
39308
39308
|
currentRow.push({ inner: raw.slice(cellStart, m.index), colSpan: cellInfo.colSpan, rowSpan: cellInfo.rowSpan });
|
|
39309
39309
|
cellStart = -1;
|
|
@@ -39328,11 +39328,11 @@ function htmlCellInnerToLines(inner) {
|
|
|
39328
39328
|
work = work.replace(/<img\s(?:"[^"]*"|'[^']*'|[^>"'])*?>/gi, (tag) => {
|
|
39329
39329
|
const m = /\bsrc\s*=\s*(?:"([^"]*)"|'([^']*)')/i.exec(tag);
|
|
39330
39330
|
const src = _nullishCoalesce(_optionalChain([m, 'optionalAccess', _650 => _650[1]]), () => ( _optionalChain([m, 'optionalAccess', _651 => _651[2]])));
|
|
39331
|
-
if (src) imgSrcs.push(
|
|
39331
|
+
if (src) imgSrcs.push(_chunk6ZRZLV3Jcjs.unescapeHtml.call(void 0, src));
|
|
39332
39332
|
return "";
|
|
39333
39333
|
});
|
|
39334
39334
|
}
|
|
39335
|
-
const lines = work.split(/<br\s*\/?>/gi).map((s) =>
|
|
39335
|
+
const lines = work.split(/<br\s*\/?>/gi).map((s) => _chunk6ZRZLV3Jcjs.unescapeHtml.call(void 0, s).trim()).filter((s) => s.length > 0);
|
|
39336
39336
|
return { lines, hadNonText, imgSrcs };
|
|
39337
39337
|
}
|
|
39338
39338
|
function splitCellByTopLevelTables(html) {
|
|
@@ -40163,8 +40163,8 @@ function layoutHtmlRows(rows) {
|
|
|
40163
40163
|
let c = 0;
|
|
40164
40164
|
for (const cell2 of rows[r].cells) {
|
|
40165
40165
|
while (occupied.has(`${r},${c}`)) c++;
|
|
40166
|
-
const colSpan = clampSpan(cell2.colSpan,
|
|
40167
|
-
const rowSpan = clampSpan(cell2.rowSpan,
|
|
40166
|
+
const colSpan = clampSpan(cell2.colSpan, _chunkN65EY5BIcjs.MAX_COLS);
|
|
40167
|
+
const rowSpan = clampSpan(cell2.rowSpan, _chunkN65EY5BIcjs.MAX_ROWS);
|
|
40168
40168
|
placed.push({ r, c, colSpan, rowSpan, inner: cell2.inner, isHeader: rows[r].tag === "th" });
|
|
40169
40169
|
for (let dr = 0; dr < rowSpan; dr++) {
|
|
40170
40170
|
for (let dc = 0; dc < colSpan; dc++) occupied.add(`${r + dr},${c + dc}`);
|
|
@@ -41629,7 +41629,7 @@ function buildMinistryItemBand(n, text, ctx, before2) {
|
|
|
41629
41629
|
const base = { font: MINISTRY.bandFont, pt: s.pt, bold: false };
|
|
41630
41630
|
const f = fitOneLine(plain(text), MINISTRY.bandFont, s.pt, w - 1800, s.pt);
|
|
41631
41631
|
const styled = f.overflow || f.ratio === 100 && f.spacing === 0 ? base : { ...base, ratio: f.ratio, spacing: f.spacing };
|
|
41632
|
-
const runs = ministryRuns(
|
|
41632
|
+
const runs = ministryRuns(_chunkN65EY5BIcjs.circledNumber.call(void 0, n - 1), text, ctx, styled, MINISTRY.blue, MINISTRY.blue);
|
|
41633
41633
|
const p = reg.para({ align: "LEFT", lineSp: 130, left: 300 });
|
|
41634
41634
|
const cell2 = tc({ bf: band, row: 0, col: 0, w, h: s.h, paras: `<hp:p paraPrIDRef="${p}" styleIDRef="0">${runs}</hp:p>`, name: "__kordoc_h5" });
|
|
41635
41635
|
return host(ftbl([cell2], w, s.h, 1, { bottomGap: 700 }), reg.para({ align: "LEFT", lineSp: 100, before: before2, keepWithNext: true }), reg.char(base));
|
|
@@ -42832,33 +42832,33 @@ async function readText(zip, name, budget) {
|
|
|
42832
42832
|
return s;
|
|
42833
42833
|
}
|
|
42834
42834
|
function assertWellFormed(xml, name) {
|
|
42835
|
-
if (xml.length > MAX_XML) throw new (0,
|
|
42836
|
-
if (/<!DOCTYPE/i.test(xml)) throw new (0,
|
|
42835
|
+
if (xml.length > MAX_XML) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uACAC\uBCF8 ${name} \uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4 (${(xml.length / 1048576).toFixed(1)}MB)`);
|
|
42836
|
+
if (/<!DOCTYPE/i.test(xml)) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uACAC\uBCF8 ${name} \uC5D0 DOCTYPE \uC774 \uC788\uC2B5\uB2C8\uB2E4 \u2014 \uD55C\uAE00 \uC800\uC7A5\uBCF8\uC774 \uC544\uB2D9\uB2C8\uB2E4`);
|
|
42837
42837
|
const issues = [];
|
|
42838
42838
|
createXmlParser(issues).parseFromString(xml, "text/xml");
|
|
42839
|
-
if (issues.some((w) => !/경고/.test(w.message))) throw new (0,
|
|
42839
|
+
if (issues.some((w) => !/경고/.test(w.message))) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uACAC\uBCF8 ${name} XML \uC774 \uC62C\uBC14\uB974\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4: ${issues[0].message}`);
|
|
42840
42840
|
}
|
|
42841
42841
|
async function loadTemplateZip(template) {
|
|
42842
42842
|
const buf = template instanceof Uint8Array ? template.buffer.slice(template.byteOffset, template.byteOffset + template.byteLength) : template;
|
|
42843
|
-
|
|
42843
|
+
_chunk6ZRZLV3Jcjs.precheckZipSize.call(void 0, buf, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
|
|
42844
42844
|
let zip;
|
|
42845
42845
|
try {
|
|
42846
42846
|
zip = await _jszip2.default.loadAsync(buf);
|
|
42847
42847
|
} catch (e40) {
|
|
42848
|
-
throw new (0,
|
|
42848
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uACAC\uBCF8\uC774 HWPX(zip)\uAC00 \uC544\uB2D9\uB2C8\uB2E4 \u2014 \uD55C\uAE00\uC5D0\uC11C .hwpx \uB85C \uC800\uC7A5\uD55C \uD30C\uC77C\uC744 \uC4F0\uC138\uC694 (.hwp \uB294 kordoc \uC73C\uB85C \uBA3C\uC800 \uBCC0\uD658)");
|
|
42849
42849
|
}
|
|
42850
42850
|
const names = Object.keys(zip.files);
|
|
42851
|
-
if (names.length > MAX_ZIP_ENTRIES) throw new (0,
|
|
42851
|
+
if (names.length > MAX_ZIP_ENTRIES) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uACAC\uBCF8 ZIP \uC5D4\uD2B8\uB9AC \uC218 \uCD08\uACFC (ZIP bomb \uC758\uC2EC)");
|
|
42852
42852
|
const bad = names.find((n) => n.split("/").includes("..") || n.startsWith("/") || n.includes("\\") || /^[A-Za-z]:/.test(n));
|
|
42853
|
-
if (bad) throw new (0,
|
|
42853
|
+
if (bad) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uACAC\uBCF8 ZIP \uC5D0 \uD5C8\uC6A9\uD558\uC9C0 \uC54A\uB294 \uACBD\uB85C\uAC00 \uC788\uC2B5\uB2C8\uB2E4: ${bad.slice(0, 80)}`);
|
|
42854
42854
|
const budget = { used: 0 };
|
|
42855
42855
|
const manifest = zip.file("META-INF/manifest.xml");
|
|
42856
42856
|
if (manifest && isEncryptedHwpx(await readText(zip, "META-INF/manifest.xml", budget))) {
|
|
42857
|
-
throw new (0,
|
|
42857
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uC554\uD638\uAC00 \uAC78\uB9B0 \uACAC\uBCF8\uC785\uB2C8\uB2E4 \u2014 \uD55C\uAE00\uC5D0\uC11C \uC554\uD638\uB97C \uD480\uACE0 \uC800\uC7A5\uD55C \uD30C\uC77C\uC744 \uC4F0\uC138\uC694");
|
|
42858
42858
|
}
|
|
42859
42859
|
const sections = await resolveSectionPaths(zip);
|
|
42860
42860
|
if (!sections.length || !zip.file(sections[0]) || !zip.file("Contents/header.xml")) {
|
|
42861
|
-
throw new (0,
|
|
42861
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uACAC\uBCF8 HWPX \uC5D0 Contents/header.xml \uB610\uB294 section0.xml \uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
42862
42862
|
}
|
|
42863
42863
|
const sectionXml = await readText(zip, sections[0], budget);
|
|
42864
42864
|
const headerXml = await readText(zip, "Contents/header.xml", budget);
|
|
@@ -43022,7 +43022,7 @@ var FAMILY_ROLE = {
|
|
|
43022
43022
|
var SYM_EXTRA = /^(?:\p{S}|[【〔〈《])$/u;
|
|
43023
43023
|
var SUBTITLE_RE = /^-\s.*\s-$/u;
|
|
43024
43024
|
function lineRole(plain4) {
|
|
43025
|
-
const t =
|
|
43025
|
+
const t = _chunkN65EY5BIcjs.mapPuaText.call(void 0, plain4.replace(/^[\s ]+/, ""));
|
|
43026
43026
|
if (!t || SUBTITLE_RE.test(t.trim())) return null;
|
|
43027
43027
|
const cls = markerClass(t);
|
|
43028
43028
|
if (FAMILY_ROLE[cls]) return FAMILY_ROLE[cls];
|
|
@@ -43057,7 +43057,7 @@ function fillParagraph(pXml, text, opts = {}) {
|
|
|
43057
43057
|
let prefixLen = ws, mStart = -1, mLen = 0;
|
|
43058
43058
|
if (opts.marker && ws < plain4.length) {
|
|
43059
43059
|
const cp = String.fromCodePoint(plain4.codePointAt(ws));
|
|
43060
|
-
if (isMarkerChar(
|
|
43060
|
+
if (isMarkerChar(_chunkN65EY5BIcjs.mapPuaText.call(void 0, cp))) {
|
|
43061
43061
|
mStart = ws;
|
|
43062
43062
|
mLen = cp.length;
|
|
43063
43063
|
prefixLen = ws + mLen + /^[\s ]*/.exec(plain4.slice(ws + mLen))[0].length;
|
|
@@ -43286,7 +43286,7 @@ function scanTemplate(sectionXml, headerXml) {
|
|
|
43286
43286
|
const t = infos[titleIdx].tbl;
|
|
43287
43287
|
contactInTitle = !!t && t.cells.some((c) => CONTACT_RE.test(c.text));
|
|
43288
43288
|
}
|
|
43289
|
-
const subIdx = _nullishCoalesce(_optionalChain([head, 'access', _809 => _809.find, 'call', _810 => _810(({ x, i }) => i !== titleIdx && !x.tbl && x.objs === 0 && SUBTITLE_RE.test(
|
|
43289
|
+
const subIdx = _nullishCoalesce(_optionalChain([head, 'access', _809 => _809.find, 'call', _810 => _810(({ x, i }) => i !== titleIdx && !x.tbl && x.objs === 0 && SUBTITLE_RE.test(_chunkN65EY5BIcjs.mapPuaText.call(void 0, x.plain.trim()))), 'optionalAccess', _811 => _811.i]), () => ( -1));
|
|
43290
43290
|
if (subIdx >= 0) set("subtitle", subIdx);
|
|
43291
43291
|
const summaryIdx = _nullishCoalesce(_optionalChain([head, 'access', _812 => _812.find, 'call', _813 => _813(({ x, i }) => i > titleIdx && _optionalChain([x, 'access', _814 => _814.tbl, 'optionalAccess', _815 => _815.rowCnt]) === 1 && x.tbl.colCnt === 1 && !CONTACT_RE.test(_nullishCoalesce(_optionalChain([x, 'access', _816 => _816.tbl, 'access', _817 => _817.cells, 'access', _818 => _818[0], 'optionalAccess', _819 => _819.text]), () => ( "")))), 'optionalAccess', _820 => _820.i]), () => ( -1));
|
|
43292
43292
|
if (summaryIdx >= 0) set("summary", summaryIdx);
|
|
@@ -43838,7 +43838,7 @@ async function markdownToHwpxFromTemplate(markdown, template, warnings = [], tot
|
|
|
43838
43838
|
let nextId = 1 + maxOf2(objIds);
|
|
43839
43839
|
let z = 1 + maxOf2([...scan.head.matchAll(OBJ_TAG_RE)].map((m) => Number(_nullishCoalesce(_optionalChain([/\bzOrder="(\d{1,10})"/, 'access', _885 => _885.exec, 'call', _886 => _886(m[0]), 'optionalAccess', _887 => _887[1]]), () => ( -1)))), -1);
|
|
43840
43840
|
const body = paras.join("").replace(OBJ_TAG_RE, (tag) => tag.replace(/\bid="\d*"/, () => `id="${nextId++}"`).replace(/\binstid="\d*"/, () => `instid="${nextId++}"`).replace(/\bzOrder="-?\d+"/, () => `zOrder="${z++}"`));
|
|
43841
|
-
if (body.length > MAX_OUTPUT) throw new (0,
|
|
43841
|
+
if (body.length > MAX_OUTPUT) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uC0DD\uC131 \uBCF8\uBB38\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4 (${(body.length / 1048576).toFixed(1)}MB) \u2014 \uC6D0\uACE0\uB97C \uB098\uB220 \uB9CC\uB4DC\uC138\uC694`);
|
|
43842
43842
|
const tops = topLevelParagraphs(sectionXml);
|
|
43843
43843
|
const newSection = sectionXml.slice(0, _nullishCoalesce(_optionalChain([tops, 'access', _888 => _888[0], 'optionalAccess', _889 => _889.start]), () => ( sectionXml.lastIndexOf("</")))) + body + sectionXml.slice(_nullishCoalesce(_optionalChain([tops, 'access', _890 => _890.at, 'call', _891 => _891(-1), 'optionalAccess', _892 => _892.end]), () => ( sectionXml.lastIndexOf("</"))));
|
|
43844
43844
|
let newHeader = appendHeader(ctx);
|
|
@@ -44153,7 +44153,7 @@ function builtinTemplateDir() {
|
|
|
44153
44153
|
for (const c of candidates) {
|
|
44154
44154
|
if (_fs.existsSync.call(void 0, _path.join.call(void 0, c, BUILTIN_TEMPLATES[0].file))) return c;
|
|
44155
44155
|
}
|
|
44156
|
-
throw new (0,
|
|
44156
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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)");
|
|
44157
44157
|
}
|
|
44158
44158
|
function readBuiltinTemplate(t) {
|
|
44159
44159
|
const buf = _fs.readFileSync.call(void 0, _path.join.call(void 0, builtinTemplateDir(), t.file));
|
|
@@ -44631,12 +44631,12 @@ function buildFloatPicXml(itemId, sizeHu, posXHu, posYHu, ids) {
|
|
|
44631
44631
|
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>`;
|
|
44632
44632
|
}
|
|
44633
44633
|
async function placeSealHwpx(hwpxBuffer, ops) {
|
|
44634
|
-
if (ops.length === 0) throw new (0,
|
|
44634
|
+
if (ops.length === 0) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("place_seal: \uBC30\uCE58\uD560 \uB3C4\uC7A5\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
44635
44635
|
const u8 = new Uint8Array(hwpxBuffer);
|
|
44636
|
-
|
|
44636
|
+
_chunk6ZRZLV3Jcjs.precheckZipSize.call(void 0, hwpxBuffer);
|
|
44637
44637
|
const zip = await _jszip2.default.loadAsync(hwpxBuffer);
|
|
44638
44638
|
const sectionPaths = Object.keys(zip.files).filter((name) => /[Ss]ection\d+\.xml$/i.test(name)).sort((a, b) => Number(_nullishCoalesce(_optionalChain([a, 'access', _1032 => _1032.match, 'call', _1033 => _1033(/(\d+)\.xml$/i), 'optionalAccess', _1034 => _1034[1]]), () => ( 0))) - Number(_nullishCoalesce(_optionalChain([b, 'access', _1035 => _1035.match, 'call', _1036 => _1036(/(\d+)\.xml$/i), 'optionalAccess', _1037 => _1037[1]]), () => ( 0))));
|
|
44639
|
-
if (sectionPaths.length === 0) throw new (0,
|
|
44639
|
+
if (sectionPaths.length === 0) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("HWPX\uC5D0\uC11C \uC139\uC158 \uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
44640
44640
|
const manifestPath = Object.keys(zip.files).find((name) => /\.hpf$/i.test(name));
|
|
44641
44641
|
const headerPath = Object.keys(zip.files).find((name) => /(^|\/)header\.xml$/i.test(name));
|
|
44642
44642
|
const styles = headerPath ? parseRenderStyles(await readZipEntry(zip.file(headerPath), "text")) : null;
|
|
@@ -44677,11 +44677,11 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
44677
44677
|
const manifestItems = [];
|
|
44678
44678
|
const placed = [];
|
|
44679
44679
|
for (const op of ops) {
|
|
44680
|
-
if (!op.anchor) throw new (0,
|
|
44681
|
-
if (!op.image || op.image.length === 0) throw new (0,
|
|
44680
|
+
if (!op.anchor) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("place_seal: anchor \uBB38\uAD6C\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
44681
|
+
if (!op.image || op.image.length === 0) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("place_seal: \uB3C4\uC7A5 \uC774\uBBF8\uC9C0\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4");
|
|
44682
44682
|
const ext = (_nullishCoalesce(op.ext, () => ( "png"))).toLowerCase();
|
|
44683
|
-
if (!MIME[ext]) throw new (0,
|
|
44684
|
-
if (!imageMagicMatches(op.image, ext)) throw new (0,
|
|
44683
|
+
if (!MIME[ext]) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`place_seal: \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC774\uBBF8\uC9C0 \uD655\uC7A5\uC790 .${ext} (png/jpg/bmp/gif)`);
|
|
44684
|
+
if (!imageMagicMatches(op.image, ext)) throw new (0, _chunk6ZRZLV3Jcjs.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)`);
|
|
44685
44685
|
const wantOcc = _nullishCoalesce(op.occurrence, () => ( 0));
|
|
44686
44686
|
let found = null;
|
|
44687
44687
|
let total = 0;
|
|
@@ -44714,7 +44714,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
44714
44714
|
}
|
|
44715
44715
|
}
|
|
44716
44716
|
}
|
|
44717
|
-
throw new (0,
|
|
44717
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(
|
|
44718
44718
|
`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)})`
|
|
44719
44719
|
);
|
|
44720
44720
|
}
|
|
@@ -44722,7 +44722,7 @@ async function placeSealHwpx(hwpxBuffer, ops) {
|
|
|
44722
44722
|
const xml = sectionXmls[si];
|
|
44723
44723
|
const run = anchorRunInfo(xml, site.para, op.anchor);
|
|
44724
44724
|
if (!run) {
|
|
44725
|
-
throw new (0,
|
|
44725
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`place_seal: \uC575\uCEE4 "${op.anchor}" \uBB38\uB2E8\uC5D0\uC11C run\uC744 \uCC3E\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4`);
|
|
44726
44726
|
}
|
|
44727
44727
|
const charPrHeight = _nullishCoalesce(_optionalChain([styles, 'optionalAccess', _1038 => _1038.charPr, 'access', _1039 => _1039.get, 'call', _1040 => _1040(run.charPr), 'optionalAccess', _1041 => _1041.height]), () => ( 1e3));
|
|
44728
44728
|
const fontPt = charPrHeight / 100;
|
|
@@ -45000,7 +45000,7 @@ function pick(map, keys) {
|
|
|
45000
45000
|
return out;
|
|
45001
45001
|
}
|
|
45002
45002
|
async function hwpxToProfile(input) {
|
|
45003
|
-
const buf = input instanceof ArrayBuffer ? input :
|
|
45003
|
+
const buf = input instanceof ArrayBuffer ? input : _chunk6ZRZLV3Jcjs.toArrayBuffer.call(void 0, input);
|
|
45004
45004
|
const zip = await _jszip2.default.loadAsync(buf);
|
|
45005
45005
|
const parser = createXmlParser();
|
|
45006
45006
|
const headerFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( _optionalChain([zip, 'access', _1066 => _1066.file, 'call', _1067 => _1067(/[Hh]eader\.xml$/), 'optionalAccess', _1068 => _1068[0]])));
|
|
@@ -45328,7 +45328,7 @@ function moneyHangulCheck(m) {
|
|
|
45328
45328
|
const n = Number(m[1].replace(/,/g, ""));
|
|
45329
45329
|
const h = hangulToNumber(m[2].replace(/\s/g, ""));
|
|
45330
45330
|
if (!Number.isFinite(n) || h === null || h === n) return null;
|
|
45331
|
-
return `\uAE08${m[1]}\uC6D0(\uAE08${
|
|
45331
|
+
return `\uAE08${m[1]}\uC6D0(\uAE08${_chunkN65EY5BIcjs.hangulAmount.call(void 0, n)}\uC6D0)`;
|
|
45332
45332
|
}
|
|
45333
45333
|
var RULES = [
|
|
45334
45334
|
// 날짜 ─ 온점 뒤 한 칸, 0 패딩 금지, 연도 4자리, 끝 마침표
|
|
@@ -45625,7 +45625,7 @@ function lintGongmunText(text, opts) {
|
|
|
45625
45625
|
}
|
|
45626
45626
|
function dictSuggest(code, match) {
|
|
45627
45627
|
const m = match.trim();
|
|
45628
|
-
if (code === "MONEY_NO_HANGUL") return `${m} \u2192 ${m}(\uAE08${
|
|
45628
|
+
if (code === "MONEY_NO_HANGUL") return `${m} \u2192 ${m}(\uAE08${_chunkN65EY5BIcjs.hangulAmount.call(void 0, m)}\uC6D0)`;
|
|
45629
45629
|
if (code === "DATE_HYPHEN") {
|
|
45630
45630
|
const d = m.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);
|
|
45631
45631
|
if (d) return `${m} \u2192 ${d[1]}. ${Number(d[2])}. ${Number(d[3])}.`;
|
|
@@ -46943,7 +46943,7 @@ function patchTableRows(input) {
|
|
|
46943
46943
|
const cells = input.editedCells(ins.ei);
|
|
46944
46944
|
if (!cells) return skip("\uC0BD\uC785 \uD589\uC5D0 \uC774\uBBF8\uC9C0/\uC911\uCCA9\uD45C \uD3EC\uD568 \u2014 \uD589 \uCD94\uAC00 \uBBF8\uC9C0\uC6D0");
|
|
46945
46945
|
for (const cell2 of cells) {
|
|
46946
|
-
const unstable = cell2.lines.find((l) =>
|
|
46946
|
+
const unstable = cell2.lines.find((l) => _chunkN65EY5BIcjs.sanitizeText.call(void 0, l) !== l);
|
|
46947
46947
|
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");
|
|
46948
46948
|
}
|
|
46949
46949
|
const tmplCells = scanTable.rows[template];
|
|
@@ -47138,14 +47138,14 @@ function buildEmbeddedLineSplices(para2, xml, newLines) {
|
|
|
47138
47138
|
}
|
|
47139
47139
|
if (text !== para2.text || !/[\r\n]/.test(text) || /<br\s*\/?\s*>/i.test(text)) return null;
|
|
47140
47140
|
const lines = text.split(/\r\n|\r|\n/);
|
|
47141
|
-
if (lines.length !== newLines.length || lines.some((line) => !line.trim() ||
|
|
47141
|
+
if (lines.length !== newLines.length || lines.some((line) => !line.trim() || _chunkN65EY5BIcjs.sanitizeText.call(void 0, line) !== line.trim())) return null;
|
|
47142
47142
|
const splices = [];
|
|
47143
47143
|
let offset = 0;
|
|
47144
47144
|
for (let i = 0; i < lines.length; i++) {
|
|
47145
47145
|
const line = lines[i];
|
|
47146
47146
|
const orig = line.trim();
|
|
47147
47147
|
const next = newLines[i];
|
|
47148
|
-
if (
|
|
47148
|
+
if (_chunkN65EY5BIcjs.sanitizeText.call(void 0, next) !== next || /[\r\n]/.test(next) || /[\uD800-\uDFFF]/u.test(next) || decodeXmlEntities(escapeXmlText(next)) !== next) return null;
|
|
47149
47149
|
let prefix = 0;
|
|
47150
47150
|
while (prefix < orig.length && prefix < next.length && orig[prefix] === next[prefix]) prefix++;
|
|
47151
47151
|
if (prefix > 0 && /[\uD800-\uDBFF]/.test(orig[prefix - 1]) && /[\uDC00-\uDFFF]/.test(_nullishCoalesce(orig[prefix], () => ( "")))) prefix--;
|
|
@@ -47382,12 +47382,12 @@ function stripCellTokens(text) {
|
|
|
47382
47382
|
}
|
|
47383
47383
|
function patchTextChunkTable(table2, scanTable, orig, edited, ctx, skip) {
|
|
47384
47384
|
if (table2.rows === 1 && table2.cols === 1) {
|
|
47385
|
-
const content =
|
|
47385
|
+
const content = _chunkN65EY5BIcjs.sanitizeText.call(void 0, table2.cells[0][0].text);
|
|
47386
47386
|
const replicaLines = content.split(/\n/).map((line) => {
|
|
47387
47387
|
const t = line.trim();
|
|
47388
47388
|
if (!t) return "";
|
|
47389
|
-
if (/^\d+\.\s/.test(t)) return `**${
|
|
47390
|
-
return
|
|
47389
|
+
if (/^\d+\.\s/.test(t)) return `**${_chunkN65EY5BIcjs.escapeGfm.call(void 0, t)}**`;
|
|
47390
|
+
return _chunkN65EY5BIcjs.escapeGfm.call(void 0, t);
|
|
47391
47391
|
}).filter(Boolean);
|
|
47392
47392
|
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");
|
|
47393
47393
|
if (extractCellTokens(orig.raw) !== extractCellTokens(edited.raw)) return skip("\uC140 \uB0B4 \uC774\uBBF8\uC9C0 \uBCC0\uACBD\uC740 \uBBF8\uC9C0\uC6D0");
|
|
@@ -47401,7 +47401,7 @@ function patchTextChunkTable(table2, scanTable, orig, edited, ctx, skip) {
|
|
|
47401
47401
|
if (table2.cols === 1 && table2.rows >= 2) {
|
|
47402
47402
|
const replica = [];
|
|
47403
47403
|
for (let r = 0; r < table2.rows; r++) {
|
|
47404
|
-
const line =
|
|
47404
|
+
const line = _chunkN65EY5BIcjs.escapeGfm.call(void 0, _chunkN65EY5BIcjs.sanitizeText.call(void 0, table2.cells[r][0].text)).replace(/\n/g, " ");
|
|
47405
47405
|
if (line) replica.push({ line, gridR: r });
|
|
47406
47406
|
}
|
|
47407
47407
|
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");
|
|
@@ -47455,7 +47455,7 @@ function applyCellEdit(table2, scanTable, gridR, gridC, newLines, ctx, before2,
|
|
|
47455
47455
|
}
|
|
47456
47456
|
const splices = [];
|
|
47457
47457
|
let sectionIndex = -1;
|
|
47458
|
-
const unstable = newLines.find((l) =>
|
|
47458
|
+
const unstable = newLines.find((l) => _chunkN65EY5BIcjs.sanitizeText.call(void 0, l) !== l);
|
|
47459
47459
|
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");
|
|
47460
47460
|
if (ctx.structure && newLines.length > Math.max(nonEmpty.length, 1) || ctx.structure && nonEmpty.length > 1 && newLines.length < nonEmpty.length) {
|
|
47461
47461
|
const done = restructureCellLines(cell2.paragraphs, newLines, ctx.scans, ctx.sectionSplices, normForMatch);
|
|
@@ -47522,7 +47522,7 @@ async function resolveSectionEntryNames(zip) {
|
|
|
47522
47522
|
const paths = parseSectionPathsFromManifest(xml).filter((p) => zip.file(p) !== null);
|
|
47523
47523
|
if (paths.length > 0) return paths;
|
|
47524
47524
|
}
|
|
47525
|
-
return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(
|
|
47525
|
+
return Object.keys(zip.files).filter((n) => /[Ss]ection\d+\.xml$/.test(n)).sort(_chunk6ZRZLV3Jcjs.compareSectionPaths);
|
|
47526
47526
|
}
|
|
47527
47527
|
|
|
47528
47528
|
// src/roundtrip/hwp5-patch.ts
|
|
@@ -48318,7 +48318,7 @@ function patchParagraph(block, orig, edited, ctx, skip) {
|
|
|
48318
48318
|
}
|
|
48319
48319
|
const origPlain = block.text != null ? block.text : restoreBr(textUnitToPlain(orig.raw, block));
|
|
48320
48320
|
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");
|
|
48321
|
-
if (
|
|
48321
|
+
if (_chunkN65EY5BIcjs.sanitizeText.call(void 0, newPlain) !== newPlain) {
|
|
48322
48322
|
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");
|
|
48323
48323
|
}
|
|
48324
48324
|
let origMd = restoreBr(textUnitToPlain(orig.raw, block));
|
|
@@ -48365,7 +48365,7 @@ function patchGfmCells(scanTable, orig, edited, ctx, skip) {
|
|
|
48365
48365
|
cellSkip("\uC140 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58 \u2014 \uC18C\uC2A4\uB9F5 \uC2E0\uB8B0 \uBD88\uAC00");
|
|
48366
48366
|
continue;
|
|
48367
48367
|
}
|
|
48368
|
-
if (afterEach.some((l) =>
|
|
48368
|
+
if (afterEach.some((l) => _chunkN65EY5BIcjs.sanitizeText.call(void 0, l) !== l)) {
|
|
48369
48369
|
cellSkip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uBBF8\uC9C0\uC6D0");
|
|
48370
48370
|
continue;
|
|
48371
48371
|
}
|
|
@@ -48393,7 +48393,7 @@ function patchGfmCells(scanTable, orig, edited, ctx, skip) {
|
|
|
48393
48393
|
cellSkip("\uC140 \uD14D\uC2A4\uD2B8 \uBD88\uC77C\uCE58 \u2014 \uC18C\uC2A4\uB9F5 \uC2E0\uB8B0 \uBD88\uAC00");
|
|
48394
48394
|
break;
|
|
48395
48395
|
}
|
|
48396
|
-
if (
|
|
48396
|
+
if (_chunkN65EY5BIcjs.sanitizeText.call(void 0, after2) !== after2) {
|
|
48397
48397
|
cellSkip("\uACF5\uBC31 \uC815\uADDC\uD654 \uBD88\uC548\uC815 \uD14D\uC2A4\uD2B8 \u2014 \uBBF8\uC9C0\uC6D0");
|
|
48398
48398
|
break;
|
|
48399
48399
|
}
|
|
@@ -48449,12 +48449,12 @@ function patchHtmlCells5(table2, scanTable, orig, edited, ctx, skip) {
|
|
|
48449
48449
|
}
|
|
48450
48450
|
function patchTextChunk5(table2, scanTable, orig, edited, ctx, skip) {
|
|
48451
48451
|
if (table2.rows === 1 && table2.cols === 1) {
|
|
48452
|
-
const content =
|
|
48452
|
+
const content = _chunkN65EY5BIcjs.sanitizeText.call(void 0, table2.cells[0][0].text);
|
|
48453
48453
|
const replicaLines = content.split(/\n/).map((line) => {
|
|
48454
48454
|
const t = line.trim();
|
|
48455
48455
|
if (!t) return "";
|
|
48456
|
-
if (/^\d+\.\s/.test(t)) return `**${
|
|
48457
|
-
return
|
|
48456
|
+
if (/^\d+\.\s/.test(t)) return `**${_chunkN65EY5BIcjs.escapeGfm.call(void 0, t)}**`;
|
|
48457
|
+
return _chunkN65EY5BIcjs.escapeGfm.call(void 0, t);
|
|
48458
48458
|
}).filter(Boolean);
|
|
48459
48459
|
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");
|
|
48460
48460
|
if (extractCellTokens(orig.raw) !== extractCellTokens(edited.raw)) return skip("\uC140 \uB0B4 \uC774\uBBF8\uC9C0 \uBCC0\uACBD\uC740 \uBBF8\uC9C0\uC6D0");
|
|
@@ -48468,7 +48468,7 @@ function patchTextChunk5(table2, scanTable, orig, edited, ctx, skip) {
|
|
|
48468
48468
|
if (table2.cols === 1 && table2.rows >= 2) {
|
|
48469
48469
|
const replica = [];
|
|
48470
48470
|
for (let r = 0; r < table2.rows; r++) {
|
|
48471
|
-
const line =
|
|
48471
|
+
const line = _chunkN65EY5BIcjs.escapeGfm.call(void 0, _chunkN65EY5BIcjs.sanitizeText.call(void 0, table2.cells[r][0].text)).replace(/\n/g, " ");
|
|
48472
48472
|
if (line) replica.push({ line, gridR: r });
|
|
48473
48473
|
}
|
|
48474
48474
|
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");
|
|
@@ -48509,7 +48509,7 @@ function applyCellEdit5(table2, scanTable, gridR, gridC, newLines, ctx, before2,
|
|
|
48509
48509
|
if (origLineCount !== void 0 && nonEmpty.length > 0 && origLineCount !== nonEmpty.length) {
|
|
48510
48510
|
return skip("\uC140 \uC904 \uACBD\uACC4 \uB9E4\uD551 \uBAA8\uD638 (\uBB38\uB2E8 \uB0B4 \uC904\uBC14\uAFC8) \u2014 \uBBF8\uC9C0\uC6D0");
|
|
48511
48511
|
}
|
|
48512
|
-
const unstable = newLines.find((l) =>
|
|
48512
|
+
const unstable = newLines.find((l) => _chunkN65EY5BIcjs.sanitizeText.call(void 0, l) !== l);
|
|
48513
48513
|
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");
|
|
48514
48514
|
const targets = nonEmpty.length > 0 ? nonEmpty : cell2.paras;
|
|
48515
48515
|
if (targets.length === 0) return skip("\uC140\uC5D0 \uBB38\uB2E8\uC774 \uC5C6\uC74C \u2014 \uBBF8\uC9C0\uC6D0");
|
|
@@ -48924,12 +48924,12 @@ function buildOrigUnits(blocks) {
|
|
|
48924
48924
|
const block = blocks[i];
|
|
48925
48925
|
let consume = 1;
|
|
48926
48926
|
let chunk;
|
|
48927
|
-
if (block.type === "paragraph" && block.text && /^\[별표\s*\d+/.test(
|
|
48927
|
+
if (block.type === "paragraph" && block.text && /^\[별표\s*\d+/.test(_chunkN65EY5BIcjs.sanitizeText.call(void 0, block.text))) {
|
|
48928
48928
|
const next = blocks[i + 1];
|
|
48929
48929
|
if (_optionalChain([next, 'optionalAccess', _1170 => _1170.type]) === "paragraph" && next.text && /관련\)?$/.test(next.text)) consume = 2;
|
|
48930
|
-
chunk =
|
|
48930
|
+
chunk = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, blocks.slice(i, i + consume));
|
|
48931
48931
|
} else {
|
|
48932
|
-
chunk =
|
|
48932
|
+
chunk = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, [block]);
|
|
48933
48933
|
}
|
|
48934
48934
|
if (chunk) {
|
|
48935
48935
|
const subUnits = splitMarkdownUnits(chunk);
|
|
@@ -49227,7 +49227,7 @@ function patchParagraphUnit(block, orig, edited, ctx, skip) {
|
|
|
49227
49227
|
}
|
|
49228
49228
|
}
|
|
49229
49229
|
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");
|
|
49230
|
-
if (
|
|
49230
|
+
if (_chunkN65EY5BIcjs.sanitizeText.call(void 0, newPlain) !== newPlain && _chunkN65EY5BIcjs.sanitizeText.call(void 0, origPlain) === origPlain) {
|
|
49231
49231
|
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");
|
|
49232
49232
|
}
|
|
49233
49233
|
const xml = _optionalChain([ctx, 'access', _1184 => _1184.scans, 'access', _1185 => _1185[mapping.para.sectionIndex], 'optionalAccess', _1186 => _1186.xml]);
|
|
@@ -49244,14 +49244,14 @@ function textUnitToPlain(raw, block) {
|
|
|
49244
49244
|
}
|
|
49245
49245
|
function textUnitInline(raw, block) {
|
|
49246
49246
|
let text = raw.split("\n").map((l) => l.trim()).filter(Boolean).join(" ");
|
|
49247
|
-
if (block.type === "heading" || block.text && /^\[별표\s*\d+/.test(
|
|
49247
|
+
if (block.type === "heading" || block.text && /^\[별표\s*\d+/.test(_chunkN65EY5BIcjs.sanitizeText.call(void 0, block.text))) {
|
|
49248
49248
|
text = text.replace(/^#{1,6}\s+/, "");
|
|
49249
49249
|
}
|
|
49250
49250
|
if (block.href) {
|
|
49251
49251
|
const linkMatch = text.match(/^\[([\s\S]*)\]\([^)]*\)$/);
|
|
49252
49252
|
if (linkMatch) text = linkMatch[1];
|
|
49253
49253
|
}
|
|
49254
|
-
if (/^\*[^*][\s\S]*\*$/.test(text) && block.text && /^\([^)]*조[^)]*관련\)$/.test(
|
|
49254
|
+
if (/^\*[^*][\s\S]*\*$/.test(text) && block.text && /^\([^)]*조[^)]*관련\)$/.test(_chunkN65EY5BIcjs.sanitizeText.call(void 0, block.text))) {
|
|
49255
49255
|
text = text.slice(1, -1);
|
|
49256
49256
|
}
|
|
49257
49257
|
return text;
|
|
@@ -51802,7 +51802,7 @@ function blocksToChunks(blocks, options) {
|
|
|
51802
51802
|
const granularity = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1217 => _1217.granularity]), () => ( "section"));
|
|
51803
51803
|
const includeCells = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1218 => _1218.includeTableCells]), () => ( false));
|
|
51804
51804
|
const mdOptions = { tableFormat: _optionalChain([options, 'optionalAccess', _1219 => _1219.tableFormat]) };
|
|
51805
|
-
if (_optionalChain([options, 'optionalAccess', _1220 => _1220.tableFormat]) === "gfm")
|
|
51805
|
+
if (_optionalChain([options, 'optionalAccess', _1220 => _1220.tableFormat]) === "gfm") _chunkN65EY5BIcjs.assignTableIds.call(void 0, blocks);
|
|
51806
51806
|
const chunks = [];
|
|
51807
51807
|
const headingStack = [];
|
|
51808
51808
|
const listStack = [];
|
|
@@ -51816,12 +51816,12 @@ function blocksToChunks(blocks, options) {
|
|
|
51816
51816
|
let run = null;
|
|
51817
51817
|
const flushRun = () => {
|
|
51818
51818
|
if (!run) return;
|
|
51819
|
-
push("text", run.breadcrumb,
|
|
51819
|
+
push("text", run.breadcrumb, _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, run.blocks, mdOptions), [run.start, run.end], run.page);
|
|
51820
51820
|
run = null;
|
|
51821
51821
|
};
|
|
51822
51822
|
for (let i = 0; i < blocks.length; i++) {
|
|
51823
51823
|
const block = blocks[i];
|
|
51824
|
-
const md2 =
|
|
51824
|
+
const md2 = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, [block], mdOptions);
|
|
51825
51825
|
if (!md2) continue;
|
|
51826
51826
|
if (block.type === "heading") {
|
|
51827
51827
|
flushRun();
|
|
@@ -51909,7 +51909,7 @@ function u8ToArrayBuffer2(u8) {
|
|
|
51909
51909
|
return u8.buffer.slice(u8.byteOffset, u8.byteOffset + u8.byteLength);
|
|
51910
51910
|
}
|
|
51911
51911
|
function irCellLines(text) {
|
|
51912
|
-
return stripCellTokens(
|
|
51912
|
+
return stripCellTokens(_chunkN65EY5BIcjs.sanitizeText.call(void 0, text)).split("\n").map((s) => s.trim()).filter(Boolean);
|
|
51913
51913
|
}
|
|
51914
51914
|
var HwpxSession = (_class10 = class _HwpxSession {
|
|
51915
51915
|
|
|
@@ -52169,7 +52169,7 @@ var HwpxSession = (_class10 = class _HwpxSession {
|
|
|
52169
52169
|
if (newPlain === "") {
|
|
52170
52170
|
return skip("\uBE14\uB85D \uBE44\uC6B0\uAE30/\uC0AD\uC81C\uB294 \uBBF8\uC9C0\uC6D0 (v1) \u2014 \uC6D0\uBCF8 \uC720\uC9C0");
|
|
52171
52171
|
}
|
|
52172
|
-
if (
|
|
52172
|
+
if (_chunkN65EY5BIcjs.sanitizeText.call(void 0, newPlain) !== newPlain) {
|
|
52173
52173
|
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");
|
|
52174
52174
|
}
|
|
52175
52175
|
const splices = buildParagraphSplices(mapping.para, newPlain, _optionalChain([st, 'access', _1240 => _1240.scans, 'access', _1241 => _1241[mapping.para.sectionIndex], 'optionalAccess', _1242 => _1242.xml]));
|
|
@@ -52264,7 +52264,7 @@ var md = new (0, _markdownit2.default)({
|
|
|
52264
52264
|
});
|
|
52265
52265
|
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;
|
|
52266
52266
|
function sanitizeRawHtml(raw) {
|
|
52267
|
-
return raw.replace(/<[^>]*>|</g, (tag) => SAFE_RAW_TAG.test(tag) ? tag :
|
|
52267
|
+
return raw.replace(/<[^>]*>|</g, (tag) => SAFE_RAW_TAG.test(tag) ? tag : _chunk6ZRZLV3Jcjs.escapeHtml.call(void 0, tag));
|
|
52268
52268
|
}
|
|
52269
52269
|
md.renderer.rules.html_block = (tokens, idx) => sanitizeRawHtml(tokens[idx].content);
|
|
52270
52270
|
md.renderer.rules.html_inline = (tokens, idx) => sanitizeRawHtml(tokens[idx].content);
|
|
@@ -52272,7 +52272,7 @@ function renderHtml(markdown, options) {
|
|
|
52272
52272
|
const preset = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1246 => _1246.preset]), () => ( "default"));
|
|
52273
52273
|
const css = PRESETS[preset] + (_nullishCoalesce(_optionalChain([options, 'optionalAccess', _1247 => _1247.extraCss]), () => ( "")));
|
|
52274
52274
|
const body = md.render(markdown);
|
|
52275
|
-
const watermark = _optionalChain([options, 'optionalAccess', _1248 => _1248.watermark]) ? `<div class="watermark">${
|
|
52275
|
+
const watermark = _optionalChain([options, 'optionalAccess', _1248 => _1248.watermark]) ? `<div class="watermark">${_chunk6ZRZLV3Jcjs.escapeHtml.call(void 0, options.watermark)}</div>` : "";
|
|
52276
52276
|
const watermarkCss = _optionalChain([options, 'optionalAccess', _1249 => _1249.watermark]) ? `
|
|
52277
52277
|
.watermark {
|
|
52278
52278
|
position: fixed;
|
|
@@ -52326,13 +52326,13 @@ async function htmlToPdf(html, options) {
|
|
|
52326
52326
|
try {
|
|
52327
52327
|
puppeteer = await Promise.resolve().then(() => _interopRequireWildcard(require("puppeteer-core")));
|
|
52328
52328
|
} catch (e43) {
|
|
52329
|
-
throw new (0,
|
|
52329
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(
|
|
52330
52330
|
"PDF \uC0DD\uC131\uC5D0 puppeteer-core\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. \uC124\uCE58: npm install puppeteer-core"
|
|
52331
52331
|
);
|
|
52332
52332
|
}
|
|
52333
52333
|
const executablePath = _nullishCoalesce(process.env.PUPPETEER_EXECUTABLE_PATH, () => ( findChromiumPath()));
|
|
52334
52334
|
if (!executablePath) {
|
|
52335
|
-
throw new (0,
|
|
52335
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(
|
|
52336
52336
|
"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."
|
|
52337
52337
|
);
|
|
52338
52338
|
}
|
|
@@ -52387,7 +52387,7 @@ async function markdownToPdf(markdown, options) {
|
|
|
52387
52387
|
return htmlToPdf(html, options);
|
|
52388
52388
|
}
|
|
52389
52389
|
async function blocksToPdf(blocks, options) {
|
|
52390
|
-
const markdown =
|
|
52390
|
+
const markdown = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, blocks);
|
|
52391
52391
|
return markdownToPdf(markdown, options);
|
|
52392
52392
|
}
|
|
52393
52393
|
|
|
@@ -52498,6 +52498,12 @@ function solveRowHeights(cells, rowCount, maxTotal = Number.POSITIVE_INFINITY, s
|
|
|
52498
52498
|
for (const r of missing) h[r] = each;
|
|
52499
52499
|
return true;
|
|
52500
52500
|
};
|
|
52501
|
+
for (let r = 0; r < rowCount; r++) {
|
|
52502
|
+
if (h[r] !== 0) continue;
|
|
52503
|
+
let need = 0;
|
|
52504
|
+
for (const { c, rows } of spans) if (rows[rows.length - 1] === r && rows.slice(0, -1).every((q) => h[q] > 0)) need = Math.max(need, c.height - rows.slice(0, -1).reduce((t, q) => t + h[q], 0));
|
|
52505
|
+
if (need > 0) h[r] = need;
|
|
52506
|
+
}
|
|
52501
52507
|
for (let again = true; again; ) {
|
|
52502
52508
|
again = false;
|
|
52503
52509
|
for (let k = 0; k < spans.length; k++) if (!done.has(k) && solve(k, true)) again = true;
|
|
@@ -52976,6 +52982,7 @@ function splitTableRows(tbl2, top, lim, bodyH, styles, notes) {
|
|
|
52976
52982
|
const fl = () => notes && nN > 0 ? Math.min(floor, bodyH - notes.area((moved ? 0 : notes.n0) + nN, (moved ? 0 : notes.s0) + nS)) : floor;
|
|
52977
52983
|
const sp = num2(tbl2, "cellSpacing");
|
|
52978
52984
|
const cells = mode === "CELL" ? collectCells(tbl2) : [];
|
|
52985
|
+
const tableCells = mode === "TABLE" ? collectCells(tbl2) : [];
|
|
52979
52986
|
const record = mode === "CELL" ? /* @__PURE__ */ new Map() : void 0;
|
|
52980
52987
|
const carries = /* @__PURE__ */ new Map();
|
|
52981
52988
|
for (let r = 0; r < rows.length; r++) {
|
|
@@ -53004,7 +53011,20 @@ function splitTableRows(tbl2, top, lim, bodyH, styles, notes) {
|
|
|
53004
53011
|
y += h;
|
|
53005
53012
|
continue;
|
|
53006
53013
|
}
|
|
53007
|
-
|
|
53014
|
+
let need = h;
|
|
53015
|
+
if (!tableCells.some((c) => c.ra < r && c.ra + c.rs > r)) {
|
|
53016
|
+
let end = r + 1;
|
|
53017
|
+
for (let grown = true; grown; ) {
|
|
53018
|
+
grown = false;
|
|
53019
|
+
for (const c of tableCells) if (c.ra >= r && c.ra < end && c.ra + c.rs > end) {
|
|
53020
|
+
end = c.ra + c.rs;
|
|
53021
|
+
grown = true;
|
|
53022
|
+
}
|
|
53023
|
+
}
|
|
53024
|
+
const groupH = rows.slice(r, end).reduce((a, b) => a + b, 0);
|
|
53025
|
+
if (end > r + 1 && groupH <= bodyH - outT - outB - headH) need = groupH;
|
|
53026
|
+
}
|
|
53027
|
+
if (y + need + outB > fl() && !(moved && y === outT + headH)) {
|
|
53008
53028
|
if (!moved && r === 0) splitWhole = true;
|
|
53009
53029
|
y = outT + headH;
|
|
53010
53030
|
floor = bodyH;
|
|
@@ -54612,6 +54632,26 @@ function cellLineBoxes(c) {
|
|
|
54612
54632
|
function cellLines(c) {
|
|
54613
54633
|
return cellLineBoxes(c).map((b) => [b.top, b.bottom]);
|
|
54614
54634
|
}
|
|
54635
|
+
function spanPartRows(cells, rowY) {
|
|
54636
|
+
const out = /* @__PURE__ */ new Set();
|
|
54637
|
+
for (const c of cells) {
|
|
54638
|
+
if (c.rs < 2) continue;
|
|
54639
|
+
const bs = cellLineBoxes(c);
|
|
54640
|
+
const parts = bs.length ? bs[bs.length - 1].part : 0;
|
|
54641
|
+
let s = c.ra;
|
|
54642
|
+
for (let k = 0; k < parts; k++) {
|
|
54643
|
+
const inK = bs.filter((b) => b.part === k);
|
|
54644
|
+
if (!inK.length) break;
|
|
54645
|
+
const ext = Math.max(...inK.map((b) => b.bottom)) - inK[0].origin + c.marginT + c.marginB;
|
|
54646
|
+
let r = s + 1;
|
|
54647
|
+
while (r < c.ra + c.rs && rowY[r] - rowY[s] < ext - 100) r++;
|
|
54648
|
+
if (r >= c.ra + c.rs) break;
|
|
54649
|
+
out.add(r);
|
|
54650
|
+
s = r;
|
|
54651
|
+
}
|
|
54652
|
+
}
|
|
54653
|
+
return out;
|
|
54654
|
+
}
|
|
54615
54655
|
function planTableRows(tbl2, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan, nested = false, contMT = MT) {
|
|
54616
54656
|
if (nested) slack = 0;
|
|
54617
54657
|
const nRows = rowH.length;
|
|
@@ -54644,9 +54684,15 @@ function planTableRows(tbl2, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan,
|
|
|
54644
54684
|
const out = [];
|
|
54645
54685
|
const flows = (_nullishCoalesce(_optionalChain([findChildByLocalName, 'call', _1460 => _1460(tbl2, "pos"), 'optionalAccess', _1461 => _1461.getAttribute, 'call', _1462 => _1462("vertRelTo")]), () => ( "PARA"))) === "PARA";
|
|
54646
54686
|
let page = 0, y = ty, first = !flows || ty - MT < 2e3;
|
|
54687
|
+
const spanStarts = cellSplit ? spanPartRows(cells, rowY) : /* @__PURE__ */ new Set();
|
|
54647
54688
|
for (let r = 0; r < nRows; r++) {
|
|
54648
54689
|
let h = rowH[r];
|
|
54649
54690
|
const pieces = [];
|
|
54691
|
+
if (!first && r >= hdrRows && spanStarts.has(r)) {
|
|
54692
|
+
page++;
|
|
54693
|
+
y = contTop;
|
|
54694
|
+
first = true;
|
|
54695
|
+
}
|
|
54650
54696
|
const rowCells = cells.filter((c) => c.ra === r && c.rs === 1);
|
|
54651
54697
|
const splittable = cellSplit && r >= hdrRows && rowCells.length > 0;
|
|
54652
54698
|
const stack = splittable && rowCells.length === 1 ? stackedFloats(rowCells[0]) : [];
|
|
@@ -54861,6 +54907,21 @@ function planTableRows(tbl2, cells, rowH, ty, MT, BODY_H, slack = 0, floatSpan,
|
|
|
54861
54907
|
page++;
|
|
54862
54908
|
y = contTop;
|
|
54863
54909
|
first = true;
|
|
54910
|
+
} else if (!first && tbl2.getAttribute("pageBreak") === "TABLE" && r >= hdrRows && !cells.some((c) => c.ra < r && c.ra + c.rs > r)) {
|
|
54911
|
+
let end = r + 1;
|
|
54912
|
+
for (let grown = true; grown; ) {
|
|
54913
|
+
grown = false;
|
|
54914
|
+
for (const c of cells) if (c.ra >= r && c.ra < end && c.ra + c.rs > end) {
|
|
54915
|
+
end = c.ra + c.rs;
|
|
54916
|
+
grown = true;
|
|
54917
|
+
}
|
|
54918
|
+
}
|
|
54919
|
+
const groupH = rowY[Math.min(end, nRows)] - rowY[r];
|
|
54920
|
+
if (end > r + 1 && y + groupH + outB > pageBottom && groupH <= pageBottom - contTop) {
|
|
54921
|
+
page++;
|
|
54922
|
+
y = contTop;
|
|
54923
|
+
first = true;
|
|
54924
|
+
}
|
|
54864
54925
|
}
|
|
54865
54926
|
out.push([{ page, y, h }]);
|
|
54866
54927
|
y += h;
|
|
@@ -54903,12 +54964,27 @@ function renderingMatrix(el) {
|
|
|
54903
54964
|
const info = findChildByLocalName(el, "renderingInfo");
|
|
54904
54965
|
if (!info) return null;
|
|
54905
54966
|
let m = null;
|
|
54967
|
+
let pendingS = null;
|
|
54968
|
+
const apply = (n) => {
|
|
54969
|
+
m = m ? mulAffine(m, n) : n;
|
|
54970
|
+
};
|
|
54906
54971
|
for (const c of elements(info)) {
|
|
54907
54972
|
const tag = ln(c);
|
|
54908
54973
|
if (tag !== "transMatrix" && tag !== "scaMatrix" && tag !== "rotMatrix") continue;
|
|
54909
54974
|
const n = [num2(c, "e1", 1), num2(c, "e4"), num2(c, "e2"), num2(c, "e5", 1), num2(c, "e3"), num2(c, "e6")];
|
|
54910
|
-
|
|
54975
|
+
if (tag === "scaMatrix") {
|
|
54976
|
+
if (pendingS) apply(pendingS);
|
|
54977
|
+
pendingS = n;
|
|
54978
|
+
continue;
|
|
54979
|
+
}
|
|
54980
|
+
if (tag === "rotMatrix" && pendingS) {
|
|
54981
|
+
apply(mulAffine(n, pendingS));
|
|
54982
|
+
pendingS = null;
|
|
54983
|
+
continue;
|
|
54984
|
+
}
|
|
54985
|
+
apply(n);
|
|
54911
54986
|
}
|
|
54987
|
+
if (pendingS) apply(pendingS);
|
|
54912
54988
|
return m;
|
|
54913
54989
|
}
|
|
54914
54990
|
function objectGeometry(el, x, y, w, h, boxW = w, boxH = h) {
|
|
@@ -55015,7 +55091,7 @@ function linePushedBy(o, lineV, paraTop) {
|
|
|
55015
55091
|
const raw = num2(pos, "vertOffset"), vo = (_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _1479 => _1479.getAttribute, 'call', _1480 => _1480("vertRelTo")]), () => ( "PARA"))) === "PARA" ? Math.max(0, raw >= 2 ** 31 ? raw - 2 ** 32 : raw) : 0;
|
|
55016
55092
|
return Math.abs(lineV - (vo + num2(om, "top") + o.height + num2(om, "bottom")) - paraTop) <= 10;
|
|
55017
55093
|
}
|
|
55018
|
-
function anchorObject(o, ox, oy, baseV, areaW, ctx, anchorLineV, stayLine = false, paraStartV, lineH, lineSB = 0) {
|
|
55094
|
+
function anchorObject(o, ox, oy, baseV, areaW, ctx, anchorLineV, stayLine = false, paraStartV, lineH, lineSB = 0, anchorAt = "end") {
|
|
55019
55095
|
const { PW, PH, ML, MT, BODY_W, BODY_H } = ctx.geom;
|
|
55020
55096
|
const pos = findChildByLocalName(o.el, "pos");
|
|
55021
55097
|
const om = findChildByLocalName(o.el, "outMargin");
|
|
@@ -55043,8 +55119,9 @@ function anchorObject(o, ox, oy, baseV, areaW, ctx, anchorLineV, stayLine = fals
|
|
|
55043
55119
|
y = oy + anchor + omT + vo;
|
|
55044
55120
|
} else {
|
|
55045
55121
|
const origin = vrel === "PARA" && wrap === "SQUARE" ? _nullishCoalesce(paraStartV, () => ( baseV)) : baseV;
|
|
55046
|
-
const later = vrel === "PARA" && wrap === "SQUARE" && anchorLineV !== void 0 && anchorLineV > baseV;
|
|
55047
|
-
|
|
55122
|
+
const later = vrel === "PARA" && wrap === "SQUARE" && anchorAt === "end" && anchorLineV !== void 0 && anchorLineV > baseV;
|
|
55123
|
+
const midLater = vrel === "PARA" && wrap === "SQUARE" && anchorAt === "top" && anchorLineV !== void 0 && anchorLineV > baseV;
|
|
55124
|
+
y = later ? oy + anchorLineV + vo + omT : oy + Math.max(origin + vo, wrap === "SQUARE" && !midLater && anchorLineV !== void 0 ? anchorLineV : -Infinity) + omT;
|
|
55048
55125
|
}
|
|
55049
55126
|
let x;
|
|
55050
55127
|
const omL = num2(om, "left"), omR = num2(om, "right");
|
|
@@ -55523,7 +55600,7 @@ function drawPara(p, ox, oy, areaW, ctx, depth, segPages) {
|
|
|
55523
55600
|
if (st.italic) attrs.push(`font-style="italic"`);
|
|
55524
55601
|
if (st.underline) attrs.push(`text-decoration="underline"`);
|
|
55525
55602
|
if (st.color) attrs.push(`fill="${escapeXml7(st.color)}"`);
|
|
55526
|
-
emit(ctx, `<text ${attrs.join(" ")}>${escapeXml7(
|
|
55603
|
+
emit(ctx, `<text ${attrs.join(" ")}>${escapeXml7(_chunkN65EY5BIcjs.mapPuaText.call(void 0, text))}</text>`);
|
|
55527
55604
|
ctx.stats.texts++;
|
|
55528
55605
|
}
|
|
55529
55606
|
return sw;
|
|
@@ -55574,7 +55651,8 @@ function drawPara(p, ox, oy, areaW, ctx, depth, segPages) {
|
|
|
55574
55651
|
const plan = plans[planIdx];
|
|
55575
55652
|
if (segPages && segPages[planIdx] !== void 0) ctx.page = segPages[planIdx];
|
|
55576
55653
|
const x = ox + plan.seg.horzpos + plan.xoff + advanceTo(m, ctx.styles, plan, o.index) + o.omL;
|
|
55577
|
-
const
|
|
55654
|
+
const shadowed = o.tag === "pic" && !!findChildByLocalName(_nullishCoalesce(findChildByLocalName(o.el, "effects"), () => ( o.el)), "shadow") && plan.seg.textheight > o.height && Math.abs(plan.seg.baseline - Math.round(plan.seg.textheight * 0.85)) <= 2;
|
|
55655
|
+
const eqAsc = o.tag === "equation" && Number(o.el.getAttribute("baseLine")) > 0 ? Math.round(o.height * Number(o.el.getAttribute("baseLine")) / 100) : shadowed ? Math.round(plan.seg.textheight * 0.85) : o.tag === "pic" ? Math.round(o.height * 0.85) : o.height;
|
|
55578
55656
|
const iom = findChildByLocalName(o.el, "outMargin"), iomT = num2(iom, "top"), iomB = num2(iom, "bottom");
|
|
55579
55657
|
const yTop = oy + plan.seg.vertpos + Math.max(iomT, plan.seg.baseline - eqAsc - iomB - captionExtra(o.el));
|
|
55580
55658
|
drawObject(o, x, yTop, baseV, areaW, ctx, depth);
|
|
@@ -55588,9 +55666,11 @@ function drawPara(p, ox, oy, areaW, ctx, depth, segPages) {
|
|
|
55588
55666
|
}
|
|
55589
55667
|
let anchorLineV;
|
|
55590
55668
|
let anchorLineH = 0;
|
|
55669
|
+
let anchorSeg;
|
|
55591
55670
|
for (const pl of plans) if (pl.start <= o.index) {
|
|
55592
55671
|
anchorLineV = pl.seg.vertpos;
|
|
55593
55672
|
anchorLineH = pl.seg.textheight;
|
|
55673
|
+
anchorSeg = pl.seg;
|
|
55594
55674
|
}
|
|
55595
55675
|
let objBaseV = baseV;
|
|
55596
55676
|
const pTop = depth === 0 ? _optionalChain([ctx, 'access', _1501 => _1501.paraTops, 'optionalAccess', _1502 => _1502.get, 'call', _1503 => _1503(p)]) : void 0;
|
|
@@ -55601,6 +55681,9 @@ function drawPara(p, ox, oy, areaW, ctx, depth, segPages) {
|
|
|
55601
55681
|
if (baseV > start + 100) {
|
|
55602
55682
|
objBaseV = start;
|
|
55603
55683
|
if (anchorLineV === baseV) anchorLineV = start;
|
|
55684
|
+
} else if (depth > 0 && start > top0 && Math.abs(baseV - start) <= 100) {
|
|
55685
|
+
objBaseV = top0;
|
|
55686
|
+
if (anchorLineV === baseV) anchorLineV = top0;
|
|
55604
55687
|
}
|
|
55605
55688
|
}
|
|
55606
55689
|
const tbFloats = m.objs.filter((q) => !q.inline && (_nullishCoalesce(q.el.getAttribute("textWrap"), () => ( "TOP_AND_BOTTOM"))) === "TOP_AND_BOTTOM" && (_nullishCoalesce(_optionalChain([findChildByLocalName, 'call', _1509 => _1509(q.el, "pos"), 'optionalAccess', _1510 => _1510.getAttribute, 'call', _1511 => _1511("vertRelTo")]), () => ( "PARA"))) === "PARA").length;
|
|
@@ -55608,7 +55691,21 @@ function drawPara(p, ox, oy, areaW, ctx, depth, segPages) {
|
|
|
55608
55691
|
const sbA = m.paraPrId != null ? _nullishCoalesce(_optionalChain([ctx, 'access', _1512 => _1512.styles, 'access', _1513 => _1513.paraGeom, 'access', _1514 => _1514.get, 'call', _1515 => _1515(m.paraPrId), 'optionalAccess', _1516 => _1516.spaceBefore]), () => ( 0)) : 0;
|
|
55609
55692
|
if (stay && wrapA === "TOP_AND_BOTTOM" && linePushedBy(o, _nullishCoalesce(anchorLineV, () => ( baseV)), _nullishCoalesce(pTop, () => ( (depth > 0 ? cellParaTop(p, ctx.styles.paraGeom) : void 0))))) stay = false;
|
|
55610
55693
|
const firstLine = anchorLineV === void 0 || anchorLineV === baseV;
|
|
55611
|
-
let { x, y } = anchorObject(
|
|
55694
|
+
let { x, y } = anchorObject(
|
|
55695
|
+
o,
|
|
55696
|
+
ax,
|
|
55697
|
+
oy,
|
|
55698
|
+
objBaseV,
|
|
55699
|
+
aw,
|
|
55700
|
+
ctx,
|
|
55701
|
+
anchorLineV,
|
|
55702
|
+
stay ? sbA : false,
|
|
55703
|
+
(firstLine || wrapA === "SQUARE") && pTop !== void 0 && pTop < baseV ? pTop : void 0,
|
|
55704
|
+
anchorLineH,
|
|
55705
|
+
firstLine ? sbA : 0,
|
|
55706
|
+
// 문단 중간 글자 앵커인데 첫 줄부터 앵커 줄만큼 좁게 저장됐으면 개체는 문단 위에 있다(같은 판 한컴 PDF: 둘째 줄 앵커 사진, 네 줄 모두 34602)
|
|
55707
|
+
m.chars.slice(o.index).some((c) => c.ch.trim() !== "") && !!anchorSeg && plans.length > 0 && plans[0].seg !== anchorSeg && Math.abs(plans[0].seg.horzsize - anchorSeg.horzsize) <= 100 && anchorSeg.horzpos + anchorSeg.horzsize < aw - 1e3 ? "top" : m.chars.slice(o.index).some((c) => c.ch.trim() !== "") ? "mid" : "end"
|
|
55708
|
+
);
|
|
55612
55709
|
let stackTop = depth === 0 ? _nullishCoalesce(pTop, () => ( 0)) : cellParaTop(p, ctx.styles.paraGeom);
|
|
55613
55710
|
if (tbFloats >= 2 && wrapA === "TOP_AND_BOTTOM" && stackTop !== void 0) {
|
|
55614
55711
|
if (!tbStack) {
|
|
@@ -55863,14 +55960,32 @@ function drawTable(tbl2, tx, ty, ctx, depth) {
|
|
|
55863
55960
|
pcs.forEach((pc, k) => geom.push({ c, page: startPage + pc.page, ...xw(c), y: pc.y, h: pc.h, pieces: k === 0 ? pcs : [] }));
|
|
55864
55961
|
continue;
|
|
55865
55962
|
}
|
|
55963
|
+
if (c.rs > 1) {
|
|
55964
|
+
const span2 = plan.slice(c.ra, Math.min(c.ra + c.rs, nRows)).flat();
|
|
55965
|
+
const pages = [...new Set(span2.map((pc) => pc.page))];
|
|
55966
|
+
if (pages.length > 1) {
|
|
55967
|
+
const bs = cellLineBoxes(c);
|
|
55968
|
+
const partTop = (k) => bs.find((b) => b.part === k);
|
|
55969
|
+
const groups = pages.map((pg, k) => {
|
|
55970
|
+
const on = span2.filter((pc) => pc.page === pg);
|
|
55971
|
+
const y0 = Math.min(...on.map((pc) => pc.y)), y1 = Math.max(...on.map((pc) => pc.y + pc.h));
|
|
55972
|
+
const from = k === 0 ? 0 : _nullishCoalesce(_optionalChain([partTop, 'call', _1539 => _1539(k), 'optionalAccess', _1540 => _1540.origin]), () => ( Number.POSITIVE_INFINITY));
|
|
55973
|
+
const to = k === pages.length - 1 ? Number.POSITIVE_INFINITY : _nullishCoalesce(_optionalChain([partTop, 'call', _1541 => _1541(k + 1), 'optionalAccess', _1542 => _1542.top]), () => ( Number.POSITIVE_INFINITY));
|
|
55974
|
+
return { page: pg, y: y0, h: y1 - y0, range: /* @__PURE__ */ new Map([[c.el, [from, to]]]) };
|
|
55975
|
+
});
|
|
55976
|
+
groups.forEach((pc, k) => geom.push({ c, page: startPage + pc.page, ...xw(c), y: pc.y, h: pc.h, pieces: k === 0 ? groups : [] }));
|
|
55977
|
+
continue;
|
|
55978
|
+
}
|
|
55979
|
+
}
|
|
55866
55980
|
const h = c.rs === 1 ? pcs[0].h : rowY[Math.min(c.ra + c.rs, nRows)] - rowY[c.ra];
|
|
55867
55981
|
geom.push({ c, page: startPage + pcs[0].page, ...xw(c), y: pcs[0].y, h });
|
|
55868
55982
|
}
|
|
55869
|
-
|
|
55983
|
+
const contBase = depth !== 1 && ctx.splitContMT !== void 0 ? ctx.splitContMT : ctx.geom.MT;
|
|
55984
|
+
for (const page of contPages) for (const c of cells) if (c.ra < hdrRows) geom.push({ c, page, ...xw(c), y: contBase + num2(findChildByLocalName(tbl2, "outMargin"), "top") + rowY[c.ra], h: rowY[Math.min(c.ra + c.rs, nRows)] - rowY[c.ra] });
|
|
55870
55985
|
for (const g3 of geom) {
|
|
55871
55986
|
ctx.page = g3.page;
|
|
55872
55987
|
const bf = g3.c.bfId != null ? ctx.styles.borderFill.get(g3.c.bfId) : void 0;
|
|
55873
|
-
if (_optionalChain([bf, 'optionalAccess',
|
|
55988
|
+
if (_optionalChain([bf, 'optionalAccess', _1543 => _1543.fill])) emit(ctx, `<rect x="${pt2(g3.x)}" y="${pt2(g3.y)}" width="${pt2(g3.w)}" height="${pt2(g3.h)}" fill="${escapeXml7(bf.fill)}"/>`);
|
|
55874
55989
|
}
|
|
55875
55990
|
for (const g3 of geom) {
|
|
55876
55991
|
const { c } = g3;
|
|
@@ -55881,14 +55996,14 @@ function drawTable(tbl2, tx, ty, ctx, depth) {
|
|
|
55881
55996
|
const boxes = cellLineBoxes(c);
|
|
55882
55997
|
const contV = new Map(boxes.map((b) => [b.seg, b.top]));
|
|
55883
55998
|
const pieceOf = (v) => Math.max(0, g3.pieces.findIndex((pc) => {
|
|
55884
|
-
const r = _optionalChain([pc, 'access',
|
|
55999
|
+
const r = _optionalChain([pc, 'access', _1544 => _1544.range, 'optionalAccess', _1545 => _1545.get, 'call', _1546 => _1546(c.el)]);
|
|
55885
56000
|
return !!r && v >= r[0] && v < r[1];
|
|
55886
56001
|
}));
|
|
55887
56002
|
const va2 = _nullishCoalesce(c.sub.getAttribute("vertAlign"), () => ( "TOP"));
|
|
55888
56003
|
const lastK = g3.pieces.length - 1;
|
|
55889
56004
|
const pieceOff = g3.pieces.map((pc, k) => {
|
|
55890
56005
|
if (va2 === "TOP" || k > 0 && k < lastK || pc.fill) return 0;
|
|
55891
|
-
const from = _nullishCoalesce(_optionalChain([pc, 'access',
|
|
56006
|
+
const from = _nullishCoalesce(_optionalChain([pc, 'access', _1547 => _1547.range, 'optionalAccess', _1548 => _1548.get, 'call', _1549 => _1549(c.el), 'optionalAccess', _1550 => _1550[0]]), () => ( 0));
|
|
55892
56007
|
const bottoms = boxes.filter((b) => pieceOf(b.top) === k).map((b) => b.bottom - from);
|
|
55893
56008
|
if (k > 0) for (const f of subFloatBottoms(c.sub)) {
|
|
55894
56009
|
const b = boxes.find((x) => x.seg === f.seg);
|
|
@@ -55905,13 +56020,13 @@ function drawTable(tbl2, tx, ty, ctx, depth) {
|
|
|
55905
56020
|
const pages = segs.map((sg) => {
|
|
55906
56021
|
const v = _nullishCoalesce(contV.get(sg), () => ( num2(sg, "vertpos")));
|
|
55907
56022
|
const k = pieceOf(v);
|
|
55908
|
-
const pc = g3.pieces[k], from = _nullishCoalesce(_optionalChain([pc, 'access',
|
|
56023
|
+
const pc = g3.pieces[k], from = _nullishCoalesce(_optionalChain([pc, 'access', _1551 => _1551.range, 'optionalAccess', _1552 => _1552.get, 'call', _1553 => _1553(c.el), 'optionalAccess', _1554 => _1554[0]]), () => ( 0));
|
|
55909
56024
|
sg.setAttribute("vertpos", String(v - from + pc.y + c.marginT + pieceOff[k] - base));
|
|
55910
56025
|
return startPage + pc.page;
|
|
55911
56026
|
});
|
|
55912
56027
|
ctx.splitCell = splitHere;
|
|
55913
56028
|
const contMTSaved = ctx.splitContMT;
|
|
55914
|
-
ctx.splitContMT = ctx.geom.MT + num2(findChildByLocalName(tbl2, "outMargin"), "top") + rowY[hdrRows] + c.marginT;
|
|
56029
|
+
ctx.splitContMT = (depth > 1 && contMTSaved !== void 0 ? contMTSaved : ctx.geom.MT) + num2(findChildByLocalName(tbl2, "outMargin"), "top") + rowY[hdrRows] + c.marginT;
|
|
55915
56030
|
drawPara(p, g3.x + c.marginL, base, g3.w - c.marginL - c.marginR, ctx, depth + 1, pages);
|
|
55916
56031
|
ctx.splitContMT = contMTSaved;
|
|
55917
56032
|
ctx.splitCell = false;
|
|
@@ -56000,7 +56115,7 @@ function drawPic(pic, x, y, ctx) {
|
|
|
56000
56115
|
}
|
|
56001
56116
|
function drawPicFrame(pic, x, y, w, h, transform, ctx) {
|
|
56002
56117
|
const img = findFirst(pic, "img");
|
|
56003
|
-
const ref = _optionalChain([img, 'optionalAccess',
|
|
56118
|
+
const ref = _optionalChain([img, 'optionalAccess', _1555 => _1555.getAttribute, 'call', _1556 => _1556("binaryItemIDRef")]);
|
|
56004
56119
|
const loaded = ref != null ? ctx.images.get(ref) : void 0;
|
|
56005
56120
|
const imgId = ctx.regions.add("image", bboxOf(ctx, x, y, w, h), { sourceId: _nullishCoalesce(ref, () => ( void 0)), parentId: parentId(ctx) });
|
|
56006
56121
|
emit(ctx, regionOpenTag(imgId, "image", pageNo(ctx)));
|
|
@@ -56046,12 +56161,12 @@ function readSectionGeom(root) {
|
|
|
56046
56161
|
const pagePr = findFirst(root, "pagePr");
|
|
56047
56162
|
const margin = pagePr ? findChildByLocalName(pagePr, "margin") : null;
|
|
56048
56163
|
let PW = num2(pagePr, "width", 59528), PH = num2(pagePr, "height", 84188);
|
|
56049
|
-
if (_optionalChain([pagePr, 'optionalAccess',
|
|
56164
|
+
if (_optionalChain([pagePr, 'optionalAccess', _1557 => _1557.getAttribute, 'call', _1558 => _1558("landscape")]) === "NARROWLY" && PW < PH) {
|
|
56050
56165
|
const t = PW;
|
|
56051
56166
|
PW = PH;
|
|
56052
56167
|
PH = t;
|
|
56053
56168
|
}
|
|
56054
|
-
const gutterType = _nullishCoalesce(_optionalChain([pagePr, 'optionalAccess',
|
|
56169
|
+
const gutterType = _nullishCoalesce(_optionalChain([pagePr, 'optionalAccess', _1559 => _1559.getAttribute, 'call', _1560 => _1560("gutterType")]), () => ( "LEFT_ONLY")), gutter = num2(margin, "gutter", 0);
|
|
56055
56170
|
const gL = gutterType === "TOP_BOTTOM" ? 0 : gutter, gT = gutterType === "TOP_BOTTOM" ? gutter : 0;
|
|
56056
56171
|
const ML = num2(margin, "left", 8504) + gL;
|
|
56057
56172
|
const MT = num2(margin, "top", 5668) + num2(margin, "header", 0) + gT;
|
|
@@ -56108,7 +56223,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
56108
56223
|
}
|
|
56109
56224
|
const absolute = !degenerate && absoluteTopCache(root, ML, BODY_W);
|
|
56110
56225
|
if (absolute) {
|
|
56111
|
-
for (const lsa of Array.from(root.getElementsByTagName("*")).filter((e) => ln(e) === "linesegarray")) _optionalChain([lsa, 'access',
|
|
56226
|
+
for (const lsa of Array.from(root.getElementsByTagName("*")).filter((e) => ln(e) === "linesegarray")) _optionalChain([lsa, 'access', _1561 => _1561.parentNode, 'optionalAccess', _1562 => _1562.removeChild, 'call', _1563 => _1563(lsa)]);
|
|
56112
56227
|
ctxBase.warnings.push("\uC870\uD310 \uCE90\uC2DC\uAC00 \uCABD \uAE30\uC900 \uC88C\uD45C\uB85C \uC801\uD600 \uC788\uC5B4 \uB2E4\uC2DC \uC870\uD310\uD574 \uB80C\uB354");
|
|
56113
56228
|
}
|
|
56114
56229
|
const mixed = !doReflow && !degenerate && !absolute && Array.from(root.getElementsByTagName("*")).some((p) => ln(p) === "p" && !findChildByLocalName(p, "linesegarray"));
|
|
@@ -56169,7 +56284,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
56169
56284
|
pendingEnd = 0;
|
|
56170
56285
|
} else {
|
|
56171
56286
|
const brk = v < prevV ? !multiCol || h <= prevH : v === prevV && h <= prevH && prevEnd > v && v < BODY_H / 2;
|
|
56172
|
-
const pbrk = !brk && paraFirst && prevV !== Number.NEGATIVE_INFINITY && p.getAttribute("pageBreak") === "1" && (v < BODY_H / 2 || buildPara(p).objs.some((o) => !o.inline && (_nullishCoalesce(o.el.getAttribute("textWrap"), () => ( "TOP_AND_BOTTOM"))) === "TOP_AND_BOTTOM" && (_nullishCoalesce(_optionalChain([findChildByLocalName, 'call',
|
|
56287
|
+
const pbrk = !brk && paraFirst && prevV !== Number.NEGATIVE_INFINITY && p.getAttribute("pageBreak") === "1" && (v < BODY_H / 2 || buildPara(p).objs.some((o) => !o.inline && (_nullishCoalesce(o.el.getAttribute("textWrap"), () => ( "TOP_AND_BOTTOM"))) === "TOP_AND_BOTTOM" && (_nullishCoalesce(_optionalChain([findChildByLocalName, 'call', _1564 => _1564(o.el, "pos"), 'optionalAccess', _1565 => _1565.getAttribute, 'call', _1566 => _1566("vertRelTo")]), () => ( "PARA"))) === "PARA" && linePushedBy(o, v, 0)));
|
|
56173
56288
|
const obrk = !brk && !pbrk && !multiCol && paraFirst && v > prevV && v < prevEnd - 100 && prevEnd + num2(s, "vertsize") > BODY_H && v < BODY_H / 2;
|
|
56174
56289
|
if (brk || pbrk || obrk) cur++;
|
|
56175
56290
|
if (brk && prevSeg && prevV + prevSeg.vs > BODY_H && v === prevSeg.vs + prevSeg.sp && prevSeg.pages[prevSeg.idx] === cur - 1) {
|
|
@@ -56199,14 +56314,14 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
56199
56314
|
const ls = segEls[segEls.length - 1];
|
|
56200
56315
|
lastEnd = num2(ls, "vertpos") + num2(ls, "vertsize") + num2(ls, "spacing");
|
|
56201
56316
|
lastPage = pagesOf[pagesOf.length - 1];
|
|
56202
|
-
lastSA = _nullishCoalesce(_optionalChain([geom0, 'access',
|
|
56317
|
+
lastSA = _nullishCoalesce(_optionalChain([geom0, 'access', _1567 => _1567.get, 'call', _1568 => _1568(_nullishCoalesce(p.getAttribute("paraPrIDRef"), () => ( ""))), 'optionalAccess', _1569 => _1569.spaceAfter]), () => ( 0));
|
|
56203
56318
|
}
|
|
56204
56319
|
if (!localCols && segEls.length) {
|
|
56205
56320
|
const m0 = buildPara(p);
|
|
56206
56321
|
for (const o of m0.objs) {
|
|
56207
56322
|
if (o.tag !== "tbl") continue;
|
|
56208
56323
|
const pos = findChildByLocalName(o.el, "pos"), om = findChildByLocalName(o.el, "outMargin");
|
|
56209
|
-
if (!o.inline && (_nullishCoalesce(_optionalChain([pos, 'optionalAccess',
|
|
56324
|
+
if (!o.inline && (_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _1570 => _1570.getAttribute, 'call', _1571 => _1571("vertRelTo")]), () => ( "PARA"))) !== "PARA") continue;
|
|
56210
56325
|
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)));
|
|
56211
56326
|
const segV = num2(segEls[segK], "vertpos");
|
|
56212
56327
|
const h = Math.max(o.height, measureTableHeight(o.el, ctxBase.extentMemo)), omT = num2(om, "top"), omB = num2(om, "bottom");
|
|
@@ -56220,10 +56335,10 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
56220
56335
|
}
|
|
56221
56336
|
const nTb = m0.objs.filter((q) => !q.inline && (_nullishCoalesce(q.el.getAttribute("textWrap"), () => ( "TOP_AND_BOTTOM"))) === "TOP_AND_BOTTOM").length;
|
|
56222
56337
|
const wrapP = _nullishCoalesce(o.el.getAttribute("textWrap"), () => ( "TOP_AND_BOTTOM"));
|
|
56223
|
-
const pTop = paraTops.get(p), sbP = m0.paraPrId != null ? _nullishCoalesce(_optionalChain([geom0, 'access',
|
|
56338
|
+
const pTop = paraTops.get(p), sbP = m0.paraPrId != null ? _nullishCoalesce(_optionalChain([geom0, 'access', _1572 => _1572.get, 'call', _1573 => _1573(m0.paraPrId), 'optionalAccess', _1574 => _1574.spaceBefore]), () => ( 0)) : 0;
|
|
56224
56339
|
const stay = nTb < 2 && !m0.objs.some((q) => q.inline) && !m0.chars.some((c) => c.ch !== "" && !c.nb && c.ch.trim() !== "") && !(!o.inline && wrapP === "TOP_AND_BOTTOM" && linePushedBy(o, segV, pTop));
|
|
56225
56340
|
const nonPush = wrapP !== "TOP_AND_BOTTOM" && pTop !== void 0 && segV > pTop + sbP + 100 ? pTop + sbP : void 0;
|
|
56226
|
-
const voP = Math.max(0, toInt32(_nullishCoalesce(_optionalChain([pos, 'optionalAccess',
|
|
56341
|
+
const voP = Math.max(0, toInt32(_nullishCoalesce(_optionalChain([pos, 'optionalAccess', _1575 => _1575.getAttribute, 'call', _1576 => _1576("vertOffset")]), () => ( void 0)), 0));
|
|
56227
56342
|
const paraStart = segK === 0 && pTop !== void 0 && pTop < segV ? pTop : segV;
|
|
56228
56343
|
const below = !o.inline && wrapP === "TOP_AND_BOTTOM" && voP + omT >= num2(segEls[segK], "textheight") && !linePushedBy(o, segV, pTop);
|
|
56229
56344
|
const ty = o.inline ? MT + segV + omT : nonPush !== void 0 ? MT + nonPush + omT + voP : MT + (below ? segV - (segK === 0 ? sbP : 0) : stay ? segV - sbP : pushed - voP >= -100 ? pushed - voP : paraStart) + omT + voP;
|
|
@@ -56251,7 +56366,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
56251
56366
|
for (const p of elements(root)) {
|
|
56252
56367
|
if (ln(p) !== "p") continue;
|
|
56253
56368
|
const pg = paraSegPages.get(p);
|
|
56254
|
-
if (!_optionalChain([pg, 'optionalAccess',
|
|
56369
|
+
if (!_optionalChain([pg, 'optionalAccess', _1577 => _1577.length])) continue;
|
|
56255
56370
|
const pm = buildPara(p);
|
|
56256
56371
|
if (pm.objs.length || pm.chars.some((c) => c.ch.trim() !== "" || !!c.ctrlText)) lastContent = Math.max(lastContent, ...pg);
|
|
56257
56372
|
}
|
|
@@ -56268,7 +56383,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
56268
56383
|
for (const p of elements(root)) {
|
|
56269
56384
|
if (ln(p) !== "p") continue;
|
|
56270
56385
|
const pg = paraSegPages.get(p);
|
|
56271
|
-
if (!_optionalChain([pg, 'optionalAccess',
|
|
56386
|
+
if (!_optionalChain([pg, 'optionalAccess', _1578 => _1578.includes, 'call', _1579 => _1579(lastContent)])) continue;
|
|
56272
56387
|
const pm = buildPara(p);
|
|
56273
56388
|
pm.segs.forEach((sg, k) => {
|
|
56274
56389
|
if (pg[k] !== lastContent) return;
|
|
@@ -56288,7 +56403,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
56288
56403
|
const ens = endNoteLayout(root, paraSegPages, geom);
|
|
56289
56404
|
const ctx = {
|
|
56290
56405
|
...ctxBase,
|
|
56291
|
-
pages: Array.from({ length: Math.max(nPages, _nullishCoalesce(_optionalChain([ens, 'optionalAccess',
|
|
56406
|
+
pages: Array.from({ length: Math.max(nPages, _nullishCoalesce(_optionalChain([ens, 'optionalAccess', _1580 => _1580.pageCount]), () => ( 0))) }, () => []),
|
|
56292
56407
|
page: 0,
|
|
56293
56408
|
geom,
|
|
56294
56409
|
pageH,
|
|
@@ -56347,7 +56462,7 @@ function renderSectionToPages(root, geom, ctxBase, doReflow, reflowMode, masters
|
|
|
56347
56462
|
ctx.bodyDx = void 0;
|
|
56348
56463
|
wrapMirror(ctx.pages, (page) => _nullishCoalesce(bodyStart[page], () => ( 0)));
|
|
56349
56464
|
const allPages = new Map(paraSegPages);
|
|
56350
|
-
for (const e of _nullishCoalesce(_optionalChain([ens, 'optionalAccess',
|
|
56465
|
+
for (const e of _nullishCoalesce(_optionalChain([ens, 'optionalAccess', _1581 => _1581.paras]), () => ( []))) allPages.set(e.p, e.pages);
|
|
56351
56466
|
drawPageDecor(root, allPages, ctx, localCols ? nCol : 1, colW, colGap);
|
|
56352
56467
|
drawPageNumbers(root, paraSegPages, ctx);
|
|
56353
56468
|
ctx.page = 0;
|
|
@@ -56416,7 +56531,7 @@ function drawPageNumbers(root, paraPages, ctx) {
|
|
|
56416
56531
|
let decl;
|
|
56417
56532
|
const hidden = /* @__PURE__ */ new Set();
|
|
56418
56533
|
for (const p of elements(root)) if (ln(p) === "p") {
|
|
56419
|
-
const page = _nullishCoalesce(_optionalChain([paraPages, 'access',
|
|
56534
|
+
const page = _nullishCoalesce(_optionalChain([paraPages, 'access', _1582 => _1582.get, 'call', _1583 => _1583(p), 'optionalAccess', _1584 => _1584[0]]), () => ( 0));
|
|
56420
56535
|
for (const run of elements(p)) if (ln(run) === "run") {
|
|
56421
56536
|
for (const ctrl of elements(run)) if (ln(ctrl) === "ctrl") {
|
|
56422
56537
|
const pn = findChildByLocalName(ctrl, "pageNum"), ph = findChildByLocalName(ctrl, "pageHiding");
|
|
@@ -56478,22 +56593,22 @@ function renderSectionRoots(sections, input) {
|
|
|
56478
56593
|
rendered.push({ pages, PW: geom.PW, pageH, clipId: `pgclip${index}` });
|
|
56479
56594
|
ctxBase.pageBase += pages.length;
|
|
56480
56595
|
}
|
|
56481
|
-
if (rendered.length === 0) throw new (0,
|
|
56596
|
+
if (rendered.length === 0) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uB80C\uB354\uD560 \uAD6C\uC5ED\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
56482
56597
|
return { sections: rendered, defs: ctxBase.defs, warnings: input.warnings, stats: ctxBase.stats, regions: ctxBase.regions.regions };
|
|
56483
56598
|
}
|
|
56484
56599
|
var SVG_FONT_FAMILY = `'HCR Batang','\uD568\uCD08\uB86C\uBC14\uD0D5','Hancom Batang',AppleMyungjo,'Noto Serif CJK KR',serif`;
|
|
56485
56600
|
async function renderHwpxInternal(input, options) {
|
|
56486
|
-
const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
56601
|
+
const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1585 => _1585.maxImageBytes]), () => ( 40 * 1024 * 1024));
|
|
56487
56602
|
const ab = input instanceof Uint8Array ? input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength) : input;
|
|
56488
|
-
|
|
56603
|
+
_chunk6ZRZLV3Jcjs.precheckZipSize.call(void 0, ab, MAX_DECOMPRESS_SIZE, MAX_ZIP_ENTRIES);
|
|
56489
56604
|
let zip;
|
|
56490
56605
|
try {
|
|
56491
56606
|
zip = await _jszip2.default.loadAsync(input);
|
|
56492
56607
|
} catch (e44) {
|
|
56493
|
-
throw new (0,
|
|
56608
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("HWPX(ZIP) \uD615\uC2DD\uC774 \uC544\uB2D9\uB2C8\uB2E4 \u2014 \uB80C\uB354\uB294 HWPX\uB9CC \uC9C0\uC6D0");
|
|
56494
56609
|
}
|
|
56495
|
-
const secFiles = zip.file(/Contents\/section\d+\.xml$/i).sort((a, b) =>
|
|
56496
|
-
if (secFiles.length === 0) throw new (0,
|
|
56610
|
+
const secFiles = zip.file(/Contents\/section\d+\.xml$/i).sort((a, b) => _chunk6ZRZLV3Jcjs.compareSectionPaths.call(void 0, a.name, b.name));
|
|
56611
|
+
if (secFiles.length === 0) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("Contents/section0.xml \uC5C6\uC74C \u2014 HWPX\uAC00 \uC544\uB2C8\uAC70\uB098 \uC190\uC0C1\uB428");
|
|
56497
56612
|
const warnings = [];
|
|
56498
56613
|
const headFile = _nullishCoalesce(zip.file("Contents/header.xml"), () => ( zip.file("Contents/head.xml")));
|
|
56499
56614
|
const verFile = zip.file("version.xml");
|
|
@@ -56504,14 +56619,14 @@ async function renderHwpxInternal(input, options) {
|
|
|
56504
56619
|
const secXmls = [];
|
|
56505
56620
|
for (const f of secFiles) {
|
|
56506
56621
|
const xml = await readZipEntry(f, "text");
|
|
56507
|
-
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
56622
|
+
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uC139\uC158 XML\uC774 \uD5C8\uC6A9 \uD06C\uAE30\uB97C \uCD08\uACFC");
|
|
56508
56623
|
secXmls.push(xml);
|
|
56509
56624
|
}
|
|
56510
56625
|
const masterPages = /* @__PURE__ */ new Map();
|
|
56511
56626
|
const masterXmls = [];
|
|
56512
56627
|
for (const file of zip.file(/Contents\/masterpage[^/]*\.xml$/i)) {
|
|
56513
56628
|
const xml = await readZipEntry(file, "text");
|
|
56514
|
-
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0,
|
|
56629
|
+
if (xml.length > MAX_DECOMPRESS_SIZE) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uBC14\uD0D5\uCABD XML\uC774 \uD5C8\uC6A9 \uD06C\uAE30\uB97C \uCD08\uACFC");
|
|
56515
56630
|
const root = createXmlParser().parseFromString(xml, "text/xml").documentElement;
|
|
56516
56631
|
if (root && ln(root) === "masterPage") {
|
|
56517
56632
|
masterPages.set(root.getAttribute("id") || file.name.replace(/^.*\/|\.xml$/g, ""), root);
|
|
@@ -56539,7 +56654,7 @@ async function renderHwpxInternal(input, options) {
|
|
|
56539
56654
|
let href = binmap.get(ref);
|
|
56540
56655
|
if (!href) {
|
|
56541
56656
|
const cand = zip.file(new RegExp(`BinData/.*${ref.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`, "i"))[0];
|
|
56542
|
-
href = _optionalChain([cand, 'optionalAccess',
|
|
56657
|
+
href = _optionalChain([cand, 'optionalAccess', _1586 => _1586.name]);
|
|
56543
56658
|
}
|
|
56544
56659
|
if (!href) continue;
|
|
56545
56660
|
const f = _nullishCoalesce(zip.file(href), () => ( zip.file("Contents/" + href)));
|
|
@@ -56558,10 +56673,11 @@ async function renderHwpxInternal(input, options) {
|
|
|
56558
56673
|
}
|
|
56559
56674
|
const roots = [];
|
|
56560
56675
|
let noCacheSkipped = false;
|
|
56676
|
+
const lastParity = /* @__PURE__ */ new Map();
|
|
56561
56677
|
for (let si = 0; si < secXmls.length; si++) {
|
|
56562
56678
|
const secXml = secXmls[si];
|
|
56563
56679
|
const hasCache = /<(?:[A-Za-z][\w.-]*:)?linesegarray[\s/>]/.test(secXml);
|
|
56564
|
-
if (!hasCache && !_optionalChain([options, 'optionalAccess',
|
|
56680
|
+
if (!hasCache && !_optionalChain([options, 'optionalAccess', _1587 => _1587.reflow])) {
|
|
56565
56681
|
noCacheSkipped = true;
|
|
56566
56682
|
warnings.push(`\uAD6C\uC5ED ${si}: \uC870\uD310 \uCE90\uC2DC \uC5C6\uC74C \u2014 reflow \uC635\uC158 \uD544\uC694, \uC0DD\uB7B5`);
|
|
56567
56683
|
continue;
|
|
@@ -56574,15 +56690,23 @@ async function renderHwpxInternal(input, options) {
|
|
|
56574
56690
|
}
|
|
56575
56691
|
const secPr = findFirst(root, "secPr");
|
|
56576
56692
|
const referenced = secPr ? elements(secPr).filter((el) => ln(el) === "masterPage").map((el) => masterPages.get(el.getAttribute("idRef") || "")).filter((el) => !!el) : [];
|
|
56693
|
+
const typeOf = (m) => m.getAttribute("type") || "BOTH";
|
|
56694
|
+
const has3 = (t) => referenced.some((m) => typeOf(m) === t);
|
|
56695
|
+
if (!has3("BOTH")) for (const [t, other] of [["EVEN", "ODD"], ["ODD", "EVEN"]]) {
|
|
56696
|
+
const prev = lastParity.get(t);
|
|
56697
|
+
if (prev && !has3(t) && has3(other)) referenced.unshift(prev);
|
|
56698
|
+
}
|
|
56699
|
+
for (const m of referenced) if (typeOf(m) === "EVEN" || typeOf(m) === "ODD") lastParity.set(typeOf(m), m);
|
|
56700
|
+
if (has3("BOTH")) lastParity.clear();
|
|
56577
56701
|
roots.push({ root, index: si, masterPages: referenced, hasDeletionMarkers: secXml.includes("deleteBegin") || secXml.includes("deleteEnd") });
|
|
56578
56702
|
}
|
|
56579
56703
|
if (roots.length === 0) {
|
|
56580
56704
|
if (noCacheSkipped) {
|
|
56581
|
-
throw new (0,
|
|
56705
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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)");
|
|
56582
56706
|
}
|
|
56583
|
-
throw new (0,
|
|
56707
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uB80C\uB354\uD560 \uAD6C\uC5ED\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 HWPX\uAC00 \uC190\uC0C1\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4");
|
|
56584
56708
|
}
|
|
56585
|
-
return renderSectionRoots(roots, { styles, images, warnings, reflow: !!_optionalChain([options, 'optionalAccess',
|
|
56709
|
+
return renderSectionRoots(roots, { styles, images, warnings, reflow: !!_optionalChain([options, 'optionalAccess', _1588 => _1588.reflow]), reflowMode: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1589 => _1589.reflowMode]), () => ( "keep")), highlights: _optionalChain([options, 'optionalAccess', _1590 => _1590.highlights]) });
|
|
56586
56710
|
}
|
|
56587
56711
|
async function renderHwpxToSvg(input, options) {
|
|
56588
56712
|
const r = await renderHwpxInternal(input, options);
|
|
@@ -56805,7 +56929,7 @@ var FOLD_END = 42124;
|
|
|
56805
56929
|
var FOLD_SHIFT = 983040 - 40960;
|
|
56806
56930
|
function textChar(ch) {
|
|
56807
56931
|
if (ch >= FOLD_START && ch <= FOLD_END) {
|
|
56808
|
-
const mapped =
|
|
56932
|
+
const mapped = _chunkN65EY5BIcjs.mapPuaText.call(void 0, String.fromCodePoint(ch + FOLD_SHIFT));
|
|
56809
56933
|
return /[\u{F0000}-\u{FFFFF}]/u.test(mapped) ? "" : mapped;
|
|
56810
56934
|
}
|
|
56811
56935
|
if (ch === 65534 || ch === 65535 || ch >= 55296 && ch <= 57343) return "\uFFFD";
|
|
@@ -56897,7 +57021,7 @@ function paragraphXml(records, i, j, level, ctx, depth) {
|
|
|
56897
57021
|
out += run.join("") + "</hp:run>";
|
|
56898
57022
|
run = [];
|
|
56899
57023
|
};
|
|
56900
|
-
openRun(_nullishCoalesce(_optionalChain([shapes, 'access',
|
|
57024
|
+
openRun(_nullishCoalesce(_optionalChain([shapes, 'access', _1591 => _1591[0], 'optionalAccess', _1592 => _1592[1]]), () => ( 0)));
|
|
56901
57025
|
let pos = 0, ctrlIdx = 0, o = 0;
|
|
56902
57026
|
const switchShape = () => {
|
|
56903
57027
|
while (shapeIdx + 1 < shapes.length && pos >= shapes[shapeIdx + 1][0]) {
|
|
@@ -56983,7 +57107,7 @@ function paragraphXml(records, i, j, level, ctx, depth) {
|
|
|
56983
57107
|
closeRun();
|
|
56984
57108
|
const rest = ctrls.filter((c) => !c.used && (c.id === CTRL_TBL3 || c.id === CTRL_GSO3 || c.id === CTRL_SECD2 || c.id === CTRL_COLD2));
|
|
56985
57109
|
if (rest.length > 0) {
|
|
56986
|
-
openRun(_nullishCoalesce(_optionalChain([shapes, 'access',
|
|
57110
|
+
openRun(_nullishCoalesce(_optionalChain([shapes, 'access', _1593 => _1593[0], 'optionalAccess', _1594 => _1594[1]]), () => ( 0)));
|
|
56987
57111
|
for (const c of rest) {
|
|
56988
57112
|
const el = ctrlElement(ctrls.indexOf(c), c.id);
|
|
56989
57113
|
run.push(el);
|
|
@@ -57149,14 +57273,14 @@ function hwp5SectionToXml(records, ctx) {
|
|
|
57149
57273
|
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>";
|
|
57150
57274
|
}
|
|
57151
57275
|
function renderHwp5Records(docInfo, styles, secRecords, binData, options, select, warnings = []) {
|
|
57152
|
-
const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
57276
|
+
const maxImg = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1595 => _1595.maxImageBytes]), () => ( 40 * 1024 * 1024));
|
|
57153
57277
|
const MAX_TOTAL_IMAGE_BYTES = 128 * 1024 * 1024;
|
|
57154
57278
|
const images = /* @__PURE__ */ new Map();
|
|
57155
57279
|
let totalImgBytes = 0;
|
|
57156
57280
|
const imageRef = (binDataId) => {
|
|
57157
57281
|
if (binDataId <= 0) return null;
|
|
57158
|
-
const item = _optionalChain([docInfo, 'optionalAccess',
|
|
57159
|
-
if (_optionalChain([item, 'optionalAccess',
|
|
57282
|
+
const item = _optionalChain([docInfo, 'optionalAccess', _1596 => _1596.binData, 'access', _1597 => _1597[binDataId - 1]]);
|
|
57283
|
+
if (_optionalChain([item, 'optionalAccess', _1598 => _1598.kind]) === "link") return null;
|
|
57160
57284
|
const storageId = item && item.storageId > 0 ? item.storageId : binDataId;
|
|
57161
57285
|
const ref = `bin${storageId}`;
|
|
57162
57286
|
if (images.has(ref)) return ref;
|
|
@@ -57190,8 +57314,8 @@ function renderHwp5Records(docInfo, styles, secRecords, binData, options, select
|
|
|
57190
57314
|
}
|
|
57191
57315
|
roots.push({ root, index: si });
|
|
57192
57316
|
}
|
|
57193
|
-
if (roots.length === 0) throw new (0,
|
|
57194
|
-
const r = renderSectionRoots(roots, { styles, images, warnings, reflow: !!_optionalChain([options, 'optionalAccess',
|
|
57317
|
+
if (roots.length === 0) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uB80C\uB354\uD560 \uAD6C\uC5ED\uC774 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 HWP \uAC00 \uC190\uC0C1\uB418\uC5C8\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4");
|
|
57318
|
+
const r = renderSectionRoots(roots, { styles, images, warnings, reflow: !!_optionalChain([options, 'optionalAccess', _1599 => _1599.reflow]), reflowMode: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _1600 => _1600.reflowMode]), () => ( "keep")), highlights: _optionalChain([options, 'optionalAccess', _1601 => _1601.highlights]) });
|
|
57195
57319
|
return assemblePageSvgs(r, "hwp", select);
|
|
57196
57320
|
}
|
|
57197
57321
|
function renderHwp5Pages(input, options, select) {
|
|
@@ -57203,7 +57327,7 @@ function renderHwp5Pages(input, options, select) {
|
|
|
57203
57327
|
const styles = buildHwp5RenderStyles(_nullishCoalesce(docInfoRecords, () => ( [])));
|
|
57204
57328
|
const docInfo = docInfoRecords ? parseDocInfo(docInfoRecords) : null;
|
|
57205
57329
|
const sections = readHwp5SectionStreams(c);
|
|
57206
|
-
if (sections.length === 0) throw new (0,
|
|
57330
|
+
if (sections.length === 0) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
57207
57331
|
const parseWarnings = [];
|
|
57208
57332
|
const secRecords = readHwp5SectionRecords(c, sections, parseWarnings);
|
|
57209
57333
|
for (const w of parseWarnings) warnings.push(w.message);
|
|
@@ -57289,14 +57413,14 @@ async function loadSharp() {
|
|
|
57289
57413
|
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("sharp")));
|
|
57290
57414
|
return _nullishCoalesce(mod.default, () => ( mod));
|
|
57291
57415
|
} catch (e47) {
|
|
57292
|
-
throw new (0,
|
|
57293
|
-
'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.' +
|
|
57416
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(
|
|
57417
|
+
'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.' + _chunk6ZRZLV3Jcjs.OPTIONAL_DEP_INSTALL_HINT
|
|
57294
57418
|
);
|
|
57295
57419
|
}
|
|
57296
57420
|
}
|
|
57297
57421
|
async function rasterizePageSvg(svg, widthPt, heightPt, options = {}) {
|
|
57298
57422
|
const sharp = await loadSharp();
|
|
57299
|
-
if (!(widthPt > 0) || !(heightPt > 0)) throw new (0,
|
|
57423
|
+
if (!(widthPt > 0) || !(heightPt > 0)) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uC798\uBABB\uB41C \uD398\uC774\uC9C0 \uD06C\uAE30: ${widthPt}x${heightPt}pt`);
|
|
57300
57424
|
const maxW = _nullishCoalesce(options.maxWidthPx, () => ( 1400));
|
|
57301
57425
|
const maxH = _nullishCoalesce(options.maxHeightPx, () => ( 4e3));
|
|
57302
57426
|
const scale2 = Math.min(maxW / widthPt, maxH / heightPt, 2);
|
|
@@ -57314,11 +57438,11 @@ async function renderHtmlToPdf(html, options = {}) {
|
|
|
57314
57438
|
try {
|
|
57315
57439
|
puppeteer = await Promise.resolve().then(() => _interopRequireWildcard(require("puppeteer-core")));
|
|
57316
57440
|
} catch (e48) {
|
|
57317
|
-
throw new (0,
|
|
57441
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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");
|
|
57318
57442
|
}
|
|
57319
57443
|
const executablePath = _nullishCoalesce(_nullishCoalesce(options.browserExecutablePath, () => ( process.env.PUPPETEER_EXECUTABLE_PATH)), () => ( findChromiumPath()));
|
|
57320
57444
|
if (!executablePath) {
|
|
57321
|
-
throw new (0,
|
|
57445
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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");
|
|
57322
57446
|
}
|
|
57323
57447
|
const { browser, page } = await launchLockedPage(puppeteer, executablePath);
|
|
57324
57448
|
try {
|
|
@@ -57334,13 +57458,13 @@ async function renderHtmlToPdf(html, options = {}) {
|
|
|
57334
57458
|
async function loadBuffer(input) {
|
|
57335
57459
|
if (typeof input === "string") {
|
|
57336
57460
|
try {
|
|
57337
|
-
return
|
|
57461
|
+
return _chunk6ZRZLV3Jcjs.toArrayBuffer.call(void 0, await _promises.readFile.call(void 0, input));
|
|
57338
57462
|
} catch (err) {
|
|
57339
57463
|
const code = err instanceof Error && "code" in err ? err.code : void 0;
|
|
57340
|
-
throw new (0,
|
|
57464
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(code === "ENOENT" ? `\uD30C\uC77C\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4: ${input}` : `\uD30C\uC77C \uC77D\uAE30 \uC2E4\uD328: ${input}`);
|
|
57341
57465
|
}
|
|
57342
57466
|
}
|
|
57343
|
-
if (Buffer.isBuffer(input)) return
|
|
57467
|
+
if (Buffer.isBuffer(input)) return _chunk6ZRZLV3Jcjs.toArrayBuffer.call(void 0, input);
|
|
57344
57468
|
if (input instanceof Uint8Array) return input.buffer.slice(input.byteOffset, input.byteOffset + input.byteLength);
|
|
57345
57469
|
return input;
|
|
57346
57470
|
}
|
|
@@ -57349,17 +57473,17 @@ async function sourceFormatOf(buffer) {
|
|
|
57349
57473
|
if (format2 === "hwpx") {
|
|
57350
57474
|
const zip = await detectZipFormat(buffer);
|
|
57351
57475
|
if (zip === "hwpx" || zip === "unknown") return "hwpx";
|
|
57352
|
-
throw new (0,
|
|
57476
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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`);
|
|
57353
57477
|
}
|
|
57354
57478
|
if (format2 === "hwp") return "hwp";
|
|
57355
|
-
throw new (0,
|
|
57479
|
+
throw new (0, _chunk6ZRZLV3Jcjs.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`);
|
|
57356
57480
|
}
|
|
57357
57481
|
async function renderDocumentToScene(input, options = {}) {
|
|
57358
57482
|
const buffer = await loadBuffer(input);
|
|
57359
57483
|
const source = await sourceFormatOf(buffer);
|
|
57360
57484
|
const select = options.pages !== void 0 ? (pageCount) => {
|
|
57361
57485
|
const set = _chunkJ55UQC5Hcjs.parsePageRange.call(void 0, options.pages, pageCount);
|
|
57362
|
-
if (set.size === 0) throw new (0,
|
|
57486
|
+
if (set.size === 0) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uC120\uD0DD\uD55C \uD398\uC774\uC9C0\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4 \u2014 \uBB38\uC11C\uB294 ${pageCount}\uCABD (pages: ${JSON.stringify(options.pages)})`);
|
|
57363
57487
|
return set;
|
|
57364
57488
|
} : void 0;
|
|
57365
57489
|
const renderOptions = { reflow: _nullishCoalesce(options.reflow, () => ( true)), reflowMode: options.reflowMode, highlights: options.highlights, maxImageBytes: options.maxImageBytes };
|
|
@@ -57395,7 +57519,7 @@ async function renderDocument(input, options) {
|
|
|
57395
57519
|
break;
|
|
57396
57520
|
}
|
|
57397
57521
|
default:
|
|
57398
|
-
throw new (0,
|
|
57522
|
+
throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uC54C \uC218 \uC5C6\uB294 \uB80C\uB354 \uD3EC\uB9F7: ${String(options.format)} (svg|html|png|jpeg|pdf)`);
|
|
57399
57523
|
}
|
|
57400
57524
|
return { scene, assets };
|
|
57401
57525
|
}
|
|
@@ -57425,7 +57549,7 @@ async function extractRenderedRegions(input, options = {}) {
|
|
|
57425
57549
|
const out = [];
|
|
57426
57550
|
for (const [page, items] of [...byPage.entries()].sort((a, b) => a[0] - b[0])) {
|
|
57427
57551
|
const meta = scene.pages.find((p) => p.page === page);
|
|
57428
|
-
if (!meta) throw new (0,
|
|
57552
|
+
if (!meta) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uD398\uC774\uC9C0 ${page} \uBA54\uD0C0 \uC5C6\uC74C`);
|
|
57429
57553
|
const raster = await rasterizePageSvg(pageSvgs.get(page), meta.width, meta.height, { format: format2, maxWidthPx: options.maxWidthPx, quality: options.quality });
|
|
57430
57554
|
for (const { region, bbox } of items) {
|
|
57431
57555
|
const rect = cropRect(bbox, raster.scale, raster.widthPx, raster.heightPx, _nullishCoalesce(options.paddingPt, () => ( 0)));
|
|
@@ -57449,9 +57573,9 @@ function wantsCrop(kind, policy) {
|
|
|
57449
57573
|
}
|
|
57450
57574
|
async function extractTables(input, options = {}) {
|
|
57451
57575
|
const policy = _nullishCoalesce(options.policy, () => ( "non-tabular-and-uncertain"));
|
|
57452
|
-
const buffer = typeof input === "string" ?
|
|
57576
|
+
const buffer = typeof input === "string" ? _chunk6ZRZLV3Jcjs.toArrayBuffer.call(void 0, await _promises.readFile.call(void 0, input)) : Buffer.isBuffer(input) ? _chunk6ZRZLV3Jcjs.toArrayBuffer.call(void 0, input) : input;
|
|
57453
57577
|
const parsed = await parse(buffer, { classifyTables: true, layoutTables: "keep" });
|
|
57454
|
-
if (!parsed.success) throw new (0,
|
|
57578
|
+
if (!parsed.success) throw new (0, _chunk6ZRZLV3Jcjs.KordocError)(`\uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}`);
|
|
57455
57579
|
const blocks = collectTableBlocks(parsed.blocks);
|
|
57456
57580
|
const out = blocks.map((b, i) => ({
|
|
57457
57581
|
id: _nullishCoalesce(b.table.sourceId, () => ( `tbl-${i + 1}`)),
|
|
@@ -57509,22 +57633,22 @@ async function extractTables(input, options = {}) {
|
|
|
57509
57633
|
// src/index.ts
|
|
57510
57634
|
async function parse(input, options) {
|
|
57511
57635
|
let buffer;
|
|
57512
|
-
const opts = typeof input === "string" && !_optionalChain([options, 'optionalAccess',
|
|
57513
|
-
if (_optionalChain([opts, 'optionalAccess',
|
|
57636
|
+
const opts = typeof input === "string" && !_optionalChain([options, 'optionalAccess', _1602 => _1602.filePath]) ? { ...options, filePath: input } : options;
|
|
57637
|
+
if (_optionalChain([opts, 'optionalAccess', _1603 => _1603.htmlTables]) && opts.tableFormat) {
|
|
57514
57638
|
return { success: false, fileType: "unknown", error: "htmlTables \uC640 tableFormat \uC740 \uD568\uAED8 \uC4F8 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4" };
|
|
57515
57639
|
}
|
|
57516
|
-
const ocrOptionError =
|
|
57640
|
+
const ocrOptionError = _chunkN65EY5BIcjs.validateOcrOptions.call(void 0, opts);
|
|
57517
57641
|
if (ocrOptionError) return { success: false, fileType: "unknown", error: ocrOptionError };
|
|
57518
57642
|
if (typeof input === "string") {
|
|
57519
57643
|
try {
|
|
57520
57644
|
const buf = await _promises.readFile.call(void 0, input);
|
|
57521
|
-
buffer =
|
|
57645
|
+
buffer = _chunk6ZRZLV3Jcjs.toArrayBuffer.call(void 0, buf);
|
|
57522
57646
|
} catch (err) {
|
|
57523
57647
|
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}`;
|
|
57524
|
-
return { success: false, fileType: "unknown", error: msg2, code:
|
|
57648
|
+
return { success: false, fileType: "unknown", error: msg2, code: _chunk6ZRZLV3Jcjs.classifyError.call(void 0, err) };
|
|
57525
57649
|
}
|
|
57526
57650
|
} else if (Buffer.isBuffer(input)) {
|
|
57527
|
-
buffer =
|
|
57651
|
+
buffer = _chunk6ZRZLV3Jcjs.toArrayBuffer.call(void 0, input);
|
|
57528
57652
|
} else {
|
|
57529
57653
|
buffer = input;
|
|
57530
57654
|
}
|
|
@@ -57533,23 +57657,23 @@ async function parse(input, options) {
|
|
|
57533
57657
|
}
|
|
57534
57658
|
const format2 = detectFormat(buffer);
|
|
57535
57659
|
const result = await dispatch(format2, buffer, opts);
|
|
57536
|
-
if (result.success && _optionalChain([opts, 'optionalAccess',
|
|
57660
|
+
if (result.success && _optionalChain([opts, 'optionalAccess', _1604 => _1604.images]) === false) {
|
|
57537
57661
|
delete result.images;
|
|
57538
57662
|
dropImageBytes(result.blocks);
|
|
57539
57663
|
}
|
|
57540
|
-
if (result.success && _optionalChain([opts, 'optionalAccess',
|
|
57664
|
+
if (result.success && _optionalChain([opts, 'optionalAccess', _1605 => _1605.classifyTables])) classifyTableTree(result.blocks);
|
|
57541
57665
|
let out = result;
|
|
57542
|
-
if (result.success && _optionalChain([opts, 'optionalAccess',
|
|
57666
|
+
if (result.success && _optionalChain([opts, 'optionalAccess', _1606 => _1606.pages]) && result.pageCount && _chunkJ55UQC5Hcjs.parsePageRange.call(void 0, opts.pages, result.pageCount).size === 0) {
|
|
57543
57667
|
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` }] };
|
|
57544
57668
|
}
|
|
57545
57669
|
if (out.success && !out.pages) {
|
|
57546
|
-
const pages =
|
|
57670
|
+
const pages = _chunkYG4YOPK6cjs.blocksToPages.call(void 0, out.blocks, (bs) => _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, bs, { tableFormat: _optionalChain([opts, 'optionalAccess', _1607 => _1607.tableFormat]) }));
|
|
57547
57671
|
if (pages) out = { ...out, pages };
|
|
57548
57672
|
}
|
|
57549
|
-
if (out.success && _optionalChain([opts, 'optionalAccess',
|
|
57673
|
+
if (out.success && _optionalChain([opts, 'optionalAccess', _1608 => _1608.plain])) {
|
|
57550
57674
|
out = { ...out, markdown: toPlainMarkdown(out.markdown), ...out.pages ? { pages: out.pages.map((p) => ({ ...p, markdown: toPlainMarkdown(p.markdown) })) } : {} };
|
|
57551
57675
|
}
|
|
57552
|
-
if (out.success && _optionalChain([opts, 'optionalAccess',
|
|
57676
|
+
if (out.success && _optionalChain([opts, 'optionalAccess', _1609 => _1609.htmlTables])) {
|
|
57553
57677
|
out = { ...out, markdown: toHtmlTables(out.markdown), ...out.pages ? { pages: out.pages.map((p) => ({ ...p, markdown: toHtmlTables(p.markdown) })) } : {} };
|
|
57554
57678
|
}
|
|
57555
57679
|
return out;
|
|
@@ -57594,42 +57718,42 @@ async function dispatch(format2, buffer, opts) {
|
|
|
57594
57718
|
async function withEmbeddedImageOcr(blocks, markdown, warnings, images, options) {
|
|
57595
57719
|
const list = [..._nullishCoalesce(warnings, () => ( []))];
|
|
57596
57720
|
if (!await ocrEmbeddedImages(blocks, options, list)) return { markdown, warnings: list.length ? list : void 0 };
|
|
57597
|
-
let md2 =
|
|
57598
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
57721
|
+
let md2 = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _1610 => _1610.tableFormat]) });
|
|
57722
|
+
if (_optionalChain([options, 'optionalAccess', _1611 => _1611.inlineImages]) && options.images !== false && _optionalChain([images, 'optionalAccess', _1612 => _1612.length])) {
|
|
57599
57723
|
try {
|
|
57600
|
-
md2 =
|
|
57724
|
+
md2 = _chunkYG4YOPK6cjs.inlineImagesIntoMarkdown.call(void 0, md2, images, { compress: true });
|
|
57601
57725
|
} catch (e49) {
|
|
57602
57726
|
}
|
|
57603
57727
|
}
|
|
57604
57728
|
return { markdown: md2, warnings: list.length ? list : void 0 };
|
|
57605
57729
|
}
|
|
57606
57730
|
function scriptsOff(r, off) {
|
|
57607
|
-
return off ?
|
|
57731
|
+
return off ? _chunkN65EY5BIcjs.stripScriptTags.call(void 0, r) : r;
|
|
57608
57732
|
}
|
|
57609
57733
|
async function parseImage(buffer, options) {
|
|
57610
57734
|
try {
|
|
57611
|
-
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-
|
|
57735
|
+
const { parseImageDocument } = await Promise.resolve().then(() => _interopRequireWildcard(require("./image-ocr-CCTE7HX3.cjs")));
|
|
57612
57736
|
const { blocks, warnings, lines } = await parseImageDocument(buffer, options);
|
|
57613
|
-
|
|
57737
|
+
_chunkN65EY5BIcjs.stripScriptTags.call(void 0, { blocks });
|
|
57614
57738
|
return {
|
|
57615
57739
|
success: true,
|
|
57616
57740
|
fileType: "image",
|
|
57617
|
-
markdown:
|
|
57741
|
+
markdown: _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, blocks, { tableFormat: _optionalChain([options, 'optionalAccess', _1613 => _1613.tableFormat]) }),
|
|
57618
57742
|
blocks,
|
|
57619
57743
|
warnings: warnings.length ? warnings : void 0,
|
|
57620
57744
|
pageCount: 1,
|
|
57621
|
-
..._optionalChain([options, 'optionalAccess',
|
|
57745
|
+
..._optionalChain([options, 'optionalAccess', _1614 => _1614.ocrLines]) ? { ocrLines: lines ? [lines] : [] } : {}
|
|
57622
57746
|
};
|
|
57623
57747
|
} catch (err) {
|
|
57624
|
-
return { success: false, fileType: "image", error:
|
|
57748
|
+
return { success: false, fileType: "image", error: _chunk6ZRZLV3Jcjs.sanitizeError.call(void 0, err), code: _chunk6ZRZLV3Jcjs.classifyError.call(void 0, err) };
|
|
57625
57749
|
}
|
|
57626
57750
|
}
|
|
57627
57751
|
async function parseHwp3(buffer, options) {
|
|
57628
57752
|
try {
|
|
57629
57753
|
const { markdown, blocks, metadata, outline, warnings, images } = parseHwp3Document(buffer, options);
|
|
57630
|
-
return { success: true, fileType: "hwp3", markdown, blocks, metadata, outline, warnings, images, pageCount: _optionalChain([metadata, 'optionalAccess',
|
|
57754
|
+
return { success: true, fileType: "hwp3", markdown, blocks, metadata, outline, warnings, images, pageCount: _optionalChain([metadata, 'optionalAccess', _1615 => _1615.pageCount]) };
|
|
57631
57755
|
} catch (err) {
|
|
57632
|
-
return { success: false, fileType: "hwp3", error:
|
|
57756
|
+
return { success: false, fileType: "hwp3", error: _chunk6ZRZLV3Jcjs.sanitizeError.call(void 0, err), code: _chunk6ZRZLV3Jcjs.classifyError.call(void 0, err) };
|
|
57633
57757
|
}
|
|
57634
57758
|
}
|
|
57635
57759
|
async function parseHwpx(buffer, options) {
|
|
@@ -57637,15 +57761,15 @@ async function parseHwpx(buffer, options) {
|
|
|
57637
57761
|
const doc = await parseHwpxDocument(buffer, options);
|
|
57638
57762
|
const { blocks, metadata, outline, images } = doc;
|
|
57639
57763
|
const { markdown, warnings } = await withEmbeddedImageOcr(blocks, doc.markdown, doc.warnings, void 0, options);
|
|
57640
|
-
return scriptsOff({ success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess',
|
|
57764
|
+
return scriptsOff({ success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _1616 => _1616.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _1617 => _1617.pageCount]) }, _optionalChain([options, 'optionalAccess', _1618 => _1618.scriptTags]) === false);
|
|
57641
57765
|
} catch (err) {
|
|
57642
|
-
return { success: false, fileType: "hwpx", error:
|
|
57766
|
+
return { success: false, fileType: "hwpx", error: _chunk6ZRZLV3Jcjs.sanitizeError.call(void 0, err), code: _chunk6ZRZLV3Jcjs.classifyError.call(void 0, err) };
|
|
57643
57767
|
}
|
|
57644
57768
|
}
|
|
57645
57769
|
async function parseHwp(buffer, options) {
|
|
57646
57770
|
try {
|
|
57647
57771
|
const { markdown, blocks, metadata, outline, warnings, images } = parseHwp5Document(Buffer.from(buffer), options);
|
|
57648
|
-
if (isDistributionSentinel(markdown) && isComFallbackAvailable() && _optionalChain([options, 'optionalAccess',
|
|
57772
|
+
if (isDistributionSentinel(markdown) && isComFallbackAvailable() && _optionalChain([options, 'optionalAccess', _1619 => _1619.filePath])) {
|
|
57649
57773
|
try {
|
|
57650
57774
|
const { pages, pageCount, warnings: comWarns } = extractTextViaCom(options.filePath);
|
|
57651
57775
|
if (pages.some((p) => p && p.trim().length > 0)) {
|
|
@@ -57664,15 +57788,15 @@ async function parseHwp(buffer, options) {
|
|
|
57664
57788
|
}
|
|
57665
57789
|
}
|
|
57666
57790
|
const ocred = await withEmbeddedImageOcr(blocks, markdown, warnings, images, options);
|
|
57667
|
-
return scriptsOff({ success: true, fileType: "hwp", markdown: ocred.markdown, blocks, metadata, outline, warnings: ocred.warnings, images: _optionalChain([images, 'optionalAccess',
|
|
57791
|
+
return scriptsOff({ success: true, fileType: "hwp", markdown: ocred.markdown, blocks, metadata, outline, warnings: ocred.warnings, images: _optionalChain([images, 'optionalAccess', _1620 => _1620.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _1621 => _1621.pageCount]) }, _optionalChain([options, 'optionalAccess', _1622 => _1622.scriptTags]) === false);
|
|
57668
57792
|
} catch (err) {
|
|
57669
|
-
return { success: false, fileType: "hwp", error:
|
|
57793
|
+
return { success: false, fileType: "hwp", error: _chunk6ZRZLV3Jcjs.sanitizeError.call(void 0, err), code: _chunk6ZRZLV3Jcjs.classifyError.call(void 0, err) };
|
|
57670
57794
|
}
|
|
57671
57795
|
}
|
|
57672
57796
|
async function parsePdf(buffer, options) {
|
|
57673
57797
|
let parsePdfDocument;
|
|
57674
57798
|
try {
|
|
57675
|
-
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-
|
|
57799
|
+
const mod = await Promise.resolve().then(() => _interopRequireWildcard(require("./parser-HE45CCSG.cjs")));
|
|
57676
57800
|
parsePdfDocument = mod.parsePdfDocument;
|
|
57677
57801
|
} catch (e51) {
|
|
57678
57802
|
return {
|
|
@@ -57684,59 +57808,59 @@ async function parsePdf(buffer, options) {
|
|
|
57684
57808
|
}
|
|
57685
57809
|
try {
|
|
57686
57810
|
const { markdown, blocks, metadata, outline, warnings, isImageBased, pageQuality, qualitySummary, images, pages, ocrLines } = await parsePdfDocument(buffer, options);
|
|
57687
|
-
return scriptsOff({ success: true, fileType: "pdf", markdown, blocks, metadata, outline, warnings, isImageBased, pageQuality, qualitySummary, images, pages, pageCount: _optionalChain([metadata, 'optionalAccess',
|
|
57811
|
+
return scriptsOff({ success: true, fileType: "pdf", markdown, blocks, metadata, outline, warnings, isImageBased, pageQuality, qualitySummary, images, pages, pageCount: _optionalChain([metadata, 'optionalAccess', _1623 => _1623.pageCount]), ...ocrLines ? { ocrLines } : {} }, _optionalChain([options, 'optionalAccess', _1624 => _1624.scriptTags]) !== true);
|
|
57688
57812
|
} catch (err) {
|
|
57689
57813
|
const isImageBased = err instanceof Error && "isImageBased" in err ? true : void 0;
|
|
57690
|
-
return { success: false, fileType: "pdf", error:
|
|
57814
|
+
return { success: false, fileType: "pdf", error: _chunk6ZRZLV3Jcjs.sanitizeError.call(void 0, err), code: _chunk6ZRZLV3Jcjs.classifyError.call(void 0, err), isImageBased };
|
|
57691
57815
|
}
|
|
57692
57816
|
}
|
|
57693
57817
|
async function parseXlsx(buffer, options) {
|
|
57694
57818
|
try {
|
|
57695
57819
|
const { markdown, blocks, metadata, warnings } = await parseXlsxDocument(buffer, options);
|
|
57696
|
-
return { success: true, fileType: "xlsx", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess',
|
|
57820
|
+
return { success: true, fileType: "xlsx", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _1625 => _1625.pageCount]) };
|
|
57697
57821
|
} catch (err) {
|
|
57698
|
-
return { success: false, fileType: "xlsx", error:
|
|
57822
|
+
return { success: false, fileType: "xlsx", error: _chunk6ZRZLV3Jcjs.sanitizeError.call(void 0, err), code: _chunk6ZRZLV3Jcjs.classifyError.call(void 0, err) };
|
|
57699
57823
|
}
|
|
57700
57824
|
}
|
|
57701
57825
|
async function parseXls(buffer, options) {
|
|
57702
57826
|
try {
|
|
57703
57827
|
const { markdown, blocks, metadata, warnings } = await parseXlsDocument(buffer, options);
|
|
57704
|
-
return { success: true, fileType: "xls", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess',
|
|
57828
|
+
return { success: true, fileType: "xls", markdown, blocks, metadata, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _1626 => _1626.pageCount]) };
|
|
57705
57829
|
} catch (err) {
|
|
57706
|
-
return { success: false, fileType: "xls", error:
|
|
57830
|
+
return { success: false, fileType: "xls", error: _chunk6ZRZLV3Jcjs.sanitizeError.call(void 0, err), code: _chunk6ZRZLV3Jcjs.classifyError.call(void 0, err) };
|
|
57707
57831
|
}
|
|
57708
57832
|
}
|
|
57709
57833
|
async function parseDocx(buffer, options) {
|
|
57710
57834
|
try {
|
|
57711
57835
|
const { markdown, blocks, metadata, outline, warnings, images } = await parseDocxDocument(buffer, options);
|
|
57712
|
-
return scriptsOff({ success: true, fileType: "docx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess',
|
|
57836
|
+
return scriptsOff({ success: true, fileType: "docx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _1627 => _1627.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _1628 => _1628.pageCount]) }, _optionalChain([options, 'optionalAccess', _1629 => _1629.scriptTags]) === false);
|
|
57713
57837
|
} catch (err) {
|
|
57714
|
-
return { success: false, fileType: "docx", error:
|
|
57838
|
+
return { success: false, fileType: "docx", error: _chunk6ZRZLV3Jcjs.sanitizeError.call(void 0, err), code: _chunk6ZRZLV3Jcjs.classifyError.call(void 0, err) };
|
|
57715
57839
|
}
|
|
57716
57840
|
}
|
|
57717
57841
|
async function parsePptx(buffer, options) {
|
|
57718
57842
|
try {
|
|
57719
57843
|
const { markdown, blocks, metadata, outline, warnings, images } = await parsePptxDocument(buffer, options);
|
|
57720
|
-
return scriptsOff({ success: true, fileType: "pptx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess',
|
|
57844
|
+
return scriptsOff({ success: true, fileType: "pptx", markdown, blocks, metadata, outline, warnings, images: _optionalChain([images, 'optionalAccess', _1630 => _1630.length]) ? images : void 0, pageCount: _optionalChain([metadata, 'optionalAccess', _1631 => _1631.pageCount]) }, _optionalChain([options, 'optionalAccess', _1632 => _1632.scriptTags]) === false);
|
|
57721
57845
|
} catch (err) {
|
|
57722
|
-
return { success: false, fileType: "pptx", error:
|
|
57846
|
+
return { success: false, fileType: "pptx", error: _chunk6ZRZLV3Jcjs.sanitizeError.call(void 0, err), code: _chunk6ZRZLV3Jcjs.classifyError.call(void 0, err) };
|
|
57723
57847
|
}
|
|
57724
57848
|
}
|
|
57725
57849
|
async function parseHwpml(buffer, options) {
|
|
57726
57850
|
try {
|
|
57727
57851
|
const { markdown, blocks, metadata, outline, warnings } = parseHwpmlDocument(buffer, options);
|
|
57728
|
-
return { success: true, fileType: "hwpml", markdown, blocks, metadata, outline, warnings, pageCount: _optionalChain([metadata, 'optionalAccess',
|
|
57852
|
+
return { success: true, fileType: "hwpml", markdown, blocks, metadata, outline, warnings, pageCount: _optionalChain([metadata, 'optionalAccess', _1633 => _1633.pageCount]) };
|
|
57729
57853
|
} catch (err) {
|
|
57730
|
-
return { success: false, fileType: "hwpml", error:
|
|
57854
|
+
return { success: false, fileType: "hwpml", error: _chunk6ZRZLV3Jcjs.sanitizeError.call(void 0, err), code: _chunk6ZRZLV3Jcjs.classifyError.call(void 0, err) };
|
|
57731
57855
|
}
|
|
57732
57856
|
}
|
|
57733
57857
|
async function fillForm(input, values, outputFormat = "markdown") {
|
|
57734
57858
|
let buffer;
|
|
57735
57859
|
if (typeof input === "string") {
|
|
57736
57860
|
const buf = await _promises.readFile.call(void 0, input);
|
|
57737
|
-
buffer =
|
|
57861
|
+
buffer = _chunk6ZRZLV3Jcjs.toArrayBuffer.call(void 0, buf);
|
|
57738
57862
|
} else if (Buffer.isBuffer(input)) {
|
|
57739
|
-
buffer =
|
|
57863
|
+
buffer = _chunk6ZRZLV3Jcjs.toArrayBuffer.call(void 0, input);
|
|
57740
57864
|
} else {
|
|
57741
57865
|
buffer = input;
|
|
57742
57866
|
}
|
|
@@ -57762,7 +57886,7 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
57762
57886
|
throw new Error(`\uC11C\uC2DD \uD30C\uC2F1 \uC2E4\uD328: ${parsed.error}`);
|
|
57763
57887
|
}
|
|
57764
57888
|
const fill = fillFormFields(parsed.blocks, values);
|
|
57765
|
-
const markdown =
|
|
57889
|
+
const markdown = _chunkN65EY5BIcjs.blocksToMarkdown.call(void 0, fill.blocks);
|
|
57766
57890
|
if (outputFormat === "hwpx") {
|
|
57767
57891
|
const hwpxBuffer = await markdownToHwpx(markdown);
|
|
57768
57892
|
return { output: hwpxBuffer, format: "hwpx", fill };
|
|
@@ -57872,5 +57996,5 @@ async function fillForm(input, values, outputFormat = "markdown") {
|
|
|
57872
57996
|
|
|
57873
57997
|
|
|
57874
57998
|
|
|
57875
|
-
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 =
|
|
57999
|
+
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 = _chunk6ZRZLV3Jcjs.VERSION; exports.ValueCursor = ValueCursor; exports.agencyNames = agencyNames; exports.agencyStyle = agencyStyle; exports.applySplices = applySplices; exports.blocksToChunks = blocksToChunks; exports.blocksToMarkdown = _chunkN65EY5BIcjs.blocksToMarkdown; exports.blocksToPages = _chunkYG4YOPK6cjs.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 = _chunkN65EY5BIcjs.flattenLayoutTables; exports.formatFillValue = formatFillValue; exports.formatGateFinding = formatGateFinding; exports.gongmunGate = gongmunGate; exports.gongmunLintWarnings = gongmunLintWarnings; exports.hasStructuredCellContent = _chunkN65EY5BIcjs.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.lintBlocks = lintBlocks; exports.lintBudgetText = lintBudgetText; exports.lintGongmunText = lintGongmunText; exports.lintLogicText = lintLogicText; exports.lintMuncheText = lintMuncheText; exports.lintSlopText = lintSlopText; exports.logicLintWarnings = logicLintWarnings; 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.placeTotalRow = placeTotalRow; 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.runLintSuite = runLintSuite; exports.scanSectionXml = scanSectionXml; exports.simulateWrap = simulateWrap; exports.simulateWrapKeepWord = simulateWrapKeepWord; exports.slopLintWarnings = slopLintWarnings; exports.unknownFontWarnings = unknownFontWarnings; exports.usesGaejosikMunche = usesGaejosikMunche; exports.usesLogicStructure = usesLogicStructure; exports.validateHwpx = validateHwpx;
|
|
57876
58000
|
//# sourceMappingURL=index.cjs.map
|