@agile-team/mach-report 2.13.0 → 2.15.0

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 (260) hide show
  1. package/README.md +20 -7
  2. package/THIRD_PARTY_NOTICES.md +3 -1
  3. package/dist/ExcelBindingWizard-BKH1nGNS.js +1485 -0
  4. package/dist/ExcelBindingWizard-Bs43BGNp.cjs +1 -0
  5. package/dist/ParamEditor-Da4akw6V.cjs +1 -0
  6. package/dist/ParamEditor-DoAhzJsm.js +594 -0
  7. package/dist/{ReportBatchPanel-CW2HV9I8.js → ReportBatchPanel-BMf6boMA.js} +39 -39
  8. package/dist/ReportBatchPanel-wP9m9Pj1.cjs +1 -0
  9. package/dist/ReportPreview-ChV19HBp.js +4619 -0
  10. package/dist/ReportPreview-DbLvvOUT.cjs +6 -0
  11. package/dist/{ReportTemplateLibrary-BZB-XWjj.js → ReportTemplateLibrary-C9wutIiT.js} +1 -1
  12. package/dist/ReportTemplateLibrary-Sxr3eD0J.cjs +1 -0
  13. package/dist/RuleEditor-C_Clasvd.js +2037 -0
  14. package/dist/RuleEditor-XhGHK8DE.cjs +1 -0
  15. package/dist/TemplateOutlinePanel-D6Bkny59.js +96 -0
  16. package/dist/TemplateOutlinePanel-JTSR53vJ.cjs +1 -0
  17. package/dist/TemplateReusePanel-Kx35S0Ql.cjs +1 -0
  18. package/dist/TemplateReusePanel-rVuK1kTz.js +388 -0
  19. package/dist/TemplateReviewPanel-B0ar9_zf.js +592 -0
  20. package/dist/TemplateReviewPanel-Dn6X9UmY.cjs +1 -0
  21. package/dist/analytics.cjs +1 -1
  22. package/dist/analytics.d.cts +3 -1
  23. package/dist/analytics.d.ts +3 -1
  24. package/dist/analytics.js +154 -60
  25. package/dist/artifact-integrity.json +135 -0
  26. package/dist/assets-B9ImAi6_.cjs +1 -0
  27. package/dist/assets-DEaz4qsp.js +124 -0
  28. package/dist/batch-BaP6pWDE.cjs +1 -0
  29. package/dist/batch-BfZHN1do.js +220 -0
  30. package/dist/batch-CGyt-b2W.js +273 -0
  31. package/dist/batch-CLpELXBl.cjs +1 -0
  32. package/dist/capabilities-CAh2Nrue.cjs +1 -0
  33. package/dist/capabilities-DskCHs3V.js +69 -0
  34. package/dist/codes.d.cts +2 -0
  35. package/dist/codes.d.ts +2 -0
  36. package/dist/{computed-Bvk0W15F.js → computed-C-4C2S5h.js} +3 -3
  37. package/dist/config-BVsJXSqS.js +842 -0
  38. package/dist/config-D10us76d.cjs +1 -0
  39. package/dist/data-explanation-B8MZRYVS.js +16 -0
  40. package/dist/data-explanation-DE55G30w.cjs +1 -0
  41. package/dist/designer-2bDlcNXQ.js +5136 -0
  42. package/dist/designer-BT7XCdbW.cjs +2 -0
  43. package/dist/designer.cjs +1 -2
  44. package/dist/designer.d.cts +432 -17
  45. package/dist/designer.d.ts +432 -17
  46. package/dist/designer.js +21 -4312
  47. package/dist/drill-ByJviLXS.js +145 -0
  48. package/dist/drill-DYTxuL3A.cjs +1 -0
  49. package/dist/font-loader-B_UkxpzC.cjs +1 -0
  50. package/dist/font-loader-Q3bQjmrI.js +297 -0
  51. package/dist/index.cjs +8 -8
  52. package/dist/index.d.cts +239 -5
  53. package/dist/index.d.ts +239 -5
  54. package/dist/index.js +939 -893
  55. package/dist/json-snapshot-DFb2eWkf.js +1416 -0
  56. package/dist/json-snapshot-WWSGlaHG.cjs +2 -0
  57. package/dist/licenses/_bwip-js_generic-4.11.4.txt +24 -0
  58. package/dist/licenses/_fast-csv_format-4.3.5.txt +22 -0
  59. package/dist/licenses/_fast-csv_parse-4.3.6.txt +22 -0
  60. package/dist/licenses/_pdf-lib_fontkit-1.1.1.txt +326 -0
  61. package/dist/licenses/_pdf-lib_standard-fonts-1.0.0.txt +22 -0
  62. package/dist/licenses/_pdf-lib_upng-1.0.1.txt +22 -0
  63. package/dist/licenses/_types_node-14.18.63.txt +22 -0
  64. package/dist/licenses/_types_pako-2.0.3.txt +22 -0
  65. package/dist/licenses/_types_pegjs-0.10.6.txt +22 -0
  66. package/dist/licenses/archiver-5.3.2.txt +23 -0
  67. package/dist/licenses/archiver-utils-2.1.0.txt +23 -0
  68. package/dist/licenses/archiver-utils-3.0.4.txt +23 -0
  69. package/dist/licenses/async-3.2.6.txt +20 -0
  70. package/dist/licenses/balanced-match-1.0.2.txt +22 -0
  71. package/dist/licenses/base64-js-1.5.1.txt +22 -0
  72. package/dist/licenses/big-integer-1.6.52.txt +25 -0
  73. package/dist/licenses/binary-0.3.0.txt +178 -0
  74. package/dist/licenses/bl-4.1.0.txt +14 -0
  75. package/dist/licenses/bluebird-3.4.7.txt +22 -0
  76. package/dist/licenses/brace-expansion-1.1.21.txt +22 -0
  77. package/dist/licenses/brace-expansion-2.1.7.txt +22 -0
  78. package/dist/licenses/buffer-5.7.1.txt +22 -0
  79. package/dist/licenses/buffer-crc32-0.2.13.txt +20 -0
  80. package/dist/licenses/buffer-indexof-polyfill-1.0.2.txt +23 -0
  81. package/dist/licenses/buffers-0.1.1.txt +140 -0
  82. package/dist/licenses/chainsaw-0.1.0.txt +184 -0
  83. package/dist/licenses/compress-commons-4.1.2.txt +23 -0
  84. package/dist/licenses/concat-map-0.0.1.txt +19 -0
  85. package/dist/licenses/core-util-is-1.0.3.txt +20 -0
  86. package/dist/licenses/crc-32-1.2.2.txt +202 -0
  87. package/dist/licenses/crc32-stream-4.0.3.txt +23 -0
  88. package/dist/licenses/dayjs-1.11.23.txt +22 -0
  89. package/dist/licenses/duplexer2-0.1.4.txt +27 -0
  90. package/dist/licenses/end-of-stream-1.4.5.txt +22 -0
  91. package/dist/licenses/exceljs-4.4.0.txt +23 -0
  92. package/dist/licenses/fast-csv-4.3.6.txt +22 -0
  93. package/dist/licenses/fast-png-6.4.0.txt +22 -0
  94. package/dist/licenses/fs-constants-1.0.0.txt +22 -0
  95. package/dist/licenses/fs.realpath-1.0.0.txt +44 -0
  96. package/dist/licenses/fstream-1.0.12.txt +16 -0
  97. package/dist/licenses/glob-7.2.3.txt +22 -0
  98. package/dist/licenses/graceful-fs-4.2.11.txt +16 -0
  99. package/dist/licenses/ieee754-1.2.1.txt +12 -0
  100. package/dist/licenses/immediate-3.0.6.txt +21 -0
  101. package/dist/licenses/inflight-1.0.6.txt +16 -0
  102. package/dist/licenses/inherits-2.0.4.txt +17 -0
  103. package/dist/licenses/iobuffer-5.4.0.txt +23 -0
  104. package/dist/licenses/isarray-1.0.0.txt +61 -0
  105. package/dist/licenses/jszip-3.10.2.txt +652 -0
  106. package/dist/licenses/lazystream-1.0.1.txt +24 -0
  107. package/dist/licenses/lie-3.3.0.txt +8 -0
  108. package/dist/licenses/listenercount-1.0.1.txt +6 -0
  109. package/dist/licenses/lodash.defaults-4.2.0.txt +48 -0
  110. package/dist/licenses/lodash.difference-4.5.0.txt +48 -0
  111. package/dist/licenses/lodash.escaperegexp-4.1.2.txt +48 -0
  112. package/dist/licenses/lodash.flatten-4.4.0.txt +48 -0
  113. package/dist/licenses/lodash.groupby-4.6.0.txt +48 -0
  114. package/dist/licenses/lodash.isboolean-3.0.3.txt +23 -0
  115. package/dist/licenses/lodash.isequal-4.5.0.txt +48 -0
  116. package/dist/licenses/lodash.isfunction-3.0.9.txt +48 -0
  117. package/dist/licenses/lodash.isnil-4.0.0.txt +23 -0
  118. package/dist/licenses/lodash.isplainobject-4.0.6.txt +48 -0
  119. package/dist/licenses/lodash.isundefined-3.0.1.txt +23 -0
  120. package/dist/licenses/lodash.union-4.6.0.txt +48 -0
  121. package/dist/licenses/lodash.uniq-4.5.0.txt +48 -0
  122. package/dist/licenses/minimatch-3.1.5.txt +16 -0
  123. package/dist/licenses/minimatch-5.1.9.txt +16 -0
  124. package/dist/licenses/minimist-1.2.8.txt +19 -0
  125. package/dist/licenses/mkdirp-0.5.6.txt +22 -0
  126. package/dist/licenses/node-sql-parser-5.4.0.txt +202 -0
  127. package/dist/licenses/normalize-path-3.0.0.txt +22 -0
  128. package/dist/licenses/once-1.4.0.txt +16 -0
  129. package/dist/licenses/pako-1.0.11.txt +22 -0
  130. package/dist/licenses/pako-2.2.0.txt +22 -0
  131. package/dist/licenses/path-is-absolute-1.0.1.txt +22 -0
  132. package/dist/licenses/pdf-lib-1.17.1.txt +22 -0
  133. package/dist/licenses/process-nextick-args-2.0.1.txt +20 -0
  134. package/dist/licenses/readable-stream-2.3.8.txt +48 -0
  135. package/dist/licenses/readable-stream-3.6.2.txt +48 -0
  136. package/dist/licenses/readdir-glob-1.1.3.txt +202 -0
  137. package/dist/licenses/rimraf-2.7.1.txt +16 -0
  138. package/dist/licenses/safe-buffer-5.1.2.txt +22 -0
  139. package/dist/licenses/safe-buffer-5.2.1.txt +22 -0
  140. package/dist/licenses/saxes-5.0.1.txt +397 -0
  141. package/dist/licenses/setimmediate-1.0.5.txt +21 -0
  142. package/dist/licenses/string_decoder-1.1.1.txt +49 -0
  143. package/dist/licenses/string_decoder-1.3.0.txt +49 -0
  144. package/dist/licenses/tar-stream-2.2.0.txt +22 -0
  145. package/dist/licenses/tmp-0.2.7.txt +22 -0
  146. package/dist/licenses/traverse-0.3.9.txt +25 -0
  147. package/dist/licenses/tslib-1.14.1.txt +13 -0
  148. package/dist/licenses/unzipper-0.10.14.txt +26 -0
  149. package/dist/licenses/util-deprecate-1.0.2.txt +25 -0
  150. package/dist/licenses/uuid-11.1.1.txt +10 -0
  151. package/dist/licenses/wrappy-1.0.2.txt +16 -0
  152. package/dist/licenses/xmlchars-2.2.0.txt +19 -0
  153. package/dist/licenses/zip-stream-4.1.1.txt +23 -0
  154. package/dist/matrix-CGRGkn5s.js +112 -0
  155. package/dist/matrix-gEO7ZM_u.cjs +1 -0
  156. package/dist/media-B7vnpD8k.cjs +1 -0
  157. package/dist/media-Y90dHK9z.js +70 -0
  158. package/dist/param-validation-C3HlcLLO.cjs +1 -0
  159. package/dist/param-validation-Do7Eg8Zv.js +181 -0
  160. package/dist/pdf-BwNyeGpt.js +36352 -0
  161. package/dist/pdf-CvvrjPQg.cjs +103 -0
  162. package/dist/pdf.cjs +1 -101
  163. package/dist/pdf.d.cts +18 -3
  164. package/dist/pdf.d.ts +18 -3
  165. package/dist/pdf.js +9 -36579
  166. package/dist/plugin-Ca_XZG3l.js +22 -0
  167. package/dist/{plugin-DzS6pxTA.cjs → plugin-DHO7X8z2.cjs} +1 -1
  168. package/dist/prepared-CFy9B75C.cjs +1 -0
  169. package/dist/prepared-ajM-H-9B.js +69 -0
  170. package/dist/progress-B0ctFpKf.cjs +1 -0
  171. package/dist/progress-D-OTpEav.js +52 -0
  172. package/dist/{record-bindings-D-5jQlTj.js → record-bindings-Do_b3h4V.js} +1 -1
  173. package/dist/{region-binding-workflow-CcUq8W2Q.js → region-binding-workflow-BMhK_TjP.js} +1 -1
  174. package/dist/{region-binding-workflow-BzfbxRiR.cjs → region-binding-workflow-DIYJdCUr.cjs} +1 -1
  175. package/dist/{report-params-B44imUd4.js → report-params-B1RzkhJj.js} +1 -1
  176. package/dist/{report-params-SJfhKgaX.cjs → report-params-WDGrA4oP.cjs} +1 -1
  177. package/dist/sbom.cdx.json +3982 -0
  178. package/dist/server/node.d.cts +66 -12
  179. package/dist/server/node.d.ts +66 -12
  180. package/dist/server-node.cjs +1 -1
  181. package/dist/server-node.js +405 -381
  182. package/dist/server.cjs +1 -1
  183. package/dist/server.d.cts +878 -15
  184. package/dist/server.d.ts +878 -15
  185. package/dist/server.js +1034 -534
  186. package/dist/sha256-ArEYjaTI.cjs +1 -0
  187. package/dist/sha256-DPEuJ3nh.js +155 -0
  188. package/dist/style.css +1 -1
  189. package/dist/template-bindings-C2SpvsMU.js +58 -0
  190. package/dist/template-bindings-CEtWyiLX.cjs +1 -0
  191. package/dist/template-catalog-FJE_c9Qe.cjs +1 -0
  192. package/dist/template-catalog-j2B1MJlL.js +414 -0
  193. package/dist/template-fragments-BGbQLGlV.js +187 -0
  194. package/dist/template-fragments-DcKeiylI.cjs +1 -0
  195. package/dist/template-outline-BwRV_eRo.cjs +1 -0
  196. package/dist/template-outline-cnWfT_LK.js +88 -0
  197. package/dist/{template-registry-BjE1VS6g.js → template-registry-BtaKPELV.js} +364 -201
  198. package/dist/template-registry-Co1zPq5e.cjs +1 -0
  199. package/dist/textwrap-CWHyzkBH.cjs +4 -0
  200. package/dist/textwrap-DE1kgcJB.js +110 -0
  201. package/dist/{tree-CqcQ99NM.js → tree-CjVZLRw7.js} +1 -1
  202. package/dist/{useLocalDraft-C07SYRnC.js → useLocalDraft-BnhcxXk_.js} +1 -1
  203. package/dist/{useLocalDraft-Yiw1wFgI.cjs → useLocalDraft-CioIfDb6.cjs} +1 -1
  204. package/dist/vue/async.d.cts +190 -15
  205. package/dist/vue/async.d.ts +190 -15
  206. package/dist/vue/index.d.cts +274 -24
  207. package/dist/vue/index.d.ts +274 -24
  208. package/dist/vue-async.cjs +1 -1
  209. package/dist/vue-async.js +5 -5
  210. package/dist/vue.cjs +1 -1
  211. package/dist/vue.js +90 -81
  212. package/dist/{workbook-session-DNa2RHNG.cjs → workbook-session-Bjv1YCRK.cjs} +18 -18
  213. package/dist/{workbook-session-BPb3TMnT.js → workbook-session-BvToI-Fd.js} +5440 -5288
  214. package/dist/worker.cjs +1 -1
  215. package/dist/worker.d.cts +66 -12
  216. package/dist/worker.d.ts +66 -12
  217. package/dist/worker.js +61 -56
  218. package/dist/xlsx-node.cjs +34 -34
  219. package/dist/xlsx-node.js +878 -870
  220. package/dist/xlsx.cjs +3 -4
  221. package/dist/xlsx.d.cts +22 -10
  222. package/dist/xlsx.d.ts +22 -10
  223. package/dist/xlsx.js +261 -253
  224. package/package.json +2 -2
  225. package/dist/ExcelBindingWizard-CeAf4QSE.js +0 -1465
  226. package/dist/ExcelBindingWizard-y0mT-AHR.cjs +0 -1
  227. package/dist/ParamEditor-BLaE5q5W.js +0 -522
  228. package/dist/ParamEditor-MBBC7lUE.cjs +0 -1
  229. package/dist/ReportBatchPanel-Fp1ePFag.cjs +0 -1
  230. package/dist/ReportPreview-BN6fk7Wz.cjs +0 -6
  231. package/dist/ReportPreview-D2Jkyh1U.js +0 -4243
  232. package/dist/ReportTemplateLibrary-5fk5CQBO.cjs +0 -1
  233. package/dist/RuleEditor-ChRzNQuF.cjs +0 -1
  234. package/dist/RuleEditor-DzAmW5YH.js +0 -2024
  235. package/dist/TemplateReviewPanel-BKofGrV9.js +0 -222
  236. package/dist/TemplateReviewPanel-DwtOcLue.cjs +0 -1
  237. package/dist/assets-C2U-e-Sz.cjs +0 -4
  238. package/dist/assets-Q0wUwNrV.js +0 -217
  239. package/dist/batch-Bt3Fd27Z.cjs +0 -1
  240. package/dist/batch-mRqhhhjt.js +0 -364
  241. package/dist/capabilities-CK_7hizc.js +0 -63
  242. package/dist/capabilities-CsZ-pNHR.cjs +0 -1
  243. package/dist/config-Bb7RiIO5.cjs +0 -1
  244. package/dist/config-XVwG87IA.js +0 -529
  245. package/dist/matrix-DVyWiYsd.cjs +0 -1
  246. package/dist/matrix-yZsGnldA.js +0 -227
  247. package/dist/page-window-index-CIuT4BAv.js +0 -43
  248. package/dist/page-window-index-DEjnM6IB.cjs +0 -1
  249. package/dist/param-validation-BlHHXs6u.js +0 -153
  250. package/dist/param-validation-DCK039V1.cjs +0 -1
  251. package/dist/plugin-D4wizDXB.js +0 -22
  252. package/dist/progress-7OSZbFok.js +0 -39
  253. package/dist/progress-BnLiS5eH.cjs +0 -1
  254. package/dist/task-events-DQ276fn2.cjs +0 -1
  255. package/dist/task-events-Dpsvf_t2.js +0 -47
  256. package/dist/template-registry-D3SjENi6.cjs +0 -1
  257. package/dist/template-review-DGwWOoCv.cjs +0 -2
  258. package/dist/template-review-PgEe_Wr9.js +0 -1742
  259. package/dist/validate-BJ5HIWY8.cjs +0 -1
  260. package/dist/validate-DbgEM1Hh.js +0 -163
