@agile-team/mach-report 2.23.0 → 2.24.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 (162) hide show
  1. package/README.md +9 -2
  2. package/dist/ExcelBindingWizard-BV12hGiK.cjs +1 -0
  3. package/dist/ExcelBindingWizard-Cy_lPjWV.js +1486 -0
  4. package/dist/ParamEditor-DenKjvKu.cjs +1 -0
  5. package/dist/ParamEditor-PyOqHzzw.js +750 -0
  6. package/dist/ReportBatchPanel-8EFtMrKk.js +351 -0
  7. package/dist/ReportBatchPanel-pQ6d0yqJ.cjs +1 -0
  8. package/dist/ReportLabelStudio-B_KF3Zc_.cjs +1 -0
  9. package/dist/ReportLabelStudio-HUeo2TsU.js +784 -0
  10. package/dist/ReportParamPanel-8xR85nz-.cjs +1 -0
  11. package/dist/{ReportParamPanel-Dgmqro1Y.js → ReportParamPanel-DA-YpkvC.js} +342 -307
  12. package/dist/ReportPreview-CyUXJSVX.cjs +6 -0
  13. package/dist/ReportPreview-_wTJnsG1.js +7120 -0
  14. package/dist/ReportTemplateLibrary-CjArKxRG.cjs +1 -0
  15. package/dist/ReportTemplateLibrary-DH8jl9IF.js +312 -0
  16. package/dist/RuleEditor-Bmj98oC4.cjs +1 -0
  17. package/dist/RuleEditor-GDydlEHz.js +2354 -0
  18. package/dist/TemplateOutlinePanel-B554_qk1.cjs +1 -0
  19. package/dist/TemplateOutlinePanel-DjPqzU9h.js +97 -0
  20. package/dist/TemplateReusePanel-D0628OYc.cjs +1 -0
  21. package/dist/TemplateReusePanel-DtYbCN7U.js +389 -0
  22. package/dist/TemplateReviewPanel-CSwvCz3f.cjs +1 -0
  23. package/dist/TemplateReviewPanel-D_FR4ISq.js +602 -0
  24. package/dist/artifact-integrity.json +94 -94
  25. package/dist/assets-B4AJIOTB.cjs +1 -0
  26. package/dist/assets-D0FbszhB.js +137 -0
  27. package/dist/{auto-CTIJ6PnR.js → auto-BksreoKc.js} +5 -5
  28. package/dist/auto-C3mGqzJ8.cjs +1 -0
  29. package/dist/capabilities-CTwlcl8q.cjs +1 -0
  30. package/dist/capabilities-lqDEZSq5.js +121 -0
  31. package/dist/data-bar-2NLRzOCQ.cjs +1 -0
  32. package/dist/{data-bar-IkI6VvMQ.js → data-bar-BnGtnJ82.js} +1 -1
  33. package/dist/designer-BNf7NWd6.js +7589 -0
  34. package/dist/designer-DWnZZ_ej.cjs +2 -0
  35. package/dist/designer.cjs +1 -1
  36. package/dist/designer.d.cts +144 -4
  37. package/dist/designer.d.ts +144 -4
  38. package/dist/designer.js +6 -6
  39. package/dist/diagnostic-collector-1sqd7DQP.js +355 -0
  40. package/dist/diagnostic-collector-D3rlvxm3.cjs +1 -0
  41. package/dist/{dom-JWrchIre.js → dom-C90cTM6Y.js} +4 -4
  42. package/dist/dom-CxOkm_Sy.cjs +1 -0
  43. package/dist/{encoding-BefcaHdp.cjs → encoding-CkziAnZI.cjs} +1 -1
  44. package/dist/{encoding-CL6rXEkR.js → encoding-DSc9zv2F.js} +2 -2
  45. package/dist/{font-loader-Ga51c2VC.cjs → font-loader-D-znWNWS.cjs} +1 -1
  46. package/dist/{font-loader-BT5baV-o.js → font-loader-i7lZbqH_.js} +1 -1
  47. package/dist/{grid-strokes-EoY66L2f.js → grid-strokes-BPiV1WHe.js} +1 -1
  48. package/dist/grid-strokes-DYf-6DMl.cjs +1 -0
  49. package/dist/index.cjs +5 -5
  50. package/dist/index.d.cts +46 -7
  51. package/dist/index.d.ts +46 -7
  52. package/dist/index.js +69 -68
  53. package/dist/{json-snapshot-OqkPyUk5.js → json-snapshot-BJWZNryO.js} +919 -791
  54. package/dist/json-snapshot-C7QZrRBf.cjs +2 -0
  55. package/dist/{pdf-aobetCsy.js → pdf-0_5XiTCx.js} +2499 -2492
  56. package/dist/{pdf-HiEeXe9H.cjs → pdf-DWuq6uxx.cjs} +31 -31
  57. package/dist/pdf.cjs +1 -1
  58. package/dist/pdf.d.cts +18 -0
  59. package/dist/pdf.d.ts +18 -0
  60. package/dist/pdf.js +2 -2
  61. package/dist/{plugin-DeYYAL6F.js → plugin-B1ydqEmS.js} +1 -1
  62. package/dist/{plugin-BFANt-i8.cjs → plugin-BQBz2vLG.cjs} +1 -1
  63. package/dist/prefill-2p9wrpn9.cjs +1 -0
  64. package/dist/{prefill-Dk4C6S5R.js → prefill-Cuzh1wxf.js} +13 -13
  65. package/dist/prepared-CVbgO9KR.js +128 -0
  66. package/dist/prepared-DAwe8Il2.cjs +1 -0
  67. package/dist/protocol-BOri9qJL.js +105 -0
  68. package/dist/protocol-DD5dHSz-.cjs +1 -0
  69. package/dist/record-bindings-CAyM5tGg.cjs +1 -0
  70. package/dist/{record-bindings-DatJZv_e.js → record-bindings-fhav-NLG.js} +1 -1
  71. package/dist/{region-binding-workflow-DjrXuR1q.js → region-binding-workflow-Cm4mqhih.js} +2 -2
  72. package/dist/{region-binding-workflow-l7NGfagJ.cjs → region-binding-workflow-DWCUgjZl.cjs} +1 -1
  73. package/dist/report-encoding-worker.cjs +1 -1
  74. package/dist/report-encoding-worker.js +1 -1
  75. package/dist/rich-text-layout-X9YOz1JD.cjs +3 -0
  76. package/dist/{rich-text-layout-Ciwa6D2o.js → rich-text-layout-YJHtCWQI.js} +1 -1
  77. package/dist/runtime-BpSAgOw1.js +201 -0
  78. package/dist/runtime-Cd2UTnwe.cjs +1 -0
  79. package/dist/sbom.cdx.json +1 -1
  80. package/dist/server/node.d.cts +55 -7
  81. package/dist/server/node.d.ts +55 -7
  82. package/dist/server-node.cjs +5 -5
  83. package/dist/server-node.js +2710 -2418
  84. package/dist/server.cjs +1 -1
  85. package/dist/server.d.cts +47 -12
  86. package/dist/server.d.ts +47 -12
  87. package/dist/server.js +8 -8
  88. package/dist/style.css +1 -1
  89. package/dist/{template-catalog-CoT7jm_6.cjs → template-catalog--yBX169M.cjs} +1 -1
  90. package/dist/{template-catalog--cjxzgH7.js → template-catalog-Bu7s7ReF.js} +3 -3
  91. package/dist/template-fragments-5EzVn7bm.cjs +1 -0
  92. package/dist/{template-fragments-CPpGpQoz.js → template-fragments-Di2vDFnx.js} +2 -2
  93. package/dist/{template-registry-O0hNIOfB.js → template-registry-BCBF2b8j.js} +10 -10
  94. package/dist/template-registry-Bnh5aEYf.cjs +1 -0
  95. package/dist/textwrap-BPFxhpOw.cjs +4 -0
  96. package/dist/textwrap-CmVkhMhx.js +111 -0
  97. package/dist/vue/async.d.cts +104 -18
  98. package/dist/vue/async.d.ts +104 -18
  99. package/dist/vue/index.d.cts +134 -28
  100. package/dist/vue/index.d.ts +134 -28
  101. package/dist/vue-async.cjs +1 -1
  102. package/dist/vue-async.js +3 -3
  103. package/dist/vue.cjs +1 -1
  104. package/dist/vue.js +192 -162
  105. package/dist/{workbook-session-C9ZmCBwY.js → workbook-session-B6P_-5a4.js} +2 -2
  106. package/dist/{workbook-session-C6-SrnCT.cjs → workbook-session-BnPK3T58.cjs} +1 -1
  107. package/dist/worker.cjs +1 -1
  108. package/dist/worker.d.cts +55 -7
  109. package/dist/worker.d.ts +55 -7
  110. package/dist/worker.js +4 -4
  111. package/dist/xlsx.cjs +4 -4
  112. package/dist/xlsx.d.cts +18 -1
  113. package/dist/xlsx.d.ts +18 -1
  114. package/dist/xlsx.js +279 -272
  115. package/package.json +1 -1
  116. package/dist/ExcelBindingWizard-D4FLind-.js +0 -1485
  117. package/dist/ExcelBindingWizard-D4RS5Bpg.cjs +0 -1
  118. package/dist/ParamEditor-C-6C9rd2.cjs +0 -1
  119. package/dist/ParamEditor-CASZt-Ma.js +0 -732
  120. package/dist/ReportBatchPanel-Bq7t8a5r.js +0 -350
  121. package/dist/ReportBatchPanel-YVj5IO5y.cjs +0 -1
  122. package/dist/ReportLabelStudio-Cqhita1b.cjs +0 -1
  123. package/dist/ReportLabelStudio-Dj7GXhuv.js +0 -783
  124. package/dist/ReportParamPanel-DZbFVmDL.cjs +0 -1
  125. package/dist/ReportPreview-DeWzG8jQ.js +0 -6257
  126. package/dist/ReportPreview-FFIryrIr.cjs +0 -6
  127. package/dist/ReportTemplateLibrary-BaWodmpm.cjs +0 -1
  128. package/dist/ReportTemplateLibrary-DdAAAD2I.js +0 -311
  129. package/dist/RuleEditor-D2UwQGF6.js +0 -2341
  130. package/dist/RuleEditor-DcT9xI1v.cjs +0 -1
  131. package/dist/TemplateOutlinePanel-CUHFFiNM.cjs +0 -1
  132. package/dist/TemplateOutlinePanel-DrT7XN0m.js +0 -96
  133. package/dist/TemplateReusePanel-4eejkNqi.js +0 -388
  134. package/dist/TemplateReusePanel-DZMyiX5I.cjs +0 -1
  135. package/dist/TemplateReviewPanel-BIhNLeNw.js +0 -592
  136. package/dist/TemplateReviewPanel-DnYImiXu.cjs +0 -1
  137. package/dist/assets-D2gHc4Mz.cjs +0 -1
  138. package/dist/assets-T_gDeFaz.js +0 -132
  139. package/dist/auto-4pK9HePf.cjs +0 -1
  140. package/dist/capabilities-DiBj4Qgl.cjs +0 -1
  141. package/dist/capabilities-pg7j7VLT.js +0 -106
  142. package/dist/data-bar-CeZuFmYl.cjs +0 -1
  143. package/dist/designer-DhrE7jzw.js +0 -7169
  144. package/dist/designer-IAZu6kBX.cjs +0 -2
  145. package/dist/dom-ChE5D-L-.cjs +0 -1
  146. package/dist/grid-strokes-Be24LGuV.cjs +0 -1
  147. package/dist/json-snapshot-1tvQNzQE.cjs +0 -2
  148. package/dist/prefill-DsUD5OoK.cjs +0 -1
  149. package/dist/prepared-DCIxhKFo.js +0 -94
  150. package/dist/prepared-Dv-XM3i1.cjs +0 -1
  151. package/dist/progress-ByiOxUD3.js +0 -250
  152. package/dist/progress-WomPRP3B.cjs +0 -1
  153. package/dist/protocol-B9YgfQ_d.cjs +0 -1
  154. package/dist/protocol-DxeUKGYG.js +0 -90
  155. package/dist/record-bindings-MBxbeBsi.cjs +0 -1
  156. package/dist/rich-text-layout-DK7A_a5r.cjs +0 -3
  157. package/dist/runtime-75Y5Oq5B.js +0 -171
  158. package/dist/runtime-DKlGd_D4.cjs +0 -1
  159. package/dist/template-fragments-GVjpew_q.cjs +0 -1
  160. package/dist/template-registry-DI59PXVK.cjs +0 -1
  161. package/dist/textwrap-BIjtEWmq.js +0 -110
  162. package/dist/textwrap-Cy7o1hIR.cjs +0 -4
