kordoc 4.24.48 → 4.24.49

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.
Files changed (208) hide show
  1. package/README.md +3 -3
  2. package/dist/{-3EMVBTE7.js → -22V6D2US.js} +42 -42
  3. package/dist/{chunk-TOOOWCKQ.cjs → chunk-2UWWWM4Q.cjs} +98 -98
  4. package/dist/{chunk-TOOOWCKQ.cjs.map → chunk-2UWWWM4Q.cjs.map} +1 -1
  5. package/dist/{chunk-MHAPDR6T.cjs → chunk-367WLMPO.cjs} +59 -67
  6. package/dist/chunk-367WLMPO.cjs.map +1 -0
  7. package/dist/{chunk-WVUR3HYW.js → chunk-4HJKBRZJ.js} +129 -40
  8. package/dist/chunk-4HJKBRZJ.js.map +1 -0
  9. package/dist/{chunk-7F5SKDUG.js → chunk-4MWUBTAE.js} +2 -2
  10. package/dist/{chunk-4N2ESXR2.js → chunk-67GSFYG7.js} +2 -2
  11. package/dist/{chunk-WICMTKWR.js → chunk-6BFWLS7E.js} +3 -3
  12. package/dist/{chunk-LBH4KAQM.cjs → chunk-6NZ32OTX.cjs} +8 -3
  13. package/dist/chunk-6NZ32OTX.cjs.map +1 -0
  14. package/dist/{chunk-JC2TMUU5.js → chunk-7KKL3PRK.js} +5 -13
  15. package/dist/chunk-7KKL3PRK.js.map +1 -0
  16. package/dist/{chunk-7EL6BCO5.js → chunk-AUAJVQQK.js} +2 -2
  17. package/dist/{chunk-QJBVP2BS.js → chunk-AXW2FMVR.js} +2 -2
  18. package/dist/{chunk-SUOJQHIN.js → chunk-CCQMSIZQ.js} +19 -19
  19. package/dist/{chunk-OUUI7I5V.js → chunk-DA5AXURC.js} +52 -4
  20. package/dist/chunk-DA5AXURC.js.map +1 -0
  21. package/dist/{chunk-3UY7ARXP.js → chunk-DAAJO62F.js} +2 -2
  22. package/dist/{chunk-QM65ELZE.js → chunk-EUJX7HTR.js} +32 -10
  23. package/dist/chunk-EUJX7HTR.js.map +1 -0
  24. package/dist/{chunk-E47LO7XG.js → chunk-EYSXMDA7.js} +17 -17
  25. package/dist/{chunk-TQ4QOCKT.js → chunk-FU6ZDWCI.js} +7 -2
  26. package/dist/chunk-FU6ZDWCI.js.map +1 -0
  27. package/dist/{chunk-MHLTZ3VI.js → chunk-HETGOJ6V.js} +2 -2
  28. package/dist/{chunk-OQPIN2OY.js → chunk-HW7WVYBF.js} +2 -2
  29. package/dist/{chunk-LHZL52HO.cjs → chunk-IRAZCKQ6.cjs} +3 -3
  30. package/dist/{chunk-LHZL52HO.cjs.map → chunk-IRAZCKQ6.cjs.map} +1 -1
  31. package/dist/{chunk-AC7FZDVP.js → chunk-KB4ORA7M.js} +2 -2
  32. package/dist/{chunk-SHYNOLL6.js → chunk-KXHUHGMC.js} +2 -2
  33. package/dist/{chunk-WO6PZMMB.js → chunk-L3JP55ZY.js} +2 -2
  34. package/dist/{chunk-OBNOOHAW.js → chunk-LCRSRVFJ.js} +2 -2
  35. package/dist/{chunk-OBNOOHAW.js.map → chunk-LCRSRVFJ.js.map} +1 -1
  36. package/dist/{chunk-OO4DHHTG.js → chunk-LFFARZYZ.js} +2 -2
  37. package/dist/{chunk-OO4DHHTG.js.map → chunk-LFFARZYZ.js.map} +1 -1
  38. package/dist/{chunk-NLPIXQOV.js → chunk-LOSCIAHY.js} +2 -2
  39. package/dist/{chunk-HW3DZ7TY.js → chunk-M5RQ2PNP.js} +6 -14
  40. package/dist/chunk-M5RQ2PNP.js.map +1 -0
  41. package/dist/{chunk-GFWCBYAI.js → chunk-MIJTZKWF.js} +2 -2
  42. package/dist/{chunk-PHU4VSNF.js → chunk-MLBX6KQM.js} +37 -3
  43. package/dist/chunk-MLBX6KQM.js.map +1 -0
  44. package/dist/{chunk-D4TKVZKB.js → chunk-OAETOHH3.js} +3 -3
  45. package/dist/{chunk-SI3GXM7Z.js → chunk-PMGJQWSW.js} +2 -2
  46. package/dist/{chunk-QOBWIFJA.cjs → chunk-PVV6OY4M.cjs} +135 -87
  47. package/dist/{chunk-QOBWIFJA.cjs.map → chunk-PVV6OY4M.cjs.map} +1 -1
  48. package/dist/{chunk-VXHZPUMS.cjs → chunk-PW7MQZI4.cjs} +2 -2
  49. package/dist/{chunk-VXHZPUMS.cjs.map → chunk-PW7MQZI4.cjs.map} +1 -1
  50. package/dist/{chunk-MYIRYP6D.js → chunk-Q7FDPJUS.js} +10 -10
  51. package/dist/{chunk-N6B5BINC.js → chunk-R2RLNUNK.js} +6 -6
  52. package/dist/{chunk-FQMPHPHE.js → chunk-RQLEGKEV.js} +2 -2
  53. package/dist/{chunk-KTGOULMH.js → chunk-S54DZB2Z.js} +51 -3
  54. package/dist/chunk-S54DZB2Z.js.map +1 -0
  55. package/dist/{chunk-D7SOY3VR.js → chunk-TAHS42ED.js} +33 -11
  56. package/dist/chunk-TAHS42ED.js.map +1 -0
  57. package/dist/{chunk-YFTD6WOP.cjs → chunk-TQOAPKLU.cjs} +6 -6
  58. package/dist/{chunk-YFTD6WOP.cjs.map → chunk-TQOAPKLU.cjs.map} +1 -1
  59. package/dist/{chunk-A6EOKPKG.cjs → chunk-UBY2PLKR.cjs} +54 -32
  60. package/dist/chunk-UBY2PLKR.cjs.map +1 -0
  61. package/dist/{chunk-UN2F6EKQ.js → chunk-UJELMNOU.js} +7 -2
  62. package/dist/chunk-UJELMNOU.js.map +1 -0
  63. package/dist/{chunk-REERG473.js → chunk-UU54HN5I.js} +6 -6
  64. package/dist/{chunk-E5RJLP2S.js → chunk-VMOUAWGD.js} +7 -7
  65. package/dist/{chunk-6YUMHSBG.js → chunk-WLFZOBZR.js} +3 -3
  66. package/dist/{chunk-SJXTCW7I.cjs → chunk-Y4MFHEK4.cjs} +40 -6
  67. package/dist/chunk-Y4MFHEK4.cjs.map +1 -0
  68. package/dist/{chunk-UJ3TZF4Y.js → chunk-Y6QW3FJQ.js} +2 -2
  69. package/dist/{chunk-GOYAJVR6.js → chunk-ZF24SO45.js} +37 -3
  70. package/dist/chunk-ZF24SO45.js.map +1 -0
  71. package/dist/chunks-Q7242OJE.js +11 -0
  72. package/dist/cli.js +73 -53
  73. package/dist/cli.js.map +1 -1
  74. package/dist/{formula-DUHNPES2.js → formula-BYEDWWZU.js} +4 -4
  75. package/dist/{formula-XNCKOV6K.js → formula-FQLMMBDP.js} +3 -3
  76. package/dist/{formula-7RJOEJHX.cjs → formula-QJEOIVKR.cjs} +9 -9
  77. package/dist/{formula-7RJOEJHX.cjs.map → formula-QJEOIVKR.cjs.map} +1 -1
  78. package/dist/generator-FTM6GOGB.cjs +11 -0
  79. package/dist/{generator-XXVCF6TG.cjs.map → generator-FTM6GOGB.cjs.map} +1 -1
  80. package/dist/generator-Q3L7RNUY.js +17 -0
  81. package/dist/generator-SU73HZHR.js +10 -0
  82. package/dist/{image-ocr-PYOXD5K4.js → image-ocr-7Y3FCGRR.js} +12 -10
  83. package/dist/image-ocr-7Y3FCGRR.js.map +1 -0
  84. package/dist/{image-ocr-NFCTNIL5.js → image-ocr-VIGZE4YL.js} +9 -7
  85. package/dist/image-ocr-VIGZE4YL.js.map +1 -0
  86. package/dist/{image-ocr-ZLAPJMES.cjs → image-ocr-WRILL3WO.cjs} +29 -27
  87. package/dist/image-ocr-WRILL3WO.cjs.map +1 -0
  88. package/dist/index.cjs +1250 -1161
  89. package/dist/index.cjs.map +1 -1
  90. package/dist/index.d.cts +13 -5
  91. package/dist/index.d.ts +13 -5
  92. package/dist/index.js +207 -118
  93. package/dist/index.js.map +1 -1
  94. package/dist/mcp.js +42 -43
  95. package/dist/mcp.js.map +1 -1
  96. package/dist/memo-T5ZQEXEA.js +17 -0
  97. package/dist/{model-bundle-TIHWFIN5.js → model-bundle-UJRQPYUU.js} +5 -5
  98. package/dist/{models-YBHBEM6J.js → models-64YLAWTI.js} +5 -5
  99. package/dist/{parse-worker-v2-Q7ST3SDO.js → parse-worker-v2-QWQZKFQO.js} +25 -24
  100. package/dist/parse-worker-v2-QWQZKFQO.js.map +1 -0
  101. package/dist/{parser-7JSQYNLS.js → parser-JPWANPLM.js} +77 -32
  102. package/dist/parser-JPWANPLM.js.map +1 -0
  103. package/dist/{parser-A76QS3VJ.cjs → parser-RB6CBNAM.cjs} +259 -214
  104. package/dist/parser-RB6CBNAM.cjs.map +1 -0
  105. package/dist/{parser-V25GYLBJ.js → parser-XFU3VRWM.js} +80 -35
  106. package/dist/parser-XFU3VRWM.js.map +1 -0
  107. package/dist/pdf-ocr-NOJHEH4M.cjs +42 -0
  108. package/dist/{pdf-ocr-5YCDSSLG.cjs.map → pdf-ocr-NOJHEH4M.cjs.map} +1 -1
  109. package/dist/{pdf-ocr-IJXT6ZJR.js → pdf-ocr-XTZZEYKJ.js} +6 -6
  110. package/dist/{pdf-ocr-GEAW23FB.js → pdf-ocr-ZV3KYIIE.js} +9 -9
  111. package/dist/{profile-io-Y7SMMS2R.js → profile-io-FAJORRD2.js} +3 -3
  112. package/dist/{rasterize-MLEHT6PU.js → rasterize-4ZJUA2DZ.js} +3 -3
  113. package/dist/{redact-doc-GPO2UTTJ.js → redact-doc-JPNROEH6.js} +30 -30
  114. package/dist/{render-TNWY53S4.js → render-D4WBOBKI.js} +13 -13
  115. package/dist/{rewrite-fallback-AHGTN757.js → rewrite-fallback-OF3QI6CX.js} +14 -14
  116. package/dist/seal-DQWEHIAM.js +16 -0
  117. package/dist/{setup-TJ57DQ6I.js → setup-YC25YCQB.js} +3 -3
  118. package/dist/to-hwpx-D7OMPDUQ.js +21 -0
  119. package/dist/to-hwpx-LUA6F5RR.cjs +16 -0
  120. package/dist/{to-hwpx-XLQUY2L2.cjs.map → to-hwpx-LUA6F5RR.cjs.map} +1 -1
  121. package/dist/{to-hwpx-DLVARUND.js → to-hwpx-ZWN64NCQ.js} +5 -5
  122. package/dist/visual-SW7NPY6K.js +37 -0
  123. package/dist/{watch-6CHDQ355.js → watch-ZU576VSR.js} +24 -24
  124. package/package.json +1 -1
  125. package/dist/chunk-A6EOKPKG.cjs.map +0 -1
  126. package/dist/chunk-D7SOY3VR.js.map +0 -1
  127. package/dist/chunk-GOYAJVR6.js.map +0 -1
  128. package/dist/chunk-HW3DZ7TY.js.map +0 -1
  129. package/dist/chunk-JC2TMUU5.js.map +0 -1
  130. package/dist/chunk-KTGOULMH.js.map +0 -1
  131. package/dist/chunk-LBH4KAQM.cjs.map +0 -1
  132. package/dist/chunk-MHAPDR6T.cjs.map +0 -1
  133. package/dist/chunk-OUUI7I5V.js.map +0 -1
  134. package/dist/chunk-PHU4VSNF.js.map +0 -1
  135. package/dist/chunk-QM65ELZE.js.map +0 -1
  136. package/dist/chunk-SJXTCW7I.cjs.map +0 -1
  137. package/dist/chunk-TQ4QOCKT.js.map +0 -1
  138. package/dist/chunk-UN2F6EKQ.js.map +0 -1
  139. package/dist/chunk-WVUR3HYW.js.map +0 -1
  140. package/dist/chunks-QTVEFJOS.js +0 -11
  141. package/dist/generator-6BFIABTF.js +0 -10
  142. package/dist/generator-XJLIBYDJ.js +0 -17
  143. package/dist/generator-XXVCF6TG.cjs +0 -11
  144. package/dist/hancom-7F53R77A.cjs +0 -85
  145. package/dist/hancom-7F53R77A.cjs.map +0 -1
  146. package/dist/hancom-D4E3WBPI.js +0 -84
  147. package/dist/hancom-D4E3WBPI.js.map +0 -1
  148. package/dist/hancom-IPF6HM5F.js +0 -85
  149. package/dist/hancom-IPF6HM5F.js.map +0 -1
  150. package/dist/image-ocr-NFCTNIL5.js.map +0 -1
  151. package/dist/image-ocr-PYOXD5K4.js.map +0 -1
  152. package/dist/image-ocr-ZLAPJMES.cjs.map +0 -1
  153. package/dist/memo-CNW6ZJFE.js +0 -17
  154. package/dist/parse-worker-v2-Q7ST3SDO.js.map +0 -1
  155. package/dist/parser-7JSQYNLS.js.map +0 -1
  156. package/dist/parser-A76QS3VJ.cjs.map +0 -1
  157. package/dist/parser-V25GYLBJ.js.map +0 -1
  158. package/dist/pdf-ocr-5YCDSSLG.cjs +0 -42
  159. package/dist/seal-7HBR3HBQ.js +0 -16
  160. package/dist/to-hwpx-6JF6Q2TZ.js +0 -21
  161. package/dist/to-hwpx-XLQUY2L2.cjs +0 -16
  162. package/dist/visual-VBDQUUKP.js +0 -37
  163. /package/dist/{-3EMVBTE7.js.map → -22V6D2US.js.map} +0 -0
  164. /package/dist/{chunk-7F5SKDUG.js.map → chunk-4MWUBTAE.js.map} +0 -0
  165. /package/dist/{chunk-4N2ESXR2.js.map → chunk-67GSFYG7.js.map} +0 -0
  166. /package/dist/{chunk-WICMTKWR.js.map → chunk-6BFWLS7E.js.map} +0 -0
  167. /package/dist/{chunk-7EL6BCO5.js.map → chunk-AUAJVQQK.js.map} +0 -0
  168. /package/dist/{chunk-QJBVP2BS.js.map → chunk-AXW2FMVR.js.map} +0 -0
  169. /package/dist/{chunk-SUOJQHIN.js.map → chunk-CCQMSIZQ.js.map} +0 -0
  170. /package/dist/{chunk-3UY7ARXP.js.map → chunk-DAAJO62F.js.map} +0 -0
  171. /package/dist/{chunk-E47LO7XG.js.map → chunk-EYSXMDA7.js.map} +0 -0
  172. /package/dist/{chunk-MHLTZ3VI.js.map → chunk-HETGOJ6V.js.map} +0 -0
  173. /package/dist/{chunk-OQPIN2OY.js.map → chunk-HW7WVYBF.js.map} +0 -0
  174. /package/dist/{chunk-AC7FZDVP.js.map → chunk-KB4ORA7M.js.map} +0 -0
  175. /package/dist/{chunk-SHYNOLL6.js.map → chunk-KXHUHGMC.js.map} +0 -0
  176. /package/dist/{chunk-WO6PZMMB.js.map → chunk-L3JP55ZY.js.map} +0 -0
  177. /package/dist/{chunk-NLPIXQOV.js.map → chunk-LOSCIAHY.js.map} +0 -0
  178. /package/dist/{chunk-GFWCBYAI.js.map → chunk-MIJTZKWF.js.map} +0 -0
  179. /package/dist/{chunk-D4TKVZKB.js.map → chunk-OAETOHH3.js.map} +0 -0
  180. /package/dist/{chunk-SI3GXM7Z.js.map → chunk-PMGJQWSW.js.map} +0 -0
  181. /package/dist/{chunk-MYIRYP6D.js.map → chunk-Q7FDPJUS.js.map} +0 -0
  182. /package/dist/{chunk-N6B5BINC.js.map → chunk-R2RLNUNK.js.map} +0 -0
  183. /package/dist/{chunk-FQMPHPHE.js.map → chunk-RQLEGKEV.js.map} +0 -0
  184. /package/dist/{chunk-REERG473.js.map → chunk-UU54HN5I.js.map} +0 -0
  185. /package/dist/{chunk-E5RJLP2S.js.map → chunk-VMOUAWGD.js.map} +0 -0
  186. /package/dist/{chunk-6YUMHSBG.js.map → chunk-WLFZOBZR.js.map} +0 -0
  187. /package/dist/{chunk-UJ3TZF4Y.js.map → chunk-Y6QW3FJQ.js.map} +0 -0
  188. /package/dist/{chunks-QTVEFJOS.js.map → chunks-Q7242OJE.js.map} +0 -0
  189. /package/dist/{formula-DUHNPES2.js.map → formula-BYEDWWZU.js.map} +0 -0
  190. /package/dist/{formula-XNCKOV6K.js.map → formula-FQLMMBDP.js.map} +0 -0
  191. /package/dist/{generator-6BFIABTF.js.map → generator-Q3L7RNUY.js.map} +0 -0
  192. /package/dist/{generator-XJLIBYDJ.js.map → generator-SU73HZHR.js.map} +0 -0
  193. /package/dist/{memo-CNW6ZJFE.js.map → memo-T5ZQEXEA.js.map} +0 -0
  194. /package/dist/{model-bundle-TIHWFIN5.js.map → model-bundle-UJRQPYUU.js.map} +0 -0
  195. /package/dist/{models-YBHBEM6J.js.map → models-64YLAWTI.js.map} +0 -0
  196. /package/dist/{pdf-ocr-GEAW23FB.js.map → pdf-ocr-XTZZEYKJ.js.map} +0 -0
  197. /package/dist/{pdf-ocr-IJXT6ZJR.js.map → pdf-ocr-ZV3KYIIE.js.map} +0 -0
  198. /package/dist/{profile-io-Y7SMMS2R.js.map → profile-io-FAJORRD2.js.map} +0 -0
  199. /package/dist/{rasterize-MLEHT6PU.js.map → rasterize-4ZJUA2DZ.js.map} +0 -0
  200. /package/dist/{redact-doc-GPO2UTTJ.js.map → redact-doc-JPNROEH6.js.map} +0 -0
  201. /package/dist/{render-TNWY53S4.js.map → render-D4WBOBKI.js.map} +0 -0
  202. /package/dist/{rewrite-fallback-AHGTN757.js.map → rewrite-fallback-OF3QI6CX.js.map} +0 -0
  203. /package/dist/{seal-7HBR3HBQ.js.map → seal-DQWEHIAM.js.map} +0 -0
  204. /package/dist/{setup-TJ57DQ6I.js.map → setup-YC25YCQB.js.map} +0 -0
  205. /package/dist/{to-hwpx-6JF6Q2TZ.js.map → to-hwpx-D7OMPDUQ.js.map} +0 -0
  206. /package/dist/{to-hwpx-DLVARUND.js.map → to-hwpx-ZWN64NCQ.js.map} +0 -0
  207. /package/dist/{visual-VBDQUUKP.js.map → visual-SW7NPY6K.js.map} +0 -0
  208. /package/dist/{watch-6CHDQ355.js.map → watch-ZU576VSR.js.map} +0 -0
