@agile-team/mach-report 2.25.0 → 2.25.1

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 (77) hide show
  1. package/README.md +4 -2
  2. package/dist/{ExcelBindingWizard-NQ_v396s.js → ExcelBindingWizard-bs3F4dD8.js} +3 -3
  3. package/dist/{ExcelBindingWizard-BgJG-T6k.cjs → ExcelBindingWizard-jSdjBtWw.cjs} +1 -1
  4. package/dist/{ParamEditor-Z-3yodp5.js → ParamEditor-B7YVD28E.js} +1 -1
  5. package/dist/{ParamEditor-DEP38mBp.cjs → ParamEditor-CGfaweYX.cjs} +1 -1
  6. package/dist/{ReportBatchPanel-D33LjMrA.cjs → ReportBatchPanel-BRJt0TXp.cjs} +1 -1
  7. package/dist/{ReportBatchPanel-DG8FV-5X.js → ReportBatchPanel-BTKHtLTW.js} +1 -1
  8. package/dist/{ReportLabelStudio-Bz-xAayk.cjs → ReportLabelStudio-BvK_WBke.cjs} +1 -1
  9. package/dist/{ReportLabelStudio-BZp23_hA.js → ReportLabelStudio-CZwqyO3t.js} +2 -2
  10. package/dist/{ReportPreview-CilFAS9U.js → ReportPreview-CnxaDTCO.js} +4 -4
  11. package/dist/{ReportPreview-dOOzPts2.cjs → ReportPreview-DqFBcsJQ.cjs} +2 -2
  12. package/dist/{ReportTemplateLibrary-DpSGgvFa.js → ReportTemplateLibrary-C7sB0Jay.js} +1 -1
  13. package/dist/{ReportTemplateLibrary-uG1gENaW.cjs → ReportTemplateLibrary-ClwxhnC0.cjs} +1 -1
  14. package/dist/{RuleEditor-BONALh1Q.js → RuleEditor-CsDGFaWz.js} +3 -3
  15. package/dist/{RuleEditor-bLXiRcxL.cjs → RuleEditor-D-OdaGdR.cjs} +1 -1
  16. package/dist/{TemplateOutlinePanel-JGBKeF3e.js → TemplateOutlinePanel-CXOT7d1r.js} +1 -1
  17. package/dist/{TemplateOutlinePanel-C3nfHuaR.cjs → TemplateOutlinePanel-DAqR9zQi.cjs} +1 -1
  18. package/dist/{TemplateReusePanel-DXQUO6nQ.js → TemplateReusePanel-Dcfx3Hba.js} +2 -2
  19. package/dist/{TemplateReusePanel-BKhgp6kg.cjs → TemplateReusePanel-ygIi-Ajz.cjs} +1 -1
  20. package/dist/{TemplateReviewPanel-DhL7Hapy.js → TemplateReviewPanel-COU8FqPq.js} +1 -1
  21. package/dist/{TemplateReviewPanel-5RWFUUEf.cjs → TemplateReviewPanel-DyGULVxr.cjs} +1 -1
  22. package/dist/analytics.cjs +1 -1
  23. package/dist/analytics.js +2 -2
  24. package/dist/artifact-integrity.json +71 -71
  25. package/dist/{auto-umW_ozwr.js → auto-D7x7QsWD.js} +4 -4
  26. package/dist/{auto-D-eDZa_V.cjs → auto-mPK9W0y5.cjs} +1 -1
  27. package/dist/{designer-CCyj5WYS.js → designer-B597ZdC0.js} +4 -4
  28. package/dist/{designer-Cj7fn4Hh.cjs → designer-DFIdv_n7.cjs} +1 -1
  29. package/dist/designer.cjs +1 -1
  30. package/dist/designer.js +1 -1
  31. package/dist/{encoding-CEkBtlUP.js → encoding-Amq3XrtU.js} +2 -2
  32. package/dist/{encoding-Cipno7dq.cjs → encoding-DRVXs5xm.cjs} +1 -1
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.js +8 -8
  35. package/dist/{json-snapshot-x0JpllWL.js → json-snapshot-CBVWZvyC.js} +661 -614
  36. package/dist/json-snapshot-DCFEtfFw.cjs +2 -0
  37. package/dist/matrix-DUYPRL7t.cjs +1 -0
  38. package/dist/{matrix-C6e_r_vp.js → matrix-b6T291xo.js} +120 -104
  39. package/dist/{plugin-CttO46hc.js → plugin-BdCplNe1.js} +1 -1
  40. package/dist/{plugin-B_k23hut.cjs → plugin-DHe8y5pD.cjs} +1 -1
  41. package/dist/{prefill-BkF9Fw_p.js → prefill-Buy4NJ15.js} +1 -1
  42. package/dist/{prefill-BvkuwooY.cjs → prefill-Cw4ZYGXZ.cjs} +1 -1
  43. package/dist/{prepared-CSywIEAZ.cjs → prepared-BlNeOjoO.cjs} +1 -1
  44. package/dist/{prepared-Cyuh61fJ.js → prepared-CBJ7BkK0.js} +1 -1
  45. package/dist/{protocol-BwbJNVZl.cjs → protocol-BU_4sXP0.cjs} +1 -1
  46. package/dist/{protocol-DwtxjXzO.js → protocol-CB19KXGr.js} +2 -2
  47. package/dist/{region-binding-workflow-D8I4QWRh.js → region-binding-workflow-EYxvUYJ-.js} +1 -1
  48. package/dist/{region-binding-workflow-COD8nISZ.cjs → region-binding-workflow-NdkMSFCh.cjs} +1 -1
  49. package/dist/report-encoding-worker.cjs +1 -1
  50. package/dist/report-encoding-worker.js +1 -1
  51. package/dist/{runtime-BE30icyB.js → runtime-B5d_lQNQ.js} +3 -3
  52. package/dist/{runtime-DRSuy_SQ.cjs → runtime-BRx8Agqr.cjs} +1 -1
  53. package/dist/sbom.cdx.json +1 -1
  54. package/dist/server-node.cjs +5 -5
  55. package/dist/server-node.js +1686 -1622
  56. package/dist/server.cjs +1 -1
  57. package/dist/server.js +6 -6
  58. package/dist/{template-catalog-D_gl93va.js → template-catalog-CM6U_RlD.js} +2 -2
  59. package/dist/{template-catalog-C0riwrx7.cjs → template-catalog-Cj66M84u.cjs} +1 -1
  60. package/dist/{template-fragments-D94ZZmPc.js → template-fragments-BDxdCuMD.js} +1 -1
  61. package/dist/{template-fragments-CgzPdFKB.cjs → template-fragments-DbKdxI1z.cjs} +1 -1
  62. package/dist/template-registry-B-AK1oam.cjs +1 -0
  63. package/dist/{template-registry-DZOtRY7t.js → template-registry-DeVgwEZj.js} +143 -142
  64. package/dist/vue-async.cjs +1 -1
  65. package/dist/vue-async.js +3 -3
  66. package/dist/vue.cjs +1 -1
  67. package/dist/vue.js +4 -4
  68. package/dist/{workbook-session-SzfILBJJ.js → workbook-session-B6hRjTyX.js} +1 -1
  69. package/dist/{workbook-session-DR2j6Hxm.cjs → workbook-session-BclW7KKH.cjs} +1 -1
  70. package/dist/worker.cjs +1 -1
  71. package/dist/worker.js +4 -4
  72. package/dist/xlsx.cjs +1 -1
  73. package/dist/xlsx.js +3 -3
  74. package/package.json +1 -1
  75. package/dist/json-snapshot-DQdkA_At.cjs +0 -2
  76. package/dist/matrix-B8QWbsGM.cjs +0 -1
  77. package/dist/template-registry-BMScUmM4.cjs +0 -1
