@embedpdf-editor/vue3-chapter-viewer 1.0.9-beta.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +39 -39
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -498,7 +498,7 @@ export declare interface ChapterViewerOptions {
|
|
|
498
498
|
overlapStrategy?: OverlapOwnerStrategy;
|
|
499
499
|
/** manifest 就绪后预取前 N 章第 0 段;滚动时另会预取视口相邻章。默认 1 */
|
|
500
500
|
prefetchChapters?: number;
|
|
501
|
-
/** 滚动按需同时 open 的分段 PDF 上限。默认
|
|
501
|
+
/** 滚动按需同时 open 的分段 PDF 上限。默认 1 */
|
|
502
502
|
maxConcurrentSegmentLoads?: number;
|
|
503
503
|
/** 章节空闲卸载超时(ms)。默认 120000 */
|
|
504
504
|
unloadTimeoutMs?: number;
|
package/dist/index.js
CHANGED
|
@@ -2193,7 +2193,7 @@ function os(e14) {
|
|
|
2193
2193
|
}
|
|
2194
2194
|
return { chapterId: e14.chapterId, threshold: t2, pageCount: s2, segments: a2 };
|
|
2195
2195
|
}
|
|
2196
|
-
function ls(e14, t2) {
|
|
2196
|
+
function ls$1(e14, t2) {
|
|
2197
2197
|
const s2 = os(e14);
|
|
2198
2198
|
if (!s2) return { documentId: e14.chapterId, pageIndex: t2 };
|
|
2199
2199
|
const n9 = s2.segments.find((e15) => t2 >= e15.localPageStart && t2 <= e15.localPageEnd);
|
|
@@ -2209,7 +2209,7 @@ function hs(e14, t2) {
|
|
|
2209
2209
|
const n9 = s2.segments.find((e15) => t2 >= e15.localPageStart && t2 <= e15.localPageEnd);
|
|
2210
2210
|
return (null == n9 ? void 0 : n9.index) ?? Math.floor(t2 / s2.threshold);
|
|
2211
2211
|
}
|
|
2212
|
-
function ds(e14) {
|
|
2212
|
+
function ds$1(e14) {
|
|
2213
2213
|
var t2;
|
|
2214
2214
|
const s2 = ns(e14);
|
|
2215
2215
|
if (!s2) return [];
|
|
@@ -2242,7 +2242,7 @@ function us$1(e14, t2, s2) {
|
|
|
2242
2242
|
return s2.resolve(e14, t2);
|
|
2243
2243
|
}
|
|
2244
2244
|
}
|
|
2245
|
-
let ps = class {
|
|
2245
|
+
let ps$1 = class ps {
|
|
2246
2246
|
constructor(e14) {
|
|
2247
2247
|
this._pages = e14, this._byChapter = /* @__PURE__ */ new Map(), this._byGlobalNumber = /* @__PURE__ */ new Map();
|
|
2248
2248
|
for (const t2 of e14) {
|
|
@@ -2276,7 +2276,7 @@ let ps = class {
|
|
|
2276
2276
|
return s2 ? this._pages.indexOf(s2) : -1;
|
|
2277
2277
|
}
|
|
2278
2278
|
};
|
|
2279
|
-
function gs(e14, t2 = cs$1) {
|
|
2279
|
+
function gs$1(e14, t2 = cs$1) {
|
|
2280
2280
|
const s2 = (function(e15, t3 = cs$1) {
|
|
2281
2281
|
const s3 = /* @__PURE__ */ new Map();
|
|
2282
2282
|
for (const r3 of e15.chapters) {
|
|
@@ -2299,7 +2299,7 @@ function gs(e14, t2 = cs$1) {
|
|
|
2299
2299
|
const [r3] = t3.globalPageRange, [l] = t3.localPageRange, h2 = l + (o2 - r3);
|
|
2300
2300
|
a2.push({ globalPageIndex: i2++, globalPageNumber: o2, chapterId: e15, localPageIndex: h2 });
|
|
2301
2301
|
}
|
|
2302
|
-
return new ps(a2);
|
|
2302
|
+
return new ps$1(a2);
|
|
2303
2303
|
}
|
|
2304
2304
|
const ms = class e4 extends BasePlugin {
|
|
2305
2305
|
constructor(e14, t2) {
|
|
@@ -2325,7 +2325,7 @@ const ms = class e4 extends BasePlugin {
|
|
|
2325
2325
|
t2 && (this.overlapStrategy = t2), this.setManifestInternal(e14);
|
|
2326
2326
|
}, getManifest: () => this.manifest, getVirtualPageMap: () => this.virtualPageMap, setVisibleGlobalPages: (e14) => this.handleVisibleChange(e14), visibleRangeNeedsSegmentLoad: (e14) => this.visibleRangeNeedsSegmentLoad(e14), shouldShowChapterLoadError: (e14, t2) => this.shouldShowChapterLoadError(e14, t2), ensureChapterLoaded: (e14) => this.ensureChapterLoaded(e14), ensureSegmentLoaded: (e14, t2) => this.ensureSegmentLoaded(e14, t2), ensureAllSegmentsLoaded: (e14) => this.ensureAllSegmentsLoaded(e14), resolvePageDocument: (e14, t2) => {
|
|
2327
2327
|
const s2 = this.findChapter(e14);
|
|
2328
|
-
return s2 ? ls(s2, t2) : null;
|
|
2328
|
+
return s2 ? ls$1(s2, t2) : null;
|
|
2329
2329
|
}, getSegmentPlan: (e14) => {
|
|
2330
2330
|
const t2 = this.findChapter(e14);
|
|
2331
2331
|
return t2 ? os(t2) : null;
|
|
@@ -2360,7 +2360,7 @@ const ms = class e4 extends BasePlugin {
|
|
|
2360
2360
|
s3.has(n10.chapterId) && t3.push(`Duplicate chapterId: ${n10.chapterId}`), s3.add(n10.chapterId);
|
|
2361
2361
|
const [e15, r3] = n10.globalPageRange, [a3, i2] = n10.localPageRange;
|
|
2362
2362
|
if (e15 > r3 && t3.push(`${n10.chapterId}: invalid globalPageRange [${e15},${r3}]`), a3 > i2 && t3.push(`${n10.chapterId}: invalid localPageRange [${a3},${i2}]`), r3 - e15 !== i2 - a3 && t3.push(`${n10.chapterId}: page-count mismatch (global ${r3 - e15 + 1} vs local ${i2 - a3 + 1})`), n10.ownedGlobalPages) for (const s4 of n10.ownedGlobalPages) (s4 < e15 || s4 > r3) && t3.push(`${n10.chapterId}: ownedGlobalPages contains ${s4} outside range`);
|
|
2363
|
-
t3.push(...ds(n10));
|
|
2363
|
+
t3.push(...ds$1(n10));
|
|
2364
2364
|
}
|
|
2365
2365
|
return t3;
|
|
2366
2366
|
})(s2);
|
|
@@ -2368,7 +2368,7 @@ const ms = class e4 extends BasePlugin {
|
|
|
2368
2368
|
const r2 = new Set(this.chapterStatus.keys()), a2 = new Set(s2.chapters.map((e14) => e14.chapterId));
|
|
2369
2369
|
for (const e14 of r2) a2.has(e14) || (this.closeChapter(e14), this.chapterStatus.delete(e14), this.chapterErrorMessages.delete(e14), this.chapterUrlsCache.delete(e14), this.pendingChapterUrlsPromises.delete(e14));
|
|
2370
2370
|
for (const e14 of s2.chapters) this.chapterStatus.has(e14.chapterId) || this.chapterStatus.set(e14.chapterId, "idle");
|
|
2371
|
-
this.manifest = s2, this.lastVisibleIndicesKey = "", this.clearVisibleSegmentBacklog(), this.virtualPageMap = gs(s2, this.overlapStrategy), this.manifestChange$.emit({ manifest: s2, map: this.virtualPageMap }), this.eagerPrefetchFromManifest();
|
|
2371
|
+
this.manifest = s2, this.lastVisibleIndicesKey = "", this.clearVisibleSegmentBacklog(), this.virtualPageMap = gs$1(s2, this.overlapStrategy), this.manifestChange$.emit({ manifest: s2, map: this.virtualPageMap }), this.eagerPrefetchFromManifest();
|
|
2372
2372
|
}
|
|
2373
2373
|
eagerPrefetchFromManifest() {
|
|
2374
2374
|
const e14 = this.config.prefetchChapters ?? 0;
|
|
@@ -2547,7 +2547,7 @@ const ms = class e4 extends BasePlugin {
|
|
|
2547
2547
|
if (this.config.autoActivateOnLoad ?? 1) {
|
|
2548
2548
|
const e15 = this.virtualPageMap.atIndex(r2);
|
|
2549
2549
|
if (e15) {
|
|
2550
|
-
const t3 = ls(this.findChapter(e15.chapterId), e15.localPageIndex);
|
|
2550
|
+
const t3 = ls$1(this.findChapter(e15.chapterId), e15.localPageIndex);
|
|
2551
2551
|
if (this.documentManager.provides().isDocumentOpen(t3.documentId)) {
|
|
2552
2552
|
this.documentManager.provides().getActiveDocumentId() !== t3.documentId && this.documentManager.provides().setActiveDocument(t3.documentId);
|
|
2553
2553
|
}
|
|
@@ -2741,8 +2741,8 @@ const ms = class e4 extends BasePlugin {
|
|
|
2741
2741
|
}
|
|
2742
2742
|
};
|
|
2743
2743
|
ms.id = "chapter-manager";
|
|
2744
|
-
let fs
|
|
2745
|
-
function vs
|
|
2744
|
+
let fs = ms;
|
|
2745
|
+
function vs(e14, t2) {
|
|
2746
2746
|
if (e14 === t2) return true;
|
|
2747
2747
|
if (e14.totalHeight !== t2.totalHeight || e14.totalWidth !== t2.totalWidth || e14.pageGap !== t2.pageGap || e14.items.length !== t2.items.length) return false;
|
|
2748
2748
|
for (let s2 = 0; s2 < e14.items.length; s2++) {
|
|
@@ -2751,9 +2751,9 @@ function vs$1(e14, t2) {
|
|
|
2751
2751
|
}
|
|
2752
2752
|
return true;
|
|
2753
2753
|
}
|
|
2754
|
-
const Is
|
|
2754
|
+
const Is = class extends BasePlugin {
|
|
2755
2755
|
constructor(e14, t2) {
|
|
2756
|
-
super(e14, t2), this.layoutChange$ = createBehaviorEmitter(void 0, vs
|
|
2756
|
+
super(e14, t2), this.layoutChange$ = createBehaviorEmitter(void 0, vs), this.visibleChange$ = createBehaviorEmitter(), this.virtualPageMap = null, this.pageSizes = /* @__PURE__ */ new Map(), this.offsets = [], this.totalHeight = 0, this.totalWidth = 0, this.viewportEl = null, this.viewportObservers = null, this.currentVisible = [], this.currentGlobalPageIndex = 0, this.lastLoadIndicesKey = "", this.chapterManagerUnsubs = [], this.chapterManager = this.registry.getPlugin(fs.id), this.documentManager = this.registry.getPlugin(DocumentManagerPlugin.id);
|
|
2757
2757
|
}
|
|
2758
2758
|
async initialize(e14) {
|
|
2759
2759
|
this.config = { placeholderPageHeight: e14.placeholderPageHeight ?? 1200, placeholderPageWidth: e14.placeholderPageWidth ?? 900, bufferSize: e14.bufferSize ?? 2, pageGap: e14.pageGap ?? 20 }, this.virtualPageMap = this.chapterManager.provides().getVirtualPageMap(), this.rebuildOffsets(), this.chapterManagerUnsubs.push(this.chapterManager.provides().onManifestChange(({ map: e15 }) => {
|
|
@@ -2967,11 +2967,11 @@ const Is$1 = class Is extends BasePlugin {
|
|
|
2967
2967
|
s2 && this.scrollToIndex(s2.globalPageIndex, t2);
|
|
2968
2968
|
}
|
|
2969
2969
|
};
|
|
2970
|
-
Is
|
|
2971
|
-
let Ps
|
|
2970
|
+
Is.id = "chapter-scroll";
|
|
2971
|
+
let Ps = Is;
|
|
2972
2972
|
const bs = class e5 extends BasePlugin {
|
|
2973
2973
|
constructor(e14, t2) {
|
|
2974
|
-
super(e14, t2), this.notesChange$ = createBehaviorEmitter([]), this.noteActivated$ = createEmitter(), this.notes = /* @__PURE__ */ new Map(), this.chapterScroll = this.registry.getPlugin(Ps
|
|
2974
|
+
super(e14, t2), this.notesChange$ = createBehaviorEmitter([]), this.noteActivated$ = createEmitter(), this.notes = /* @__PURE__ */ new Map(), this.chapterScroll = this.registry.getPlugin(Ps.id), this.chapterManager = this.registry.getPlugin(Xt$1.id), this.documentManager = this.registry.getPlugin(DocumentManagerPlugin.id);
|
|
2975
2975
|
}
|
|
2976
2976
|
async initialize(t2) {
|
|
2977
2977
|
if (this.config = t2, t2.callbacks.loadNotes) try {
|
|
@@ -4725,7 +4725,7 @@ function Ln(e14) {
|
|
|
4725
4725
|
return { id: "chapter-editor-main-toolbar", position: { placement: "top", slot: "main", order: 0 }, permanent: true, items: [{ type: "spacer", id: "main-spacer-left", flex: true }, { type: "group", id: "mode-group", alignment: "start", gap: 2, items: [...e16.has("view") ? [t4("view", "View", "mode:view")] : [], ...e16.has("annotate") ? [t4("annotate", "Annotate", "mode:annotate")] : [], ...e16.has("shapes") ? [t4("shapes", "Shapes", "mode:shapes")] : [], ...e16.has("insert") ? [t4("insert", "Insert", "mode:insert")] : [], ...e16.has("form") ? [t4("form", "Form", "mode:form")] : [], ...e16.has("redact") ? [t4("redact", "Redact", "mode:redact")] : []] }, { type: "spacer", id: "main-spacer-right", flex: true }] };
|
|
4726
4726
|
})(o3);
|
|
4727
4727
|
return c2 && (d2["chapter-editor-main-toolbar"] = c2), (null == (s3 = e15.extend) ? void 0 : s3.toolbars) && Object.assign(d2, e15.extend.toolbars), { schema: { id: "chapter-pdf-editor-ui", version: "1.0.0", toolbars: d2, menus: (null == (n10 = e15.extend) ? void 0 : n10.menus) ?? {}, sidebars: (null == (r3 = e15.extend) ? void 0 : r3.sidebars) ?? {}, modals: (null == (a3 = e15.extend) ? void 0 : a3.modals) ?? {}, selectionMenus: (null == (i3 = e15.extend) ? void 0 : i3.selectionMenus) ?? {} }, operationRegistry: l };
|
|
4728
|
-
})({ ...t2, enabledModes: s2 }), i2 = { ...n9 ? xn() : {}, ...n9 ? $n(a2.list()) : {}, ...e14.commands ?? {} }, o2 = [createPluginRegistration(DocumentManagerPluginPackage, { initialDocuments: [] }), createPluginRegistration(rt$1, { manifest: e14.manifest, overlapStrategy: e14.overlapStrategy, passwordProvider: e14.passwordProvider, chapterPdfLoader: e14.chapterPdfLoader, prefetchChapters: e14.prefetchChapters, maxConcurrentSegmentLoads: e14.maxConcurrentSegmentLoads, unloadTimeoutMs: e14.unloadTimeoutMs }), createPluginRegistration(Ut$1, { placeholderPageHeight: e14.placeholderPageHeight, placeholderPageWidth: e14.placeholderPageWidth }), createPluginRegistration(InteractionManagerPluginPackage), createPluginRegistration(RenderPluginPackage), createPluginRegistration(RotatePluginPackage), createPluginRegistration(SelectionPluginPackage, { marquee: { enabled: false }, toleranceFactor: 1.2, minSelectionDragDistance: 4 }), createPluginRegistration(HistoryPluginPackage), createPluginRegistration(AnnotationPluginPackage), createPluginRegistration(RedactionPluginPackage), createPluginRegistration(FormPluginPackage), createPluginRegistration(StampPluginPackage, false === e14.loadDefaultStampLibrary ? { manifests: [] } : void 0), createPluginRegistration(SignaturePluginPackage), ...Object.keys(i2).length > 0 ? [createPluginRegistration(CommandsPluginPackage, { commands: i2 })] : [], ...n9 ? [createPluginRegistration(I18nPluginPackage), createPluginRegistration(UIPluginPackage, { schema: r2 })] : []];
|
|
4728
|
+
})({ ...t2, enabledModes: s2 }), i2 = { ...n9 ? xn() : {}, ...n9 ? $n(a2.list()) : {}, ...e14.commands ?? {} }, o2 = [createPluginRegistration(DocumentManagerPluginPackage, { initialDocuments: [], maxDocuments: Number.MAX_SAFE_INTEGER }), createPluginRegistration(rt$1, { manifest: e14.manifest, overlapStrategy: e14.overlapStrategy ?? En.overlapStrategy, passwordProvider: e14.passwordProvider ?? En.passwordProvider, chapterPdfLoader: e14.chapterPdfLoader, prefetchChapters: e14.prefetchChapters ?? En.prefetchChapters, maxConcurrentSegmentLoads: e14.maxConcurrentSegmentLoads ?? En.maxConcurrentSegmentLoads, unloadTimeoutMs: e14.unloadTimeoutMs ?? En.unloadTimeoutMs }), createPluginRegistration(Ut$1, { placeholderPageHeight: e14.placeholderPageHeight, placeholderPageWidth: e14.placeholderPageWidth }), createPluginRegistration(InteractionManagerPluginPackage), createPluginRegistration(RenderPluginPackage), createPluginRegistration(RotatePluginPackage), createPluginRegistration(SelectionPluginPackage, { marquee: { enabled: false }, toleranceFactor: 1.2, minSelectionDragDistance: 4 }), createPluginRegistration(HistoryPluginPackage), createPluginRegistration(AnnotationPluginPackage), createPluginRegistration(RedactionPluginPackage), createPluginRegistration(FormPluginPackage), createPluginRegistration(StampPluginPackage, false === e14.loadDefaultStampLibrary ? { manifests: [] } : void 0), createPluginRegistration(SignaturePluginPackage), ...Object.keys(i2).length > 0 ? [createPluginRegistration(CommandsPluginPackage, { commands: i2 })] : [], ...n9 ? [createPluginRegistration(I18nPluginPackage), createPluginRegistration(UIPluginPackage, { schema: r2 })] : []];
|
|
4729
4729
|
return e14.notes && o2.push(createPluginRegistration(ys, { callbacks: e14.notes.callbacks, ui: (_b = (_a2 = e14.features) == null ? void 0 : _a2.notes) == null ? void 0 : _b.marker })), e14.bookmarks && o2.push(createPluginRegistration(Sn, { callbacks: e14.bookmarks.callbacks, ui: (_d = (_c = e14.features) == null ? void 0 : _c.bookmarks) == null ? void 0 : _d.marker, hover: (_f = (_e2 = e14.features) == null ? void 0 : _e2.bookmarks) == null ? void 0 : _f.hover })), { plugins: o2, uiSchema: r2, operationRegistry: a2 };
|
|
4730
4730
|
}
|
|
4731
4731
|
function $n(e14) {
|
|
@@ -7751,8 +7751,8 @@ const Wa = /* @__PURE__ */ defineComponent({ __name: "PdfChapterViewport", props
|
|
|
7751
7751
|
const s2 = e14, n9 = computed(() => (function(e15) {
|
|
7752
7752
|
if (e15.options) return Tn(e15.options);
|
|
7753
7753
|
if (!e15.editorOptions) throw new Error("ChapterPdfViewer: 请传入 `options`(推荐),或同时传入 `editorOptions` 与 `features`");
|
|
7754
|
-
const t2 = ke$1(e15.features), {
|
|
7755
|
-
return { plugins:
|
|
7754
|
+
const t2 = ke$1(e15.features), s3 = { ...e15.editorOptions, prefetchChapters: e15.editorOptions.prefetchChapters ?? En.prefetchChapters, maxConcurrentSegmentLoads: e15.editorOptions.maxConcurrentSegmentLoads ?? En.maxConcurrentSegmentLoads, unloadTimeoutMs: e15.editorOptions.unloadTimeoutMs ?? En.unloadTimeoutMs, features: t2 }, { plugins: n10 } = Un(s3);
|
|
7755
|
+
return { plugins: n10, features: t2, editorOptions: s3 };
|
|
7756
7756
|
})({ engine: s2.engine, options: s2.options, editorOptions: s2.editorOptions, features: s2.features }));
|
|
7757
7757
|
return (t2, s3) => (openBlock(), createElementBlock("div", { class: normalizeClass(e14.className), style: normalizeStyle(e14.className ? void 0 : unref(Ie)) }, [createVNode(unref(EmbedPDF), { engine: e14.engine, plugins: n9.value.plugins }, { default: withCtx(({ pluginsReady: s4 }) => [s4 ? (openBlock(), createElementBlock("div", qa, [renderSlot(t2.$slots, "prepend"), createVNode(Wa, { class: normalizeClass(e14.viewportClassName), style: { flex: 1, minHeight: 0 }, features: n9.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));
|
|
7758
7758
|
} }), Ka = { class: "chapter-tree-row" }, ja = ["aria-expanded"], Xa = { key: 1, class: "chapter-tree-toggle-spacer", "aria-hidden": "" }, Za = { class: "chapter-tree-label" }, Ya = { class: "chapter-tree-meta" }, Qa = { key: 0 }, Ja = (e14, t2) => {
|
|
@@ -12336,28 +12336,17 @@ const ts = class s extends BasePlugin {
|
|
|
12336
12336
|
};
|
|
12337
12337
|
ts.id = "paragraph-bookmark";
|
|
12338
12338
|
let ss = ts;
|
|
12339
|
-
function
|
|
12340
|
-
const s2 = e14;
|
|
12341
|
-
return false === e14 ? { ...t2, enabled: false } : true === e14 || void 0 === e14 ? { ...t2, enabled: t2.enabled ?? true } : { ...t2, ...s2, enabled: false !== (null == s2 ? void 0 : s2.enabled) };
|
|
12342
|
-
}
|
|
12343
|
-
function us(e14) {
|
|
12344
|
-
var t2;
|
|
12345
|
-
const s2 = cs(void 0, { enabled: true }), n9 = cs(void 0, { enabled: true }), r2 = cs(void 0, { enabled: true }), a2 = cs(void 0, { enabled: true, min: 0.5, max: 3, initial: 1 }), i2 = cs(false !== s2.enabled || false !== r2.enabled, { enabled: true });
|
|
12346
|
-
return { markup: s2, bookmarks: n9, notes: r2, zoom: a2, scrollViewport: { background: (null == (t2 = void 0) ? void 0 : t2.background) ?? "#f1f5f9" }, selectionToolbar: i2 };
|
|
12347
|
-
}
|
|
12348
|
-
PdfAnnotationSubtype.HIGHLIGHT, PdfAnnotationSubtype.UNDERLINE, PdfAnnotationSubtype.SQUIGGLY, PdfAnnotationSubtype.STRIKEOUT, PdfAnnotationSubtype.HIGHLIGHT, PdfAnnotationSubtype.UNDERLINE, PdfAnnotationSubtype.SQUIGGLY, PdfAnnotationSubtype.STRIKEOUT;
|
|
12349
|
-
us();
|
|
12350
|
-
function fs(e14) {
|
|
12339
|
+
function ls(e14) {
|
|
12351
12340
|
return !!e14 && "urls" in e14 && Array.isArray(e14.urls);
|
|
12352
12341
|
}
|
|
12353
|
-
function
|
|
12342
|
+
function ds(e14, t2) {
|
|
12354
12343
|
return `${e14}#s${t2}`;
|
|
12355
12344
|
}
|
|
12356
|
-
function
|
|
12345
|
+
function cs(e14) {
|
|
12357
12346
|
const t2 = (function(e15) {
|
|
12358
12347
|
if (null != e15.segmentPageThreshold && e15.segmentPageThreshold > 0) return e15.segmentPageThreshold;
|
|
12359
12348
|
const t3 = e15.source;
|
|
12360
|
-
return
|
|
12349
|
+
return ls(t3) ? t3.segmentPageThreshold : null;
|
|
12361
12350
|
})(e14);
|
|
12362
12351
|
if (!t2) return null;
|
|
12363
12352
|
const s2 = (function(e15) {
|
|
@@ -12365,20 +12354,31 @@ function Is2(e14) {
|
|
|
12365
12354
|
return s3 - t3 + 1;
|
|
12366
12355
|
})(e14), n9 = (function(e15, t3) {
|
|
12367
12356
|
return e15 <= 0 || t3 <= 0 ? 0 : Math.ceil(e15 / t3);
|
|
12368
|
-
})(s2, t2), r2 =
|
|
12357
|
+
})(s2, t2), r2 = ls(e14.source) ? e14.source.urls : void 0, a2 = [];
|
|
12369
12358
|
for (let i2 = 0; i2 < n9; i2++) {
|
|
12370
12359
|
const n10 = i2 * t2, o2 = Math.min(n10 + t2 - 1, s2 - 1);
|
|
12371
12360
|
if (n10 >= s2) break;
|
|
12372
|
-
a2.push({ index: i2, url: (r2 == null ? void 0 : r2[i2]) ?? "", localPageStart: n10, localPageEnd: o2, documentId:
|
|
12361
|
+
a2.push({ index: i2, url: (r2 == null ? void 0 : r2[i2]) ?? "", localPageStart: n10, localPageEnd: o2, documentId: ds(e14.chapterId, i2) });
|
|
12373
12362
|
}
|
|
12374
12363
|
return { chapterId: e14.chapterId, threshold: t2, pageCount: s2, segments: a2 };
|
|
12375
12364
|
}
|
|
12376
|
-
function
|
|
12377
|
-
const s2 =
|
|
12365
|
+
function us(e14, t2) {
|
|
12366
|
+
const s2 = cs(e14);
|
|
12378
12367
|
if (!s2) return 0;
|
|
12379
12368
|
const n9 = s2.segments.find((e15) => t2 >= e15.localPageStart && t2 <= e15.localPageEnd);
|
|
12380
12369
|
return (n9 == null ? void 0 : n9.index) ?? Math.floor(t2 / s2.threshold);
|
|
12381
12370
|
}
|
|
12371
|
+
function ps2(e14, t2) {
|
|
12372
|
+
const s2 = e14;
|
|
12373
|
+
return false === e14 ? { ...t2, enabled: false } : true === e14 || void 0 === e14 ? { ...t2, enabled: t2.enabled ?? true } : { ...t2, ...s2, enabled: false !== (null == s2 ? void 0 : s2.enabled) };
|
|
12374
|
+
}
|
|
12375
|
+
function gs(e14) {
|
|
12376
|
+
var t2;
|
|
12377
|
+
const s2 = ps2(void 0, { enabled: true }), n9 = ps2(void 0, { enabled: true }), r2 = ps2(void 0, { enabled: true }), a2 = ps2(void 0, { enabled: true, min: 0.5, max: 3, initial: 1 }), i2 = ps2(false !== s2.enabled || false !== r2.enabled, { enabled: true });
|
|
12378
|
+
return { markup: s2, bookmarks: n9, notes: r2, zoom: a2, scrollViewport: { background: (null == (t2 = void 0) ? void 0 : t2.background) ?? "#f1f5f9" }, selectionToolbar: i2 };
|
|
12379
|
+
}
|
|
12380
|
+
PdfAnnotationSubtype.HIGHLIGHT, PdfAnnotationSubtype.UNDERLINE, PdfAnnotationSubtype.SQUIGGLY, PdfAnnotationSubtype.STRIKEOUT, PdfAnnotationSubtype.HIGHLIGHT, PdfAnnotationSubtype.UNDERLINE, PdfAnnotationSubtype.SQUIGGLY, PdfAnnotationSubtype.STRIKEOUT;
|
|
12381
|
+
gs();
|
|
12382
12382
|
async function $s(e14) {
|
|
12383
12383
|
var _a2;
|
|
12384
12384
|
const t2 = e14.trim();
|
|
@@ -12505,7 +12505,7 @@ async function Gs(e14, t2, s2) {
|
|
|
12505
12505
|
if (!i3) return;
|
|
12506
12506
|
const o3 = /* @__PURE__ */ new Map();
|
|
12507
12507
|
for (const h3 of n10) {
|
|
12508
|
-
const e16 = h3.annotation.pageIndex, t4 =
|
|
12508
|
+
const e16 = h3.annotation.pageIndex, t4 = us(i3, e16), s4 = a3.segments[t4];
|
|
12509
12509
|
if (!s4) continue;
|
|
12510
12510
|
const n11 = o3.get(t4) ?? [];
|
|
12511
12511
|
n11.push({ ...h3, annotation: { ...h3.annotation, pageIndex: e16 - s4.localPageStart } }), o3.set(t4, n11);
|