kordoc 4.24.49 → 4.24.51
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 +14 -13
- package/dist/{-22V6D2US.js → -KCRZNASU.js} +42 -42
- package/dist/{chunk-DA5AXURC.js → chunk-2SIZ5MFF.js} +84 -11
- package/dist/chunk-2SIZ5MFF.js.map +1 -0
- package/dist/{chunk-EUJX7HTR.js → chunk-35G7U3YU.js} +26 -10
- package/dist/{chunk-EUJX7HTR.js.map → chunk-35G7U3YU.js.map} +1 -1
- package/dist/{chunk-UBY2PLKR.cjs → chunk-45LMTY3P.cjs} +48 -32
- package/dist/chunk-45LMTY3P.cjs.map +1 -0
- package/dist/{chunk-PW7MQZI4.cjs → chunk-4ATTNHKS.cjs} +2 -2
- package/dist/{chunk-PW7MQZI4.cjs.map → chunk-4ATTNHKS.cjs.map} +1 -1
- package/dist/{chunk-L3JP55ZY.js → chunk-4IPFRFVU.js} +2 -2
- package/dist/{chunk-7KKL3PRK.js → chunk-5IMZWUXP.js} +32 -30
- package/dist/chunk-5IMZWUXP.js.map +1 -0
- package/dist/{chunk-M5RQ2PNP.js → chunk-6IAYV5W4.js} +14 -6
- package/dist/chunk-6IAYV5W4.js.map +1 -0
- package/dist/{chunk-4MWUBTAE.js → chunk-7ZWEK6GU.js} +2 -2
- package/dist/{chunk-LCRSRVFJ.js → chunk-AI43WY7Q.js} +2 -2
- package/dist/{chunk-Q7FDPJUS.js → chunk-BW7M7NEK.js} +13 -11
- package/dist/{chunk-Q7FDPJUS.js.map → chunk-BW7M7NEK.js.map} +1 -1
- package/dist/{chunk-HETGOJ6V.js → chunk-BZNS2FVC.js} +2 -2
- package/dist/{chunk-VMOUAWGD.js → chunk-D4AMLUTJ.js} +7 -7
- package/dist/{chunk-KB4ORA7M.js → chunk-DAGVJDCR.js} +2 -2
- package/dist/{chunk-MIJTZKWF.js → chunk-EOU3LHBZ.js} +2 -2
- package/dist/{chunk-S54DZB2Z.js → chunk-G5BBHFKH.js} +83 -10
- package/dist/chunk-G5BBHFKH.js.map +1 -0
- package/dist/{chunk-LOSCIAHY.js → chunk-GCYCXGNW.js} +4 -2
- package/dist/chunk-GCYCXGNW.js.map +1 -0
- package/dist/{chunk-PMGJQWSW.js → chunk-I44OXMPJ.js} +2 -2
- package/dist/{chunk-67GSFYG7.js → chunk-IWAYL364.js} +2 -2
- package/dist/{chunk-UU54HN5I.js → chunk-J2223EAJ.js} +25 -31
- package/dist/chunk-J2223EAJ.js.map +1 -0
- package/dist/{chunk-6BFWLS7E.js → chunk-JQVDG7KX.js} +3 -3
- package/dist/{chunk-LFFARZYZ.js → chunk-MCQSIN7Z.js} +2 -2
- package/dist/{chunk-HW7WVYBF.js → chunk-NQBHDDAT.js} +2 -2
- package/dist/{chunk-MLBX6KQM.js → chunk-NZPCUEGV.js} +2 -2
- package/dist/{chunk-4HJKBRZJ.js → chunk-O42SEA4E.js} +18 -18
- package/dist/{chunk-TAHS42ED.js → chunk-P6UVZNSO.js} +27 -11
- package/dist/{chunk-TAHS42ED.js.map → chunk-P6UVZNSO.js.map} +1 -1
- package/dist/{chunk-R2RLNUNK.js → chunk-PUMTE6MJ.js} +6 -6
- package/dist/{chunk-IRAZCKQ6.cjs → chunk-QECUDHOQ.cjs} +3 -3
- package/dist/{chunk-IRAZCKQ6.cjs.map → chunk-QECUDHOQ.cjs.map} +1 -1
- package/dist/{chunk-367WLMPO.cjs → chunk-QMLFUMPU.cjs} +85 -83
- package/dist/chunk-QMLFUMPU.cjs.map +1 -0
- package/dist/{chunk-ZF24SO45.js → chunk-TAZTQPXH.js} +2 -2
- package/dist/{chunk-CCQMSIZQ.js → chunk-TKMHLKEP.js} +19 -19
- package/dist/{chunk-2UWWWM4Q.cjs → chunk-TUQER6U6.cjs} +98 -98
- package/dist/{chunk-2UWWWM4Q.cjs.map → chunk-TUQER6U6.cjs.map} +1 -1
- package/dist/{chunk-OAETOHH3.js → chunk-TZNID7WN.js} +3 -3
- package/dist/{chunk-Y6QW3FJQ.js → chunk-U45FZY4H.js} +2 -2
- package/dist/{chunk-AXW2FMVR.js → chunk-U65CFPRW.js} +2 -2
- package/dist/{chunk-TQOAPKLU.cjs → chunk-USVDMFOC.cjs} +6 -6
- package/dist/{chunk-TQOAPKLU.cjs.map → chunk-USVDMFOC.cjs.map} +1 -1
- package/dist/{chunk-KXHUHGMC.js → chunk-V26RXRUA.js} +2 -2
- package/dist/{chunk-WLFZOBZR.js → chunk-V4A3L5KR.js} +3 -3
- package/dist/{chunk-Y4MFHEK4.cjs → chunk-VEQ33FMY.cjs} +3 -3
- package/dist/{chunk-Y4MFHEK4.cjs.map → chunk-VEQ33FMY.cjs.map} +1 -1
- package/dist/{chunk-AUAJVQQK.js → chunk-WTDEYE6F.js} +2 -2
- package/dist/{chunk-RQLEGKEV.js → chunk-X2ZNWQBA.js} +2 -2
- package/dist/{chunk-PVV6OY4M.cjs → chunk-XENUD7JK.cjs} +177 -104
- package/dist/chunk-XENUD7JK.cjs.map +1 -0
- package/dist/{chunk-EYSXMDA7.js → chunk-XO6DCDIT.js} +17 -17
- package/dist/{chunk-DAAJO62F.js → chunk-ZWNVRSGF.js} +2 -2
- package/dist/chunks-TMBS7TRD.js +11 -0
- package/dist/cli.js +52 -51
- package/dist/cli.js.map +1 -1
- package/dist/{formula-QJEOIVKR.cjs → formula-4O54LMV4.cjs} +14 -13
- package/dist/formula-4O54LMV4.cjs.map +1 -0
- package/dist/{formula-FQLMMBDP.js → formula-6JZI46QH.js} +4 -3
- package/dist/formula-6JZI46QH.js.map +1 -0
- package/dist/{formula-BYEDWWZU.js → formula-PSPOE4NL.js} +5 -4
- package/dist/formula-PSPOE4NL.js.map +1 -0
- package/dist/generator-IHU3ZJFL.cjs +11 -0
- package/dist/{generator-FTM6GOGB.cjs.map → generator-IHU3ZJFL.cjs.map} +1 -1
- package/dist/generator-KE3WTY4O.js +17 -0
- package/dist/generator-SMNLBY45.js +10 -0
- package/dist/hancom-GB6HZKL7.js +84 -0
- package/dist/hancom-GB6HZKL7.js.map +1 -0
- package/dist/hancom-SZBRFB4L.js +85 -0
- package/dist/hancom-SZBRFB4L.js.map +1 -0
- package/dist/hancom-YAUQDSDK.cjs +85 -0
- package/dist/hancom-YAUQDSDK.cjs.map +1 -0
- package/dist/{image-ocr-7Y3FCGRR.js → image-ocr-7SIIO5GO.js} +10 -10
- package/dist/{image-ocr-VIGZE4YL.js → image-ocr-J63QUDI2.js} +7 -7
- package/dist/{image-ocr-WRILL3WO.cjs → image-ocr-YPKWLJVD.cjs} +28 -28
- package/dist/{image-ocr-WRILL3WO.cjs.map → image-ocr-YPKWLJVD.cjs.map} +1 -1
- package/dist/index.cjs +1119 -1117
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +75 -73
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +42 -41
- package/dist/mcp.js.map +1 -1
- package/dist/memo-5MQ6DM4A.js +17 -0
- package/dist/{model-bundle-UJRQPYUU.js → model-bundle-72BDGCZY.js} +5 -5
- package/dist/{models-64YLAWTI.js → models-QXVI5UHR.js} +5 -5
- package/dist/{parse-worker-v2-QWQZKFQO.js → parse-worker-v2-RCZPPU7G.js} +23 -23
- package/dist/{parser-RB6CBNAM.cjs → parser-IRERCFMK.cjs} +166 -166
- package/dist/{parser-RB6CBNAM.cjs.map → parser-IRERCFMK.cjs.map} +1 -1
- package/dist/{parser-JPWANPLM.js → parser-MAOMYZY5.js} +12 -12
- package/dist/{parser-XFU3VRWM.js → parser-NZJD3JG7.js} +16 -16
- package/dist/{pdf-ocr-XTZZEYKJ.js → pdf-ocr-ELMWWH5T.js} +6 -6
- package/dist/pdf-ocr-KIIEIQU6.cjs +42 -0
- package/dist/{pdf-ocr-NOJHEH4M.cjs.map → pdf-ocr-KIIEIQU6.cjs.map} +1 -1
- package/dist/{pdf-ocr-ZV3KYIIE.js → pdf-ocr-NP3BOUA5.js} +9 -9
- package/dist/{profile-io-FAJORRD2.js → profile-io-HDWE5EY3.js} +3 -3
- package/dist/{rasterize-4ZJUA2DZ.js → rasterize-4TQAGBZQ.js} +3 -3
- package/dist/{redact-doc-JPNROEH6.js → redact-doc-NZVL45JN.js} +29 -29
- package/dist/{render-D4WBOBKI.js → render-7JRZBK5R.js} +12 -12
- package/dist/{rewrite-fallback-OF3QI6CX.js → rewrite-fallback-VYGY2GAX.js} +13 -13
- package/dist/seal-TXHDIO27.js +16 -0
- package/dist/{setup-YC25YCQB.js → setup-ME45RAIC.js} +3 -3
- package/dist/{to-hwpx-ZWN64NCQ.js → to-hwpx-7XR5P4NH.js} +4 -4
- package/dist/to-hwpx-HIL2WODY.cjs +16 -0
- package/dist/{to-hwpx-LUA6F5RR.cjs.map → to-hwpx-HIL2WODY.cjs.map} +1 -1
- package/dist/{to-hwpx-D7OMPDUQ.js → to-hwpx-IFL6CZ6T.js} +7 -7
- package/dist/visual-J3E3ZYN3.js +37 -0
- package/dist/{watch-ZU576VSR.js → watch-BAED4COV.js} +23 -23
- package/package.json +1 -1
- package/dist/chunk-367WLMPO.cjs.map +0 -1
- package/dist/chunk-7KKL3PRK.js.map +0 -1
- package/dist/chunk-DA5AXURC.js.map +0 -1
- package/dist/chunk-LOSCIAHY.js.map +0 -1
- package/dist/chunk-M5RQ2PNP.js.map +0 -1
- package/dist/chunk-PVV6OY4M.cjs.map +0 -1
- package/dist/chunk-S54DZB2Z.js.map +0 -1
- package/dist/chunk-UBY2PLKR.cjs.map +0 -1
- package/dist/chunk-UU54HN5I.js.map +0 -1
- package/dist/chunks-Q7242OJE.js +0 -11
- package/dist/formula-BYEDWWZU.js.map +0 -1
- package/dist/formula-FQLMMBDP.js.map +0 -1
- package/dist/formula-QJEOIVKR.cjs.map +0 -1
- package/dist/generator-FTM6GOGB.cjs +0 -11
- package/dist/generator-Q3L7RNUY.js +0 -17
- package/dist/generator-SU73HZHR.js +0 -10
- package/dist/memo-T5ZQEXEA.js +0 -17
- package/dist/pdf-ocr-NOJHEH4M.cjs +0 -42
- package/dist/seal-DQWEHIAM.js +0 -16
- package/dist/to-hwpx-LUA6F5RR.cjs +0 -16
- package/dist/visual-SW7NPY6K.js +0 -37
- /package/dist/{-22V6D2US.js.map → -KCRZNASU.js.map} +0 -0
- /package/dist/{chunk-L3JP55ZY.js.map → chunk-4IPFRFVU.js.map} +0 -0
- /package/dist/{chunk-4MWUBTAE.js.map → chunk-7ZWEK6GU.js.map} +0 -0
- /package/dist/{chunk-LCRSRVFJ.js.map → chunk-AI43WY7Q.js.map} +0 -0
- /package/dist/{chunk-HETGOJ6V.js.map → chunk-BZNS2FVC.js.map} +0 -0
- /package/dist/{chunk-VMOUAWGD.js.map → chunk-D4AMLUTJ.js.map} +0 -0
- /package/dist/{chunk-KB4ORA7M.js.map → chunk-DAGVJDCR.js.map} +0 -0
- /package/dist/{chunk-MIJTZKWF.js.map → chunk-EOU3LHBZ.js.map} +0 -0
- /package/dist/{chunk-PMGJQWSW.js.map → chunk-I44OXMPJ.js.map} +0 -0
- /package/dist/{chunk-67GSFYG7.js.map → chunk-IWAYL364.js.map} +0 -0
- /package/dist/{chunk-6BFWLS7E.js.map → chunk-JQVDG7KX.js.map} +0 -0
- /package/dist/{chunk-LFFARZYZ.js.map → chunk-MCQSIN7Z.js.map} +0 -0
- /package/dist/{chunk-HW7WVYBF.js.map → chunk-NQBHDDAT.js.map} +0 -0
- /package/dist/{chunk-MLBX6KQM.js.map → chunk-NZPCUEGV.js.map} +0 -0
- /package/dist/{chunk-4HJKBRZJ.js.map → chunk-O42SEA4E.js.map} +0 -0
- /package/dist/{chunk-R2RLNUNK.js.map → chunk-PUMTE6MJ.js.map} +0 -0
- /package/dist/{chunk-ZF24SO45.js.map → chunk-TAZTQPXH.js.map} +0 -0
- /package/dist/{chunk-CCQMSIZQ.js.map → chunk-TKMHLKEP.js.map} +0 -0
- /package/dist/{chunk-OAETOHH3.js.map → chunk-TZNID7WN.js.map} +0 -0
- /package/dist/{chunk-Y6QW3FJQ.js.map → chunk-U45FZY4H.js.map} +0 -0
- /package/dist/{chunk-AXW2FMVR.js.map → chunk-U65CFPRW.js.map} +0 -0
- /package/dist/{chunk-KXHUHGMC.js.map → chunk-V26RXRUA.js.map} +0 -0
- /package/dist/{chunk-WLFZOBZR.js.map → chunk-V4A3L5KR.js.map} +0 -0
- /package/dist/{chunk-AUAJVQQK.js.map → chunk-WTDEYE6F.js.map} +0 -0
- /package/dist/{chunk-RQLEGKEV.js.map → chunk-X2ZNWQBA.js.map} +0 -0
- /package/dist/{chunk-EYSXMDA7.js.map → chunk-XO6DCDIT.js.map} +0 -0
- /package/dist/{chunk-DAAJO62F.js.map → chunk-ZWNVRSGF.js.map} +0 -0
- /package/dist/{chunks-Q7242OJE.js.map → chunks-TMBS7TRD.js.map} +0 -0
- /package/dist/{generator-Q3L7RNUY.js.map → generator-KE3WTY4O.js.map} +0 -0
- /package/dist/{generator-SU73HZHR.js.map → generator-SMNLBY45.js.map} +0 -0
- /package/dist/{image-ocr-7Y3FCGRR.js.map → image-ocr-7SIIO5GO.js.map} +0 -0
- /package/dist/{image-ocr-VIGZE4YL.js.map → image-ocr-J63QUDI2.js.map} +0 -0
- /package/dist/{memo-T5ZQEXEA.js.map → memo-5MQ6DM4A.js.map} +0 -0
- /package/dist/{model-bundle-UJRQPYUU.js.map → model-bundle-72BDGCZY.js.map} +0 -0
- /package/dist/{models-64YLAWTI.js.map → models-QXVI5UHR.js.map} +0 -0
- /package/dist/{parse-worker-v2-QWQZKFQO.js.map → parse-worker-v2-RCZPPU7G.js.map} +0 -0
- /package/dist/{parser-JPWANPLM.js.map → parser-MAOMYZY5.js.map} +0 -0
- /package/dist/{parser-XFU3VRWM.js.map → parser-NZJD3JG7.js.map} +0 -0
- /package/dist/{pdf-ocr-XTZZEYKJ.js.map → pdf-ocr-ELMWWH5T.js.map} +0 -0
- /package/dist/{pdf-ocr-ZV3KYIIE.js.map → pdf-ocr-NP3BOUA5.js.map} +0 -0
- /package/dist/{profile-io-FAJORRD2.js.map → profile-io-HDWE5EY3.js.map} +0 -0
- /package/dist/{rasterize-4ZJUA2DZ.js.map → rasterize-4TQAGBZQ.js.map} +0 -0
- /package/dist/{redact-doc-JPNROEH6.js.map → redact-doc-NZVL45JN.js.map} +0 -0
- /package/dist/{render-D4WBOBKI.js.map → render-7JRZBK5R.js.map} +0 -0
- /package/dist/{rewrite-fallback-OF3QI6CX.js.map → rewrite-fallback-VYGY2GAX.js.map} +0 -0
- /package/dist/{seal-DQWEHIAM.js.map → seal-TXHDIO27.js.map} +0 -0
- /package/dist/{setup-YC25YCQB.js.map → setup-ME45RAIC.js.map} +0 -0
- /package/dist/{to-hwpx-D7OMPDUQ.js.map → to-hwpx-7XR5P4NH.js.map} +0 -0
- /package/dist/{to-hwpx-ZWN64NCQ.js.map → to-hwpx-IFL6CZ6T.js.map} +0 -0
- /package/dist/{visual-SW7NPY6K.js.map → visual-J3E3ZYN3.js.map} +0 -0
- /package/dist/{watch-ZU576VSR.js.map → watch-BAED4COV.js.map} +0 -0
|
@@ -39,12 +39,12 @@ var _chunkLAYKIZOXcjs = require('./chunk-LAYKIZOX.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
var
|
|
42
|
+
var _chunkUSVDMFOCcjs = require('./chunk-USVDMFOC.cjs');
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
var
|
|
47
|
+
var _chunk4ATTNHKScjs = require('./chunk-4ATTNHKS.cjs');
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
var _chunkGS7T56RPcjs = require('./chunk-GS7T56RP.cjs');
|
|
@@ -62,6 +62,7 @@ var TAG_PARA_LINE_SEG = 69;
|
|
|
62
62
|
var TAG_CTRL_HEADER = 71;
|
|
63
63
|
var TAG_LIST_HEADER = 72;
|
|
64
64
|
var TAG_MEMO_LIST = 93;
|
|
65
|
+
var TAG_FOOTNOTE_SHAPE = 74;
|
|
65
66
|
var TAG_TABLE = 77;
|
|
66
67
|
var TAG_SHAPE_COMPONENT = 76;
|
|
67
68
|
var TAG_SHAPE_COMPONENT_PICTURE = 85;
|
|
@@ -121,7 +122,7 @@ function decompressStream(data2) {
|
|
|
121
122
|
return _zlib.inflateRawSync.call(void 0, data2, opts);
|
|
122
123
|
}
|
|
123
124
|
function parseFileHeader(data2) {
|
|
124
|
-
if (data2.length < 40) throw new (0,
|
|
125
|
+
if (data2.length < 40) throw new (0, _chunk4ATTNHKScjs.KordocError)("FileHeader\uAC00 \uB108\uBB34 \uC9E7\uC2B5\uB2C8\uB2E4 (\uCD5C\uC18C 40\uBC14\uC774\uD2B8)");
|
|
125
126
|
const sig = data2.subarray(0, 32).toString("utf8").replace(/\0+$/, "");
|
|
126
127
|
return {
|
|
127
128
|
signature: sig,
|
|
@@ -1350,7 +1351,7 @@ function decryptPasswordStream(raw, password) {
|
|
|
1350
1351
|
var TAG_DOCUMENT_PROPERTIES = 16;
|
|
1351
1352
|
var TAG_ID_MAPPINGS2 = 17;
|
|
1352
1353
|
function assertDecryptedDocInfo(data2, readRecords2) {
|
|
1353
|
-
const wrong = () => new (0,
|
|
1354
|
+
const wrong = () => new (0, _chunk4ATTNHKScjs.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.");
|
|
1354
1355
|
let records;
|
|
1355
1356
|
try {
|
|
1356
1357
|
records = readRecords2(data2);
|
|
@@ -1362,7 +1363,7 @@ function assertDecryptedDocInfo(data2, readRecords2) {
|
|
|
1362
1363
|
}
|
|
1363
1364
|
function assertSupportedEncryptVersion(version) {
|
|
1364
1365
|
if (version !== SUPPORTED_ENCRYPT_VERSION) {
|
|
1365
|
-
throw new (0,
|
|
1366
|
+
throw new (0, _chunk4ATTNHKScjs.KordocError)(
|
|
1366
1367
|
`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 HWP \uC554\uD638\uD654 \uBC84\uC804\uC785\uB2C8\uB2E4 (EncryptVersion=${version}, \uC9C0\uC6D0: ${SUPPORTED_ENCRYPT_VERSION})`
|
|
1367
1368
|
);
|
|
1368
1369
|
}
|
|
@@ -1533,6 +1534,10 @@ function headFormatToNumFmt(code) {
|
|
|
1533
1534
|
return "latinUpper";
|
|
1534
1535
|
case 5:
|
|
1535
1536
|
return "latinLower";
|
|
1537
|
+
case 6:
|
|
1538
|
+
return "circledLatinUpper";
|
|
1539
|
+
case 7:
|
|
1540
|
+
return "circledLatinLower";
|
|
1536
1541
|
case 8:
|
|
1537
1542
|
return "ganada";
|
|
1538
1543
|
case 9:
|
|
@@ -1550,26 +1555,7 @@ function headFormatToNumFmt(code) {
|
|
|
1550
1555
|
}
|
|
1551
1556
|
}
|
|
1552
1557
|
function shapeFormatToNumFmt(code) {
|
|
1553
|
-
|
|
1554
|
-
case 1:
|
|
1555
|
-
return "circled";
|
|
1556
|
-
case 2:
|
|
1557
|
-
return "romanUpper";
|
|
1558
|
-
case 3:
|
|
1559
|
-
return "romanLower";
|
|
1560
|
-
case 4:
|
|
1561
|
-
return "latinUpper";
|
|
1562
|
-
case 5:
|
|
1563
|
-
return "latinLower";
|
|
1564
|
-
case 6:
|
|
1565
|
-
return "ganada";
|
|
1566
|
-
case 7:
|
|
1567
|
-
return "hangulNum";
|
|
1568
|
-
case 8:
|
|
1569
|
-
return "hanjaNum";
|
|
1570
|
-
default:
|
|
1571
|
-
return "digit";
|
|
1572
|
-
}
|
|
1558
|
+
return headFormatToNumFmt(code);
|
|
1573
1559
|
}
|
|
1574
1560
|
var JAMO = "\u3131\u3134\u3137\u3139\u3141\u3142\u3145\u3147\u3148\u314A\u314B\u314C\u314D\u314E";
|
|
1575
1561
|
var CIRCLED_JAMO = "\u3260\u3261\u3262\u3263\u3264\u3265\u3266\u3267\u3268\u3269\u326A\u326B\u326C\u326D";
|
|
@@ -1611,23 +1597,27 @@ var HANJA_UNITS = ["", "\u5341", "\u767E", "\u5343", "\u842C"];
|
|
|
1611
1597
|
function formatNumber(n, fmt) {
|
|
1612
1598
|
switch (fmt) {
|
|
1613
1599
|
case "circled":
|
|
1614
|
-
return n >= 1 ?
|
|
1600
|
+
return n >= 1 ? _chunkUSVDMFOCcjs.circledNumber.call(void 0, n - 1) : String(n);
|
|
1615
1601
|
case "romanUpper":
|
|
1616
|
-
return
|
|
1602
|
+
return _chunkUSVDMFOCcjs.romanNumeral.call(void 0, n, true);
|
|
1617
1603
|
case "romanLower":
|
|
1618
|
-
return
|
|
1604
|
+
return _chunkUSVDMFOCcjs.romanNumeral.call(void 0, n, false);
|
|
1619
1605
|
case "latinUpper":
|
|
1620
1606
|
return formatLatin(n, true) || String(n);
|
|
1621
1607
|
case "latinLower":
|
|
1622
1608
|
return formatLatin(n, false) || String(n);
|
|
1623
1609
|
case "ganada":
|
|
1624
|
-
return n >= 1 ?
|
|
1610
|
+
return n >= 1 ? _chunkUSVDMFOCcjs.hangulOrdinal.call(void 0, n - 1) : String(n);
|
|
1625
1611
|
case "circledGanada":
|
|
1626
|
-
return n >= 1 ?
|
|
1612
|
+
return n >= 1 ? _chunkUSVDMFOCcjs.circledHangul.call(void 0, n - 1) : String(n);
|
|
1627
1613
|
case "jamo":
|
|
1628
1614
|
return fromTable(n, JAMO);
|
|
1629
1615
|
case "circledJamo":
|
|
1630
1616
|
return fromTable(n, CIRCLED_JAMO);
|
|
1617
|
+
case "circledLatinUpper":
|
|
1618
|
+
return n >= 1 && n <= 26 ? String.fromCodePoint(9398 + n - 1) : formatLatin(n, true) || String(n);
|
|
1619
|
+
case "circledLatinLower":
|
|
1620
|
+
return n >= 1 && n <= 26 ? String.fromCodePoint(9424 + n - 1) : formatLatin(n, false) || String(n);
|
|
1631
1621
|
case "hangulNum":
|
|
1632
1622
|
return formatEastAsianNumber(n, HANGUL_DIGITS, HANGUL_UNITS, "\uC601");
|
|
1633
1623
|
case "hanjaNum":
|
|
@@ -1806,8 +1796,8 @@ function emitParagraphBlocks(p) {
|
|
|
1806
1796
|
return blocks;
|
|
1807
1797
|
}
|
|
1808
1798
|
function tableFlatText(table) {
|
|
1809
|
-
const flat =
|
|
1810
|
-
return table.caption ?
|
|
1799
|
+
const flat = _chunkUSVDMFOCcjs.convertTableToText.call(void 0, table.cells);
|
|
1800
|
+
return table.caption ? _chunkUSVDMFOCcjs.captionedText.call(void 0, flat, table.caption, table.captionBelow) : flat;
|
|
1811
1801
|
}
|
|
1812
1802
|
function blocksPlainText(blocks, sep) {
|
|
1813
1803
|
const parts = [];
|
|
@@ -1890,8 +1880,8 @@ ${cell.text}` : cell.text;
|
|
|
1890
1880
|
}
|
|
1891
1881
|
function buildAddressedTable(cells, rows, cols, keepAnchoredEmptyCols) {
|
|
1892
1882
|
for (const c of cells) {
|
|
1893
|
-
rows = Math.max(rows, Math.min((_nullishCoalesce(c.rowAddr, () => ( 0))) + 1,
|
|
1894
|
-
cols = Math.max(cols, Math.min((_nullishCoalesce(c.colAddr, () => ( 0))) + 1,
|
|
1883
|
+
rows = Math.max(rows, Math.min((_nullishCoalesce(c.rowAddr, () => ( 0))) + 1, _chunkUSVDMFOCcjs.MAX_ROWS));
|
|
1884
|
+
cols = Math.max(cols, Math.min((_nullishCoalesce(c.colAddr, () => ( 0))) + 1, _chunkUSVDMFOCcjs.MAX_COLS));
|
|
1895
1885
|
}
|
|
1896
1886
|
const placed = resolveCellOverlaps(cells, rows, cols);
|
|
1897
1887
|
const byRow = Array.from({ length: rows }, () => []);
|
|
@@ -1899,12 +1889,12 @@ function buildAddressedTable(cells, rows, cols, keepAnchoredEmptyCols) {
|
|
|
1899
1889
|
const r = _nullishCoalesce(c.rowAddr, () => ( 0));
|
|
1900
1890
|
if (r < rows && (_nullishCoalesce(c.colAddr, () => ( 0))) < cols) byRow[r].push(c);
|
|
1901
1891
|
}
|
|
1902
|
-
const table =
|
|
1892
|
+
const table = _chunkUSVDMFOCcjs.buildTable.call(void 0, byRow, { keepAnchoredEmptyCols });
|
|
1903
1893
|
if (table.rows === 0) return null;
|
|
1904
1894
|
for (const c of placed) {
|
|
1905
1895
|
if (c.edges) {
|
|
1906
1896
|
const at = _optionalChain([table, 'access', _12 => _12.cells, 'access', _13 => _13[_nullishCoalesce(c.rowAddr, () => ( 0))], 'optionalAccess', _14 => _14[_nullishCoalesce(c.colAddr, () => ( 0))]]);
|
|
1907
|
-
if (at)
|
|
1897
|
+
if (at) _chunkUSVDMFOCcjs.CELL_EDGES.set(at, c.edges);
|
|
1908
1898
|
}
|
|
1909
1899
|
if (!_optionalChain([c, 'access', _15 => _15.blocks, 'optionalAccess', _16 => _16.length]) && !c.isHeader) continue;
|
|
1910
1900
|
const target = _optionalChain([table, 'access', _17 => _17.cells, 'access', _18 => _18[_nullishCoalesce(c.rowAddr, () => ( 0))], 'optionalAccess', _19 => _19[_nullishCoalesce(c.colAddr, () => ( 0))]]);
|
|
@@ -1997,6 +1987,7 @@ function createHwp5DocState() {
|
|
|
1997
1987
|
numbering: new NumberingState(),
|
|
1998
1988
|
outlineNumberingId: 0,
|
|
1999
1989
|
autoCounters: /* @__PURE__ */ new Map(),
|
|
1990
|
+
noteFormats: /* @__PURE__ */ new Map(),
|
|
2000
1991
|
headerTexts: /* @__PURE__ */ new Set(),
|
|
2001
1992
|
tocTexts: /* @__PURE__ */ new Set(),
|
|
2002
1993
|
headerBlocks: [],
|
|
@@ -2141,7 +2132,7 @@ function parseParagraph(records, start, end, ctx) {
|
|
|
2141
2132
|
continue;
|
|
2142
2133
|
}
|
|
2143
2134
|
if (!ctrl2.href) continue;
|
|
2144
|
-
const href =
|
|
2135
|
+
const href = _chunk4ATTNHKScjs.sanitizeHref.call(void 0, ctrl2.href);
|
|
2145
2136
|
if (!href) continue;
|
|
2146
2137
|
if (!anchor.trim() || anchor.includes(INLINE_TABLE_MARK)) continue;
|
|
2147
2138
|
text = text.slice(0, r.start) + `[${anchor}](${href})` + text.slice(r.end);
|
|
@@ -2151,7 +2142,7 @@ function parseParagraph(records, start, end, ctx) {
|
|
|
2151
2142
|
}
|
|
2152
2143
|
if (text.includes(LITERAL_DOLLAR_MARK)) text = text.replaceAll(LITERAL_DOLLAR_MARK, "\\$");
|
|
2153
2144
|
text = resolveLiteralLt(text);
|
|
2154
|
-
text =
|
|
2145
|
+
text = _chunkUSVDMFOCcjs.tidyScriptTags.call(void 0, text);
|
|
2155
2146
|
const toc = _chunkLAYKIZOXcjs.takeTocLeaders.call(void 0, text);
|
|
2156
2147
|
text = toc.text;
|
|
2157
2148
|
const holdsText = (c) => {
|
|
@@ -2269,6 +2260,11 @@ function applyCtrlEffect(ctrl2, records, ctx) {
|
|
|
2269
2260
|
if (ctrl2.data.length >= 20) {
|
|
2270
2261
|
ctx.doc.outlineNumberingId = ctrl2.data.readUInt16LE(18);
|
|
2271
2262
|
}
|
|
2263
|
+
let note = 1;
|
|
2264
|
+
for (let i = ctrl2.childStart; i < ctrl2.childEnd && note <= 2; i++) {
|
|
2265
|
+
if (records[i].tagId !== TAG_FOOTNOTE_SHAPE || records[i].data.length < 4) continue;
|
|
2266
|
+
ctx.doc.noteFormats.set(note++, records[i].data.readUInt32LE(0) & 255);
|
|
2267
|
+
}
|
|
2272
2268
|
return;
|
|
2273
2269
|
}
|
|
2274
2270
|
case CTRL_OLE: {
|
|
@@ -2278,7 +2274,7 @@ function applyCtrlEffect(ctrl2, records, ctx) {
|
|
|
2278
2274
|
// 글자 겹침 — ctrl id 뒤 글자 수(WORD)·겹친 글자(WCHAR[n])·테두리 종류(BYTE, 0 = 없음). 종전엔 건너뛰어 법령 서식 원 번호(⑯·⑰)가 빠졌다
|
|
2279
2275
|
case CTRL_TCPS: {
|
|
2280
2276
|
const d = ctrl2.data, n = d.length >= 6 ? d.readUInt16LE(4) : 0;
|
|
2281
|
-
if (n > 0 && d.length >= 6 + 2 * n) ctrl2.inlineText =
|
|
2277
|
+
if (n > 0 && d.length >= 6 + 2 * n) ctrl2.inlineText = _chunkUSVDMFOCcjs.composeText.call(void 0, d.toString("utf16le", 6, 6 + 2 * n), (_nullishCoalesce(d[6 + 2 * n], () => ( 0))) !== 0);
|
|
2282
2278
|
return;
|
|
2283
2279
|
}
|
|
2284
2280
|
// 숨은 설명/단 정의/쪽번호 위치/감추기/찾아보기/책갈피/덧말 — 본문 텍스트 없음 또는 의도적 스킵
|
|
@@ -2315,18 +2311,16 @@ function parseListHeaderParagraphs(ctrl2, records, ctx) {
|
|
|
2315
2311
|
return [];
|
|
2316
2312
|
}
|
|
2317
2313
|
function applyNoteEffect(ctrl2, records, ctx, autoType) {
|
|
2318
|
-
const
|
|
2314
|
+
const stored = ctrl2.data.length >= 8 ? ctrl2.data.readUInt32LE(4) & 65535 : 0;
|
|
2315
|
+
const num = stored || (_nullishCoalesce(ctx.doc.autoCounters.get(autoType), () => ( 1)));
|
|
2316
|
+
ctx.doc.autoCounters.set(autoType, num);
|
|
2319
2317
|
let before = "";
|
|
2320
2318
|
let after = "";
|
|
2321
|
-
let shape = 0;
|
|
2322
2319
|
if (ctrl2.data.length >= 12) {
|
|
2323
2320
|
before = wcharAt(ctrl2.data, 8);
|
|
2324
2321
|
after = wcharAt(ctrl2.data, 10);
|
|
2325
2322
|
}
|
|
2326
|
-
|
|
2327
|
-
shape = ctrl2.data.readUInt32LE(12) & 255;
|
|
2328
|
-
}
|
|
2329
|
-
const formatted = formatNumber(num, shapeFormatToNumFmt(shape));
|
|
2323
|
+
const formatted = formatNumber(num, shapeFormatToNumFmt(_nullishCoalesce(ctx.doc.noteFormats.get(autoType), () => ( 0))));
|
|
2330
2324
|
const marker = before || after ? `${before}${formatted}${after}` : `${formatted})`;
|
|
2331
2325
|
const blocks = parseListHeaderParagraphs(ctrl2, records, ctx);
|
|
2332
2326
|
const content = blocksPlainText(blocks, " ");
|
|
@@ -2413,7 +2407,7 @@ function hyperlinkUrlFromCommand(command) {
|
|
|
2413
2407
|
}
|
|
2414
2408
|
var A4_HEIGHT = 84188;
|
|
2415
2409
|
function keepUnlessPageSpanning(table, cells) {
|
|
2416
|
-
if (!cells.some((c) => c.pageSpanning))
|
|
2410
|
+
if (!cells.some((c) => c.pageSpanning)) _chunkUSVDMFOCcjs.markNonLayoutTable.call(void 0, table);
|
|
2417
2411
|
}
|
|
2418
2412
|
function parseTableControl(ctrl2, records, ctx) {
|
|
2419
2413
|
if (ctx.depth >= MAX_NEST_DEPTH) return null;
|
|
@@ -2425,8 +2419,8 @@ function parseTableControl(ctrl2, records, ctx) {
|
|
|
2425
2419
|
let tableIdx = -1;
|
|
2426
2420
|
for (let i2 = childStart; i2 < childEnd; i2++) {
|
|
2427
2421
|
if (records[i2].tagId === TAG_TABLE && records[i2].level === directLevel && records[i2].data.length >= 8) {
|
|
2428
|
-
rows = Math.min(records[i2].data.readUInt16LE(4),
|
|
2429
|
-
cols = Math.min(records[i2].data.readUInt16LE(6),
|
|
2422
|
+
rows = Math.min(records[i2].data.readUInt16LE(4), _chunkUSVDMFOCcjs.MAX_ROWS);
|
|
2423
|
+
cols = Math.min(records[i2].data.readUInt16LE(6), _chunkUSVDMFOCcjs.MAX_COLS);
|
|
2430
2424
|
tableIdx = i2;
|
|
2431
2425
|
break;
|
|
2432
2426
|
}
|
|
@@ -2473,11 +2467,11 @@ function parseTableControl(ctrl2, records, ctx) {
|
|
|
2473
2467
|
return table2;
|
|
2474
2468
|
}
|
|
2475
2469
|
if (rows === 0 || cols === 0) {
|
|
2476
|
-
rows = Math.min(cells.length,
|
|
2470
|
+
rows = Math.min(cells.length, _chunkUSVDMFOCcjs.MAX_ROWS);
|
|
2477
2471
|
cols = 1;
|
|
2478
2472
|
}
|
|
2479
2473
|
const cellRows = arrangeCells(rows, cols, cells);
|
|
2480
|
-
const table =
|
|
2474
|
+
const table = _chunkUSVDMFOCcjs.buildTable.call(void 0, cellRows, { keepAnchoredEmptyCols: ctx.doc.keepTrailingEmptyCols });
|
|
2481
2475
|
if (caption && table.rows > 0) table.caption = caption;
|
|
2482
2476
|
if (caption && captionBelow && table.rows > 0) table.captionBelow = true;
|
|
2483
2477
|
if (sourceId && table.rows > 0) table.sourceId = sourceId;
|
|
@@ -2497,8 +2491,8 @@ function parseCell(records, lhIdx, end, ctx) {
|
|
|
2497
2491
|
rowAddr = rec.data.readUInt16LE(10);
|
|
2498
2492
|
const cs = rec.data.readUInt16LE(12);
|
|
2499
2493
|
const rs = rec.data.readUInt16LE(14);
|
|
2500
|
-
if (cs > 0) colSpan = Math.min(cs,
|
|
2501
|
-
if (rs > 0) rowSpan = Math.min(rs,
|
|
2494
|
+
if (cs > 0) colSpan = Math.min(cs, _chunkUSVDMFOCcjs.MAX_COLS);
|
|
2495
|
+
if (rs > 0) rowSpan = Math.min(rs, _chunkUSVDMFOCcjs.MAX_ROWS);
|
|
2502
2496
|
}
|
|
2503
2497
|
const blocks = ctx.depth < MAX_NEST_DEPTH ? parseParagraphList(records, lhIdx + 1, end, { ...ctx, depth: ctx.depth + 1, plainText: false }) : [];
|
|
2504
2498
|
const { text, hasStructure } = cellTextFromBlocks(blocks);
|
|
@@ -2624,7 +2618,7 @@ function emphasisSpans(state, text) {
|
|
|
2624
2618
|
for (let r = 0; r < runs.length; r++) {
|
|
2625
2619
|
const end = r + 1 < runs.length ? runs[r + 1][0] : state.text.length;
|
|
2626
2620
|
const raw = state.text.slice(r === 0 ? 0 : runs[r][0], end);
|
|
2627
|
-
const t =
|
|
2621
|
+
const t = _chunkUSVDMFOCcjs.tidyScriptTags.call(void 0, resolveLiteralLt(raw.replaceAll(LITERAL_DOLLAR_MARK, "\\$")));
|
|
2628
2622
|
if (!t) continue;
|
|
2629
2623
|
const key = runs[r][1], last = spans[spans.length - 1];
|
|
2630
2624
|
if (last && last.key === key) {
|
|
@@ -2681,7 +2675,7 @@ function hasRealUnderline(attrFlags) {
|
|
|
2681
2675
|
|
|
2682
2676
|
|
|
2683
2677
|
// src/memo-notes.ts
|
|
2684
|
-
var squash = (s) =>
|
|
2678
|
+
var squash = (s) => _chunkUSVDMFOCcjs.sanitizeText.call(void 0, s).replace(/\s+/g, "");
|
|
2685
2679
|
function blockText(b) {
|
|
2686
2680
|
if (b.type !== "table" || !b.table) return _nullishCoalesce(b.text, () => ( ""));
|
|
2687
2681
|
return b.table.cells.flat().map((c) => _nullishCoalesce(_optionalChain([c, 'optionalAccess', _51 => _51.text]), () => ( ""))).join("\n");
|
|
@@ -2703,7 +2697,7 @@ function locateMemoBlocks(blocks, memos) {
|
|
|
2703
2697
|
});
|
|
2704
2698
|
}
|
|
2705
2699
|
function memosMarkdown(memos) {
|
|
2706
|
-
const one = (s) =>
|
|
2700
|
+
const one = (s) => _chunkUSVDMFOCcjs.escapeGfm.call(void 0, _chunkUSVDMFOCcjs.sanitizeText.call(void 0, s.replace(/\s*\n\s*/g, " / ")));
|
|
2707
2701
|
const lines = memos.map((m, i) => {
|
|
2708
2702
|
const when = _optionalChain([m, 'access', _52 => _52.createdAt, 'optionalAccess', _53 => _53.replace, 'call', _54 => _54("T", " "), 'access', _55 => _55.replace, 'call', _56 => _56(/(:\d\d)?Z?$/, "")]);
|
|
2709
2703
|
const who = [m.author, when].filter(Boolean).join(", ");
|
|
@@ -2735,7 +2729,7 @@ function openHwp5Container(buffer, options) {
|
|
|
2735
2729
|
lenientCfb = _chunkDEVQZTE7cjs.parseLenientCfb.call(void 0, buffer);
|
|
2736
2730
|
warnings.push({ message: "\uC190\uC0C1\uB41C CFB \uCEE8\uD14C\uC774\uB108 \u2014 lenient \uBAA8\uB4DC\uB85C \uBCF5\uAD6C", code: "LENIENT_CFB_RECOVERY" });
|
|
2737
2731
|
} catch (e8) {
|
|
2738
|
-
throw new (0,
|
|
2732
|
+
throw new (0, _chunk4ATTNHKScjs.KordocError)("CFB \uCEE8\uD14C\uC774\uB108 \uD30C\uC2F1 \uC2E4\uD328 (strict \uBC0F lenient \uBAA8\uB450)");
|
|
2739
2733
|
}
|
|
2740
2734
|
}
|
|
2741
2735
|
const readRawStream = (path) => {
|
|
@@ -2746,14 +2740,14 @@ function openHwp5Container(buffer, options) {
|
|
|
2746
2740
|
return lenientCfb.findStream(path);
|
|
2747
2741
|
};
|
|
2748
2742
|
const headerData = readRawStream("/FileHeader");
|
|
2749
|
-
if (!headerData) throw new (0,
|
|
2743
|
+
if (!headerData) throw new (0, _chunk4ATTNHKScjs.KordocError)("FileHeader \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
|
|
2750
2744
|
const header = parseFileHeader(headerData);
|
|
2751
|
-
if (header.signature !== "HWP Document File") throw new (0,
|
|
2752
|
-
if (header.flags & FLAG_DRM) throw new (0,
|
|
2745
|
+
if (header.signature !== "HWP Document File") throw new (0, _chunk4ATTNHKScjs.KordocError)("HWP \uC2DC\uADF8\uB2C8\uCC98 \uBD88\uC77C\uCE58");
|
|
2746
|
+
if (header.flags & FLAG_DRM) throw new (0, _chunk4ATTNHKScjs.KordocError)("DRM \uBCF4\uD638\uB41C HWP\uB294 \uC9C0\uC6D0\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4");
|
|
2753
2747
|
const encrypted = (header.flags & FLAG_ENCRYPTED) !== 0;
|
|
2754
2748
|
if (encrypted) {
|
|
2755
2749
|
if (!_optionalChain([options, 'optionalAccess', _58 => _58.password])) {
|
|
2756
|
-
throw new (0,
|
|
2750
|
+
throw new (0, _chunk4ATTNHKScjs.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.");
|
|
2757
2751
|
}
|
|
2758
2752
|
assertSupportedEncryptVersion(readEncryptVersion(headerData));
|
|
2759
2753
|
}
|
|
@@ -2767,12 +2761,12 @@ function openHwp5Container(buffer, options) {
|
|
|
2767
2761
|
const distribution = (header.flags & FLAG_DISTRIBUTION) !== 0;
|
|
2768
2762
|
if (encrypted) {
|
|
2769
2763
|
const rawDocInfo = findStream("/DocInfo");
|
|
2770
|
-
if (!rawDocInfo) throw new (0,
|
|
2764
|
+
if (!rawDocInfo) throw new (0, _chunk4ATTNHKScjs.KordocError)("DocInfo \uC2A4\uD2B8\uB9BC \uC5C6\uC74C");
|
|
2771
2765
|
let docInfoData;
|
|
2772
2766
|
try {
|
|
2773
2767
|
docInfoData = compressed ? decompressStream(rawDocInfo) : rawDocInfo;
|
|
2774
2768
|
} catch (e9) {
|
|
2775
|
-
throw new (0,
|
|
2769
|
+
throw new (0, _chunk4ATTNHKScjs.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.");
|
|
2776
2770
|
}
|
|
2777
2771
|
assertDecryptedDocInfo(docInfoData, readRecords);
|
|
2778
2772
|
}
|
|
@@ -2797,10 +2791,10 @@ function readHwp5SectionRecords(c, sections, warnings) {
|
|
|
2797
2791
|
try {
|
|
2798
2792
|
const data2 = !c.distribution && c.compressed ? decompressStream(Buffer.from(sections[si])) : Buffer.from(sections[si]);
|
|
2799
2793
|
totalDecompressed += data2.length;
|
|
2800
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
2794
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunk4ATTNHKScjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
2801
2795
|
out.push(readRecords(data2));
|
|
2802
2796
|
} catch (secErr) {
|
|
2803
|
-
if (secErr instanceof
|
|
2797
|
+
if (secErr instanceof _chunk4ATTNHKScjs.KordocError) throw secErr;
|
|
2804
2798
|
out.push(null);
|
|
2805
2799
|
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" });
|
|
2806
2800
|
}
|
|
@@ -2820,7 +2814,7 @@ function parseHwp5Document(buffer, options) {
|
|
|
2820
2814
|
if (cfb) extractHwp5Metadata(cfb, metadata);
|
|
2821
2815
|
const docInfo = cfb && !encrypted ? parseDocInfoStream(cfb, compressed) : parseDocInfoFromStream(findStream("/DocInfo"), compressed);
|
|
2822
2816
|
const sections = readHwp5SectionStreams(c);
|
|
2823
|
-
if (sections.length === 0) throw new (0,
|
|
2817
|
+
if (sections.length === 0) throw new (0, _chunk4ATTNHKScjs.KordocError)("\uC139\uC158 \uC2A4\uD2B8\uB9BC\uC744 \uCC3E\uC744 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
2824
2818
|
const sectionRecords = readHwp5SectionRecords(c, sections, warnings);
|
|
2825
2819
|
const sectionDetects = sectionRecords.map((r) => r ? detectHwp5SectionPages(r) : null);
|
|
2826
2820
|
const sectionTableIds = [];
|
|
@@ -2864,7 +2858,7 @@ function parseHwp5Document(buffer, options) {
|
|
|
2864
2858
|
parsedSections++;
|
|
2865
2859
|
_optionalChain([options, 'optionalAccess', _63 => _63.onProgress, 'optionalCall', _64 => _64(parsedSections, sections.length)]);
|
|
2866
2860
|
} catch (secErr) {
|
|
2867
|
-
if (secErr instanceof
|
|
2861
|
+
if (secErr instanceof _chunk4ATTNHKScjs.KordocError) throw secErr;
|
|
2868
2862
|
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" });
|
|
2869
2863
|
} finally {
|
|
2870
2864
|
pageBase += detect.pages;
|
|
@@ -2875,10 +2869,10 @@ function parseHwp5Document(buffer, options) {
|
|
|
2875
2869
|
}
|
|
2876
2870
|
const blocks = [...doc.headerBlocks, ...bodyBlocks, ...doc.footerBlocks];
|
|
2877
2871
|
const images = cfb ? extractHwp5Images(cfb.FileIndex, blocks, warnings, !pageFilter, encrypted ? findStream : void 0) : extractHwp5ImagesLenient(lenientCfb, blocks, warnings, !pageFilter, encrypted ? findStream : void 0);
|
|
2878
|
-
let flatBlocks =
|
|
2879
|
-
if (_optionalChain([options, 'optionalAccess', _65 => _65.layoutTables]) !== "keep") flatBlocks =
|
|
2872
|
+
let flatBlocks = _chunkUSVDMFOCcjs.flattenLayoutTables.call(void 0, blocks);
|
|
2873
|
+
if (_optionalChain([options, 'optionalAccess', _65 => _65.layoutTables]) !== "keep") flatBlocks = _chunkUSVDMFOCcjs.unframeLayoutTables.call(void 0, flatBlocks, !!_optionalChain([options, 'optionalAccess', _66 => _66.keepTrailingEmptyCols]));
|
|
2880
2874
|
if (_optionalChain([options, 'optionalAccess', _67 => _67.dedupeRunningHeaders])) {
|
|
2881
|
-
const deduped =
|
|
2875
|
+
const deduped = _chunkUSVDMFOCcjs.dedupeRunningHeaders.call(void 0, flatBlocks);
|
|
2882
2876
|
const removed = flatBlocks.length - deduped.length;
|
|
2883
2877
|
if (removed > 0) warnings.push({ message: `\uBC18\uBCF5 \uB7EC\uB2DD \uD5E4\uB354 ${removed}\uAC1C \uC81C\uAC70`, code: "HIDDEN_TEXT_FILTERED" });
|
|
2884
2878
|
flatBlocks = deduped;
|
|
@@ -2887,7 +2881,7 @@ function parseHwp5Document(buffer, options) {
|
|
|
2887
2881
|
detectHwp5Headings(flatBlocks, docInfo, doc.tocTexts);
|
|
2888
2882
|
}
|
|
2889
2883
|
const outline = flatBlocks.filter((b) => b.type === "heading" && b.level && b.text).map((b) => ({ level: b.level, text: b.text, pageNumber: b.pageNumber }));
|
|
2890
|
-
let markdown =
|
|
2884
|
+
let markdown = _chunkUSVDMFOCcjs.blocksToMarkdown.call(void 0, flatBlocks, { tableFormat: _optionalChain([options, 'optionalAccess', _68 => _68.tableFormat]) });
|
|
2891
2885
|
if (_optionalChain([options, 'optionalAccess', _69 => _69.inlineImages]) && options.images !== false && images.length > 0) {
|
|
2892
2886
|
try {
|
|
2893
2887
|
markdown = _chunk6NZ32OTXcjs.inlineImagesIntoMarkdown.call(void 0, markdown, images, { compress: true });
|
|
@@ -2955,9 +2949,9 @@ function detectHwp5Headings(blocks, docInfo, tocTexts) {
|
|
|
2955
2949
|
let level = 0;
|
|
2956
2950
|
if (_optionalChain([block, 'access', _76 => _76.style, 'optionalAccess', _77 => _77.fontSize]) && baseFontSize > 0) {
|
|
2957
2951
|
const ratio = block.style.fontSize / baseFontSize;
|
|
2958
|
-
if (ratio >=
|
|
2959
|
-
else if (ratio >=
|
|
2960
|
-
else if (ratio >=
|
|
2952
|
+
if (ratio >= _chunkUSVDMFOCcjs.HEADING_RATIO_H1) level = 1;
|
|
2953
|
+
else if (ratio >= _chunkUSVDMFOCcjs.HEADING_RATIO_H2) level = 2;
|
|
2954
|
+
else if (ratio >= _chunkUSVDMFOCcjs.HEADING_RATIO_H3) level = 3;
|
|
2961
2955
|
}
|
|
2962
2956
|
if (/^제\d+[장절편]\s/.test(text) && text.length <= 50) {
|
|
2963
2957
|
if (level === 0) level = 2;
|
|
@@ -3090,7 +3084,7 @@ function findSectionsLenient(lcfb) {
|
|
|
3090
3084
|
const raw = _nullishCoalesce(lcfb.findStream(`/BodyText/Section${i}`), () => ( lcfb.findStream(`Section${i}`)));
|
|
3091
3085
|
if (!raw) break;
|
|
3092
3086
|
totalBytes += raw.length;
|
|
3093
|
-
if (totalBytes > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
3087
|
+
if (totalBytes > MAX_TOTAL_DECOMPRESS) throw new (0, _chunk4ATTNHKScjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
3094
3088
|
sections.push({ idx: i, content: raw });
|
|
3095
3089
|
}
|
|
3096
3090
|
if (sections.length === 0) {
|
|
@@ -3101,7 +3095,7 @@ function findSectionsLenient(lcfb) {
|
|
|
3101
3095
|
const raw = lcfb.findStream(e.name);
|
|
3102
3096
|
if (raw) {
|
|
3103
3097
|
totalBytes += raw.length;
|
|
3104
|
-
if (totalBytes > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
3098
|
+
if (totalBytes > MAX_TOTAL_DECOMPRESS) throw new (0, _chunk4ATTNHKScjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
3105
3099
|
sections.push({ idx, content: raw });
|
|
3106
3100
|
}
|
|
3107
3101
|
}
|
|
@@ -3118,7 +3112,7 @@ function findViewTextSectionsLenient(lcfb, compressed) {
|
|
|
3118
3112
|
try {
|
|
3119
3113
|
const content = decryptViewText(raw, compressed);
|
|
3120
3114
|
totalDecompressed += content.length;
|
|
3121
|
-
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0,
|
|
3115
|
+
if (totalDecompressed > MAX_TOTAL_DECOMPRESS) throw new (0, _chunk4ATTNHKScjs.KordocError)("\uCD1D \uC555\uCD95 \uD574\uC81C \uD06C\uAE30 \uCD08\uACFC (decompression bomb \uC758\uC2EC)");
|
|
3122
3116
|
sections.push({ idx: i, content });
|
|
3123
3117
|
} catch (e16) {
|
|
3124
3118
|
break;
|
|
@@ -4358,7 +4352,7 @@ function otherControlXml(id, node, ctx) {
|
|
|
4358
4352
|
["charSz", size],
|
|
4359
4353
|
["composeType", expansion ? "OVERLAP" : "SPREAD"],
|
|
4360
4354
|
["charPrCnt", ids.length],
|
|
4361
|
-
["composeText", circle ?
|
|
4355
|
+
["composeText", circle ? _chunkUSVDMFOCcjs.composeDigits.call(void 0, text) : text]
|
|
4362
4356
|
],
|
|
4363
4357
|
ids.map((i) => el("hp:charPr", [["prIDRef", i]])).join("")
|
|
4364
4358
|
) };
|
|
@@ -5266,7 +5260,7 @@ async function hwpToHwpx(input, options) {
|
|
|
5266
5260
|
["os", 1],
|
|
5267
5261
|
["xmlVersion", "1.5"],
|
|
5268
5262
|
["application", "kordoc"],
|
|
5269
|
-
["appVersion",
|
|
5263
|
+
["appVersion", _chunk4ATTNHKScjs.VERSION]
|
|
5270
5264
|
]),
|
|
5271
5265
|
{ compression: "STORE" }
|
|
5272
5266
|
);
|
|
@@ -5346,12 +5340,20 @@ async function convertToHwpx(input, options) {
|
|
|
5346
5340
|
const { detectFormat } = await Promise.resolve().then(() => _interopRequireWildcard(require("./detect-V75ERMYL.cjs")));
|
|
5347
5341
|
const format = detectFormat(ab);
|
|
5348
5342
|
if (format === "hwpx") return { data: bytes, mode: "preserve", engine: "kordoc", warnings: ["\uC774\uBBF8 HWPX \uBB38\uC11C\uC785\uB2C8\uB2E4 \u2014 \uADF8\uB300\uB85C \uB461\uB2C8\uB2E4"] };
|
|
5349
|
-
if (format !== "hwp" && format !== "hwp3" && format !== "hwpml") throw new (0,
|
|
5343
|
+
if (format !== "hwp" && format !== "hwp3" && format !== "hwpml") throw new (0, _chunk4ATTNHKScjs.KordocError)(`HWP \uBB38\uC11C\uAC00 \uC544\uB2D9\uB2C8\uB2E4 (${format})`);
|
|
5344
|
+
const engine = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _159 => _159.engine]), () => ( "kordoc"));
|
|
5345
|
+
if (engine !== "kordoc") {
|
|
5346
|
+
const { hancomAvailable, hwpToHwpxViaHancom } = await Promise.resolve().then(() => _interopRequireWildcard(require("./hancom-YAUQDSDK.cjs")));
|
|
5347
|
+
if (engine === "hancom" || !_optionalChain([options, 'optionalAccess', _160 => _160.password]) && hancomAvailable()) {
|
|
5348
|
+
if (_optionalChain([options, 'optionalAccess', _161 => _161.password])) throw new (0, _chunk4ATTNHKScjs.KordocError)('\uD55C/\uAE00 \uC800\uC7A5 \uBCC0\uD658\uC740 \uC5F4\uAE30 \uC554\uD638\uB97C \uBC1B\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4 \u2014 engine "kordoc" \uC73C\uB85C \uBC14\uAFB8\uC138\uC694');
|
|
5349
|
+
return { data: hwpToHwpxViaHancom(bytes, format === "hwpml" ? "hml" : "hwp"), mode: "preserve", engine: "hancom", warnings: [] };
|
|
5350
|
+
}
|
|
5351
|
+
}
|
|
5350
5352
|
if (format === "hwp") return { data: await hwpToHwpx(bytes, options), mode: "preserve", engine: "kordoc", warnings: [] };
|
|
5351
5353
|
const { parse } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.cjs")));
|
|
5352
|
-
const { markdownToHwpx } = await Promise.resolve().then(() => _interopRequireWildcard(require("./generator-
|
|
5353
|
-
const parsed = await parse(ab, { password: _optionalChain([options, 'optionalAccess',
|
|
5354
|
-
if (!parsed.success) throw new (0,
|
|
5354
|
+
const { markdownToHwpx } = await Promise.resolve().then(() => _interopRequireWildcard(require("./generator-IHU3ZJFL.cjs")));
|
|
5355
|
+
const parsed = await parse(ab, { password: _optionalChain([options, 'optionalAccess', _162 => _162.password]) });
|
|
5356
|
+
if (!parsed.success) throw new (0, _chunk4ATTNHKScjs.KordocError)(_nullishCoalesce(parsed.error, () => ( "\uBB38\uC11C\uB97C \uC77D\uC9C0 \uBABB\uD588\uC2B5\uB2C8\uB2E4")));
|
|
5355
5357
|
return {
|
|
5356
5358
|
data: new Uint8Array(await markdownToHwpx(parsed.markdown)),
|
|
5357
5359
|
mode: "content",
|
|
@@ -5412,4 +5414,4 @@ async function convertToHwpx(input, options) {
|
|
|
5412
5414
|
|
|
5413
5415
|
|
|
5414
5416
|
exports.locateMemoBlocks = locateMemoBlocks; exports.memosMarkdown = memosMarkdown; exports.TAG_PARA_HEADER = TAG_PARA_HEADER; exports.TAG_PARA_TEXT = TAG_PARA_TEXT; exports.TAG_CHAR_SHAPE = TAG_CHAR_SHAPE; exports.TAG_PARA_LINE_SEG = TAG_PARA_LINE_SEG; exports.TAG_CTRL_HEADER = TAG_CTRL_HEADER; exports.TAG_LIST_HEADER = TAG_LIST_HEADER; exports.TAG_TABLE = TAG_TABLE; exports.TAG_SHAPE_COMPONENT = TAG_SHAPE_COMPONENT; exports.TAG_SHAPE_COMPONENT_PICTURE = TAG_SHAPE_COMPONENT_PICTURE; exports.TAG_ID_MAPPINGS = TAG_ID_MAPPINGS; exports.TAG_FACE_NAME = TAG_FACE_NAME; exports.TAG_DOC_CHAR_SHAPE = TAG_DOC_CHAR_SHAPE; exports.TAG_DOC_PARA_SHAPE = TAG_DOC_PARA_SHAPE; exports.FLAG_COMPRESSED = FLAG_COMPRESSED; exports.FLAG_ENCRYPTED = FLAG_ENCRYPTED; exports.FLAG_DISTRIBUTION = FLAG_DISTRIBUTION; exports.FLAG_DRM = FLAG_DRM; exports.FLAG_TRACK_CHANGES = FLAG_TRACK_CHANGES; exports.readRecords = readRecords; exports.decompressStream = decompressStream; exports.parseFileHeader = parseFileHeader; exports.fileTimeText = fileTimeText; exports.parseDocInfo = parseDocInfo; exports.createParaTextState = createParaTextState; exports.isExtendedOnlyCtrlChar = isExtendedOnlyCtrlChar; exports.appendParaText = appendParaText; exports.detectImageMime = detectImageMime; exports.resolveImageBlocks = resolveImageBlocks; exports.indexHwp5Tables = indexHwp5Tables; exports.formatNumber = formatNumber; exports.hwpEquationToLatex = hwpEquationToLatex; exports.INLINE_TABLE_MARK = INLINE_TABLE_MARK; exports.emitParagraphBlocks = emitParagraphBlocks; exports.blocksPlainText = blocksPlainText; exports.cellTextFromBlocks = cellTextFromBlocks; exports.buildAddressedTable = buildAddressedTable; exports.unfilledClickHereGuide = unfilledClickHereGuide; exports.isClickHereGuideText = isClickHereGuideText; exports.hasRealStrike = hasRealStrike; exports.hasRealUnderline = hasRealUnderline; exports.openHwp5Container = openHwp5Container; exports.readHwp5DocInfoRecords = readHwp5DocInfoRecords; exports.readHwp5SectionStreams = readHwp5SectionStreams; exports.readHwp5SectionRecords = readHwp5SectionRecords; exports.readHwp5BinData = readHwp5BinData; exports.parseHwp5Document = parseHwp5Document; exports.hwpToHwpx = hwpToHwpx; exports.convertToHwpx = convertToHwpx;
|
|
5415
|
-
//# sourceMappingURL=chunk-
|
|
5417
|
+
//# sourceMappingURL=chunk-QMLFUMPU.cjs.map
|