@@ -1,44 +1,203 @@
1
- import { v as J } from "./matrix-yZsGnldA.js";
2
- import { v as j, e as D } from "./computed-Bvk0W15F.js";
3
- import { R as H } from "./render-plan-Ck6koX9L.js";
4
- import { v as L, d as K } from "./validate-DbgEM1Hh.js";
5
- import { v as U, e as W } from "./param-validation-BlHHXs6u.js";
6
- import { v as G, a as z } from "./tree-CqcQ99NM.js";
7
- function x(e) {
1
+ import { v as H } from "./matrix-CGRGkn5s.js";
2
+ import { v as W, c as G } from "./computed-C-4C2S5h.js";
3
+ import { R as U } from "./render-plan-Ck6koX9L.js";
4
+ import { c as B } from "./code-options-BKXXY7NI.js";
5
+ import { v as z, e as q } from "./param-validation-Do7Eg8Zv.js";
6
+ import { v as X, a as Y } from "./tree-CjVZLRw7.js";
7
+ function Q(e, i, t) {
8
+ e !== void 0 && (typeof e != "string" || !e.trim() || e.length > 4096) && t.push({ path: i, message: "来源范围应为不超过 4096 字符的非空字符串" });
9
+ }
10
+ function P(e, i, t) {
11
+ e.editable !== void 0 && typeof e.editable != "boolean" && t.push({ path: `${i}.editable`, message: "编辑控制应为布尔值" }), e.valueType !== void 0 && !["text", "number", "boolean"].includes(e.valueType) && t.push({ path: `${i}.valueType`, message: "编辑类型应为 text、number 或 boolean" });
12
+ }
13
+ function Z(e, i, t) {
14
+ P(e, i, t), e.indentMm !== void 0 && (typeof e.indentMm != "number" || !Number.isFinite(e.indentMm) || e.indentMm < 0) && t.push({ path: `${i}.indentMm`, message: "单元格缩进应为有限非负数" }), e.derived !== void 0 && typeof e.derived != "boolean" && t.push({ path: `${i}.derived`, message: "派生结果标记应为布尔值" }), _(e.source, `${i}.source`, t, !0), e.formula !== void 0 && typeof e.formula != "string" && t.push({ path: `${i}.formula`, message: "单元格公式应为字符串" });
15
+ }
16
+ function _(e, i, t, s = !1) {
17
+ if (e === void 0) return;
18
+ if (!e || typeof e != "object" || Array.isArray(e)) {
19
+ t.push({ path: i, message: "业务来源应为对象" });
20
+ return;
21
+ }
22
+ const n = e;
23
+ Q(n.sourceScope, `${i}.sourceScope`, t);
24
+ for (const a of ["datasetId", ...s ? ["field"] : []])
25
+ (typeof n[a] != "string" || !n[a].trim()) && t.push({ path: `${i}.${a}`, message: "业务标识应为非空字符串" });
26
+ for (const a of ["rowKey", "revision"]) {
27
+ const o = n[a];
28
+ o === void 0 && !(s && a === "rowKey") || typeof o != "string" && !(typeof o == "number" && Number.isFinite(o)) && t.push({ path: `${i}.${a}`, message: "业务键及修订号应为字符串或有限数字" });
29
+ }
30
+ n.sourceToken !== void 0 && typeof n.sourceToken != "string" && t.push({ path: `${i}.sourceToken`, message: "来源令牌应为字符串" });
31
+ }
32
+ const ee = /* @__PURE__ */ new Set([
33
+ "text",
34
+ "image",
35
+ "barcode",
36
+ "qrcode",
37
+ "chart",
38
+ "line",
39
+ "rect",
40
+ "ellipse"
41
+ ]);
42
+ function p(e) {
43
+ return typeof e == "object" && e !== null && !Array.isArray(e);
44
+ }
45
+ function te(e, i, t, s) {
46
+ const n = e[i];
47
+ (typeof n != "number" || !Number.isFinite(n)) && s.push({ path: `${t}.${i}`, message: `应为有限数字,实际 ${JSON.stringify(n)}` });
48
+ }
49
+ function ie(e, i, t) {
50
+ if (e !== void 0) {
51
+ const s = `${i}.table`;
52
+ if (!p(e)) t.push({ path: s, message: "逻辑表来源应为对象" });
53
+ else {
54
+ _(e.source, `${s}.source`, t), (typeof e.id != "string" || !e.id.trim()) && t.push({ path: `${s}.id`, message: "逻辑表 ID 应为非空字符串" });
55
+ const n = e.role;
56
+ ["header", "body", "group-header", "subtotal", "grand-total"].includes(n) || t.push({ path: `${s}.role`, message: "未知逻辑表行角色" });
57
+ const a = e.rowIndex;
58
+ (typeof a != "number" || !Number.isInteger(a) || (n === "header" ? a !== -1 : a < 0)) && t.push({ path: `${s}.rowIndex`, message: "表头索引应为 -1,内容行索引应为非负整数" }), (!Array.isArray(e.columnKeys) || e.columnKeys.some((o) => typeof o != "string")) && t.push({ path: `${s}.columnKeys`, message: "逻辑列字段应为字符串数组" }), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && t.push({ path: `${s}.layout`, message: "布局应为 page 或 wide" }), e.title !== void 0 && typeof e.title != "string" && t.push({ path: `${s}.title`, message: "逻辑表名称应为字符串" });
59
+ }
60
+ }
61
+ }
62
+ function se(e, i, t, s) {
63
+ if (e !== void 0)
64
+ if (!p(e) || !Array.isArray(e.cells))
65
+ t.push({ path: `${i}.grid.cells`, message: "grid.cells 应为二维数组" });
66
+ else {
67
+ const n = e.paddingMm;
68
+ n !== void 0 && (typeof n != "number" || !Number.isFinite(n) || n < 0) && t.push({ path: `${i}.grid.paddingMm`, message: "单元格内距应为有限非负数" }), e.cells.forEach((a, o) => {
69
+ if (!Array.isArray(a)) {
70
+ t.push({ path: `${i}.grid.cells.${o}`, message: "行应为数组" });
71
+ return;
72
+ }
73
+ a.forEach((f, r) => {
74
+ if (f == null) return;
75
+ const d = `${i}.grid.cells.${o}.${r}`;
76
+ if (!p(f)) {
77
+ t.push({ path: d, message: "网格单元格应为对象或 null" });
78
+ return;
79
+ }
80
+ Z(f, d, t), Array.isArray(f.children) && f.children.forEach((h, g) => {
81
+ S(h, `${i}.grid.cells.${o}.${r}.children.${g}`, t, s);
82
+ });
83
+ });
84
+ });
85
+ }
86
+ }
87
+ function ne(e, i, t) {
88
+ e !== void 0 && (Array.isArray(e) ? e.forEach((s, n) => {
89
+ (!p(s) || !Array.isArray(s.segments)) && t.push({ path: `${i}.richParagraphs.${n}`, message: "段落缺少 segments 数组" });
90
+ }) : t.push({ path: `${i}.richParagraphs`, message: "richParagraphs 应为数组" }));
91
+ }
92
+ function S(e, i, t, s = []) {
93
+ if (!p(e)) {
94
+ t.push({ path: i, message: "组件应为对象" });
95
+ return;
96
+ }
97
+ const n = e.kind;
98
+ typeof n != "string" ? t.push({ path: `${i}.kind`, message: "组件缺少 kind 字符串" }) : ee.has(n) || s.push({
99
+ path: `${i}.kind`,
100
+ message: `未知组件类型 ${JSON.stringify(n)},将以兜底方式渲染`
101
+ });
102
+ for (const a of ["leftMm", "topMm", "widthMm", "heightMm"])
103
+ te(e, a, i, t);
104
+ typeof e.leftMm == "number" && e.leftMm < -100 && t.push({ path: `${i}.leftMm`, message: "几何数值异常(leftMm<-100)" });
105
+ for (const a of ["widthMm", "heightMm"])
106
+ typeof e[a] == "number" && e[a] < 0 && t.push({ path: `${i}.${a}`, message: "组件尺寸不能为负数" });
107
+ ie(e.table, i, t), ae(e.code, n, i, t), e.pageAnchor !== void 0 && !["header", "footer"].includes(e.pageAnchor) && t.push({ path: `${i}.pageAnchor`, message: "页面锚点应为 header 或 footer" }), e.lineDirection !== void 0 && !["down", "up"].includes(e.lineDirection) && t.push({ path: `${i}.lineDirection`, message: "线段方向应为 down 或 up" }), se(e.grid, i, t, s), ne(e.richParagraphs, i, t);
108
+ }
109
+ function ae(e, i, t, s) {
110
+ if (e !== void 0)
111
+ for (const n of B(e, i)) s.push({ path: `${t}.code${n.path ? `.${n.path}` : ""}`, message: n.message });
112
+ }
113
+ function L(e, i, t) {
114
+ if (!p(e)) return;
115
+ e.binding !== void 0 && t.push({ path: `${i}.binding`, message: "渲染计划不允许未解析字段绑定" });
116
+ const s = e.grid;
117
+ !p(s) || !Array.isArray(s.cells) || s.cells.forEach((n, a) => {
118
+ Array.isArray(n) && n.forEach((o, f) => {
119
+ !p(o) || !Array.isArray(o.children) || o.children.forEach((r, d) => L(r, `${i}.grid.cells.${a}.${f}.children.${d}`, t));
120
+ });
121
+ });
122
+ }
123
+ function oe(e, i, t, s = []) {
124
+ if (!p(e)) {
125
+ t.push({ path: i, message: "页应为对象" });
126
+ return;
127
+ }
128
+ const n = e.pageWidthMm, a = e.pageHeightMm;
129
+ (typeof n != "number" || !Number.isFinite(n) || n <= 0) && t.push({ path: `${i}.pageWidthMm`, message: `页宽非法: ${JSON.stringify(n)}` }), (typeof a != "number" || !(a > 0 && a < 5e3)) && t.push({ path: `${i}.pageHeightMm`, message: `页高非法: ${JSON.stringify(a)}` }), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && t.push({ path: `${i}.layout`, message: "布局应为 page 或 wide" });
130
+ const o = e.components;
131
+ Array.isArray(o) ? Array.isArray(o) && o.forEach((f, r) => {
132
+ S(f, `${i}.components.${r}`, t, s), L(f, `${i}.components.${r}`, t);
133
+ }) : t.push({ path: `${i}.components`, message: "components 应为数组" });
134
+ }
135
+ function fe(e) {
136
+ const i = [], t = [], s = p(e) ? e.pages : void 0;
137
+ if (p(e) && e.requiresRecalculation !== void 0 && typeof e.requiresRecalculation != "boolean" && i.push({ path: "$.requiresRecalculation", message: "重算能力要求应为布尔值" }), !Array.isArray(s))
138
+ i.push({
139
+ path: "$.pages",
140
+ message: e == null ? "渲染计划为空" : "渲染计划缺少 pages 数组"
141
+ });
142
+ else {
143
+ s.forEach((a, o) => oe(a, `$.pages.${o}`, i, t)), s.length > 2e3 && t.push({
144
+ path: "$.pages",
145
+ message: `页数异常大(${s.length} 页),渲染与打印耗时可能显著增加`
146
+ });
147
+ const n = s.reduce(
148
+ (a, o) => a + (p(o) && Array.isArray(o.components) ? o.components.length : 0),
149
+ 0
150
+ );
151
+ n > 5e4 && t.push({
152
+ path: "$.pages",
153
+ message: `组件总数异常大(${n} 个),可能触发浏览器性能限制`
154
+ });
155
+ }
156
+ return { ok: i.length === 0, errors: i, warnings: t };
157
+ }
158
+ function He(e) {
159
+ const i = fe(e);
160
+ if (!i.ok) {
161
+ const t = i.errors.slice(0, 3).map((s) => `${s.path}: ${s.message}`).join("; ");
162
+ throw new Error(`渲染计划校验失败(${i.errors.length} 处): ${t}`);
163
+ }
164
+ return e.pages;
165
+ }
166
+ function R(e) {
8
167
  return e.kind === "list" ? e.id : e.nid;
9
168
  }
10
- function B(e) {
169
+ function re(e) {
11
170
  return e.kind === "list" ? !1 : e.pageAnchor !== void 0 || e.kind === "text" && typeof e.text == "string" && /\{(?:page|totalPages)\}/.test(e.text);
12
171
  }
13
- function X(e, i) {
14
- const t = e.filter((n) => i.componentIds.includes(x(n) ?? ""));
172
+ function de(e, i) {
173
+ const t = e.filter((n) => i.componentIds.includes(R(n) ?? ""));
15
174
  if (t.filter((n) => n.kind === "list" && n.cardinality !== "record").length && t.length !== 1) throw new Error("纵向重复区域必须独占流式分段,不能与静态或单记录区域并排");
16
175
  for (const n of t) {
17
176
  const a = n.kind === "list" ? n.topMm + (n.rowHeightMm ?? 0) : n.topMm + n.heightMm;
18
177
  if (n.topMm < i.topMm - 1e-3 || a > i.topMm + i.heightMm + 1e-3) throw new Error("流式分段应完整包含其组件的原始纵向范围");
19
178
  }
20
179
  }
21
- function Oe(e, i) {
180
+ function We(e, i) {
22
181
  if (!i) return e.map((s) => ({ components: [s] }));
23
- const t = new Map(e.map((s) => [x(s), s]));
182
+ const t = new Map(e.map((s) => [R(s), s]));
24
183
  return i.bands.map((s) => ({ band: s, components: s.componentIds.map((n) => {
25
184
  const a = t.get(n);
26
185
  if (!a) throw new Error(`流式区域引用不存在的组件:${n}`);
27
186
  return a;
28
187
  }) }));
29
188
  }
30
- function Y(e, i) {
189
+ function he(e, i) {
31
190
  if (!i || !Array.isArray(i.bands) || !i.bands.length || i.bands.length > 1e4) throw new Error("流式排版应包含 1–10000 个区域");
32
191
  const t = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
33
192
  for (const n of e) {
34
- if (B(n)) continue;
35
- const a = x(n);
193
+ if (re(n)) continue;
194
+ const a = R(n);
36
195
  if (!a || t.has(a)) throw new Error("流式排版组件应具有唯一标识");
37
196
  t.add(a);
38
197
  }
39
- if (q(e, i, t, s), s.size !== t.size) throw new Error("流式排版必须显式包含每个非锚点组件");
198
+ if (ue(e, i, t, s), s.size !== t.size) throw new Error("流式排版必须显式包含每个非锚点组件");
40
199
  }
41
- function q(e, i, t, s) {
200
+ function ue(e, i, t, s) {
42
201
  let n = -1 / 0;
43
202
  for (const a of i.bands) {
44
203
  if (!Number.isFinite(a.topMm) || !Number.isFinite(a.heightMm) || a.topMm < 0 || a.heightMm <= 0 || a.topMm < n - 1e-3) throw new Error("流式区域应按原始位置排序,尺寸有效且不重叠");
@@ -47,78 +206,78 @@ function q(e, i, t, s) {
47
206
  if (!t.has(o) || s.has(o)) throw new Error(`流式区域组件缺失、重复或包含页锚点:${o}`);
48
207
  s.add(o);
49
208
  }
50
- X(e, a), n = a.topMm + a.heightMm;
209
+ de(e, a), n = a.topMm + a.heightMm;
51
210
  }
52
211
  }
53
- const Q = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
54
- function y(e) {
212
+ const me = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
213
+ function l(e) {
55
214
  return !!e && typeof e == "object" && !Array.isArray(e);
56
215
  }
57
- function M(e) {
58
- return typeof e == "string" && !!e.trim() && !Q.has(e);
216
+ function v(e) {
217
+ return typeof e == "string" && !!e.trim() && !me.has(e);
59
218
  }
60
219
  function E(e, i, t, s) {
61
220
  for (const n of Object.keys(e)) i.includes(n) || s.push({ path: `${t}.${n}`, message: "存在未知配置字段" });
62
221
  }
63
- function Z(e, i, t) {
222
+ function ce(e, i, t) {
64
223
  if (e !== void 0) {
65
- if (!y(e) || !["number", "percent", "date"].includes(String(e.kind))) {
224
+ if (!l(e) || !["number", "percent", "date"].includes(String(e.kind))) {
66
225
  t.push({ path: i, message: "绑定格式应为 number、percent 或 date" });
67
226
  return;
68
227
  }
69
228
  E(e, e.kind === "date" ? ["kind", "pattern"] : e.kind === "number" ? ["kind", "digits", "thousands"] : ["kind", "digits"], i, t), e.digits !== void 0 && (!Number.isInteger(e.digits) || Number(e.digits) < 0 || Number(e.digits) > 100) && t.push({ path: `${i}.digits`, message: "精度应为 0..100 整数" }), e.thousands !== void 0 && typeof e.thousands != "boolean" && t.push({ path: `${i}.thousands`, message: "千分位开关应为布尔值" }), e.pattern !== void 0 && typeof e.pattern != "string" && t.push({ path: `${i}.pattern`, message: "日期格式应为字符串" });
70
229
  }
71
230
  }
72
- function ee(e, i, t) {
231
+ function ge(e, i, t) {
73
232
  const s = e.binding;
74
233
  if (s === void 0) return;
75
234
  const n = `${i}.binding`;
76
- if (!y(s)) {
235
+ if (!l(s)) {
77
236
  t.push({ path: n, message: "字段绑定应为对象" });
78
237
  return;
79
238
  }
80
- (!["text", "image", "barcode", "qrcode"].includes(String(e.kind)) || e.grid !== void 0) && t.push({ path: n, message: "绑定仅支持独立文本、图片、条码与二维码组件" }), E(s, ["field", "format", "prefix", "suffix", "emptyText"], n, t), M(s.field) || t.push({ path: `${n}.field`, message: "绑定字段应为安全的非空字段名(按字面读取自有字段)" });
239
+ (!["text", "image", "barcode", "qrcode"].includes(String(e.kind)) || e.grid !== void 0) && t.push({ path: n, message: "绑定仅支持独立文本、图片、条码与二维码组件" }), E(s, ["field", "format", "prefix", "suffix", "emptyText"], n, t), v(s.field) || t.push({ path: `${n}.field`, message: "绑定字段应为安全的非空字段名(按字面读取自有字段)" });
81
240
  for (const a of ["prefix", "suffix", "emptyText"]) s[a] !== void 0 && typeof s[a] != "string" && t.push({ path: `${n}.${a}`, message: "应为字符串" });
82
- Z(s.format, `${n}.format`, t), e.kind === "image" && ["format", "prefix", "suffix"].some((a) => s[a] !== void 0) && t.push({ path: n, message: "图片绑定直接读取 PNG/JPEG data URL,不支持文本格式或前后缀" });
241
+ ce(s.format, `${n}.format`, t), e.kind === "image" && ["format", "prefix", "suffix"].some((a) => s[a] !== void 0) && t.push({ path: n, message: "图片绑定直接读取 PNG/JPEG data URL,不支持文本格式或前后缀" });
83
242
  }
84
- function te(e, i) {
85
- if (!y(e)) {
243
+ function pe(e, i) {
244
+ if (!l(e)) {
86
245
  i.push({ path: "$.repeat", message: "逐记录配置应为对象" });
87
246
  return;
88
247
  }
89
- E(e, ["dataset", "rowKey", "copies"], "$.repeat", i), M(e.dataset) || i.push({ path: "$.repeat.dataset", message: "数据集应为安全的非空名称" }), e.rowKey !== void 0 && !M(e.rowKey) && i.push({ path: "$.repeat.rowKey", message: "业务主键应为安全的非空字段名" });
248
+ E(e, ["dataset", "rowKey", "copies"], "$.repeat", i), v(e.dataset) || i.push({ path: "$.repeat.dataset", message: "数据集应为安全的非空名称" }), e.rowKey !== void 0 && !v(e.rowKey) && i.push({ path: "$.repeat.rowKey", message: "业务主键应为安全的非空字段名" });
90
249
  const t = e.copies;
91
- t !== void 0 && (y(t) ? (E(t, ["field"], "$.repeat.copies", i), M(t.field) || i.push({ path: "$.repeat.copies.field", message: "复制数字段应为安全的非空字段名" })) : (!Number.isSafeInteger(t) || Number(t) < 1 || Number(t) > 1e3) && i.push({ path: "$.repeat.copies", message: "每条记录复制数应为 1..1000 整数" }));
250
+ t !== void 0 && (l(t) ? (E(t, ["field"], "$.repeat.copies", i), v(t.field) || i.push({ path: "$.repeat.copies.field", message: "复制数字段应为安全的非空字段名" })) : (!Number.isSafeInteger(t) || Number(t) < 1 || Number(t) > 1e3) && i.push({ path: "$.repeat.copies", message: "每条记录复制数应为 1..1000 整数" }));
92
251
  }
93
- function _(e, i, t, s) {
94
- if (!y(e)) return;
95
- ee(e, i, s), e.binding !== void 0 && !t && s.push({ path: `${i}.binding`, message: "字段绑定需要模板 repeat 数据集;普通报表请使用列表字段" }), t && e.kind === "list" && s.push({ path: i, message: "逐记录标签使用固定组件;动态列表请使用普通报表模板" });
252
+ function C(e, i, t, s) {
253
+ if (!l(e)) return;
254
+ ge(e, i, s), e.binding !== void 0 && !t && s.push({ path: `${i}.binding`, message: "字段绑定需要模板 repeat 数据集;普通报表请使用列表字段" }), t && e.kind === "list" && s.push({ path: i, message: "逐记录标签使用固定组件;动态列表请使用普通报表模板" });
96
255
  const n = e.grid;
97
- y(n) && Array.isArray(n.cells) && n.cells.forEach((a, o) => {
256
+ l(n) && Array.isArray(n.cells) && n.cells.forEach((a, o) => {
98
257
  Array.isArray(a) && a.forEach((f, r) => {
99
- y(f) && Array.isArray(f.children) && f.children.forEach((h, m) => _(h, `${i}.grid.cells.${o}.${r}.children.${m}`, t, s));
258
+ l(f) && Array.isArray(f.children) && f.children.forEach((d, h) => C(d, `${i}.grid.cells.${o}.${r}.children.${h}`, t, s));
100
259
  });
101
260
  });
102
261
  }
103
- function ie(e, i) {
262
+ function ye(e, i) {
104
263
  const t = e.repeat !== void 0;
105
- t && te(e.repeat, i), Array.isArray(e.pages) && e.pages.forEach((s, n) => {
106
- if (!y(s)) return;
264
+ t && pe(e.repeat, i), Array.isArray(e.pages) && e.pages.forEach((s, n) => {
265
+ if (!l(s)) return;
107
266
  const a = `$.pages.${n}`;
108
267
  t && (s.layout === "wide" || s.flow !== void 0) && i.push({ path: a, message: "逐记录标签仅支持固定尺寸页面,不支持宽表或流式分区" }), Array.isArray(s.components) && s.components.forEach((o, f) => {
109
268
  const r = `${a}.components.${f}`;
110
- if (_(o, r, t, i), !t || !y(o)) return;
111
- const { leftMm: h, topMm: m, widthMm: g, heightMm: p } = o;
112
- [h, m, g, p, s.widthMm, s.heightMm].every((b) => typeof b == "number" && Number.isFinite(b)) && (Number(h) < 0 || Number(m) < 0 || Number(h) + Number(g) > Number(s.widthMm) + 1e-3 || Number(m) + Number(p) > Number(s.heightMm) + 1e-3) && i.push({ path: r, message: "标签组件超出纸张边界,请调整位置或尺寸" });
269
+ if (C(o, r, t, i), !t || !l(o)) return;
270
+ const { leftMm: d, topMm: h, widthMm: g, heightMm: y } = o;
271
+ [d, h, g, y, s.widthMm, s.heightMm].every((A) => typeof A == "number" && Number.isFinite(A)) && (Number(d) < 0 || Number(h) < 0 || Number(d) + Number(g) > Number(s.widthMm) + 1e-3 || Number(h) + Number(y) > Number(s.heightMm) + 1e-3) && i.push({ path: r, message: "标签组件超出纸张边界,请调整位置或尺寸" });
113
272
  });
114
273
  });
115
274
  }
116
- function T(e) {
275
+ function j(e) {
117
276
  return !!e && typeof e == "object" && !Array.isArray(e);
118
277
  }
119
- function v(e, i, t) {
278
+ function O(e, i, t) {
120
279
  if (e !== void 0) {
121
- if (!T(e)) {
280
+ if (!j(e)) {
122
281
  t.push({ path: i, message: "条件应为对象" });
123
282
  return;
124
283
  }
@@ -128,7 +287,7 @@ function v(e, i, t) {
128
287
  });
129
288
  }
130
289
  }
131
- function I(e, i, t) {
290
+ function J(e, i, t) {
132
291
  if (e === void 0) return;
133
292
  if (!Array.isArray(e) || e.length > 2048) {
134
293
  t.push({ path: i, message: "聚合应为数组且最多 2048 项" });
@@ -137,7 +296,7 @@ function I(e, i, t) {
137
296
  const s = /* @__PURE__ */ new Set();
138
297
  e.forEach((n, a) => {
139
298
  const o = `${i}.${a}`;
140
- if (!T(n)) {
299
+ if (!j(n)) {
141
300
  t.push({ path: o, message: "聚合应为对象" });
142
301
  return;
143
302
  }
@@ -153,7 +312,7 @@ function I(e, i, t) {
153
312
  message: "小数位应为 0–100 的整数"
154
313
  });
155
314
  try {
156
- D({
315
+ G({
157
316
  ...n,
158
317
  field: n.valueField ?? f
159
318
  });
@@ -165,15 +324,15 @@ function I(e, i, t) {
165
324
  }
166
325
  });
167
326
  }
168
- function se(e, i, t) {
327
+ function le(e, i, t) {
169
328
  if (e === void 0) return;
170
- const s = j(e);
329
+ const s = W(e);
171
330
  for (const n of s.errors) t.push({ path: i, message: n });
172
331
  }
173
- function ne(e, i, t) {
332
+ function $e(e, i, t) {
174
333
  if (e !== void 0)
175
334
  try {
176
- J(e);
335
+ H(e);
177
336
  } catch (s) {
178
337
  t.push({
179
338
  path: i,
@@ -181,31 +340,31 @@ function ne(e, i, t) {
181
340
  });
182
341
  }
183
342
  }
184
- function ae(e, i, t) {
343
+ function be(e, i, t) {
185
344
  if (e.tree === void 0) return;
186
345
  const s = `${i}.tree`;
187
346
  try {
188
- G(e.tree);
347
+ X(e.tree);
189
348
  const n = e.tree;
190
349
  if (e.matrix || e.detail || e.groupBy || Array.isArray(e.groups) && e.groups.length || e.rowVisibleWhen) throw new Error("树形布局不能同时配置普通分组、矩阵、主从或行可见条件");
191
350
  if (e.rowKey !== void 0 && e.rowKey !== n.idField) throw new Error("树形 rowKey 应与 idField 一致");
192
351
  if (!Array.isArray(e.columns) || !e.columns.some((a) => a && a.field === n.labelField && !a.hidden)) throw new Error("树形布局需要可见的标签列");
193
- Array.isArray(e.computed) && z(n, e.computed);
352
+ Array.isArray(e.computed) && Y(n, e.computed);
194
353
  } catch (n) {
195
354
  t.push({ path: s, message: n instanceof Error ? n.message : String(n) });
196
355
  }
197
356
  }
198
- const P = "1.0";
199
- class A extends Error {
357
+ const D = "1.0";
358
+ class w extends Error {
200
359
  constructor(i) {
201
360
  super(`模板校验失败:${i.slice(0, 3).map((t) => `${t.path}: ${t.message}`).join("; ")}`), this.errors = i, this.name = "ReportTemplateError";
202
361
  }
203
362
  }
204
- const oe = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]), fe = /* @__PURE__ */ new Set(["schemaVersion", "id", "name", "revision", "description", "template"]), re = /* @__PURE__ */ new Set(["left", "center", "right", "justify"]), N = 2e5, he = 64, O = 1e7;
205
- function d(e) {
363
+ const Ae = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]), we = /* @__PURE__ */ new Set(["schemaVersion", "id", "name", "revision", "description", "template"]), Me = /* @__PURE__ */ new Set(["left", "center", "right", "justify"]), N = 2e5, ve = 64, F = 1e7;
364
+ function u(e) {
206
365
  return !!e && typeof e == "object" && !Array.isArray(e);
207
366
  }
208
- function me(e, i, t) {
367
+ function Ne(e, i, t) {
209
368
  const s = Object.getPrototypeOf(e), n = Array.isArray(e);
210
369
  if (n ? s !== Array.prototype : s !== Object.prototype && s !== null)
211
370
  return t.push({ path: i, message: "模板对象必须使用普通 JSON 对象原型" }), !1;
@@ -216,30 +375,30 @@ function me(e, i, t) {
216
375
  }
217
376
  return Object.getOwnPropertySymbols(e).length > 0 ? (t.push({ path: i, message: "模板不能包含 Symbol 键" }), !1) : !0;
218
377
  }
219
- function de(e, i, t, s) {
220
- return oe.has(e) ? (s.push({ path: t, message: "模板不能包含可能污染原型的键" }), !1) : i.get || i.set || !i.enumerable ? (s.push({ path: t, message: "模板不能包含访问器或不可枚举字段" }), !1) : !0;
378
+ function Ee(e, i, t, s) {
379
+ return Ae.has(e) ? (s.push({ path: t, message: "模板不能包含可能污染原型的键" }), !1) : i.get || i.set || !i.enumerable ? (s.push({ path: t, message: "模板不能包含访问器或不可枚举字段" }), !1) : !0;
221
380
  }
222
- function ue(e) {
381
+ function ke(e) {
223
382
  return e === null || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e);
224
383
  }
225
- function R(e, i) {
384
+ function T(e, i) {
226
385
  const t = /* @__PURE__ */ new Set();
227
386
  let s = 0, n = 0, a = !1;
228
- const o = (f, r, h) => {
387
+ const o = (f, r, d) => {
229
388
  if (!a) {
230
389
  if (++s > N) {
231
390
  s === N + 1 && i.push({ path: r, message: "模板超过 JSON 节点安全上限" });
232
391
  return;
233
392
  }
234
- if (h > he) {
393
+ if (d > ve) {
235
394
  i.push({ path: r, message: "模板嵌套层级过深" });
236
395
  return;
237
396
  }
238
397
  if (typeof f == "string") {
239
- n += f.length, n > O && (a = !0, i.push({ path: r, message: "模板文本超过 1000 万字符的安全上限" }));
398
+ n += f.length, n > F && (a = !0, i.push({ path: r, message: "模板文本超过 1000 万字符的安全上限" }));
240
399
  return;
241
400
  }
242
- if (!ue(f)) {
401
+ if (!ke(f)) {
243
402
  if (!f || typeof f != "object") {
244
403
  i.push({ path: r, message: "模板只允许 JSON 值,不允许函数、undefined 或非有限数字" });
245
404
  return;
@@ -248,12 +407,12 @@ function R(e, i) {
248
407
  i.push({ path: r, message: "模板不能包含循环引用" });
249
408
  return;
250
409
  }
251
- if (me(f, r, i)) {
410
+ if (Ne(f, r, i)) {
252
411
  t.add(f);
253
- for (const [m, g] of Object.entries(Object.getOwnPropertyDescriptors(f))) {
254
- if (Array.isArray(f) && m === "length") continue;
255
- const p = `${r}.${m}`;
256
- if (de(m, g, p, i) && o(g.value, p, h + 1), s > N || a) break;
412
+ for (const [h, g] of Object.entries(Object.getOwnPropertyDescriptors(f))) {
413
+ if (Array.isArray(f) && h === "length") continue;
414
+ const y = `${r}.${h}`;
415
+ if (Ee(h, g, y, i) && o(g.value, y, d + 1), s > N || a) break;
257
416
  }
258
417
  t.delete(f);
259
418
  }
@@ -262,7 +421,7 @@ function R(e, i) {
262
421
  };
263
422
  o(e, "$", 0);
264
423
  }
265
- function u(e, i, t, s, n = !1) {
424
+ function m(e, i, t, s, n = !1) {
266
425
  const a = e[i];
267
426
  a === void 0 && !n || (typeof a != "string" || n && !a.trim()) && s.push({ path: `${t}.${i}`, message: n ? "应为非空字符串" : "应为字符串" });
268
427
  }
@@ -270,27 +429,27 @@ function c(e, i, t, s, n = 0, a = !1) {
270
429
  const o = e[i];
271
430
  o === void 0 && !a || (typeof o != "number" || !Number.isFinite(o) || o < n) && s.push({ path: `${t}.${i}`, message: `应为大于等于 ${n} 的有限数字` });
272
431
  }
273
- function $(e, i, t, s) {
432
+ function b(e, i, t, s) {
274
433
  e[i] !== void 0 && typeof e[i] != "boolean" && s.push({ path: `${t}.${i}`, message: "应为布尔值" });
275
434
  }
276
- function w(e, i, t, s = !1) {
277
- e !== void 0 && !re.has(e) && !(s && e === "auto") && t.push({ path: i, message: `未知对齐方式${s ? "(支持 auto)" : ""}` });
435
+ function M(e, i, t, s = !1) {
436
+ e !== void 0 && !Me.has(e) && !(s && e === "auto") && t.push({ path: i, message: `未知对齐方式${s ? "(支持 auto)" : ""}` });
278
437
  }
279
- function l(e, i, t) {
438
+ function $(e, i, t) {
280
439
  if (e !== void 0) {
281
- if (!d(e)) {
440
+ if (!u(e)) {
282
441
  t.push({ path: i, message: "样式应为对象" });
283
442
  return;
284
443
  }
285
- w(e.align, `${i}.align`, t), e.verticalAlign !== void 0 && !["top", "middle", "bottom"].includes(e.verticalAlign) && t.push({ path: `${i}.verticalAlign`, message: "未知垂直对齐方式" });
444
+ M(e.align, `${i}.align`, t), e.verticalAlign !== void 0 && !["top", "middle", "bottom"].includes(e.verticalAlign) && t.push({ path: `${i}.verticalAlign`, message: "未知垂直对齐方式" });
286
445
  for (const s of ["fontSize", "fontSizePx", "lineWidthPt", "lineHeight"]) c(e, s, i, t);
287
446
  for (const s of ["letterSpacing", "rotateDeg"]) c(e, s, i, t, -1 / 0);
288
447
  c(e, "opacity", i, t), typeof e.opacity == "number" && e.opacity > 1 && t.push({ path: `${i}.opacity`, message: "透明度不能大于 1" });
289
- for (const s of ["bold", "italic", "underline", "borderTop", "borderRight", "borderBottom", "borderLeft"]) $(e, s, i, t);
290
- for (const s of ["fontFamily", "color", "backgroundColor", "lineColor", "borderColor"]) u(e, s, i, t);
448
+ for (const s of ["bold", "italic", "underline", "borderTop", "borderRight", "borderBottom", "borderLeft"]) b(e, s, i, t);
449
+ for (const s of ["fontFamily", "color", "backgroundColor", "lineColor", "borderColor"]) m(e, s, i, t);
291
450
  }
292
451
  }
293
- function ce(e, i, t) {
452
+ function Se(e, i, t) {
294
453
  if (e === void 0) return;
295
454
  if (!Array.isArray(e)) {
296
455
  t.push({ path: i, message: "参数定义应为数组" });
@@ -299,149 +458,149 @@ function ce(e, i, t) {
299
458
  const s = /* @__PURE__ */ new Set(), n = t.length;
300
459
  e.forEach((a, o) => {
301
460
  const f = `${i}.${o}`;
302
- if (!d(a)) {
461
+ if (!u(a)) {
303
462
  t.push({ path: f, message: "参数定义应为对象" });
304
463
  return;
305
464
  }
306
- u(a, "field", f, t, !0), typeof a.field == "string" && (s.has(a.field) && t.push({ path: `${f}.field`, message: "参数名重复" }), s.add(a.field)), a.type !== void 0 && !["text", "number", "date", "month", "year", "dateRange", "select"].includes(a.type) && t.push({ path: `${f}.type`, message: "未知参数类型" });
307
- for (const r of ["label", "defaultValue", "placeholder"]) u(a, r, f, t);
308
- $(a, "required", f, t);
465
+ m(a, "field", f, t, !0), typeof a.field == "string" && (s.has(a.field) && t.push({ path: `${f}.field`, message: "参数名重复" }), s.add(a.field)), a.type !== void 0 && !["text", "number", "date", "month", "year", "dateRange", "select"].includes(a.type) && t.push({ path: `${f}.type`, message: "未知参数类型" });
466
+ for (const r of ["label", "defaultValue", "placeholder"]) m(a, r, f, t);
467
+ b(a, "required", f, t);
309
468
  for (const r of ["minLength", "maxLength"]) {
310
- const h = a[r];
311
- h !== void 0 && (typeof h != "number" || !Number.isSafeInteger(h) || h < 0) && t.push({ path: `${f}.${r}`, message: "长度边界应为非负整数" });
469
+ const d = a[r];
470
+ d !== void 0 && (typeof d != "number" || !Number.isSafeInteger(d) || d < 0) && t.push({ path: `${f}.${r}`, message: "长度边界应为非负整数" });
312
471
  }
313
- ge(a, f, t), a.options !== void 0 && (Array.isArray(a.options) ? a.options.forEach((r, h) => {
314
- const m = `${f}.options.${h}`;
315
- if (!d(r)) t.push({ path: m, message: "选项应为对象" });
472
+ xe(a, f, t), a.options !== void 0 && (Array.isArray(a.options) ? a.options.forEach((r, d) => {
473
+ const h = `${f}.options.${d}`;
474
+ if (!u(r)) t.push({ path: h, message: "选项应为对象" });
316
475
  else
317
- for (const g of ["label", "value"]) typeof r[g] != "string" && t.push({ path: `${m}.${g}`, message: "选项标签与值应为字符串(允许空白选项)" });
476
+ for (const g of ["label", "value"]) typeof r[g] != "string" && t.push({ path: `${h}.${g}`, message: "选项标签与值应为字符串(允许空白选项)" });
318
477
  }) : t.push({ path: `${f}.options`, message: "选项应为数组" }));
319
- }), t.length === n && t.push(...U(e).map((a) => ({ path: a.path.replace("$.paramDefs", i), message: a.message })));
478
+ }), t.length === n && t.push(...z(e).map((a) => ({ path: a.path.replace("$.paramDefs", i), message: a.message })));
320
479
  }
321
- function ge(e, i, t) {
480
+ function xe(e, i, t) {
322
481
  for (const a of ["min", "max"]) {
323
482
  const o = e[a];
324
483
  if (o === void 0) continue;
325
- W(e.type, o) || e.type === "number" && typeof o == "number" && Number.isFinite(o) || t.push({ path: `${i}.${a}`, message: "数字使用有限数字边界,日期/月/年使用对应规范字符串边界" });
484
+ q(e.type, o) || e.type === "number" && typeof o == "number" && Number.isFinite(o) || t.push({ path: `${i}.${a}`, message: "数字使用有限数字边界,日期/月/年使用对应规范字符串边界" });
326
485
  }
327
486
  const s = typeof e.min == "number" && typeof e.max == "number" && e.min > e.max, n = typeof e.min == "string" && typeof e.max == "string" && e.min > e.max;
328
487
  (s || n) && t.push({ path: i, message: "最小边界不能大于最大边界" }), typeof e.minLength == "number" && typeof e.maxLength == "number" && e.minLength > e.maxLength && t.push({ path: i, message: "最小长度不能大于最大长度" });
329
488
  }
330
- function C(e, i, t) {
489
+ function K(e, i, t) {
331
490
  if (!Array.isArray(e) || e.length === 0) {
332
491
  t.push({ path: i, message: "列表至少需要一列" });
333
492
  return;
334
493
  }
335
- e.every((s) => d(s) && s.hidden === !0) && t.push({ path: i, message: "列表至少需要一列可见列" }), e.forEach((s, n) => {
494
+ e.every((s) => u(s) && s.hidden === !0) && t.push({ path: i, message: "列表至少需要一列可见列" }), e.forEach((s, n) => {
336
495
  const a = `${i}.${n}`;
337
- if (!d(s)) {
496
+ if (!u(s)) {
338
497
  t.push({ path: a, message: "列应为对象" });
339
498
  return;
340
499
  }
341
- if (K(s, a, t), $(s, "hidden", a, t), v(s.visibleWhen, `${a}.visibleWhen`, t), typeof s.header != "string" && t.push({ path: `${a}.header`, message: "表头应为字符串(允许空白表头)" }), u(s, "field", a, t, !0), c(s, "widthMm", a, t, Number.MIN_VALUE, !0), l(s.style, `${a}.style`, t), l(s.headerStyle, `${a}.headerStyle`, t), w(s.align, `${a}.align`, t, !0), w(s.headerAlign, `${a}.headerAlign`, t), s.semanticRole !== void 0 && !["identifier", "dimension", "measure", "date", "text"].includes(s.semanticRole) && t.push({ path: `${a}.semanticRole`, message: "未知列语义" }), s.format !== void 0)
342
- if (!d(s.format) || !["number", "percent", "date"].includes(s.format.kind))
500
+ if (P(s, a, t), b(s, "hidden", a, t), O(s.visibleWhen, `${a}.visibleWhen`, t), typeof s.header != "string" && t.push({ path: `${a}.header`, message: "表头应为字符串(允许空白表头)" }), m(s, "field", a, t, !0), c(s, "widthMm", a, t, Number.MIN_VALUE, !0), $(s.style, `${a}.style`, t), $(s.headerStyle, `${a}.headerStyle`, t), M(s.align, `${a}.align`, t, !0), M(s.headerAlign, `${a}.headerAlign`, t), s.semanticRole !== void 0 && !["identifier", "dimension", "measure", "date", "text"].includes(s.semanticRole) && t.push({ path: `${a}.semanticRole`, message: "未知列语义" }), s.format !== void 0)
501
+ if (!u(s.format) || !["number", "percent", "date"].includes(s.format.kind))
343
502
  t.push({ path: `${a}.format`, message: "未知列格式" });
344
503
  else {
345
504
  const o = s.format.digits;
346
- o !== void 0 && (typeof o != "number" || !Number.isInteger(o) || o < 0 || o > 100) && t.push({ path: `${a}.format.digits`, message: "小数位应为 0–100 的整数" }), $(s.format, "thousands", `${a}.format`, t), u(s.format, "pattern", `${a}.format`, t);
505
+ o !== void 0 && (typeof o != "number" || !Number.isInteger(o) || o < 0 || o > 100) && t.push({ path: `${a}.format.digits`, message: "小数位应为 0–100 的整数" }), b(s.format, "thousands", `${a}.format`, t), m(s.format, "pattern", `${a}.format`, t);
347
506
  }
348
507
  s.rules !== void 0 && (Array.isArray(s.rules) ? s.rules.forEach((o, f) => {
349
508
  const r = `${a}.rules.${f}`;
350
- if (!d(o) || !d(o.when)) {
509
+ if (!u(o) || !u(o.when)) {
351
510
  t.push({ path: r, message: "条件格式缺少 when 对象" });
352
511
  return;
353
512
  }
354
- v(o.when, `${r}.when`, t), u(o.when, "field", `${r}.when`, t, !0), [">", ">=", "<", "<=", "==", "!="].includes(o.when.op) || t.push({ path: `${r}.when.op`, message: "未知条件运算符" }), typeof o.when.value != "number" && typeof o.when.value != "string" && t.push({ path: `${r}.when.value`, message: "条件值应为数字或字符串" }), l(o.style, `${r}.style`, t);
513
+ O(o.when, `${r}.when`, t), m(o.when, "field", `${r}.when`, t, !0), [">", ">=", "<", "<=", "==", "!="].includes(o.when.op) || t.push({ path: `${r}.when.op`, message: "未知条件运算符" }), typeof o.when.value != "number" && typeof o.when.value != "string" && t.push({ path: `${r}.when.value`, message: "条件值应为数字或字符串" }), $(o.style, `${r}.style`, t);
355
514
  }) : t.push({ path: `${a}.rules`, message: "条件格式应为数组" }));
356
515
  });
357
516
  }
358
517
  function V(e, i, t) {
359
518
  if (e !== void 0) {
360
- if (!d(e)) {
519
+ if (!u(e)) {
361
520
  t.push({ path: i, message: "分组应为对象" });
362
521
  return;
363
522
  }
364
- u(e, "field", i, t, !0);
365
- for (const s of ["headerTemplate", "subtotalLabel"]) u(e, s, i, t);
366
- for (const s of ["headerStyle", "subtotalStyle"]) l(e[s], `${i}.${s}`, t);
367
- $(e, "keepWithNext", i, t), $(e, "repeatHeader", i, t), I(e.aggregates, `${i}.aggregates`, t), e.subtotal !== void 0 && (!Array.isArray(e.subtotal) || e.subtotal.some((s) => typeof s != "string")) && t.push({ path: `${i}.subtotal`, message: "小计字段应为字符串数组" });
523
+ m(e, "field", i, t, !0);
524
+ for (const s of ["headerTemplate", "subtotalLabel"]) m(e, s, i, t);
525
+ for (const s of ["headerStyle", "subtotalStyle"]) $(e[s], `${i}.${s}`, t);
526
+ b(e, "keepWithNext", i, t), b(e, "repeatHeader", i, t), J(e.aggregates, `${i}.aggregates`, t), e.subtotal !== void 0 && (!Array.isArray(e.subtotal) || e.subtotal.some((s) => typeof s != "string")) && t.push({ path: `${i}.subtotal`, message: "小计字段应为字符串数组" });
368
527
  }
369
528
  }
370
- function pe(e, i, t) {
529
+ function Oe(e, i, t) {
371
530
  if (!(e === void 0 || typeof e == "boolean")) {
372
- if (!d(e)) {
531
+ if (!u(e)) {
373
532
  t.push({ path: i, message: "合计应为布尔值或对象" });
374
533
  return;
375
534
  }
376
- u(e, "label", i, t), I(e.aggregates, `${i}.aggregates`, t), l(e.style, `${i}.style`, t), e.fields !== void 0 && (!Array.isArray(e.fields) || e.fields.some((s) => typeof s != "string")) && t.push({ path: `${i}.fields`, message: "合计字段应为字符串数组" });
535
+ m(e, "label", i, t), J(e.aggregates, `${i}.aggregates`, t), $(e.style, `${i}.style`, t), e.fields !== void 0 && (!Array.isArray(e.fields) || e.fields.some((s) => typeof s != "string")) && t.push({ path: `${i}.fields`, message: "合计字段应为字符串数组" });
377
536
  }
378
537
  }
379
- function ye(e, i, t, s) {
538
+ function Re(e, i, t, s) {
380
539
  const n = { kind: "rect", leftMm: 0, topMm: 0, widthMm: 1, heightMm: 1, grid: e };
381
- if (L(n, t, s, []), F(n, t, s), !d(e) || !Array.isArray(e.cells)) return;
540
+ if (S(n, t, s, []), I(n, t, s), !u(e) || !Array.isArray(e.cells)) return;
382
541
  const a = e.cells, o = Array.isArray(i) ? i.length : 0;
383
542
  if (a.length * o > N) {
384
543
  s.push({ path: t, message: "表头逻辑网格超过 20 万格安全上限" });
385
544
  return;
386
545
  }
387
- e.cells.length || s.push({ path: `${t}.cells`, message: "表头至少需要一行" }), Array.isArray(e.colWidthsMm) && e.colWidthsMm.length !== o && s.push({ path: `${t}.colWidthsMm`, message: "表头列宽数量应与列表列数一致" }), Array.isArray(e.rowHeightsMm) && e.rowHeightsMm.length !== e.cells.length && s.push({ path: `${t}.rowHeightsMm`, message: "表头行高数量应与行数一致" }), le(a, o, t, s);
546
+ e.cells.length || s.push({ path: `${t}.cells`, message: "表头至少需要一行" }), Array.isArray(e.colWidthsMm) && e.colWidthsMm.length !== o && s.push({ path: `${t}.colWidthsMm`, message: "表头列宽数量应与列表列数一致" }), Array.isArray(e.rowHeightsMm) && e.rowHeightsMm.length !== e.cells.length && s.push({ path: `${t}.rowHeightsMm`, message: "表头行高数量应与行数一致" }), Fe(a, o, t, s);
388
547
  }
389
- function le(e, i, t, s) {
548
+ function Fe(e, i, t, s) {
390
549
  const n = /* @__PURE__ */ new Set();
391
550
  e.forEach((a, o) => {
392
551
  if (!Array.isArray(a)) return;
393
552
  let f = 0;
394
- a.forEach((r, h) => {
553
+ a.forEach((r, d) => {
395
554
  for (; n.has(`${o}:${f}`); ) f++;
396
- const m = d(r) && typeof r.colSpan == "number" ? r.colSpan : 1, g = d(r) && typeof r.rowSpan == "number" ? r.rowSpan : 1;
397
- (f + m > i || o + g > e.length) && s.push({ path: `${t}.cells.${o}.${h}`, message: "表头合并区域超出表头边界" });
398
- for (let p = o; p < Math.min(e.length, o + g); p++)
399
- for (let b = f; b < Math.min(i, f + m); b++)
400
- n.has(`${p}:${b}`) && s.push({ path: `${t}.cells.${o}.${h}`, message: "表头合并区域重叠" }), n.add(`${p}:${b}`);
401
- f += m;
555
+ const h = u(r) && typeof r.colSpan == "number" ? r.colSpan : 1, g = u(r) && typeof r.rowSpan == "number" ? r.rowSpan : 1;
556
+ (f + h > i || o + g > e.length) && s.push({ path: `${t}.cells.${o}.${d}`, message: "表头合并区域超出表头边界" });
557
+ for (let y = o; y < Math.min(e.length, o + g); y++)
558
+ for (let A = f; A < Math.min(i, f + h); A++)
559
+ n.has(`${y}:${A}`) && s.push({ path: `${t}.cells.${o}.${d}`, message: "表头合并区域重叠" }), n.add(`${y}:${A}`);
560
+ f += h;
402
561
  });
403
562
  });
404
563
  }
405
- function $e(e, i, t) {
406
- if (ae(e, i, t), se(e.computed, `${i}.computed`, t), ne(e.matrix, `${i}.matrix`, t), e.matrix && (e.detail || e.groupBy || Array.isArray(e.groups) && e.groups.length || e.grandTotal) && t.push({ path: `${i}.matrix`, message: "矩阵请使用自身 totals 汇总,不能同时配置普通分组、总计或主从明细" }), v(e.rowVisibleWhen, `${i}.rowVisibleWhen`, t), e.groups !== void 0 && (!Array.isArray(e.groups) || e.groups.length > 16 ? t.push({ path: `${i}.groups`, message: "分组应为数组,最多 16 级" }) : e.groups.forEach((a, o) => V(a, `${i}.groups.${o}`, t))), e.detail === void 0) return;
564
+ function Te(e, i, t) {
565
+ if (be(e, i, t), le(e.computed, `${i}.computed`, t), $e(e.matrix, `${i}.matrix`, t), e.matrix && (e.detail || e.groupBy || Array.isArray(e.groups) && e.groups.length || e.grandTotal) && t.push({ path: `${i}.matrix`, message: "矩阵请使用自身 totals 汇总,不能同时配置普通分组、总计或主从明细" }), O(e.rowVisibleWhen, `${i}.rowVisibleWhen`, t), e.groups !== void 0 && (!Array.isArray(e.groups) || e.groups.length > 16 ? t.push({ path: `${i}.groups`, message: "分组应为数组,最多 16 级" }) : e.groups.forEach((a, o) => V(a, `${i}.groups.${o}`, t))), e.detail === void 0) return;
407
566
  const s = e.detail, n = `${i}.detail`;
408
- if (!d(s)) {
567
+ if (!u(s)) {
409
568
  t.push({ path: n, message: "主从关联应为对象" });
410
569
  return;
411
570
  }
412
- for (const a of ["dataset", "parentKey", "foreignKey"]) u(s, a, n, t, !0);
413
- for (const a of ["rowKey", "revisionField", "sourceTokenField"]) u(s, a, n, t, s[a] !== void 0);
414
- u(s, "label", n, t), $(s, "header", n, t), c(s, "rowHeightMm", n, t, Number.MIN_VALUE), C(s.columns, `${n}.columns`, t), s.unmatched !== void 0 && s.unmatched !== "error" && s.unmatched !== "ignore" && t.push({ path: `${n}.unmatched`, message: "未关联明细策略应为 error 或 ignore" });
571
+ for (const a of ["dataset", "parentKey", "foreignKey"]) m(s, a, n, t, !0);
572
+ for (const a of ["rowKey", "revisionField", "sourceTokenField"]) m(s, a, n, t, s[a] !== void 0);
573
+ m(s, "label", n, t), b(s, "header", n, t), c(s, "rowHeightMm", n, t, Number.MIN_VALUE), K(s.columns, `${n}.columns`, t), s.unmatched !== void 0 && s.unmatched !== "error" && s.unmatched !== "ignore" && t.push({ path: `${n}.unmatched`, message: "未关联明细策略应为 error 或 ignore" });
415
574
  }
416
- function be(e, i, t) {
575
+ function Ie(e, i, t) {
417
576
  for (const s of ["leftMm", "topMm"]) c(e, s, i, t, -1 / 0, !0);
418
- c(e, "widthMm", i, t, Number.MIN_VALUE, !0), u(e, "dataset", i, t, !0), u(e, "title", i, t);
419
- for (const s of ["rowKey", "revisionField", "sourceTokenField"]) u(e, s, i, t, e[s] !== void 0);
420
- e.headerGrid !== void 0 && ye(e.headerGrid, e.columns, `${i}.headerGrid`, t), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && t.push({ path: `${i}.layout`, message: "布局应为 page 或 wide" }), C(e.columns, `${i}.columns`, t);
577
+ c(e, "widthMm", i, t, Number.MIN_VALUE, !0), m(e, "dataset", i, t, !0), m(e, "title", i, t);
578
+ for (const s of ["rowKey", "revisionField", "sourceTokenField"]) m(e, s, i, t, e[s] !== void 0);
579
+ e.headerGrid !== void 0 && Re(e.headerGrid, e.columns, `${i}.headerGrid`, t), e.layout !== void 0 && e.layout !== "page" && e.layout !== "wide" && t.push({ path: `${i}.layout`, message: "布局应为 page 或 wide" }), K(e.columns, `${i}.columns`, t);
421
580
  for (const s of ["fontSizePt", "rowHeightMm"]) c(e, s, i, t, Number.MIN_VALUE);
422
581
  c(e, "paddingMm", i, t);
423
- for (const s of ["header", "headerBold", "headerEveryPage", "border"]) $(e, s, i, t);
424
- e.cardinality !== void 0 && e.cardinality !== "record" && t.push({ path: `${i}.cardinality`, message: "单记录区域类型应为 record" }), u(e, "headerBackgroundColor", i, t), w(e.align, `${i}.align`, t, !0), w(e.headerAlign, `${i}.headerAlign`, t), l(e.headerStyle, `${i}.headerStyle`, t), $e(e, i, t), V(e.groupBy, `${i}.groupBy`, t), pe(e.grandTotal, `${i}.grandTotal`, t);
582
+ for (const s of ["header", "headerBold", "headerEveryPage", "border"]) b(e, s, i, t);
583
+ e.cardinality !== void 0 && e.cardinality !== "record" && t.push({ path: `${i}.cardinality`, message: "单记录区域类型应为 record" }), m(e, "headerBackgroundColor", i, t), M(e.align, `${i}.align`, t, !0), M(e.headerAlign, `${i}.headerAlign`, t), $(e.headerStyle, `${i}.headerStyle`, t), Te(e, i, t), V(e.groupBy, `${i}.groupBy`, t), Oe(e.grandTotal, `${i}.grandTotal`, t);
425
584
  }
426
- function F(e, i, t) {
427
- l(e.style, `${i}.style`, t);
428
- for (const n of ["text", "rawText", "imageData", "fallbackText", "nid", "rkey"]) u(e, n, i, t);
585
+ function I(e, i, t) {
586
+ $(e.style, `${i}.style`, t);
587
+ for (const n of ["text", "rawText", "imageData", "fallbackText", "nid", "rkey"]) m(e, n, i, t);
429
588
  if (e.lines !== void 0 && (!Array.isArray(e.lines) || e.lines.some((n) => typeof n != "string")) && t.push({ path: `${i}.lines`, message: "文本行应为字符串数组" }), Array.isArray(e.richParagraphs) && e.richParagraphs.forEach((n, a) => {
430
- if (!d(n)) return;
589
+ if (!u(n)) return;
431
590
  const o = `${i}.richParagraphs.${a}`;
432
- w(n.align, `${o}.align`, t);
591
+ M(n.align, `${o}.align`, t);
433
592
  for (const f of ["lineHeight", "spaceBeforeMm", "spaceAfterMm", "indentMm"]) c(n, f, o, t);
434
593
  Array.isArray(n.segments) && n.segments.forEach((f, r) => {
435
- const h = `${o}.segments.${r}`;
436
- if (!d(f)) {
437
- t.push({ path: h, message: "富文本片段应为对象" });
594
+ const d = `${o}.segments.${r}`;
595
+ if (!u(f)) {
596
+ t.push({ path: d, message: "富文本片段应为对象" });
438
597
  return;
439
598
  }
440
- f.kind !== void 0 && f.kind !== "text" && f.kind !== "field" && t.push({ path: `${h}.kind`, message: "未知富文本片段类型" });
441
- for (const m of ["text", "field"]) u(f, m, h, t);
442
- l(f.style, `${h}.style`, t);
599
+ f.kind !== void 0 && f.kind !== "text" && f.kind !== "field" && t.push({ path: `${d}.kind`, message: "未知富文本片段类型" });
600
+ for (const h of ["text", "field"]) m(f, h, d, t);
601
+ $(f.style, `${d}.style`, t);
443
602
  });
444
- }), !d(e.grid)) return;
603
+ }), !u(e.grid)) return;
445
604
  const s = e.grid;
446
605
  c(s, "gapMm", `${i}.grid`, t), c(s, "paddingMm", `${i}.grid`, t);
447
606
  for (const n of ["colWidthsMm", "rowHeightsMm"]) {
@@ -452,35 +611,35 @@ function F(e, i, t) {
452
611
  Array.isArray(n) && n.forEach((o, f) => {
453
612
  const r = `${i}.grid.cells.${a}.${f}`;
454
613
  if (o !== null) {
455
- if (!d(o)) {
614
+ if (!u(o)) {
456
615
  t.push({ path: r, message: "网格单元格应为对象或 null" });
457
616
  return;
458
617
  }
459
- for (const h of ["text", "rawText", "numberFormat"]) u(o, h, r, t);
460
- for (const h of ["colSpan", "rowSpan"]) {
461
- const m = o[h];
462
- m !== void 0 && (typeof m != "number" || !Number.isInteger(m) || m <= 0) && t.push({ path: `${r}.${h}`, message: "跨度应为正整数" });
618
+ for (const d of ["text", "rawText", "numberFormat"]) m(o, d, r, t);
619
+ for (const d of ["colSpan", "rowSpan"]) {
620
+ const h = o[d];
621
+ h !== void 0 && (typeof h != "number" || !Number.isInteger(h) || h <= 0) && t.push({ path: `${r}.${d}`, message: "跨度应为正整数" });
463
622
  }
464
- o.value !== void 0 && o.value !== null && !["string", "number", "boolean"].includes(typeof o.value) && t.push({ path: `${r}.value`, message: "Excel 原始值应为字符串、数字、布尔值或 null" }), l(o.style, `${r}.style`, t), o.children !== void 0 && (Array.isArray(o.children) ? o.children.forEach((h, m) => {
465
- d(h) && F(h, `${r}.children.${m}`, t);
623
+ o.value !== void 0 && o.value !== null && !["string", "number", "boolean"].includes(typeof o.value) && t.push({ path: `${r}.value`, message: "Excel 原始值应为字符串、数字、布尔值或 null" }), $(o.style, `${r}.style`, t), o.children !== void 0 && (Array.isArray(o.children) ? o.children.forEach((d, h) => {
624
+ u(d) && I(d, `${r}.children.${h}`, t);
466
625
  }) : t.push({ path: `${r}.children`, message: "嵌套组件应为数组" }));
467
626
  }
468
627
  });
469
628
  });
470
629
  }
471
- function Ae(e, i, t) {
630
+ function Pe(e, i, t) {
472
631
  if (!(e.flow === void 0 || !Array.isArray(e.components)))
473
632
  try {
474
- Y(e.components, e.flow);
633
+ he(e.components, e.flow);
475
634
  } catch (s) {
476
635
  t.push({ path: `${i}.flow`, message: s instanceof Error ? s.message : String(s) });
477
636
  }
478
637
  }
479
- function we(e) {
638
+ function _e(e) {
480
639
  const i = [], t = [];
481
- return R(e, i), i.length ? { ok: !1, errors: i, warnings: t } : (d(e) ? (e.schemaVersion !== void 0 && e.schemaVersion !== H && i.push({ path: "$.schemaVersion", message: "不支持的模板 schemaVersion" }), ce(e.params, "$.params", i), ie(e, i), !Array.isArray(e.pages) || e.pages.length === 0 ? i.push({ path: "$.pages", message: "模板至少需要一页" }) : e.pages.forEach((s, n) => {
640
+ return T(e, i), i.length ? { ok: !1, errors: i, warnings: t } : (u(e) ? (e.schemaVersion !== void 0 && e.schemaVersion !== U && i.push({ path: "$.schemaVersion", message: "不支持的模板 schemaVersion" }), Se(e.params, "$.params", i), ye(e, i), !Array.isArray(e.pages) || e.pages.length === 0 ? i.push({ path: "$.pages", message: "模板至少需要一页" }) : e.pages.forEach((s, n) => {
482
641
  const a = `$.pages.${n}`;
483
- if (!d(s)) {
642
+ if (!u(s)) {
484
643
  i.push({ path: a, message: "页应为对象" });
485
644
  return;
486
645
  }
@@ -488,67 +647,67 @@ function we(e) {
488
647
  for (const o of ["marginTopMm", "marginBottomMm", "marginLeftMm", "marginRightMm"]) c(s, o, a, i);
489
648
  typeof s.widthMm == "number" && Number(s.marginLeftMm ?? 0) + Number(s.marginRightMm ?? 0) >= s.widthMm && i.push({ path: a, message: "横向页边距占满页面" }), typeof s.heightMm == "number" && Number(s.marginTopMm ?? 0) + Number(s.marginBottomMm ?? 0) >= s.heightMm && i.push({ path: a, message: "纵向页边距占满页面" }), Array.isArray(s.components) ? s.components.forEach((o, f) => {
490
649
  const r = `${a}.components.${f}`;
491
- d(o) && o.kind === "list" ? be(o, r, i) : (L(o, r, i, t), d(o) && F(o, r, i));
492
- }) : i.push({ path: `${a}.components`, message: "组件应为数组" }), Ae(s, a, i);
650
+ u(o) && o.kind === "list" ? Ie(o, r, i) : (S(o, r, i, t), u(o) && I(o, r, i));
651
+ }) : i.push({ path: `${a}.components`, message: "组件应为数组" }), Pe(s, a, i);
493
652
  })) : i.push({ path: "$", message: "模板应为对象" }), { ok: i.length === 0, errors: i, warnings: t });
494
653
  }
495
- function Me(e) {
654
+ function Le(e) {
496
655
  const i = [], t = [];
497
- if (R(e, i), i.length) return { ok: !1, errors: i, warnings: t };
498
- if (!d(e)) i.push({ path: "$", message: "模板文档应为对象" });
656
+ if (T(e, i), i.length) return { ok: !1, errors: i, warnings: t };
657
+ if (!u(e)) i.push({ path: "$", message: "模板文档应为对象" });
499
658
  else {
500
659
  for (const n of Object.keys(e))
501
- fe.has(n) || i.push({ path: `$.${n}`, message: "模板文档存在未知字段;只保存模板与描述,不保存取数或业务数据" });
502
- e.schemaVersion !== P && i.push({ path: "$.schemaVersion", message: "不支持的模板文档版本" });
503
- for (const n of ["id", "name"]) u(e, n, "$", i, !0);
504
- for (const n of ["revision", "description"]) u(e, n, "$", i);
505
- const s = we(e.template);
660
+ we.has(n) || i.push({ path: `$.${n}`, message: "模板文档存在未知字段;只保存模板与描述,不保存取数或业务数据" });
661
+ e.schemaVersion !== D && i.push({ path: "$.schemaVersion", message: "不支持的模板文档版本" });
662
+ for (const n of ["id", "name"]) m(e, n, "$", i, !0);
663
+ for (const n of ["revision", "description"]) m(e, n, "$", i);
664
+ const s = _e(e.template);
506
665
  i.push(...s.errors.map((n) => ({ ...n, path: `$.template${n.path.slice(1)}` }))), t.push(...s.warnings.map((n) => ({ ...n, path: `$.template${n.path.slice(1)}` })));
507
666
  }
508
667
  return { ok: i.length === 0, errors: i, warnings: t };
509
668
  }
510
- function k(e) {
511
- const i = Me(e);
512
- if (!i.ok) throw new A(i.errors);
669
+ function x(e) {
670
+ const i = Le(e);
671
+ if (!i.ok) throw new w(i.errors);
513
672
  }
514
- function Re(e) {
673
+ function Ge(e) {
515
674
  const i = [];
516
- if (R(e, i), i.length) throw new A(i);
517
- const t = { ...e, schemaVersion: e.schemaVersion ?? P };
518
- return k(t), S(t);
675
+ if (T(e, i), i.length) throw new w(i);
676
+ const t = { ...e, schemaVersion: e.schemaVersion ?? D };
677
+ return x(t), k(t);
519
678
  }
520
- function Fe(e) {
679
+ function Ue(e) {
521
680
  let i = e;
522
681
  if (typeof e == "string") {
523
- if (e.length > O)
524
- throw new A([{ path: "$", message: "模板 JSON 超过 1000 万字符的导出/导入上限" }]);
682
+ if (e.length > F)
683
+ throw new w([{ path: "$", message: "模板 JSON 超过 1000 万字符的导出/导入上限" }]);
525
684
  try {
526
685
  i = JSON.parse(e);
527
686
  } catch {
528
- throw new A([{ path: "$", message: "模板 JSON 语法无效" }]);
687
+ throw new w([{ path: "$", message: "模板 JSON 语法无效" }]);
529
688
  }
530
689
  }
531
- return k(i), S(i);
690
+ return x(i), k(i);
532
691
  }
533
- function Le(e) {
534
- k(e);
692
+ function Be(e) {
693
+ x(e);
535
694
  const i = JSON.stringify(e, null, 2);
536
- if (i.length > O) throw new A([{ path: "$", message: "模板 JSON 超过 1000 万字符的导出/导入上限" }]);
695
+ if (i.length > F) throw new w([{ path: "$", message: "模板 JSON 超过 1000 万字符的导出/导入上限" }]);
537
696
  return i;
538
697
  }
539
- function S(e) {
698
+ function k(e) {
540
699
  return JSON.parse(JSON.stringify(e));
541
700
  }
542
- function _e(e = []) {
701
+ function ze(e = []) {
543
702
  const i = /* @__PURE__ */ new Map(), t = {
544
703
  get: (s) => {
545
704
  const n = i.get(s);
546
- return n ? S(n) : void 0;
705
+ return n ? k(n) : void 0;
547
706
  },
548
707
  list: () => Array.from(i.values(), ({ template: s, ...n }) => ({ ...n })),
549
708
  register: (s, n = {}) => {
550
- if (k(s), i.has(s.id) && !n.replace) throw new A([{ path: "$.id", message: `模板 ID ${s.id} 已注册;更新需显式 replace:true` }]);
551
- i.set(s.id, S(s));
709
+ if (x(s), i.has(s.id) && !n.replace) throw new w([{ path: "$.id", message: `模板 ID ${s.id} 已注册;更新需显式 replace:true` }]);
710
+ i.set(s.id, k(s));
552
711
  },
553
712
  remove: (s) => i.delete(s)
554
713
  };
@@ -556,15 +715,19 @@ function _e(e = []) {
556
715
  return t;
557
716
  }
558
717
  export {
559
- A as R,
560
- P as a,
561
- Me as b,
562
- _e as c,
563
- Re as d,
564
- Y as e,
565
- ie as f,
566
- Fe as p,
567
- Oe as r,
568
- Le as s,
569
- we as v
718
+ w as R,
719
+ fe as a,
720
+ D as b,
721
+ He as c,
722
+ ze as d,
723
+ Ge as e,
724
+ S as f,
725
+ oe as g,
726
+ Le as h,
727
+ he as i,
728
+ ye as j,
729
+ Ue as p,
730
+ We as r,
731
+ Be as s,
732
+ _e as v
570
733
  };