@@ -1,12 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
- extractRenderedRegions,
4
- renderDocumentToScene
5
- } from "./chunk-MYIRYP6D.js";
6
- import {
3
+ WEBP_OPTIONS,
7
4
  blocksToPages,
8
- readImageQrCodes
9
- } from "./chunk-GOYAJVR6.js";
5
+ loadSharp,
6
+ readImageQrCodes,
7
+ toBuffer
8
+ } from "./chunk-ZF24SO45.js";
10
9
  import {
11
10
  applyCellEdit,
12
11
  buildOrigUnits,
@@ -19,7 +18,7 @@ import {
19
18
  resolveParagraphMappings,
20
19
  resolveSectionEntryNames,
21
20
  stripCellTokens
22
- } from "./chunk-E47LO7XG.js";
21
+ } from "./chunk-EYSXMDA7.js";
23
22
  import {
24
23
  TOTAL_LABEL_RE,
25
24
  comResultToParseResult,
@@ -48,10 +47,10 @@ import {
48
47
  summarize,
49
48
  textProfile,
50
49
  topLevelParagraphs
51
- } from "./chunk-SUOJQHIN.js";
50
+ } from "./chunk-CCQMSIZQ.js";
52
51
  import {
53
52
  patchZipEntries
54
- } from "./chunk-UJ3TZF4Y.js";
53
+ } from "./chunk-Y6QW3FJQ.js";
55
54
  import {
56
55
  ANNOTATION_BLANK_RE,
57
56
  ValueCursor,
@@ -78,6 +77,10 @@ import {
78
77
  scanInlineSegments,
79
78
  scanSectionXml
80
79
  } from "./chunk-3AHL6YEA.js";
80
+ import {
81
+ extractRenderedRegions,
82
+ renderDocumentToScene
83
+ } from "./chunk-Q7FDPJUS.js";
81
84
  import {
82
85
  MAX_DECOMPRESS_SIZE,
83
86
  MAX_XML_DEPTH,
@@ -88,7 +91,7 @@ import {
88
91
  localName,
89
92
  rawTextContent,
90
93
  readZipEntry
91
- } from "./chunk-AC7FZDVP.js";
94
+ } from "./chunk-KB4ORA7M.js";
92
95
  import {
93
96
  INLINE_TABLE_MARK,
94
97
  blocksPlainText,
@@ -101,11 +104,13 @@ import {
101
104
  memosMarkdown,
102
105
  parseHwp5Document,
103
106
  resolveImageBlocks
104
- } from "./chunk-REERG473.js";
107
+ } from "./chunk-UU54HN5I.js";
105
108
  import {
109
+ MAX_PIXELS,
106
110
  bmpToPng,
111
+ bmpToRgba,
107
112
  inlineImagesIntoMarkdown
108
- } from "./chunk-TQ4QOCKT.js";
113
+ } from "./chunk-FU6ZDWCI.js";
109
114
  import {
110
115
  parsePageRange
111
116
  } from "./chunk-VQFA55IC.js";
