@embedpdf-editor/vue3-chapter-viewer 1.1.2 → 1.1.4

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.
package/dist/index.js CHANGED
@@ -3443,7 +3443,7 @@ function Vs(e14) {
3443
3443
  function Es(e14) {
3444
3444
  return !!e14 && "urls" in e14 && Array.isArray(e14.urls);
3445
3445
  }
3446
- function As(e14) {
3446
+ function As$1(e14) {
3447
3447
  if (null != e14.segmentPageThreshold && e14.segmentPageThreshold > 0) return e14.segmentPageThreshold;
3448
3448
  const t2 = e14.source;
3449
3449
  return Es(t2) ? t2.segmentPageThreshold : null;
@@ -3457,13 +3457,13 @@ function Fs(e14) {
3457
3457
  const s2 = e14.slice(0, t2), r9 = Number.parseInt(e14.slice(t2 + 2), 10);
3458
3458
  return !Number.isFinite(r9) || r9 < 0 ? { chapterId: e14, segmentIndex: null } : { chapterId: s2, segmentIndex: r9 };
3459
3459
  }
3460
- function Os$1(e14, t2) {
3460
+ function Os(e14, t2) {
3461
3461
  return e14 <= 0 || t2 <= 0 ? 0 : Math.ceil(e14 / t2);
3462
3462
  }
3463
- function Ns(e14) {
3464
- const t2 = As(e14);
3463
+ function Ns$1(e14) {
3464
+ const t2 = As$1(e14);
3465
3465
  if (!t2) return null;
3466
- const s2 = Vs(e14), r9 = Os$1(s2, t2), n2 = Es(e14.source) ? e14.source.urls : void 0, a2 = [];
3466
+ const s2 = Vs(e14), r9 = Os(s2, t2), n2 = Es(e14.source) ? e14.source.urls : void 0, a2 = [];
3467
3467
  for (let i2 = 0; i2 < r9; i2++) {
3468
3468
  const r10 = i2 * t2, o2 = Math.min(r10 + t2 - 1, s2 - 1);
3469
3469
  if (r10 >= s2) break;
@@ -3472,7 +3472,7 @@ function Ns(e14) {
3472
3472
  return { chapterId: e14.chapterId, threshold: t2, pageCount: s2, segments: a2 };
3473
3473
  }
3474
3474
  function zs$1(e14, t2) {
3475
- const s2 = Ns(e14);
3475
+ const s2 = Ns$1(e14);
3476
3476
  if (!s2) return { documentId: e14.chapterId, pageIndex: t2 };
3477
3477
  const r9 = s2.segments.find((e15) => t2 >= e15.localPageStart && t2 <= e15.localPageEnd);
3478
3478
  if (!r9) {
@@ -3481,22 +3481,22 @@ function zs$1(e14, t2) {
3481
3481
  }
3482
3482
  return { documentId: r9.documentId, pageIndex: t2 - r9.localPageStart };
3483
3483
  }
3484
- function Rs$1(e14, t2) {
3485
- const s2 = Ns(e14);
3484
+ function Rs(e14, t2) {
3485
+ const s2 = Ns$1(e14);
3486
3486
  if (!s2) return 0;
3487
3487
  const r9 = s2.segments.find((e15) => t2 >= e15.localPageStart && t2 <= e15.localPageEnd);
3488
3488
  return (null == r9 ? void 0 : r9.index) ?? Math.floor(t2 / s2.threshold);
3489
3489
  }
3490
3490
  function Gs$1(e14) {
3491
3491
  var t2;
3492
- const s2 = As(e14);
3492
+ const s2 = As$1(e14);
3493
3493
  if (!s2) return [];
3494
3494
  const r9 = [], { chapterId: n2 } = e14, a2 = Vs(e14);
3495
3495
  s2 <= 0 && r9.push(`${n2}: segmentPageThreshold must be > 0`);
3496
3496
  const i2 = e14.source;
3497
3497
  if (!Es(i2)) return r9;
3498
3498
  0 === i2.urls.length && r9.push(`${n2}: source.urls must not be empty`);
3499
- const o2 = Os$1(a2, s2);
3499
+ const o2 = Os(a2, s2);
3500
3500
  i2.urls.length !== o2 && r9.push(`${n2}: source.urls.length (${i2.urls.length}) must equal ceil(pageCount/threshold) (${o2})`);
3501
3501
  for (let l = 0; l < i2.urls.length; l++) (null == (t2 = i2.urls[l]) ? void 0 : t2.trim()) || r9.push(`${n2}: source.urls[${l}] is empty`);
3502
3502
  return r9;
@@ -3606,7 +3606,7 @@ const qs$1 = class e6 extends BasePlugin {
3606
3606
  return s2 ? zs$1(s2, t2) : null;
3607
3607
  }, getSegmentPlan: (e14) => {
3608
3608
  const t2 = this.findChapter(e14);
3609
- return t2 ? Ns(t2) : null;
3609
+ return t2 ? Ns$1(t2) : null;
3610
3610
  }, isSegmentLoaded: (e14, t2) => this.isSegmentDocumentOpen(e14, t2), isSegmentLoadPending: (e14, t2) => this.isSegmentLoadPending(e14, t2), getChapterErrorMessage: (e14) => this.chapterErrorMessages.get(e14), getChapterStatus: (e14) => this.chapterStatus.get(e14) ?? "idle", getChapter: (e14) => this.findChapter(e14), onChapterStatusChange: this.statusChange$.on, onManifestChange: this.manifestChange$.on };
3611
3611
  }
3612
3612
  destroy() {
@@ -3663,7 +3663,7 @@ const qs$1 = class e6 extends BasePlugin {
3663
3663
  }
3664
3664
  getSegmentPlanForChapter(e14) {
3665
3665
  const t2 = this.findChapter(e14);
3666
- return t2 ? Ns(t2) : null;
3666
+ return t2 ? Ns$1(t2) : null;
3667
3667
  }
3668
3668
  anySegmentOpen(e14) {
3669
3669
  const t2 = this.getSegmentPlanForChapter(e14), s2 = this.documentManager.provides();
@@ -3707,7 +3707,7 @@ const qs$1 = class e6 extends BasePlugin {
3707
3707
  if (!e15) continue;
3708
3708
  const s2 = this.findChapter(e15.chapterId);
3709
3709
  if (!s2) continue;
3710
- const r9 = Rs$1(s2, e15.localPageIndex);
3710
+ const r9 = Rs(s2, e15.localPageIndex);
3711
3711
  if (!this.isSegmentDocumentOpen(e15.chapterId, r9)) return true;
3712
3712
  }
3713
3713
  return false;
@@ -3735,7 +3735,7 @@ const qs$1 = class e6 extends BasePlugin {
3735
3735
  if (!this.virtualPageMap) return Number.MAX_SAFE_INTEGER;
3736
3736
  const r9 = this.findChapter(e14);
3737
3737
  if (!r9) return Number.MAX_SAFE_INTEGER;
3738
- const n2 = Ns(r9), a2 = (null == (s2 = null == n2 ? void 0 : n2.segments[t2]) ? void 0 : s2.localPageStart) ?? 0, i2 = this.virtualPageMap.toGlobal(e14, a2);
3738
+ const n2 = Ns$1(r9), a2 = (null == (s2 = null == n2 ? void 0 : n2.segments[t2]) ? void 0 : s2.localPageStart) ?? 0, i2 = this.virtualPageMap.toGlobal(e14, a2);
3739
3739
  if (i2) return i2.globalPageIndex;
3740
3740
  return 1e4 * this.manifest.chapters.findIndex((t3) => t3.chapterId === e14) + t2;
3741
3741
  }
@@ -3807,7 +3807,7 @@ const qs$1 = class e6 extends BasePlugin {
3807
3807
  if (t3 < 0) return;
3808
3808
  const s3 = this.findChapter(e15);
3809
3809
  if (!s3) return;
3810
- const r10 = Ns(s3);
3810
+ const r10 = Ns$1(s3);
3811
3811
  if (r10 && t3 >= r10.segments.length) return;
3812
3812
  const n3 = `${e15}:${t3}`, a3 = this.segmentStartGlobalIndex(e15, t3), l2 = Math.abs(a3 - i2), h3 = o2.get(n3);
3813
3813
  (void 0 === h3 || l2 < h3) && o2.set(n3, l2);
@@ -3817,7 +3817,7 @@ const qs$1 = class e6 extends BasePlugin {
3817
3817
  if (!e15) continue;
3818
3818
  const t3 = this.findChapter(e15.chapterId);
3819
3819
  if (!t3) continue;
3820
- const s3 = Rs$1(t3, e15.localPageIndex);
3820
+ const s3 = Rs(t3, e15.localPageIndex);
3821
3821
  l(e15.chapterId, s3), this.resolveChapterUrls(t3).catch(() => {
3822
3822
  });
3823
3823
  }
@@ -3831,7 +3831,7 @@ const qs$1 = class e6 extends BasePlugin {
3831
3831
  if (this.scheduleVisibleSegmentLoads(d2), h2) {
3832
3832
  const e15 = this.findChapter(h2.chapterId);
3833
3833
  if (e15) {
3834
- const t3 = Rs$1(e15, h2.localPageIndex);
3834
+ const t3 = Rs(e15, h2.localPageIndex);
3835
3835
  this.isSegmentDocumentOpen(h2.chapterId, t3) || (this.prepareChapterForSegmentLoad(h2.chapterId), this.loadSegmentNow(h2.chapterId, t3).finally(() => {
3836
3836
  this.pumpVisibleSegmentBacklog();
3837
3837
  }));
@@ -3876,7 +3876,7 @@ const qs$1 = class e6 extends BasePlugin {
3876
3876
  this.prepareChapterForSegmentLoad(e14);
3877
3877
  const r9 = this.findChapter(e14);
3878
3878
  if (!r9) return Promise.resolve("error");
3879
- const n2 = Ns(r9);
3879
+ const n2 = Ns$1(r9);
3880
3880
  if (!n2) return 0 !== t2 ? Promise.resolve(this.isSegmentDocumentOpen(e14, 0) ? "loaded" : "error") : this.ensureSingleDocumentChapter(r9);
3881
3881
  if (t2 < 0 || t2 >= n2.segments.length) return Promise.resolve("error");
3882
3882
  const a2 = n2.segments[t2], i2 = a2.documentId;
@@ -3932,9 +3932,9 @@ const qs$1 = class e6 extends BasePlugin {
3932
3932
  return (null == n2 ? void 0 : n2.openPdf) ? n2.openPdf(a2) : { url: r9 };
3933
3933
  }
3934
3934
  async resolvePdfPayload(t2, s2) {
3935
- const r9 = t2.source, n2 = this.config.chapterPdfLoader, a2 = As(t2);
3935
+ const r9 = t2.source, n2 = this.config.chapterPdfLoader, a2 = As$1(t2);
3936
3936
  if (a2) {
3937
- const r10 = Os$1(Vs(t2), a2);
3937
+ const r10 = Os(Vs(t2), a2);
3938
3938
  if (s2 < 0 || s2 >= r10) throw new Error(`Chapter "${t2.chapterId}" invalid segmentIndex ${s2} (expected 0..${r10 - 1})`);
3939
3939
  const n3 = await this.resolveChapterUrls(t2);
3940
3940
  if (n3.length !== r10) {
@@ -4025,7 +4025,7 @@ const qs$1 = class e6 extends BasePlugin {
4025
4025
  });
4026
4026
  }
4027
4027
  closeChapter(e14) {
4028
- const t2 = this.findChapter(e14), s2 = this.documentManager.provides(), r9 = t2 ? Ns(t2) : null, n2 = (e15) => {
4028
+ const t2 = this.findChapter(e14), s2 = this.documentManager.provides(), r9 = t2 ? Ns$1(t2) : null, n2 = (e15) => {
4029
4029
  if (s2.isDocumentOpen(e15)) {
4030
4030
  s2.closeDocument(e15).wait(() => {
4031
4031
  }, () => {
@@ -4099,7 +4099,7 @@ function sr$1(e14) {
4099
4099
  function rr$1(e14, t2) {
4100
4100
  return e14 <= 0 || t2 <= 0 ? 0 : Math.ceil(e14 / t2);
4101
4101
  }
4102
- function nr(e14) {
4102
+ function nr$1(e14) {
4103
4103
  const t2 = er$1(e14);
4104
4104
  if (!t2) return null;
4105
4105
  const s2 = Qs$1(e14), r9 = rr$1(s2, t2), n2 = Js$1(e14.source) ? e14.source.urls : void 0, a2 = [];
@@ -4111,7 +4111,7 @@ function nr(e14) {
4111
4111
  return { chapterId: e14.chapterId, threshold: t2, pageCount: s2, segments: a2 };
4112
4112
  }
4113
4113
  function ar(e14, t2) {
4114
- const s2 = nr(e14);
4114
+ const s2 = nr$1(e14);
4115
4115
  if (!s2) return { documentId: e14.chapterId, pageIndex: t2 };
4116
4116
  const r9 = s2.segments.find((e15) => t2 >= e15.localPageStart && t2 <= e15.localPageEnd);
4117
4117
  if (!r9) {
@@ -4121,7 +4121,7 @@ function ar(e14, t2) {
4121
4121
  return { documentId: r9.documentId, pageIndex: t2 - r9.localPageStart };
4122
4122
  }
4123
4123
  function ir(e14, t2) {
4124
- const s2 = nr(e14);
4124
+ const s2 = nr$1(e14);
4125
4125
  if (!s2) return 0;
4126
4126
  const r9 = s2.segments.find((e15) => t2 >= e15.localPageStart && t2 <= e15.localPageEnd);
4127
4127
  return (null == r9 ? void 0 : r9.index) ?? Math.floor(t2 / s2.threshold);
@@ -4245,7 +4245,7 @@ const ur = class e7 extends BasePlugin {
4245
4245
  return s2 ? ar(s2, t2) : null;
4246
4246
  }, getSegmentPlan: (e14) => {
4247
4247
  const t2 = this.findChapter(e14);
4248
- return t2 ? nr(t2) : null;
4248
+ return t2 ? nr$1(t2) : null;
4249
4249
  }, isSegmentLoaded: (e14, t2) => this.isSegmentDocumentOpen(e14, t2), isSegmentLoadPending: (e14, t2) => this.isSegmentLoadPending(e14, t2), getChapterErrorMessage: (e14) => this.chapterErrorMessages.get(e14), getChapterStatus: (e14) => this.chapterStatus.get(e14) ?? "idle", getChapter: (e14) => this.findChapter(e14), onChapterStatusChange: this.statusChange$.on, onManifestChange: this.manifestChange$.on };
4250
4250
  }
4251
4251
  destroy() {
@@ -4302,7 +4302,7 @@ const ur = class e7 extends BasePlugin {
4302
4302
  }
4303
4303
  getSegmentPlanForChapter(e14) {
4304
4304
  const t2 = this.findChapter(e14);
4305
- return t2 ? nr(t2) : null;
4305
+ return t2 ? nr$1(t2) : null;
4306
4306
  }
4307
4307
  anySegmentOpen(e14) {
4308
4308
  const t2 = this.getSegmentPlanForChapter(e14), s2 = this.documentManager.provides();
@@ -4374,7 +4374,7 @@ const ur = class e7 extends BasePlugin {
4374
4374
  if (!this.virtualPageMap) return Number.MAX_SAFE_INTEGER;
4375
4375
  const r9 = this.findChapter(e14);
4376
4376
  if (!r9) return Number.MAX_SAFE_INTEGER;
4377
- const n2 = nr(r9), a2 = (null == (s2 = null == n2 ? void 0 : n2.segments[t2]) ? void 0 : s2.localPageStart) ?? 0, i2 = this.virtualPageMap.toGlobal(e14, a2);
4377
+ const n2 = nr$1(r9), a2 = (null == (s2 = null == n2 ? void 0 : n2.segments[t2]) ? void 0 : s2.localPageStart) ?? 0, i2 = this.virtualPageMap.toGlobal(e14, a2);
4378
4378
  if (i2) return i2.globalPageIndex;
4379
4379
  return 1e4 * this.manifest.chapters.findIndex((t3) => t3.chapterId === e14) + t2;
4380
4380
  }
@@ -4446,7 +4446,7 @@ const ur = class e7 extends BasePlugin {
4446
4446
  if (t3 < 0) return;
4447
4447
  const s3 = this.findChapter(e15);
4448
4448
  if (!s3) return;
4449
- const r10 = nr(s3);
4449
+ const r10 = nr$1(s3);
4450
4450
  if (r10 && t3 >= r10.segments.length) return;
4451
4451
  const n3 = `${e15}:${t3}`, a3 = this.segmentStartGlobalIndex(e15, t3), l2 = Math.abs(a3 - i2), h3 = o2.get(n3);
4452
4452
  (void 0 === h3 || l2 < h3) && o2.set(n3, l2);
@@ -4515,7 +4515,7 @@ const ur = class e7 extends BasePlugin {
4515
4515
  this.prepareChapterForSegmentLoad(e14);
4516
4516
  const r9 = this.findChapter(e14);
4517
4517
  if (!r9) return Promise.resolve("error");
4518
- const n2 = nr(r9);
4518
+ const n2 = nr$1(r9);
4519
4519
  if (!n2) return 0 !== t2 ? Promise.resolve(this.isSegmentDocumentOpen(e14, 0) ? "loaded" : "error") : this.ensureSingleDocumentChapter(r9);
4520
4520
  if (t2 < 0 || t2 >= n2.segments.length) return Promise.resolve("error");
4521
4521
  const a2 = n2.segments[t2], i2 = a2.documentId;
@@ -4664,7 +4664,7 @@ const ur = class e7 extends BasePlugin {
4664
4664
  });
4665
4665
  }
4666
4666
  closeChapter(e14) {
4667
- const t2 = this.findChapter(e14), s2 = this.documentManager.provides(), r9 = t2 ? nr(t2) : null, n2 = (e15) => {
4667
+ const t2 = this.findChapter(e14), s2 = this.documentManager.provides(), r9 = t2 ? nr$1(t2) : null, n2 = (e15) => {
4668
4668
  if (s2.isDocumentOpen(e15)) {
4669
4669
  s2.closeDocument(e15).wait(() => {
4670
4670
  }, () => {
@@ -8313,37 +8313,50 @@ const Ma = { key: 0, style: { position: "absolute", inset: "0", pointerEvents: "
8313
8313
  if (!t4) return;
8314
8314
  await t4.requestRemoveBookmark(e16) && (g2.value = null);
8315
8315
  })(e15.id) }, " 删除书签 ", 8, Ta)], 512)) : createCommentVNode("", true)], 36))), 128))])) : createCommentVNode("", true);
8316
- } });
8317
- function Oa(e14) {
8316
+ } }), Oa = "embedpdf-chapter-copy-toast";
8317
+ function Na(e14) {
8318
8318
  return e14.pdfDocumentId ?? e14.chapterId;
8319
8319
  }
8320
- function Na(e14) {
8320
+ function za(e14) {
8321
8321
  return e14.pdfPageIndex ?? e14.localPageIndex;
8322
8322
  }
8323
- function za(e14, t2) {
8323
+ function Ra(e14, t2) {
8324
8324
  e14.wait(t2, () => {
8325
8325
  });
8326
8326
  }
8327
- async function Ra(e14) {
8327
+ async function Ga(e14, t2) {
8328
8328
  var _a2;
8329
- const t2 = e14.trim();
8330
- if (!t2) return false;
8329
+ const s2 = e14.trim();
8330
+ if (!s2) return false;
8331
+ const r9 = () => {
8332
+ (function(e15 = "已复制") {
8333
+ var _a3;
8334
+ if ("undefined" == typeof document) return;
8335
+ (_a3 = document.getElementById(Oa)) == null ? void 0 : _a3.remove();
8336
+ const t3 = document.createElement("div");
8337
+ t3.id = Oa, t3.setAttribute("role", "status"), t3.setAttribute("aria-live", "polite"), t3.textContent = e15, Object.assign(t3.style, { position: "fixed", left: "50%", bottom: "48px", transform: "translateX(-50%)", padding: "10px 18px", borderRadius: "8px", background: "rgba(15, 23, 42, 0.88)", color: "#fff", fontSize: "13px", lineHeight: "1.4", fontFamily: "system-ui, -apple-system, sans-serif", zIndex: "99999", pointerEvents: "none", boxShadow: "0 4px 16px rgba(15, 23, 42, 0.2)", opacity: "0", transition: "opacity 200ms ease" }), document.body.appendChild(t3), requestAnimationFrame(() => {
8338
+ t3.style.opacity = "1";
8339
+ }), window.setTimeout(() => {
8340
+ t3.style.opacity = "0", window.setTimeout(() => t3.remove(), 200);
8341
+ }, 1800);
8342
+ })("已复制");
8343
+ };
8331
8344
  try {
8332
- if ("undefined" != typeof navigator && ((_a2 = navigator.clipboard) == null ? void 0 : _a2.writeText)) return await navigator.clipboard.writeText(t2), true;
8345
+ if ("undefined" != typeof navigator && ((_a2 = navigator.clipboard) == null ? void 0 : _a2.writeText)) return await navigator.clipboard.writeText(s2), r9(), true;
8333
8346
  } catch {
8334
8347
  }
8335
8348
  if ("undefined" == typeof document) return false;
8336
8349
  try {
8337
8350
  const e15 = document.createElement("textarea");
8338
- e15.value = t2, e15.setAttribute("readonly", ""), e15.style.position = "fixed", e15.style.left = "-9999px", document.body.appendChild(e15), e15.select();
8339
- const s2 = document.execCommand("copy");
8340
- return document.body.removeChild(e15), s2;
8351
+ e15.value = s2, e15.setAttribute("readonly", ""), e15.style.position = "fixed", e15.style.left = "-9999px", document.body.appendChild(e15), e15.select();
8352
+ const t3 = document.execCommand("copy");
8353
+ return document.body.removeChild(e15), t3 && r9(), t3;
8341
8354
  } catch {
8342
8355
  return false;
8343
8356
  }
8344
8357
  }
8345
- const Ga = { display: "flex", alignItems: "center", justifyContent: "center", padding: "4px 8px", borderRadius: "8px", background: "#ffffff", border: "1px solid rgba(15, 23, 42, 0.08)", boxShadow: "0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 10px 24px -4px rgba(15, 23, 42, 0.12)" }, Ba = { padding: "6px 12px", fontSize: "12px", fontWeight: "500", border: "none", borderRadius: "6px", background: "transparent", color: "#dc2626", cursor: "pointer" };
8346
- function _a(e14, s2) {
8358
+ const Ba = { display: "flex", alignItems: "center", justifyContent: "center", padding: "4px 8px", borderRadius: "8px", background: "#ffffff", border: "1px solid rgba(15, 23, 42, 0.08)", boxShadow: "0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 10px 24px -4px rgba(15, 23, 42, 0.12)" }, _a = { padding: "6px 12px", fontSize: "12px", fontWeight: "500", border: "none", borderRadius: "6px", background: "transparent", color: "#dc2626", cursor: "pointer" };
8359
+ function Wa(e14, s2) {
8347
8360
  var _a2, _b;
8348
8361
  const { provides: r9 } = useAnnotationCapability(), n2 = (_a2 = s2 == null ? void 0 : s2.markup) == null ? void 0 : _a2.annotationMenu, a2 = false !== ((_b = s2 == null ? void 0 : s2.markup) == null ? void 0 : _b.enabled), i2 = false !== (n2 == null ? void 0 : n2.enabled);
8349
8362
  return computed(() => {
@@ -8356,13 +8369,13 @@ function _a(e14, s2) {
8356
8369
  var h2;
8357
8370
  const d2 = r9.value.forDocument(t2), { pageIndex: c2, id: u2 } = s3.annotation.object, p2 = () => {
8358
8371
  d2 == null ? void 0 : d2.deleteAnnotation(c2, u2);
8359
- }, g2 = { position: "absolute", pointerEvents: "auto", left: "50%", transform: "translateX(-50%)", top: (i3 == null ? void 0 : i3.suggestTop) ? void 0 : `${a3.size.height + 8}px`, bottom: (i3 == null ? void 0 : i3.suggestTop) ? `${a3.size.height + 8}px` : void 0 }, m2 = (n2 == null ? void 0 : n2.renderMenu) ? n2.renderMenu({ pageIndex: c2, annotationId: u2, onDelete: p2 }) : h$1("button", { type: "button", style: Ba, onClick: p2 }, "删除");
8360
- return h$1("div", o2, [h$1("div", { style: g2 }, [h$1("div", { style: Ga, role: "toolbar", "aria-label": "划线标注" }, [m2])])]);
8372
+ }, g2 = { position: "absolute", pointerEvents: "auto", left: "50%", transform: "translateX(-50%)", top: (i3 == null ? void 0 : i3.suggestTop) ? void 0 : `${a3.size.height + 8}px`, bottom: (i3 == null ? void 0 : i3.suggestTop) ? `${a3.size.height + 8}px` : void 0 }, m2 = (n2 == null ? void 0 : n2.renderMenu) ? n2.renderMenu({ pageIndex: c2, annotationId: u2, onDelete: p2 }) : h$1("button", { type: "button", style: _a, onClick: p2 }, "删除");
8373
+ return h$1("div", o2, [h$1("div", { style: g2 }, [h$1("div", { style: Ba, role: "toolbar", "aria-label": "划线标注" }, [m2])])]);
8361
8374
  };
8362
8375
  });
8363
8376
  }
8364
- const Wa = /* @__PURE__ */ defineComponent({ __name: "ChapterPageSurface", props: { item: {}, features: {}, showNoteMarkers: { type: Boolean }, showBookmarkMarkers: { type: Boolean }, showRedactionLayer: { type: Boolean }, noteMarkerUi: {}, bookmarkMarkerUi: {}, buildSelectionMenu: { type: Function }, createNote: {}, annotationSelectionMenu: {}, redactionSelectionMenu: {}, renderPageOverlay: { type: Function } }, setup(e14) {
8365
- const s2 = e14, n2 = computed(() => Oa(s2.item)), a2 = computed(() => Na(s2.item));
8377
+ const Ha = /* @__PURE__ */ defineComponent({ __name: "ChapterPageSurface", props: { item: {}, features: {}, showNoteMarkers: { type: Boolean }, showBookmarkMarkers: { type: Boolean }, showRedactionLayer: { type: Boolean }, noteMarkerUi: {}, bookmarkMarkerUi: {}, buildSelectionMenu: { type: Function }, createNote: {}, annotationSelectionMenu: {}, redactionSelectionMenu: {}, renderPageOverlay: { type: Function } }, setup(e14) {
8378
+ const s2 = e14, n2 = computed(() => Na(s2.item)), a2 = computed(() => za(s2.item));
8366
8379
  !(function(e15) {
8367
8380
  const { provides: t2 } = useCapability(DocumentManagerPlugin.id);
8368
8381
  watch([t2, e15], ([e16, t3]) => {
@@ -8381,8 +8394,8 @@ const Wa = /* @__PURE__ */ defineComponent({ __name: "ChapterPageSurface", props
8381
8394
  const n3 = { position: "absolute", pointerEvents: "auto", left: "50%", transform: "translateX(-50%)", top: ((_a3 = s3.placement) == null ? void 0 : _a3.suggestTop) ? -40 : s3.rect.size.height + 8 };
8382
8395
  return h$1("div", s3.menuWrapperProps, [h$1("div", { style: n3 }, h$1("button", { type: "button", style: { padding: "6px 10px", fontSize: "12px", border: "1px solid #e2e8f0", borderRadius: "6px", background: "#fff", cursor: "pointer" }, onClick: () => {
8383
8396
  if (!l.value) return;
8384
- const s4 = l.value.getHighlightRectsForPage(Na(e15), t2);
8385
- za(l.value.getSelectedText(t2), (t3) => {
8397
+ const s4 = l.value.getHighlightRectsForPage(za(e15), t2);
8398
+ Ra(l.value.getSelectedText(t2), (t3) => {
8386
8399
  r9((function(e16, t4, s5) {
8387
8400
  return { chapterId: e16.chapterId, localPageIndex: e16.localPageIndex, globalPageIndex: e16.globalPageIndex, globalPageNumber: e16.globalPageNumber, rectsPdfCoord: t4, selectedText: s5 };
8388
8401
  })(e15, s4, t3.join("\n")));
@@ -8397,7 +8410,7 @@ const Wa = /* @__PURE__ */ defineComponent({ __name: "ChapterPageSurface", props
8397
8410
  if (s3) return s3;
8398
8411
  }
8399
8412
  return t2.defaultMenu;
8400
- }), p2 = _a(n2, s2.features), v = computed(() => (function(e15, t2) {
8413
+ }), p2 = Wa(n2, s2.features), v = computed(() => (function(e15, t2) {
8401
8414
  if (e15 || t2) return (s3) => {
8402
8415
  if (e15) {
8403
8416
  const t3 = e15(s3);
@@ -8417,8 +8430,8 @@ const Wa = /* @__PURE__ */ defineComponent({ __name: "ChapterPageSurface", props
8417
8430
  });
8418
8431
  return (t2, s3) => e14.item.isPlaceholder ? createCommentVNode("", true) : (openBlock(), createBlock(unref(GlobalPointerProvider), { key: 0, "document-id": n2.value }, { default: withCtx(() => [createVNode(unref(Rotate), { "document-id": n2.value, "page-index": a2.value, style: { backgroundColor: "#fff" } }, { default: withCtx(() => [createVNode(unref(PagePointerProvider), { "document-id": n2.value, "page-index": a2.value, style: normalizeStyle(unref(Pe)), onPointerdown: unref(Se) }, { default: withCtx(() => [createVNode(unref(Vn), { "chapter-id": e14.item.chapterId, "local-page-index": e14.item.localPageIndex, "pdf-document-id": n2.value, "pdf-page-index": a2.value }, null, 8, ["chapter-id", "local-page-index", "pdf-document-id", "pdf-page-index"]), createVNode(unref(SelectionLayer), { "document-id": n2.value, "page-index": a2.value, "text-style": w2.value, "selection-menu": u2.value }, null, 8, ["document-id", "page-index", "text-style", "selection-menu"]), e14.showRedactionLayer ? (openBlock(), createBlock(unref(RedactionLayer), { key: 0, "document-id": n2.value, "page-index": a2.value, "selection-menu": e14.redactionSelectionMenu }, null, 8, ["document-id", "page-index", "selection-menu"])) : createCommentVNode("", true), createVNode(unref(AnnotationLayer), { "document-id": n2.value, "page-index": a2.value, "selection-menu": v.value }, null, 8, ["document-id", "page-index", "selection-menu"]), e14.showBookmarkMarkers && d2.value ? (openBlock(), createBlock(Fa, { key: 1, "chapter-id": e14.item.chapterId, "local-page-index": e14.item.localPageIndex, "pdf-page-width": d2.value.size.width, "pdf-page-height": d2.value.size.height, "css-page-width": e14.item.width, "css-page-height": e14.item.height, ui: e14.bookmarkMarkerUi }, null, 8, ["chapter-id", "local-page-index", "pdf-page-width", "pdf-page-height", "css-page-width", "css-page-height", "ui"])) : createCommentVNode("", true), y.value ? (openBlock(), createBlock(resolveDynamicComponent(y.value), { key: 2 })) : createCommentVNode("", true), e14.showNoteMarkers && d2.value ? (openBlock(), createBlock(Va, { key: 3, "chapter-id": e14.item.chapterId, "local-page-index": e14.item.localPageIndex, "pdf-page-width": d2.value.size.width, "pdf-page-height": d2.value.size.height, "css-page-width": e14.item.width, "css-page-height": e14.item.height, ui: e14.noteMarkerUi }, null, 8, ["chapter-id", "local-page-index", "pdf-page-width", "pdf-page-height", "css-page-width", "css-page-height", "ui"])) : createCommentVNode("", true), renderSlot(t2.$slots, "default")]), _: 3 }, 8, ["document-id", "page-index", "style", "onPointerdown"])]), _: 3 }, 8, ["document-id", "page-index"])]), _: 3 }, 8, ["document-id"]));
8419
8432
  } });
8420
- const Ha = /* @__PURE__ */ defineComponent({ __name: "HoverBookmarkLayer", props: { item: {}, pdfPageWidth: {}, pdfPageHeight: {}, cssPageWidth: {}, cssPageHeight: {}, hoverUi: {} }, setup(e14) {
8421
- const a2 = e14, i2 = computed(() => Oa(a2.item)), { provides: d2 } = useCapability(SelectionPlugin.id), { provides: u2 } = useCapability($r.id), p2 = ref(null), g2 = ref(null), m2 = ref(null), P2 = ref(null), S = computed(() => {
8433
+ const qa = /* @__PURE__ */ defineComponent({ __name: "HoverBookmarkLayer", props: { item: {}, pdfPageWidth: {}, pdfPageHeight: {}, cssPageWidth: {}, cssPageHeight: {}, hoverUi: {} }, setup(e14) {
8434
+ const a2 = e14, i2 = computed(() => Na(a2.item)), { provides: d2 } = useCapability(SelectionPlugin.id), { provides: u2 } = useCapability($r.id), p2 = ref(null), g2 = ref(null), m2 = ref(null), P2 = ref(null), S = computed(() => {
8422
8435
  var _a2;
8423
8436
  return ((_a2 = a2.hoverUi) == null ? void 0 : _a2.iconSize) ?? 16;
8424
8437
  }), b2 = computed(() => P2.value ?? m2.value);
@@ -8494,15 +8507,15 @@ const Ha = /* @__PURE__ */ defineComponent({ __name: "HoverBookmarkLayer", props
8494
8507
  var _a2;
8495
8508
  return unref(u2) && e14.pdfPageWidth && e14.pdfPageHeight ? (openBlock(), createElementBlock("div", { key: 0, ref_key: "rootRef", ref: p2, style: { position: "absolute", inset: "0", zIndex: 14, pointerEvents: "none" } }, [D2.value && b2.value && !$2.value ? (openBlock(), createElementBlock("div", { key: 0, style: normalizeStyle({ position: "absolute", left: `${D2.value.zoneLeft}px`, top: `${D2.value.zoneTop}px`, width: `${D2.value.size + 20}px`, height: `${(((_a2 = b2.value[b2.value.length - 1]) == null ? void 0 : _a2.size.height) ?? 0) * (e14.cssPageHeight / e14.pdfPageHeight) + D2.value.size + 12}px`, pointerEvents: "auto" }), onMouseenter: s2[0] || (s2[0] = (e15) => P2.value = b2.value), onMouseleave: s2[1] || (s2[1] = (e15) => P2.value = null) }, [createElementVNode("button", { type: "button", title: "添加书签", style: normalizeStyle({ position: "absolute", left: D2.value.iconLeft - D2.value.zoneLeft + "px", top: D2.value.iconTop - D2.value.zoneTop + "px", width: `${D2.value.size}px`, height: `${D2.value.size}px`, cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", background: "#3b82f6", color: "#fff", border: "none", borderRadius: "4px", boxShadow: "0 2px 8px rgba(37, 99, 235, 0.45)", fontSize: "12px", padding: 0 }), onClick: withModifiers(k2, ["stop"]) }, " 🔖 ", 4)], 36)) : createCommentVNode("", true)], 512)) : createCommentVNode("", true);
8496
8509
  };
8497
- } }), qa = { key: 0, width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "" }, Ka = { key: 1, width: "24", height: "24", viewBox: "0 0 28 28", fill: "none", "aria-hidden": "" }, ja = { key: 0, x: "5", y: "4", width: "18", height: "20", rx: "3", fill: "#fde047" }, Xa = { key: 1, d: "M6 22h16", stroke: "#dc2626", "stroke-width": "2.2", "stroke-linecap": "round" }, Za = { key: 2, d: "M6 22c2-2 3-2 5 0s3 2 5 0 3-2 5 0", stroke: "#dc2626", "stroke-width": "2", "stroke-linecap": "round", fill: "none" }, Ya = { key: 3, d: "M5 14h18", stroke: "#dc2626", "stroke-width": "2.2", "stroke-linecap": "round" }, Qa = { key: 2, width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "" }, Ja = /* @__PURE__ */ defineComponent({ __name: "SelectionToolbarIcons", props: { kind: {} }, setup: (e14) => (t2, s2) => "copy" === e14.kind ? (openBlock(), createElementBlock("svg", qa, [...s2[0] || (s2[0] = [createElementVNode("rect", { x: "8.5", y: "8.5", width: "11", height: "13", rx: "2.25", fill: "#f1f5f9", stroke: "#94a3b8", "stroke-width": "1.35" }, null, -1), createElementVNode("rect", { x: "4.5", y: "3.5", width: "11", height: "13", rx: "2.25", fill: "#ffffff", stroke: "#334155", "stroke-width": "1.5" }, null, -1), createElementVNode("path", { d: "M7.5 7h5.5a1.5 1.5 0 0 1 1.5 1.5V14", stroke: "#64748b", "stroke-width": "1.2", "stroke-linecap": "round" }, null, -1)])])) : "note" !== e14.kind ? (openBlock(), createElementBlock("svg", Ka, ["highlight" === e14.kind ? (openBlock(), createElementBlock("rect", ja)) : createCommentVNode("", true), s2[1] || (s2[1] = createElementVNode("text", { x: "14", y: "19", "text-anchor": "middle", "font-size": "15", "font-weight": "700", "font-family": "system-ui, -apple-system, sans-serif", fill: "#0f172a" }, " A ", -1)), "underline" === e14.kind ? (openBlock(), createElementBlock("path", Xa)) : "squiggly" === e14.kind ? (openBlock(), createElementBlock("path", Za)) : "strikeout" === e14.kind ? (openBlock(), createElementBlock("path", Ya)) : createCommentVNode("", true)])) : (openBlock(), createElementBlock("svg", Qa, [...s2[2] || (s2[2] = [createElementVNode("path", { d: "M8 3h8l4 4v14H8V3z", fill: "#fef3c7", stroke: "#d97706", "stroke-width": "1.2", "stroke-linejoin": "round" }, null, -1), createElementVNode("path", { d: "M16 3v4h4", stroke: "#d97706", "stroke-width": "1.2" }, null, -1), createElementVNode("path", { d: "M10 12h6M10 16h4", stroke: "#92400e", "stroke-width": "1.2", "stroke-linecap": "round" }, null, -1)])])) }), ei = ["title", "aria-label", "onMouseenter", "onClick"], ti = ["title", "onMouseenter", "onClick"], si = { style: { "font-size": "11px", "font-weight": "600" } }, ri = /* @__PURE__ */ defineComponent({ __name: "SelectionToolbarCard", props: { placementAbove: { type: Boolean }, anchorHeight: {}, hiddenBuiltinActions: {}, extraActions: {}, renderCopyIcon: { type: Function } }, emits: ["action"], setup(e14, { emit: r9 }) {
8510
+ } }), Ka = "#64748b", ja = { key: 0, width: "20", height: "20", viewBox: "0 0 1024 1024", fill: "none", "aria-hidden": "" }, Xa = ["d", "fill"], Za = { key: 1, width: "24", height: "24", viewBox: "0 0 28 28", fill: "none", "aria-hidden": "" }, Ya = { key: 0, x: "5", y: "4", width: "18", height: "20", rx: "3", fill: "#fde047" }, Qa = { key: 1, d: "M6 22h16", stroke: "#dc2626", "stroke-width": "2.2", "stroke-linecap": "round" }, Ja = { key: 2, d: "M6 22c2-2 3-2 5 0s3 2 5 0 3-2 5 0", stroke: "#dc2626", "stroke-width": "2", "stroke-linecap": "round", fill: "none" }, ei = { key: 3, d: "M5 14h18", stroke: "#dc2626", "stroke-width": "2.2", "stroke-linecap": "round" }, ti = { key: 2, width: "20", height: "20", viewBox: "0 0 1024 1024", fill: "none", "aria-hidden": "" }, si = ["d", "fill"], ri = /* @__PURE__ */ defineComponent({ __name: "SelectionToolbarIcons", props: { kind: {} }, setup: (e14) => (t2, s2) => "copy" === e14.kind ? (openBlock(), createElementBlock("svg", ja, [createElementVNode("path", { d: unref("M753.312 698.848 753.312 383.6736c0-62.048-50.3104-112.3264-112.288-112.3264L395.3024 271.3472 324.288 271.3472l-53.7344 0-29.536 0c-62.048 0-112.288 50.272-112.288 112.3264l0 400.0512c0 61.9776 50.24 112.2752 112.288 112.2752l400.0128 0c62.048 0 112.288-50.2976 112.288-112.2752l0-31.0656 0.8768 0 0-54.0352C753.888 698.624 753.6768 698.7776 753.312 698.848zM660.6016 681.728l0 42.5984c0 0.864-0.2368 1.792-0.2368 2.6688-1.4272 42.3552-36.064 76.3008-78.7328 76.3008L300.3392 803.296c-43.5968 0-78.9056-35.3664-78.9056-78.9696L221.4336 442.9888c0-42.2336 33.2608-76.4928 75.0144-78.5984 1.2928-0.064 2.5984-0.3712 3.8912-0.3712l41.4272 0L581.632 364.0192c43.6608 0 78.9696 35.4048 78.9696 78.9696L660.6016 681.728zM895.1232 555.5008 895.1232 240.3264c0-62.048-50.3104-112.3264-112.288-112.3264L537.1136 128 466.0992 128l-53.7344 0-29.536 0c-62.048 0-112.288 50.272-112.288 112.3264l0 4.4736 115.0784 0c13.4912-13.8112 32.0256-22.72 52.6464-23.7568 1.2864-0.064 2.592-0.3712 3.8848-0.3712l41.4272 0 239.8656 0c43.6608 0 78.9696 35.4048 78.9696 78.9696l0 238.7328 0 42.5984c0 0.864-0.2368 1.792-0.2368 2.6688-0.8768 25.9136-14.208 48.6336-34.176 62.4l0 106.6048 14.8352 0c62.048 0 112.288-50.2976 112.288-112.2752l0-31.0656L896 609.3056l0-54.0352C895.6992 555.2768 895.488 555.424 895.1232 555.5008z"), fill: unref(Ka) }, null, 8, Xa)])) : "note" !== e14.kind ? (openBlock(), createElementBlock("svg", Za, ["highlight" === e14.kind ? (openBlock(), createElementBlock("rect", Ya)) : createCommentVNode("", true), s2[0] || (s2[0] = createElementVNode("text", { x: "14", y: "19", "text-anchor": "middle", "font-size": "15", "font-weight": "700", "font-family": "system-ui, -apple-system, sans-serif", fill: "#0f172a" }, " A ", -1)), "underline" === e14.kind ? (openBlock(), createElementBlock("path", Qa)) : "squiggly" === e14.kind ? (openBlock(), createElementBlock("path", Ja)) : "strikeout" === e14.kind ? (openBlock(), createElementBlock("path", ei)) : createCommentVNode("", true)])) : (openBlock(), createElementBlock("svg", ti, [createElementVNode("path", { d: unref("M725.333333 85.333333a170.666667 170.666667 0 0 1 170.666667 170.666667v512a170.666667 170.666667 0 0 1-170.666667 170.666667H298.666667a170.666667 170.666667 0 0 1-170.666667-170.666667V256a170.666667 170.666667 0 0 1 170.666667-170.666667h426.666666z m0 85.333334H298.666667a85.333333 85.333333 0 0 0-85.12 78.933333L213.333333 256v512a85.333333 85.333333 0 0 0 78.933334 85.12L298.666667 853.333333h426.666666a85.333333 85.333333 0 0 0 85.12-78.933333L810.666667 768V256a85.333333 85.333333 0 0 0-78.933334-85.12L725.333333 170.666667z m-42.666666 469.333333a42.666667 42.666667 0 0 1 4.992 85.034667L682.666667 725.333333H341.333333a42.666667 42.666667 0 0 1-4.992-85.034666L341.333333 640h341.333334z m0-170.666667a42.666667 42.666667 0 1 1 0 85.333334H341.333333a42.666667 42.666667 0 1 1 0-85.333334h341.333334z m-170.666667-170.666666a42.666667 42.666667 0 0 1 4.992 85.034666L512 384H341.333333a42.666667 42.666667 0 0 1-4.992-85.034667L341.333333 298.666667h170.666667z"), fill: unref(Ka) }, null, 8, si)])) }), ni = ["title", "aria-label", "onMouseenter", "onClick"], ai = ["title", "onMouseenter", "onClick"], ii = { style: { "font-size": "11px", "font-weight": "600" } }, oi = /* @__PURE__ */ defineComponent({ __name: "SelectionToolbarCard", props: { placementAbove: { type: Boolean }, anchorHeight: {}, hiddenBuiltinActions: {}, extraActions: {}, renderCopyIcon: { type: Function } }, emits: ["action"], setup(e14, { emit: r9 }) {
8498
8511
  const n2 = e14, a2 = r9, i2 = [{ id: "highlight", label: "高亮背景" }, { id: "underline", label: "下划线" }, { id: "squiggly", label: "波浪线" }, { id: "strikeout", label: "删除线" }], d2 = computed(() => new Set(n2.hiddenBuiltinActions ?? [])), g2 = computed(() => !d2.value.has("copy")), f2 = computed(() => i2.filter((e15) => !d2.value.has(e15.id))), v = computed(() => !d2.value.has("note")), P2 = computed(() => [...n2.extraActions ?? []].sort((e15, t2) => (e15.order ?? 0) - (t2.order ?? 0))), S = computed(() => f2.value.length > 0 || P2.value.length > 0), w2 = ref(null), x = computed(() => ({ position: "absolute", pointerEvents: "auto", left: "50%", transform: "translateX(-50%)", top: n2.placementAbove ? void 0 : `${n2.anchorHeight + 10}px`, bottom: n2.placementAbove ? `${n2.anchorHeight + 10}px` : void 0, display: "flex", alignItems: "center", gap: "2px", padding: "4px 6px", borderRadius: "12px", background: "rgba(255, 255, 255, 0.96)", border: "1px solid rgba(15, 23, 42, 0.06)", boxShadow: "0 2px 8px rgba(15, 23, 42, 0.08), 0 12px 32px rgba(15, 23, 42, 0.1)", backdropFilter: "blur(10px)", WebkitBackdropFilter: "blur(10px)" }));
8499
8512
  function M2(e15, t2 = false) {
8500
8513
  return { display: "flex", alignItems: "center", justifyContent: "center", width: "32px", height: "32px", padding: 0, margin: 0, border: "none", borderRadius: "8px", background: w2.value === e15 ? t2 ? "#fffbeb" : "#f1f5f9" : "transparent", color: t2 ? "#b45309" : "#334155", cursor: "pointer", flexShrink: 0, WebkitAppearance: "none", appearance: "none" };
8501
8514
  }
8502
8515
  const L2 = { width: "1px", height: "20px", margin: "0 4px", background: "rgba(15, 23, 42, 0.1)", flexShrink: 0 };
8503
- return (t2, s2) => (openBlock(), createElementBlock("div", { role: "toolbar", "aria-label": "选区工具", style: normalizeStyle(x.value) }, [g2.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("button", { type: "button", title: "复制", "aria-label": "复制", style: normalizeStyle(M2("copy")), onMouseenter: s2[0] || (s2[0] = (e15) => w2.value = "copy"), onMouseleave: s2[1] || (s2[1] = (e15) => w2.value = null), onClick: s2[2] || (s2[2] = (e15) => a2("action", "copy")) }, [e14.renderCopyIcon ? (openBlock(), createBlock(resolveDynamicComponent(e14.renderCopyIcon), { key: 0 })) : (openBlock(), createBlock(Ja, { key: 1, kind: "copy" }))], 36), S.value ? (openBlock(), createElementBlock("span", { key: 0, style: L2, "aria-hidden": "" })) : createCommentVNode("", true)], 64)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(f2.value, (e15) => (openBlock(), createElementBlock("button", { key: e15.id, type: "button", title: e15.label, "aria-label": e15.label, style: normalizeStyle(M2(e15.id)), onMouseenter: (t3) => w2.value = e15.id, onMouseleave: s2[3] || (s2[3] = (e16) => w2.value = null), onClick: (t3) => a2("action", e15.id) }, [createVNode(Ja, { kind: e15.id }, null, 8, ["kind"])], 44, ei))), 128)), (openBlock(true), createElementBlock(Fragment, null, renderList(P2.value, (e15) => (openBlock(), createElementBlock("button", { key: e15.id, type: "button", title: e15.label, style: normalizeStyle(M2(e15.id)), onMouseenter: (t3) => w2.value = e15.id, onMouseleave: s2[4] || (s2[4] = (e16) => w2.value = null), onClick: (t3) => a2("action", e15.id) }, [createElementVNode("span", si, toDisplayString(e15.label.slice(0, 2)), 1)], 44, ti))), 128)), v.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [S.value || g2.value ? (openBlock(), createElementBlock("span", { key: 0, style: L2, "aria-hidden": "" })) : createCommentVNode("", true), createElementVNode("button", { type: "button", title: "添加笔记", "aria-label": "添加笔记", style: normalizeStyle(M2("note", true)), onMouseenter: s2[5] || (s2[5] = (e15) => w2.value = "note"), onMouseleave: s2[6] || (s2[6] = (e15) => w2.value = null), onClick: s2[7] || (s2[7] = (e15) => a2("action", "note")) }, [createVNode(Ja, { kind: "note" })], 36)], 64)) : createCommentVNode("", true)], 4));
8504
- } }), ni = { highlight: "highlight", underline: "underline", squiggly: "squiggly", strikeout: "strikeout" };
8505
- const ai = /* @__PURE__ */ defineComponent({ __name: "PdfChapterViewport", props: { className: {}, features: {}, buildSelectionMenu: {}, annotationSelectionMenu: {}, redactionSelectionMenu: {}, showNoteMarkers: { type: Boolean, default: true }, showBookmarkMarkers: { type: Boolean, default: true }, showRedactionLayer: { type: Boolean, default: false }, renderPageOverlay: {}, onExtraSelectionAction: {} }, setup(e14) {
8516
+ return (t2, s2) => (openBlock(), createElementBlock("div", { role: "toolbar", "aria-label": "选区工具", style: normalizeStyle(x.value) }, [g2.value ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("button", { type: "button", title: "复制", "aria-label": "复制", style: normalizeStyle(M2("copy")), onMouseenter: s2[0] || (s2[0] = (e15) => w2.value = "copy"), onMouseleave: s2[1] || (s2[1] = (e15) => w2.value = null), onClick: s2[2] || (s2[2] = (e15) => a2("action", "copy")) }, [e14.renderCopyIcon ? (openBlock(), createBlock(resolveDynamicComponent(e14.renderCopyIcon), { key: 0 })) : (openBlock(), createBlock(ri, { key: 1, kind: "copy" }))], 36), S.value ? (openBlock(), createElementBlock("span", { key: 0, style: L2, "aria-hidden": "" })) : createCommentVNode("", true)], 64)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(f2.value, (e15) => (openBlock(), createElementBlock("button", { key: e15.id, type: "button", title: e15.label, "aria-label": e15.label, style: normalizeStyle(M2(e15.id)), onMouseenter: (t3) => w2.value = e15.id, onMouseleave: s2[3] || (s2[3] = (e16) => w2.value = null), onClick: (t3) => a2("action", e15.id) }, [createVNode(ri, { kind: e15.id }, null, 8, ["kind"])], 44, ni))), 128)), (openBlock(true), createElementBlock(Fragment, null, renderList(P2.value, (e15) => (openBlock(), createElementBlock("button", { key: e15.id, type: "button", title: e15.label, style: normalizeStyle(M2(e15.id)), onMouseenter: (t3) => w2.value = e15.id, onMouseleave: s2[4] || (s2[4] = (e16) => w2.value = null), onClick: (t3) => a2("action", e15.id) }, [createElementVNode("span", ii, toDisplayString(e15.label.slice(0, 2)), 1)], 44, ai))), 128)), v.value ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [S.value || g2.value ? (openBlock(), createElementBlock("span", { key: 0, style: L2, "aria-hidden": "" })) : createCommentVNode("", true), createElementVNode("button", { type: "button", title: "添加笔记", "aria-label": "添加笔记", style: normalizeStyle(M2("note", true)), onMouseenter: s2[5] || (s2[5] = (e15) => w2.value = "note"), onMouseleave: s2[6] || (s2[6] = (e15) => w2.value = null), onClick: s2[7] || (s2[7] = (e15) => a2("action", "note")) }, [createVNode(ri, { kind: "note" })], 36)], 64)) : createCommentVNode("", true)], 4));
8517
+ } }), li = { highlight: "highlight", underline: "underline", squiggly: "squiggly", strikeout: "strikeout" };
8518
+ const hi = /* @__PURE__ */ defineComponent({ __name: "PdfChapterViewport", props: { className: {}, features: {}, buildSelectionMenu: {}, annotationSelectionMenu: {}, redactionSelectionMenu: {}, showNoteMarkers: { type: Boolean, default: true }, showBookmarkMarkers: { type: Boolean, default: true }, showRedactionLayer: { type: Boolean, default: false }, renderPageOverlay: {}, onExtraSelectionAction: {} }, setup(e14) {
8506
8519
  const s2 = e14, r9 = computed(() => s2.features), { hostRef: n2 } = tn(r9), a2 = computed(() => {
8507
8520
  var _a2, _b;
8508
8521
  return { background: ((_b = (_a2 = s2.features) == null ? void 0 : _a2.scrollViewport) == null ? void 0 : _b.background) ?? be };
@@ -8551,16 +8564,16 @@ const ai = /* @__PURE__ */ defineComponent({ __name: "PdfChapterViewport", props
8551
8564
  return computed(() => {
8552
8565
  var _a2, _b, _c;
8553
8566
  if (false !== ((_a2 = r10.value) == null ? void 0 : _a2.enabled) && (n3.value || a3.value || i3.value || ((_c = (_b = r10.value) == null ? void 0 : _b.extraActions) == null ? void 0 : _c.length))) return (t2) => {
8554
- const d2 = Oa(t2.item), c3 = Na(t2.item);
8567
+ const d2 = Na(t2.item), c3 = za(t2.item);
8555
8568
  return (u3) => {
8556
8569
  var _a3, _b2, _c2, _d;
8557
- return h$1("div", u3.menuWrapperProps, h$1(ri, { placementAbove: !!((_a3 = u3.placement) == null ? void 0 : _a3.suggestTop), anchorHeight: u3.rect.size.height, hiddenBuiltinActions: (_b2 = r10.value) == null ? void 0 : _b2.hiddenBuiltinActions, extraActions: (_c2 = r10.value) == null ? void 0 : _c2.extraActions, renderCopyIcon: (_d = r10.value) == null ? void 0 : _d.renderCopyIcon, onAction: (r11) => {
8570
+ return h$1("div", u3.menuWrapperProps, h$1(oi, { placementAbove: !!((_a3 = u3.placement) == null ? void 0 : _a3.suggestTop), anchorHeight: u3.rect.size.height, hiddenBuiltinActions: (_b2 = r10.value) == null ? void 0 : _b2.hiddenBuiltinActions, extraActions: (_c2 = r10.value) == null ? void 0 : _c2.extraActions, renderCopyIcon: (_d = r10.value) == null ? void 0 : _d.renderCopyIcon, onAction: (r11) => {
8558
8571
  var _a4, _b3, _c3;
8559
8572
  if ("copy" !== r11) if ("highlight" !== r11 && "underline" !== r11 && "squiggly" !== r11 && "strikeout" !== r11) {
8560
8573
  if ("note" === r11) {
8561
8574
  if (!o2.value || !h2.value || !a3.value) return;
8562
8575
  const e16 = o2.value.getHighlightRectsForPage(c3, d2);
8563
- return void za(o2.value.getSelectedText(d2), (s4) => {
8576
+ return void Ra(o2.value.getSelectedText(d2), (s4) => {
8564
8577
  var _a5;
8565
8578
  (_a5 = h2.value) == null ? void 0 : _a5.requestCreateFromSelection({ chapterId: t2.item.chapterId, localPageIndex: t2.item.localPageIndex, globalPageIndex: t2.item.globalPageIndex, globalPageNumber: t2.item.globalPageNumber, rectsPdfCoord: e16, selectedText: s4.join("\n") });
8566
8579
  });
@@ -8568,12 +8581,12 @@ const ai = /* @__PURE__ */ defineComponent({ __name: "PdfChapterViewport", props
8568
8581
  (_a4 = s3 == null ? void 0 : s3.onExtraAction) == null ? void 0 : _a4.call(s3, r11, t2);
8569
8582
  } else {
8570
8583
  if (!o2.value || !l.value || !n3.value) return;
8571
- Me$1(d2, ni[r11], l.value, o2.value, (_c3 = (_b3 = e15()) == null ? void 0 : _b3.markup) == null ? void 0 : _c3.styles);
8584
+ Me$1(d2, li[r11], l.value, o2.value, (_c3 = (_b3 = e15()) == null ? void 0 : _b3.markup) == null ? void 0 : _c3.styles);
8572
8585
  }
8573
8586
  else {
8574
8587
  if (!o2.value || !i3.value) return;
8575
- za(o2.value.getSelectedText(d2), (e16) => {
8576
- Ra(e16.join("\n"));
8588
+ Ra(o2.value.getSelectedText(d2), (e16) => {
8589
+ Ga(e16.join("\n"));
8577
8590
  });
8578
8591
  }
8579
8592
  } }));
@@ -8592,8 +8605,8 @@ const ai = /* @__PURE__ */ defineComponent({ __name: "PdfChapterViewport", props
8592
8605
  if (v.value) {
8593
8606
  const r11 = (function(e16) {
8594
8607
  var _a3, _b, _c, _d;
8595
- const t3 = Oa(e16), r12 = Na(e16), n3 = (_b = (_a3 = y.value) == null ? void 0 : _a3.getDocument(t3)) == null ? void 0 : _b.pages[r12];
8596
- return e16.isPlaceholder || !n3 ? null : h$1(Ha, { item: e16, pdfPageWidth: n3.size.width, pdfPageHeight: n3.size.height, cssPageWidth: e16.width, cssPageHeight: e16.height, hoverUi: (_d = (_c = s2.features) == null ? void 0 : _c.bookmarks) == null ? void 0 : _d.hover });
8608
+ const t3 = Na(e16), r12 = za(e16), n3 = (_b = (_a3 = y.value) == null ? void 0 : _a3.getDocument(t3)) == null ? void 0 : _b.pages[r12];
8609
+ return e16.isPlaceholder || !n3 ? null : h$1(qa, { item: e16, pdfPageWidth: n3.size.width, pdfPageHeight: n3.size.height, cssPageWidth: e16.width, cssPageHeight: e16.height, hoverUi: (_d = (_c = s2.features) == null ? void 0 : _c.bookmarks) == null ? void 0 : _d.hover });
8597
8610
  })(e15);
8598
8611
  r11 && t2.push(r11);
8599
8612
  }
@@ -8602,24 +8615,24 @@ const ai = /* @__PURE__ */ defineComponent({ __name: "PdfChapterViewport", props
8602
8615
  }
8603
8616
  return (t2, s3) => (openBlock(), createElementBlock("div", { ref_key: "hostRef", ref: n2, class: normalizeClass(e14.className), style: normalizeStyle(e14.className ? void 0 : unref(Ie$1)) }, [createVNode(unref(Un), { class: normalizeClass(e14.className), style: normalizeStyle(a2.value) }, { page: withCtx(({ item: t3 }) => {
8604
8617
  var _a2, _b, _c, _d;
8605
- return [createVNode(Wa, { item: t3, features: e14.features, "show-note-markers": p2.value, "show-bookmark-markers": m2.value, "show-redaction-layer": e14.showRedactionLayer, "note-marker-ui": (_b = (_a2 = e14.features) == null ? void 0 : _a2.notes) == null ? void 0 : _b.marker, "bookmark-marker-ui": (_d = (_c = e14.features) == null ? void 0 : _c.bookmarks) == null ? void 0 : _d.marker, "build-selection-menu": C2.value, "create-note": unref(i2), "annotation-selection-menu": e14.annotationSelectionMenu, "redaction-selection-menu": e14.redactionSelectionMenu, "render-page-overlay": M2 }, null, 8, ["item", "features", "show-note-markers", "show-bookmark-markers", "show-redaction-layer", "note-marker-ui", "bookmark-marker-ui", "build-selection-menu", "create-note", "annotation-selection-menu", "redaction-selection-menu"])];
8618
+ return [createVNode(Ha, { item: t3, features: e14.features, "show-note-markers": p2.value, "show-bookmark-markers": m2.value, "show-redaction-layer": e14.showRedactionLayer, "note-marker-ui": (_b = (_a2 = e14.features) == null ? void 0 : _a2.notes) == null ? void 0 : _b.marker, "bookmark-marker-ui": (_d = (_c = e14.features) == null ? void 0 : _c.bookmarks) == null ? void 0 : _d.marker, "build-selection-menu": C2.value, "create-note": unref(i2), "annotation-selection-menu": e14.annotationSelectionMenu, "redaction-selection-menu": e14.redactionSelectionMenu, "render-page-overlay": M2 }, null, 8, ["item", "features", "show-note-markers", "show-bookmark-markers", "show-redaction-layer", "note-marker-ui", "bookmark-marker-ui", "build-selection-menu", "create-note", "annotation-selection-menu", "redaction-selection-menu"])];
8606
8619
  }), _: 1 }, 8, ["class", "style"]), renderSlot(t2.$slots, "default")], 6));
8607
- } }), ii = { key: 0, style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0, width: "100%" } }, oi = /* @__PURE__ */ defineComponent({ __name: "ChapterPdfViewer", props: { engine: {}, options: {}, editorOptions: {}, features: {}, className: {}, viewportClassName: {}, onExtraSelectionAction: { type: Function } }, setup(e14) {
8620
+ } }), di = { key: 0, style: { display: "flex", flexDirection: "column", height: "100%", minHeight: 0, width: "100%" } }, ci = /* @__PURE__ */ defineComponent({ __name: "ChapterPdfViewer", props: { engine: {}, options: {}, editorOptions: {}, features: {}, className: {}, viewportClassName: {}, onExtraSelectionAction: { type: Function } }, setup(e14) {
8608
8621
  const s2 = e14, r9 = computed(() => (function(e15) {
8609
8622
  if (e15.options) return _r(e15.options);
8610
8623
  if (!e15.editorOptions) throw new Error("ChapterPdfViewer: 请传入 `options`(推荐),或同时传入 `editorOptions` 与 `features`");
8611
8624
  const t2 = ke$1(e15.features), s3 = { ...e15.editorOptions, prefetchChapters: e15.editorOptions.prefetchChapters ?? Rr.prefetchChapters, maxConcurrentSegmentLoads: e15.editorOptions.maxConcurrentSegmentLoads ?? Rr.maxConcurrentSegmentLoads, unloadTimeoutMs: e15.editorOptions.unloadTimeoutMs ?? Rr.unloadTimeoutMs, features: t2 }, { plugins: r10 } = zr(s3);
8612
8625
  return { plugins: r10, features: t2, editorOptions: s3 };
8613
8626
  })({ engine: s2.engine, options: s2.options, editorOptions: s2.editorOptions, features: s2.features }));
8614
- return (t2, s3) => (openBlock(), createElementBlock("div", { class: normalizeClass(e14.className), style: normalizeStyle(e14.className ? void 0 : unref(Ie$1)) }, [createVNode(unref(EmbedPDF), { engine: e14.engine, plugins: r9.value.plugins }, { default: withCtx(({ pluginsReady: s4 }) => [s4 ? (openBlock(), createElementBlock("div", ii, [renderSlot(t2.$slots, "prepend"), createVNode(ai, { class: normalizeClass(e14.viewportClassName), style: { flex: 1, minHeight: 0 }, features: r9.value.features, "on-extra-selection-action": e14.onExtraSelectionAction }, null, 8, ["class", "features", "on-extra-selection-action"]), renderSlot(t2.$slots, "default")])) : createCommentVNode("", true)]), _: 3 }, 8, ["engine", "plugins"])], 6));
8615
- } }), li = { class: "chapter-tree-row" }, hi = ["aria-expanded"], di = { key: 1, class: "chapter-tree-toggle-spacer", "aria-hidden": "" }, ci = { class: "chapter-tree-label" }, ui = { class: "chapter-tree-meta" }, pi = { key: 0 }, gi = (e14, t2) => {
8627
+ return (t2, s3) => (openBlock(), createElementBlock("div", { class: normalizeClass(e14.className), style: normalizeStyle(e14.className ? void 0 : unref(Ie$1)) }, [createVNode(unref(EmbedPDF), { engine: e14.engine, plugins: r9.value.plugins }, { default: withCtx(({ pluginsReady: s4 }) => [s4 ? (openBlock(), createElementBlock("div", di, [renderSlot(t2.$slots, "prepend"), createVNode(hi, { class: normalizeClass(e14.viewportClassName), style: { flex: 1, minHeight: 0 }, features: r9.value.features, "on-extra-selection-action": e14.onExtraSelectionAction }, null, 8, ["class", "features", "on-extra-selection-action"]), renderSlot(t2.$slots, "default")])) : createCommentVNode("", true)]), _: 3 }, 8, ["engine", "plugins"])], 6));
8628
+ } }), ui = { class: "chapter-tree-row" }, pi = ["aria-expanded"], gi = { key: 1, class: "chapter-tree-toggle-spacer", "aria-hidden": "" }, mi = { class: "chapter-tree-label" }, fi = { class: "chapter-tree-meta" }, vi = { key: 0 }, Ii = (e14, t2) => {
8616
8629
  const s2 = e14.__vccOpts || e14;
8617
8630
  for (const [r9, n2] of t2) s2[r9] = n2;
8618
8631
  return s2;
8619
- }, mi = /* @__PURE__ */ gi(/* @__PURE__ */ defineComponent({ __name: "ChapterTreeItem", props: { node: {}, depth: {}, activeChapterId: {}, chapterStatus: {} }, emits: ["select"], setup(e14) {
8632
+ }, Pi = /* @__PURE__ */ Ii(/* @__PURE__ */ defineComponent({ __name: "ChapterTreeItem", props: { node: {}, depth: {}, activeChapterId: {}, chapterStatus: {} }, emits: ["select"], setup(e14) {
8620
8633
  const r9 = { idle: "未加载", loading: "加载中", loaded: "已加载", closed: "已卸载", error: "失败", "password-required": "需密码" }, n2 = e14, a2 = computed(() => n2.node.children ?? []), i2 = computed(() => a2.value.length > 0), h2 = ref(n2.depth < 1), u2 = computed(() => n2.activeChapterId === n2.node.id), p2 = computed(() => n2.chapterStatus[n2.node.id] ?? "idle"), g2 = computed(() => !i2.value);
8621
- return (t2, s2) => (openBlock(), createElementBlock("li", null, [createElementVNode("div", li, [i2.value ? (openBlock(), createElementBlock("button", { key: 0, type: "button", class: "chapter-tree-toggle", "aria-expanded": h2.value, onClick: s2[0] || (s2[0] = (e15) => h2.value = !h2.value) }, toDisplayString(h2.value ? "▼" : "▶"), 9, hi)) : (openBlock(), createElementBlock("span", di)), createElementVNode("button", { type: "button", class: normalizeClass(["chapter-tree-btn", { "chapter-tree-btn-active": u2.value }]), onClick: s2[1] || (s2[1] = (s3) => t2.$emit("select", e14.node.id)) }, [createElementVNode("div", ci, toDisplayString(e14.node.title), 1), createElementVNode("div", ui, [createElementVNode("span", null, " 第 " + toDisplayString(e14.node.startPage) + toDisplayString(e14.node.endPage !== e14.node.startPage ? `–${e14.node.endPage}` : "") + " 页 ", 1), g2.value ? (openBlock(), createElementBlock("span", pi, toDisplayString(r9[p2.value]), 1)) : createCommentVNode("", true)])], 2)]), i2.value && h2.value ? (openBlock(), createBlock(fi, { key: 0, nodes: a2.value, depth: e14.depth + 1, "active-chapter-id": e14.activeChapterId, "chapter-status": e14.chapterStatus, onSelect: s2[2] || (s2[2] = (e15) => t2.$emit("select", e15)) }, null, 8, ["nodes", "depth", "active-chapter-id", "chapter-status"])) : createCommentVNode("", true)]));
8622
- } }), [["__scopeId", "data-v-315bbf7a"]]), fi = /* @__PURE__ */ gi(/* @__PURE__ */ defineComponent({ __name: "ChapterTreeList", props: { nodes: {}, depth: {}, activeChapterId: {}, chapterStatus: {} }, emits: ["select"], setup: (e14) => (t2, s2) => (openBlock(), createElementBlock("ul", { class: "chapter-tree-list", style: normalizeStyle({ marginLeft: e14.depth > 0 ? "12px" : "0" }) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(e14.nodes, (r9) => (openBlock(), createBlock(mi, { key: r9.id, node: r9, depth: e14.depth, "active-chapter-id": e14.activeChapterId, "chapter-status": e14.chapterStatus, onSelect: s2[0] || (s2[0] = (e15) => t2.$emit("select", e15)) }, null, 8, ["node", "depth", "active-chapter-id", "chapter-status"]))), 128))], 4)) }), [["__scopeId", "data-v-eb742e4f"]]), vi = { class: "chapter-tree" }, Ii = { class: "chapter-tree-nav", "aria-label": "章节目录" }, Pi = /* @__PURE__ */ gi(/* @__PURE__ */ defineComponent({ __name: "ChapterTreePanel", props: { tree: {}, activeChapterId: {} }, emits: ["active-chapter-change"], setup(e14, { emit: t2 }) {
8634
+ return (t2, s2) => (openBlock(), createElementBlock("li", null, [createElementVNode("div", ui, [i2.value ? (openBlock(), createElementBlock("button", { key: 0, type: "button", class: "chapter-tree-toggle", "aria-expanded": h2.value, onClick: s2[0] || (s2[0] = (e15) => h2.value = !h2.value) }, toDisplayString(h2.value ? "▼" : "▶"), 9, pi)) : (openBlock(), createElementBlock("span", gi)), createElementVNode("button", { type: "button", class: normalizeClass(["chapter-tree-btn", { "chapter-tree-btn-active": u2.value }]), onClick: s2[1] || (s2[1] = (s3) => t2.$emit("select", e14.node.id)) }, [createElementVNode("div", mi, toDisplayString(e14.node.title), 1), createElementVNode("div", fi, [createElementVNode("span", null, " 第 " + toDisplayString(e14.node.startPage) + toDisplayString(e14.node.endPage !== e14.node.startPage ? `–${e14.node.endPage}` : "") + " 页 ", 1), g2.value ? (openBlock(), createElementBlock("span", vi, toDisplayString(r9[p2.value]), 1)) : createCommentVNode("", true)])], 2)]), i2.value && h2.value ? (openBlock(), createBlock(Si, { key: 0, nodes: a2.value, depth: e14.depth + 1, "active-chapter-id": e14.activeChapterId, "chapter-status": e14.chapterStatus, onSelect: s2[2] || (s2[2] = (e15) => t2.$emit("select", e15)) }, null, 8, ["nodes", "depth", "active-chapter-id", "chapter-status"])) : createCommentVNode("", true)]));
8635
+ } }), [["__scopeId", "data-v-315bbf7a"]]), Si = /* @__PURE__ */ Ii(/* @__PURE__ */ defineComponent({ __name: "ChapterTreeList", props: { nodes: {}, depth: {}, activeChapterId: {}, chapterStatus: {} }, emits: ["select"], setup: (e14) => (t2, s2) => (openBlock(), createElementBlock("ul", { class: "chapter-tree-list", style: normalizeStyle({ marginLeft: e14.depth > 0 ? "12px" : "0" }) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(e14.nodes, (r9) => (openBlock(), createBlock(Pi, { key: r9.id, node: r9, depth: e14.depth, "active-chapter-id": e14.activeChapterId, "chapter-status": e14.chapterStatus, onSelect: s2[0] || (s2[0] = (e15) => t2.$emit("select", e15)) }, null, 8, ["node", "depth", "active-chapter-id", "chapter-status"]))), 128))], 4)) }), [["__scopeId", "data-v-eb742e4f"]]), bi = { class: "chapter-tree" }, Ci = { class: "chapter-tree-nav", "aria-label": "章节目录" }, yi = /* @__PURE__ */ Ii(/* @__PURE__ */ defineComponent({ __name: "ChapterTreePanel", props: { tree: {}, activeChapterId: {} }, emits: ["active-chapter-change"], setup(e14, { emit: t2 }) {
8623
8636
  const a2 = e14, i2 = t2, { provides: h2 } = useCapability(Et$1.id), { provides: d2 } = useCapability(rt$1.id), u2 = ref({});
8624
8637
  function p2() {
8625
8638
  if (!d2.value) return;
@@ -8637,7 +8650,7 @@ const ai = /* @__PURE__ */ defineComponent({ __name: "PdfChapterViewport", props
8637
8650
  }
8638
8651
  return watch(d2, (e15) => {
8639
8652
  g2 == null ? void 0 : g2(), g2 = e15 ? e15.onChapterStatusChange(p2) : null;
8640
- }, { immediate: true }), onBeforeUnmount(() => g2 == null ? void 0 : g2()), (t3, s2) => (openBlock(), createElementBlock("aside", vi, [s2[0] || (s2[0] = createElementVNode("h2", { class: "chapter-tree-title" }, "章节目录", -1)), createElementVNode("nav", Ii, [createVNode(fi, { nodes: e14.tree, depth: 0, "active-chapter-id": e14.activeChapterId, "chapter-status": u2.value, onSelect: m2 }, null, 8, ["nodes", "active-chapter-id", "chapter-status"])])]));
8653
+ }, { immediate: true }), onBeforeUnmount(() => g2 == null ? void 0 : g2()), (t3, s2) => (openBlock(), createElementBlock("aside", bi, [s2[0] || (s2[0] = createElementVNode("h2", { class: "chapter-tree-title" }, "章节目录", -1)), createElementVNode("nav", Ci, [createVNode(Si, { nodes: e14.tree, depth: 0, "active-chapter-id": e14.activeChapterId, "chapter-status": u2.value, onSelect: m2 }, null, 8, ["nodes", "active-chapter-id", "chapter-status"])])]));
8641
8654
  } }), [["__scopeId", "data-v-d7a0838d"]]);
8642
8655
  const _sfc_main = /* @__PURE__ */ defineComponent({
8643
8656
  __name: "ChapterPdfViewer",
@@ -8651,7 +8664,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
8651
8664
  },
8652
8665
  setup(__props) {
8653
8666
  return (_ctx, _cache) => {
8654
- return openBlock(), createBlock(unref(oi), normalizeProps(guardReactiveProps(_ctx.$props)), createSlots({
8667
+ return openBlock(), createBlock(unref(ci), normalizeProps(guardReactiveProps(_ctx.$props)), createSlots({
8655
8668
  default: withCtx(() => [
8656
8669
  renderSlot(_ctx.$slots, "default")
8657
8670
  ]),
@@ -13764,39 +13777,53 @@ function ys(e14) {
13764
13777
  }
13765
13778
  PdfAnnotationSubtype.HIGHLIGHT, PdfAnnotationSubtype.UNDERLINE, PdfAnnotationSubtype.SQUIGGLY, PdfAnnotationSubtype.STRIKEOUT, PdfAnnotationSubtype.HIGHLIGHT, PdfAnnotationSubtype.UNDERLINE, PdfAnnotationSubtype.SQUIGGLY, PdfAnnotationSubtype.STRIKEOUT;
13766
13779
  ys();
13767
- async function Os(e14) {
13780
+ const As = "embedpdf-chapter-copy-toast";
13781
+ async function Ns(e14, t2) {
13768
13782
  var _a2;
13769
- const t2 = e14.trim();
13770
- if (!t2) return false;
13783
+ const s2 = e14.trim();
13784
+ if (!s2) return false;
13785
+ const r9 = () => {
13786
+ false !== (t2 == null ? void 0 : t2.toastMessage) && (function(e15 = "已复制") {
13787
+ var _a3;
13788
+ if ("undefined" == typeof document) return;
13789
+ (_a3 = document.getElementById(As)) == null ? void 0 : _a3.remove();
13790
+ const t3 = document.createElement("div");
13791
+ t3.id = As, t3.setAttribute("role", "status"), t3.setAttribute("aria-live", "polite"), t3.textContent = e15, Object.assign(t3.style, { position: "fixed", left: "50%", bottom: "48px", transform: "translateX(-50%)", padding: "10px 18px", borderRadius: "8px", background: "rgba(15, 23, 42, 0.88)", color: "#fff", fontSize: "13px", lineHeight: "1.4", fontFamily: "system-ui, -apple-system, sans-serif", zIndex: "99999", pointerEvents: "none", boxShadow: "0 4px 16px rgba(15, 23, 42, 0.2)", opacity: "0", transition: "opacity 200ms ease" }), document.body.appendChild(t3), requestAnimationFrame(() => {
13792
+ t3.style.opacity = "1";
13793
+ }), window.setTimeout(() => {
13794
+ t3.style.opacity = "0", window.setTimeout(() => t3.remove(), 200);
13795
+ }, 1800);
13796
+ })((t2 == null ? void 0 : t2.toastMessage) ?? "已复制");
13797
+ };
13771
13798
  try {
13772
- if ("undefined" != typeof navigator && ((_a2 = navigator.clipboard) == null ? void 0 : _a2.writeText)) return await navigator.clipboard.writeText(t2), true;
13799
+ if ("undefined" != typeof navigator && ((_a2 = navigator.clipboard) == null ? void 0 : _a2.writeText)) return await navigator.clipboard.writeText(s2), r9(), true;
13773
13800
  } catch {
13774
13801
  }
13775
13802
  if ("undefined" == typeof document) return false;
13776
13803
  try {
13777
13804
  const e15 = document.createElement("textarea");
13778
- e15.value = t2, e15.setAttribute("readonly", ""), e15.style.position = "fixed", e15.style.left = "-9999px", document.body.appendChild(e15), e15.select();
13779
- const s2 = document.execCommand("copy");
13780
- return document.body.removeChild(e15), s2;
13805
+ e15.value = s2, e15.setAttribute("readonly", ""), e15.style.position = "fixed", e15.style.left = "-9999px", document.body.appendChild(e15), e15.select();
13806
+ const t3 = document.execCommand("copy");
13807
+ return document.body.removeChild(e15), t3 && r9(), t3;
13781
13808
  } catch {
13782
13809
  return false;
13783
13810
  }
13784
13811
  }
13785
- const Rs = 1;
13786
- function zs(e14) {
13812
+ const zs = 1;
13813
+ function Gs(e14) {
13787
13814
  const t2 = new Uint8Array(e14);
13788
13815
  let s2 = "";
13789
13816
  for (let r9 = 0; r9 < t2.length; r9++) s2 += String.fromCharCode(t2[r9]);
13790
13817
  return btoa(s2);
13791
13818
  }
13792
- function Gs(e14) {
13819
+ function Bs(e14) {
13793
13820
  return e14.map((e15) => {
13794
13821
  if (!(e15.ctx && "data" in e15.ctx && e15.ctx.data instanceof ArrayBuffer)) return { annotation: e15.annotation };
13795
13822
  const t2 = e15.ctx;
13796
- return { annotation: e15.annotation, ctx: { dataBase64: zs(t2.data), mimeType: t2.mimeType } };
13823
+ return { annotation: e15.annotation, ctx: { dataBase64: Gs(t2.data), mimeType: t2.mimeType } };
13797
13824
  });
13798
13825
  }
13799
- function Bs(e14) {
13826
+ function _s(e14) {
13800
13827
  return e14.map((e15) => {
13801
13828
  var _a2;
13802
13829
  if (!((_a2 = e15.ctx) == null ? void 0 : _a2.dataBase64)) return { annotation: e15.annotation };
@@ -13808,26 +13835,26 @@ function Bs(e14) {
13808
13835
  return { annotation: e15.annotation, ctx: { data: t2, ...e15.ctx.mimeType ? { mimeType: e15.ctx.mimeType } : {} } };
13809
13836
  });
13810
13837
  }
13811
- function _s(e14) {
13838
+ function Ws2(e14) {
13812
13839
  return { bookmarks: false !== (e14 == null ? void 0 : e14.bookmarks), notes: false !== (e14 == null ? void 0 : e14.notes), markup: false !== (e14 == null ? void 0 : e14.markup) };
13813
13840
  }
13814
- function Ws2(e14) {
13841
+ function qs(e14) {
13815
13842
  return new Promise((t2, s2) => {
13816
13843
  e14.wait((e15) => t2(e15), (e15) => s2(e15));
13817
13844
  });
13818
13845
  }
13819
- function qs(e14) {
13846
+ function Hs(e14) {
13820
13847
  var _a2, _b, _c, _d;
13821
13848
  const t2 = (_a2 = e14.getPlugin(AnnotationPlugin.id)) == null ? void 0 : _a2.provides(), s2 = (_b = e14.getPlugin(ut.id)) == null ? void 0 : _b.provides(), r9 = (_c = e14.getPlugin(cs.id)) == null ? void 0 : _c.provides(), n2 = (_d = e14.getPlugin(B.id)) == null ? void 0 : _d.provides();
13822
13849
  return { annotation: t2, note: s2, bookmark: r9, chapterManager: n2 };
13823
13850
  }
13824
- async function Hs(e14, t2, s2) {
13851
+ async function Ks(e14, t2, s2) {
13825
13852
  if (!s2 || !e14) return;
13826
13853
  const r9 = e14.getSegmentPlan(t2) ? await e14.ensureAllSegmentsLoaded(t2) : await e14.ensureChapterLoaded(t2);
13827
13854
  if ("loaded" !== r9) throw new Error(`章节 ${t2} 未加载成功(${r9}),无法导入/导出划线`);
13828
13855
  }
13829
- async function Ks(e14, t2, s2) {
13830
- const r9 = _s(s2), { annotation: n2, note: a2, bookmark: i2, chapterManager: o2 } = qs(e14), h2 = { chapterId: t2 };
13856
+ async function js(e14, t2, s2) {
13857
+ const r9 = Ws2(s2), { annotation: n2, note: a2, bookmark: i2, chapterManager: o2 } = Hs(e14), h2 = { chapterId: t2 };
13831
13858
  if (r9.bookmarks) {
13832
13859
  if (!i2) throw new Error("paragraph-bookmark 插件未注册");
13833
13860
  h2.bookmarks = i2.listBookmarksForChapter(t2);
@@ -13838,14 +13865,14 @@ async function Ks(e14, t2, s2) {
13838
13865
  }
13839
13866
  if (r9.markup) {
13840
13867
  if (!n2) throw new Error("annotation 插件未注册");
13841
- await Hs(o2, t2, false !== (s2 == null ? void 0 : s2.ensureChapterLoaded));
13868
+ await Ks(o2, t2, false !== (s2 == null ? void 0 : s2.ensureChapterLoaded));
13842
13869
  const e15 = await (async function(e16, t3, s3) {
13843
13870
  const r10 = t3.getSegmentPlan(s3);
13844
- if (!r10) return Ws2(e16.forDocument(s3).exportAnnotations());
13871
+ if (!r10) return qs(e16.forDocument(s3).exportAnnotations());
13845
13872
  const n3 = [];
13846
13873
  for (const a3 of r10.segments) {
13847
13874
  if (!t3.isSegmentLoaded(s3, a3.index)) continue;
13848
- const r11 = await Ws2(e16.forDocument(a3.documentId).exportAnnotations());
13875
+ const r11 = await qs(e16.forDocument(a3.documentId).exportAnnotations());
13849
13876
  for (const e17 of r11) {
13850
13877
  const t4 = e17.annotation.pageIndex;
13851
13878
  n3.push({ ...e17, annotation: { ...e17.annotation, pageIndex: t4 + a3.localPageStart } });
@@ -13853,20 +13880,20 @@ async function Ks(e14, t2, s2) {
13853
13880
  }
13854
13881
  return n3;
13855
13882
  })(n2, o2, t2);
13856
- h2.markup = Gs(e15);
13883
+ h2.markup = Bs(e15);
13857
13884
  }
13858
13885
  return h2;
13859
13886
  }
13860
- async function js(e14, t2, s2) {
13887
+ async function Xs(e14, t2, s2) {
13861
13888
  const r9 = {};
13862
13889
  for (const n2 of t2.chapters) {
13863
- const t3 = await Ks(e14, n2.chapterId, s2), { chapterId: a2, ...i2 } = t3;
13890
+ const t3 = await js(e14, n2.chapterId, s2), { chapterId: a2, ...i2 } = t3;
13864
13891
  r9[n2.chapterId] = i2;
13865
13892
  }
13866
13893
  return { version: 1, exportedAt: /* @__PURE__ */ (/* @__PURE__ */ new Date()).toISOString(), chapters: r9 };
13867
13894
  }
13868
- async function Xs(e14, t2, s2) {
13869
- const r9 = _s(s2), n2 = (s2 == null ? void 0 : s2.mode) ?? "replace", { annotation: a2, note: i2, bookmark: o2, chapterManager: h2 } = qs(e14), l = t2.chapterId;
13895
+ async function Js(e14, t2, s2) {
13896
+ const r9 = Ws2(s2), n2 = (s2 == null ? void 0 : s2.mode) ?? "replace", { annotation: a2, note: i2, bookmark: o2, chapterManager: h2 } = Hs(e14), l = t2.chapterId;
13870
13897
  if (r9.bookmarks && t2.bookmarks) {
13871
13898
  if (!o2) throw new Error("paragraph-bookmark 插件未注册");
13872
13899
  if ("replace" === n2) o2.replaceBookmarksForChapter(l, t2.bookmarks);
@@ -13879,7 +13906,7 @@ async function Xs(e14, t2, s2) {
13879
13906
  }
13880
13907
  if (r9.markup && t2.markup) {
13881
13908
  if (!a2) throw new Error("annotation 插件未注册");
13882
- await Hs(h2, l, false !== (s2 == null ? void 0 : s2.ensureChapterLoaded));
13909
+ await Ks(h2, l, false !== (s2 == null ? void 0 : s2.ensureChapterLoaded));
13883
13910
  !(function(e15, t3, s3, r10, n3) {
13884
13911
  const a3 = t3.getSegmentPlan(s3);
13885
13912
  if (!a3) {
@@ -13899,39 +13926,39 @@ async function Xs(e14, t2, s2) {
13899
13926
  const t4 = e15.forDocument(h3.documentId), s4 = o3.get(h3.index) ?? [];
13900
13927
  "replace" === n3 && t4.deleteAllAnnotations(), s4.length > 0 && t4.importAnnotations(s4);
13901
13928
  }
13902
- })(a2, h2, l, Bs(t2.markup), n2);
13929
+ })(a2, h2, l, _s(t2.markup), n2);
13903
13930
  }
13904
13931
  (s2 == null ? void 0 : s2.persistNotes) && i2 && await s2.persistNotes(i2.listAllNotes()), (s2 == null ? void 0 : s2.persistBookmarks) && o2 && await s2.persistBookmarks(o2.listBookmarks());
13905
13932
  }
13906
- async function Js(e14, t2, s2) {
13933
+ async function Qs(e14, t2, s2) {
13907
13934
  if (1 !== t2.version) throw new Error(`不支持的归档版本 ${t2.version},当前为 1`);
13908
- for (const [r9, n2] of Object.entries(t2.chapters)) await Xs(e14, { chapterId: r9, ...n2 }, s2);
13935
+ for (const [r9, n2] of Object.entries(t2.chapters)) await Js(e14, { chapterId: r9, ...n2 }, s2);
13909
13936
  }
13910
- function Qs(e14) {
13937
+ function Ys(e14) {
13911
13938
  return JSON.stringify(e14, null, 2);
13912
13939
  }
13913
- function Ys(e14) {
13940
+ function Zs(e14) {
13914
13941
  const t2 = JSON.parse(e14);
13915
13942
  if (!t2 || "object" != typeof t2 || !t2.chapters) throw new Error("无效的章节标注 JSON");
13916
13943
  return t2;
13917
13944
  }
13918
- function Zs(e14) {
13945
+ function er(e14) {
13919
13946
  return JSON.stringify(e14, null, 2);
13920
13947
  }
13921
- function er(e14) {
13948
+ function tr(e14) {
13922
13949
  const t2 = JSON.parse(e14);
13923
13950
  if (!(t2 == null ? void 0 : t2.chapterId)) throw new Error("无效的章节标注 JSON:缺少 chapterId");
13924
13951
  return t2;
13925
13952
  }
13926
- function tr(e14, t2) {
13953
+ function sr(e14, t2) {
13927
13954
  const s2 = new Blob([t2], { type: "application/json;charset=utf-8" }), r9 = URL.createObjectURL(s2), n2 = document.createElement("a");
13928
13955
  n2.href = r9, n2.download = e14, n2.click(), URL.revokeObjectURL(r9);
13929
13956
  }
13930
- function sr(e14, t2 = "chapter-annotations.json") {
13931
- tr(t2, Qs(e14));
13957
+ function rr(e14, t2 = "chapter-annotations.json") {
13958
+ sr(t2, Ys(e14));
13932
13959
  }
13933
- function rr(e14, t2) {
13934
- tr(t2 ?? `chapter-annotations-${e14.chapterId}.json`, Zs(e14));
13960
+ function nr(e14, t2) {
13961
+ sr(t2 ?? `chapter-annotations-${e14.chapterId}.json`, er(e14));
13935
13962
  }
13936
13963
  const DEFAULT_CHAPTER_TEXT_SELECTION_BACKGROUND = "rgba(33, 150, 243)";
13937
13964
  ({
@@ -14947,39 +14974,39 @@ function M(e14) {
14947
14974
  return { tree: G(e14), manifest: { chapters: C(e14) } };
14948
14975
  }
14949
14976
  export {
14950
- Rs as CHAPTER_ANNOTATIONS_ARCHIVE_VERSION,
14977
+ zs as CHAPTER_ANNOTATIONS_ARCHIVE_VERSION,
14951
14978
  Ae$1 as CallbackPasswordProvider,
14952
14979
  ChapterManagerPlugin,
14953
14980
  _sfc_main as ChapterPdfViewer,
14954
- Pi as ChapterTreePanel,
14981
+ yi as ChapterTreePanel,
14955
14982
  DEFAULT_CHAPTER_TEXT_SELECTION_BACKGROUND,
14956
14983
  Nr as DEFAULT_CHAPTER_VIEWER_CONFIG,
14957
14984
  Or as DEFAULT_CHAPTER_VIEWER_FEATURES,
14958
14985
  EmbedPDF2 as EmbedPDF,
14959
- ai as PdfChapterViewport,
14986
+ hi as PdfChapterViewport,
14960
14987
  Me$1 as applySelectionMarkup,
14961
14988
  M as buildChapterViewerCatalog,
14962
14989
  xr as buildParagraphBookmarkAnchor,
14963
- Qs as chapterAnnotationsArchiveToJson,
14964
- Zs as chapterAnnotationsSnapshotToJson,
14990
+ Ys as chapterAnnotationsArchiveToJson,
14991
+ er as chapterAnnotationsSnapshotToJson,
14965
14992
  R2 as chapterDescriptorFromTreeNode,
14966
- Os as copyTextToClipboard,
14993
+ Ns as copyTextToClipboard,
14967
14994
  _r as createChapterViewerBundle,
14968
14995
  zr as createChapterViewerEditor,
14969
14996
  Wr as createChapterViewerEditorOptions,
14970
14997
  Tr as createPdfChapterEditor,
14971
14998
  m as defaultOverlapStrategy,
14972
- sr as downloadChapterAnnotationsArchive,
14973
- rr as downloadChapterAnnotationsSnapshot,
14974
- tr as downloadJsonFile,
14975
- js as exportAllChapterAnnotations,
14976
- Ks as exportChapterAnnotations,
14999
+ rr as downloadChapterAnnotationsArchive,
15000
+ nr as downloadChapterAnnotationsSnapshot,
15001
+ sr as downloadJsonFile,
15002
+ Xs as exportAllChapterAnnotations,
15003
+ js as exportChapterAnnotations,
14977
15004
  C as flattenChapterTree,
14978
- Xs as importChapterAnnotations,
14979
- Js as importChapterAnnotationsArchive,
15005
+ Js as importChapterAnnotations,
15006
+ Qs as importChapterAnnotationsArchive,
14980
15007
  _ as overlapStrategyForSamePageOwner,
14981
- Ys as parseChapterAnnotationsArchiveJson,
14982
- er as parseChapterAnnotationsSnapshotJson,
15008
+ Zs as parseChapterAnnotationsArchiveJson,
15009
+ tr as parseChapterAnnotationsSnapshotJson,
14983
15010
  G as toChapterTreeNodes,
14984
15011
  useCapability2 as useCapability,
14985
15012
  usePdfiumEngine,