@@ -1,26 +1,26 @@
1
- import { l as Z, n as ee, v as te, c as ie } from "./computed-f3pOqWLX.js";
2
- import { v as se } from "./matrix-C6e_r_vp.js";
3
- import { J as K, E as ne, K as ae, R as oe } from "./diagnostic-collector-gB07PHy2.js";
4
- import { c as fe } from "./code-options-BKXXY7NI.js";
5
- import { v as re, m as de } from "./param-validation-CnDEd2l-.js";
6
- import { a as he, d as ce, b as ue, M as V, v as me, s as ge } from "./template-serialization-CWmHq7lX.js";
7
- function pe(e, i, t) {
1
+ import { l as ee, n as te, v as ie, c as se } from "./computed-f3pOqWLX.js";
2
+ import { v as ne } from "./matrix-b6T291xo.js";
3
+ import { J as D, E as ae, K as oe, R as fe } from "./diagnostic-collector-gB07PHy2.js";
4
+ import { c as re } from "./code-options-BKXXY7NI.js";
5
+ import { v as de, m as he } from "./param-validation-CnDEd2l-.js";
6
+ import { a as ue, d as ce, b as me, M as K, v as ge, s as pe } from "./template-serialization-CWmHq7lX.js";
7
+ function ye(e, i, t) {
8
8
  e !== void 0 && (typeof e != "string" || !e.trim() || e.length > 4096) && t.push({ path: i, message: "来源范围应为不超过 4096 字符的非空字符串" });
9
9
  }
10
- function H(e, i, t) {
10
+ function V(e, i, t) {
11
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
12
  }
13
- function ye(e, i, t) {
14
- H(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: "派生结果标记应为布尔值" }), J(e.source, `${i}.source`, t, !0), e.formula !== void 0 && typeof e.formula != "string" && t.push({ path: `${i}.formula`, message: "单元格公式应为字符串" });
13
+ function le(e, i, t) {
14
+ V(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: "派生结果标记应为布尔值" }), H(e.source, `${i}.source`, t, !0), e.formula !== void 0 && typeof e.formula != "string" && t.push({ path: `${i}.formula`, message: "单元格公式应为字符串" });
15
15
  }
16
- function J(e, i, t, s = !1) {
16
+ function H(e, i, t, s = !1) {
17
17
  if (e === void 0) return;
18
18
  if (!e || typeof e != "object" || Array.isArray(e)) {
19
19
  t.push({ path: i, message: "业务来源应为对象" });
20
20
  return;
21
21
  }
22
22
  const n = e;
23
- pe(n.sourceScope, `${i}.sourceScope`, t);
23
+ ye(n.sourceScope, `${i}.sourceScope`, t);
24
24
  for (const a of ["datasetId", ...s ? ["field"] : []])
25
25
  (typeof n[a] != "string" || !n[a].trim()) && t.push({ path: `${i}.${a}`, message: "业务标识应为非空字符串" });
26
26
  for (const a of ["rowKey", "revision"]) {
@@ -29,7 +29,7 @@ function J(e, i, t, s = !1) {
29
29
  }
30
30
  n.sourceToken !== void 0 && typeof n.sourceToken != "string" && t.push({ path: `${i}.sourceToken`, message: "来源令牌应为字符串" });
31
31
  }
32
- const le = /* @__PURE__ */ new Set([
32
+ const $e = /* @__PURE__ */ new Set([
33
33
  "text",
34
34
  "image",
35
35
  "barcode",
@@ -45,16 +45,16 @@ function p(e) {
45
45
  function v(e) {
46
46
  return e === null ? "null" : typeof e == "string" ? JSON.stringify(e.slice(0, 120)) : ["number", "boolean", "undefined"].includes(typeof e) ? String(e) : `[${typeof e}]`;
47
47
  }
48
- function $e(e, i, t, s) {
48
+ function be(e, i, t, s) {
49
49
  const n = e[i];
50
50
  (typeof n != "number" || !Number.isFinite(n)) && s.push({ path: `${t}.${i}`, message: `应为有限数字,实际 ${v(n)}` });
51
51
  }
52
- function be(e, i, t) {
52
+ function Ae(e, i, t) {
53
53
  if (e !== void 0) {
54
54
  const s = `${i}.table`;
55
55
  if (!p(e)) t.push({ path: s, message: "逻辑表来源应为对象" });
56
56
  else {
57
- J(e.source, `${s}.source`, t), (typeof e.id != "string" || !e.id.trim()) && t.push({ path: `${s}.id`, message: "逻辑表 ID 应为非空字符串" });
57
+ H(e.source, `${s}.source`, t), (typeof e.id != "string" || !e.id.trim()) && t.push({ path: `${s}.id`, message: "逻辑表 ID 应为非空字符串" });
58
58
  const n = e.role;
59
59
  ["header", "body", "group-header", "subtotal", "grand-total"].includes(n) || t.push({ path: `${s}.role`, message: "未知逻辑表行角色" });
60
60
  const a = e.rowIndex;
@@ -62,7 +62,7 @@ function be(e, i, t) {
62
62
  }
63
63
  }
64
64
  }
65
- function Ae(e, i, t, s) {
65
+ function we(e, i, t, s) {
66
66
  if (e !== void 0)
67
67
  if (!p(e) || !Array.isArray(e.cells))
68
68
  t.push({ path: `${i}.grid.cells`, message: "grid.cells 应为二维数组" });
@@ -80,7 +80,7 @@ function Ae(e, i, t, s) {
80
80
  t.push({ path: d, message: "网格单元格应为对象或 null" });
81
81
  return;
82
82
  }
83
- ye(f, d, t), f.dataBar !== void 0 && !ne(f.dataBar) && t.push({ path: `${d}.dataBar`, message: "数据条应包含 0–1 有序比例与 #RRGGBB 颜色" }), W(f.richParagraphs, d, t), Array.isArray(f.children) && f.children.forEach((h, m) => {
83
+ le(f, d, t), f.dataBar !== void 0 && !ae(f.dataBar) && t.push({ path: `${d}.dataBar`, message: "数据条应包含 0–1 有序比例与 #RRGGBB 颜色" }), J(f.richParagraphs, d, t), Array.isArray(f.children) && f.children.forEach((h, m) => {
84
84
  O(h, `${i}.grid.cells.${o}.${r}.children.${m}`, t, s);
85
85
  });
86
86
  });
@@ -96,7 +96,7 @@ function F(e, i, t, s, n = 0) {
96
96
  o !== void 0 && (typeof o != "number" || !Number.isFinite(o) || o < n) && s.push({ path: `${t}.${a}`, message: "富文本数值应为范围内有限数字" });
97
97
  }
98
98
  }
99
- function we(e, i, t) {
99
+ function Me(e, i, t) {
100
100
  if (e !== void 0) {
101
101
  if (!p(e)) {
102
102
  t.push({ path: i, message: "富文本样式应为对象" });
@@ -109,7 +109,7 @@ function we(e, i, t) {
109
109
  F(e, ["fontSize", "fontSizePx", "lineWidthPt", "lineHeight", "opacity"], i, t), F(e, ["letterSpacing", "rotateDeg"], i, t, -1 / 0), typeof e.opacity == "number" && e.opacity > 1 && t.push({ path: `${i}.opacity`, message: "透明度不能大于1" }), N(e.align, ["left", "center", "right", "justify"], `${i}.align`, t), N(e.verticalAlign, ["top", "middle", "bottom"], `${i}.verticalAlign`, t);
110
110
  }
111
111
  }
112
- function Me(e, i, t) {
112
+ function ke(e, i, t) {
113
113
  if (!p(e)) {
114
114
  t.push({ path: i, message: "富文本片段应为对象" });
115
115
  return;
@@ -117,9 +117,9 @@ function Me(e, i, t) {
117
117
  N(e.kind, ["text", "field"], `${i}.kind`, t);
118
118
  for (const s of ["text", "field"])
119
119
  e[s] !== void 0 && typeof e[s] != "string" && t.push({ path: `${i}.${s}`, message: "富文本内容应为字符串" });
120
- we(e.style, `${i}.style`, t);
120
+ Me(e.style, `${i}.style`, t);
121
121
  }
122
- function W(e, i, t) {
122
+ function J(e, i, t) {
123
123
  if (e !== void 0) {
124
124
  if (!Array.isArray(e)) {
125
125
  t.push({ path: `${i}.richParagraphs`, message: "richParagraphs 应为数组" });
@@ -131,12 +131,12 @@ function W(e, i, t) {
131
131
  t.push({ path: a, message: "段落缺少 segments 数组" });
132
132
  return;
133
133
  }
134
- N(s.align, ["left", "center", "right", "justify"], `${a}.align`, t), F(s, ["lineHeight", "spaceBeforeMm", "spaceAfterMm", "indentMm"], a, t), s.segments.forEach((o, f) => Me(o, `${a}.segments.${f}`, t));
134
+ N(s.align, ["left", "center", "right", "justify"], `${a}.align`, t), F(s, ["lineHeight", "spaceBeforeMm", "spaceAfterMm", "indentMm"], a, t), s.segments.forEach((o, f) => ke(o, `${a}.segments.${f}`, t));
135
135
  });
136
136
  }
137
137
  }
138
- function G(e, i, t, s = []) {
139
- const n = K([e], i);
138
+ function W(e, i, t, s = []) {
139
+ const n = D([e], i);
140
140
  if (n) {
141
141
  t.push(n);
142
142
  return;
@@ -149,41 +149,41 @@ function O(e, i, t, s = []) {
149
149
  return;
150
150
  }
151
151
  const n = e.kind;
152
- typeof n != "string" ? t.push({ path: `${i}.kind`, message: "组件缺少 kind 字符串" }) : le.has(n) || s.push({
152
+ typeof n != "string" ? t.push({ path: `${i}.kind`, message: "组件缺少 kind 字符串" }) : $e.has(n) || s.push({
153
153
  path: `${i}.kind`,
154
154
  message: `未知组件类型 ${v(n)},将以兜底方式渲染`
155
155
  });
156
156
  for (const a of ["leftMm", "topMm", "widthMm", "heightMm"])
157
- $e(e, a, i, t);
157
+ be(e, a, i, t);
158
158
  typeof e.leftMm == "number" && e.leftMm < -100 && t.push({ path: `${i}.leftMm`, message: "几何数值异常(leftMm<-100)" });
159
159
  for (const a of ["widthMm", "heightMm"])
160
160
  typeof e[a] == "number" && e[a] < 0 && t.push({ path: `${i}.${a}`, message: "组件尺寸不能为负数" });
161
- be(e.table, i, t), Ee(e.code, n, i, t), ke(e, 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" }), Ae(e.grid, i, t, s), W(e.richParagraphs, i, t);
161
+ Ae(e.table, i, t), Se(e.code, n, i, t), Ee(e, 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" }), we(e.grid, i, t, s), J(e.richParagraphs, i, t);
162
162
  }
163
- function ke(e, i, t) {
163
+ function Ee(e, i, t) {
164
164
  if (e.chartBinding !== void 0)
165
165
  try {
166
- if (Z(e.chartBinding), e.kind !== "chart" || ["binding", "imageData", "grid", "pageAnchor"].some((s) => e[s] !== void 0)) throw new Error("绑定图表不能设置图片、网格、记录绑定或页眉页脚");
166
+ if (ee(e.chartBinding), e.kind !== "chart" || ["binding", "imageData", "grid", "pageAnchor"].some((s) => e[s] !== void 0)) throw new Error("绑定图表不能设置图片、网格、记录绑定或页眉页脚");
167
167
  if (typeof e.widthMm != "number" || e.widthMm < 45 || typeof e.heightMm != "number" || e.heightMm < 35) throw new Error("绑定图表至少需要 45×35mm");
168
168
  } catch (s) {
169
169
  t.push({ path: `${i}.chartBinding`, message: s instanceof Error ? s.message : String(s) });
170
170
  }
171
171
  }
172
- function Ee(e, i, t, s) {
172
+ function Se(e, i, t, s) {
173
173
  if (e !== void 0)
174
- for (const n of fe(e, i)) s.push({ path: `${t}.code${n.path ? `.${n.path}` : ""}`, message: n.message });
174
+ for (const n of re(e, i)) s.push({ path: `${t}.code${n.path ? `.${n.path}` : ""}`, message: n.message });
175
175
  }
176
- function U(e, i, t) {
176
+ function G(e, i, t) {
177
177
  if (!p(e)) return;
178
178
  e.binding !== void 0 && t.push({ path: `${i}.binding`, message: "渲染计划不允许未解析字段绑定" }), e.chartBinding !== void 0 && t.push({ path: `${i}.chartBinding`, message: "渲染计划不允许未解析图表绑定" });
179
179
  const s = e.grid;
180
180
  !p(s) || !Array.isArray(s.cells) || s.cells.forEach((n, a) => {
181
181
  Array.isArray(n) && n.forEach((o, f) => {
182
- !p(o) || !Array.isArray(o.children) || o.children.forEach((r, d) => U(r, `${i}.grid.cells.${a}.${f}.children.${d}`, t));
182
+ !p(o) || !Array.isArray(o.children) || o.children.forEach((r, d) => G(r, `${i}.grid.cells.${a}.${f}.children.${d}`, t));
183
183
  });
184
184
  });
185
185
  }
186
- function Se(e, i, t, s = []) {
186
+ function ve(e, i, t, s = []) {
187
187
  if (!p(e)) {
188
188
  t.push({ path: i, message: "页应为对象" });
189
189
  return;
@@ -194,17 +194,17 @@ function Se(e, i, t, s = []) {
194
194
  if (!Array.isArray(o))
195
195
  t.push({ path: `${i}.components`, message: "components 应为数组" });
196
196
  else if (Array.isArray(o)) {
197
- const f = K(o, `${i}.components`);
197
+ const f = D(o, `${i}.components`);
198
198
  if (f) {
199
199
  t.push(f);
200
200
  return;
201
201
  }
202
202
  o.forEach((r, d) => {
203
- O(r, `${i}.components.${d}`, t, s), U(r, `${i}.components.${d}`, t);
203
+ O(r, `${i}.components.${d}`, t, s), G(r, `${i}.components.${d}`, t);
204
204
  });
205
205
  }
206
206
  }
207
- function ve(e) {
207
+ function Ne(e) {
208
208
  const i = [], t = [], s = p(e) ? e.pages : void 0;
209
209
  if (p(e) && e.requiresRecalculation !== void 0 && typeof e.requiresRecalculation != "boolean" && i.push({ path: "$.requiresRecalculation", message: "重算能力要求应为布尔值" }), !Array.isArray(s))
210
210
  i.push({
@@ -212,9 +212,9 @@ function ve(e) {
212
212
  message: e == null ? "渲染计划为空" : "渲染计划缺少 pages 数组"
213
213
  });
214
214
  else {
215
- const n = ae(s);
215
+ const n = oe(s);
216
216
  if (n) return { ok: !1, errors: [...i, n], warnings: t };
217
- s.forEach((o, f) => Se(o, `$.pages.${f}`, i, t)), s.length > 2e3 && t.push({
217
+ s.forEach((o, f) => ve(o, `$.pages.${f}`, i, t)), s.length > 2e3 && t.push({
218
218
  path: "$.pages",
219
219
  message: `页数异常大(${s.length} 页),渲染与打印耗时可能显著增加`
220
220
  });
@@ -230,30 +230,29 @@ function ve(e) {
230
230
  return { ok: i.length === 0, errors: i, warnings: t };
231
231
  }
232
232
  function mt(e) {
233
- const i = ve(e);
233
+ const i = Ne(e);
234
234
  if (!i.ok) {
235
235
  const t = i.errors.slice(0, 3).map((s) => `${s.path}: ${s.message}`).join("; ");
236
236
  throw new Error(`渲染计划校验失败(${i.errors.length} 处): ${t}`);
237
237
  }
238
238
  return e.pages;
239
239
  }
240
- function _(e) {
240
+ function U(e) {
241
241
  return e.kind === "list" ? e.id : e.nid;
242
242
  }
243
- function Ne(e) {
243
+ function z(e) {
244
244
  return e.kind === "list" ? !1 : e.pageAnchor !== void 0 || e.kind === "text" && typeof e.text == "string" && /\{(?:page|totalPages)\}/.test(e.text);
245
245
  }
246
246
  function xe(e, i) {
247
- const t = e.filter((n) => i.componentIds.includes(_(n) ?? ""));
248
- if (t.filter((n) => n.kind === "list" && n.cardinality !== "record").length && t.length !== 1) throw new Error("纵向重复区域必须独占流式分段,不能与静态或单记录区域并排");
249
- for (const n of t) {
250
- const a = n.kind === "list" ? n.topMm + (n.rowHeightMm ?? 0) : n.topMm + n.heightMm;
251
- if (n.topMm < i.topMm - 1e-3 || a > i.topMm + i.heightMm + 1e-3) throw new Error("流式分段应完整包含其组件的原始纵向范围");
247
+ if (e.filter((s) => s.kind === "list" && s.cardinality !== "record").length && e.length !== 1) throw new Error("纵向重复区域必须独占流式分段,不能与静态或单记录区域并排");
248
+ for (const s of e) {
249
+ const n = s.kind === "list" ? s.topMm + (s.rowHeightMm ?? 0) : s.topMm + s.heightMm;
250
+ if (s.topMm < i.topMm - 1e-3 || n > i.topMm + i.heightMm + 1e-3) throw new Error("流式分段应完整包含其组件的原始纵向范围");
252
251
  }
253
252
  }
254
253
  function gt(e, i) {
255
254
  if (!i) return e.map((s) => ({ components: [s] }));
256
- const t = new Map(e.map((s) => [_(s), s]));
255
+ const t = new Map(e.filter((s) => !z(s)).map((s) => [U(s), s]));
257
256
  return i.bands.map((s) => ({ band: s, components: s.componentIds.map((n) => {
258
257
  const a = t.get(n);
259
258
  if (!a) throw new Error(`流式区域引用不存在的组件:${n}`);
@@ -262,25 +261,27 @@ function gt(e, i) {
262
261
  }
263
262
  function Re(e, i) {
264
263
  if (!i || !Array.isArray(i.bands) || !i.bands.length || i.bands.length > 1e4) throw new Error("流式排版应包含 1–10000 个区域");
265
- const t = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
264
+ const t = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set();
266
265
  for (const n of e) {
267
- if (Ne(n)) continue;
268
- const a = _(n);
266
+ if (z(n)) continue;
267
+ const a = U(n);
269
268
  if (!a || t.has(a)) throw new Error("流式排版组件应具有唯一标识");
270
- t.add(a);
271
- }
272
- if (Te(e, i, t, s), s.size !== t.size) throw new Error("流式排版必须显式包含每个非锚点组件");
273
- }
274
- function Te(e, i, t, s) {
275
- let n = -1 / 0;
276
- for (const a of i.bands) {
277
- if (!Number.isFinite(a.topMm) || !Number.isFinite(a.heightMm) || a.topMm < 0 || a.heightMm <= 0 || a.topMm < n - 1e-3) throw new Error("流式区域应按原始位置排序,尺寸有效且不重叠");
278
- if (!Array.isArray(a.componentIds) || !a.componentIds.length) throw new Error("流式区域不能没有组件");
279
- for (const o of a.componentIds) {
280
- if (!t.has(o) || s.has(o)) throw new Error(`流式区域组件缺失、重复或包含页锚点:${o}`);
281
- s.add(o);
269
+ t.set(a, n);
270
+ }
271
+ if (Te(i, t, s), s.size !== t.size) throw new Error("流式排版必须显式包含每个非锚点组件");
272
+ }
273
+ function Te(e, i, t) {
274
+ let s = -1 / 0;
275
+ for (const n of e.bands) {
276
+ if (!Number.isFinite(n.topMm) || !Number.isFinite(n.heightMm) || n.topMm < 0 || n.heightMm <= 0 || n.topMm < s - 1e-3) throw new Error("流式区域应按原始位置排序,尺寸有效且不重叠");
277
+ if (!Array.isArray(n.componentIds) || !n.componentIds.length) throw new Error("流式区域不能没有组件");
278
+ const a = [];
279
+ for (const o of n.componentIds) {
280
+ const f = i.get(o);
281
+ if (!f || t.has(o)) throw new Error(`流式区域组件缺失、重复或包含页锚点:${o}`);
282
+ t.add(o), a.push(f);
282
283
  }
283
- xe(e, a), n = a.topMm + a.heightMm;
284
+ xe(a, n), s = n.topMm + n.heightMm;
284
285
  }
285
286
  }
286
287
  const Fe = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
@@ -323,13 +324,13 @@ function Ie(e, i) {
323
324
  const t = e.copies;
324
325
  t !== void 0 && ($(t) ? (x(t, ["field"], "$.repeat.copies", i), k(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 整数" }));
325
326
  }
326
- function z(e, i, t, s) {
327
+ function q(e, i, t, s) {
327
328
  if (!$(e)) return;
328
329
  Pe(e, i, s), e.binding !== void 0 && !t && s.push({ path: `${i}.binding`, message: "字段绑定需要模板 repeat 数据集;普通报表请使用列表字段" }), t && e.kind === "list" && s.push({ path: i, message: "逐记录标签使用固定组件;动态列表请使用普通报表模板" }), e.chartBinding !== void 0 && (t || i.includes(".children.")) && s.push({ path: `${i}.chartBinding`, message: "数据图表应放在普通报表的页面或流式分区,不放在逐记录标签或嵌套单元格内" });
329
330
  const n = e.grid;
330
331
  $(n) && Array.isArray(n.cells) && n.cells.forEach((a, o) => {
331
332
  Array.isArray(a) && a.forEach((f, r) => {
332
- $(f) && Array.isArray(f.children) && f.children.forEach((d, h) => z(d, `${i}.grid.cells.${o}.${r}.children.${h}`, t, s));
333
+ $(f) && Array.isArray(f.children) && f.children.forEach((d, h) => q(d, `${i}.grid.cells.${o}.${r}.children.${h}`, t, s));
333
334
  });
334
335
  });
335
336
  }
@@ -340,7 +341,7 @@ function Oe(e, i) {
340
341
  const a = `$.pages.${n}`;
341
342
  t && (s.layout === "wide" || s.flow !== void 0) && i.push({ path: a, message: "逐记录标签仅支持固定尺寸页面,不支持宽表或流式分区" }), Array.isArray(s.components) && s.components.forEach((o, f) => {
342
343
  const r = `${a}.components.${f}`;
343
- if (z(o, r, t, i), !t || !$(o)) return;
344
+ if (q(o, r, t, i), !t || !$(o)) return;
344
345
  const { leftMm: d, topMm: h, widthMm: m, heightMm: y } = o;
345
346
  [d, h, m, y, s.widthMm, s.heightMm].every((l) => typeof l == "number" && Number.isFinite(l)) && (Number(d) < 0 || Number(h) < 0 || Number(d) + Number(m) > Number(s.widthMm) + 1e-3 || Number(h) + Number(y) > Number(s.heightMm) + 1e-3) && i.push({ path: r, message: "标签组件超出纸张边界,请调整位置或尺寸" });
346
347
  });
@@ -352,12 +353,12 @@ function _e(e) {
352
353
  function C(e, i, t) {
353
354
  if (e !== void 0)
354
355
  try {
355
- ee(e);
356
+ te(e);
356
357
  } catch (s) {
357
358
  t.push({ path: i, message: s instanceof Error ? s.message : String(s) });
358
359
  }
359
360
  }
360
- function q(e, i, t) {
361
+ function X(e, i, t) {
361
362
  if (e === void 0) return;
362
363
  if (!Array.isArray(e) || e.length > 2048) {
363
364
  t.push({ path: i, message: "聚合应为数组且最多 2048 项" });
@@ -382,7 +383,7 @@ function q(e, i, t) {
382
383
  message: "小数位应为 0–100 的整数"
383
384
  });
384
385
  try {
385
- ie({
386
+ se({
386
387
  ...n,
387
388
  field: n.valueField ?? f
388
389
  });
@@ -396,13 +397,13 @@ function q(e, i, t) {
396
397
  }
397
398
  function Le(e, i, t) {
398
399
  if (e === void 0) return;
399
- const s = te(e);
400
+ const s = ie(e);
400
401
  for (const n of s.errors) t.push({ path: i, message: n });
401
402
  }
402
403
  function je(e, i, t) {
403
404
  if (e !== void 0)
404
405
  try {
405
- se(e);
406
+ ne(e);
406
407
  } catch (s) {
407
408
  t.push({
408
409
  path: i,
@@ -414,7 +415,7 @@ function Be(e, i, t) {
414
415
  if (e.tree === void 0) return;
415
416
  const s = `${i}.tree`;
416
417
  try {
417
- he(e.tree);
418
+ ue(e.tree);
418
419
  const n = e.tree;
419
420
  if (e.matrix || e.detail || e.groupBy || Array.isArray(e.groups) && e.groups.length || e.rowVisibleWhen) throw new Error("树形布局不能同时配置普通分组、矩阵、主从或行可见条件");
420
421
  if (e.rowKey !== void 0 && e.rowKey !== n.idField) throw new Error("树形 rowKey 应与 idField 一致");
@@ -463,7 +464,7 @@ function I(e, i, t) {
463
464
  !P(n) || !E(a) ? t.push({ path: o, message: "数据集应使用安全名称和字段契约" }) : Ve(a.fields, `${o}.fields`, t);
464
465
  }
465
466
  }
466
- function B(e, i) {
467
+ function j(e, i) {
467
468
  return new Map(e.datasets[i]?.fields.map((t) => [t.field, t]) ?? []);
468
469
  }
469
470
  function He(e, i, t, s) {
@@ -478,8 +479,8 @@ function pt(e, i) {
478
479
  if (!n) return { ok: !1, issues: [{ code: "contract", path: "$.template.dataContract", message: "模板未声明数据来源,请核对业务字段并重新绑定" }] };
479
480
  n.source !== i.source && t.push({ code: "source", path: "$.template.dataContract.source", message: `模板来源与当前报表不一致(${n.source ?? "未声明"} → ${i.source ?? "未声明"}),请从当前报表创建或重新绑定模板` });
480
481
  const a = /* @__PURE__ */ new Set();
481
- for (const o of ue(e)) {
482
- const f = B(n, o.dataset), r = B(i, o.dataset);
482
+ for (const o of me(e)) {
483
+ const f = j(n, o.dataset), r = j(i, o.dataset);
483
484
  if (!f.size || !r.size) {
484
485
  t.push({ code: "dataset", dataset: o.dataset, path: o.path, message: `数据集“${o.dataset}”缺少来源或目标字段契约` });
485
486
  continue;
@@ -495,14 +496,14 @@ function pt(e, i) {
495
496
  }
496
497
  return { ok: t.length === 0, issues: t };
497
498
  }
498
- const X = "1.0";
499
+ const Y = "1.0";
499
500
  class w extends Error {
500
501
  constructor(i) {
501
502
  super(`模板校验失败:${i.slice(0, 3).map((t) => `${t.path}: ${t.message}`).join("; ")}`), this.errors = i, this.name = "ReportTemplateError";
502
503
  }
503
504
  }
504
505
  const Je = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]), We = /* @__PURE__ */ new Set(["schemaVersion", "id", "name", "revision", "description", "template"]), Ge = /* @__PURE__ */ new Set(["left", "center", "right", "justify"]), S = 2e5, Ue = 64;
505
- function c(e) {
506
+ function u(e) {
506
507
  return !!e && typeof e == "object" && !Array.isArray(e);
507
508
  }
508
509
  function ze(e, i, t) {
@@ -522,7 +523,7 @@ function qe(e, i, t, s) {
522
523
  function Xe(e) {
523
524
  return e === null || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e);
524
525
  }
525
- function L(e, i) {
526
+ function _(e, i) {
526
527
  const t = /* @__PURE__ */ new Set();
527
528
  let s = 0, n = 0, a = !1;
528
529
  const o = (f, r, d) => {
@@ -536,7 +537,7 @@ function L(e, i) {
536
537
  return;
537
538
  }
538
539
  if (typeof f == "string") {
539
- n += f.length, n > V && (a = !0, i.push({ path: r, message: "模板文本超过 1000 万字符的安全上限" }));
540
+ n += f.length, n > K && (a = !0, i.push({ path: r, message: "模板文本超过 1000 万字符的安全上限" }));
540
541
  return;
541
542
  }
542
543
  if (!Xe(f)) {
@@ -562,7 +563,7 @@ function L(e, i) {
562
563
  };
563
564
  o(e, "$", 0);
564
565
  }
565
- function u(e, i, t, s, n = !1) {
566
+ function c(e, i, t, s, n = !1) {
566
567
  const a = e[i];
567
568
  a === void 0 && !n || (typeof a != "string" || n && !a.trim()) && s.push({ path: `${t}.${i}`, message: n ? "应为非空字符串" : "应为字符串" });
568
569
  }
@@ -578,7 +579,7 @@ function M(e, i, t, s = !1) {
578
579
  }
579
580
  function b(e, i, t) {
580
581
  if (e !== void 0) {
581
- if (!c(e)) {
582
+ if (!u(e)) {
582
583
  t.push({ path: i, message: "样式应为对象" });
583
584
  return;
584
585
  }
@@ -587,7 +588,7 @@ function b(e, i, t) {
587
588
  for (const s of ["letterSpacing", "rotateDeg"]) g(e, s, i, t, -1 / 0);
588
589
  g(e, "opacity", i, t), typeof e.opacity == "number" && e.opacity > 1 && t.push({ path: `${i}.opacity`, message: "透明度不能大于 1" });
589
590
  for (const s of ["bold", "italic", "underline", "borderTop", "borderRight", "borderBottom", "borderLeft"]) A(e, s, i, t);
590
- for (const s of ["fontFamily", "color", "backgroundColor", "lineColor", "borderColor"]) u(e, s, i, t);
591
+ for (const s of ["fontFamily", "color", "backgroundColor", "lineColor", "borderColor"]) c(e, s, i, t);
591
592
  }
592
593
  }
593
594
  function Ye(e, i, t) {
@@ -599,12 +600,12 @@ function Ye(e, i, t) {
599
600
  const s = /* @__PURE__ */ new Set(), n = t.length;
600
601
  e.forEach((a, o) => {
601
602
  const f = `${i}.${o}`;
602
- if (!c(a)) {
603
+ if (!u(a)) {
603
604
  t.push({ path: f, message: "参数定义应为对象" });
604
605
  return;
605
606
  }
606
- 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", "multiSelect", "cascader", "numberRange"].includes(a.type) && t.push({ path: `${f}.type`, message: "未知参数类型" });
607
- for (const r of ["label", "defaultValue", "placeholder"]) u(a, r, f, t);
607
+ c(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", "multiSelect", "cascader", "numberRange"].includes(a.type) && t.push({ path: `${f}.type`, message: "未知参数类型" });
608
+ for (const r of ["label", "defaultValue", "placeholder"]) c(a, r, f, t);
608
609
  A(a, "required", f, t);
609
610
  for (const r of ["minLength", "maxLength"]) {
610
611
  const d = a[r];
@@ -612,42 +613,42 @@ function Ye(e, i, t) {
612
613
  }
613
614
  Qe(a, f, t), a.options !== void 0 && (Array.isArray(a.options) ? a.options.forEach((r, d) => {
614
615
  const h = `${f}.options.${d}`;
615
- if (!c(r)) t.push({ path: h, message: "选项应为对象" });
616
+ if (!u(r)) t.push({ path: h, message: "选项应为对象" });
616
617
  else
617
618
  for (const m of ["label", "value"]) typeof r[m] != "string" && t.push({ path: `${h}.${m}`, message: "选项标签与值应为字符串(允许空白选项)" });
618
619
  }) : t.push({ path: `${f}.options`, message: "选项应为数组" }));
619
- }), t.length === n && t.push(...re(e).map((a) => ({ path: a.path.replace("$.paramDefs", i), message: a.message })));
620
+ }), t.length === n && t.push(...de(e).map((a) => ({ path: a.path.replace("$.paramDefs", i), message: a.message })));
620
621
  }
621
622
  function Qe(e, i, t) {
622
623
  for (const a of ["min", "max"]) {
623
624
  const o = e[a];
624
625
  if (o === void 0) continue;
625
- de(e.type, o) || ["number", "numberRange"].includes(e.type) && typeof o == "number" && Number.isFinite(o) || t.push({ path: `${i}.${a}`, message: "数字使用有限数字边界,日期/月/年使用对应规范字符串边界" });
626
+ he(e.type, o) || ["number", "numberRange"].includes(e.type) && typeof o == "number" && Number.isFinite(o) || t.push({ path: `${i}.${a}`, message: "数字使用有限数字边界,日期/月/年使用对应规范字符串边界" });
626
627
  }
627
628
  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;
628
629
  (s || n) && t.push({ path: i, message: "最小边界不能大于最大边界" }), typeof e.minLength == "number" && typeof e.maxLength == "number" && e.minLength > e.maxLength && t.push({ path: i, message: "最小长度不能大于最大长度" });
629
630
  }
630
- function Y(e, i, t) {
631
+ function Q(e, i, t) {
631
632
  if (!Array.isArray(e) || e.length === 0) {
632
633
  t.push({ path: i, message: "列表至少需要一列" });
633
634
  return;
634
635
  }
635
- e.every((s) => c(s) && s.hidden === !0) && t.push({ path: i, message: "列表至少需要一列可见列" }), e.forEach((s, n) => {
636
+ e.every((s) => u(s) && s.hidden === !0) && t.push({ path: i, message: "列表至少需要一列可见列" }), e.forEach((s, n) => {
636
637
  const a = `${i}.${n}`;
637
- if (!c(s)) {
638
+ if (!u(s)) {
638
639
  t.push({ path: a, message: "列应为对象" });
639
640
  return;
640
641
  }
641
- if (H(s, a, t), s.visual !== void 0 && !me(s.visual) && t.push({ path: `${a}.visual`, message: "列可视化配置无效,请检查类型、数值范围和颜色" }), A(s, "hidden", a, t), C(s.visibleWhen, `${a}.visibleWhen`, t), typeof s.header != "string" && t.push({ path: `${a}.header`, message: "表头应为字符串(允许空白表头)" }), u(s, "field", a, t, !0), g(s, "widthMm", a, t, Number.MIN_VALUE, !0), b(s.style, `${a}.style`, t), b(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)
642
- if (!c(s.format) || !["number", "percent", "date"].includes(s.format.kind))
642
+ if (V(s, a, t), s.visual !== void 0 && !ge(s.visual) && t.push({ path: `${a}.visual`, message: "列可视化配置无效,请检查类型、数值范围和颜色" }), A(s, "hidden", a, t), C(s.visibleWhen, `${a}.visibleWhen`, t), typeof s.header != "string" && t.push({ path: `${a}.header`, message: "表头应为字符串(允许空白表头)" }), c(s, "field", a, t, !0), g(s, "widthMm", a, t, Number.MIN_VALUE, !0), b(s.style, `${a}.style`, t), b(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)
643
+ if (!u(s.format) || !["number", "percent", "date"].includes(s.format.kind))
643
644
  t.push({ path: `${a}.format`, message: "未知列格式" });
644
645
  else {
645
646
  const o = s.format.digits;
646
- o !== void 0 && (typeof o != "number" || !Number.isInteger(o) || o < 0 || o > 100) && t.push({ path: `${a}.format.digits`, message: "小数位应为 0–100 的整数" }), A(s.format, "thousands", `${a}.format`, t), u(s.format, "pattern", `${a}.format`, t);
647
+ o !== void 0 && (typeof o != "number" || !Number.isInteger(o) || o < 0 || o > 100) && t.push({ path: `${a}.format.digits`, message: "小数位应为 0–100 的整数" }), A(s.format, "thousands", `${a}.format`, t), c(s.format, "pattern", `${a}.format`, t);
647
648
  }
648
649
  s.rules !== void 0 && (Array.isArray(s.rules) ? s.rules.forEach((o, f) => {
649
650
  const r = `${a}.rules.${f}`;
650
- if (!c(o) || !c(o.when)) {
651
+ if (!u(o) || !u(o.when)) {
651
652
  t.push({ path: r, message: "条件格式缺少 when 对象" });
652
653
  return;
653
654
  }
@@ -655,30 +656,30 @@ function Y(e, i, t) {
655
656
  }) : t.push({ path: `${a}.rules`, message: "条件格式应为数组" }));
656
657
  });
657
658
  }
658
- function Q(e, i, t) {
659
+ function Z(e, i, t) {
659
660
  if (e !== void 0) {
660
- if (!c(e)) {
661
+ if (!u(e)) {
661
662
  t.push({ path: i, message: "分组应为对象" });
662
663
  return;
663
664
  }
664
- u(e, "field", i, t, !0);
665
- for (const s of ["headerTemplate", "subtotalLabel"]) u(e, s, i, t);
665
+ c(e, "field", i, t, !0);
666
+ for (const s of ["headerTemplate", "subtotalLabel"]) c(e, s, i, t);
666
667
  for (const s of ["headerStyle", "subtotalStyle"]) b(e[s], `${i}.${s}`, t);
667
- A(e, "keepWithNext", i, t), A(e, "repeatHeader", i, t), q(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: "小计字段应为字符串数组" });
668
+ A(e, "keepWithNext", i, t), A(e, "repeatHeader", i, t), X(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: "小计字段应为字符串数组" });
668
669
  }
669
670
  }
670
671
  function Ze(e, i, t) {
671
672
  if (!(e === void 0 || typeof e == "boolean")) {
672
- if (!c(e)) {
673
+ if (!u(e)) {
673
674
  t.push({ path: i, message: "合计应为布尔值或对象" });
674
675
  return;
675
676
  }
676
- u(e, "label", i, t), q(e.aggregates, `${i}.aggregates`, t), b(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: "合计字段应为字符串数组" });
677
+ c(e, "label", i, t), X(e.aggregates, `${i}.aggregates`, t), b(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: "合计字段应为字符串数组" });
677
678
  }
678
679
  }
679
680
  function et(e, i, t, s) {
680
681
  const n = { kind: "rect", leftMm: 0, topMm: 0, widthMm: 1, heightMm: 1, grid: e };
681
- if (G(n, t, s, []), j(n, t, s), !c(e) || !Array.isArray(e.cells)) return;
682
+ if (W(n, t, s, []), L(n, t, s), !u(e) || !Array.isArray(e.cells)) return;
682
683
  const a = e.cells, o = Array.isArray(i) ? i.length : 0;
683
684
  if (a.length * o > S) {
684
685
  s.push({ path: t, message: "表头逻辑网格超过 20 万格安全上限" });
@@ -693,7 +694,7 @@ function tt(e, i, t, s) {
693
694
  let f = 0;
694
695
  a.forEach((r, d) => {
695
696
  for (; n.has(`${o}:${f}`); ) f++;
696
- const h = c(r) && typeof r.colSpan == "number" ? r.colSpan : 1, m = c(r) && typeof r.rowSpan == "number" ? r.rowSpan : 1;
697
+ const h = u(r) && typeof r.colSpan == "number" ? r.colSpan : 1, m = u(r) && typeof r.rowSpan == "number" ? r.rowSpan : 1;
697
698
  (f + h > i || o + m > e.length) && s.push({ path: `${t}.cells.${o}.${d}`, message: "表头合并区域超出表头边界" });
698
699
  for (let y = o; y < Math.min(e.length, o + m); y++)
699
700
  for (let l = f; l < Math.min(i, f + h); l++)
@@ -703,48 +704,48 @@ function tt(e, i, t, s) {
703
704
  });
704
705
  }
705
706
  function it(e, i, t) {
706
- if (Be(e, i, t), Le(e.computed, `${i}.computed`, t), je(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 汇总,不能同时配置普通分组、总计或主从明细" }), C(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) => Q(a, `${i}.groups.${o}`, t))), e.detail === void 0) return;
707
+ if (Be(e, i, t), Le(e.computed, `${i}.computed`, t), je(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 汇总,不能同时配置普通分组、总计或主从明细" }), C(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) => Z(a, `${i}.groups.${o}`, t))), e.detail === void 0) return;
707
708
  const s = e.detail, n = `${i}.detail`;
708
- if (!c(s)) {
709
+ if (!u(s)) {
709
710
  t.push({ path: n, message: "主从关联应为对象" });
710
711
  return;
711
712
  }
712
- for (const a of ["dataset", "parentKey", "foreignKey"]) u(s, a, n, t, !0);
713
- for (const a of ["rowKey", "revisionField", "sourceTokenField"]) u(s, a, n, t, s[a] !== void 0);
714
- u(s, "label", n, t), A(s, "header", n, t), g(s, "rowHeightMm", n, t, Number.MIN_VALUE), Y(s.columns, `${n}.columns`, t), s.unmatched !== void 0 && s.unmatched !== "error" && s.unmatched !== "ignore" && t.push({ path: `${n}.unmatched`, message: "未关联明细策略应为 error 或 ignore" });
713
+ for (const a of ["dataset", "parentKey", "foreignKey"]) c(s, a, n, t, !0);
714
+ for (const a of ["rowKey", "revisionField", "sourceTokenField"]) c(s, a, n, t, s[a] !== void 0);
715
+ c(s, "label", n, t), A(s, "header", n, t), g(s, "rowHeightMm", n, t, Number.MIN_VALUE), Q(s.columns, `${n}.columns`, t), s.unmatched !== void 0 && s.unmatched !== "error" && s.unmatched !== "ignore" && t.push({ path: `${n}.unmatched`, message: "未关联明细策略应为 error 或 ignore" });
715
716
  }
716
717
  function st(e, i, t) {
717
718
  for (const s of ["leftMm", "topMm"]) g(e, s, i, t, -1 / 0, !0);
718
- g(e, "widthMm", i, t, Number.MIN_VALUE, !0), u(e, "dataset", i, t, !0), u(e, "title", i, t);
719
- for (const s of ["rowKey", "revisionField", "sourceTokenField"]) u(e, s, i, t, e[s] !== void 0);
720
- e.headerGrid !== void 0 && et(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" }), Y(e.columns, `${i}.columns`, t);
719
+ g(e, "widthMm", i, t, Number.MIN_VALUE, !0), c(e, "dataset", i, t, !0), c(e, "title", i, t);
720
+ for (const s of ["rowKey", "revisionField", "sourceTokenField"]) c(e, s, i, t, e[s] !== void 0);
721
+ e.headerGrid !== void 0 && et(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" }), Q(e.columns, `${i}.columns`, t);
721
722
  for (const s of ["fontSizePt", "rowHeightMm"]) g(e, s, i, t, Number.MIN_VALUE);
722
723
  g(e, "paddingMm", i, t);
723
724
  for (const s of ["header", "headerBold", "headerEveryPage", "border"]) A(e, s, i, t);
724
- e.cardinality !== void 0 && e.cardinality !== "record" && t.push({ path: `${i}.cardinality`, message: "单记录区域类型应为 record" }), u(e, "headerBackgroundColor", i, t), M(e.align, `${i}.align`, t, !0), M(e.headerAlign, `${i}.headerAlign`, t), b(e.headerStyle, `${i}.headerStyle`, t), it(e, i, t), Q(e.groupBy, `${i}.groupBy`, t), Ze(e.grandTotal, `${i}.grandTotal`, t);
725
+ e.cardinality !== void 0 && e.cardinality !== "record" && t.push({ path: `${i}.cardinality`, message: "单记录区域类型应为 record" }), c(e, "headerBackgroundColor", i, t), M(e.align, `${i}.align`, t, !0), M(e.headerAlign, `${i}.headerAlign`, t), b(e.headerStyle, `${i}.headerStyle`, t), it(e, i, t), Z(e.groupBy, `${i}.groupBy`, t), Ze(e.grandTotal, `${i}.grandTotal`, t);
725
726
  }
726
- function D(e, i, t) {
727
+ function B(e, i, t) {
727
728
  Array.isArray(e.richParagraphs) && e.richParagraphs.forEach((s, n) => {
728
- if (!c(s)) return;
729
+ if (!u(s)) return;
729
730
  const a = `${i}.richParagraphs.${n}`;
730
731
  M(s.align, `${a}.align`, t);
731
732
  for (const o of ["lineHeight", "spaceBeforeMm", "spaceAfterMm", "indentMm"]) g(s, o, a, t);
732
733
  Array.isArray(s.segments) && s.segments.forEach((o, f) => {
733
734
  const r = `${a}.segments.${f}`;
734
- if (!c(o)) {
735
+ if (!u(o)) {
735
736
  t.push({ path: r, message: "富文本片段应为对象" });
736
737
  return;
737
738
  }
738
739
  o.kind !== void 0 && o.kind !== "text" && o.kind !== "field" && t.push({ path: `${r}.kind`, message: "未知富文本片段类型" });
739
- for (const d of ["text", "field"]) u(o, d, r, t);
740
+ for (const d of ["text", "field"]) c(o, d, r, t);
740
741
  b(o.style, `${r}.style`, t);
741
742
  });
742
743
  });
743
744
  }
744
- function j(e, i, t) {
745
+ function L(e, i, t) {
745
746
  b(e.style, `${i}.style`, t);
746
- for (const n of ["text", "rawText", "imageData", "fallbackText", "nid", "rkey"]) u(e, n, i, t);
747
- if (e.lines !== void 0 && (!Array.isArray(e.lines) || e.lines.some((n) => typeof n != "string")) && t.push({ path: `${i}.lines`, message: "文本行应为字符串数组" }), D(e, i, t), !c(e.grid)) return;
747
+ for (const n of ["text", "rawText", "imageData", "fallbackText", "nid", "rkey"]) c(e, n, i, t);
748
+ if (e.lines !== void 0 && (!Array.isArray(e.lines) || e.lines.some((n) => typeof n != "string")) && t.push({ path: `${i}.lines`, message: "文本行应为字符串数组" }), B(e, i, t), !u(e.grid)) return;
748
749
  const s = e.grid;
749
750
  g(s, "gapMm", `${i}.grid`, t), g(s, "paddingMm", `${i}.grid`, t);
750
751
  for (const n of ["colWidthsMm", "rowHeightsMm"]) {
@@ -755,17 +756,17 @@ function j(e, i, t) {
755
756
  Array.isArray(n) && n.forEach((o, f) => {
756
757
  const r = `${i}.grid.cells.${a}.${f}`;
757
758
  if (o !== null) {
758
- if (!c(o)) {
759
+ if (!u(o)) {
759
760
  t.push({ path: r, message: "网格单元格应为对象或 null" });
760
761
  return;
761
762
  }
762
- for (const d of ["text", "rawText", "numberFormat"]) u(o, d, r, t);
763
+ for (const d of ["text", "rawText", "numberFormat"]) c(o, d, r, t);
763
764
  for (const d of ["colSpan", "rowSpan"]) {
764
765
  const h = o[d];
765
766
  h !== void 0 && (typeof h != "number" || !Number.isInteger(h) || h <= 0) && t.push({ path: `${r}.${d}`, message: "跨度应为正整数" });
766
767
  }
767
- o.value !== void 0 && o.value !== null && !["string", "number", "boolean"].includes(typeof o.value) && t.push({ path: `${r}.value`, message: "Excel 原始值应为字符串、数字、布尔值或 null" }), b(o.style, `${r}.style`, t), D(o, r, t), o.children !== void 0 && (Array.isArray(o.children) ? o.children.forEach((d, h) => {
768
- c(d) && j(d, `${r}.children.${h}`, t);
768
+ o.value !== void 0 && o.value !== null && !["string", "number", "boolean"].includes(typeof o.value) && t.push({ path: `${r}.value`, message: "Excel 原始值应为字符串、数字、布尔值或 null" }), b(o.style, `${r}.style`, t), B(o, r, t), o.children !== void 0 && (Array.isArray(o.children) ? o.children.forEach((d, h) => {
769
+ u(d) && L(d, `${r}.children.${h}`, t);
769
770
  }) : t.push({ path: `${r}.children`, message: "嵌套组件应为数组" }));
770
771
  }
771
772
  });
@@ -781,9 +782,9 @@ function nt(e, i, t) {
781
782
  }
782
783
  function at(e) {
783
784
  const i = [], t = [];
784
- return L(e, i), i.length ? { ok: !1, errors: i, warnings: t } : (c(e) ? (e.schemaVersion !== void 0 && e.schemaVersion !== oe && i.push({ path: "$.schemaVersion", message: "不支持的模板 schemaVersion" }), Ye(e.params, "$.params", i), I(e.dataContract, "$.dataContract", i), Oe(e, i), !Array.isArray(e.pages) || e.pages.length === 0 ? i.push({ path: "$.pages", message: "模板至少需要一页" }) : e.pages.forEach((s, n) => {
785
+ return _(e, i), i.length ? { ok: !1, errors: i, warnings: t } : (u(e) ? (e.schemaVersion !== void 0 && e.schemaVersion !== fe && i.push({ path: "$.schemaVersion", message: "不支持的模板 schemaVersion" }), Ye(e.params, "$.params", i), I(e.dataContract, "$.dataContract", i), Oe(e, i), !Array.isArray(e.pages) || e.pages.length === 0 ? i.push({ path: "$.pages", message: "模板至少需要一页" }) : e.pages.forEach((s, n) => {
785
786
  const a = `$.pages.${n}`;
786
- if (!c(s)) {
787
+ if (!u(s)) {
787
788
  i.push({ path: a, message: "页应为对象" });
788
789
  return;
789
790
  }
@@ -791,20 +792,20 @@ function at(e) {
791
792
  for (const o of ["marginTopMm", "marginBottomMm", "marginLeftMm", "marginRightMm"]) g(s, o, a, i);
792
793
  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) => {
793
794
  const r = `${a}.components.${f}`;
794
- c(o) && o.kind === "list" ? st(o, r, i) : (G(o, r, i, t), c(o) && j(o, r, i));
795
+ u(o) && o.kind === "list" ? st(o, r, i) : (W(o, r, i, t), u(o) && L(o, r, i));
795
796
  }) : i.push({ path: `${a}.components`, message: "组件应为数组" }), nt(s, a, i);
796
797
  })) : i.push({ path: "$", message: "模板应为对象" }), { ok: i.length === 0, errors: i, warnings: t });
797
798
  }
798
799
  function ot(e) {
799
800
  const i = [], t = [];
800
- if (L(e, i), i.length) return { ok: !1, errors: i, warnings: t };
801
- if (!c(e)) i.push({ path: "$", message: "模板文档应为对象" });
801
+ if (_(e, i), i.length) return { ok: !1, errors: i, warnings: t };
802
+ if (!u(e)) i.push({ path: "$", message: "模板文档应为对象" });
802
803
  else {
803
804
  for (const n of Object.keys(e))
804
805
  We.has(n) || i.push({ path: `$.${n}`, message: "模板文档存在未知字段;只保存模板与描述,不保存取数或业务数据" });
805
- e.schemaVersion !== X && i.push({ path: "$.schemaVersion", message: "不支持的模板文档版本" });
806
- for (const n of ["id", "name"]) u(e, n, "$", i, !0);
807
- for (const n of ["revision", "description"]) u(e, n, "$", i);
806
+ e.schemaVersion !== Y && i.push({ path: "$.schemaVersion", message: "不支持的模板文档版本" });
807
+ for (const n of ["id", "name"]) c(e, n, "$", i, !0);
808
+ for (const n of ["revision", "description"]) c(e, n, "$", i);
808
809
  const s = at(e.template);
809
810
  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)}` })));
810
811
  }
@@ -816,14 +817,14 @@ function T(e) {
816
817
  }
817
818
  function yt(e) {
818
819
  const i = [];
819
- if (L(e, i), i.length) throw new w(i);
820
- const t = { ...e, schemaVersion: e.schemaVersion ?? X };
820
+ if (_(e, i), i.length) throw new w(i);
821
+ const t = { ...e, schemaVersion: e.schemaVersion ?? Y };
821
822
  return T(t), R(t);
822
823
  }
823
824
  function lt(e) {
824
825
  let i = e;
825
826
  if (typeof e == "string") {
826
- if (e.length > V)
827
+ if (e.length > K)
827
828
  throw new w([{ path: "$", message: "模板 JSON 超过 1000 万字符的导出/导入上限" }]);
828
829
  try {
829
830
  i = JSON.parse(e);
@@ -836,7 +837,7 @@ function lt(e) {
836
837
  function $t(e) {
837
838
  T(e);
838
839
  try {
839
- return ge(e);
840
+ return pe(e);
840
841
  } catch (i) {
841
842
  throw i instanceof RangeError ? new w([{ path: "$", message: i.message }]) : i;
842
843
  }
@@ -862,13 +863,13 @@ function bt(e = []) {
862
863
  }
863
864
  export {
864
865
  w as R,
865
- X as a,
866
- ve as b,
866
+ Y as a,
867
+ Ne as b,
867
868
  mt as c,
868
869
  bt as d,
869
870
  yt as e,
870
- G as f,
871
- Se as g,
871
+ W as f,
872
+ ve as g,
872
873
  ot as h,
873
874
  pt as i,
874
875
  Re as j,