@agile-team/mach-report 0.10.0 → 1.0.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.
@@ -1,8 +1,8 @@
1
- import { ref as k, computed as x, shallowRef as Be, defineComponent as xe, watch as A, nextTick as _e, openBlock as b, createElementBlock as w, createElementVNode as h, toDisplayString as y, Fragment as ee, createCommentVNode as B, normalizeClass as V, renderList as ie, createTextVNode as Le, withKeys as Te, inject as ue, provide as ze, useCssVars as et, watchEffect as Se, onMounted as tt, onUnmounted as nt, normalizeStyle as Y, createBlock as ot, createVNode as at, unref as g, renderSlot as rt } from "vue";
2
- import { computePageWindow as st, renderPage as We, validateRenderPlan as lt, renderPlanToCanvas as it } from "@agile-team/mach-report";
3
- import { a as Pe, b as ut, c as ct, n as dt, M as ft, e as pt } from "./plugin-QjAiSBP6.js";
4
- function mt(e, o, r = {}) {
5
- const n = r.pxPerMm ?? 3.7795275590551185, a = r.gapPx ?? 18, t = k(0), s = k(800), d = x(
1
+ import { ref as k, computed as x, shallowRef as Le, defineComponent as xe, watch as V, nextTick as et, openBlock as w, createElementBlock as y, createElementVNode as h, toDisplayString as P, Fragment as ee, createCommentVNode as B, normalizeClass as U, renderList as ie, createTextVNode as ze, withKeys as Se, inject as ue, provide as We, useCssVars as tt, watchEffect as Fe, onMounted as nt, onUnmounted as ot, normalizeStyle as Z, createBlock as at, createVNode as rt, unref as g, renderSlot as st } from "vue";
2
+ import { computePageWindow as lt, renderPage as Oe, validateRenderPlan as it, renderPlanToCanvas as ut } from "@agile-team/mach-report";
3
+ import { a as Pe, b as ct, c as dt, n as ft, M as pt, e as mt } from "./plugin-D3QAPZ-7.js";
4
+ function vt(e, o, r = {}) {
5
+ const n = r.pxPerMm ?? 3.7795275590551185, a = r.gapPx ?? 18, t = k(0), l = k(800), d = x(
6
6
  () => (e.value?.pages ?? []).map((f) => f.pageHeightMm * n)
7
7
  ), u = x(() => {
8
8
  const f = e.value?.pages ?? [];
@@ -11,9 +11,9 @@ function mt(e, o, r = {}) {
11
11
  m += C.pageHeightMm * n + a, v = Math.max(v, C.pageWidthMm * n);
12
12
  return { w: v, h: m };
13
13
  }), p = x(
14
- () => st({
14
+ () => lt({
15
15
  pageHeightsPx: d.value,
16
- viewportHeightPx: s.value / o.value,
16
+ viewportHeightPx: l.value / o.value,
17
17
  scrollTopPx: t.value / o.value,
18
18
  overscan: 1,
19
19
  gapPx: a
@@ -28,14 +28,14 @@ function mt(e, o, r = {}) {
28
28
  let v = 0;
29
29
  return (C) => {
30
30
  v || (v = requestAnimationFrame(() => {
31
- if (v = 0, t.value = C.scrollTop, s.value = C.clientHeight || 800, m.value <= 0) return;
31
+ if (v = 0, t.value = C.scrollTop, l.value = C.clientHeight || 800, m.value <= 0) return;
32
32
  const R = C.querySelectorAll(".mrp-page-holder");
33
33
  if (!R.length) return;
34
34
  const W = C.getBoundingClientRect().top + 56;
35
- let H = 1;
35
+ let N = 1;
36
36
  R.forEach((M) => {
37
- M.getBoundingClientRect().top <= W && (H = Number(M.dataset.page ?? 1));
38
- }), f.value = Math.max(1, Math.min(m.value, H));
37
+ M.getBoundingClientRect().top <= W && (N = Number(M.dataset.page ?? 1));
38
+ }), f.value = Math.max(1, Math.min(m.value, N));
39
39
  }));
40
40
  };
41
41
  }
@@ -45,11 +45,11 @@ function mt(e, o, r = {}) {
45
45
  visiblePages: c,
46
46
  makeScrollHandler: i,
47
47
  refreshViewport(f) {
48
- f && (s.value = f.clientHeight || 800);
48
+ f && (l.value = f.clientHeight || 800);
49
49
  }
50
50
  };
51
51
  }
52
- function vt(e) {
52
+ function gt(e) {
53
53
  const o = k(1), r = k("fit");
54
54
  function n() {
55
55
  requestAnimationFrame(() => {
@@ -74,48 +74,48 @@ function ae(e) {
74
74
  }
75
75
  function se(e) {
76
76
  const o = /* @__PURE__ */ new Map();
77
- e.pages.forEach((s) => {
78
- o.has(ae(s)) || o.set(ae(s), s);
77
+ e.pages.forEach((l) => {
78
+ o.has(ae(l)) || o.set(ae(l), l);
79
79
  });
80
80
  const a = `<!doctype html><html><head><meta charset="utf-8"><style>${`.mr-page{margin:0 auto;page-break-after:always;}
81
81
  .mr-page tr{break-inside:avoid;page-break-inside:avoid;}
82
82
  .mr-comp{break-inside:avoid;page-break-inside:avoid;}
83
83
  ${[...o.values()].map(
84
- (s) => `@page ${ae(s)}{size:${Math.round(s.pageWidthMm)}mm ${Math.round(s.pageHeightMm)}mm;margin:0;}`
84
+ (l) => `@page ${ae(l)}{size:${Math.round(l.pageWidthMm)}mm ${Math.round(l.pageHeightMm)}mm;margin:0;}`
85
85
  ).join(`
86
86
  `)}
87
- body{margin:0;background:#fff;}`}</style></head><body>`, t = e.pages.map((s) => {
88
- const d = We(s, 96, {}, document);
89
- return d.style.page = ae(s), d.outerHTML;
87
+ body{margin:0;background:#fff;}`}</style></head><body>`, t = e.pages.map((l) => {
88
+ const d = Oe(l, 96, {}, document);
89
+ return d.style.page = ae(l), d.outerHTML;
90
90
  });
91
91
  return { head: a, pageChunks: t };
92
92
  }
93
- async function gn(e, o = {}) {
93
+ async function hn(e, o = {}) {
94
94
  const r = {
95
95
  pages: e.flatMap((d) => d.pages)
96
96
  };
97
97
  if (r.pages.length === 0) return;
98
98
  const { head: n, pageChunks: a } = se(r), t = document.createElement("iframe");
99
99
  t.style.cssText = "position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden;", document.body.appendChild(t);
100
- let s = !1;
100
+ let l = !1;
101
101
  try {
102
102
  const d = t.contentDocument;
103
103
  d.open(), d.write(n);
104
104
  for (let u = 0; u < a.length; u++)
105
105
  d.write(a[u]), u % ce === ce - 1 && (o.onProgress?.(u + 1, a.length), await de());
106
- d.write("</body></html>"), d.close(), await de(), o.onProgress?.(a.length, a.length), s = !0, t.contentWindow?.focus(), t.contentWindow?.print();
106
+ d.write("</body></html>"), d.close(), await de(), o.onProgress?.(a.length, a.length), l = !0, t.contentWindow?.focus(), t.contentWindow?.print();
107
107
  } catch (d) {
108
108
  o.onError?.(d instanceof Error ? `批量打印失败: ${d.message}` : "批量打印失败");
109
109
  } finally {
110
- s ? setTimeout(() => t.remove(), 6e4) : t.remove();
110
+ l ? setTimeout(() => t.remove(), 6e4) : t.remove();
111
111
  }
112
112
  }
113
- function gt(e, o) {
113
+ function ht(e, o) {
114
114
  let r = null, n = !1, a = null;
115
115
  function t() {
116
116
  r?.remove(), r = null;
117
117
  }
118
- function s(i, f) {
118
+ function l(i, f) {
119
119
  const m = URL.createObjectURL(i), v = document.createElement("a");
120
120
  v.href = m, v.download = f, v.click(), setTimeout(() => URL.revokeObjectURL(m), 1e4);
121
121
  }
@@ -146,7 +146,7 @@ function gt(e, o) {
146
146
  return a = (async () => {
147
147
  try {
148
148
  const f = await o.getPdfExporter()(i);
149
- s(
149
+ l(
150
150
  new Blob([f], { type: "application/pdf" }),
151
151
  "mach-report.pdf"
152
152
  );
@@ -165,7 +165,7 @@ function gt(e, o) {
165
165
  return;
166
166
  }
167
167
  const { head: m, pageChunks: v } = se(f), C = `${m}${v.join("")}</body></html>`;
168
- s(new Blob([C], { type: "text/html;charset=utf-8" }), `mach-report.${i === "html" ? "html" : i}`);
168
+ l(new Blob([C], { type: "text/html;charset=utf-8" }), `mach-report.${i === "html" ? "html" : i}`);
169
169
  }
170
170
  function c() {
171
171
  const i = e.value;
@@ -184,9 +184,9 @@ function gt(e, o) {
184
184
  releasePrintFrame: t
185
185
  };
186
186
  }
187
- const Oe = "mrp-hit";
188
- function ht(e) {
189
- e.querySelectorAll(`mark.${Oe}`).forEach((r) => {
187
+ const He = "mrp-hit";
188
+ function bt(e) {
189
+ e.querySelectorAll(`mark.${He}`).forEach((r) => {
190
190
  const n = r.parentNode;
191
191
  if (n) {
192
192
  for (; r.firstChild; ) n.insertBefore(r.firstChild, r);
@@ -194,7 +194,7 @@ function ht(e) {
194
194
  }
195
195
  });
196
196
  }
197
- function bt(e, o) {
197
+ function wt(e, o) {
198
198
  const r = o.trim();
199
199
  if (!r) return 0;
200
200
  const n = r.toLowerCase(), a = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, {
@@ -204,7 +204,7 @@ function bt(e, o) {
204
204
  }
205
205
  }), t = [];
206
206
  for (let d = a.nextNode(); d; d = a.nextNode()) t.push(d);
207
- let s = 0;
207
+ let l = 0;
208
208
  for (const d of t) {
209
209
  const u = d.nodeValue ?? "", p = u.toLowerCase(), c = d.parentElement;
210
210
  if (!c) continue;
@@ -213,34 +213,34 @@ function bt(e, o) {
213
213
  for (; m >= 0; ) {
214
214
  m > f && i.appendChild(document.createTextNode(u.slice(f, m)));
215
215
  const v = document.createElement("mark");
216
- v.className = Oe, v.textContent = u.slice(m, m + r.length), i.appendChild(v), s++, f = m + r.length, m = p.indexOf(n, f);
216
+ v.className = He, v.textContent = u.slice(m, m + r.length), i.appendChild(v), l++, f = m + r.length, m = p.indexOf(n, f);
217
217
  }
218
218
  f < u.length && i.appendChild(document.createTextNode(u.slice(f))), c.replaceChild(i, d);
219
219
  }
220
- return s;
220
+ return l;
221
221
  }
222
- function Fe(e, o) {
222
+ function Ie(e, o) {
223
223
  let r = 0, n = e.toLowerCase().indexOf(o);
224
224
  for (; n >= 0; )
225
225
  r++, n = e.toLowerCase().indexOf(o, n + o.length);
226
226
  return r;
227
227
  }
228
- function wt(e) {
229
- const { plan: o, gotoPage: r, highlight: n, clearHighlights: a } = e, t = e.debounceMs ?? 200, s = k(!1), d = k(""), u = k(""), p = k(0);
228
+ function yt(e) {
229
+ const { plan: o, gotoPage: r, highlight: n, clearHighlights: a } = e, t = e.debounceMs ?? 200, l = k(!1), d = k(""), u = k(""), p = k(0);
230
230
  let c = null;
231
231
  const i = x(() => {
232
232
  const M = d.value.trim().toLowerCase(), F = o.value;
233
233
  if (!M || !F) return [];
234
234
  const L = [];
235
235
  return F.pages.forEach((O, te) => {
236
- for (const N of O.components)
237
- if (N.grid) {
238
- for (const U of N.grid.cells ?? [])
239
- for (const Z of U ?? [])
240
- if (typeof Z?.text == "string")
241
- for (let ne = 0; ne < Fe(Z.text, M); ne++) L.push(te);
242
- } else if (N.kind === "text" && typeof N.text == "string")
243
- for (let U = 0; U < Fe(N.text, M); U++) L.push(te);
236
+ for (const D of O.components)
237
+ if (D.grid) {
238
+ for (const j of D.grid.cells ?? [])
239
+ for (const J of j ?? [])
240
+ if (typeof J?.text == "string")
241
+ for (let ne = 0; ne < Ie(J.text, M); ne++) L.push(te);
242
+ } else if (D.kind === "text" && typeof D.text == "string")
243
+ for (let j = 0; j < Ie(D.text, M); j++) L.push(te);
244
244
  }), L;
245
245
  }), f = x(() => i.value.length);
246
246
  function m(M) {
@@ -259,7 +259,7 @@ function wt(e) {
259
259
  F !== 0 && (p.value = (p.value + M + F) % F, r(i.value[p.value] + 1));
260
260
  }
261
261
  function C() {
262
- s.value = !s.value;
262
+ l.value = !l.value;
263
263
  }
264
264
  function R(M) {
265
265
  const F = d.value.trim();
@@ -268,11 +268,11 @@ function wt(e) {
268
268
  function W(M) {
269
269
  a(M);
270
270
  }
271
- function H() {
271
+ function N() {
272
272
  u.value = "", d.value = "", p.value = 0, c && clearTimeout(c), c = null;
273
273
  }
274
274
  return {
275
- visible: s,
275
+ visible: l,
276
276
  query: d,
277
277
  matchIndex: p,
278
278
  matchCount: f,
@@ -281,10 +281,10 @@ function wt(e) {
281
281
  onNav: v,
282
282
  apply: R,
283
283
  clear: W,
284
- reset: H
284
+ reset: N
285
285
  };
286
286
  }
287
- function yt(e, o) {
287
+ function Pt(e, o) {
288
288
  const r = x(() => {
289
289
  if (e.value) return !0;
290
290
  if (typeof location > "u") return !1;
@@ -302,10 +302,10 @@ function yt(e, o) {
302
302
  });
303
303
  return { enabled: r, debugStats: a };
304
304
  }
305
- function Pt(e, o) {
305
+ function xt(e, o) {
306
306
  const { thumbsRoot: r, visible: n, renderThumbCanvas: a } = o;
307
307
  let t = null;
308
- function s(p, c) {
308
+ function l(p, c) {
309
309
  if (!e.value || p.childElementCount > 0) return;
310
310
  const i = a(c);
311
311
  i && (i.style.width = "100%", i.style.height = "100%", i.style.display = "block", p.appendChild(i));
@@ -316,7 +316,7 @@ function Pt(e, o) {
316
316
  for (const c of p) {
317
317
  if (!c.isIntersecting) continue;
318
318
  const i = c.target;
319
- s(i, Number(i.dataset.thumb ?? 1) - 1), t?.unobserve(i);
319
+ l(i, Number(i.dataset.thumb ?? 1) - 1), t?.unobserve(i);
320
320
  }
321
321
  },
322
322
  { root: r.value, rootMargin: "200px" }
@@ -327,8 +327,8 @@ function Pt(e, o) {
327
327
  t?.disconnect(), t = null;
328
328
  } };
329
329
  }
330
- function xt() {
331
- const e = Be(0);
330
+ function Et() {
331
+ const e = Le(0);
332
332
  return {
333
333
  loadMs: e,
334
334
  start() {
@@ -339,13 +339,13 @@ function xt() {
339
339
  }
340
340
  };
341
341
  }
342
- const Et = { class: "mrp-toolbar" }, $t = { class: "mrp-title" }, Ct = ["disabled"], Mt = { class: "mrp-pageinfo" }, kt = ["disabled"], Rt = {
342
+ const $t = { class: "mrp-toolbar" }, Ct = { class: "mrp-title" }, Mt = ["disabled"], kt = { class: "mrp-pageinfo" }, Rt = ["disabled"], Tt = {
343
343
  key: 1,
344
344
  class: "mrp-search"
345
- }, Tt = ["placeholder", "value"], St = {
345
+ }, St = ["placeholder", "value"], Ft = {
346
346
  key: 0,
347
347
  class: "mrp-search-count"
348
- }, Ft = ["disabled"], It = ["disabled"], Bt = /* @__PURE__ */ xe({
348
+ }, It = ["disabled"], Bt = ["disabled"], Lt = /* @__PURE__ */ xe({
349
349
  __name: "ReportToolbar",
350
350
  props: {
351
351
  pageCount: {},
@@ -362,34 +362,34 @@ const Et = { class: "mrp-toolbar" }, $t = { class: "mrp-title" }, Ct = ["disable
362
362
  emits: ["goto", "zoom", "export", "print", "pdf-window", "search-input", "search-nav", "search-toggle", "thumbs-toggle"],
363
363
  setup(e) {
364
364
  const o = e, r = k(null);
365
- A(
365
+ V(
366
366
  () => o.search.visible,
367
367
  (a) => {
368
- a && _e(() => r.value?.focus());
368
+ a && et(() => r.value?.focus());
369
369
  }
370
370
  );
371
- function n(a, t, s) {
372
- return a.replace("{cur}", String(t)).replace("{total}", String(s));
371
+ function n(a, t, l) {
372
+ return a.replace("{cur}", String(t)).replace("{total}", String(l));
373
373
  }
374
- return (a, t) => (b(), w("div", Et, [
375
- h("span", $t, y(e.messages.title), 1),
376
- e.pageCount > 0 ? (b(), w(ee, { key: 0 }, [
374
+ return (a, t) => (w(), y("div", $t, [
375
+ h("span", Ct, P(e.messages.title), 1),
376
+ e.pageCount > 0 ? (w(), y(ee, { key: 0 }, [
377
377
  h("button", {
378
378
  class: "mrp-nav",
379
379
  type: "button",
380
380
  disabled: e.currentPage <= 1,
381
- onClick: t[0] || (t[0] = (s) => a.$emit("goto", e.currentPage - 1))
382
- }, y(e.messages.prevPage), 9, Ct),
383
- h("span", Mt, y(n(e.messages.pageInfo, e.currentPage, e.pageCount)), 1),
381
+ onClick: t[0] || (t[0] = (l) => a.$emit("goto", e.currentPage - 1))
382
+ }, P(e.messages.prevPage), 9, Mt),
383
+ h("span", kt, P(n(e.messages.pageInfo, e.currentPage, e.pageCount)), 1),
384
384
  h("button", {
385
385
  class: "mrp-nav",
386
386
  type: "button",
387
387
  disabled: e.currentPage >= e.pageCount,
388
- onClick: t[1] || (t[1] = (s) => a.$emit("goto", e.currentPage + 1))
389
- }, y(e.messages.nextPage), 9, kt)
388
+ onClick: t[1] || (t[1] = (l) => a.$emit("goto", e.currentPage + 1))
389
+ }, P(e.messages.nextPage), 9, Rt)
390
390
  ], 64)) : B("", !0),
391
391
  t[14] || (t[14] = h("span", { class: "mrp-spacer" }, null, -1)),
392
- e.search.visible ? (b(), w("div", Rt, [
392
+ e.search.visible ? (w(), y("div", Tt, [
393
393
  h("input", {
394
394
  ref_key: "searchInputRef",
395
395
  ref: r,
@@ -397,72 +397,72 @@ const Et = { class: "mrp-toolbar" }, $t = { class: "mrp-title" }, Ct = ["disable
397
397
  type: "text",
398
398
  placeholder: e.messages.searchPlaceholder,
399
399
  value: e.search.query,
400
- onInput: t[2] || (t[2] = (s) => a.$emit("search-input", s.target.value))
401
- }, null, 40, Tt),
402
- e.search.query ? (b(), w("span", St, y(n(e.messages.matchInfo, e.search.matchIndex + 1, e.search.matchCount)), 1)) : B("", !0),
400
+ onInput: t[2] || (t[2] = (l) => a.$emit("search-input", l.target.value))
401
+ }, null, 40, St),
402
+ e.search.query ? (w(), y("span", Ft, P(n(e.messages.matchInfo, e.search.matchIndex + 1, e.search.matchCount)), 1)) : B("", !0),
403
403
  h("button", {
404
404
  class: "mrp-nav",
405
405
  type: "button",
406
406
  disabled: e.search.matchCount === 0,
407
- onClick: t[3] || (t[3] = (s) => a.$emit("search-nav", -1))
408
- }, y(e.messages.prevMatch), 9, Ft),
407
+ onClick: t[3] || (t[3] = (l) => a.$emit("search-nav", -1))
408
+ }, P(e.messages.prevMatch), 9, It),
409
409
  h("button", {
410
410
  class: "mrp-nav",
411
411
  type: "button",
412
412
  disabled: e.search.matchCount === 0,
413
- onClick: t[4] || (t[4] = (s) => a.$emit("search-nav", 1))
414
- }, y(e.messages.nextMatch), 9, It)
413
+ onClick: t[4] || (t[4] = (l) => a.$emit("search-nav", 1))
414
+ }, P(e.messages.nextMatch), 9, Bt)
415
415
  ])) : B("", !0),
416
416
  h("button", {
417
- class: V(["mrp-nav", { "mrp-active": e.search.visible }]),
417
+ class: U(["mrp-nav", { "mrp-active": e.search.visible }]),
418
418
  type: "button",
419
419
  title: "Ctrl+F",
420
- onClick: t[5] || (t[5] = (s) => a.$emit("search-toggle"))
420
+ onClick: t[5] || (t[5] = (l) => a.$emit("search-toggle"))
421
421
  }, " 🔍 ", 2),
422
422
  h("button", {
423
- class: V(["mrp-nav", { "mrp-active": e.thumbsVisible }]),
423
+ class: U(["mrp-nav", { "mrp-active": e.thumbsVisible }]),
424
424
  type: "button",
425
- onClick: t[6] || (t[6] = (s) => a.$emit("thumbs-toggle"))
426
- }, " ▦ " + y(e.messages.thumbnails), 3),
425
+ onClick: t[6] || (t[6] = (l) => a.$emit("thumbs-toggle"))
426
+ }, " ▦ " + P(e.messages.thumbnails), 3),
427
427
  h("button", {
428
- class: V(["mrp-nav", { "mrp-active": e.zoomMode === "fit" }]),
428
+ class: U(["mrp-nav", { "mrp-active": e.zoomMode === "fit" }]),
429
429
  type: "button",
430
- onClick: t[7] || (t[7] = (s) => a.$emit("zoom", "fit"))
431
- }, y(e.messages.fitWidth), 3),
430
+ onClick: t[7] || (t[7] = (l) => a.$emit("zoom", "fit"))
431
+ }, P(e.messages.fitWidth), 3),
432
432
  h("button", {
433
- class: V(["mrp-nav", { "mrp-active": e.zoomMode === "raw" && Math.round(e.zoom * 100) === 100 }]),
433
+ class: U(["mrp-nav", { "mrp-active": e.zoomMode === "raw" && Math.round(e.zoom * 100) === 100 }]),
434
434
  type: "button",
435
- onClick: t[8] || (t[8] = (s) => a.$emit("zoom", 100))
435
+ onClick: t[8] || (t[8] = (l) => a.$emit("zoom", 100))
436
436
  }, " 100% ", 2),
437
437
  h("button", {
438
- class: V(["mrp-nav", { "mrp-active": e.zoomMode === "raw" && Math.round(e.zoom * 100) === 150 }]),
438
+ class: U(["mrp-nav", { "mrp-active": e.zoomMode === "raw" && Math.round(e.zoom * 100) === 150 }]),
439
439
  type: "button",
440
- onClick: t[9] || (t[9] = (s) => a.$emit("zoom", 150))
440
+ onClick: t[9] || (t[9] = (l) => a.$emit("zoom", 150))
441
441
  }, " 150% ", 2),
442
- e.showExport ? (b(), w("button", {
442
+ e.showExport ? (w(), y("button", {
443
443
  key: 2,
444
444
  class: "mrp-nav",
445
445
  type: "button",
446
- onClick: t[10] || (t[10] = (s) => a.$emit("export", "html"))
447
- }, y(e.messages.exportHtml), 1)) : B("", !0),
448
- e.showExport ? (b(), w("button", {
446
+ onClick: t[10] || (t[10] = (l) => a.$emit("export", "html"))
447
+ }, P(e.messages.exportHtml), 1)) : B("", !0),
448
+ e.showExport ? (w(), y("button", {
449
449
  key: 3,
450
450
  class: "mrp-nav",
451
451
  type: "button",
452
- onClick: t[11] || (t[11] = (s) => a.$emit("export", "pdf"))
453
- }, y(e.messages.exportPdf), 1)) : B("", !0),
454
- e.showPrint ? (b(), w("button", {
452
+ onClick: t[11] || (t[11] = (l) => a.$emit("export", "pdf"))
453
+ }, P(e.messages.exportPdf), 1)) : B("", !0),
454
+ e.showPrint ? (w(), y("button", {
455
455
  key: 4,
456
456
  class: "mrp-nav",
457
457
  type: "button",
458
- onClick: t[12] || (t[12] = (s) => a.$emit("print"))
459
- }, y(e.messages.print), 1)) : B("", !0),
460
- e.showPdfWindow ? (b(), w("button", {
458
+ onClick: t[12] || (t[12] = (l) => a.$emit("print"))
459
+ }, P(e.messages.print), 1)) : B("", !0),
460
+ e.showPdfWindow ? (w(), y("button", {
461
461
  key: 5,
462
462
  class: "mrp-nav",
463
463
  type: "button",
464
- onClick: t[13] || (t[13] = (s) => a.$emit("pdf-window"))
465
- }, y(e.messages.pdfWindow), 1)) : B("", !0)
464
+ onClick: t[13] || (t[13] = (l) => a.$emit("pdf-window"))
465
+ }, P(e.messages.pdfWindow), 1)) : B("", !0)
466
466
  ]));
467
467
  }
468
468
  }), Ee = (e, o) => {
@@ -470,14 +470,14 @@ const Et = { class: "mrp-toolbar" }, $t = { class: "mrp-title" }, Ct = ["disable
470
470
  for (const [n, a] of o)
471
471
  r[n] = a;
472
472
  return r;
473
- }, Lt = /* @__PURE__ */ Ee(Bt, [["__scopeId", "data-v-f50c26e8"]]), zt = { class: "mrp-params" }, Wt = { class: "mrp-params-title" }, Ot = { class: "mrp-params-grid" }, Ht = { class: "mrp-param-label" }, Nt = {
473
+ }, zt = /* @__PURE__ */ Ee(Lt, [["__scopeId", "data-v-f50c26e8"]]), Wt = { class: "mrp-params" }, Ot = { class: "mrp-params-title" }, Ht = { class: "mrp-params-grid" }, Nt = { class: "mrp-param-label" }, Dt = {
474
474
  key: 0,
475
475
  class: "mrp-param-star"
476
- }, Dt = ["value", "onChange"], qt = {
476
+ }, qt = ["value", "onChange"], At = {
477
477
  value: "",
478
478
  disabled: "",
479
479
  hidden: ""
480
- }, At = ["value"], Vt = ["type", "placeholder", "value", "onInput"], Ut = { class: "mrp-params-actions" }, jt = /* @__PURE__ */ xe({
480
+ }, Vt = ["value"], Ut = ["type", "placeholder", "value", "onInput"], jt = { class: "mrp-params-actions" }, Kt = /* @__PURE__ */ xe({
481
481
  __name: "ReportParamPanel",
482
482
  props: {
483
483
  defs: {},
@@ -488,7 +488,7 @@ const Et = { class: "mrp-toolbar" }, $t = { class: "mrp-title" }, Ct = ["disable
488
488
  emits: ["update:modelValue", "query", "reset"],
489
489
  setup(e, { emit: o }) {
490
490
  const r = e, n = o, a = k({ ...r.modelValue });
491
- A(
491
+ V(
492
492
  () => r.modelValue,
493
493
  (u) => {
494
494
  a.value = { ...u };
@@ -501,62 +501,62 @@ const Et = { class: "mrp-toolbar" }, $t = { class: "mrp-title" }, Ct = ["disable
501
501
  value: a.value[u.field] ?? ""
502
502
  }))
503
503
  );
504
- function s(u, p) {
504
+ function l(u, p) {
505
505
  a.value = { ...a.value, [u]: p }, n("update:modelValue", { ...a.value });
506
506
  }
507
507
  function d(u) {
508
508
  const p = r.defs.find((c) => c.field === u);
509
509
  return r.attempted && p?.required === !0 && !(a.value[u] ?? "").trim();
510
510
  }
511
- return (u, p) => (b(), w("div", zt, [
512
- h("span", Wt, y(e.messages.paramsTitle), 1),
513
- h("div", Ot, [
514
- (b(!0), w(ee, null, ie(t.value, (c) => (b(), w("label", {
511
+ return (u, p) => (w(), y("div", Wt, [
512
+ h("span", Ot, P(e.messages.paramsTitle), 1),
513
+ h("div", Ht, [
514
+ (w(!0), y(ee, null, ie(t.value, (c) => (w(), y("label", {
515
515
  key: c.def.field,
516
- class: V(["mrp-param", { "mrp-param-missing": d(c.def.field) }])
516
+ class: U(["mrp-param", { "mrp-param-missing": d(c.def.field) }])
517
517
  }, [
518
- h("span", Ht, [
519
- Le(y(c.label), 1),
520
- c.def.required ? (b(), w("i", Nt, "*")) : B("", !0)
518
+ h("span", Nt, [
519
+ ze(P(c.label), 1),
520
+ c.def.required ? (w(), y("i", Dt, "*")) : B("", !0)
521
521
  ]),
522
- (c.def.type ?? "text") === "select" ? (b(), w("select", {
522
+ (c.def.type ?? "text") === "select" ? (w(), y("select", {
523
523
  key: 0,
524
524
  class: "mrp-param-input",
525
525
  value: c.value,
526
- onChange: (i) => s(c.def.field, i.target.value),
527
- onKeydown: p[0] || (p[0] = Te((i) => u.$emit("query"), ["enter"]))
526
+ onChange: (i) => l(c.def.field, i.target.value),
527
+ onKeydown: p[0] || (p[0] = Se((i) => u.$emit("query"), ["enter"]))
528
528
  }, [
529
- h("option", qt, y(c.def.placeholder ?? `请选择${c.label}`), 1),
530
- (b(!0), w(ee, null, ie(c.def.options ?? [], (i) => (b(), w("option", {
529
+ h("option", At, P(c.def.placeholder ?? `请选择${c.label}`), 1),
530
+ (w(!0), y(ee, null, ie(c.def.options ?? [], (i) => (w(), y("option", {
531
531
  key: i.value,
532
532
  value: i.value
533
- }, y(i.label), 9, At))), 128))
534
- ], 40, Dt)) : (b(), w("input", {
533
+ }, P(i.label), 9, Vt))), 128))
534
+ ], 40, qt)) : (w(), y("input", {
535
535
  key: 1,
536
536
  class: "mrp-param-input",
537
537
  type: c.def.type === "number" ? "number" : c.def.type === "date" ? "date" : "text",
538
538
  placeholder: c.def.placeholder ?? `请输入${c.label}`,
539
539
  value: c.value,
540
- onInput: (i) => s(c.def.field, i.target.value),
541
- onKeydown: p[1] || (p[1] = Te((i) => u.$emit("query"), ["enter"]))
542
- }, null, 40, Vt))
540
+ onInput: (i) => l(c.def.field, i.target.value),
541
+ onKeydown: p[1] || (p[1] = Se((i) => u.$emit("query"), ["enter"]))
542
+ }, null, 40, Ut))
543
543
  ], 2))), 128))
544
544
  ]),
545
- h("div", Ut, [
545
+ h("div", jt, [
546
546
  h("button", {
547
547
  class: "mrp-nav mrp-param-query",
548
548
  type: "button",
549
549
  onClick: p[2] || (p[2] = (c) => u.$emit("query"))
550
- }, y(e.messages.query), 1),
550
+ }, P(e.messages.query), 1),
551
551
  h("button", {
552
552
  class: "mrp-nav",
553
553
  type: "button",
554
554
  onClick: p[3] || (p[3] = (c) => u.$emit("reset"))
555
- }, y(e.messages.reset), 1)
555
+ }, P(e.messages.reset), 1)
556
556
  ])
557
557
  ]));
558
558
  }
559
- }), Kt = /* @__PURE__ */ Ee(jt, [["__scopeId", "data-v-aafce92d"]]), Gt = {
559
+ }), Gt = /* @__PURE__ */ Ee(Kt, [["__scopeId", "data-v-aafce92d"]]), Yt = {
560
560
  title: "报表预览",
561
561
  prevPage: "‹ 上一页",
562
562
  nextPage: "下一页 ›",
@@ -579,7 +579,7 @@ const Et = { class: "mrp-toolbar" }, $t = { class: "mrp-title" }, Ct = ["disable
579
579
  query: "查 询",
580
580
  reset: "重 置",
581
581
  paramRequired: "请填写{label}"
582
- }, Yt = {
582
+ }, Zt = {
583
583
  shellBg: "#525659",
584
584
  shellFg: "#e8e8e8",
585
585
  toolbarBg: "#323639",
@@ -591,13 +591,13 @@ const Et = { class: "mrp-toolbar" }, $t = { class: "mrp-title" }, Ct = ["disable
591
591
  btnHoverFg: "#ffffff",
592
592
  btnActiveBg: "#2d5fb8"
593
593
  };
594
- function hn(e) {
594
+ function bn(e) {
595
595
  return e;
596
596
  }
597
- function bn(e) {
597
+ function wn(e) {
598
598
  return e;
599
599
  }
600
- const q = {
600
+ const A = {
601
601
  showExport: !0,
602
602
  showPrint: !0,
603
603
  showPdfWindow: !0,
@@ -605,28 +605,28 @@ const q = {
605
605
  gapPx: 18,
606
606
  pdfFontUrl: "/simhei.ttf",
607
607
  logger: console
608
- }, wn = { warn: () => {
608
+ }, yn = { warn: () => {
609
609
  }, info: () => {
610
610
  } };
611
- function Zt(e, o) {
611
+ function Jt(e, o) {
612
612
  const r = o ? e?.presets?.[o] : e?.defaultPreset ? e?.presets?.[e.defaultPreset] : void 0, n = { ...e?.defaults, ...r };
613
613
  return {
614
- showExport: n.showExport ?? q.showExport,
615
- showPrint: n.showPrint ?? q.showPrint,
616
- showPdfWindow: n.showPdfWindow ?? q.showPdfWindow,
617
- showParams: n.showParams ?? q.showParams,
618
- gapPx: n.gapPx ?? q.gapPx,
619
- pdfFontUrl: n.pdfFontUrl ?? q.pdfFontUrl,
620
- theme: { ...Yt, ...n.theme },
621
- messages: { ...Gt, ...n.messages },
622
- logger: n.logger ?? q.logger
614
+ showExport: n.showExport ?? A.showExport,
615
+ showPrint: n.showPrint ?? A.showPrint,
616
+ showPdfWindow: n.showPdfWindow ?? A.showPdfWindow,
617
+ showParams: n.showParams ?? A.showParams,
618
+ gapPx: n.gapPx ?? A.gapPx,
619
+ pdfFontUrl: n.pdfFontUrl ?? A.pdfFontUrl,
620
+ theme: { ...Zt, ...n.theme },
621
+ messages: { ...Yt, ...n.messages },
622
+ logger: n.logger ?? A.logger
623
623
  };
624
624
  }
625
- function Jt(e) {
625
+ function Xt(e) {
626
626
  const o = {};
627
627
  return e.shellBg != null && (o["--mrp-shell-bg"] = e.shellBg), e.shellFg != null && (o["--mrp-shell-fg"] = e.shellFg), e.toolbarBg != null && (o["--mrp-toolbar-bg"] = e.toolbarBg), e.toolbarBorder != null && (o["--mrp-toolbar-border"] = e.toolbarBorder), e.toolbarFg != null && (o["--mrp-toolbar-fg"] = e.toolbarFg), e.btnFg != null && (o["--mrp-btn-fg"] = e.btnFg), e.btnBorder != null && (o["--mrp-btn-border"] = e.btnBorder), e.btnHoverBg != null && (o["--mrp-btn-hover-bg"] = e.btnHoverBg), e.btnHoverFg != null && (o["--mrp-btn-hover-fg"] = e.btnHoverFg), e.btnActiveBg != null && (o["--mrp-btn-active-bg"] = e.btnActiveBg), o;
628
628
  }
629
- function yn(e) {
629
+ function Pn(e) {
630
630
  const o = ue(Pe, null), r = x(() => {
631
631
  const n = o?.value ?? null, a = "defaults" in e && "presets" in e ? e : { defaults: e, presets: {} };
632
632
  return n ? {
@@ -635,9 +635,9 @@ function yn(e) {
635
635
  defaultPreset: a.defaultPreset ?? n.defaultPreset
636
636
  } : a;
637
637
  });
638
- ze(Pe, r);
638
+ We(Pe, r);
639
639
  }
640
- function Xt() {
640
+ function Qt() {
641
641
  return ue(Pe, x(() => null));
642
642
  }
643
643
  class le extends Error {
@@ -645,23 +645,23 @@ class le extends Error {
645
645
  super(r), this.name = "MachReportError", this.code = o, this.cause = n;
646
646
  }
647
647
  }
648
- function Qt(e) {
648
+ function _t(e) {
649
649
  return e instanceof le ? { code: e.code, cause: e.cause } : { code: "render", cause: e };
650
650
  }
651
- const _t = { class: "mrp-main" }, en = {
651
+ const en = { class: "mrp-main" }, tn = {
652
652
  key: 0,
653
653
  class: "mrp-state"
654
- }, tn = {
654
+ }, nn = {
655
655
  key: 1,
656
656
  class: "mrp-state mrp-error"
657
- }, nn = {
657
+ }, on = {
658
658
  key: 2,
659
659
  class: "mrp-state"
660
- }, on = ["data-page"], an = ["onClick"], rn = ["data-thumb"], sn = { class: "mrp-thumb-no" }, ln = { class: "mrp-overlay" }, un = {
660
+ }, an = ["data-page"], rn = ["onClick"], sn = ["data-thumb"], ln = { class: "mrp-thumb-no" }, un = { class: "mrp-overlay" }, cn = {
661
661
  key: 1,
662
662
  class: "mrp-debug",
663
663
  "aria-hidden": "true"
664
- }, re = 96 / 25.4, Ie = "mach-report:ui", cn = /* @__PURE__ */ xe({
664
+ }, re = 96 / 25.4, Be = "mach-report:ui", dn = /* @__PURE__ */ xe({
665
665
  __name: "ReportPreview",
666
666
  props: {
667
667
  tempId: {
@@ -701,81 +701,81 @@ const _t = { class: "mrp-main" }, en = {
701
701
  },
702
702
  emits: ["loaded", "error"],
703
703
  setup(e, { expose: o, emit: r }) {
704
- et((l) => ({
705
- v06e552ba: v.value + "px"
704
+ tt((s) => ({
705
+ dce0aa90: v.value + "px"
706
706
  }));
707
- const n = e, a = r, t = Be(null), s = k(!1), d = k(""), u = k(1), p = k(null), c = k(null), i = k(null), f = k(!1), m = xt(), v = x(() => Math.max(0, Z.value)), C = ue(ut, null), W = ue(ct, null) ?? pt({ fontUrl: "/simhei.ttf" }), H = x(() => dt(n.tempId)), M = x(() => t.value?.pages.length ?? 0), F = Xt(), L = x(() => Zt(F.value, n.preset)), O = x(() => ({
707
+ const n = e, a = r, t = Le(null), l = k(!1), d = k(""), u = k(1), p = k(null), c = k(null), i = k(null), f = k(!1), m = Et(), v = x(() => Math.max(0, J.value)), C = ue(ct, null), W = ue(dt, null) ?? mt({ fontUrl: "/simhei.ttf" }), N = x(() => ft(n.tempId)), M = x(() => t.value?.pages.length ?? 0), F = Qt(), L = x(() => Jt(F.value, n.preset)), O = x(() => ({
708
708
  ...L.value.messages,
709
709
  ...n.messages
710
- })), te = x(() => n.showExport ?? L.value.showExport), N = x(() => n.showPrint ?? L.value.showPrint), U = x(() => n.showPdfWindow ?? L.value.showPdfWindow), Z = x(() => n.gapPx ?? L.value.gapPx), ne = x(() => n.showParams ?? L.value.showParams), j = x(() => n.paramDefs ?? []), J = k({}), fe = k(!1);
711
- function pe(l) {
712
- const P = {};
713
- for (const E of l)
714
- P[E.field] = n.params[E.field] ?? E.defaultValue ?? "";
715
- J.value = P, fe.value = !1;
710
+ })), te = x(() => n.showExport ?? L.value.showExport), D = x(() => n.showPrint ?? L.value.showPrint), j = x(() => n.showPdfWindow ?? L.value.showPdfWindow), J = x(() => n.gapPx ?? L.value.gapPx), ne = x(() => n.showParams ?? L.value.showParams), K = x(() => n.paramDefs ?? []), q = k({}), fe = k(!1);
711
+ function pe(s) {
712
+ const b = {};
713
+ for (const E of s)
714
+ b[E.field] = n.params[E.field] ?? E.defaultValue ?? "";
715
+ q.value = b, fe.value = !1;
716
716
  }
717
- pe(j.value), A(j, (l) => pe(l));
718
- const He = x(() => ({
717
+ pe(K.value), V(K, (s) => pe(s));
718
+ const Ne = x(() => ({
719
719
  ...n.params,
720
720
  ...Object.fromEntries(
721
- Object.entries(J.value).filter(([, l]) => l !== "")
721
+ Object.entries(q.value).filter(([, s]) => s !== "")
722
722
  )
723
723
  }));
724
- function Ne() {
725
- return j.value.filter(
726
- (l) => l.required === !0 && !(J.value[l.field] ?? "").trim()
724
+ function De() {
725
+ return K.value.filter(
726
+ (s) => s.required === !0 && !(q.value[s.field] ?? "").trim()
727
727
  );
728
728
  }
729
- function De() {
729
+ function qe() {
730
730
  fe.value = !0;
731
- const l = Ne();
732
- if (l.length > 0) {
733
- const P = l[0].label ?? l[0].field, E = O.value.paramRequired.replace("{label}", P);
731
+ const s = De();
732
+ if (s.length > 0) {
733
+ const b = s[0].label ?? s[0].field, E = O.value.paramRequired.replace("{label}", b);
734
734
  d.value = E, a("error", E, { code: "param" });
735
735
  return;
736
736
  }
737
- D();
737
+ H();
738
738
  }
739
- function qe() {
740
- pe(j.value);
739
+ function Ae() {
740
+ pe(K.value);
741
741
  }
742
- const Ae = x(() => ({
742
+ const Ve = x(() => ({
743
743
  height: n.height,
744
- ...Jt(L.value.theme)
745
- })), { zoom: I, zoomMode: K, applyFitZoom: $e, setZoom: me } = vt(() => ({
744
+ ...Xt(L.value.theme)
745
+ })), { zoom: I, zoomMode: G, applyFitZoom: $e, setZoom: me } = gt(() => ({
746
746
  viewport: c.value,
747
747
  pageWidthPx: (t.value?.pages[0]?.pageWidthMm ?? 210) * re
748
- })), Ve = mt(t, I, {
748
+ })), Ue = vt(t, I, {
749
749
  pxPerMm: re,
750
- gapPx: Z.value
751
- }), { contentSize: ve, windowRange: X, visiblePages: Ue, makeScrollHandler: je, refreshViewport: Ce } = Ve, Ke = je(u, M);
752
- function ge(l) {
753
- K.value = "raw", I.value = Math.min(3, Math.max(0.3, l));
750
+ gapPx: J.value
751
+ }), { contentSize: ve, windowRange: X, visiblePages: je, makeScrollHandler: Ke, refreshViewport: Ce } = Ue, Ge = Ke(u, M);
752
+ function ge(s) {
753
+ G.value = "raw", I.value = Math.min(3, Math.max(0.3, s));
754
754
  }
755
755
  function he() {
756
756
  t.value = null, u.value = 1, T.reset();
757
757
  }
758
758
  let oe = 0;
759
- async function D() {
760
- const l = ++oe, P = n.fetcher ?? C;
761
- if (H.value.length === 0) {
759
+ async function H() {
760
+ const s = ++oe, b = n.fetcher ?? C;
761
+ if (N.value.length === 0) {
762
762
  d.value = "缺少报表模板 ID", he(), a("error", d.value, { code: "param" });
763
763
  return;
764
764
  }
765
- if (!P) {
765
+ if (!b) {
766
766
  d.value = "未提供渲染数据源 fetcher", he(), a("error", d.value, { code: "config" });
767
767
  return;
768
768
  }
769
- s.value = !0, d.value = "", he();
769
+ l.value = !0, d.value = "", he();
770
770
  const E = m.start();
771
771
  try {
772
- const $ = await P({
773
- tempIds: H.value,
772
+ const $ = await b({
773
+ tempIds: N.value,
774
774
  furnitureTempId: n.furnitureTempId || void 0,
775
- params: { ...He.value }
775
+ params: { ...Ne.value }
776
776
  });
777
- if (l !== oe) return;
778
- const S = lt($);
777
+ if (s !== oe) return;
778
+ const S = it($);
779
779
  if (!S.ok) {
780
780
  const Q = S.errors.slice(0, 3).map((_) => `${_.path}: ${_.message}`).join("; ");
781
781
  throw new le(
@@ -783,286 +783,289 @@ const _t = { class: "mrp-main" }, en = {
783
783
  `渲染计划校验失败(${S.errors.length} 处): ${Q}`
784
784
  );
785
785
  }
786
- S.warnings.length > 0 && L.value.logger.warn("[mach-report] 渲染计划告警:", S.warnings), t.value = $, u.value = 1, m.end(E), c.value && (c.value.scrollTop = 0), K.value === "fit" && $e(), a("loaded", $.pages.length);
786
+ S.warnings.length > 0 && L.value.logger.warn("[mach-report] 渲染计划告警:", S.warnings), t.value = $, u.value = 1, m.end(E), c.value && (c.value.scrollTop = 0), G.value === "fit" && $e(), a("loaded", $.pages.length);
787
787
  } catch ($) {
788
- if (l !== oe) return;
788
+ if (s !== oe) return;
789
789
  const S = $ instanceof le ? $ : new le(
790
790
  "fetch",
791
791
  $ instanceof Error ? $.message : "预览加载失败",
792
792
  $
793
793
  );
794
- d.value = S.message, a("error", S.message, Qt(S));
794
+ d.value = S.message, a("error", S.message, _t(S));
795
795
  } finally {
796
- l === oe && (s.value = !1);
796
+ s === oe && (l.value = !1);
797
797
  }
798
798
  }
799
- function z(l) {
799
+ function z(s) {
800
800
  if (M.value <= 0) return;
801
- const P = Math.max(1, Math.min(M.value, l));
802
- u.value = P;
801
+ const b = Math.max(1, Math.min(M.value, s));
802
+ u.value = b;
803
803
  const E = c.value;
804
804
  if (!E) return;
805
805
  let $ = 0;
806
- for (let S = 0; S < P - 1; S++)
806
+ for (let S = 0; S < b - 1; S++)
807
807
  $ += (t.value?.pages[S]?.pageHeightMm ?? 0) * re + v.value;
808
808
  E.scrollTop = $ * I.value;
809
809
  }
810
- const { print: be, exportAs: we, openPdfWindow: ye, releasePrintFrame: Ge } = gt(t, {
810
+ const { print: be, exportAs: we, openPdfWindow: ye, releasePrintFrame: Ye } = ht(t, {
811
811
  getPdfExporter: () => W,
812
- onError: (l) => a("error", l, { code: "print" })
812
+ onError: (s) => a("error", s, { code: "print" })
813
813
  });
814
- ze(ft, { reload: D, print: be, exportAs: we, openPdfWindow: ye, gotoPage: z });
815
- const T = wt({
814
+ function Me(s, b = {}) {
815
+ q.value = { ...q.value, ...s }, b.reload !== !1 && H();
816
+ }
817
+ We(pt, { reload: H, print: be, exportAs: we, openPdfWindow: ye, gotoPage: z, setParams: Me });
818
+ const T = yt({
816
819
  plan: t,
817
820
  gotoPage: z,
818
- highlight: bt,
819
- clearHighlights: ht
821
+ highlight: wt,
822
+ clearHighlights: bt
820
823
  });
821
- function Ye(l) {
822
- l.ctrlKey && (l.preventDefault(), ge(I.value * (l.deltaY < 0 ? 1.1 : 1 / 1.1)));
824
+ function Ze(s) {
825
+ s.ctrlKey && (s.preventDefault(), ge(I.value * (s.deltaY < 0 ? 1.1 : 1 / 1.1)));
823
826
  }
824
- function Ze(l) {
825
- if ((l.ctrlKey || l.metaKey) && l.key.toLowerCase() === "f") {
826
- l.preventDefault(), T.visible.value || T.toggle();
827
+ function Je(s) {
828
+ if ((s.ctrlKey || s.metaKey) && s.key.toLowerCase() === "f") {
829
+ s.preventDefault(), T.visible.value || T.toggle();
827
830
  return;
828
831
  }
829
- switch (l.key) {
832
+ switch (s.key) {
830
833
  case "PageDown":
831
- l.preventDefault(), z(u.value + 1);
834
+ s.preventDefault(), z(u.value + 1);
832
835
  break;
833
836
  case "PageUp":
834
- l.preventDefault(), z(u.value - 1);
837
+ s.preventDefault(), z(u.value - 1);
835
838
  break;
836
839
  case "Home":
837
- l.preventDefault(), z(1);
840
+ s.preventDefault(), z(1);
838
841
  break;
839
842
  case "End":
840
- l.preventDefault(), z(M.value);
843
+ s.preventDefault(), z(M.value);
841
844
  break;
842
845
  case "+":
843
846
  case "=":
844
- l.preventDefault(), ge(I.value * 1.1);
847
+ s.preventDefault(), ge(I.value * 1.1);
845
848
  break;
846
849
  case "-":
847
- l.preventDefault(), ge(I.value / 1.1);
850
+ s.preventDefault(), ge(I.value / 1.1);
848
851
  break;
849
852
  }
850
853
  }
851
- function Je() {
854
+ function Xe() {
852
855
  try {
853
856
  localStorage.setItem(
854
- Ie,
855
- JSON.stringify({ zoomMode: K.value === "fit" ? "fit" : Math.round(I.value * 100) })
857
+ Be,
858
+ JSON.stringify({ zoomMode: G.value === "fit" ? "fit" : Math.round(I.value * 100) })
856
859
  );
857
860
  } catch {
858
861
  }
859
862
  }
860
- A([K, I], Je), Se(() => {
861
- const l = t.value;
862
- if (!l) return;
863
- const P = p.value;
864
- if (!P) return;
865
- P.querySelectorAll(".mrp-page-holder").forEach(($) => {
866
- const S = Number($.dataset.page ?? 0) - 1, Q = l.pages[S];
863
+ V([G, I], Xe), Fe(() => {
864
+ const s = t.value;
865
+ if (!s) return;
866
+ const b = p.value;
867
+ if (!b) return;
868
+ b.querySelectorAll(".mrp-page-holder").forEach(($) => {
869
+ const S = Number($.dataset.page ?? 0) - 1, Q = s.pages[S];
867
870
  if (!Q || $.childElementCount > 0) {
868
871
  if ($.firstElementChild) {
869
- const Re = $.firstElementChild;
870
- T.clear(Re), T.apply(Re);
872
+ const Te = $.firstElementChild;
873
+ T.clear(Te), T.apply(Te);
871
874
  }
872
875
  return;
873
876
  }
874
877
  $.style.width = `${Q.pageWidthMm * re}px`;
875
- const _ = We(Q, 96, {}, document);
878
+ const _ = Oe(Q, 96, {}, document);
876
879
  T.apply(_), $.appendChild(_);
877
880
  });
878
- }, { flush: "post" }), A(() => T.query.value, (l) => {
879
- l || p.value?.querySelectorAll(".mrp-page-holder").forEach((P) => {
880
- T.clear(P);
881
+ }, { flush: "post" }), V(() => T.query.value, (s) => {
882
+ s || p.value?.querySelectorAll(".mrp-page-holder").forEach((b) => {
883
+ T.clear(b);
881
884
  });
882
885
  });
883
- const Me = Pt(t, {
886
+ const ke = xt(t, {
884
887
  thumbsRoot: i,
885
888
  visible: f,
886
- renderThumbCanvas: (l) => {
889
+ renderThumbCanvas: (s) => {
887
890
  try {
888
- const { canvases: P } = it(t.value, { start: l, end: l, dpr: 0.2 });
889
- return P[0] ?? null;
891
+ const { canvases: b } = ut(t.value, { start: s, end: s, dpr: 0.2 });
892
+ return b[0] ?? null;
890
893
  } catch {
891
894
  return null;
892
895
  }
893
896
  }
894
897
  });
895
- Se(() => {
896
- Me.schedule();
898
+ Fe(() => {
899
+ ke.schedule();
897
900
  }, { flush: "post" });
898
- const Xe = x(() => n.debug), { debugStats: G } = yt(Xe, {
901
+ const Qe = x(() => n.debug), { debugStats: Y } = Pt(Qe, {
899
902
  plan: t,
900
903
  pageCount: M,
901
904
  windowRange: X,
902
905
  zoom: I,
903
906
  loadMs: m.loadMs
904
907
  });
905
- function ke() {
906
- Ce(c.value), K.value === "fit" && $e();
908
+ function Re() {
909
+ Ce(c.value), G.value === "fit" && $e();
907
910
  }
908
- function Qe() {
911
+ function _e() {
909
912
  try {
910
- const l = JSON.parse(localStorage.getItem(Ie) ?? "{}");
911
- l.zoomMode === "fit" ? me("fit") : typeof l.zoomMode == "number" && me(l.zoomMode);
913
+ const s = JSON.parse(localStorage.getItem(Be) ?? "{}");
914
+ s.zoomMode === "fit" ? me("fit") : typeof s.zoomMode == "number" && me(s.zoomMode);
912
915
  } catch {
913
916
  }
914
917
  }
915
- return tt(() => {
916
- window.addEventListener("resize", ke), Ce(c.value), Qe(), n.autoLoad && D();
917
- }), nt(() => {
918
- window.removeEventListener("resize", ke), Me.destroy(), T.reset(), Ge();
919
- }), A(
918
+ return nt(() => {
919
+ window.addEventListener("resize", Re), Ce(c.value), _e(), n.autoLoad && H();
920
+ }), ot(() => {
921
+ window.removeEventListener("resize", Re), ke.destroy(), T.reset(), Ye();
922
+ }), V(
920
923
  () => [n.tempId, n.furnitureTempId, JSON.stringify(n.params)],
921
924
  () => {
922
- n.autoLoad && D();
925
+ n.autoLoad && H();
923
926
  }
924
- ), A(
927
+ ), V(
925
928
  () => n.fetcher ?? C,
926
929
  () => {
927
- n.autoLoad && D();
930
+ n.autoLoad && H();
928
931
  }
929
- ), o({ reload: D, print: be, exportAs: we, openPdfWindow: ye, gotoPage: z }), (l, P) => (b(), w("div", {
932
+ ), o({ reload: H, print: be, exportAs: we, openPdfWindow: ye, gotoPage: z, setParams: Me }), (s, b) => (w(), y("div", {
930
933
  class: "mach-report-preview",
931
- style: Y(Ae.value)
934
+ style: Z(Ve.value)
932
935
  }, [
933
- ne.value && j.value.length > 0 ? (b(), ot(Kt, {
936
+ ne.value && K.value.length > 0 ? (w(), at(Gt, {
934
937
  key: 0,
935
- defs: j.value,
936
- modelValue: J.value,
937
- "onUpdate:modelValue": P[0] || (P[0] = (E) => J.value = E),
938
+ defs: K.value,
939
+ modelValue: q.value,
940
+ "onUpdate:modelValue": b[0] || (b[0] = (E) => q.value = E),
938
941
  messages: O.value,
939
942
  attempted: fe.value,
940
- onQuery: De,
941
- onReset: qe
943
+ onQuery: qe,
944
+ onReset: Ae
942
945
  }, null, 8, ["defs", "modelValue", "messages", "attempted"])) : B("", !0),
943
- at(Lt, {
946
+ rt(zt, {
944
947
  "page-count": M.value,
945
948
  "current-page": u.value,
946
- "zoom-mode": g(K),
949
+ "zoom-mode": g(G),
947
950
  zoom: g(I),
948
951
  "show-export": te.value,
949
- "show-print": N.value,
950
- "show-pdf-window": U.value,
952
+ "show-print": D.value,
953
+ "show-pdf-window": j.value,
951
954
  messages: O.value,
952
955
  search: { visible: g(T).visible.value, query: g(T).query.value, matchIndex: g(T).matchIndex.value, matchCount: g(T).matchCount.value },
953
956
  "thumbs-visible": f.value,
954
957
  onGoto: z,
955
958
  onZoom: g(me),
956
- onExport: P[1] || (P[1] = (E) => g(we)(E)),
959
+ onExport: b[1] || (b[1] = (E) => g(we)(E)),
957
960
  onPrint: g(be),
958
961
  onPdfWindow: g(ye),
959
962
  onSearchInput: g(T).onInput,
960
963
  onSearchNav: g(T).onNav,
961
964
  onSearchToggle: g(T).toggle,
962
- onThumbsToggle: P[2] || (P[2] = (E) => f.value = !f.value)
965
+ onThumbsToggle: b[2] || (b[2] = (E) => f.value = !f.value)
963
966
  }, null, 8, ["page-count", "current-page", "zoom-mode", "zoom", "show-export", "show-print", "show-pdf-window", "messages", "search", "thumbs-visible", "onZoom", "onPrint", "onPdfWindow", "onSearchInput", "onSearchNav", "onSearchToggle"]),
964
- h("div", _t, [
967
+ h("div", en, [
965
968
  h("div", {
966
969
  ref_key: "viewportRef",
967
970
  ref: c,
968
971
  class: "mrp-body",
969
972
  tabindex: "0",
970
- onWheel: Ye,
971
- onKeydown: Ze,
972
- onScrollPassive: P[3] || (P[3] = (E) => g(Ke)(E.target))
973
+ onWheel: Ze,
974
+ onKeydown: Je,
975
+ onScrollPassive: b[3] || (b[3] = (E) => g(Ge)(E.target))
973
976
  }, [
974
- s.value ? (b(), w("div", en, y(O.value.loading), 1)) : d.value ? (b(), w("div", tn, [
975
- Le(y(d.value) + " ", 1),
977
+ l.value ? (w(), y("div", tn, P(O.value.loading), 1)) : d.value ? (w(), y("div", nn, [
978
+ ze(P(d.value) + " ", 1),
976
979
  h("button", {
977
980
  class: "mrp-retry",
978
981
  type: "button",
979
- onClick: D
980
- }, y(O.value.retry), 1)
981
- ])) : !t.value || M.value === 0 ? (b(), w("div", nn, y(O.value.empty), 1)) : (b(), w("div", {
982
+ onClick: H
983
+ }, P(O.value.retry), 1)
984
+ ])) : !t.value || M.value === 0 ? (w(), y("div", on, P(O.value.empty), 1)) : (w(), y("div", {
982
985
  key: 3,
983
986
  class: "mrp-scale",
984
- style: Y({ width: `${g(ve).w * g(I)}px`, height: `${g(ve).h * g(I)}px` })
987
+ style: Z({ width: `${g(ve).w * g(I)}px`, height: `${g(ve).h * g(I)}px` })
985
988
  }, [
986
989
  h("div", {
987
990
  ref_key: "containerRef",
988
991
  ref: p,
989
992
  class: "mrp-scale-inner",
990
- style: Y({ transform: `scale(${g(I)})`, transformOrigin: "top left", width: `${g(ve).w}px` })
993
+ style: Z({ transform: `scale(${g(I)})`, transformOrigin: "top left", width: `${g(ve).w}px` })
991
994
  }, [
992
- g(X).padTopPx > 0 ? (b(), w("div", {
995
+ g(X).padTopPx > 0 ? (w(), y("div", {
993
996
  key: 0,
994
997
  class: "mrp-spacer-top",
995
- style: Y({ height: `${g(X).padTopPx}px` }),
998
+ style: Z({ height: `${g(X).padTopPx}px` }),
996
999
  "aria-hidden": "true"
997
1000
  }, null, 4)) : B("", !0),
998
- (b(!0), w(ee, null, ie(g(Ue), (E) => (b(), w("div", {
1001
+ (w(!0), y(ee, null, ie(g(je), (E) => (w(), y("div", {
999
1002
  key: E.index,
1000
1003
  class: "mrp-page-holder",
1001
1004
  "data-page": E.index + 1
1002
- }, null, 8, on))), 128)),
1003
- g(X).padBottomPx > 0 ? (b(), w("div", {
1005
+ }, null, 8, an))), 128)),
1006
+ g(X).padBottomPx > 0 ? (w(), y("div", {
1004
1007
  key: 1,
1005
1008
  class: "mrp-spacer-bottom",
1006
- style: Y({ height: `${g(X).padBottomPx}px` }),
1009
+ style: Z({ height: `${g(X).padBottomPx}px` }),
1007
1010
  "aria-hidden": "true"
1008
1011
  }, null, 4)) : B("", !0)
1009
1012
  ], 4)
1010
1013
  ], 4))
1011
1014
  ], 544),
1012
- f.value && M.value > 0 ? (b(), w("aside", {
1015
+ f.value && M.value > 0 ? (w(), y("aside", {
1013
1016
  key: 0,
1014
1017
  ref_key: "thumbsRef",
1015
1018
  ref: i,
1016
1019
  class: "mrp-thumbs"
1017
1020
  }, [
1018
- (b(!0), w(ee, null, ie(t.value?.pages ?? [], (E, $) => (b(), w("div", {
1021
+ (w(!0), y(ee, null, ie(t.value?.pages ?? [], (E, $) => (w(), y("div", {
1019
1022
  key: $,
1020
- class: V(["mrp-thumb", { "mrp-thumb-active": $ + 1 === u.value }]),
1023
+ class: U(["mrp-thumb", { "mrp-thumb-active": $ + 1 === u.value }]),
1021
1024
  onClick: (S) => z($ + 1)
1022
1025
  }, [
1023
1026
  h("div", {
1024
1027
  class: "mrp-thumb-box",
1025
1028
  "data-thumb": $ + 1,
1026
- style: Y({ height: `${Math.round(E.pageHeightMm / E.pageWidthMm * 116)}px` })
1027
- }, null, 12, rn),
1028
- h("span", sn, y($ + 1), 1)
1029
- ], 10, an))), 128))
1029
+ style: Z({ height: `${Math.round(E.pageHeightMm / E.pageWidthMm * 116)}px` })
1030
+ }, null, 12, sn),
1031
+ h("span", ln, P($ + 1), 1)
1032
+ ], 10, rn))), 128))
1030
1033
  ], 512)) : B("", !0)
1031
1034
  ]),
1032
- h("div", ln, [
1033
- rt(l.$slots, "default", {}, void 0, !0)
1035
+ h("div", un, [
1036
+ st(s.$slots, "default", {}, void 0, !0)
1034
1037
  ]),
1035
- g(G) ? (b(), w("div", un, [
1036
- P[4] || (P[4] = h("div", null, "mach-report debug", -1)),
1037
- h("div", null, "pages: " + y(g(G).pages) + " | window: [" + y(g(G).window) + "]", 1),
1038
- h("div", null, "zoom: " + y(g(G).zoom) + " | load: " + y(g(G).loadMs), 1),
1039
- h("div", null, "plan: " + y(g(G).planKB) + "KB", 1)
1038
+ g(Y) ? (w(), y("div", cn, [
1039
+ b[4] || (b[4] = h("div", null, "mach-report debug", -1)),
1040
+ h("div", null, "pages: " + P(g(Y).pages) + " | window: [" + P(g(Y).window) + "]", 1),
1041
+ h("div", null, "zoom: " + P(g(Y).zoom) + " | load: " + P(g(Y).loadMs), 1),
1042
+ h("div", null, "plan: " + P(g(Y).planKB) + "KB", 1)
1040
1043
  ])) : B("", !0)
1041
1044
  ], 4));
1042
1045
  }
1043
- }), dn = /* @__PURE__ */ Ee(cn, [["__scopeId", "data-v-dbf59a36"]]), Pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1046
+ }), fn = /* @__PURE__ */ Ee(dn, [["__scopeId", "data-v-d49e06b6"]]), xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1044
1047
  __proto__: null,
1045
- default: dn
1048
+ default: fn
1046
1049
  }, Symbol.toStringTag, { value: "Module" }));
1047
1050
  export {
1048
- Gt as D,
1051
+ Yt as D,
1049
1052
  le as M,
1050
- Kt as R,
1051
- wn as S,
1052
- Yt as a,
1053
- dn as b,
1054
- Lt as c,
1053
+ Gt as R,
1054
+ yn as S,
1055
+ Zt as a,
1056
+ fn as b,
1057
+ zt as c,
1055
1058
  se as d,
1056
- hn as e,
1057
- bn as f,
1058
- yn as g,
1059
- Qt as h,
1060
- mt as i,
1061
- gt as j,
1062
- vt as k,
1063
- Pn as l,
1064
- gn as p,
1065
- Zt as r,
1066
- Jt as t,
1067
- Xt as u
1059
+ bn as e,
1060
+ wn as f,
1061
+ Pn as g,
1062
+ _t as h,
1063
+ vt as i,
1064
+ ht as j,
1065
+ gt as k,
1066
+ xn as l,
1067
+ hn as p,
1068
+ Jt as r,
1069
+ Xt as t,
1070
+ Qt as u
1068
1071
  };