@@ -126,7 +131,7 @@ import {
126
131
  stripScriptTags,
127
132
  tidyScriptTags,
128
133
  wrapScript
129
- } from "./chunk-OBNOOHAW.js";
134
+ } from "./chunk-LCRSRVFJ.js";
130
135
  import {
131
136
  MAX_COLS,
132
137
  MAX_ROWS,
@@ -137,7 +142,7 @@ import {
137
142
  flattenLayoutTables,
138
143
  hasStructuredCellContent,
139
144
  sanitizeText
140
- } from "./chunk-MHLTZ3VI.js";
145
+ } from "./chunk-HETGOJ6V.js";
141
146
  import {
142
147
  hangulAmount,
143
148
  mapPuaText
@@ -153,7 +158,7 @@ import {
153
158
  stripDtd,
154
159
  toArrayBuffer,
155
160
  unzipLimitBytes
156
- } from "./chunk-SHYNOLL6.js";
161
+ } from "./chunk-KXHUHGMC.js";
157
162
 
158
163
  // src/table/visual.ts
159
164
  import { readFile as readFile2 } from "fs/promises";
@@ -16884,7 +16889,7 @@ var MIN_SIDE = 24;
16884
16889
  async function ocrEmbeddedImages(blocks, options, warnings) {
16885
16890
  const ocr = options?.ocr;
16886
16891
  if (ocr !== true && ocr !== "force" && typeof ocr !== "function") return false;
16887
- const { parseImageDocument } = await import("./image-ocr-PYOXD5K4.js");
16892
+ const { parseImageDocument } = await import("./image-ocr-7Y3FCGRR.js");
16888
16893
  let inserted = false, unreadable = 0;
16889
16894
  let failed = null;
16890
16895
  const walk = async (list, depth) => {
@@ -16939,6 +16944,79 @@ async function tooSmall(bytes) {
16939
16944
  }
16940
16945
  }
16941
16946
 
16947
+ // src/image/format.ts
16948
+ var MIME = { png: "image/png", webp: "image/webp" };
16949
+ function isFormat(b, format2) {
16950
+ if (format2 === "png") return b[0] === 137 && b[1] === 80 && b[2] === 78 && b[3] === 71;
16951
+ return b.length >= 12 && b[0] === 82 && b[1] === 73 && b[2] === 70 && b[3] === 70 && b[8] === 87 && b[9] === 69 && b[10] === 66 && b[11] === 80;
16952
+ }
16953
+ var plain = (b) => b && new Uint8Array(b.buffer, b.byteOffset, b.byteLength);
16954
+ async function convert(sharp, img, format2) {
16955
+ if (isFormat(img.data, format2)) return img.data;
16956
+ if (img.data[0] === 66 && img.data[1] === 77) {
16957
+ if (format2 === "png") return bmpToPng(img.data);
16958
+ const px = bmpToRgba(img.data);
16959
+ if (!px || !sharp) return null;
16960
+ return plain(await sharp(toBuffer(px.data), { raw: { width: px.width, height: px.height, channels: 4 } }).webp(WEBP_OPTIONS).toBuffer().catch(() => null));
16961
+ }
16962
+ if (!sharp) return null;
16963
+ const out = sharp(toBuffer(img.data), { limitInputPixels: MAX_PIXELS }).rotate();
16964
+ return plain(await (format2 === "png" ? out.png() : out.webp(WEBP_OPTIONS)).toBuffer().catch(() => null));
16965
+ }
16966
+ async function convertImages(blocks, images, format2, warnings) {
16967
+ const sharp = await loadSharp();
16968
+ const names = new Set(images.map((i) => i.filename));
16969
+ const renamed = /* @__PURE__ */ new Map();
16970
+ const kept = [];
16971
+ for (const img of images) {
16972
+ const name = img.filename.replace(/\.[^./]*$/, "") + "." + format2;
16973
+ const data = await convert(sharp, img, format2);
16974
+ if (!data || name !== img.filename && names.has(name)) {
16975
+ kept.push(img.mimeType);
16976
+ continue;
16977
+ }
16978
+ if (name !== img.filename) {
16979
+ renamed.set(img.filename, img);
16980
+ names.add(name);
16981
+ }
16982
+ Object.assign(img, { filename: name, data, mimeType: MIME[format2] });
16983
+ }
16984
+ if (kept.length) {
16985
+ const byMime = [...new Set(kept)].map((m) => `${m} ${kept.filter((k) => k === m).length}`).join(", ");
16986
+ warnings.push({ code: "SKIPPED_IMAGE", message: `\uADF8\uB9BC ${kept.length}\uAC1C\uB294 ${format2.toUpperCase()} \uB85C \uBC14\uAFB8\uC9C0 \uBABB\uD574 \uC6D0\uBCF8 \uD615\uC2DD\uC73C\uB85C \uB0C8\uC2B5\uB2C8\uB2E4 (${byMime})${sharp ? "" : " \u2014 optional dependency 'sharp' \uAC00 \uC5C6\uC2B5\uB2C8\uB2E4"}` });
16987
+ }
16988
+ const byName = new Map(images.map((i) => [i.filename, i]));
16989
+ const fix = (s) => s.includes("![image](") ? s.replace(/!\[image\]\(([^()\s]+)\)/g, (m, name) => {
16990
+ const img = renamed.get(name);
16991
+ return img ? `![image](${img.filename})` : m;
16992
+ }) : s;
16993
+ const walk = (list, depth) => {
16994
+ if (!list || depth > 64) return;
16995
+ for (const b of list) {
16996
+ if (b.type === "image" && b.text) {
16997
+ const img = renamed.get(b.text) ?? byName.get(b.text);
16998
+ if (img) {
16999
+ b.text = img.filename;
17000
+ if (b.imageData) b.imageData = { ...b.imageData, data: img.data, mimeType: img.mimeType };
17001
+ }
17002
+ } else if (b.text) b.text = fix(b.text);
17003
+ if (b.footnoteText) b.footnoteText = fix(b.footnoteText);
17004
+ walk(b.children, depth + 1);
17005
+ walk(b.footnoteBlocks, depth + 1);
17006
+ if (b.table) {
17007
+ if (b.table.caption) b.table.caption = fix(b.table.caption);
17008
+ for (const row of b.table.cells) for (const cell of row) {
17009
+ cell.text = fix(cell.text);
17010
+ walk(cell.blocks, depth + 1);
17011
+ }
17012
+ walk(b.table.captionBlocks, depth + 1);
17013
+ }
17014
+ }
17015
+ };
17016
+ walk(blocks, 0);
17017
+ return renamed.size > 0;
17018
+ }
17019
+
16942
17020
  // src/table/classifier.ts
16943
17021
  var DIAGRAM_KEYWORDS = /조직도|비상\s*연락망|연락망|체계도|업무\s*체계도|기구표|배치도|흐름도|추진\s*체계/u;
16944
17022
  var KEYWORD_GATE = 0.3;
@@ -17335,12 +17413,12 @@ function protoStyle(xml, ix) {
17335
17413
  if (!p) return null;
17336
17414
  const model = parsePara(xml, p);
17337
17415
  const paraPr = /\bparaPrIDRef="(\d+)"/.exec(xml.slice(p.start, p.openEnd))?.[1] ?? "0";
17338
- const plain2 = paraPlain(model);
17339
- let prefix = /^[\s ]*/.exec(plain2)[0].length;
17340
- const cp = plain2.codePointAt(prefix);
17416
+ const plain3 = paraPlain(model);
17417
+ let prefix = /^[\s ]*/.exec(plain3)[0].length;
17418
+ const cp = plain3.codePointAt(prefix);
17341
17419
  if (cp !== void 0 && isMarkerChar(mapPuaText(String.fromCodePoint(cp)))) {
17342
17420
  prefix += String.fromCodePoint(cp).length;
17343
- prefix += /^[\s ]*/.exec(plain2.slice(prefix))[0].length;
17421
+ prefix += /^[\s ]*/.exec(plain3.slice(prefix))[0].length;
17344
17422
  }
17345
17423
  let best = "", bestN = 0, pos = 0;
17346
17424
  for (const r of model.runs) {
@@ -17587,9 +17665,9 @@ var scrubText = (t) => t.replace(ROLE_LABEL_RE, (_m, label) => `${label}\u25CB\u
17587
17665
  function scrubPeople(xml) {
17588
17666
  return xml.replace(/(<hp:t\b(?:[^>/]|\/(?!>)){0,256}>)([\s\S]{0,65536}?)(<\/hp:t>)/g, (all, open, body, close) => {
17589
17667
  if (!body.includes("<")) return open + scrubText(body) + close;
17590
- const plain2 = body.replace(/<hp:(?:fwSpace|nbSpace)\/>/g, " ").replace(/<hp:tab\b[^>]{0,256}\/>/g, " ").replace(/<[^>]{1,1024}>/g, "");
17591
- const out = scrubText(plain2);
17592
- return out === plain2 ? all : open + out.replace(/&(?!(?:amp|lt|gt|quot|apos);)/g, "&amp;").replace(/</g, "&lt;") + close;
17668
+ const plain3 = body.replace(/<hp:(?:fwSpace|nbSpace)\/>/g, " ").replace(/<hp:tab\b[^>]{0,256}\/>/g, " ").replace(/<[^>]{1,1024}>/g, "");
17669
+ const out = scrubText(plain3);
17670
+ return out === plain3 ? all : open + out.replace(/&(?!(?:amp|lt|gt|quot|apos);)/g, "&amp;").replace(/</g, "&lt;") + close;
17593
17671
  });
17594
17672
  }
17595
17673
  function scrubMeta(hpf) {
@@ -18809,7 +18887,7 @@ function classify(raw) {
18809
18887
  if (li) return { kind: indent >= 2 ? "sub" : "item", body: li[1].trim() };
18810
18888
  return { kind: "para", body: t };
18811
18889
  }
18812
- function plain(s) {
18890
+ function plain2(s) {
18813
18891
  return s.replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/(\*\*|__|~~|`)/g, "").trim();
18814
18892
  }
18815
18893
  function stripQuoted(s) {
@@ -18914,11 +18992,11 @@ function lintMuncheText(text) {
18914
18992
  continue;
18915
18993
  }
18916
18994
  if (c.kind === "lead") {
18917
- leadBuf.push({ line: no, body: plain(c.body) });
18995
+ leadBuf.push({ line: no, body: plain2(c.body) });
18918
18996
  continue;
18919
18997
  }
18920
18998
  flushLead();
18921
- const b = plain(c.body);
18999
+ const b = plain2(c.body);
18922
19000
  if (!b) continue;
18923
19001
  const q = stripQuoted(b);
18924
19002
  if (c.kind === "item" || c.kind === "sub" || c.kind === "concl" || c.kind === "para") {
@@ -19738,9 +19816,9 @@ var UNIT_NOTE_RE = new RegExp(String.raw`[((]\s*(?:단위\s*[::]\s*)?(${unit
19738
19816
  var BOUND_AFTER = /^\s?(?:이상|이하|초과|미만|내외|수준|안팎|가량|정도)/;
19739
19817
  var BOUND_BEFORE = /(?:목표|기준|상한|하한|최소|최대|약)[^\d]{0,8}$/;
19740
19818
  function canonicalValue(text) {
19741
- const plain2 = text.replace(/,/g, "");
19742
- if (!plain2.includes(".")) return plain2;
19743
- return plain2.replace(/0+$/, "").replace(/\.$/, "");
19819
+ const plain3 = text.replace(/,/g, "");
19820
+ if (!plain3.includes(".")) return plain3;
19821
+ return plain3.replace(/0+$/, "").replace(/\.$/, "");
19744
19822
  }
19745
19823
  var isDistinctive = (value) => value.includes(".") || value.replace(/^0+/, "").length >= 3;
19746
19824
  function indexTable(rows, at) {
@@ -20479,6 +20557,12 @@ async function withImageQr(blocks, markdown, warnings, images, options, inline)
20479
20557
  const found = await readImageQrCodes(blocks, images, list);
20480
20558
  return { markdown: found ? blocksMarkdown(blocks, options, inline) : markdown, warnings: list.length ? list : void 0 };
20481
20559
  }
20560
+ async function withImageFormat(blocks, markdown, warnings, images, options, inline) {
20561
+ if (!options?.imageFormat || options.images === false || !images?.length) return { markdown, warnings };
20562
+ const list = [...warnings ?? []];
20563
+ const renamed = await convertImages(blocks, images, options.imageFormat, list);
20564
+ return { markdown: renamed ? blocksMarkdown(blocks, options, inline) : markdown, warnings: list.length ? list : void 0 };
20565
+ }
20482
20566
  function blocksMarkdown(blocks, options, images) {
20483
20567
  const md = blocksToMarkdown(blocks, { tableFormat: options?.tableFormat });
20484
20568
  if (!(options?.inlineImages && options.images !== false && images?.length)) return md;
@@ -20493,7 +20577,7 @@ function scriptsOff(r, off) {
20493
20577
  }
20494
20578
  async function parseImage(buffer, options) {
20495
20579
  try {
20496
- const { parseImageDocument } = await import("./image-ocr-PYOXD5K4.js");
20580
+ const { parseImageDocument } = await import("./image-ocr-7Y3FCGRR.js");
20497
20581
  const { blocks, warnings, lines } = await parseImageDocument(buffer, options);
20498
20582
  stripScriptTags({ blocks });
20499
20583
  return {
@@ -20513,7 +20597,8 @@ async function parseHwp3(buffer, options) {
20513
20597
  try {
20514
20598
  const { markdown, blocks, metadata, outline, warnings, images } = parseHwp3Document(buffer, options);
20515
20599
  const qr = await withImageQr(blocks, markdown, warnings, images, options, images);
20516
- return { success: true, fileType: "hwp3", markdown: qr.markdown, blocks, metadata, outline, warnings: qr.warnings, images, pageCount: metadata?.pageCount };
20600
+ const webp = await withImageFormat(blocks, qr.markdown, qr.warnings, images, options, images);
20601
+ return { success: true, fileType: "hwp3", markdown: webp.markdown, blocks, metadata, outline, warnings: webp.warnings, images, pageCount: metadata?.pageCount };
20517
20602
  } catch (err) {
20518
20603
  return { success: false, fileType: "hwp3", error: sanitizeError(err), code: classifyError(err) };
20519
20604
  }
@@ -20524,8 +20609,9 @@ async function parseHwpx(buffer, options) {
20524
20609
  const { blocks, metadata, outline, images, memos } = doc;
20525
20610
  const ocr = await withEmbeddedImageOcr(blocks, doc.markdown, doc.warnings, void 0, options);
20526
20611
  const qr = await withImageQr(blocks, ocr.markdown, ocr.warnings, images, options);
20527
- const markdown = options?.memos && memos?.length ? qr.markdown + memosMarkdown(memos) : qr.markdown;
20528
- return scriptsOff({ success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings: qr.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount, ...memos?.length ? { memos } : {} }, options?.scriptTags === false);
20612
+ const webp = await withImageFormat(blocks, qr.markdown, qr.warnings, images, options);
20613
+ const markdown = options?.memos && memos?.length ? webp.markdown + memosMarkdown(memos) : webp.markdown;
20614
+ return scriptsOff({ success: true, fileType: "hwpx", markdown, blocks, metadata, outline, warnings: webp.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount, ...memos?.length ? { memos } : {} }, options?.scriptTags === false);
20529
20615
  } catch (err) {
20530
20616
  return { success: false, fileType: "hwpx", error: sanitizeError(err), code: classifyError(err) };
20531
20617
  }
@@ -20553,8 +20639,9 @@ async function parseHwp(buffer, options) {
20553
20639
  }
20554
20640
  const ocred = await withEmbeddedImageOcr(blocks, markdown, warnings, images, options);
20555
20641
  const qr = await withImageQr(blocks, ocred.markdown, ocred.warnings, images, options, images);
20556
- const md = options?.memos && memos?.length ? qr.markdown + memosMarkdown(memos) : qr.markdown;
20557
- return scriptsOff({ success: true, fileType: "hwp", markdown: md, blocks, metadata, outline, warnings: qr.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount, ...memos?.length ? { memos } : {} }, options?.scriptTags === false);
20642
+ const webp = await withImageFormat(blocks, qr.markdown, qr.warnings, images, options, images);
20643
+ const md = options?.memos && memos?.length ? webp.markdown + memosMarkdown(memos) : webp.markdown;
20644
+ return scriptsOff({ success: true, fileType: "hwp", markdown: md, blocks, metadata, outline, warnings: webp.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount, ...memos?.length ? { memos } : {} }, options?.scriptTags === false);
20558
20645
  } catch (err) {
20559
20646
  return { success: false, fileType: "hwp", error: sanitizeError(err), code: classifyError(err) };
20560
20647
  }
@@ -20562,7 +20649,7 @@ async function parseHwp(buffer, options) {
20562
20649
  async function parsePdf(buffer, options) {
20563
20650
  let parsePdfDocument;
20564
20651
  try {
20565
- const mod = await import("./parser-7JSQYNLS.js");
20652
+ const mod = await import("./parser-JPWANPLM.js");
20566
20653
  parsePdfDocument = mod.parsePdfDocument;
20567
20654
  } catch {
20568
20655
  return {
@@ -20600,7 +20687,8 @@ async function parseDocx(buffer, options) {
20600
20687
  try {
20601
20688
  const { markdown, blocks, metadata, outline, warnings, images } = await parseDocxDocument(buffer, options);
20602
20689
  const qr = await withImageQr(blocks, markdown, warnings, images, options);
20603
- return scriptsOff({ success: true, fileType: "docx", markdown: qr.markdown, blocks, metadata, outline, warnings: qr.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount }, options?.scriptTags === false);
20690
+ const webp = await withImageFormat(blocks, qr.markdown, qr.warnings, images, options);
20691
+ return scriptsOff({ success: true, fileType: "docx", markdown: webp.markdown, blocks, metadata, outline, warnings: webp.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount }, options?.scriptTags === false);
20604
20692
  } catch (err) {
20605
20693
  return { success: false, fileType: "docx", error: sanitizeError(err), code: classifyError(err) };
20606
20694
  }
@@ -20609,7 +20697,8 @@ async function parsePptx(buffer, options) {
20609
20697
  try {
20610
20698
  const { markdown, blocks, metadata, outline, warnings, images } = await parsePptxDocument(buffer, options);
20611
20699
  const qr = await withImageQr(blocks, markdown, warnings, images, options);
20612
- return scriptsOff({ success: true, fileType: "pptx", markdown: qr.markdown, blocks, metadata, outline, warnings: qr.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount }, options?.scriptTags === false);
20700
+ const webp = await withImageFormat(blocks, qr.markdown, qr.warnings, images, options);
20701
+ return scriptsOff({ success: true, fileType: "pptx", markdown: webp.markdown, blocks, metadata, outline, warnings: webp.warnings, images: images?.length ? images : void 0, pageCount: metadata?.pageCount }, options?.scriptTags === false);
20613
20702
  } catch (err) {
20614
20703
  return { success: false, fileType: "pptx", error: sanitizeError(err), code: classifyError(err) };
20615
20704
  }
@@ -20640,7 +20729,7 @@ async function fillForm(input, values, outputFormat = "markdown") {
20640
20729
  throw new Error(`hwpx-preserve \uD3EC\uB9F7\uC740 HWPX\xB7HWP 5.x \uC785\uB825\uB9CC \uC9C0\uC6D0\uD569\uB2C8\uB2E4 (\uAC10\uC9C0\uB41C \uD3EC\uB9F7: ${zipFormat})`);
20641
20730
  }
20642
20731
  } else if (format2 === "hwp" && detectOle2Format(buffer) === "hwp") {
20643
- const { hwpToHwpx: hwpToHwpx2 } = await import("./to-hwpx-6JF6Q2TZ.js");
20732
+ const { hwpToHwpx: hwpToHwpx2 } = await import("./to-hwpx-D7OMPDUQ.js");
20644
20733
  const hwpx = await hwpToHwpx2(new Uint8Array(buffer));
20645
20734
  buffer = hwpx.buffer.slice(hwpx.byteOffset, hwpx.byteOffset + hwpx.byteLength);
20646
20735
  } else {
@@ -20789,4 +20878,4 @@ export {
20789
20878
  parseHwpml,
20790
20879
  fillForm
20791
20880
  };
20792
- //# sourceMappingURL=chunk-WVUR3HYW.js.map
20881
+ //# sourceMappingURL=chunk-4HJKBRZJ.js.map