@@ -1,592 +0,0 @@
1
- import { shallowRef as q, ref as C, computed as P, watch as H, onBeforeUnmount as re, toRaw as ne, defineComponent as se, openBlock as r, createElementBlock as n, toDisplayString as t, createCommentVNode as v, Fragment as N, createElementVNode as l, createVNode as X, unref as s, createTextVNode as R, withDirectives as U, isRef as L, vModelSelect as oe, renderList as B, vModelText as Y, vModelCheckbox as Z, normalizeClass as K, createBlock as ue } from "vue";
2
- import { reviewReportTemplateAsync as ie, paginateTemplate as ce } from "@agile-team/mach-report";
3
- import { T as Q } from "./designer-DhrE7jzw.js";
4
- import { ReportPreview as ee } from "@agile-team/mach-report/vue";
5
- import { b as de } from "./template-serialization-CWmHq7lX.js";
6
- import { _ as le } from "./_plugin-vue_export-helper-8SL1F89S.js";
7
- function ve(o, d = () => o.fixtures) {
8
- const i = q(), u = q([]), e = C("20"), c = C(!1), g = C(!1), m = C(!1), _ = C(""), h = q(), w = C(!1), M = q(), b = P(
9
- () => new Set(
10
- o.document.template.pages.flatMap((f) => f.components).flatMap(
11
- (f) => f.kind === "list" && f.tree ? [f.dataset] : []
12
- )
13
- )
14
- ), A = P(() => b.value.size > 0);
15
- let k = 0, p;
16
- function j() {
17
- k++, p?.abort(), p = void 0, g.value = !1, w.value = !1, h.value = void 0, m.value = !!i.value, _.value = "";
18
- }
19
- for (const f of [() => o.document, () => o.previous])
20
- H(
21
- f,
22
- () => {
23
- c.value = !1, j();
24
- },
25
- { deep: !0, flush: "sync" }
26
- );
27
- for (const f of [
28
- () => o.datasets,
29
- () => o.dataSchemas,
30
- () => o.formats,
31
- d
32
- ])
33
- H(f, j, { deep: !0, flush: "sync" });
34
- H([e, c], j, { flush: "sync" }), re(() => {
35
- k++, p?.abort();
36
- });
37
- const z = P(
38
- () => i.value?.issues.filter((f) => f.severity === "error").length ?? 0
39
- );
40
- function F() {
41
- p?.abort(), p = new AbortController();
42
- const f = ++k, $ = p;
43
- g.value = !0, _.value = "", w.value = !1, h.value = void 0, J(f, $);
44
- }
45
- async function J(f, $) {
46
- try {
47
- const x = Number(e.value), G = Object.fromEntries(
48
- Object.entries(o.datasets ?? {}).map(([O, S]) => [
49
- O,
50
- x < 0 || b.value.has(O) ? S : S.slice(0, x)
51
- ])
52
- ), V = d(), T = V?.length ? [...V] : x === 0 ? [] : [{ name: e.value, datasets: G }], D = await ie(o.document, {
53
- previous: o.previous,
54
- dataSchemas: o.dataSchemas,
55
- formats: o.formats,
56
- allowBreakingChanges: c.value,
57
- ...!V?.length && A.value && x > 0 ? { maxSampleRows: x } : {},
58
- fixtures: T,
59
- signal: $.signal,
60
- onProgress: (O) => {
61
- f === k && (h.value = O);
62
- }
63
- });
64
- if (f !== k) return;
65
- i.value = D, m.value = !1, u.value = T, M.value = {
66
- requested: e.value,
67
- rows: D.samples.reduce((O, S) => O + S.rows, 0),
68
- datasets: new Set(
69
- T.flatMap((O) => Object.keys(O.datasets))
70
- ).size,
71
- formats: [...o.formats ?? []]
72
- };
73
- } catch (x) {
74
- f === k && !$.signal.aborted && (_.value = x instanceof Error ? x.message : String(x));
75
- } finally {
76
- f === k && (g.value = !1, p = void 0);
77
- }
78
- }
79
- function W() {
80
- k++, p?.abort(), p = void 0, g.value = !1, w.value = !0, h.value = void 0;
81
- }
82
- return {
83
- report: i,
84
- sampleSize: e,
85
- acknowledged: c,
86
- running: g,
87
- stale: m,
88
- failure: _,
89
- checkedScope: M,
90
- checkedFixtures: u,
91
- hasTree: A,
92
- errors: z,
93
- run: F,
94
- cancel: W,
95
- progress: h,
96
- cancelled: w
97
- };
98
- }
99
- function me(o) {
100
- const d = Object.getPrototypeOf(o);
101
- if (d !== Object.prototype && d !== Array.prototype && d !== null)
102
- throw new Error("Sample data must contain plain JSON objects");
103
- if (Object.getOwnPropertySymbols(o).length)
104
- throw new Error("Sample data must not contain symbols");
105
- if (Array.isArray(o) && Object.keys(o).length !== o.length)
106
- throw new Error("Sample arrays must not contain holes or extra properties");
107
- }
108
- function pe(o) {
109
- let d = 0, i = 0;
110
- const u = /* @__PURE__ */ new Set();
111
- function e(c, g) {
112
- if (++d > 1e5 || g > 32)
113
- throw new RangeError("Sample data exceeds the capture budget");
114
- if (typeof c == "string") {
115
- if (i += c.length, i > 2e6)
116
- throw new RangeError("Sample text exceeds the capture budget");
117
- return c;
118
- }
119
- if (c === null || typeof c == "boolean" || typeof c == "number" && Number.isFinite(c)) return c;
120
- if (!c || typeof c != "object")
121
- throw new Error("Sample data must contain plain JSON values");
122
- const m = ne(c);
123
- if (u.has(m))
124
- throw new Error("Sample data must not contain cycles");
125
- me(m), u.add(m);
126
- const _ = Array.isArray(m) ? [] : /* @__PURE__ */ Object.create(null);
127
- for (const h of Object.keys(m)) {
128
- const w = Object.getOwnPropertyDescriptor(m, h);
129
- if (w.get || w.set || ["__proto__", "constructor", "prototype"].includes(h))
130
- throw new Error("Sample data must not contain getters or unsafe keys");
131
- _[h] = e(
132
- w.value,
133
- g + 1
134
- );
135
- }
136
- return u.delete(m), _;
137
- }
138
- return e(o, 0);
139
- }
140
- function fe(o, d = () => Q) {
141
- const i = C([]), u = C(""), e = C(!1), c = C(""), g = C({}), m = P(() => [...o.fixtures ?? [], ...i.value]);
142
- function _() {
143
- c.value = "";
144
- try {
145
- if (!e.value) throw new Error(d().sampleConsentMissing);
146
- if (!u.value.trim()) throw new Error(d().sampleNameMissing);
147
- if (m.value.length >= 20) throw new Error(d().sampleLimit);
148
- if (m.value.some((M) => M.name === u.value.trim()))
149
- throw new Error(d().sampleNameDuplicate);
150
- const w = pe(o.datasets ?? {});
151
- if (Object.values(w).reduce((M, b) => M + b.length, 0) > 1e3)
152
- throw new Error(d().sampleRowsLimit);
153
- i.value.push({
154
- name: u.value.trim(),
155
- datasets: w,
156
- ...Object.keys(g.value).length ? { params: { ...g.value } } : {}
157
- }), u.value = "", e.value = !1;
158
- } catch (w) {
159
- c.value = w instanceof Error ? w.message : String(w);
160
- }
161
- }
162
- function h(w) {
163
- i.value.splice(w, 1);
164
- }
165
- return { fixtures: i, name: u, consent: e, failure: c, params: g, suite: m, capture: _, remove: h };
166
- }
167
- function te(o, d) {
168
- const i = ce(o.template, d.datasets, {
169
- maxPages: 100,
170
- maxCells: 25e4
171
- }), u = [
172
- ...new Set(
173
- de(o.template).flatMap(
174
- (e) => e.fields.map((c) => `${e.dataset}.${c.field}`)
175
- )
176
- )
177
- ];
178
- return {
179
- pages: i.plan.pages.length,
180
- dimensions: [
181
- ...new Set(
182
- i.plan.pages.map(
183
- (e) => `${e.pageWidthMm} × ${e.pageHeightMm} mm`
184
- )
185
- )
186
- ],
187
- fields: u,
188
- fetcher: async () => i.plan
189
- };
190
- }
191
- function he(o, d, i) {
192
- const u = te(o, d), e = i ? te(i, d) : void 0, c = new Set(e?.fields), g = new Set(u.fields);
193
- return {
194
- current: u,
195
- previous: e,
196
- addedFields: u.fields.filter((m) => !c.has(m)),
197
- removedFields: e?.fields.filter((m) => !g.has(m)) ?? []
198
- };
199
- }
200
- const we = ["aria-label"], ge = {
201
- key: 0,
202
- role: "alert"
203
- }, ye = { class: "mr-fixture-previews" }, be = { key: 0 }, _e = /* @__PURE__ */ se({
204
- __name: "TemplateFixtureComparison",
205
- props: {
206
- document: {},
207
- previous: {},
208
- fixture: {},
209
- messages: {}
210
- },
211
- setup(o) {
212
- const d = o, i = P(() => ({ ...Q, ...d.messages })), u = P(() => {
213
- try {
214
- return {
215
- result: he(
216
- d.document,
217
- d.fixture,
218
- d.previous
219
- )
220
- };
221
- } catch (e) {
222
- return { error: e instanceof Error ? e.message : String(e) };
223
- }
224
- });
225
- return (e, c) => (r(), n("section", {
226
- class: "mr-fixture-comparison",
227
- "aria-label": i.value.compare
228
- }, [
229
- u.value.error ? (r(), n("p", ge, t(u.value.error), 1)) : v("", !0),
230
- u.value.result ? (r(), n(N, { key: 1 }, [
231
- l("dl", null, [
232
- l("dt", null, t(i.value.pages), 1),
233
- l("dd", null, t(u.value.result.previous?.pages ?? "—") + " → " + t(u.value.result.current.pages), 1),
234
- l("dt", null, t(i.value.dimensions), 1),
235
- l("dd", null, t(u.value.result.previous?.dimensions.join(" / ") ?? "—") + " → " + t(u.value.result.current.dimensions.join(" / ")), 1),
236
- l("dt", null, t(i.value.fieldsAdded), 1),
237
- l("dd", null, t(u.value.result.addedFields.join("、") || "—"), 1),
238
- l("dt", null, t(i.value.fieldsRemoved), 1),
239
- l("dd", null, t(u.value.result.removedFields.join("、") || "—"), 1)
240
- ]),
241
- l("div", ye, [
242
- u.value.result.previous ? (r(), n("article", be, [
243
- l("h4", null, t(i.value.baselinePreview), 1),
244
- X(s(ee), {
245
- "report-id": "baseline",
246
- fetcher: u.value.result.previous.fetcher,
247
- "show-params": !1,
248
- "show-export": !1,
249
- "show-print": !1,
250
- "show-pdf-window": !1,
251
- editable: !1,
252
- "excel-import": !1,
253
- height: "400px"
254
- }, null, 8, ["fetcher"])
255
- ])) : v("", !0),
256
- l("article", null, [
257
- l("h4", null, t(i.value.draftPreview), 1),
258
- X(s(ee), {
259
- "report-id": "draft",
260
- fetcher: u.value.result.current.fetcher,
261
- "show-params": !1,
262
- "show-export": !1,
263
- "show-print": !1,
264
- "show-pdf-window": !1,
265
- editable: !1,
266
- "excel-import": !1,
267
- height: "400px"
268
- }, null, 8, ["fetcher"])
269
- ])
270
- ])
271
- ], 64)) : v("", !0)
272
- ], 8, we));
273
- }
274
- }), ke = /* @__PURE__ */ le(_e, [["__scopeId", "data-v-211ee4bf"]]), xe = ["aria-label", "aria-busy"], Se = {
275
- key: 0,
276
- role: "status"
277
- }, Ce = ["disabled"], Ee = {
278
- key: 0,
279
- class: "mr-review-stale",
280
- role: "status"
281
- }, je = { class: "mr-review-controls" }, Fe = ["aria-label", "disabled"], Oe = { value: "0" }, Te = { value: "20" }, Re = { value: "100" }, Ne = { value: "-1" }, Me = {
282
- key: 0,
283
- class: "mr-review-note"
284
- }, Pe = { class: "mr-review-fixtures" }, $e = { class: "mr-review-note" }, Ve = { key: 0 }, Ae = ["disabled", "onClick"], De = { class: "mr-review-fixture-form" }, Ue = ["placeholder", "disabled"], Be = { key: 0 }, ze = ["onUpdate:modelValue", "placeholder", "disabled"], Ie = { class: "mr-review-consent" }, qe = ["disabled"], Le = ["disabled"], He = {
285
- key: 1,
286
- role: "alert",
287
- class: "is-error"
288
- }, Je = {
289
- key: 1,
290
- class: "mr-review-note"
291
- }, We = {
292
- key: 2,
293
- class: "is-error",
294
- role: "alert"
295
- }, Ge = {
296
- key: 3,
297
- class: "mr-review-stale",
298
- role: "status"
299
- }, Ke = {
300
- key: 4,
301
- class: "mr-review-note"
302
- }, Qe = {
303
- key: 0,
304
- class: "mr-review-summary",
305
- role: "status"
306
- }, Xe = {
307
- key: 0,
308
- class: "mr-review-note"
309
- }, Ye = {
310
- key: 1,
311
- class: "mr-review-note"
312
- }, Ze = {
313
- key: 2,
314
- class: "mr-review-list"
315
- }, et = { key: 0 }, tt = ["onClick"], st = {
316
- key: 3,
317
- class: "mr-review-note"
318
- }, lt = {
319
- key: 4,
320
- class: "mr-review-ack"
321
- }, at = {
322
- key: 0,
323
- class: "mr-review-note"
324
- }, rt = {
325
- key: 1,
326
- class: "mr-review-list"
327
- }, nt = ["onClick"], ot = {
328
- key: 0,
329
- class: "mr-review-scope"
330
- }, ut = { key: 0 }, it = ["disabled", "onClick"], ct = { class: "mr-review-note" }, dt = /* @__PURE__ */ se({
331
- __name: "TemplateReviewPanel",
332
- props: {
333
- document: {},
334
- previous: {},
335
- datasets: {},
336
- dataSchemas: {},
337
- formats: {},
338
- fixtures: {},
339
- messages: {}
340
- },
341
- emits: ["locate"],
342
- setup(o, { emit: d }) {
343
- const i = o, u = d, e = P(() => ({ ...Q, ...i.messages })), {
344
- name: c,
345
- consent: g,
346
- failure: m,
347
- params: _,
348
- suite: h,
349
- capture: w,
350
- remove: M
351
- } = fe(i, () => e.value), {
352
- report: b,
353
- sampleSize: A,
354
- acknowledged: k,
355
- running: p,
356
- stale: j,
357
- failure: z,
358
- checkedScope: F,
359
- checkedFixtures: J,
360
- hasTree: W,
361
- errors: f,
362
- run: $,
363
- cancel: x,
364
- cancelled: G,
365
- progress: V
366
- } = ve(i, () => h.value), T = C(), D = P(
367
- () => J.value.find((S) => S.name === T.value)
368
- );
369
- H(j, (S) => {
370
- S && (T.value = void 0);
371
- });
372
- function O(S) {
373
- const y = /\.pages\[(\d+)\]\.components\[(\d+)\]/.exec(S);
374
- u("locate", {
375
- path: S,
376
- ...y ? { pageIndex: Number(y[1]), componentIndex: Number(y[2]) } : {}
377
- });
378
- }
379
- return (S, y) => (r(), n("section", {
380
- class: "mr-template-review",
381
- "aria-label": e.value.title,
382
- "aria-busy": s(p)
383
- }, [
384
- l("header", null, [
385
- l("strong", null, t(e.value.title), 1),
386
- s(p) && s(V) ? (r(), n("span", Se, t(s(V).completed) + " / " + t(s(V).total) + " " + t(e.value.progress), 1)) : v("", !0),
387
- s(p) ? (r(), n("button", {
388
- key: 1,
389
- type: "button",
390
- onClick: y[0] || (y[0] = //@ts-ignore
391
- (...a) => s(x) && s(x)(...a))
392
- }, t(e.value.cancel), 1)) : v("", !0),
393
- l("button", {
394
- type: "button",
395
- disabled: s(p),
396
- onClick: y[1] || (y[1] = //@ts-ignore
397
- (...a) => s($) && s($)(...a))
398
- }, t(s(p) ? e.value.running : e.value.run), 9, Ce)
399
- ]),
400
- s(G) ? (r(), n("p", Ee, t(e.value.cancelled), 1)) : v("", !0),
401
- l("div", je, [
402
- l("label", null, [
403
- R(t(e.value.samples), 1),
404
- U(l("select", {
405
- "onUpdate:modelValue": y[2] || (y[2] = (a) => L(A) ? A.value = a : null),
406
- "aria-label": e.value.samples,
407
- disabled: s(p) || !!s(h).length
408
- }, [
409
- l("option", Oe, t(e.value.none), 1),
410
- l("option", Te, t(e.value.first20), 1),
411
- l("option", Re, t(e.value.first100), 1),
412
- l("option", Ne, t(e.value.all), 1)
413
- ], 8, Fe), [
414
- [oe, s(A)]
415
- ])
416
- ]),
417
- s(h).length ? (r(), n("span", Me, t(e.value.namedFixtures) + " · " + t(s(h).length), 1)) : v("", !0)
418
- ]),
419
- l("details", Pe, [
420
- l("summary", null, [
421
- R(t(e.value.namedFixtures) + " ", 1),
422
- l("small", null, t(s(h).length) + " / 20", 1)
423
- ]),
424
- l("p", $e, t(e.value.fixtureHint), 1),
425
- s(h).length ? (r(), n("ul", Ve, [
426
- (r(!0), n(N, null, B(s(h), (a, E) => (r(), n("li", {
427
- key: a.name
428
- }, [
429
- l("strong", null, t(a.name), 1),
430
- l("span", null, t(Object.values(a.datasets).reduce(
431
- (I, ae) => I + ae.length,
432
- 0
433
- )) + " " + t(e.value.rows), 1),
434
- E >= (o.fixtures?.length ?? 0) ? (r(), n("button", {
435
- key: 0,
436
- type: "button",
437
- disabled: s(p),
438
- onClick: (I) => s(M)(E - (o.fixtures?.length ?? 0))
439
- }, t(e.value.remove), 9, Ae)) : v("", !0)
440
- ]))), 128))
441
- ])) : v("", !0),
442
- l("div", De, [
443
- l("label", null, [
444
- R(t(e.value.fixtureName), 1),
445
- U(l("input", {
446
- "onUpdate:modelValue": y[3] || (y[3] = (a) => L(c) ? c.value = a : null),
447
- placeholder: e.value.fixturePlaceholder,
448
- disabled: s(p)
449
- }, null, 8, Ue), [
450
- [Y, s(c)]
451
- ])
452
- ]),
453
- o.document.template.params?.length ? (r(), n("details", Be, [
454
- l("summary", null, t(e.value.parameters), 1),
455
- (r(!0), n(N, null, B(o.document.template.params, (a) => (r(), n("label", {
456
- key: a.field
457
- }, [
458
- R(t(a.label ?? a.field), 1),
459
- U(l("input", {
460
- "onUpdate:modelValue": (E) => s(_)[a.field] = E,
461
- placeholder: a.defaultValue,
462
- disabled: s(p)
463
- }, null, 8, ze), [
464
- [Y, s(_)[a.field]]
465
- ])
466
- ]))), 128))
467
- ])) : v("", !0),
468
- l("label", Ie, [
469
- U(l("input", {
470
- "onUpdate:modelValue": y[4] || (y[4] = (a) => L(g) ? g.value = a : null),
471
- type: "checkbox",
472
- disabled: s(p)
473
- }, null, 8, qe), [
474
- [Z, s(g)]
475
- ]),
476
- R(t(e.value.deidentified), 1)
477
- ]),
478
- l("button", {
479
- type: "button",
480
- disabled: s(p) || !s(g) || !s(c).trim() || s(h).length >= 20,
481
- onClick: y[5] || (y[5] = //@ts-ignore
482
- (...a) => s(w) && s(w)(...a))
483
- }, t(e.value.capture), 9, Le),
484
- s(m) ? (r(), n("p", He, t(s(m)), 1)) : v("", !0)
485
- ])
486
- ]),
487
- s(W) ? (r(), n("p", Je, t(e.value.treeHint), 1)) : v("", !0),
488
- s(z) ? (r(), n("p", We, t(s(z)), 1)) : v("", !0),
489
- s(j) ? (r(), n("p", Ge, t(e.value.stale), 1)) : v("", !0),
490
- s(b) ? (r(), n(N, { key: 5 }, [
491
- s(j) ? v("", !0) : (r(), n("div", Qe, [
492
- l("span", {
493
- class: K({ "is-error": s(f) })
494
- }, t(s(f)) + " " + t(e.value.errors), 3),
495
- l("span", null, t(s(b).issues.length - s(f)) + " " + t(e.value.warnings), 1)
496
- ])),
497
- l("section", null, [
498
- l("h3", null, [
499
- R(t(e.value.changes) + " ", 1),
500
- l("small", null, t(s(b).changes?.totalChanges ?? 0), 1)
501
- ]),
502
- o.previous ? s(b).changes?.totalChanges ? (r(), n("ol", Ze, [
503
- (r(!0), n(N, null, B(s(b).changes?.changes, (a, E) => (r(), n("li", { key: E }, [
504
- l("div", null, [
505
- l("span", null, t(e.value.categories[a.category]) + " · " + t(e.value.kinds[a.kind]), 1),
506
- a.breaking ? (r(), n("b", et, t(e.value.breaking), 1)) : v("", !0),
507
- l("button", {
508
- type: "button",
509
- onClick: (I) => O(a.path)
510
- }, t(e.value.locate), 9, tt)
511
- ]),
512
- l("code", null, t(a.path), 1),
513
- l("dl", null, [
514
- a.before !== void 0 ? (r(), n(N, { key: 0 }, [
515
- l("dt", null, t(e.value.before), 1),
516
- l("dd", null, t(a.before), 1)
517
- ], 64)) : v("", !0),
518
- a.after !== void 0 ? (r(), n(N, { key: 1 }, [
519
- l("dt", null, t(e.value.after), 1),
520
- l("dd", null, t(a.after), 1)
521
- ], 64)) : v("", !0)
522
- ])
523
- ]))), 128))
524
- ])) : (r(), n("p", Ye, t(e.value.noChanges), 1)) : (r(), n("p", Xe, t(e.value.baseline), 1)),
525
- s(b).changes?.truncated ? (r(), n("p", st, t(e.value.truncated), 1)) : v("", !0),
526
- s(b).changes?.breakingChanges ? (r(), n("label", lt, [
527
- U(l("input", {
528
- "onUpdate:modelValue": y[6] || (y[6] = (a) => L(k) ? k.value = a : null),
529
- type: "checkbox"
530
- }, null, 512), [
531
- [Z, s(k)]
532
- ]),
533
- R(t(e.value.acknowledge), 1)
534
- ])) : v("", !0)
535
- ]),
536
- l("section", null, [
537
- l("h3", null, t(e.value.issues), 1),
538
- s(b).issues.length ? (r(), n("ol", rt, [
539
- (r(!0), n(N, null, B(s(b).issues, (a, E) => (r(), n("li", { key: E }, [
540
- l("div", null, [
541
- l("span", {
542
- class: K({ "is-error": a.severity === "error" })
543
- }, t(a.severity === "error" ? e.value.errors : e.value.warnings), 3),
544
- l("button", {
545
- type: "button",
546
- onClick: (I) => u("locate", a)
547
- }, t(e.value.locate), 9, nt)
548
- ]),
549
- l("p", null, t(a.message), 1),
550
- l("code", null, t(a.path), 1)
551
- ]))), 128))
552
- ])) : (r(), n("p", at, t(e.value.noIssues), 1))
553
- ]),
554
- s(b).samples.length ? (r(), n("section", {
555
- key: 1,
556
- class: K({ "is-stale": s(j) })
557
- }, [
558
- l("h3", null, t(e.value.results), 1),
559
- s(F) ? (r(), n("p", ot, [
560
- R(t(e.value.scope) + " · " + t(s(h).length ? e.value.namedFixtures : s(F).requested === "-1" ? e.value.all : s(F).requested === "0" ? e.value.none : s(F).requested + " " + e.value.rows) + " · " + t(s(F).datasets) + " " + t(e.value.datasets) + " · " + t(s(F).rows) + " " + t(e.value.rows), 1),
561
- s(F).formats.length ? (r(), n("span", ut, " · " + t(s(F).formats.join(" / ")), 1)) : v("", !0)
562
- ])) : v("", !0),
563
- (r(!0), n(N, null, B(s(b).samples, (a) => (r(), n("div", {
564
- key: a.name,
565
- class: "mr-review-sample"
566
- }, [
567
- l("p", null, [
568
- l("strong", null, t(a.name), 1),
569
- R(" · " + t(a.rows) + " " + t(e.value.rows) + " · " + t(a.pages) + " " + t(e.value.pages) + " · " + t(s(b).issues.filter((E) => E.fixture === a.name).length) + " " + t(e.value.issues), 1)
570
- ]),
571
- l("button", {
572
- type: "button",
573
- disabled: s(j) || s(p),
574
- onClick: (E) => T.value = T.value === a.name ? void 0 : a.name
575
- }, t(T.value === a.name ? e.value.closeCompare : e.value.compare), 9, it)
576
- ]))), 128))
577
- ], 2)) : v("", !0),
578
- D.value && !s(j) ? (r(), ue(ke, {
579
- key: 2,
580
- document: o.document,
581
- previous: o.previous,
582
- fixture: D.value,
583
- messages: o.messages
584
- }, null, 8, ["document", "previous", "fixture", "messages"])) : v("", !0),
585
- l("p", ct, t(e.value.checked), 1)
586
- ], 64)) : (r(), n("p", Ke, t(e.value.empty), 1))
587
- ], 8, xe));
588
- }
589
- }), gt = /* @__PURE__ */ le(dt, [["__scopeId", "data-v-0a5dda64"]]);
590
- export {
591
- gt as default
592
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),A=require("@agile-team/mach-report"),j=require("./designer-IAZu6kBX.cjs"),O=require("@agile-team/mach-report/vue"),L=require("./template-serialization-CqQY4zDg.cjs"),$=require("./_plugin-vue_export-helper-BLmdZLlg.cjs");function z(r,s=()=>r.fixtures){const o=e.shallowRef(),n=e.shallowRef([]),t=e.ref("20"),a=e.ref(!1),p=e.ref(!1),i=e.ref(!1),g=e.ref(""),d=e.shallowRef(),m=e.ref(!1),D=e.shallowRef(),v=e.computed(()=>new Set(r.document.template.pages.flatMap(u=>u.components).flatMap(u=>u.kind==="list"&&u.tree?[u.dataset]:[]))),B=e.computed(()=>v.value.size>0);let y=0,c;function S(){y++,c?.abort(),c=void 0,p.value=!1,m.value=!1,d.value=void 0,i.value=!!o.value,g.value=""}for(const u of[()=>r.document,()=>r.previous])e.watch(u,()=>{a.value=!1,S()},{deep:!0,flush:"sync"});for(const u of[()=>r.datasets,()=>r.dataSchemas,()=>r.formats,s])e.watch(u,S,{deep:!0,flush:"sync"});e.watch([t,a],S,{flush:"sync"}),e.onBeforeUnmount(()=>{y++,c?.abort()});const C=e.computed(()=>o.value?.issues.filter(u=>u.severity==="error").length??0);function w(){c?.abort(),c=new AbortController;const u=++y,_=c;p.value=!0,g.value="",m.value=!1,d.value=void 0,F(u,_)}async function F(u,_){try{const k=Number(t.value),M=Object.fromEntries(Object.entries(r.datasets??{}).map(([V,h])=>[V,k<0||v.value.has(V)?h:h.slice(0,k)])),b=s(),N=b?.length?[...b]:k===0?[]:[{name:t.value,datasets:M}],x=await A.reviewReportTemplateAsync(r.document,{previous:r.previous,dataSchemas:r.dataSchemas,formats:r.formats,allowBreakingChanges:a.value,...!b?.length&&B.value&&k>0?{maxSampleRows:k}:{},fixtures:N,signal:_.signal,onProgress:V=>{u===y&&(d.value=V)}});if(u!==y)return;o.value=x,i.value=!1,n.value=N,D.value={requested:t.value,rows:x.samples.reduce((V,h)=>V+h.rows,0),datasets:new Set(N.flatMap(V=>Object.keys(V.datasets))).size,formats:[...r.formats??[]]}}catch(k){u===y&&!_.signal.aborted&&(g.value=k instanceof Error?k.message:String(k))}finally{u===y&&(p.value=!1,c=void 0)}}function R(){y++,c?.abort(),c=void 0,p.value=!1,m.value=!0,d.value=void 0}return{report:o,sampleSize:t,acknowledged:a,running:p,stale:i,failure:g,checkedScope:D,checkedFixtures:n,hasTree:B,errors:C,run:w,cancel:R,progress:d,cancelled:m}}function I(r){const s=Object.getPrototypeOf(r);if(s!==Object.prototype&&s!==Array.prototype&&s!==null)throw new Error("Sample data must contain plain JSON objects");if(Object.getOwnPropertySymbols(r).length)throw new Error("Sample data must not contain symbols");if(Array.isArray(r)&&Object.keys(r).length!==r.length)throw new Error("Sample arrays must not contain holes or extra properties")}function U(r){let s=0,o=0;const n=new Set;function t(a,p){if(++s>1e5||p>32)throw new RangeError("Sample data exceeds the capture budget");if(typeof a=="string"){if(o+=a.length,o>2e6)throw new RangeError("Sample text exceeds the capture budget");return a}if(a===null||typeof a=="boolean"||typeof a=="number"&&Number.isFinite(a))return a;if(!a||typeof a!="object")throw new Error("Sample data must contain plain JSON values");const i=e.toRaw(a);if(n.has(i))throw new Error("Sample data must not contain cycles");I(i),n.add(i);const g=Array.isArray(i)?[]:Object.create(null);for(const d of Object.keys(i)){const m=Object.getOwnPropertyDescriptor(i,d);if(m.get||m.set||["__proto__","constructor","prototype"].includes(d))throw new Error("Sample data must not contain getters or unsafe keys");g[d]=t(m.value,p+1)}return n.delete(i),g}return t(r,0)}function H(r,s=()=>j.TEMPLATE_REVIEW_MESSAGES){const o=e.ref([]),n=e.ref(""),t=e.ref(!1),a=e.ref(""),p=e.ref({}),i=e.computed(()=>[...r.fixtures??[],...o.value]);function g(){a.value="";try{if(!t.value)throw new Error(s().sampleConsentMissing);if(!n.value.trim())throw new Error(s().sampleNameMissing);if(i.value.length>=20)throw new Error(s().sampleLimit);if(i.value.some(D=>D.name===n.value.trim()))throw new Error(s().sampleNameDuplicate);const m=U(r.datasets??{});if(Object.values(m).reduce((D,v)=>D+v.length,0)>1e3)throw new Error(s().sampleRowsLimit);o.value.push({name:n.value.trim(),datasets:m,...Object.keys(p.value).length?{params:{...p.value}}:{}}),n.value="",t.value=!1}catch(m){a.value=m instanceof Error?m.message:String(m)}}function d(m){o.value.splice(m,1)}return{fixtures:o,name:n,consent:t,failure:a,params:p,suite:i,capture:g,remove:d}}function P(r,s){const o=A.paginateTemplate(r.template,s.datasets,{maxPages:100,maxCells:25e4}),n=[...new Set(L.collectTemplateDatasetBindings(r.template).flatMap(t=>t.fields.map(a=>`${t.dataset}.${a.field}`)))];return{pages:o.plan.pages.length,dimensions:[...new Set(o.plan.pages.map(t=>`${t.pageWidthMm} × ${t.pageHeightMm} mm`))],fields:n,fetcher:async()=>o.plan}}function W(r,s,o){const n=P(r,s),t=o?P(o,s):void 0,a=new Set(t?.fields),p=new Set(n.fields);return{current:n,previous:t,addedFields:n.fields.filter(i=>!a.has(i)),removedFields:t?.fields.filter(i=>!p.has(i))??[]}}const G=["aria-label"],J={key:0,role:"alert"},K={class:"mr-fixture-previews"},Q={key:0},X=e.defineComponent({__name:"TemplateFixtureComparison",props:{document:{},previous:{},fixture:{},messages:{}},setup(r){const s=r,o=e.computed(()=>({...j.TEMPLATE_REVIEW_MESSAGES,...s.messages})),n=e.computed(()=>{try{return{result:W(s.document,s.fixture,s.previous)}}catch(t){return{error:t instanceof Error?t.message:String(t)}}});return(t,a)=>(e.openBlock(),e.createElementBlock("section",{class:"mr-fixture-comparison","aria-label":o.value.compare},[n.value.error?(e.openBlock(),e.createElementBlock("p",J,e.toDisplayString(n.value.error),1)):e.createCommentVNode("",!0),n.value.result?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("dl",null,[e.createElementVNode("dt",null,e.toDisplayString(o.value.pages),1),e.createElementVNode("dd",null,e.toDisplayString(n.value.result.previous?.pages??"—")+" → "+e.toDisplayString(n.value.result.current.pages),1),e.createElementVNode("dt",null,e.toDisplayString(o.value.dimensions),1),e.createElementVNode("dd",null,e.toDisplayString(n.value.result.previous?.dimensions.join(" / ")??"—")+" → "+e.toDisplayString(n.value.result.current.dimensions.join(" / ")),1),e.createElementVNode("dt",null,e.toDisplayString(o.value.fieldsAdded),1),e.createElementVNode("dd",null,e.toDisplayString(n.value.result.addedFields.join("、")||"—"),1),e.createElementVNode("dt",null,e.toDisplayString(o.value.fieldsRemoved),1),e.createElementVNode("dd",null,e.toDisplayString(n.value.result.removedFields.join("、")||"—"),1)]),e.createElementVNode("div",K,[n.value.result.previous?(e.openBlock(),e.createElementBlock("article",Q,[e.createElementVNode("h4",null,e.toDisplayString(o.value.baselinePreview),1),e.createVNode(e.unref(O.ReportPreview),{"report-id":"baseline",fetcher:n.value.result.previous.fetcher,"show-params":!1,"show-export":!1,"show-print":!1,"show-pdf-window":!1,editable:!1,"excel-import":!1,height:"400px"},null,8,["fetcher"])])):e.createCommentVNode("",!0),e.createElementVNode("article",null,[e.createElementVNode("h4",null,e.toDisplayString(o.value.draftPreview),1),e.createVNode(e.unref(O.ReportPreview),{"report-id":"draft",fetcher:n.value.result.current.fetcher,"show-params":!1,"show-export":!1,"show-print":!1,"show-pdf-window":!1,editable:!1,"excel-import":!1,height:"400px"},null,8,["fetcher"])])])],64)):e.createCommentVNode("",!0)],8,G))}}),Y=$._export_sfc(X,[["__scopeId","data-v-211ee4bf"]]),Z=["aria-label","aria-busy"],ee={key:0,role:"status"},te=["disabled"],le={key:0,class:"mr-review-stale",role:"status"},re={class:"mr-review-controls"},ne=["aria-label","disabled"],oe={value:"0"},ae={value:"20"},se={value:"100"},ie={value:"-1"},ce={key:0,class:"mr-review-note"},ue={class:"mr-review-fixtures"},de={class:"mr-review-note"},me={key:0},pe=["disabled","onClick"],fe={class:"mr-review-fixture-form"},ve=["placeholder","disabled"],ge={key:0},ye=["onUpdate:modelValue","placeholder","disabled"],ke={class:"mr-review-consent"},he=["disabled"],Ee=["disabled"],Se={key:1,role:"alert",class:"is-error"},we={key:1,class:"mr-review-note"},Ve={key:2,class:"is-error",role:"alert"},Ne={key:3,class:"mr-review-stale",role:"status"},De={key:4,class:"mr-review-note"},_e={key:0,class:"mr-review-summary",role:"status"},be={key:0,class:"mr-review-note"},Be={key:1,class:"mr-review-note"},xe={key:2,class:"mr-review-list"},Ce={key:0},Te=["onClick"],Fe={key:3,class:"mr-review-note"},Re={key:4,class:"mr-review-ack"},Me={key:0,class:"mr-review-note"},je={key:1,class:"mr-review-list"},Oe=["onClick"],Pe={key:0,class:"mr-review-scope"},Ae={key:0},$e=["disabled","onClick"],qe={class:"mr-review-note"},Le=e.defineComponent({__name:"TemplateReviewPanel",props:{document:{},previous:{},datasets:{},dataSchemas:{},formats:{},fixtures:{},messages:{}},emits:["locate"],setup(r,{emit:s}){const o=r,n=s,t=e.computed(()=>({...j.TEMPLATE_REVIEW_MESSAGES,...o.messages})),{name:a,consent:p,failure:i,params:g,suite:d,capture:m,remove:D}=H(o,()=>t.value),{report:v,sampleSize:B,acknowledged:y,running:c,stale:S,failure:C,checkedScope:w,checkedFixtures:F,hasTree:R,errors:u,run:_,cancel:k,cancelled:M,progress:b}=z(o,()=>d.value),N=e.ref(),x=e.computed(()=>F.value.find(h=>h.name===N.value));e.watch(S,h=>{h&&(N.value=void 0)});function V(h){const f=/\.pages\[(\d+)\]\.components\[(\d+)\]/.exec(h);n("locate",{path:h,...f?{pageIndex:Number(f[1]),componentIndex:Number(f[2])}:{}})}return(h,f)=>(e.openBlock(),e.createElementBlock("section",{class:"mr-template-review","aria-label":t.value.title,"aria-busy":e.unref(c)},[e.createElementVNode("header",null,[e.createElementVNode("strong",null,e.toDisplayString(t.value.title),1),e.unref(c)&&e.unref(b)?(e.openBlock(),e.createElementBlock("span",ee,e.toDisplayString(e.unref(b).completed)+" / "+e.toDisplayString(e.unref(b).total)+" "+e.toDisplayString(t.value.progress),1)):e.createCommentVNode("",!0),e.unref(c)?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",onClick:f[0]||(f[0]=(...l)=>e.unref(k)&&e.unref(k)(...l))},e.toDisplayString(t.value.cancel),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",disabled:e.unref(c),onClick:f[1]||(f[1]=(...l)=>e.unref(_)&&e.unref(_)(...l))},e.toDisplayString(e.unref(c)?t.value.running:t.value.run),9,te)]),e.unref(M)?(e.openBlock(),e.createElementBlock("p",le,e.toDisplayString(t.value.cancelled),1)):e.createCommentVNode("",!0),e.createElementVNode("div",re,[e.createElementVNode("label",null,[e.createTextVNode(e.toDisplayString(t.value.samples),1),e.withDirectives(e.createElementVNode("select",{"onUpdate:modelValue":f[2]||(f[2]=l=>e.isRef(B)?B.value=l:null),"aria-label":t.value.samples,disabled:e.unref(c)||!!e.unref(d).length},[e.createElementVNode("option",oe,e.toDisplayString(t.value.none),1),e.createElementVNode("option",ae,e.toDisplayString(t.value.first20),1),e.createElementVNode("option",se,e.toDisplayString(t.value.first100),1),e.createElementVNode("option",ie,e.toDisplayString(t.value.all),1)],8,ne),[[e.vModelSelect,e.unref(B)]])]),e.unref(d).length?(e.openBlock(),e.createElementBlock("span",ce,e.toDisplayString(t.value.namedFixtures)+" · "+e.toDisplayString(e.unref(d).length),1)):e.createCommentVNode("",!0)]),e.createElementVNode("details",ue,[e.createElementVNode("summary",null,[e.createTextVNode(e.toDisplayString(t.value.namedFixtures)+" ",1),e.createElementVNode("small",null,e.toDisplayString(e.unref(d).length)+" / 20",1)]),e.createElementVNode("p",de,e.toDisplayString(t.value.fixtureHint),1),e.unref(d).length?(e.openBlock(),e.createElementBlock("ul",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d),(l,E)=>(e.openBlock(),e.createElementBlock("li",{key:l.name},[e.createElementVNode("strong",null,e.toDisplayString(l.name),1),e.createElementVNode("span",null,e.toDisplayString(Object.values(l.datasets).reduce((T,q)=>T+q.length,0))+" "+e.toDisplayString(t.value.rows),1),E>=(r.fixtures?.length??0)?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",disabled:e.unref(c),onClick:T=>e.unref(D)(E-(r.fixtures?.length??0))},e.toDisplayString(t.value.remove),9,pe)):e.createCommentVNode("",!0)]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("div",fe,[e.createElementVNode("label",null,[e.createTextVNode(e.toDisplayString(t.value.fixtureName),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[3]||(f[3]=l=>e.isRef(a)?a.value=l:null),placeholder:t.value.fixturePlaceholder,disabled:e.unref(c)},null,8,ve),[[e.vModelText,e.unref(a)]])]),r.document.template.params?.length?(e.openBlock(),e.createElementBlock("details",ge,[e.createElementVNode("summary",null,e.toDisplayString(t.value.parameters),1),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.document.template.params,l=>(e.openBlock(),e.createElementBlock("label",{key:l.field},[e.createTextVNode(e.toDisplayString(l.label??l.field),1),e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":E=>e.unref(g)[l.field]=E,placeholder:l.defaultValue,disabled:e.unref(c)},null,8,ye),[[e.vModelText,e.unref(g)[l.field]]])]))),128))])):e.createCommentVNode("",!0),e.createElementVNode("label",ke,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[4]||(f[4]=l=>e.isRef(p)?p.value=l:null),type:"checkbox",disabled:e.unref(c)},null,8,he),[[e.vModelCheckbox,e.unref(p)]]),e.createTextVNode(e.toDisplayString(t.value.deidentified),1)]),e.createElementVNode("button",{type:"button",disabled:e.unref(c)||!e.unref(p)||!e.unref(a).trim()||e.unref(d).length>=20,onClick:f[5]||(f[5]=(...l)=>e.unref(m)&&e.unref(m)(...l))},e.toDisplayString(t.value.capture),9,Ee),e.unref(i)?(e.openBlock(),e.createElementBlock("p",Se,e.toDisplayString(e.unref(i)),1)):e.createCommentVNode("",!0)])]),e.unref(R)?(e.openBlock(),e.createElementBlock("p",we,e.toDisplayString(t.value.treeHint),1)):e.createCommentVNode("",!0),e.unref(C)?(e.openBlock(),e.createElementBlock("p",Ve,e.toDisplayString(e.unref(C)),1)):e.createCommentVNode("",!0),e.unref(S)?(e.openBlock(),e.createElementBlock("p",Ne,e.toDisplayString(t.value.stale),1)):e.createCommentVNode("",!0),e.unref(v)?(e.openBlock(),e.createElementBlock(e.Fragment,{key:5},[e.unref(S)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("span",{class:e.normalizeClass({"is-error":e.unref(u)})},e.toDisplayString(e.unref(u))+" "+e.toDisplayString(t.value.errors),3),e.createElementVNode("span",null,e.toDisplayString(e.unref(v).issues.length-e.unref(u))+" "+e.toDisplayString(t.value.warnings),1)])),e.createElementVNode("section",null,[e.createElementVNode("h3",null,[e.createTextVNode(e.toDisplayString(t.value.changes)+" ",1),e.createElementVNode("small",null,e.toDisplayString(e.unref(v).changes?.totalChanges??0),1)]),r.previous?e.unref(v).changes?.totalChanges?(e.openBlock(),e.createElementBlock("ol",xe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v).changes?.changes,(l,E)=>(e.openBlock(),e.createElementBlock("li",{key:E},[e.createElementVNode("div",null,[e.createElementVNode("span",null,e.toDisplayString(t.value.categories[l.category])+" · "+e.toDisplayString(t.value.kinds[l.kind]),1),l.breaking?(e.openBlock(),e.createElementBlock("b",Ce,e.toDisplayString(t.value.breaking),1)):e.createCommentVNode("",!0),e.createElementVNode("button",{type:"button",onClick:T=>V(l.path)},e.toDisplayString(t.value.locate),9,Te)]),e.createElementVNode("code",null,e.toDisplayString(l.path),1),e.createElementVNode("dl",null,[l.before!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createElementVNode("dt",null,e.toDisplayString(t.value.before),1),e.createElementVNode("dd",null,e.toDisplayString(l.before),1)],64)):e.createCommentVNode("",!0),l.after!==void 0?(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("dt",null,e.toDisplayString(t.value.after),1),e.createElementVNode("dd",null,e.toDisplayString(l.after),1)],64)):e.createCommentVNode("",!0)])]))),128))])):(e.openBlock(),e.createElementBlock("p",Be,e.toDisplayString(t.value.noChanges),1)):(e.openBlock(),e.createElementBlock("p",be,e.toDisplayString(t.value.baseline),1)),e.unref(v).changes?.truncated?(e.openBlock(),e.createElementBlock("p",Fe,e.toDisplayString(t.value.truncated),1)):e.createCommentVNode("",!0),e.unref(v).changes?.breakingChanges?(e.openBlock(),e.createElementBlock("label",Re,[e.withDirectives(e.createElementVNode("input",{"onUpdate:modelValue":f[6]||(f[6]=l=>e.isRef(y)?y.value=l:null),type:"checkbox"},null,512),[[e.vModelCheckbox,e.unref(y)]]),e.createTextVNode(e.toDisplayString(t.value.acknowledge),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("section",null,[e.createElementVNode("h3",null,e.toDisplayString(t.value.issues),1),e.unref(v).issues.length?(e.openBlock(),e.createElementBlock("ol",je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v).issues,(l,E)=>(e.openBlock(),e.createElementBlock("li",{key:E},[e.createElementVNode("div",null,[e.createElementVNode("span",{class:e.normalizeClass({"is-error":l.severity==="error"})},e.toDisplayString(l.severity==="error"?t.value.errors:t.value.warnings),3),e.createElementVNode("button",{type:"button",onClick:T=>n("locate",l)},e.toDisplayString(t.value.locate),9,Oe)]),e.createElementVNode("p",null,e.toDisplayString(l.message),1),e.createElementVNode("code",null,e.toDisplayString(l.path),1)]))),128))])):(e.openBlock(),e.createElementBlock("p",Me,e.toDisplayString(t.value.noIssues),1))]),e.unref(v).samples.length?(e.openBlock(),e.createElementBlock("section",{key:1,class:e.normalizeClass({"is-stale":e.unref(S)})},[e.createElementVNode("h3",null,e.toDisplayString(t.value.results),1),e.unref(w)?(e.openBlock(),e.createElementBlock("p",Pe,[e.createTextVNode(e.toDisplayString(t.value.scope)+" · "+e.toDisplayString(e.unref(d).length?t.value.namedFixtures:e.unref(w).requested==="-1"?t.value.all:e.unref(w).requested==="0"?t.value.none:e.unref(w).requested+" "+t.value.rows)+" · "+e.toDisplayString(e.unref(w).datasets)+" "+e.toDisplayString(t.value.datasets)+" · "+e.toDisplayString(e.unref(w).rows)+" "+e.toDisplayString(t.value.rows),1),e.unref(w).formats.length?(e.openBlock(),e.createElementBlock("span",Ae," · "+e.toDisplayString(e.unref(w).formats.join(" / ")),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(v).samples,l=>(e.openBlock(),e.createElementBlock("div",{key:l.name,class:"mr-review-sample"},[e.createElementVNode("p",null,[e.createElementVNode("strong",null,e.toDisplayString(l.name),1),e.createTextVNode(" · "+e.toDisplayString(l.rows)+" "+e.toDisplayString(t.value.rows)+" · "+e.toDisplayString(l.pages)+" "+e.toDisplayString(t.value.pages)+" · "+e.toDisplayString(e.unref(v).issues.filter(E=>E.fixture===l.name).length)+" "+e.toDisplayString(t.value.issues),1)]),e.createElementVNode("button",{type:"button",disabled:e.unref(S)||e.unref(c),onClick:E=>N.value=N.value===l.name?void 0:l.name},e.toDisplayString(N.value===l.name?t.value.closeCompare:t.value.compare),9,$e)]))),128))],2)):e.createCommentVNode("",!0),x.value&&!e.unref(S)?(e.openBlock(),e.createBlock(Y,{key:2,document:r.document,previous:r.previous,fixture:x.value,messages:r.messages},null,8,["document","previous","fixture","messages"])):e.createCommentVNode("",!0),e.createElementVNode("p",qe,e.toDisplayString(t.value.checked),1)],64)):(e.openBlock(),e.createElementBlock("p",De,e.toDisplayString(t.value.empty),1))],8,Z))}}),ze=$._export_sfc(Le,[["__scopeId","data-v-0a5dda64"]]);exports.default=ze;
@@ -1 +0,0 @@
1
- "use strict";const h=require("./progress-WomPRP3B.cjs"),w=require("./capabilities-DiBj4Qgl.cjs"),y=require("./media-B7vnpD8k.cjs");class b extends Error{constructor(t,r){super(t.message),this.name="OutputAssetError",this.diagnostic=t,this.cause=r}}function p(e){if(e.aborted)throw e.reason??new DOMException("The operation was aborted.","AbortError")}function I(e){const t={maxAssets:1e3,maxImageBytes:33554432,maxTotalImageBytes:134217728,maxDurationMs:3e4,...e.assetBudget};for(const[r,a]of Object.entries(t))if(!Number.isSafeInteger(a)||a<=0||a>2147483647)throw new RangeError(`${r} must be a positive safe integer at most 2147483647.`);return t}function v(e){const t=/^data:image\/[a-z0-9.+-]+(;base64)?,(.*)$/is.exec(e);if(!t)throw new TypeError("Asset renderers must return an image data URL.");return t[1]?Math.ceil(t[2].length*3/4):new TextEncoder().encode(decodeURIComponent(t[2])).byteLength}function l(e,t,r,a,i){const n={code:r,message:a,severity:"warning",format:e.options.format??"dom",pageIndex:t.pageIndex,componentIndex:t.componentIndex,componentPath:t.componentPath,kind:t.component.kind,nid:t.component.nid};if(e.diagnostics.push(n),w.notifyOutputDiagnostic(n,{...e.options,signal:e.signal}),e.options.assetFailure!=="placeholder")throw new b(n,i)}async function E(e,t,r){const a=e.options.assetRegistry?.rendererFor(t)??e.options.assetRenderers?.[t.kind];if(t.imageData||!a)return t.imageData;if(++e.rendered>e.budget.maxAssets)return l(e,r,"asset-budget-exceeded","Output exceeded the asset count budget.");let i;try{if(e.active=r,i=await h.waitForOutput(a({...r,signal:e.signal}),e.signal),p(e.signal),i.length>e.budget.maxImageBytes*4+1024)return l(e,r,"asset-budget-exceeded","Output exceeded the image payload byte budget.");const n=v(i);if(n>e.budget.maxImageBytes||e.bytes+n>e.budget.maxTotalImageBytes)return l(e,r,"asset-budget-exceeded","Output exceeded the encoded image byte budget.");/^data:image\/(png|jpe?g);base64,/i.test(i)&&e.inspectImage(i),e.bytes+=n}catch(n){if(e.signal.aborted||n instanceof b||n instanceof y.ImageMediaError&&n.code==="image-budget-exceeded")throw n;return l(e,r,"asset-render-failed",`Asset renderer failed for ${t.kind}; output was not silently omitted.`,n)}return i}function A(e,t){const r=e.active;if(!r){t.abort(new Error("Asset rendering exceeded maxDurationMs."));return}const a={code:"asset-budget-exceeded",message:"Asset rendering exceeded maxDurationMs.",severity:"warning",format:e.options.format??"dom",pageIndex:r.pageIndex,componentIndex:r.componentIndex,componentPath:r.componentPath,kind:r.component.kind,nid:r.component.nid};e.diagnostics.push(a);try{w.notifyOutputDiagnostic(a,{...e.options,signal:e.signal})}catch(i){t.abort(i);return}t.abort(new b(a))}async function O(e,t,r,a,i){if(!t?.children?.length)return t;const n=[];for(const[s,c]of t.children.entries())n.push(await x(e,c,{...r,component:c,componentPath:[...a,s]},i));return n.some((s,c)=>s!==t.children[c])?{...t,children:n}:t}async function x(e,t,r,a){if(p(e.signal),a.has(t))throw new TypeError("Cyclic grid children cannot be rendered.");let i=e.cache.get(t);i||(i=E(e,t,r),e.cache.set(t,i));const n=await i;p(e.signal);let s=t.grid;if(s){const c=new Set(a).add(t),d=[];for(const[u,o]of s.cells.entries()){if(!o.some(m=>m?.children?.length)){d.push(o);continue}const f=[];for(const[m,g]of o.entries())f.push(g?.children?.length?await O(e,g,r,[...r.componentPath,u,m],c):g);d.push(f.some((m,g)=>m!==o[g])?f:o)}d.some((u,o)=>u!==s.cells[o])&&(s={...s,cells:d})}return n!==t.imageData||s!==t.grid?{...t,imageData:n,grid:s}:t}function D(e,t,r){const a=new Set,i=n=>{if(h.assertOutputActive(r),!a.has(n)){if(a.add(n),n.imageData&&/^data:image\/(png|jpe?g);base64,/i.test(n.imageData))try{t(n.imageData)}catch(s){if(!(s instanceof y.ImageMediaError)||s.code==="image-budget-exceeded")throw s}for(const s of n.grid?.cells??[])for(const c of s)for(const d of c?.children??[])i(d)}};for(const n of e.pages)for(const s of n.components)i(s)}function M(e){if(e.options.fidelity==="strict"&&e.diagnostics.length)throw new w.OutputFidelityError(e.diagnostics)}async function T(e,t={}){h.assertOutputActive(t.signal),h.assertBoundedRenderTree(e);const r=I(t),a=y.createImageMediaInspector(t);if(D(e,a,t.signal),t.signal?.aborted)throw t.signal.reason??new DOMException("The operation was aborted.","AbortError");const i=new AbortController,n=()=>i.abort(t.signal?.reason);if(t.signal?.addEventListener("abort",n,{once:!0}),!t.assetRegistry&&(!t.assetRenderers||!Object.keys(t.assetRenderers).length))return t.signal?.removeEventListener("abort",n),{plan:e,diagnostics:[]};const s={options:t,signal:i.signal,diagnostics:[],rendered:0,bytes:0,budget:r,cache:new WeakMap,inspectImage:a},c=setTimeout(()=>A(s,i),r.maxDurationMs);try{const d=[];for(const[u,o]of e.pages.entries()){if(u<(t.start??0)||u>(t.end??e.pages.length-1)){d.push(o);continue}const f=[];for(const[m,g]of o.components.entries())f.push(await x(s,g,{component:g,pageIndex:u,componentIndex:m,componentPath:[]},new Set));d.push(f.some((m,g)=>m!==o.components[g])?{...o,components:f}:o)}return p(s.signal),M(s),{plan:d.some((u,o)=>u!==e.pages[o])?{...e,pages:d}:e,diagnostics:s.diagnostics}}finally{clearTimeout(c),t.signal?.removeEventListener("abort",n)}}exports.OutputAssetError=b;exports.resolvePlanAssets=T;