@jt-home/mfe-components 1.0.60-beta.1 → 1.0.61-beta.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,7 +1,6 @@
1
- import { ref as D, isRef as Q, watch as I, defineAsyncComponent as me, defineComponent as T, h as o, computed as b, onMounted as z, onBeforeUnmount as J, render as p } from "vue";
2
- import { ElIcon as _ } from "element-plus";
3
- import { ZoomOut as fe, ZoomIn as pe, RefreshLeft as ve, Download as he } from "@element-plus/icons-vue";
4
- const we = {
1
+ import { ref as j, isRef as ue, watch as $, defineComponent as R, openBlock as N, createElementBlock as q, createElementVNode as V, onBeforeUnmount as G, h as r, computed as L, onMounted as ee, nextTick as ge, render as P } from "vue";
2
+ import { ElIcon as J } from "element-plus";
3
+ const be = {
5
4
  common: {
6
5
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js 无法读取该文件,已切换为浏览器内置预览",
7
6
  PDF加载中___: "PDF 加载中...",
@@ -57,7 +56,7 @@ const we = {
57
56
  附件预览: "附件预览",
58
57
  附件预览未初始化: "附件预览未初始化"
59
58
  }
60
- }, ge = {
59
+ }, ye = {
61
60
  common: {
62
61
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "Cannot read file via PDF.js; switched to browser preview",
63
62
  PDF加载中___: "Loading PDF...",
@@ -113,7 +112,7 @@ const we = {
113
112
  附件预览: "Attachment Preview",
114
113
  附件预览未初始化: "Attachment preview not initialized"
115
114
  }
116
- }, be = {
115
+ }, Ae = {
117
116
  common: {
118
117
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js ไม่สามารถอ่านไฟล์ได้ เปลี่ยนเป็นตัวอย่างในเบราว์เซอร์แล้ว",
119
118
  PDF加载中___: "กำลังโหลด PDF...",
@@ -169,7 +168,7 @@ const we = {
169
168
  附件预览: "ตัวอย่างไฟล์แนบ",
170
169
  附件预览未初始化: "ยังไม่ได้เริ่มต้นการแสดงตัวอย่างไฟล์แนบ"
171
170
  }
172
- }, ye = {
171
+ }, _e = {
173
172
  common: {
174
173
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js không đọc được tệp, đã chuyển sang xem trước bằng trình duyệt",
175
174
  PDF加载中___: "Đang tải PDF...",
@@ -225,7 +224,7 @@ const we = {
225
224
  附件预览: "Xem trước tệp đính kèm",
226
225
  附件预览未初始化: "Chưa khởi tạo xem trước tệp đính kèm"
227
226
  }
228
- }, Ae = {
227
+ }, Pe = {
229
228
  common: {
230
229
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js no puede leer el archivo; se cambió a vista previa del navegador",
231
230
  PDF加载中___: "Cargando PDF...",
@@ -337,7 +336,7 @@ const we = {
337
336
  附件预览: "Pratinjau Lampiran",
338
337
  附件预览未初始化: "Pratinjau lampiran belum diinisialisasi"
339
338
  }
340
- }, Pe = {
339
+ }, ke = {
341
340
  common: {
342
341
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "Datei kann nicht mit PDF.js gelesen werden; Browser-Vorschau aktiviert",
343
342
  PDF加载中___: "PDF wird geladen...",
@@ -393,7 +392,7 @@ const we = {
393
392
  附件预览: "Anhangsvorschau",
394
393
  附件预览未初始化: "Anhangsvorschau nicht initialisiert"
395
394
  }
396
- }, ke = {
395
+ }, je = {
397
396
  common: {
398
397
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "O PDF.js não consegue ler o arquivo; alterado para visualização do navegador",
399
398
  PDF加载中___: "Carregando PDF...",
@@ -449,7 +448,7 @@ const we = {
449
448
  附件预览: "Visualização de anexo",
450
449
  附件预览未初始化: "Visualização de anexo não inicializada"
451
450
  }
452
- }, je = {
451
+ }, Ee = {
453
452
  common: {
454
453
  "PDF_js无法读取该文件,已切换为浏览器内置预览": "PDF.js មិនអាចអានឯកសារបានទេ បានប្តូរទៅជាមើលជាមុនក្នុងកម្មវិធីរុករក",
455
454
  PDF加载中___: "កំពុងផ្ទុក PDF...",
@@ -505,17 +504,17 @@ const we = {
505
504
  附件预览: "មើលឯកសារភ្ជាប់ជាមុន",
506
505
  附件预览未初始化: "ការមើលឯកសារភ្ជាប់ជាមុនមិនទាន់ត្រូវបានចាប់ផ្តើមទេ"
507
506
  }
508
- }, Ee = {
509
- "zh-cn": we,
510
- en: ge,
511
- th: be,
512
- vi: ye,
513
- es: Ae,
507
+ }, Le = {
508
+ "zh-cn": be,
509
+ en: ye,
510
+ th: Ae,
511
+ vi: _e,
512
+ es: Pe,
514
513
  id: De,
515
- de: Pe,
516
- pt: ke,
517
- km: je
518
- }, E = [
514
+ de: ke,
515
+ pt: je,
516
+ km: Ee
517
+ }, z = [
519
518
  { key: "zh", label: "简体中文", displayLabel: "简体中文", elementPlusLocale: "zh-cn" },
520
519
  { key: "en", label: "英语", displayLabel: "English", elementPlusLocale: "en" },
521
520
  { key: "th", label: "泰语", displayLabel: "ไทย", elementPlusLocale: "th" },
@@ -527,9 +526,9 @@ const we = {
527
526
  { key: "km", label: "柬埔寨语", displayLabel: "ភាសាខ្មែរ", elementPlusLocale: "km" }
528
527
  ];
529
528
  Object.freeze(
530
- Object.fromEntries(E.map((e) => [e.key, e.elementPlusLocale]))
529
+ Object.fromEntries(z.map((e) => [e.key, e.elementPlusLocale]))
531
530
  );
532
- const _e = Object.freeze({
531
+ const Re = Object.freeze({
533
532
  zh: "ZHS",
534
533
  en: "ENG",
535
534
  id: "IDN",
@@ -541,27 +540,27 @@ const _e = Object.freeze({
541
540
  km: "CAM"
542
541
  });
543
542
  Object.freeze(
544
- Object.fromEntries(Object.entries(_e).map(([e, t]) => [t, e]))
543
+ Object.fromEntries(Object.entries(Re).map(([e, t]) => [t, e]))
545
544
  );
546
- function Le(e, t = {}) {
547
- const n = t.fallback ?? "zh", r = Ce(t.languageList), a = e.toLowerCase();
548
- return r.find((i) => i.key === a) ?? r.find((i) => i.key === n) ?? E[0];
545
+ function xe(e, t = {}) {
546
+ const a = t.fallback ?? "zh", o = Ce(t.languageList), n = e.toLowerCase();
547
+ return o.find((i) => i.key === n) ?? o.find((i) => i.key === a) ?? z[0];
549
548
  }
550
- function Re(e, t = {}) {
551
- return Le(e, t).elementPlusLocale;
549
+ function Te(e, t = {}) {
550
+ return xe(e, t).elementPlusLocale;
552
551
  }
553
552
  function Ce(e) {
554
553
  return e != null && e.length ? e.map((t) => {
555
- const n = t.key ?? t.value, r = E.find((a) => a.key === n) ?? E[0];
554
+ const a = t.key ?? t.value, o = z.find((n) => n.key === a) ?? z[0];
556
555
  return {
557
- ...r,
556
+ ...o,
558
557
  ...t,
559
- key: r.key,
560
- elementPlusLocale: t.elementPlusLocale ?? r.elementPlusLocale
558
+ key: o.key,
559
+ elementPlusLocale: t.elementPlusLocale ?? o.elementPlusLocale
561
560
  };
562
- }) : E;
561
+ }) : z;
563
562
  }
564
- const Te = {
563
+ const Be = {
565
564
  "zh-hans": "zh",
566
565
  "zh-cn": "zh",
567
566
  cn: "zh",
@@ -575,64 +574,122 @@ const Te = {
575
574
  "pt-br": "pt",
576
575
  "km-kh": "km"
577
576
  };
578
- function L(e) {
577
+ function O(e) {
579
578
  const t = String(e || "zh-cn").trim().toLowerCase().replace(/_/g, "-");
580
- return Re(Te[t] || t) || "zh-cn";
579
+ return Te(Be[t] || t) || "zh-cn";
581
580
  }
582
- const y = D("zh-cn");
583
- let U;
584
- function M() {
585
- U?.(), U = void 0;
581
+ const B = j("zh-cn");
582
+ let Q;
583
+ function te() {
584
+ Q?.(), Q = void 0;
586
585
  }
587
- function V(e) {
588
- return e ? typeof e == "function" ? L(e()) : Q(e) ? L(e.value) : L(e) : y.value;
586
+ function le(e) {
587
+ return e ? typeof e == "function" ? O(e()) : ue(e) ? O(e.value) : O(e) : B.value;
589
588
  }
590
- function Be(e, t) {
589
+ function Fe(e, t) {
591
590
  if (e)
592
- return t.split(".").reduce((n, r) => {
593
- if (!(!n || typeof n != "object"))
594
- return n[r];
591
+ return t.split(".").reduce((a, o) => {
592
+ if (!(!a || typeof a != "object"))
593
+ return a[o];
595
594
  }, e);
596
595
  }
597
- function K(e, t) {
598
- const n = Be(Ee[e], t);
599
- return typeof n == "string" ? n : void 0;
596
+ function se(e, t) {
597
+ const a = Fe(Le[e], t);
598
+ return typeof a == "string" ? a : void 0;
600
599
  }
601
- function Fe(e, t) {
602
- return t ? e.replace(/\{(\w+)\}/g, (n, r) => {
603
- const a = t[r];
604
- return a == null ? n : String(a);
600
+ function Se(e, t) {
601
+ return t ? e.replace(/\{(\w+)\}/g, (a, o) => {
602
+ const n = t[o];
603
+ return n == null ? a : String(n);
605
604
  }) : e;
606
605
  }
607
- function at(e) {
608
- M(), y.value = L(e);
606
+ function pt(e) {
607
+ te(), B.value = O(e);
609
608
  }
610
- function ot() {
611
- return y.value;
609
+ function vt() {
610
+ return B.value;
612
611
  }
613
- function rt() {
614
- M(), y.value = "zh-cn";
612
+ function ht() {
613
+ te(), B.value = "zh-cn";
615
614
  }
616
- function it(e, t = {}) {
617
- if (M(), t.locale) {
618
- if (typeof t.locale == "function" || Q(t.locale)) {
619
- U = I(
620
- () => V(t.locale),
621
- (n) => {
622
- y.value = n;
615
+ function wt(e, t = {}) {
616
+ if (te(), t.locale) {
617
+ if (typeof t.locale == "function" || ue(t.locale)) {
618
+ Q = $(
619
+ () => le(t.locale),
620
+ (a) => {
621
+ B.value = a;
623
622
  },
624
623
  { immediate: !0, flush: "sync" }
625
624
  );
626
625
  return;
627
626
  }
628
- y.value = V(t.locale);
627
+ B.value = le(t.locale);
629
628
  }
630
629
  }
631
- function s(e, t = e, n) {
632
- const r = t || e, a = y.value, i = K(a, e) || K("zh-cn", e) || r || e;
633
- return Fe(i, n);
630
+ function c(e, t = e, a) {
631
+ const o = t || e, n = B.value, i = se(n, e) || se("zh-cn", e) || o || e;
632
+ return Se(i, a);
634
633
  }
635
- const Se = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAAAAaVBMVEUAAABWapNVapKeqsLJztx3hKnGzN2yu8////9XapWcqMGps8lXapVYa5RWaZWps8l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7X2EGdlHbiNYNjON8OfvIkZP2Zi9tqV7CE2V77TyxL2PdkXJ52GUuYvZbKL1IsYcfr9GPbq2WxhJ2gMIUpTGEcFKYwEgpTGAmFKYyEwhRGQmEKI+EJy3YDCeeNdgOesMH4ZTgk4zfAoxi9GR6dsctwCfRD1sNnNm7HCmtuY8wRH42dZSXCL/CW5QQcmtoax4iLIuOglQkVpIHrPlzGPqCSNE8diT4FiIiIiIjIP2/v9e/hKQXqEwAAAABJRU5ErkJggg==", xe = /* @__PURE__ */ new Set([
634
+ /*! Element Plus Icons Vue v2.3.2 */
635
+ var Ie = /* @__PURE__ */ R({
636
+ name: "Download",
637
+ __name: "download",
638
+ setup(e) {
639
+ return (t, a) => (N(), q("svg", {
640
+ xmlns: "http://www.w3.org/2000/svg",
641
+ viewBox: "0 0 1024 1024"
642
+ }, [
643
+ V("path", {
644
+ fill: "currentColor",
645
+ d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"
646
+ })
647
+ ]));
648
+ }
649
+ }), Me = Ie, ze = /* @__PURE__ */ R({
650
+ name: "RefreshLeft",
651
+ __name: "refresh-left",
652
+ setup(e) {
653
+ return (t, a) => (N(), q("svg", {
654
+ xmlns: "http://www.w3.org/2000/svg",
655
+ viewBox: "0 0 1024 1024"
656
+ }, [
657
+ V("path", {
658
+ fill: "currentColor",
659
+ d: "M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"
660
+ })
661
+ ]));
662
+ }
663
+ }), Ue = ze, Je = /* @__PURE__ */ R({
664
+ name: "ZoomIn",
665
+ __name: "zoom-in",
666
+ setup(e) {
667
+ return (t, a) => (N(), q("svg", {
668
+ xmlns: "http://www.w3.org/2000/svg",
669
+ viewBox: "0 0 1024 1024"
670
+ }, [
671
+ V("path", {
672
+ fill: "currentColor",
673
+ d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"
674
+ })
675
+ ]));
676
+ }
677
+ }), Oe = Je, Ye = /* @__PURE__ */ R({
678
+ name: "ZoomOut",
679
+ __name: "zoom-out",
680
+ setup(e) {
681
+ return (t, a) => (N(), q("svg", {
682
+ xmlns: "http://www.w3.org/2000/svg",
683
+ viewBox: "0 0 1024 1024"
684
+ }, [
685
+ V("path", {
686
+ fill: "currentColor",
687
+ d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"
688
+ })
689
+ ]));
690
+ }
691
+ }), Ne = Ye;
692
+ const qe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAAAAaVBMVEUAAABWapNVapKeqsLJztx3hKnGzN2yu8////9XapWcqMGps8lXapVYa5RWaZWps8lfcJjS1+KjrsVXapWapr////9sfaKrtMrV2uWBj7B4iKqWob1wgaXr7fOBj6/Ax9dhc5yhq8OKl7Wba+6tAAAAE3RSTlMAgGDuDyVLoYDe2XuXRb68cy6e4BCQEAAAAyZJREFUeNrt29tyokAUheGOQjIoeMhuCQ4e0Pd/yCE1STU4mGq7bXqzZ/23ufoqYblTqkIIIYQQQggNlM42Lzctf5nMD22bKQYVOQ30sTPt6dEO74mKXLoiCgDTi1RFbUMUBhZXluQUDKbnWxWtjMLB2pYqUjmFg8WUzSg0T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  "jpg",
637
694
  "jpeg",
638
695
  "png",
@@ -642,7 +699,7 @@ const Se = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
642
699
  "svg",
643
700
  "avif",
644
701
  "ico"
645
- ]), Ie = /* @__PURE__ */ new Set(["mp4", "webm", "ogg", "ogv", "mov", "m4v"]), ze = /* @__PURE__ */ new Set([
702
+ ]), He = /* @__PURE__ */ new Set(["mp4", "webm", "ogg", "ogv", "mov", "m4v"]), Ke = /* @__PURE__ */ new Set([
646
703
  "mp3",
647
704
  "wav",
648
705
  "ogg",
@@ -650,7 +707,7 @@ const Se = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
650
707
  "m4a",
651
708
  "aac",
652
709
  "flac"
653
- ]), Je = /* @__PURE__ */ new Set([
710
+ ]), We = /* @__PURE__ */ new Set([
654
711
  "html",
655
712
  "htm",
656
713
  "txt",
@@ -659,7 +716,7 @@ const Se = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
659
716
  "csv",
660
717
  "md",
661
718
  "log"
662
- ]), Me = /* @__PURE__ */ new Set([
719
+ ]), Qe = /* @__PURE__ */ new Set([
663
720
  "doc",
664
721
  "docx",
665
722
  "xls",
@@ -669,133 +726,150 @@ const Se = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANgAAADYCAMAAAC+/t3fAA
669
726
  "zip",
670
727
  "rar",
671
728
  "7z"
672
- ]), x = {
729
+ ]), Z = {
673
730
  component: "JtAttachmentPreview",
674
731
  marker: "2026-06-25-download-error-detail",
675
732
  source: "@jt-home/mfe-components/src/components/JtAttachmentPreview/index.ts",
676
- pdfLoadMode: "vue-office-pdf-src",
733
+ pdfLoadMode: "fetch-bytes-then-pdfjs-data",
677
734
  previewDownloadMode: "openByParams-uses-registered-downloadRequest",
678
735
  downloadResponseMode: "supports-blob-and-axios-response-data-blob"
679
736
  };
680
- function m(e, t) {
681
- console.info(`[JtAttachmentPreview DEBUG ${x.marker}] ${e}`, {
682
- ...x,
737
+ function p(e, t) {
738
+ console.info(`[JtAttachmentPreview DEBUG ${Z.marker}] ${e}`, {
739
+ ...Z,
683
740
  ...t
684
741
  });
685
742
  }
686
- typeof window < "u" && (window.__JT_ATTACHMENT_PREVIEW_DEBUG__ = x);
687
- let v = null, h = null, R = null;
688
- const Ye = me(
689
- () => (
690
- // PDF 渲染依赖体积较大,只在 PDF 预览时加载,避免图片预览静态带入。
691
- import("@vue-office/pdf").then((e) => e.default)
692
- )
693
- );
694
- function Oe(e) {
743
+ typeof window < "u" && (window.__JT_ATTACHMENT_PREVIEW_DEBUG__ = Z, p("module-loaded"));
744
+ let D = null, K = null, k = null;
745
+ async function Ze() {
746
+ return K || (K = Promise.all([
747
+ import("./pdf-BmBuG7of.js"),
748
+ import("./pdf.worker.min-4PI-nNLo.js")
749
+ ]).then(([e, t]) => (e.GlobalWorkerOptions.workerSrc = t.default, e))), K;
750
+ }
751
+ function Xe(e) {
695
752
  return typeof e == "string" ? { url: e } : e;
696
753
  }
697
- function Z(e) {
754
+ function de(e) {
698
755
  const [t] = e.split(/[?#]/);
699
756
  return t ?? "";
700
757
  }
701
- function Y(e, t) {
758
+ function ae(e, t) {
702
759
  if (t?.trim()) return t.trim();
703
- const n = Z(e).split("/").filter(Boolean).pop();
704
- if (!n) return s("common.附件预览");
760
+ const a = de(e).split("/").filter(Boolean).pop();
761
+ if (!a) return c("common.附件预览");
705
762
  try {
706
- return decodeURIComponent(n);
763
+ return decodeURIComponent(a);
707
764
  } catch {
708
- return n;
765
+ return a;
709
766
  }
710
767
  }
711
- function H(e) {
712
- return Z(e).match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase() ?? "";
768
+ function X(e) {
769
+ return de(e).match(/\.([a-z0-9]+)$/i)?.[1]?.toLowerCase() ?? "";
713
770
  }
714
- function qe(e) {
771
+ function $e(e) {
715
772
  return e?.trim().replace(/^\./, "").toLowerCase() ?? "";
716
773
  }
717
- function Ne(e) {
718
- const t = qe(e);
719
- return xe.has(t) ? "image" : t === "pdf" ? "pdf" : Ie.has(t) ? "video" : ze.has(t) ? "audio" : Je.has(t) ? "iframe" : Me.has(t) ? "unsupported" : "unknown";
774
+ function et(e) {
775
+ const t = $e(e);
776
+ return Ge.has(t) ? "image" : t === "pdf" ? "pdf" : He.has(t) ? "video" : Ke.has(t) ? "audio" : We.has(t) ? "iframe" : Qe.has(t) ? "unsupported" : "unknown";
720
777
  }
721
- function O(e) {
778
+ function ne(e) {
722
779
  const t = e.toLowerCase().split(";")[0]?.trim() ?? "";
723
780
  return t.startsWith("image/") ? "image" : t === "application/pdf" ? "pdf" : t.startsWith("video/") ? "video" : t.startsWith("audio/") ? "audio" : t.startsWith("text/") ? "iframe" : "unknown";
724
781
  }
725
- function X(e) {
782
+ function me(e) {
726
783
  if (!e.url.trim()) return "empty";
727
784
  if (e.mode && e.mode !== "auto") return e.mode;
728
785
  if (e.mimeType) {
729
- const n = O(e.mimeType);
730
- if (n !== "unknown") return n;
786
+ const a = ne(e.mimeType);
787
+ if (a !== "unknown") return a;
731
788
  }
732
- const t = Ne(
733
- e.extension || H(e.name || "") || H(e.url)
789
+ const t = et(
790
+ e.extension || X(e.name || "") || X(e.url)
734
791
  );
735
792
  return t !== "unknown" ? t : "unknown";
736
793
  }
737
- async function Ge(e) {
794
+ async function tt(e) {
738
795
  try {
739
- const n = (await fetch(e, { method: "HEAD" })).headers.get("content-type") ?? "";
740
- return O(n);
796
+ const a = (await fetch(e, { method: "HEAD" })).headers.get("content-type") ?? "";
797
+ return ne(a);
741
798
  } catch {
742
799
  return "unknown";
743
800
  }
744
801
  }
745
- async function $(e, t) {
746
- const n = await fetch(e, t);
747
- if (!n.ok) throw new Error(`fetch failed: ${n.status}`);
748
- return n.blob();
802
+ async function fe(e, t) {
803
+ const a = await fetch(e, t);
804
+ if (!a.ok) throw new Error(`fetch failed: ${a.status}`);
805
+ return a.blob();
806
+ }
807
+ async function at(e) {
808
+ p("fetch-pdf-bytes-start", {
809
+ url: e
810
+ });
811
+ const t = await fetch(e);
812
+ if (!t.ok) throw new Error(`fetch failed: ${t.status}`);
813
+ const a = new Uint8Array(await t.arrayBuffer());
814
+ return p("fetch-pdf-bytes-done", {
815
+ url: e,
816
+ byteLength: a.byteLength,
817
+ contentType: t.headers.get("content-type") ?? ""
818
+ }), a;
819
+ }
820
+ function nt(e, t) {
821
+ const a = X(t);
822
+ return a === "doc" || a === "docx" ? "W" : a === "xls" || a === "xlsx" ? "X" : a === "ppt" || a === "pptx" ? "P" : a === "zip" || a === "rar" || a === "7z" ? "ZIP" : e === "pdf" ? "PDF" : "FILE";
749
823
  }
750
- function ee(e, t, n, r = !1) {
751
- return o(
824
+ function pe(e, t, a, o = !1) {
825
+ return r(
752
826
  "button",
753
827
  {
754
- class: n,
828
+ class: a,
755
829
  type: "button",
756
830
  onClick: () => {
757
- m("download-button-click", {
831
+ p("download-button-click", {
758
832
  url: e.url,
759
833
  downloadName: t,
760
- fallbackToRawUrl: r
761
- }), ne(e, t, {
762
- fallbackToRawUrl: r
834
+ fallbackToRawUrl: o
835
+ }), he(e, t, {
836
+ fallbackToRawUrl: o
763
837
  });
764
838
  }
765
839
  },
766
840
  [
767
- o(
768
- _,
841
+ r(
842
+ J,
769
843
  { class: "jt-attachment-preview-service__download-icon" },
770
- () => o(he)
844
+ () => r(Me)
771
845
  ),
772
- o(
846
+ r(
773
847
  "span",
774
848
  { class: "jt-attachment-preview-service__download-text" },
775
- s("common.下载")
849
+ c("common.下载")
776
850
  )
777
851
  ]
778
852
  );
779
853
  }
780
- function S(e) {
854
+ function W(e) {
781
855
  return e === "image" || e === "pdf";
782
856
  }
783
- function te(e) {
784
- return o(
857
+ function ve(e) {
858
+ return r(
785
859
  "div",
786
860
  { class: "jt-attachment-preview-service__preview-fallback" },
787
861
  [
788
- o("img", {
862
+ r("img", {
789
863
  class: "jt-attachment-preview-service__preview-fallback-icon",
790
864
  src: e.icon,
791
865
  alt: ""
792
866
  }),
793
- o(
867
+ r(
794
868
  "div",
795
869
  { class: "jt-attachment-preview-service__unsupported-text" },
796
- s("common.暂不支持预览此类型的文件")
870
+ c("common.暂不支持预览此类型的文件")
797
871
  ),
798
- o(
872
+ r(
799
873
  "div",
800
874
  {
801
875
  class: "jt-attachment-preview-service__file-name",
@@ -806,56 +880,56 @@ function te(e) {
806
880
  ]
807
881
  );
808
882
  }
809
- function q(e, t) {
810
- const n = document.createElement("a");
811
- n.href = e, n.download = t, n.style.display = "none", document.body.appendChild(n), n.click(), n.remove();
883
+ function re(e, t) {
884
+ const a = document.createElement("a");
885
+ a.href = e, a.download = t, a.style.display = "none", document.body.appendChild(a), a.click(), a.remove();
812
886
  }
813
- function N(e, t) {
814
- const n = URL.createObjectURL(e);
815
- q(n, t), window.setTimeout(() => URL.revokeObjectURL(n), 1e3);
887
+ function oe(e, t) {
888
+ const a = URL.createObjectURL(e);
889
+ re(a, t), window.setTimeout(() => URL.revokeObjectURL(a), 1e3);
816
890
  }
817
- function C(e) {
891
+ function Y(e) {
818
892
  return e instanceof Blob || Object.prototype.toString.call(e) === "[object Blob]";
819
893
  }
820
- function Ve(e, t) {
821
- if (C(e))
894
+ function rt(e, t) {
895
+ if (Y(e))
822
896
  return e;
823
897
  if (e && typeof e == "object") {
824
- const n = e;
825
- if (C(n.data)) {
826
- const r = n.data;
898
+ const a = e;
899
+ if (Y(a.data)) {
900
+ const o = a.data;
827
901
  return {
828
- blob: n.data,
829
- name: n.fileName || n.name || r.name || t
902
+ blob: a.data,
903
+ name: a.fileName || a.name || o.name || t
830
904
  };
831
905
  }
832
906
  }
833
907
  return null;
834
908
  }
835
- async function Ke(e, t, n = {}) {
836
- m("download-start", {
909
+ async function ot(e, t, a = {}) {
910
+ p("download-start", {
837
911
  url: e,
838
912
  downloadName: t,
839
- fallbackToRawUrl: !!n.fallbackToRawUrl,
840
- hasRequestInit: !!n.requestInit
913
+ fallbackToRawUrl: !!a.fallbackToRawUrl,
914
+ hasRequestInit: !!a.requestInit
841
915
  });
842
916
  try {
843
- const r = await $(e, n.requestInit);
844
- m("download-blob-ready", {
917
+ const o = await fe(e, a.requestInit);
918
+ p("download-blob-ready", {
845
919
  url: e,
846
920
  downloadName: t,
847
- blobType: r.type,
848
- blobSize: r.size
849
- }), N(r, t);
921
+ blobType: o.type,
922
+ blobSize: o.size
923
+ }), oe(o, t);
850
924
  } catch {
851
- m("download-blob-failed", {
925
+ p("download-blob-failed", {
852
926
  url: e,
853
927
  downloadName: t,
854
- fallbackToRawUrl: !!n.fallbackToRawUrl
855
- }), n.fallbackToRawUrl && q(e, t);
928
+ fallbackToRawUrl: !!a.fallbackToRawUrl
929
+ }), a.fallbackToRawUrl && re(e, t);
856
930
  }
857
931
  }
858
- function W(e, t) {
932
+ function ce(e, t) {
859
933
  return e instanceof Blob ? { blob: e, name: t } : e ? {
860
934
  url: e.url,
861
935
  blob: e.blob,
@@ -864,88 +938,88 @@ function W(e, t) {
864
938
  fallbackToRawUrl: e.fallbackToRawUrl
865
939
  } : null;
866
940
  }
867
- async function ne(e, t, n = {}) {
868
- const r = {
941
+ async function he(e, t, a = {}) {
942
+ const o = {
869
943
  url: e.url,
870
944
  name: t,
871
945
  params: e.requestParams,
872
946
  options: e
873
947
  };
874
948
  try {
875
- let a = null;
876
- if (m("download-resolve-start", {
949
+ let n = null;
950
+ if (p("download-resolve-start", {
877
951
  url: e.url,
878
952
  downloadName: t,
879
953
  hasCustomDownload: !!e.download,
880
- hasRegisteredDownload: !!h?.downloadRequest,
954
+ hasRegisteredDownload: !!k?.downloadRequest,
881
955
  useRegisteredDownload: !!e.useRegisteredDownload,
882
956
  hasRequestParams: Object.prototype.hasOwnProperty.call(
883
957
  e,
884
958
  "requestParams"
885
959
  )
886
960
  }), e.download) {
887
- m("download-custom-handler-start", {
961
+ p("download-custom-handler-start", {
888
962
  url: e.url,
889
963
  downloadName: t
890
964
  });
891
- const l = await e.download(r);
892
- if (a = W(l, t), !a) {
893
- m("download-custom-handler-done", {
965
+ const l = await e.download(o);
966
+ if (n = ce(l, t), !n) {
967
+ p("download-custom-handler-done", {
894
968
  url: e.url,
895
969
  downloadName: t
896
970
  });
897
971
  return;
898
972
  }
899
- } else if (e.useRegisteredDownload && h?.downloadRequest) {
900
- m("download-setup-request-start", {
973
+ } else if (e.useRegisteredDownload && k?.downloadRequest) {
974
+ p("download-setup-request-start", {
901
975
  url: e.url,
902
976
  downloadName: t,
903
977
  params: e.requestParams
904
978
  });
905
- const l = await h.downloadRequest(
979
+ const l = await k.downloadRequest(
906
980
  e.requestParams
907
981
  );
908
- m("download-request-response", {
909
- isBlob: C(l),
910
- isDataBlob: !!l && typeof l == "object" && C(l.data),
982
+ p("download-request-response", {
983
+ isBlob: Y(l),
984
+ isDataBlob: !!l && typeof l == "object" && Y(l.data),
911
985
  responseType: Object.prototype.toString.call(l)
912
986
  });
913
- const f = Ve(l, t), d = f || (h.mapDownloadResponse ? h.mapDownloadResponse(
987
+ const h = rt(l, t), f = h || (k.mapDownloadResponse ? k.mapDownloadResponse(
914
988
  l,
915
989
  e.requestParams
916
990
  ) : l);
917
- a = W(d, t);
991
+ n = ce(f, t);
918
992
  }
919
- if (a?.blob) {
920
- m("download-result-blob", {
921
- downloadName: a.name,
922
- blobType: a.blob.type,
923
- blobSize: a.blob.size
924
- }), N(a.blob, a.name);
993
+ if (n?.blob) {
994
+ p("download-result-blob", {
995
+ downloadName: n.name,
996
+ blobType: n.blob.type,
997
+ blobSize: n.blob.size
998
+ }), oe(n.blob, n.name);
925
999
  return;
926
1000
  }
927
- const i = a?.url || e.downloadUrl || e.url, u = a?.name || t;
928
- await Ke(i, u, {
929
- requestInit: a?.requestInit || e.downloadRequestInit,
930
- fallbackToRawUrl: a?.fallbackToRawUrl ?? e.downloadFallbackToRawUrl ?? n.fallbackToRawUrl
1001
+ const i = n?.url || e.downloadUrl || e.url, u = n?.name || t;
1002
+ await ot(i, u, {
1003
+ requestInit: n?.requestInit || e.downloadRequestInit,
1004
+ fallbackToRawUrl: n?.fallbackToRawUrl ?? e.downloadFallbackToRawUrl ?? a.fallbackToRawUrl
931
1005
  });
932
- } catch (a) {
933
- m("download-handler-failed", {
1006
+ } catch (n) {
1007
+ p("download-handler-failed", {
934
1008
  url: e.url,
935
1009
  downloadName: t,
936
- errorName: a instanceof Error ? a.name : "",
937
- errorMessage: a instanceof Error ? a.message : String(a),
938
- errorStack: a instanceof Error ? a.stack : "",
939
- errorResponseStatus: a && typeof a == "object" ? a.response?.status : void 0,
940
- errorResponseType: a && typeof a == "object" ? Object.prototype.toString.call(
941
- a.response?.data
1010
+ errorName: n instanceof Error ? n.name : "",
1011
+ errorMessage: n instanceof Error ? n.message : String(n),
1012
+ errorStack: n instanceof Error ? n.stack : "",
1013
+ errorResponseStatus: n && typeof n == "object" ? n.response?.status : void 0,
1014
+ errorResponseType: n && typeof n == "object" ? Object.prototype.toString.call(
1015
+ n.response?.data
942
1016
  ) : void 0,
943
- errorResponseDataType: a && typeof a == "object" ? a.response?.data?.type : void 0
944
- }), n.fallbackToRawUrl && q(e.downloadUrl || e.url, t);
1017
+ errorResponseDataType: n && typeof n == "object" ? n.response?.data?.type : void 0
1018
+ }), a.fallbackToRawUrl && re(e.downloadUrl || e.url, t);
945
1019
  }
946
1020
  }
947
- const He = T({
948
- name: "JtAttachmentPreviewPdfOffice",
1021
+ const it = R({
1022
+ name: "JtAttachmentPreviewPdfCanvas",
949
1023
  props: {
950
1024
  url: {
951
1025
  type: String,
@@ -969,34 +1043,159 @@ const He = T({
969
1043
  previewError: (e) => e instanceof Event
970
1044
  },
971
1045
  setup(e, { emit: t }) {
972
- const n = D("ready");
973
- function r() {
974
- n.value = "ready", t("previewLoad", new Event("load"));
1046
+ const a = j("loading"), o = j([]), n = j([]), i = /* @__PURE__ */ new Map(), u = j("");
1047
+ let l = null, h = [], f = 0;
1048
+ async function v(s, d) {
1049
+ if (!d) return null;
1050
+ const g = typeof d == "string" ? await s.getDestination(d) : d;
1051
+ return !Array.isArray(g) || !g[0] ? null : await s.getPageIndex(g[0]) + 1;
1052
+ }
1053
+ async function A(s, d, g = 0) {
1054
+ if (!d?.length) return [];
1055
+ const b = [];
1056
+ for (const E of d) {
1057
+ const F = await v(s, E.dest);
1058
+ b.push({
1059
+ title: E.title || c("common.未命名标题"),
1060
+ pageNumber: F,
1061
+ level: g
1062
+ });
1063
+ const T = await A(s, E.items, g + 1);
1064
+ b.push(...T);
1065
+ }
1066
+ return b;
975
1067
  }
976
- function a() {
977
- n.value = "error", t("previewError", new Event("error"));
1068
+ function w() {
1069
+ f += 1;
1070
+ for (const s of h)
1071
+ s.cancel();
1072
+ h = [], l?.destroy(), l = null, i.clear();
978
1073
  }
979
- return I(
980
- () => e.url,
981
- () => {
982
- n.value = "ready";
1074
+ async function x() {
1075
+ w();
1076
+ const s = f;
1077
+ a.value = "loading", u.value = "", o.value = [], n.value = [];
1078
+ try {
1079
+ const d = await Ze();
1080
+ if (s !== f) return;
1081
+ const g = await at(e.url);
1082
+ if (s !== f) return;
1083
+ p("render-pdf-get-document-data", {
1084
+ byteLength: g.byteLength
1085
+ }), l = d.getDocument({ data: g });
1086
+ const b = await l.promise;
1087
+ if (s !== f) return;
1088
+ o.value = Array.from(
1089
+ { length: b.numPages },
1090
+ (T, C) => C + 1
1091
+ ), n.value = await A(
1092
+ b,
1093
+ await b.getOutline()
1094
+ ), await ge();
1095
+ const E = i.values().next().value, F = Math.max(
1096
+ (E?.parentElement?.clientWidth ?? 800) - 32,
1097
+ 320
1098
+ );
1099
+ for (const T of o.value) {
1100
+ if (s !== f) return;
1101
+ const C = await b.getPage(T), y = i.get(T), S = y?.getContext("2d");
1102
+ if (!y || !S) continue;
1103
+ const H = C.getViewport({ scale: 1 }), m = Math.min(F / H.width, 2), I = C.getViewport({ scale: m }), U = window.devicePixelRatio || 1;
1104
+ y.width = Math.floor(I.width * U), y.height = Math.floor(I.height * U), y.style.width = `${Math.floor(I.width)}px`, y.style.height = `${Math.floor(I.height)}px`, S.setTransform(U, 0, 0, U, 0, 0);
1105
+ const ie = C.render({
1106
+ canvas: y,
1107
+ canvasContext: S,
1108
+ viewport: I
1109
+ });
1110
+ h.push(ie), await ie.promise;
1111
+ }
1112
+ if (s !== f) return;
1113
+ a.value = "ready", t("previewLoad", new Event("load"));
1114
+ } catch (d) {
1115
+ if (s !== f) return;
1116
+ a.value = "error", u.value = d instanceof Error ? d.message : c("common.PDF加载失败"), t("previewError", new Event("error"));
983
1117
  }
984
- ), () => o("div", { class: "jt-attachment-preview-service__pdf-viewer" }, [
985
- // PDF 预览只负责把现有 URL 交给 vue-office,下载和接口适配仍由外层服务处理。
986
- n.value === "error" ? o("div", { class: "jt-attachment-preview-service__pdf-state" }, [
987
- te({
988
- icon: Ue,
1118
+ }
1119
+ $(() => e.url, x, { immediate: !0 }), G(w);
1120
+ function _(s) {
1121
+ if (!s) return;
1122
+ i.get(s)?.scrollIntoView({ behavior: "smooth", block: "start" });
1123
+ }
1124
+ return () => r("div", { class: "jt-attachment-preview-service__pdf-viewer" }, [
1125
+ a.value === "loading" ? r(
1126
+ "div",
1127
+ { class: "jt-attachment-preview-service__pdf-state" },
1128
+ c("common.PDF加载中___")
1129
+ ) : null,
1130
+ a.value === "error" ? r("div", { class: "jt-attachment-preview-service__pdf-state" }, [
1131
+ ve({
1132
+ icon: Ve,
989
1133
  name: e.name
990
1134
  })
991
- ]) : o(Ye, {
992
- class: "jt-attachment-preview-service__pdf-document",
993
- src: e.url,
994
- onRendered: r,
995
- onError: a
996
- })
1135
+ ]) : null,
1136
+ null,
1137
+ null,
1138
+ r(
1139
+ "div",
1140
+ {
1141
+ class: [
1142
+ "jt-attachment-preview-service__pdf-layout",
1143
+ a.value !== "ready" ? "jt-attachment-preview-service__pdf-layout--hidden" : ""
1144
+ ]
1145
+ },
1146
+ [
1147
+ n.value.length ? r(
1148
+ "aside",
1149
+ { class: "jt-attachment-preview-service__pdf-outline" },
1150
+ [
1151
+ r(
1152
+ "div",
1153
+ {
1154
+ class: "jt-attachment-preview-service__pdf-outline-title"
1155
+ },
1156
+ c("common.目录")
1157
+ ),
1158
+ r(
1159
+ "div",
1160
+ {
1161
+ class: "jt-attachment-preview-service__pdf-outline-list"
1162
+ },
1163
+ n.value.map(
1164
+ (s, d) => r(
1165
+ "button",
1166
+ {
1167
+ key: `${s.title}-${d}`,
1168
+ class: "jt-attachment-preview-service__pdf-outline-item",
1169
+ style: { paddingLeft: `${12 + s.level * 14}px` },
1170
+ type: "button",
1171
+ disabled: !s.pageNumber,
1172
+ title: s.title,
1173
+ onClick: () => _(s.pageNumber)
1174
+ },
1175
+ s.title
1176
+ )
1177
+ )
1178
+ )
1179
+ ]
1180
+ ) : null,
1181
+ r(
1182
+ "div",
1183
+ { class: "jt-attachment-preview-service__pdf-pages" },
1184
+ o.value.map(
1185
+ (s) => r("canvas", {
1186
+ key: s,
1187
+ ref: (d) => {
1188
+ d instanceof HTMLCanvasElement && i.set(s, d);
1189
+ },
1190
+ class: "jt-attachment-preview-service__pdf-page"
1191
+ })
1192
+ )
1193
+ )
1194
+ ]
1195
+ )
997
1196
  ]);
998
1197
  }
999
- }), We = T({
1198
+ }), lt = R({
1000
1199
  name: "JtAttachmentPreviewImageTransform",
1001
1200
  props: {
1002
1201
  url: {
@@ -1025,130 +1224,130 @@ const He = T({
1025
1224
  previewError: (e) => e instanceof Event
1026
1225
  },
1027
1226
  setup(e, { emit: t }) {
1028
- const n = D(null), r = D("ready"), a = D(1), i = D(!1);
1029
- let u = 0, l = 0, f = 0, d = 0, P = 0, A = 0, w = 0;
1030
- const k = b(
1227
+ const a = j(null), o = j("ready"), n = j(1), i = j(!1);
1228
+ let u = 0, l = 0, h = 0, f = 0, v = 0, A = 0, w = 0;
1229
+ const x = L(
1031
1230
  () => ({
1032
1231
  "--jt-attachment-preview-service-image-fit": e.fit,
1033
- transform: `translate(${u}px, ${l}px) scale(${a.value})`
1232
+ transform: `translate(${u}px, ${l}px) scale(${n.value})`
1034
1233
  })
1035
1234
  );
1036
- function g() {
1037
- n.value && (n.value.style.transform = `translate(${u}px, ${l}px) scale(${a.value})`);
1235
+ function _() {
1236
+ a.value && (a.value.style.transform = `translate(${u}px, ${l}px) scale(${n.value})`);
1038
1237
  }
1039
- function oe() {
1238
+ function s() {
1040
1239
  w || (w = window.requestAnimationFrame(() => {
1041
- w = 0, g();
1240
+ w = 0, _();
1042
1241
  }));
1043
1242
  }
1044
- function B(c) {
1045
- a.value = Math.min(Math.max(Number(c.toFixed(2)), 0.2), 5), a.value <= 1 && (u = 0, l = 0), g();
1243
+ function d(m) {
1244
+ n.value = Math.min(Math.max(Number(m.toFixed(2)), 0.2), 5), n.value <= 1 && (u = 0, l = 0), _();
1046
1245
  }
1047
- function re() {
1048
- B(a.value + 0.2);
1246
+ function g() {
1247
+ d(n.value + 0.2);
1049
1248
  }
1050
- function ie() {
1051
- const c = Math.max(Number((a.value - 0.2).toFixed(2)), 0.2);
1052
- a.value = c, c <= 1 && (u = 0, l = 0), g();
1249
+ function b() {
1250
+ const m = Math.max(Number((n.value - 0.2).toFixed(2)), 0.2);
1251
+ n.value = m, m <= 1 && (u = 0, l = 0), _();
1053
1252
  }
1054
- function G() {
1055
- u = 0, l = 0, B(1);
1253
+ function E() {
1254
+ u = 0, l = 0, d(1);
1056
1255
  }
1057
- function le(c) {
1058
- r.value = "ready", t("previewLoad", c);
1256
+ function F(m) {
1257
+ o.value = "ready", t("previewLoad", m);
1059
1258
  }
1060
- function se(c) {
1061
- r.value = "error", t("previewError", c);
1259
+ function T(m) {
1260
+ o.value = "error", t("previewError", m);
1062
1261
  }
1063
- function ce(c) {
1064
- a.value <= 1 || (c.preventDefault(), i.value = !0, f = c.clientX, d = c.clientY, P = u, A = l, window.addEventListener("pointermove", F), window.addEventListener("pointerup", ue, { once: !0 }));
1262
+ function C(m) {
1263
+ n.value <= 1 || (m.preventDefault(), i.value = !0, h = m.clientX, f = m.clientY, v = u, A = l, window.addEventListener("pointermove", y), window.addEventListener("pointerup", S, { once: !0 }));
1065
1264
  }
1066
- function F(c) {
1067
- i.value && (u = P + c.clientX - f, l = A + c.clientY - d, oe());
1265
+ function y(m) {
1266
+ i.value && (u = v + m.clientX - h, l = A + m.clientY - f, s());
1068
1267
  }
1069
- function ue() {
1070
- i.value = !1, window.removeEventListener("pointermove", F);
1268
+ function S() {
1269
+ i.value = !1, window.removeEventListener("pointermove", y);
1071
1270
  }
1072
- function de(c) {
1073
- c.preventDefault(), B(a.value + (c.deltaY < 0 ? 0.1 : -0.1));
1271
+ function H(m) {
1272
+ m.preventDefault(), d(n.value + (m.deltaY < 0 ? 0.1 : -0.1));
1074
1273
  }
1075
- return z(g), I(
1274
+ return ee(_), $(
1076
1275
  () => e.url,
1077
1276
  () => {
1078
- r.value = "ready", G();
1277
+ o.value = "ready", E();
1079
1278
  }
1080
- ), J(() => {
1081
- window.removeEventListener("pointermove", F), w && window.cancelAnimationFrame(w);
1082
- }), () => o(
1279
+ ), G(() => {
1280
+ window.removeEventListener("pointermove", y), w && window.cancelAnimationFrame(w);
1281
+ }), () => r(
1083
1282
  "div",
1084
1283
  { class: "jt-attachment-preview-service__image-viewer" },
1085
- r.value === "error" ? te({
1086
- icon: Se,
1284
+ o.value === "error" ? ve({
1285
+ icon: qe,
1087
1286
  name: e.name
1088
1287
  }) : [
1089
- o("img", {
1090
- ref: n,
1288
+ r("img", {
1289
+ ref: a,
1091
1290
  class: [
1092
1291
  "jt-attachment-preview-service__media",
1093
1292
  "jt-attachment-preview-service__image",
1094
- a.value > 1 ? "jt-attachment-preview-service__image--draggable" : "",
1293
+ n.value > 1 ? "jt-attachment-preview-service__image--draggable" : "",
1095
1294
  i.value ? "jt-attachment-preview-service__image--dragging" : ""
1096
1295
  ],
1097
1296
  src: e.url,
1098
1297
  alt: e.name,
1099
- style: k.value,
1100
- onLoad: le,
1101
- onError: se,
1102
- onPointerdown: ce,
1103
- onWheel: de,
1104
- onDragstart: (c) => c.preventDefault(),
1298
+ style: x.value,
1299
+ onLoad: F,
1300
+ onError: T,
1301
+ onPointerdown: C,
1302
+ onWheel: H,
1303
+ onDragstart: (m) => m.preventDefault(),
1105
1304
  draggable: !1
1106
1305
  }),
1107
- o(
1306
+ r(
1108
1307
  "div",
1109
1308
  { class: "jt-attachment-preview-service__image-toolbar" },
1110
1309
  [
1111
- o(
1310
+ r(
1112
1311
  "button",
1113
1312
  {
1114
1313
  class: "jt-attachment-preview-service__image-tool",
1115
1314
  type: "button",
1116
- title: s("common.缩小"),
1117
- onClick: ie
1315
+ title: c("common.缩小"),
1316
+ onClick: b
1118
1317
  },
1119
- [o(_, () => o(fe))]
1318
+ [r(J, () => r(Ne))]
1120
1319
  ),
1121
- o(
1320
+ r(
1122
1321
  "span",
1123
1322
  { class: "jt-attachment-preview-service__image-scale" },
1124
- `${Math.round(a.value * 100)}%`
1323
+ `${Math.round(n.value * 100)}%`
1125
1324
  ),
1126
- o(
1325
+ r(
1127
1326
  "button",
1128
1327
  {
1129
1328
  class: "jt-attachment-preview-service__image-tool",
1130
1329
  type: "button",
1131
- title: s("common.放大"),
1132
- onClick: re
1330
+ title: c("common.放大"),
1331
+ onClick: g
1133
1332
  },
1134
- [o(_, () => o(pe))]
1333
+ [r(J, () => r(Oe))]
1135
1334
  ),
1136
- o(
1335
+ r(
1137
1336
  "button",
1138
1337
  {
1139
1338
  class: "jt-attachment-preview-service__image-tool",
1140
1339
  type: "button",
1141
- title: s("common.复位"),
1142
- onClick: G
1340
+ title: c("common.复位"),
1341
+ onClick: E
1143
1342
  },
1144
- [o(_, () => o(ve))]
1343
+ [r(J, () => r(Ue))]
1145
1344
  )
1146
1345
  ]
1147
1346
  )
1148
1347
  ]
1149
1348
  );
1150
1349
  }
1151
- }), Qe = T({
1350
+ }), st = R({
1152
1351
  name: "JtAttachmentPreviewService",
1153
1352
  props: {
1154
1353
  options: {
@@ -1161,47 +1360,49 @@ const He = T({
1161
1360
  }
1162
1361
  },
1163
1362
  setup(e) {
1164
- const t = b(
1165
- () => Y(e.options.url, e.options.name)
1166
- ), n = b(
1363
+ const t = L(
1364
+ () => ae(e.options.url, e.options.name)
1365
+ ), a = L(
1167
1366
  () => e.options.downloadName || t.value
1168
- ), r = b(() => X(e.options)), a = b(
1367
+ ), o = L(() => me(e.options)), n = L(
1368
+ () => nt(o.value, e.options.url)
1369
+ ), i = L(
1169
1370
  () => ({
1170
1371
  zIndex: e.options.zIndex ?? 3e3,
1171
1372
  "--jt-attachment-preview-service-image-fit": e.options.fit ?? "contain"
1172
1373
  })
1173
1374
  );
1174
- function i() {
1375
+ function u() {
1175
1376
  e.options.onClose?.(), e.onDestroy();
1176
1377
  }
1177
- function u(d) {
1178
- d.key === "Escape" && e.options.closeOnPressEscape !== !1 && i();
1378
+ function l(v) {
1379
+ v.key === "Escape" && e.options.closeOnPressEscape !== !1 && u();
1179
1380
  }
1180
- function l(d) {
1181
- e.options.onLoad?.(d);
1381
+ function h(v) {
1382
+ e.options.onLoad?.(v);
1182
1383
  }
1183
- function f(d) {
1184
- e.options.onError?.(d);
1384
+ function f(v) {
1385
+ e.options.onError?.(v);
1185
1386
  }
1186
- return z(() => {
1187
- document.addEventListener("keydown", u), document.body.classList.add("jt-attachment-preview-service-lock");
1188
- }), J(() => {
1189
- document.removeEventListener("keydown", u), document.body.classList.remove("jt-attachment-preview-service-lock");
1387
+ return ee(() => {
1388
+ document.addEventListener("keydown", l), document.body.classList.add("jt-attachment-preview-service-lock");
1389
+ }), G(() => {
1390
+ document.removeEventListener("keydown", l), document.body.classList.remove("jt-attachment-preview-service-lock");
1190
1391
  }), () => {
1191
- const d = e.options.downloadable === !1 ? [] : [
1192
- ee(
1392
+ const v = e.options.downloadable === !1 ? [] : [
1393
+ pe(
1193
1394
  e.options,
1194
- n.value,
1395
+ a.value,
1195
1396
  "jt-attachment-preview-service__top-download"
1196
1397
  )
1197
1398
  ];
1198
- return o(
1399
+ return r(
1199
1400
  "div",
1200
- { class: "jt-attachment-preview-service", style: a.value },
1401
+ { class: "jt-attachment-preview-service", style: i.value },
1201
1402
  [
1202
- o("div", { class: "jt-attachment-preview-service__modal" }, [
1203
- o("div", { class: "jt-attachment-preview-service__header" }, [
1204
- o(
1403
+ r("div", { class: "jt-attachment-preview-service__modal" }, [
1404
+ r("div", { class: "jt-attachment-preview-service__header" }, [
1405
+ r(
1205
1406
  "div",
1206
1407
  {
1207
1408
  class: "jt-attachment-preview-service__filename",
@@ -1209,33 +1410,35 @@ const He = T({
1209
1410
  },
1210
1411
  t.value
1211
1412
  ),
1212
- o(
1413
+ r(
1213
1414
  "div",
1214
1415
  { class: "jt-attachment-preview-service__header-actions" },
1215
1416
  [
1216
- ...d,
1217
- o(
1417
+ ...v,
1418
+ r(
1218
1419
  "button",
1219
1420
  {
1220
1421
  class: "jt-attachment-preview-service__close",
1221
1422
  type: "button",
1222
- "aria-label": s("common.关闭"),
1223
- onClick: i
1423
+ "aria-label": c("common.关闭"),
1424
+ onClick: u
1224
1425
  },
1225
1426
  "×"
1226
1427
  )
1227
1428
  ]
1228
1429
  )
1229
1430
  ]),
1230
- o("div", { class: "jt-attachment-preview-service__body" }, [
1231
- Ze({
1232
- type: r.value,
1431
+ r("div", { class: "jt-attachment-preview-service__body" }, [
1432
+ ct({
1433
+ type: o.value,
1233
1434
  url: e.options.url,
1234
1435
  name: t.value,
1235
- downloadName: n.value,
1436
+ downloadName: a.value,
1236
1437
  sourceOptions: e.options,
1438
+ sandbox: e.options.sandbox,
1439
+ iconText: n.value,
1237
1440
  downloadable: e.options.downloadable !== !1,
1238
- onLoad: l,
1441
+ onLoad: h,
1239
1442
  onError: f
1240
1443
  })
1241
1444
  ])
@@ -1244,7 +1447,7 @@ const He = T({
1244
1447
  );
1245
1448
  };
1246
1449
  }
1247
- }), j = T({
1450
+ }), M = R({
1248
1451
  name: "JtAttachmentPreviewDetectingService",
1249
1452
  props: {
1250
1453
  options: {
@@ -1257,11 +1460,11 @@ const He = T({
1257
1460
  },
1258
1461
  title: {
1259
1462
  type: String,
1260
- default: s("common.正在识别文件类型")
1463
+ default: c("common.正在识别文件类型")
1261
1464
  },
1262
1465
  desc: {
1263
1466
  type: String,
1264
- default: s("common.请稍候,识别完成后将自动预览或下载")
1467
+ default: c("common.请稍候,识别完成后将自动预览或下载")
1265
1468
  },
1266
1469
  spinning: {
1267
1470
  type: Boolean,
@@ -1269,28 +1472,28 @@ const He = T({
1269
1472
  }
1270
1473
  },
1271
1474
  setup(e) {
1272
- const t = b(
1273
- () => Y(e.options.url, e.options.name)
1274
- ), n = b(() => ({
1475
+ const t = L(
1476
+ () => ae(e.options.url, e.options.name)
1477
+ ), a = L(() => ({
1275
1478
  zIndex: e.options.zIndex ?? 3e3
1276
1479
  }));
1277
- function r() {
1480
+ function o() {
1278
1481
  e.options.onClose?.(), e.onDestroy();
1279
1482
  }
1280
- function a(i) {
1281
- i.key === "Escape" && e.options.closeOnPressEscape !== !1 && r();
1483
+ function n(i) {
1484
+ i.key === "Escape" && e.options.closeOnPressEscape !== !1 && o();
1282
1485
  }
1283
- return z(() => {
1284
- document.addEventListener("keydown", a), document.body.classList.add("jt-attachment-preview-service-lock");
1285
- }), J(() => {
1286
- document.removeEventListener("keydown", a), document.body.classList.remove("jt-attachment-preview-service-lock");
1287
- }), () => o(
1486
+ return ee(() => {
1487
+ document.addEventListener("keydown", n), document.body.classList.add("jt-attachment-preview-service-lock");
1488
+ }), G(() => {
1489
+ document.removeEventListener("keydown", n), document.body.classList.remove("jt-attachment-preview-service-lock");
1490
+ }), () => r(
1288
1491
  "div",
1289
- { class: "jt-attachment-preview-service", style: n.value },
1492
+ { class: "jt-attachment-preview-service", style: a.value },
1290
1493
  [
1291
- o("div", { class: "jt-attachment-preview-service__modal" }, [
1292
- o("div", { class: "jt-attachment-preview-service__header" }, [
1293
- o(
1494
+ r("div", { class: "jt-attachment-preview-service__modal" }, [
1495
+ r("div", { class: "jt-attachment-preview-service__header" }, [
1496
+ r(
1294
1497
  "div",
1295
1498
  {
1296
1499
  class: "jt-attachment-preview-service__filename",
@@ -1298,34 +1501,34 @@ const He = T({
1298
1501
  },
1299
1502
  t.value
1300
1503
  ),
1301
- o(
1504
+ r(
1302
1505
  "div",
1303
1506
  { class: "jt-attachment-preview-service__header-actions" },
1304
1507
  [
1305
- o(
1508
+ r(
1306
1509
  "button",
1307
1510
  {
1308
1511
  class: "jt-attachment-preview-service__close",
1309
1512
  type: "button",
1310
- "aria-label": s("common.关闭"),
1311
- onClick: r
1513
+ "aria-label": c("common.关闭"),
1514
+ onClick: o
1312
1515
  },
1313
1516
  "×"
1314
1517
  )
1315
1518
  ]
1316
1519
  )
1317
1520
  ]),
1318
- o("div", { class: "jt-attachment-preview-service__body" }, [
1319
- o("div", { class: "jt-attachment-preview-service__detecting" }, [
1320
- e.spinning ? o("span", {
1521
+ r("div", { class: "jt-attachment-preview-service__body" }, [
1522
+ r("div", { class: "jt-attachment-preview-service__detecting" }, [
1523
+ e.spinning ? r("span", {
1321
1524
  class: "jt-attachment-preview-service__detecting-spinner"
1322
1525
  }) : null,
1323
- o(
1526
+ r(
1324
1527
  "span",
1325
1528
  { class: "jt-attachment-preview-service__detecting-title" },
1326
1529
  e.title
1327
1530
  ),
1328
- o(
1531
+ r(
1329
1532
  "span",
1330
1533
  { class: "jt-attachment-preview-service__detecting-desc" },
1331
1534
  e.desc
@@ -1337,39 +1540,57 @@ const He = T({
1337
1540
  );
1338
1541
  }
1339
1542
  });
1340
- function Ze(e) {
1341
- return e.type === "empty" ? o(
1543
+ function ct(e) {
1544
+ return e.type === "empty" ? r(
1342
1545
  "div",
1343
1546
  { class: "jt-attachment-preview-service__empty" },
1344
- s("common.暂无附件")
1345
- ) : e.type === "image" ? o(We, {
1547
+ c("common.暂无附件")
1548
+ ) : e.type === "image" ? r(lt, {
1346
1549
  url: e.url,
1347
1550
  name: e.name,
1348
1551
  downloadName: e.downloadName,
1349
1552
  downloadable: e.downloadable,
1350
1553
  onPreviewLoad: e.onLoad,
1351
1554
  onPreviewError: e.onError
1352
- }) : e.type === "pdf" ? o(He, {
1555
+ }) : e.type === "video" ? r("video", {
1556
+ class: "jt-attachment-preview-service__media",
1557
+ src: e.url,
1558
+ controls: !0,
1559
+ onLoadeddata: e.onLoad,
1560
+ onError: e.onError
1561
+ }) : e.type === "audio" ? r("audio", {
1562
+ class: "jt-attachment-preview-service__audio",
1563
+ src: e.url,
1564
+ controls: !0,
1565
+ onLoadeddata: e.onLoad,
1566
+ onError: e.onError
1567
+ }) : e.type === "pdf" ? r(it, {
1353
1568
  url: e.url,
1354
1569
  name: e.name,
1355
1570
  downloadName: e.downloadName,
1356
1571
  downloadable: e.downloadable,
1357
1572
  onPreviewLoad: e.onLoad,
1358
1573
  onPreviewError: e.onError
1359
- }) : o("div", { class: "jt-attachment-preview-service__unsupported" }, [
1360
- o("div", { class: "jt-attachment-preview-service__file-card" }, [
1361
- o(
1574
+ }) : e.type === "iframe" ? r("iframe", {
1575
+ class: "jt-attachment-preview-service__iframe",
1576
+ src: e.url,
1577
+ title: e.name,
1578
+ sandbox: e.sandbox || void 0,
1579
+ onLoad: e.onLoad
1580
+ }) : r("div", { class: "jt-attachment-preview-service__unsupported" }, [
1581
+ r("div", { class: "jt-attachment-preview-service__file-card" }, [
1582
+ r(
1362
1583
  "div",
1363
1584
  { class: "jt-attachment-preview-service__file-icon" },
1364
- "FILE"
1585
+ e.iconText
1365
1586
  ),
1366
- o(
1587
+ r(
1367
1588
  "div",
1368
1589
  { class: "jt-attachment-preview-service__unsupported-text" },
1369
- s("common.暂不支持预览此类型的文件")
1590
+ c("common.暂不支持预览此类型的文件")
1370
1591
  )
1371
1592
  ]),
1372
- o(
1593
+ r(
1373
1594
  "div",
1374
1595
  {
1375
1596
  class: "jt-attachment-preview-service__file-name",
@@ -1377,166 +1598,159 @@ function Ze(e) {
1377
1598
  },
1378
1599
  e.name
1379
1600
  ),
1380
- e.downloadable ? ee(
1601
+ e.downloadable ? pe(
1381
1602
  e.sourceOptions,
1382
1603
  e.downloadName,
1383
1604
  "jt-attachment-preview-service__primary-download"
1384
1605
  ) : null
1385
1606
  ]);
1386
1607
  }
1387
- function ae(e) {
1608
+ function we(e) {
1388
1609
  if (typeof document > "u")
1389
1610
  return { close: () => {
1390
1611
  } };
1391
- m("open-called", {
1612
+ p("open-called", {
1392
1613
  rawOptions: typeof e == "string" ? e : { ...e }
1393
- }), v?.close();
1394
- const t = Oe(
1614
+ }), D?.close();
1615
+ const t = Xe(
1395
1616
  e
1396
- ), n = t.downloadName || Y(t.url, t.name);
1397
- let r = !1, a = null, i = null;
1617
+ ), a = t.downloadName || ae(t.url, t.name);
1618
+ let o = !1, n = null, i = null;
1398
1619
  const u = () => {
1399
- r = !0, a && (p(null, a), a.remove(), a = null), i && (URL.revokeObjectURL(i), i = null), v?.close === u && (v = null);
1620
+ o = !0, n && (P(null, n), n.remove(), n = null), i && (URL.revokeObjectURL(i), i = null), D?.close === u && (D = null);
1400
1621
  };
1401
1622
  function l() {
1402
- r || (a || (a = document.createElement("div"), document.body.appendChild(a)), p(
1403
- o(Qe, {
1623
+ o || (n || (n = document.createElement("div"), document.body.appendChild(n)), P(
1624
+ r(st, {
1404
1625
  options: t,
1405
1626
  onDestroy: u
1406
1627
  }),
1407
- a
1628
+ n
1408
1629
  ));
1409
1630
  }
1410
- function f() {
1411
- r || (a || (a = document.createElement("div"), document.body.appendChild(a)), p(
1412
- o(j, {
1631
+ function h() {
1632
+ o || (n || (n = document.createElement("div"), document.body.appendChild(n)), P(
1633
+ r(M, {
1413
1634
  options: t,
1414
1635
  onDestroy: u
1415
1636
  }),
1416
- a
1637
+ n
1417
1638
  ));
1418
1639
  }
1419
- function d() {
1420
- a && (p(null, a), a.remove(), a = null);
1640
+ function f() {
1641
+ n && (P(null, n), n.remove(), n = null);
1421
1642
  }
1422
- function P() {
1423
- r || ne(t, n, {
1643
+ function v() {
1644
+ o || he(t, a, {
1424
1645
  fallbackToRawUrl: !0
1425
1646
  });
1426
1647
  }
1427
- const A = X(t);
1428
- return m("type-resolved", {
1648
+ const A = me(t);
1649
+ return p("type-resolved", {
1429
1650
  resolvedType: A,
1430
1651
  url: t.url,
1431
1652
  name: t.name,
1432
1653
  mode: t.mode,
1433
1654
  mimeType: t.mimeType,
1434
1655
  extension: t.extension
1435
- }), S(A) ? l() : A === "unknown" ? (f(), Ge(t.url).then(async (w) => {
1436
- if (!r) {
1437
- if (S(w)) {
1656
+ }), W(A) ? l() : A === "unknown" ? (h(), tt(t.url).then(async (w) => {
1657
+ if (!o) {
1658
+ if (W(w)) {
1438
1659
  t.mode = w, l();
1439
1660
  return;
1440
1661
  }
1441
1662
  try {
1442
- const k = await $(t.url), g = O(k.type);
1443
- if (S(g)) {
1444
- i = URL.createObjectURL(k), t.url = i, t.mode = g, l();
1663
+ const x = await fe(t.url), _ = ne(x.type);
1664
+ if (W(_)) {
1665
+ i = URL.createObjectURL(x), t.url = i, t.mode = _, l();
1445
1666
  return;
1446
1667
  }
1447
- d(), N(k, n);
1668
+ f(), oe(x, a);
1448
1669
  } catch {
1449
- d(), P();
1670
+ f(), v();
1450
1671
  }
1451
1672
  }
1452
- })) : P(), v = { close: u }, v;
1673
+ })) : v(), D = { close: u }, D;
1453
1674
  }
1454
- function Xe(e) {
1455
- if (typeof e == "function") {
1456
- h = null, R = e;
1457
- return;
1458
- }
1459
- h = e, R = async (t) => {
1460
- const n = await h.request(t);
1461
- return h.mapResponse(n, t);
1462
- };
1675
+ function ut(e) {
1676
+ k = e;
1463
1677
  }
1464
- function $e(e) {
1678
+ function dt(e) {
1465
1679
  if (typeof document > "u")
1466
1680
  return { close: () => {
1467
1681
  } };
1468
- v?.close();
1469
- let t = !1, n = document.createElement("div");
1470
- document.body.appendChild(n);
1471
- const r = () => {
1472
- t = !0, n && (p(null, n), n.remove(), n = null), v?.close === r && (v = null);
1473
- }, a = { close: r };
1474
- return v = a, R ? (p(
1475
- o(j, {
1476
- options: { url: "", name: s("common.附件预览") },
1477
- title: s("common.正在获取文件信息"),
1478
- desc: s("common.请稍候,获取完成后将自动预览或下载"),
1682
+ D?.close();
1683
+ let t = !1, a = document.createElement("div");
1684
+ document.body.appendChild(a);
1685
+ const o = () => {
1686
+ t = !0, a && (P(null, a), a.remove(), a = null), D?.close === o && (D = null);
1687
+ }, n = { close: o };
1688
+ return D = n, k ? (P(
1689
+ r(M, {
1690
+ options: { url: "", name: c("common.附件预览") },
1691
+ title: c("common.正在获取文件信息"),
1692
+ desc: c("common.请稍候,获取完成后将自动预览或下载"),
1479
1693
  spinning: !0,
1480
- onDestroy: r
1694
+ onDestroy: o
1481
1695
  }),
1482
- n
1483
- ), Promise.resolve(R(e)).then((i) => {
1484
- if (!t) {
1485
- if (!i?.url) {
1486
- p(
1487
- o(j, {
1488
- options: { url: "", name: s("common.附件预览") },
1489
- title: s("common.文件信息缺少URL"),
1490
- desc: s("common.请检查mapResponse是否返回了url字段"),
1491
- spinning: !1,
1492
- onDestroy: r
1493
- }),
1494
- n
1495
- );
1496
- return;
1497
- }
1498
- ae({
1499
- ...i,
1500
- requestParams: e,
1501
- useRegisteredDownload: !0
1502
- });
1696
+ a
1697
+ ), k.request(e).then((i) => {
1698
+ if (t) return;
1699
+ const u = k?.mapResponse(i, e);
1700
+ if (!u?.url) {
1701
+ P(
1702
+ r(M, {
1703
+ options: { url: "", name: c("common.附件预览") },
1704
+ title: c("common.文件信息缺少URL"),
1705
+ desc: c("common.请检查mapResponse是否返回了url字段"),
1706
+ spinning: !1,
1707
+ onDestroy: o
1708
+ }),
1709
+ a
1710
+ );
1711
+ return;
1503
1712
  }
1713
+ we({
1714
+ ...u,
1715
+ requestParams: e,
1716
+ useRegisteredDownload: !0
1717
+ });
1504
1718
  }).catch((i) => {
1505
1719
  if (t) return;
1506
- const u = i instanceof Error ? i.message : s("common.接口请求失败");
1507
- p(
1508
- o(j, {
1509
- options: { url: "", name: s("common.附件预览") },
1510
- title: s("common.文件信息获取失败"),
1720
+ const u = i instanceof Error ? i.message : c("common.接口请求失败");
1721
+ P(
1722
+ r(M, {
1723
+ options: { url: "", name: c("common.附件预览") },
1724
+ title: c("common.文件信息获取失败"),
1511
1725
  desc: u,
1512
1726
  spinning: !1,
1513
- onDestroy: r
1727
+ onDestroy: o
1514
1728
  }),
1515
- n
1729
+ a
1516
1730
  );
1517
- }), a) : (p(
1518
- o(j, {
1519
- options: { url: "", name: s("common.附件预览") },
1520
- title: s("common.附件预览未初始化"),
1521
- desc: s("common.请先调用setupJtAttachmentPreview注册请求配置"),
1731
+ }), n) : (P(
1732
+ r(M, {
1733
+ options: { url: "", name: c("common.附件预览") },
1734
+ title: c("common.附件预览未初始化"),
1735
+ desc: c("common.请先调用setupJtAttachmentPreview注册请求配置"),
1522
1736
  spinning: !1,
1523
- onDestroy: r
1737
+ onDestroy: o
1524
1738
  }),
1525
- n
1526
- ), a);
1739
+ a
1740
+ ), n);
1527
1741
  }
1528
- const lt = Object.assign(ae, {
1529
- openByParams: $e,
1530
- setup: Xe
1742
+ const gt = Object.assign(we, {
1743
+ openByParams: dt,
1744
+ setup: ut
1531
1745
  });
1532
1746
  export {
1533
- lt as J,
1534
- $e as a,
1535
- Xe as b,
1536
- ot as g,
1537
- it as i,
1538
- L as n,
1539
- rt as r,
1540
- at as s,
1541
- s as t
1747
+ gt as J,
1748
+ dt as a,
1749
+ ut as b,
1750
+ vt as g,
1751
+ wt as i,
1752
+ O as n,
1753
+ ht as r,
1754
+ pt as s,
1755
+ c as t
1542
1756
  };