pdfjs-reader-core 0.1.4 → 0.1.5

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
@@ -1361,6 +1361,12 @@ function createSearchStore(initialOverrides = {}) {
1361
1361
  set({ currentResultIndex: index });
1362
1362
  }
1363
1363
  },
1364
+ setCaseSensitive: (value) => {
1365
+ set({ caseSensitive: value });
1366
+ },
1367
+ setWholeWord: (value) => {
1368
+ set({ wholeWord: value });
1369
+ },
1364
1370
  toggleCaseSensitive: () => {
1365
1371
  set((state) => ({ caseSensitive: !state.caseSensitive }));
1366
1372
  },
@@ -8743,13 +8749,155 @@ var init_DualPageContainer = __esm({
8743
8749
  }
8744
8750
  });
8745
8751
 
8752
+ // src/components/FloatingZoomControls/FloatingZoomControls.tsx
8753
+ import { memo as memo24, useCallback as useCallback32 } from "react";
8754
+ import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
8755
+ var FloatingZoomControls;
8756
+ var init_FloatingZoomControls = __esm({
8757
+ "src/components/FloatingZoomControls/FloatingZoomControls.tsx"() {
8758
+ "use strict";
8759
+ init_hooks();
8760
+ init_utils();
8761
+ FloatingZoomControls = memo24(function FloatingZoomControls2({
8762
+ position = "bottom-right",
8763
+ className,
8764
+ showFitToWidth = true,
8765
+ showFitToPage = false,
8766
+ showZoomLevel = true
8767
+ }) {
8768
+ const { viewerStore } = usePDFViewerStores();
8769
+ const scale = useViewerStore((s) => s.scale);
8770
+ const document2 = useViewerStore((s) => s.document);
8771
+ const handleZoomIn = useCallback32(() => {
8772
+ viewerStore.getState().zoomIn();
8773
+ }, [viewerStore]);
8774
+ const handleZoomOut = useCallback32(() => {
8775
+ viewerStore.getState().zoomOut();
8776
+ }, [viewerStore]);
8777
+ const handleFitToWidth = useCallback32(() => {
8778
+ viewerStore.getState().setScale(1);
8779
+ }, [viewerStore]);
8780
+ const handleFitToPage = useCallback32(() => {
8781
+ viewerStore.getState().setScale(0.75);
8782
+ }, [viewerStore]);
8783
+ if (!document2) return null;
8784
+ const positionClasses = {
8785
+ "bottom-right": "bottom-4 right-4",
8786
+ "bottom-left": "bottom-4 left-4",
8787
+ "top-right": "top-4 right-4",
8788
+ "top-left": "top-4 left-4"
8789
+ };
8790
+ const zoomPercentage = Math.round(scale * 100);
8791
+ return /* @__PURE__ */ jsxs21(
8792
+ "div",
8793
+ {
8794
+ className: cn(
8795
+ "fixed z-50 flex items-center gap-1",
8796
+ "bg-white dark:bg-gray-800 rounded-lg shadow-lg",
8797
+ "border border-gray-200 dark:border-gray-700",
8798
+ "p-1",
8799
+ positionClasses[position],
8800
+ className
8801
+ ),
8802
+ children: [
8803
+ /* @__PURE__ */ jsx25(
8804
+ "button",
8805
+ {
8806
+ onClick: handleZoomOut,
8807
+ className: cn(
8808
+ "w-8 h-8 flex items-center justify-center rounded",
8809
+ "text-gray-700 dark:text-gray-300",
8810
+ "hover:bg-gray-100 dark:hover:bg-gray-700",
8811
+ "transition-colors",
8812
+ "disabled:opacity-50 disabled:cursor-not-allowed"
8813
+ ),
8814
+ disabled: scale <= 0.25,
8815
+ title: "Zoom Out",
8816
+ "aria-label": "Zoom Out",
8817
+ children: /* @__PURE__ */ jsx25("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx25("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) })
8818
+ }
8819
+ ),
8820
+ showZoomLevel && /* @__PURE__ */ jsxs21("span", { className: "min-w-[48px] text-center text-sm font-medium text-gray-700 dark:text-gray-300", children: [
8821
+ zoomPercentage,
8822
+ "%"
8823
+ ] }),
8824
+ /* @__PURE__ */ jsx25(
8825
+ "button",
8826
+ {
8827
+ onClick: handleZoomIn,
8828
+ className: cn(
8829
+ "w-8 h-8 flex items-center justify-center rounded",
8830
+ "text-gray-700 dark:text-gray-300",
8831
+ "hover:bg-gray-100 dark:hover:bg-gray-700",
8832
+ "transition-colors",
8833
+ "disabled:opacity-50 disabled:cursor-not-allowed"
8834
+ ),
8835
+ disabled: scale >= 4,
8836
+ title: "Zoom In",
8837
+ "aria-label": "Zoom In",
8838
+ children: /* @__PURE__ */ jsx25("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx25("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) })
8839
+ }
8840
+ ),
8841
+ (showFitToWidth || showFitToPage) && /* @__PURE__ */ jsx25("div", { className: "w-px h-6 bg-gray-200 dark:bg-gray-700 mx-1" }),
8842
+ showFitToWidth && /* @__PURE__ */ jsx25(
8843
+ "button",
8844
+ {
8845
+ onClick: handleFitToWidth,
8846
+ className: cn(
8847
+ "w-8 h-8 flex items-center justify-center rounded",
8848
+ "text-gray-700 dark:text-gray-300",
8849
+ "hover:bg-gray-100 dark:hover:bg-gray-700",
8850
+ "transition-colors"
8851
+ ),
8852
+ title: "Fit to Width",
8853
+ "aria-label": "Fit to Width",
8854
+ children: /* @__PURE__ */ jsx25("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx25("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4" }) })
8855
+ }
8856
+ ),
8857
+ showFitToPage && /* @__PURE__ */ jsx25(
8858
+ "button",
8859
+ {
8860
+ onClick: handleFitToPage,
8861
+ className: cn(
8862
+ "w-8 h-8 flex items-center justify-center rounded",
8863
+ "text-gray-700 dark:text-gray-300",
8864
+ "hover:bg-gray-100 dark:hover:bg-gray-700",
8865
+ "transition-colors"
8866
+ ),
8867
+ title: "Fit to Page",
8868
+ "aria-label": "Fit to Page",
8869
+ children: /* @__PURE__ */ jsx25("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx25("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) })
8870
+ }
8871
+ )
8872
+ ]
8873
+ }
8874
+ );
8875
+ });
8876
+ }
8877
+ });
8878
+
8879
+ // src/components/FloatingZoomControls/index.ts
8880
+ var init_FloatingZoomControls2 = __esm({
8881
+ "src/components/FloatingZoomControls/index.ts"() {
8882
+ "use strict";
8883
+ init_FloatingZoomControls();
8884
+ }
8885
+ });
8886
+
8746
8887
  // src/components/PDFViewer/PDFViewerClient.tsx
8747
8888
  var PDFViewerClient_exports = {};
8748
8889
  __export(PDFViewerClient_exports, {
8749
8890
  PDFViewerClient: () => PDFViewerClient
8750
8891
  });
8751
- import { useEffect as useEffect22, useCallback as useCallback32, memo as memo24, useRef as useRef19, useState as useState21 } from "react";
8752
- import { jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
8892
+ import {
8893
+ useEffect as useEffect22,
8894
+ useCallback as useCallback33,
8895
+ memo as memo25,
8896
+ useRef as useRef19,
8897
+ useState as useState21,
8898
+ forwardRef
8899
+ } from "react";
8900
+ import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
8753
8901
  function getSrcIdentifier(src) {
8754
8902
  if (typeof src === "string") {
8755
8903
  return src;
@@ -8761,7 +8909,26 @@ function getSrcIdentifier(src) {
8761
8909
  const last = Array.from(data.slice(-4)).map((b) => b.toString(16).padStart(2, "0")).join("");
8762
8910
  return `binary:${len}:${first}:${last}`;
8763
8911
  }
8764
- var PDFViewerInner, PDFViewerClient;
8912
+ function mergeRects2(rects) {
8913
+ if (rects.length === 0) return [];
8914
+ const sorted = [...rects].sort((a, b) => a.y - b.y || a.x - b.x);
8915
+ const merged = [];
8916
+ let current = { ...sorted[0] };
8917
+ for (let i = 1; i < sorted.length; i++) {
8918
+ const rect = sorted[i];
8919
+ if (Math.abs(rect.y - current.y) < 2 && rect.x <= current.x + current.width + 2) {
8920
+ const newRight = Math.max(current.x + current.width, rect.x + rect.width);
8921
+ current.width = newRight - current.x;
8922
+ current.height = Math.max(current.height, rect.height);
8923
+ } else {
8924
+ merged.push(current);
8925
+ current = { ...rect };
8926
+ }
8927
+ }
8928
+ merged.push(current);
8929
+ return merged;
8930
+ }
8931
+ var PDFViewerInner, PDFViewerInnerWithRef, PDFViewerClient;
8765
8932
  var init_PDFViewerClient = __esm({
8766
8933
  "src/components/PDFViewer/PDFViewerClient.tsx"() {
8767
8934
  "use strict";
@@ -8773,33 +8940,38 @@ var init_PDFViewerClient = __esm({
8773
8940
  init_DocumentContainer();
8774
8941
  init_ContinuousScrollContainer();
8775
8942
  init_DualPageContainer();
8943
+ init_FloatingZoomControls2();
8776
8944
  init_utils();
8777
- PDFViewerInner = memo24(function PDFViewerInner2({
8945
+ PDFViewerInner = memo25(function PDFViewerInner2({
8778
8946
  src,
8779
8947
  initialPage = 1,
8780
- initialScale = 1,
8948
+ initialScale = "auto",
8781
8949
  showToolbar = true,
8782
8950
  showSidebar = true,
8783
8951
  showAnnotationToolbar = false,
8952
+ showFloatingZoom = true,
8784
8953
  viewMode = "single",
8785
8954
  onDocumentLoad,
8786
8955
  onPageChange,
8787
8956
  onScaleChange,
8788
8957
  onError,
8789
8958
  workerSrc,
8790
- className
8959
+ className,
8960
+ onReady
8791
8961
  }) {
8792
- const { viewerStore } = usePDFViewerStores();
8962
+ const { viewerStore, annotationStore, searchStore } = usePDFViewerStores();
8793
8963
  const mountedRef = useRef19(true);
8794
8964
  const [, setLoadState] = useState21("idle");
8795
8965
  const onDocumentLoadRef = useRef19(onDocumentLoad);
8796
8966
  const onErrorRef = useRef19(onError);
8797
8967
  const onPageChangeRef = useRef19(onPageChange);
8798
8968
  const onScaleChangeRef = useRef19(onScaleChange);
8969
+ const onReadyRef = useRef19(onReady);
8799
8970
  onDocumentLoadRef.current = onDocumentLoad;
8800
8971
  onErrorRef.current = onError;
8801
8972
  onPageChangeRef.current = onPageChange;
8802
8973
  onScaleChangeRef.current = onScaleChange;
8974
+ onReadyRef.current = onReady;
8803
8975
  const srcIdRef = useRef19(null);
8804
8976
  const currentPage = useViewerStore((s) => s.currentPage);
8805
8977
  const scale = useViewerStore((s) => s.scale);
@@ -8808,7 +8980,211 @@ var init_PDFViewerClient = __esm({
8808
8980
  const error = useViewerStore((s) => s.error);
8809
8981
  const sidebarOpen = useViewerStore((s) => s.sidebarOpen);
8810
8982
  const srcId = getSrcIdentifier(src);
8811
- const handleRetry = useCallback32(() => {
8983
+ const handleRef = useRef19(null);
8984
+ useEffect22(() => {
8985
+ const handle = {
8986
+ // ==================== Text Highlighting ====================
8987
+ highlightText: async (text, options) => {
8988
+ const doc = viewerStore.getState().document;
8989
+ if (!doc) return [];
8990
+ const color = options?.color ?? "yellow";
8991
+ const targetPage = options?.page;
8992
+ const caseSensitive = options?.caseSensitive ?? false;
8993
+ const scrollTo = options?.scrollTo ?? true;
8994
+ const highlightIds = [];
8995
+ const searchText = caseSensitive ? text : text.toLowerCase();
8996
+ const pagesToSearch = targetPage ? [targetPage] : Array.from({ length: doc.numPages }, (_, i) => i + 1);
8997
+ for (const pageNum of pagesToSearch) {
8998
+ try {
8999
+ const page = await doc.getPage(pageNum);
9000
+ const textContent = await page.getTextContent();
9001
+ const viewport = page.getViewport({ scale: 1 });
9002
+ let fullText = "";
9003
+ const charPositions = [];
9004
+ for (const item of textContent.items) {
9005
+ if ("str" in item && item.str) {
9006
+ const tx = item.transform;
9007
+ const x = tx[4];
9008
+ const y = viewport.height - tx[5];
9009
+ const width = item.width ?? 0;
9010
+ const height = item.height ?? 12;
9011
+ const charWidth = item.str.length > 0 ? width / item.str.length : width;
9012
+ for (let i = 0; i < item.str.length; i++) {
9013
+ charPositions.push({
9014
+ char: item.str[i],
9015
+ rect: {
9016
+ x: x + i * charWidth,
9017
+ y: y - height,
9018
+ width: charWidth,
9019
+ height
9020
+ }
9021
+ });
9022
+ }
9023
+ fullText += item.str;
9024
+ }
9025
+ }
9026
+ const textToSearch = caseSensitive ? fullText : fullText.toLowerCase();
9027
+ let startIndex = 0;
9028
+ while (true) {
9029
+ const matchIndex = textToSearch.indexOf(searchText, startIndex);
9030
+ if (matchIndex === -1) break;
9031
+ const matchRects = [];
9032
+ for (let i = matchIndex; i < matchIndex + text.length && i < charPositions.length; i++) {
9033
+ matchRects.push(charPositions[i].rect);
9034
+ }
9035
+ const mergedRects = mergeRects2(matchRects);
9036
+ const highlight = annotationStore.getState().addHighlight({
9037
+ pageNumber: pageNum,
9038
+ rects: mergedRects,
9039
+ color,
9040
+ text: fullText.substring(matchIndex, matchIndex + text.length)
9041
+ });
9042
+ highlightIds.push(highlight.id);
9043
+ startIndex = matchIndex + 1;
9044
+ }
9045
+ } catch {
9046
+ }
9047
+ }
9048
+ if (scrollTo && highlightIds.length > 0) {
9049
+ const firstHighlight = annotationStore.getState().highlights.find((h) => h.id === highlightIds[0]);
9050
+ if (firstHighlight) {
9051
+ viewerStore.getState().goToPage(firstHighlight.pageNumber);
9052
+ }
9053
+ }
9054
+ return highlightIds;
9055
+ },
9056
+ removeHighlight: (id) => {
9057
+ annotationStore.getState().removeHighlight(id);
9058
+ },
9059
+ clearHighlights: () => {
9060
+ const highlights = annotationStore.getState().highlights;
9061
+ for (const h of highlights) {
9062
+ annotationStore.getState().removeHighlight(h.id);
9063
+ }
9064
+ },
9065
+ // ==================== Annotations ====================
9066
+ drawRect: (options) => {
9067
+ const annotation = annotationStore.getState().addAnnotation({
9068
+ type: "shape",
9069
+ shapeType: "rect",
9070
+ pageNumber: options.page,
9071
+ x: options.x,
9072
+ y: options.y,
9073
+ width: options.width,
9074
+ height: options.height,
9075
+ color: options.color ?? "blue",
9076
+ strokeWidth: options.strokeWidth ?? 2
9077
+ });
9078
+ return annotation.id;
9079
+ },
9080
+ drawCircle: (options) => {
9081
+ const annotation = annotationStore.getState().addAnnotation({
9082
+ type: "shape",
9083
+ shapeType: "circle",
9084
+ pageNumber: options.page,
9085
+ x: options.x,
9086
+ y: options.y,
9087
+ width: options.radius * 2,
9088
+ height: options.radius * 2,
9089
+ color: options.color ?? "blue",
9090
+ strokeWidth: options.strokeWidth ?? 2
9091
+ });
9092
+ return annotation.id;
9093
+ },
9094
+ addNote: (options) => {
9095
+ const annotation = annotationStore.getState().addAnnotation({
9096
+ type: "note",
9097
+ pageNumber: options.page,
9098
+ x: options.x,
9099
+ y: options.y,
9100
+ content: options.content,
9101
+ color: options.color ?? "yellow"
9102
+ });
9103
+ return annotation.id;
9104
+ },
9105
+ removeAnnotation: (id) => {
9106
+ annotationStore.getState().removeAnnotation(id);
9107
+ },
9108
+ clearAnnotations: () => {
9109
+ const annotations = annotationStore.getState().annotations;
9110
+ for (const a of annotations) {
9111
+ annotationStore.getState().removeAnnotation(a.id);
9112
+ }
9113
+ },
9114
+ // ==================== Navigation ====================
9115
+ goToPage: (page) => {
9116
+ viewerStore.getState().goToPage(page);
9117
+ },
9118
+ nextPage: () => {
9119
+ viewerStore.getState().nextPage();
9120
+ },
9121
+ previousPage: () => {
9122
+ viewerStore.getState().previousPage();
9123
+ },
9124
+ getCurrentPage: () => {
9125
+ return viewerStore.getState().currentPage;
9126
+ },
9127
+ getNumPages: () => {
9128
+ return viewerStore.getState().numPages;
9129
+ },
9130
+ // ==================== Zoom ====================
9131
+ setZoom: (scale2) => {
9132
+ viewerStore.getState().setScale(scale2);
9133
+ },
9134
+ getZoom: () => {
9135
+ return viewerStore.getState().scale;
9136
+ },
9137
+ zoomIn: () => {
9138
+ viewerStore.getState().zoomIn();
9139
+ },
9140
+ zoomOut: () => {
9141
+ viewerStore.getState().zoomOut();
9142
+ },
9143
+ // ==================== Search ====================
9144
+ search: async (query, options) => {
9145
+ const doc = viewerStore.getState().document;
9146
+ if (!doc) return [];
9147
+ searchStore.getState().setQuery(query);
9148
+ if (options?.caseSensitive !== void 0) {
9149
+ searchStore.getState().setCaseSensitive(options.caseSensitive);
9150
+ }
9151
+ if (options?.wholeWord !== void 0) {
9152
+ searchStore.getState().setWholeWord(options.wholeWord);
9153
+ }
9154
+ await searchStore.getState().search(doc);
9155
+ return searchStore.getState().results;
9156
+ },
9157
+ nextSearchResult: () => {
9158
+ searchStore.getState().nextResult();
9159
+ const results = searchStore.getState().results;
9160
+ const index = searchStore.getState().currentResultIndex;
9161
+ if (results[index]) {
9162
+ viewerStore.getState().goToPage(results[index].pageNumber);
9163
+ }
9164
+ },
9165
+ previousSearchResult: () => {
9166
+ searchStore.getState().previousResult();
9167
+ const results = searchStore.getState().results;
9168
+ const index = searchStore.getState().currentResultIndex;
9169
+ if (results[index]) {
9170
+ viewerStore.getState().goToPage(results[index].pageNumber);
9171
+ }
9172
+ },
9173
+ clearSearch: () => {
9174
+ searchStore.getState().clearSearch();
9175
+ },
9176
+ // ==================== Document ====================
9177
+ getDocument: () => {
9178
+ return viewerStore.getState().document;
9179
+ },
9180
+ isLoaded: () => {
9181
+ return viewerStore.getState().document !== null;
9182
+ }
9183
+ };
9184
+ handleRef.current = handle;
9185
+ onReadyRef.current?.(handle);
9186
+ }, [viewerStore, annotationStore, searchStore]);
9187
+ const handleRetry = useCallback33(() => {
8812
9188
  srcIdRef.current = null;
8813
9189
  viewerStore.getState().setError(null);
8814
9190
  setLoadState("idle");
@@ -8846,8 +9222,12 @@ var init_PDFViewerClient = __esm({
8846
9222
  if (initialPage !== 1) {
8847
9223
  viewerStore.getState().goToPage(initialPage);
8848
9224
  }
8849
- if (typeof initialScale === "number" && initialScale !== 1) {
9225
+ if (typeof initialScale === "number") {
8850
9226
  viewerStore.getState().setScale(initialScale);
9227
+ } else if (initialScale === "auto" || initialScale === "page-width") {
9228
+ viewerStore.getState().setScale(1);
9229
+ } else if (initialScale === "page-fit") {
9230
+ viewerStore.getState().setScale(0.75);
8851
9231
  }
8852
9232
  onDocumentLoadRef.current?.({ document: document2, numPages });
8853
9233
  } else {
@@ -8883,7 +9263,7 @@ var init_PDFViewerClient = __esm({
8883
9263
  }, [scale]);
8884
9264
  const themeClass = theme === "dark" ? "dark" : "";
8885
9265
  if (error) {
8886
- return /* @__PURE__ */ jsx25(
9266
+ return /* @__PURE__ */ jsx26(
8887
9267
  "div",
8888
9268
  {
8889
9269
  className: cn(
@@ -8893,10 +9273,10 @@ var init_PDFViewerClient = __esm({
8893
9273
  themeClass,
8894
9274
  className
8895
9275
  ),
8896
- children: /* @__PURE__ */ jsx25("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsxs21("div", { className: "text-center p-8", children: [
8897
- /* @__PURE__ */ jsx25("div", { className: "text-red-500 text-lg font-semibold mb-2", children: "Failed to load PDF" }),
8898
- /* @__PURE__ */ jsx25("div", { className: "text-gray-500 text-sm", children: error.message }),
8899
- /* @__PURE__ */ jsx25(
9276
+ children: /* @__PURE__ */ jsx26("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsxs22("div", { className: "text-center p-8", children: [
9277
+ /* @__PURE__ */ jsx26("div", { className: "text-red-500 text-lg font-semibold mb-2", children: "Failed to load PDF" }),
9278
+ /* @__PURE__ */ jsx26("div", { className: "text-gray-500 text-sm", children: error.message }),
9279
+ /* @__PURE__ */ jsx26(
8900
9280
  "button",
8901
9281
  {
8902
9282
  onClick: handleRetry,
@@ -8911,56 +9291,73 @@ var init_PDFViewerClient = __esm({
8911
9291
  const renderContainer = () => {
8912
9292
  switch (viewMode) {
8913
9293
  case "continuous":
8914
- return /* @__PURE__ */ jsx25(ContinuousScrollContainer, {});
9294
+ return /* @__PURE__ */ jsx26(ContinuousScrollContainer, {});
8915
9295
  case "dual":
8916
- return /* @__PURE__ */ jsx25(DualPageContainer, {});
9296
+ return /* @__PURE__ */ jsx26(DualPageContainer, {});
8917
9297
  case "single":
8918
9298
  default:
8919
- return /* @__PURE__ */ jsx25(DocumentContainer, {});
9299
+ return /* @__PURE__ */ jsx26(DocumentContainer, {});
8920
9300
  }
8921
9301
  };
8922
- return /* @__PURE__ */ jsxs21(
9302
+ return /* @__PURE__ */ jsxs22(
8923
9303
  "div",
8924
9304
  {
8925
9305
  className: cn(
8926
9306
  "pdf-viewer",
8927
- "flex flex-col h-full",
9307
+ "flex flex-col h-full relative",
8928
9308
  "bg-white dark:bg-gray-900",
8929
9309
  "text-gray-900 dark:text-gray-100",
8930
9310
  themeClass,
8931
9311
  className
8932
9312
  ),
8933
9313
  children: [
8934
- showToolbar && /* @__PURE__ */ jsx25(Toolbar, {}),
8935
- showAnnotationToolbar && /* @__PURE__ */ jsx25(AnnotationToolbar, {}),
8936
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-1 overflow-hidden", children: [
8937
- showSidebar && sidebarOpen && /* @__PURE__ */ jsx25(Sidebar, {}),
9314
+ showToolbar && /* @__PURE__ */ jsx26(Toolbar, {}),
9315
+ showAnnotationToolbar && /* @__PURE__ */ jsx26(AnnotationToolbar, {}),
9316
+ /* @__PURE__ */ jsxs22("div", { className: "flex flex-1 overflow-hidden", children: [
9317
+ showSidebar && sidebarOpen && /* @__PURE__ */ jsx26(Sidebar, {}),
8938
9318
  renderContainer()
8939
9319
  ] }),
8940
- isLoading && /* @__PURE__ */ jsx25("div", { className: "absolute inset-0 flex items-center justify-center bg-white/80 dark:bg-gray-900/80", children: /* @__PURE__ */ jsxs21("div", { className: "flex flex-col items-center", children: [
8941
- /* @__PURE__ */ jsx25("div", { className: "w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin" }),
8942
- /* @__PURE__ */ jsx25("div", { className: "mt-2 text-sm text-gray-500", children: "Loading PDF..." })
9320
+ showFloatingZoom && /* @__PURE__ */ jsx26(FloatingZoomControls, { position: "bottom-right" }),
9321
+ isLoading && /* @__PURE__ */ jsx26("div", { className: "absolute inset-0 flex items-center justify-center bg-white/80 dark:bg-gray-900/80", children: /* @__PURE__ */ jsxs22("div", { className: "flex flex-col items-center", children: [
9322
+ /* @__PURE__ */ jsx26("div", { className: "w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin" }),
9323
+ /* @__PURE__ */ jsx26("div", { className: "mt-2 text-sm text-gray-500", children: "Loading PDF..." })
8943
9324
  ] }) })
8944
9325
  ]
8945
9326
  }
8946
9327
  );
8947
9328
  });
8948
- PDFViewerClient = memo24(function PDFViewerClient2(props) {
8949
- return /* @__PURE__ */ jsx25(
8950
- PDFViewerProvider,
8951
- {
8952
- theme: props.theme,
8953
- defaultSidebarPanel: props.defaultSidebarPanel,
8954
- children: /* @__PURE__ */ jsx25(PDFViewerInner, { ...props })
8955
- }
8956
- );
8957
- });
9329
+ PDFViewerInnerWithRef = forwardRef(
9330
+ function PDFViewerInnerWithRef2(props, ref) {
9331
+ const handleRef = useRef19(null);
9332
+ const handleReady = useCallback33((handle) => {
9333
+ handleRef.current = handle;
9334
+ if (typeof ref === "function") {
9335
+ ref(handle);
9336
+ } else if (ref) {
9337
+ ref.current = handle;
9338
+ }
9339
+ }, [ref]);
9340
+ return /* @__PURE__ */ jsx26(PDFViewerInner, { ...props, onReady: handleReady });
9341
+ }
9342
+ );
9343
+ PDFViewerClient = memo25(
9344
+ forwardRef(function PDFViewerClient2(props, ref) {
9345
+ return /* @__PURE__ */ jsx26(
9346
+ PDFViewerProvider,
9347
+ {
9348
+ theme: props.theme,
9349
+ defaultSidebarPanel: props.defaultSidebarPanel,
9350
+ children: /* @__PURE__ */ jsx26(PDFViewerInnerWithRef, { ref, ...props })
9351
+ }
9352
+ );
9353
+ })
9354
+ );
8958
9355
  }
8959
9356
  });
8960
9357
 
8961
9358
  // src/components/PDFViewer/PDFViewer.tsx
8962
- import { lazy, Suspense, memo as memo25 } from "react";
8963
- import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
9359
+ import { lazy, Suspense, memo as memo26 } from "react";
9360
+ import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
8964
9361
  var PDFViewerClient3, PDFViewerLoading, PDFViewer;
8965
9362
  var init_PDFViewer = __esm({
8966
9363
  "src/components/PDFViewer/PDFViewer.tsx"() {
@@ -8969,10 +9366,10 @@ var init_PDFViewer = __esm({
8969
9366
  PDFViewerClient3 = lazy(
8970
9367
  () => Promise.resolve().then(() => (init_PDFViewerClient(), PDFViewerClient_exports)).then((mod) => ({ default: mod.PDFViewerClient }))
8971
9368
  );
8972
- PDFViewerLoading = memo25(function PDFViewerLoading2({
9369
+ PDFViewerLoading = memo26(function PDFViewerLoading2({
8973
9370
  className
8974
9371
  }) {
8975
- return /* @__PURE__ */ jsx26(
9372
+ return /* @__PURE__ */ jsx27(
8976
9373
  "div",
8977
9374
  {
8978
9375
  className: cn(
@@ -8981,18 +9378,18 @@ var init_PDFViewer = __esm({
8981
9378
  "bg-white dark:bg-gray-900",
8982
9379
  className
8983
9380
  ),
8984
- children: /* @__PURE__ */ jsx26("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsxs22("div", { className: "flex flex-col items-center", children: [
8985
- /* @__PURE__ */ jsx26("div", { className: "w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin" }),
8986
- /* @__PURE__ */ jsx26("div", { className: "mt-2 text-sm text-gray-500", children: "Loading PDF viewer..." })
9381
+ children: /* @__PURE__ */ jsx27("div", { className: "flex-1 flex items-center justify-center", children: /* @__PURE__ */ jsxs23("div", { className: "flex flex-col items-center", children: [
9382
+ /* @__PURE__ */ jsx27("div", { className: "w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin" }),
9383
+ /* @__PURE__ */ jsx27("div", { className: "mt-2 text-sm text-gray-500", children: "Loading PDF viewer..." })
8987
9384
  ] }) })
8988
9385
  }
8989
9386
  );
8990
9387
  });
8991
- PDFViewer = memo25(function PDFViewer2(props) {
9388
+ PDFViewer = memo26(function PDFViewer2(props) {
8992
9389
  if (typeof window === "undefined") {
8993
- return /* @__PURE__ */ jsx26(PDFViewerLoading, { className: props.className });
9390
+ return /* @__PURE__ */ jsx27(PDFViewerLoading, { className: props.className });
8994
9391
  }
8995
- return /* @__PURE__ */ jsx26(Suspense, { fallback: /* @__PURE__ */ jsx26(PDFViewerLoading, { className: props.className }), children: /* @__PURE__ */ jsx26(PDFViewerClient3, { ...props }) });
9392
+ return /* @__PURE__ */ jsx27(Suspense, { fallback: /* @__PURE__ */ jsx27(PDFViewerLoading, { className: props.className }), children: /* @__PURE__ */ jsx27(PDFViewerClient3, { ...props }) });
8996
9393
  });
8997
9394
  }
8998
9395
  });
@@ -9021,8 +9418,8 @@ init_AnnotationToolbar2();
9021
9418
 
9022
9419
  // src/components/Annotations/StickyNote.tsx
9023
9420
  init_utils();
9024
- import { memo as memo26, useState as useState22, useRef as useRef20, useEffect as useEffect23, useCallback as useCallback33 } from "react";
9025
- import { jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
9421
+ import { memo as memo27, useState as useState22, useRef as useRef20, useEffect as useEffect23, useCallback as useCallback34 } from "react";
9422
+ import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
9026
9423
  var NOTE_COLORS = [
9027
9424
  "#fef08a",
9028
9425
  // yellow
@@ -9035,7 +9432,7 @@ var NOTE_COLORS = [
9035
9432
  "#fed7aa"
9036
9433
  // orange
9037
9434
  ];
9038
- var StickyNote = memo26(function StickyNote2({
9435
+ var StickyNote = memo27(function StickyNote2({
9039
9436
  note,
9040
9437
  scale,
9041
9438
  isSelected,
@@ -9061,24 +9458,24 @@ var StickyNote = memo26(function StickyNote2({
9061
9458
  textareaRef.current.select();
9062
9459
  }
9063
9460
  }, [isEditing]);
9064
- const handleClick = useCallback33((e) => {
9461
+ const handleClick = useCallback34((e) => {
9065
9462
  e.stopPropagation();
9066
9463
  onSelect?.();
9067
9464
  if (!isExpanded) {
9068
9465
  setIsExpanded(true);
9069
9466
  }
9070
9467
  }, [isExpanded, onSelect]);
9071
- const handleDoubleClick = useCallback33((e) => {
9468
+ const handleDoubleClick = useCallback34((e) => {
9072
9469
  e.stopPropagation();
9073
9470
  onStartEdit?.();
9074
9471
  }, [onStartEdit]);
9075
- const handleBlur = useCallback33(() => {
9472
+ const handleBlur = useCallback34(() => {
9076
9473
  if (isEditing && localContent !== note.content) {
9077
9474
  onUpdate?.({ content: localContent });
9078
9475
  }
9079
9476
  onEndEdit?.();
9080
9477
  }, [isEditing, localContent, note.content, onUpdate, onEndEdit]);
9081
- const handleKeyDown = useCallback33((e) => {
9478
+ const handleKeyDown = useCallback34((e) => {
9082
9479
  if (e.key === "Escape") {
9083
9480
  setLocalContent(note.content);
9084
9481
  onEndEdit?.();
@@ -9086,16 +9483,16 @@ var StickyNote = memo26(function StickyNote2({
9086
9483
  handleBlur();
9087
9484
  }
9088
9485
  }, [note.content, onEndEdit, handleBlur]);
9089
- const handleColorChange = useCallback33((color) => {
9486
+ const handleColorChange = useCallback34((color) => {
9090
9487
  onUpdate?.({ color });
9091
9488
  }, [onUpdate]);
9092
- const handleCollapse = useCallback33((e) => {
9489
+ const handleCollapse = useCallback34((e) => {
9093
9490
  e.stopPropagation();
9094
9491
  setIsExpanded(false);
9095
9492
  onEndEdit?.();
9096
9493
  }, [onEndEdit]);
9097
9494
  if (!isExpanded) {
9098
- return /* @__PURE__ */ jsx27(
9495
+ return /* @__PURE__ */ jsx28(
9099
9496
  "div",
9100
9497
  {
9101
9498
  ref: noteRef,
@@ -9116,14 +9513,14 @@ var StickyNote = memo26(function StickyNote2({
9116
9513
  onMouseDown: onDragStart,
9117
9514
  onTouchStart: onDragStart,
9118
9515
  title: note.content || "Empty note",
9119
- children: /* @__PURE__ */ jsx27(
9516
+ children: /* @__PURE__ */ jsx28(
9120
9517
  "svg",
9121
9518
  {
9122
9519
  className: "w-4 h-4 opacity-70",
9123
9520
  fill: "currentColor",
9124
9521
  viewBox: "0 0 20 20",
9125
9522
  style: { color: "#333" },
9126
- children: /* @__PURE__ */ jsx27(
9523
+ children: /* @__PURE__ */ jsx28(
9127
9524
  "path",
9128
9525
  {
9129
9526
  fillRule: "evenodd",
@@ -9136,7 +9533,7 @@ var StickyNote = memo26(function StickyNote2({
9136
9533
  }
9137
9534
  );
9138
9535
  }
9139
- return /* @__PURE__ */ jsxs23(
9536
+ return /* @__PURE__ */ jsxs24(
9140
9537
  "div",
9141
9538
  {
9142
9539
  ref: noteRef,
@@ -9154,14 +9551,14 @@ var StickyNote = memo26(function StickyNote2({
9154
9551
  },
9155
9552
  onClick: handleClick,
9156
9553
  children: [
9157
- /* @__PURE__ */ jsxs23(
9554
+ /* @__PURE__ */ jsxs24(
9158
9555
  "div",
9159
9556
  {
9160
9557
  className: "flex items-center justify-between px-2 py-1 border-b border-black/10 cursor-move",
9161
9558
  onMouseDown: onDragStart,
9162
9559
  onTouchStart: onDragStart,
9163
9560
  children: [
9164
- /* @__PURE__ */ jsx27("div", { className: "flex gap-1", children: NOTE_COLORS.map((color) => /* @__PURE__ */ jsx27(
9561
+ /* @__PURE__ */ jsx28("div", { className: "flex gap-1", children: NOTE_COLORS.map((color) => /* @__PURE__ */ jsx28(
9165
9562
  "button",
9166
9563
  {
9167
9564
  className: cn(
@@ -9178,8 +9575,8 @@ var StickyNote = memo26(function StickyNote2({
9178
9575
  },
9179
9576
  color
9180
9577
  )) }),
9181
- /* @__PURE__ */ jsxs23("div", { className: "flex gap-1", children: [
9182
- /* @__PURE__ */ jsx27(
9578
+ /* @__PURE__ */ jsxs24("div", { className: "flex gap-1", children: [
9579
+ /* @__PURE__ */ jsx28(
9183
9580
  "button",
9184
9581
  {
9185
9582
  className: "p-0.5 hover:bg-black/10 rounded",
@@ -9188,23 +9585,23 @@ var StickyNote = memo26(function StickyNote2({
9188
9585
  onDelete?.();
9189
9586
  },
9190
9587
  title: "Delete note",
9191
- children: /* @__PURE__ */ jsx27("svg", { className: "w-3.5 h-3.5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx27("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) })
9588
+ children: /* @__PURE__ */ jsx28("svg", { className: "w-3.5 h-3.5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx28("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" }) })
9192
9589
  }
9193
9590
  ),
9194
- /* @__PURE__ */ jsx27(
9591
+ /* @__PURE__ */ jsx28(
9195
9592
  "button",
9196
9593
  {
9197
9594
  className: "p-0.5 hover:bg-black/10 rounded",
9198
9595
  onClick: handleCollapse,
9199
9596
  title: "Collapse note",
9200
- children: /* @__PURE__ */ jsx27("svg", { className: "w-3.5 h-3.5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx27("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
9597
+ children: /* @__PURE__ */ jsx28("svg", { className: "w-3.5 h-3.5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx28("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
9201
9598
  }
9202
9599
  )
9203
9600
  ] })
9204
9601
  ]
9205
9602
  }
9206
9603
  ),
9207
- /* @__PURE__ */ jsx27("div", { className: "p-2", children: isEditing ? /* @__PURE__ */ jsx27(
9604
+ /* @__PURE__ */ jsx28("div", { className: "p-2", children: isEditing ? /* @__PURE__ */ jsx28(
9208
9605
  "textarea",
9209
9606
  {
9210
9607
  ref: textareaRef,
@@ -9219,7 +9616,7 @@ var StickyNote = memo26(function StickyNote2({
9219
9616
  onKeyDown: handleKeyDown,
9220
9617
  placeholder: "Enter note..."
9221
9618
  }
9222
- ) : /* @__PURE__ */ jsx27(
9619
+ ) : /* @__PURE__ */ jsx28(
9223
9620
  "div",
9224
9621
  {
9225
9622
  className: cn(
@@ -9230,7 +9627,7 @@ var StickyNote = memo26(function StickyNote2({
9230
9627
  children: note.content || "Double-click to edit..."
9231
9628
  }
9232
9629
  ) }),
9233
- /* @__PURE__ */ jsx27("div", { className: "px-2 pb-1 text-[10px] text-gray-500", children: new Date(note.updatedAt).toLocaleDateString() })
9630
+ /* @__PURE__ */ jsx28("div", { className: "px-2 pb-1 text-[10px] text-gray-500", children: new Date(note.updatedAt).toLocaleDateString() })
9234
9631
  ]
9235
9632
  }
9236
9633
  );
@@ -9238,8 +9635,8 @@ var StickyNote = memo26(function StickyNote2({
9238
9635
 
9239
9636
  // src/components/Annotations/DrawingCanvas.tsx
9240
9637
  init_utils();
9241
- import { memo as memo27, useRef as useRef21, useCallback as useCallback34, useState as useState23 } from "react";
9242
- import { jsx as jsx28 } from "react/jsx-runtime";
9638
+ import { memo as memo28, useRef as useRef21, useCallback as useCallback35, useState as useState23 } from "react";
9639
+ import { jsx as jsx29 } from "react/jsx-runtime";
9243
9640
  function pointsToSvgPath(points) {
9244
9641
  if (points.length === 0) return "";
9245
9642
  if (points.length === 1) {
@@ -9277,7 +9674,7 @@ function simplifyPath(points, tolerance = 1) {
9277
9674
  result.push(points[points.length - 1]);
9278
9675
  return result;
9279
9676
  }
9280
- var DrawingCanvas = memo27(function DrawingCanvas2({
9677
+ var DrawingCanvas = memo28(function DrawingCanvas2({
9281
9678
  width,
9282
9679
  height,
9283
9680
  scale,
@@ -9290,7 +9687,7 @@ var DrawingCanvas = memo27(function DrawingCanvas2({
9290
9687
  const svgRef = useRef21(null);
9291
9688
  const [isDrawing, setIsDrawing] = useState23(false);
9292
9689
  const [currentPath, setCurrentPath] = useState23([]);
9293
- const getPoint = useCallback34((e) => {
9690
+ const getPoint = useCallback35((e) => {
9294
9691
  if (!svgRef.current) return null;
9295
9692
  const svg = svgRef.current;
9296
9693
  const rect = svg.getBoundingClientRect();
@@ -9310,7 +9707,7 @@ var DrawingCanvas = memo27(function DrawingCanvas2({
9310
9707
  y: (clientY - rect.top) / scale
9311
9708
  };
9312
9709
  }, [scale]);
9313
- const handleStart = useCallback34((e) => {
9710
+ const handleStart = useCallback35((e) => {
9314
9711
  if (!isActive) return;
9315
9712
  const point = getPoint(e);
9316
9713
  if (point) {
@@ -9318,14 +9715,14 @@ var DrawingCanvas = memo27(function DrawingCanvas2({
9318
9715
  setCurrentPath([point]);
9319
9716
  }
9320
9717
  }, [isActive, getPoint]);
9321
- const handleMove = useCallback34((e) => {
9718
+ const handleMove = useCallback35((e) => {
9322
9719
  if (!isDrawing || !isActive) return;
9323
9720
  const point = getPoint(e);
9324
9721
  if (point) {
9325
9722
  setCurrentPath((prev) => [...prev, point]);
9326
9723
  }
9327
9724
  }, [isDrawing, isActive, getPoint]);
9328
- const handleEnd = useCallback34(() => {
9725
+ const handleEnd = useCallback35(() => {
9329
9726
  if (!isDrawing) return;
9330
9727
  setIsDrawing(false);
9331
9728
  if (currentPath.length >= 2) {
@@ -9334,7 +9731,7 @@ var DrawingCanvas = memo27(function DrawingCanvas2({
9334
9731
  }
9335
9732
  setCurrentPath([]);
9336
9733
  }, [isDrawing, currentPath, onDrawingComplete]);
9337
- return /* @__PURE__ */ jsx28(
9734
+ return /* @__PURE__ */ jsx29(
9338
9735
  "svg",
9339
9736
  {
9340
9737
  ref: svgRef,
@@ -9354,7 +9751,7 @@ var DrawingCanvas = memo27(function DrawingCanvas2({
9354
9751
  onTouchStart: handleStart,
9355
9752
  onTouchMove: handleMove,
9356
9753
  onTouchEnd: handleEnd,
9357
- children: isDrawing && currentPath.length > 0 && /* @__PURE__ */ jsx28(
9754
+ children: isDrawing && currentPath.length > 0 && /* @__PURE__ */ jsx29(
9358
9755
  "path",
9359
9756
  {
9360
9757
  d: pointsToSvgPath(currentPath),
@@ -9372,9 +9769,9 @@ var DrawingCanvas = memo27(function DrawingCanvas2({
9372
9769
 
9373
9770
  // src/components/Annotations/ShapeRenderer.tsx
9374
9771
  init_utils();
9375
- import { memo as memo28, useCallback as useCallback35, useState as useState24, useRef as useRef22 } from "react";
9376
- import { jsx as jsx29, jsxs as jsxs24 } from "react/jsx-runtime";
9377
- var ShapeRenderer = memo28(function ShapeRenderer2({
9772
+ import { memo as memo29, useCallback as useCallback36, useState as useState24, useRef as useRef22 } from "react";
9773
+ import { jsx as jsx30, jsxs as jsxs25 } from "react/jsx-runtime";
9774
+ var ShapeRenderer = memo29(function ShapeRenderer2({
9378
9775
  shape,
9379
9776
  scale,
9380
9777
  isSelected,
@@ -9395,7 +9792,7 @@ var ShapeRenderer = memo28(function ShapeRenderer2({
9395
9792
  const scaledWidth = width * scale;
9396
9793
  const scaledHeight = height * scale;
9397
9794
  const scaledStroke = strokeWidth * scale;
9398
- const getResizeHandles = useCallback35(() => {
9795
+ const getResizeHandles = useCallback36(() => {
9399
9796
  const handleSize = 8;
9400
9797
  const half = handleSize / 2;
9401
9798
  return [
@@ -9409,7 +9806,7 @@ var ShapeRenderer = memo28(function ShapeRenderer2({
9409
9806
  { position: "w", cursor: "ew-resize", x: scaledX - half, y: scaledY + scaledHeight / 2 - half }
9410
9807
  ];
9411
9808
  }, [scaledX, scaledY, scaledWidth, scaledHeight]);
9412
- const handleMouseDown = useCallback35((e, handle) => {
9809
+ const handleMouseDown = useCallback36((e, handle) => {
9413
9810
  e.stopPropagation();
9414
9811
  onSelect?.();
9415
9812
  if (!isEditing) return;
@@ -9485,7 +9882,7 @@ var ShapeRenderer = memo28(function ShapeRenderer2({
9485
9882
  document.addEventListener("mousemove", handleMouseMove);
9486
9883
  document.addEventListener("mouseup", handleMouseUp);
9487
9884
  }, [isEditing, x, y, width, height, scale, onSelect, onUpdate]);
9488
- const renderShape2 = useCallback35(() => {
9885
+ const renderShape2 = useCallback36(() => {
9489
9886
  const commonProps = {
9490
9887
  stroke: color,
9491
9888
  strokeWidth: scaledStroke,
@@ -9497,7 +9894,7 @@ var ShapeRenderer = memo28(function ShapeRenderer2({
9497
9894
  };
9498
9895
  switch (shapeType) {
9499
9896
  case "rect":
9500
- return /* @__PURE__ */ jsx29(
9897
+ return /* @__PURE__ */ jsx30(
9501
9898
  "rect",
9502
9899
  {
9503
9900
  x: scaledX,
@@ -9508,7 +9905,7 @@ var ShapeRenderer = memo28(function ShapeRenderer2({
9508
9905
  }
9509
9906
  );
9510
9907
  case "circle":
9511
- return /* @__PURE__ */ jsx29(
9908
+ return /* @__PURE__ */ jsx30(
9512
9909
  "ellipse",
9513
9910
  {
9514
9911
  cx: scaledX + scaledWidth / 2,
@@ -9519,7 +9916,7 @@ var ShapeRenderer = memo28(function ShapeRenderer2({
9519
9916
  }
9520
9917
  );
9521
9918
  case "line":
9522
- return /* @__PURE__ */ jsx29(
9919
+ return /* @__PURE__ */ jsx30(
9523
9920
  "line",
9524
9921
  {
9525
9922
  x1: scaledX,
@@ -9539,22 +9936,22 @@ var ShapeRenderer = memo28(function ShapeRenderer2({
9539
9936
  const arrow1Y = endY - arrowLength * Math.sin(angle - arrowAngle);
9540
9937
  const arrow2X = endX - arrowLength * Math.cos(angle + arrowAngle);
9541
9938
  const arrow2Y = endY - arrowLength * Math.sin(angle + arrowAngle);
9542
- return /* @__PURE__ */ jsxs24("g", { children: [
9543
- /* @__PURE__ */ jsx29("line", { x1: scaledX, y1: scaledY, x2: endX, y2: endY, ...commonProps }),
9544
- /* @__PURE__ */ jsx29("line", { x1: endX, y1: endY, x2: arrow1X, y2: arrow1Y, ...commonProps }),
9545
- /* @__PURE__ */ jsx29("line", { x1: endX, y1: endY, x2: arrow2X, y2: arrow2Y, ...commonProps })
9939
+ return /* @__PURE__ */ jsxs25("g", { children: [
9940
+ /* @__PURE__ */ jsx30("line", { x1: scaledX, y1: scaledY, x2: endX, y2: endY, ...commonProps }),
9941
+ /* @__PURE__ */ jsx30("line", { x1: endX, y1: endY, x2: arrow1X, y2: arrow1Y, ...commonProps }),
9942
+ /* @__PURE__ */ jsx30("line", { x1: endX, y1: endY, x2: arrow2X, y2: arrow2Y, ...commonProps })
9546
9943
  ] });
9547
9944
  default:
9548
9945
  return null;
9549
9946
  }
9550
9947
  }, [shapeType, scaledX, scaledY, scaledWidth, scaledHeight, color, scaledStroke, isSelected]);
9551
- return /* @__PURE__ */ jsxs24(
9948
+ return /* @__PURE__ */ jsxs25(
9552
9949
  "g",
9553
9950
  {
9554
9951
  className: cn("shape-renderer", className),
9555
9952
  onMouseDown: (e) => handleMouseDown(e),
9556
9953
  children: [
9557
- /* @__PURE__ */ jsx29(
9954
+ /* @__PURE__ */ jsx30(
9558
9955
  "rect",
9559
9956
  {
9560
9957
  x: scaledX - 5,
@@ -9567,7 +9964,7 @@ var ShapeRenderer = memo28(function ShapeRenderer2({
9567
9964
  }
9568
9965
  ),
9569
9966
  renderShape2(),
9570
- isSelected && /* @__PURE__ */ jsx29(
9967
+ isSelected && /* @__PURE__ */ jsx30(
9571
9968
  "rect",
9572
9969
  {
9573
9970
  x: scaledX - 2,
@@ -9580,7 +9977,7 @@ var ShapeRenderer = memo28(function ShapeRenderer2({
9580
9977
  strokeDasharray: "4 2"
9581
9978
  }
9582
9979
  ),
9583
- isSelected && isEditing && getResizeHandles().map((handle) => /* @__PURE__ */ jsx29(
9980
+ isSelected && isEditing && getResizeHandles().map((handle) => /* @__PURE__ */ jsx30(
9584
9981
  "rect",
9585
9982
  {
9586
9983
  x: handle.x,
@@ -9600,7 +9997,7 @@ var ShapeRenderer = memo28(function ShapeRenderer2({
9600
9997
  }
9601
9998
  );
9602
9999
  });
9603
- var ShapePreview = memo28(function ShapePreview2({
10000
+ var ShapePreview = memo29(function ShapePreview2({
9604
10001
  shapeType,
9605
10002
  startPoint,
9606
10003
  endPoint,
@@ -9621,9 +10018,9 @@ var ShapePreview = memo28(function ShapePreview2({
9621
10018
  };
9622
10019
  switch (shapeType) {
9623
10020
  case "rect":
9624
- return /* @__PURE__ */ jsx29("rect", { x, y, width, height, ...commonProps });
10021
+ return /* @__PURE__ */ jsx30("rect", { x, y, width, height, ...commonProps });
9625
10022
  case "circle":
9626
- return /* @__PURE__ */ jsx29(
10023
+ return /* @__PURE__ */ jsx30(
9627
10024
  "ellipse",
9628
10025
  {
9629
10026
  cx: x + width / 2,
@@ -9634,7 +10031,7 @@ var ShapePreview = memo28(function ShapePreview2({
9634
10031
  }
9635
10032
  );
9636
10033
  case "line":
9637
- return /* @__PURE__ */ jsx29(
10034
+ return /* @__PURE__ */ jsx30(
9638
10035
  "line",
9639
10036
  {
9640
10037
  x1: startPoint.x * scale,
@@ -9656,8 +10053,8 @@ var ShapePreview = memo28(function ShapePreview2({
9656
10053
  const arrow1Y = endY - arrowLength * Math.sin(angle - arrowAngle);
9657
10054
  const arrow2X = endX - arrowLength * Math.cos(angle + arrowAngle);
9658
10055
  const arrow2Y = endY - arrowLength * Math.sin(angle + arrowAngle);
9659
- return /* @__PURE__ */ jsxs24("g", { children: [
9660
- /* @__PURE__ */ jsx29(
10056
+ return /* @__PURE__ */ jsxs25("g", { children: [
10057
+ /* @__PURE__ */ jsx30(
9661
10058
  "line",
9662
10059
  {
9663
10060
  x1: startPoint.x * scale,
@@ -9667,8 +10064,8 @@ var ShapePreview = memo28(function ShapePreview2({
9667
10064
  ...commonProps
9668
10065
  }
9669
10066
  ),
9670
- /* @__PURE__ */ jsx29("line", { x1: endX, y1: endY, x2: arrow1X, y2: arrow1Y, ...commonProps }),
9671
- /* @__PURE__ */ jsx29("line", { x1: endX, y1: endY, x2: arrow2X, y2: arrow2Y, ...commonProps })
10067
+ /* @__PURE__ */ jsx30("line", { x1: endX, y1: endY, x2: arrow1X, y2: arrow1Y, ...commonProps }),
10068
+ /* @__PURE__ */ jsx30("line", { x1: endX, y1: endY, x2: arrow2X, y2: arrow2Y, ...commonProps })
9672
10069
  ] });
9673
10070
  default:
9674
10071
  return null;
@@ -9677,9 +10074,9 @@ var ShapePreview = memo28(function ShapePreview2({
9677
10074
 
9678
10075
  // src/components/Annotations/QuickNoteButton.tsx
9679
10076
  init_utils();
9680
- import { memo as memo29, useCallback as useCallback36, useState as useState25 } from "react";
9681
- import { jsx as jsx30 } from "react/jsx-runtime";
9682
- var QuickNoteButton = memo29(function QuickNoteButton2({
10077
+ import { memo as memo30, useCallback as useCallback37, useState as useState25 } from "react";
10078
+ import { jsx as jsx31 } from "react/jsx-runtime";
10079
+ var QuickNoteButton = memo30(function QuickNoteButton2({
9683
10080
  pageNumber,
9684
10081
  scale,
9685
10082
  position = "top-right",
@@ -9688,7 +10085,7 @@ var QuickNoteButton = memo29(function QuickNoteButton2({
9688
10085
  visible = true
9689
10086
  }) {
9690
10087
  const [isHovered, setIsHovered] = useState25(false);
9691
- const handleClick = useCallback36(
10088
+ const handleClick = useCallback37(
9692
10089
  (e) => {
9693
10090
  e.stopPropagation();
9694
10091
  const x = position === "top-right" ? 80 : 80;
@@ -9700,7 +10097,7 @@ var QuickNoteButton = memo29(function QuickNoteButton2({
9700
10097
  if (!visible) {
9701
10098
  return null;
9702
10099
  }
9703
- return /* @__PURE__ */ jsx30(
10100
+ return /* @__PURE__ */ jsx31(
9704
10101
  "button",
9705
10102
  {
9706
10103
  onClick: handleClick,
@@ -9722,7 +10119,7 @@ var QuickNoteButton = memo29(function QuickNoteButton2({
9722
10119
  ),
9723
10120
  title: "Add quick note",
9724
10121
  "aria-label": "Add quick note",
9725
- children: /* @__PURE__ */ jsx30(
10122
+ children: /* @__PURE__ */ jsx31(
9726
10123
  "svg",
9727
10124
  {
9728
10125
  className: "w-4 h-4 text-yellow-900",
@@ -9730,7 +10127,7 @@ var QuickNoteButton = memo29(function QuickNoteButton2({
9730
10127
  viewBox: "0 0 24 24",
9731
10128
  stroke: "currentColor",
9732
10129
  strokeWidth: 2,
9733
- children: /* @__PURE__ */ jsx30("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" })
10130
+ children: /* @__PURE__ */ jsx31("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" })
9734
10131
  }
9735
10132
  )
9736
10133
  }
@@ -9739,9 +10136,9 @@ var QuickNoteButton = memo29(function QuickNoteButton2({
9739
10136
 
9740
10137
  // src/components/Annotations/QuickNotePopover.tsx
9741
10138
  init_utils();
9742
- import { memo as memo30, useCallback as useCallback37, useState as useState26, useRef as useRef23, useEffect as useEffect24 } from "react";
9743
- import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
9744
- var QuickNotePopover = memo30(function QuickNotePopover2({
10139
+ import { memo as memo31, useCallback as useCallback38, useState as useState26, useRef as useRef23, useEffect as useEffect24 } from "react";
10140
+ import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
10141
+ var QuickNotePopover = memo31(function QuickNotePopover2({
9745
10142
  visible,
9746
10143
  position,
9747
10144
  initialContent = "",
@@ -9783,14 +10180,14 @@ var QuickNotePopover = memo30(function QuickNotePopover2({
9783
10180
  }
9784
10181
  setAdjustedPosition({ x, y });
9785
10182
  }, [position, visible]);
9786
- const handleSave = useCallback37(() => {
10183
+ const handleSave = useCallback38(() => {
9787
10184
  if (content.trim()) {
9788
10185
  onSave(content.trim());
9789
10186
  } else {
9790
10187
  onCancel();
9791
10188
  }
9792
10189
  }, [content, onSave, onCancel]);
9793
- const handleKeyDown = useCallback37(
10190
+ const handleKeyDown = useCallback38(
9794
10191
  (e) => {
9795
10192
  if (e.key === "Enter" && (e.ctrlKey || e.metaKey)) {
9796
10193
  e.preventDefault();
@@ -9805,7 +10202,7 @@ var QuickNotePopover = memo30(function QuickNotePopover2({
9805
10202
  if (!visible) {
9806
10203
  return null;
9807
10204
  }
9808
- return /* @__PURE__ */ jsxs25(
10205
+ return /* @__PURE__ */ jsxs26(
9809
10206
  "div",
9810
10207
  {
9811
10208
  ref: popoverRef,
@@ -9824,15 +10221,15 @@ var QuickNotePopover = memo30(function QuickNotePopover2({
9824
10221
  top: adjustedPosition.y
9825
10222
  },
9826
10223
  children: [
9827
- agentLastStatement && /* @__PURE__ */ jsx31("div", { className: "mb-2 p-2 bg-blue-50 dark:bg-blue-900/50 rounded text-xs text-blue-600 dark:text-blue-300 border border-blue-100 dark:border-blue-800", children: /* @__PURE__ */ jsxs25("div", { className: "flex items-start gap-1", children: [
9828
- /* @__PURE__ */ jsx31("svg", { className: "w-3 h-3 mt-0.5 flex-shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx31("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) }),
9829
- /* @__PURE__ */ jsxs25("span", { className: "line-clamp-2", children: [
10224
+ agentLastStatement && /* @__PURE__ */ jsx32("div", { className: "mb-2 p-2 bg-blue-50 dark:bg-blue-900/50 rounded text-xs text-blue-600 dark:text-blue-300 border border-blue-100 dark:border-blue-800", children: /* @__PURE__ */ jsxs26("div", { className: "flex items-start gap-1", children: [
10225
+ /* @__PURE__ */ jsx32("svg", { className: "w-3 h-3 mt-0.5 flex-shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx32("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" }) }),
10226
+ /* @__PURE__ */ jsxs26("span", { className: "line-clamp-2", children: [
9830
10227
  "AI discussed: \u201C",
9831
10228
  agentLastStatement,
9832
10229
  "\u201D"
9833
10230
  ] })
9834
10231
  ] }) }),
9835
- /* @__PURE__ */ jsx31(
10232
+ /* @__PURE__ */ jsx32(
9836
10233
  "textarea",
9837
10234
  {
9838
10235
  ref: textareaRef,
@@ -9851,13 +10248,13 @@ var QuickNotePopover = memo30(function QuickNotePopover2({
9851
10248
  )
9852
10249
  }
9853
10250
  ),
9854
- /* @__PURE__ */ jsxs25("div", { className: "flex items-center justify-between mt-2", children: [
9855
- /* @__PURE__ */ jsxs25("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
10251
+ /* @__PURE__ */ jsxs26("div", { className: "flex items-center justify-between mt-2", children: [
10252
+ /* @__PURE__ */ jsxs26("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: [
9856
10253
  navigator.platform.includes("Mac") ? "\u2318" : "Ctrl",
9857
10254
  "+Enter to save"
9858
10255
  ] }),
9859
- /* @__PURE__ */ jsxs25("div", { className: "flex gap-2", children: [
9860
- /* @__PURE__ */ jsx31(
10256
+ /* @__PURE__ */ jsxs26("div", { className: "flex gap-2", children: [
10257
+ /* @__PURE__ */ jsx32(
9861
10258
  "button",
9862
10259
  {
9863
10260
  onClick: onCancel,
@@ -9870,7 +10267,7 @@ var QuickNotePopover = memo30(function QuickNotePopover2({
9870
10267
  children: "Cancel"
9871
10268
  }
9872
10269
  ),
9873
- /* @__PURE__ */ jsx31(
10270
+ /* @__PURE__ */ jsx32(
9874
10271
  "button",
9875
10272
  {
9876
10273
  onClick: handleSave,
@@ -9894,9 +10291,9 @@ var QuickNotePopover = memo30(function QuickNotePopover2({
9894
10291
 
9895
10292
  // src/components/AskAbout/AskAboutOverlay.tsx
9896
10293
  init_utils();
9897
- import { memo as memo31 } from "react";
9898
- import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
9899
- var AskAboutOverlay = memo31(function AskAboutOverlay2({
10294
+ import { memo as memo32 } from "react";
10295
+ import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
10296
+ var AskAboutOverlay = memo32(function AskAboutOverlay2({
9900
10297
  visible,
9901
10298
  progress,
9902
10299
  position,
@@ -9910,7 +10307,7 @@ var AskAboutOverlay = memo31(function AskAboutOverlay2({
9910
10307
  const radius = (size - strokeWidth) / 2;
9911
10308
  const circumference = 2 * Math.PI * radius;
9912
10309
  const strokeDashoffset = circumference * (1 - progress);
9913
- return /* @__PURE__ */ jsxs26(
10310
+ return /* @__PURE__ */ jsxs27(
9914
10311
  "div",
9915
10312
  {
9916
10313
  className: cn(
@@ -9923,7 +10320,7 @@ var AskAboutOverlay = memo31(function AskAboutOverlay2({
9923
10320
  top: position.y - size / 2
9924
10321
  },
9925
10322
  children: [
9926
- /* @__PURE__ */ jsxs26(
10323
+ /* @__PURE__ */ jsxs27(
9927
10324
  "svg",
9928
10325
  {
9929
10326
  width: size,
@@ -9931,7 +10328,7 @@ var AskAboutOverlay = memo31(function AskAboutOverlay2({
9931
10328
  viewBox: `0 0 ${size} ${size}`,
9932
10329
  className: "transform -rotate-90",
9933
10330
  children: [
9934
- /* @__PURE__ */ jsx32(
10331
+ /* @__PURE__ */ jsx33(
9935
10332
  "circle",
9936
10333
  {
9937
10334
  cx: size / 2,
@@ -9942,7 +10339,7 @@ var AskAboutOverlay = memo31(function AskAboutOverlay2({
9942
10339
  strokeWidth
9943
10340
  }
9944
10341
  ),
9945
- /* @__PURE__ */ jsx32(
10342
+ /* @__PURE__ */ jsx33(
9946
10343
  "circle",
9947
10344
  {
9948
10345
  cx: size / 2,
@@ -9960,12 +10357,12 @@ var AskAboutOverlay = memo31(function AskAboutOverlay2({
9960
10357
  ]
9961
10358
  }
9962
10359
  ),
9963
- /* @__PURE__ */ jsx32(
10360
+ /* @__PURE__ */ jsx33(
9964
10361
  "div",
9965
10362
  {
9966
10363
  className: "absolute inset-0 flex items-center justify-center",
9967
10364
  style: { color: progress >= 1 ? "#22c55e" : "white" },
9968
- children: progress >= 1 ? /* @__PURE__ */ jsx32(
10365
+ children: progress >= 1 ? /* @__PURE__ */ jsx33(
9969
10366
  "svg",
9970
10367
  {
9971
10368
  width: "24",
@@ -9976,9 +10373,9 @@ var AskAboutOverlay = memo31(function AskAboutOverlay2({
9976
10373
  strokeWidth: "2",
9977
10374
  strokeLinecap: "round",
9978
10375
  strokeLinejoin: "round",
9979
- children: /* @__PURE__ */ jsx32("polyline", { points: "20 6 9 17 4 12" })
10376
+ children: /* @__PURE__ */ jsx33("polyline", { points: "20 6 9 17 4 12" })
9980
10377
  }
9981
- ) : /* @__PURE__ */ jsxs26(
10378
+ ) : /* @__PURE__ */ jsxs27(
9982
10379
  "svg",
9983
10380
  {
9984
10381
  width: "20",
@@ -9990,9 +10387,9 @@ var AskAboutOverlay = memo31(function AskAboutOverlay2({
9990
10387
  strokeLinecap: "round",
9991
10388
  strokeLinejoin: "round",
9992
10389
  children: [
9993
- /* @__PURE__ */ jsx32("circle", { cx: "12", cy: "12", r: "10" }),
9994
- /* @__PURE__ */ jsx32("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
9995
- /* @__PURE__ */ jsx32("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
10390
+ /* @__PURE__ */ jsx33("circle", { cx: "12", cy: "12", r: "10" }),
10391
+ /* @__PURE__ */ jsx33("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }),
10392
+ /* @__PURE__ */ jsx33("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
9996
10393
  ]
9997
10394
  }
9998
10395
  )
@@ -10005,9 +10402,9 @@ var AskAboutOverlay = memo31(function AskAboutOverlay2({
10005
10402
 
10006
10403
  // src/components/AskAbout/AskAboutTrigger.tsx
10007
10404
  init_utils();
10008
- import { memo as memo32, useCallback as useCallback38, useState as useState27, useRef as useRef24, useEffect as useEffect25 } from "react";
10009
- import { jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
10010
- var AskAboutTrigger = memo32(function AskAboutTrigger2({
10405
+ import { memo as memo33, useCallback as useCallback39, useState as useState27, useRef as useRef24, useEffect as useEffect25 } from "react";
10406
+ import { jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
10407
+ var AskAboutTrigger = memo33(function AskAboutTrigger2({
10011
10408
  position,
10012
10409
  onConfirm,
10013
10410
  onCancel,
@@ -10038,14 +10435,14 @@ var AskAboutTrigger = memo32(function AskAboutTrigger2({
10038
10435
  const timer = setTimeout(onCancel, autoHideDelay);
10039
10436
  return () => clearTimeout(timer);
10040
10437
  }, [visible, autoHideDelay, onCancel]);
10041
- const handleConfirm = useCallback38(
10438
+ const handleConfirm = useCallback39(
10042
10439
  (e) => {
10043
10440
  e.stopPropagation();
10044
10441
  onConfirm();
10045
10442
  },
10046
10443
  [onConfirm]
10047
10444
  );
10048
- const handleCancel = useCallback38(
10445
+ const handleCancel = useCallback39(
10049
10446
  (e) => {
10050
10447
  e.stopPropagation();
10051
10448
  onCancel();
@@ -10055,7 +10452,7 @@ var AskAboutTrigger = memo32(function AskAboutTrigger2({
10055
10452
  if (!visible) {
10056
10453
  return null;
10057
10454
  }
10058
- return /* @__PURE__ */ jsxs27(
10455
+ return /* @__PURE__ */ jsxs28(
10059
10456
  "div",
10060
10457
  {
10061
10458
  ref: triggerRef,
@@ -10074,8 +10471,8 @@ var AskAboutTrigger = memo32(function AskAboutTrigger2({
10074
10471
  transform: "translate(-50%, 0)"
10075
10472
  },
10076
10473
  children: [
10077
- /* @__PURE__ */ jsx33("span", { className: "text-sm text-gray-600 dark:text-gray-300 px-2", children: "Ask about this?" }),
10078
- /* @__PURE__ */ jsx33(
10474
+ /* @__PURE__ */ jsx34("span", { className: "text-sm text-gray-600 dark:text-gray-300 px-2", children: "Ask about this?" }),
10475
+ /* @__PURE__ */ jsx34(
10079
10476
  "button",
10080
10477
  {
10081
10478
  onClick: handleConfirm,
@@ -10088,7 +10485,7 @@ var AskAboutTrigger = memo32(function AskAboutTrigger2({
10088
10485
  children: "Ask"
10089
10486
  }
10090
10487
  ),
10091
- /* @__PURE__ */ jsx33(
10488
+ /* @__PURE__ */ jsx34(
10092
10489
  "button",
10093
10490
  {
10094
10491
  onClick: handleCancel,
@@ -10110,9 +10507,9 @@ var AskAboutTrigger = memo32(function AskAboutTrigger2({
10110
10507
  // src/components/Minimap/Minimap.tsx
10111
10508
  init_hooks();
10112
10509
  init_utils();
10113
- import { memo as memo33, useMemo as useMemo14, useCallback as useCallback39 } from "react";
10114
- import { Fragment as Fragment3, jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
10115
- var PageIndicator = memo33(function PageIndicator2({
10510
+ import { memo as memo34, useMemo as useMemo14, useCallback as useCallback40 } from "react";
10511
+ import { Fragment as Fragment3, jsx as jsx35, jsxs as jsxs29 } from "react/jsx-runtime";
10512
+ var PageIndicator = memo34(function PageIndicator2({
10116
10513
  pageNumber,
10117
10514
  status,
10118
10515
  isBookmarked,
@@ -10126,7 +10523,7 @@ var PageIndicator = memo33(function PageIndicator2({
10126
10523
  if (status === "visited") return "bg-green-400";
10127
10524
  return "bg-gray-200 dark:bg-gray-700";
10128
10525
  };
10129
- return /* @__PURE__ */ jsxs28(
10526
+ return /* @__PURE__ */ jsxs29(
10130
10527
  "button",
10131
10528
  {
10132
10529
  onClick,
@@ -10142,13 +10539,13 @@ var PageIndicator = memo33(function PageIndicator2({
10142
10539
  title: `Page ${pageNumber}${isBookmarked ? " (bookmarked)" : ""}`,
10143
10540
  "aria-label": `Go to page ${pageNumber}`,
10144
10541
  children: [
10145
- isBookmarked && !compact && /* @__PURE__ */ jsx34("div", { className: "absolute -top-1 -right-1 w-2 h-2 bg-yellow-500 rounded-full border border-white" }),
10146
- showNumber && !compact && /* @__PURE__ */ jsx34("span", { className: "absolute inset-0 flex items-center justify-center text-[8px] font-medium text-white", children: pageNumber })
10542
+ isBookmarked && !compact && /* @__PURE__ */ jsx35("div", { className: "absolute -top-1 -right-1 w-2 h-2 bg-yellow-500 rounded-full border border-white" }),
10543
+ showNumber && !compact && /* @__PURE__ */ jsx35("span", { className: "absolute inset-0 flex items-center justify-center text-[8px] font-medium text-white", children: pageNumber })
10147
10544
  ]
10148
10545
  }
10149
10546
  );
10150
10547
  });
10151
- var Minimap = memo33(function Minimap2({
10548
+ var Minimap = memo34(function Minimap2({
10152
10549
  variant = "sidebar",
10153
10550
  floatingPosition = "right",
10154
10551
  maxHeight = 300,
@@ -10165,14 +10562,14 @@ var Minimap = memo33(function Minimap2({
10165
10562
  return new Set(bookmarks.map((b) => b.pageNumber));
10166
10563
  }, [bookmarks]);
10167
10564
  const compact = numPages > 50;
10168
- const handlePageClick = useCallback39(
10565
+ const handlePageClick = useCallback40(
10169
10566
  (pageNumber) => {
10170
10567
  goToPage(pageNumber);
10171
10568
  onPageClick?.(pageNumber);
10172
10569
  },
10173
10570
  [goToPage, onPageClick]
10174
10571
  );
10175
- const getPageStatus = useCallback39(
10572
+ const getPageStatus = useCallback40(
10176
10573
  (pageNumber) => {
10177
10574
  if (pageNumber === currentPage) return "current";
10178
10575
  if (bookmarkedPages.has(pageNumber)) return "bookmarked";
@@ -10185,7 +10582,7 @@ var Minimap = memo33(function Minimap2({
10185
10582
  const pages = [];
10186
10583
  for (let i = 1; i <= numPages; i++) {
10187
10584
  pages.push(
10188
- /* @__PURE__ */ jsx34(
10585
+ /* @__PURE__ */ jsx35(
10189
10586
  PageIndicator,
10190
10587
  {
10191
10588
  pageNumber: i,
@@ -10206,16 +10603,16 @@ var Minimap = memo33(function Minimap2({
10206
10603
  if (numPages === 0) {
10207
10604
  return null;
10208
10605
  }
10209
- const content = /* @__PURE__ */ jsxs28(Fragment3, { children: [
10210
- /* @__PURE__ */ jsxs28("div", { className: "mb-3", children: [
10211
- /* @__PURE__ */ jsxs28("div", { className: "flex items-center justify-between text-xs text-gray-500 dark:text-gray-400 mb-1", children: [
10212
- /* @__PURE__ */ jsx34("span", { children: "Progress" }),
10213
- /* @__PURE__ */ jsxs28("span", { children: [
10606
+ const content = /* @__PURE__ */ jsxs29(Fragment3, { children: [
10607
+ /* @__PURE__ */ jsxs29("div", { className: "mb-3", children: [
10608
+ /* @__PURE__ */ jsxs29("div", { className: "flex items-center justify-between text-xs text-gray-500 dark:text-gray-400 mb-1", children: [
10609
+ /* @__PURE__ */ jsx35("span", { children: "Progress" }),
10610
+ /* @__PURE__ */ jsxs29("span", { children: [
10214
10611
  progressPercentage,
10215
10612
  "%"
10216
10613
  ] })
10217
10614
  ] }),
10218
- /* @__PURE__ */ jsx34("div", { className: "h-1.5 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx34(
10615
+ /* @__PURE__ */ jsx35("div", { className: "h-1.5 bg-gray-200 dark:bg-gray-700 rounded-full overflow-hidden", children: /* @__PURE__ */ jsx35(
10219
10616
  "div",
10220
10617
  {
10221
10618
  className: "h-full bg-green-500 rounded-full transition-all duration-300",
@@ -10223,7 +10620,7 @@ var Minimap = memo33(function Minimap2({
10223
10620
  }
10224
10621
  ) })
10225
10622
  ] }),
10226
- /* @__PURE__ */ jsx34(
10623
+ /* @__PURE__ */ jsx35(
10227
10624
  "div",
10228
10625
  {
10229
10626
  className: cn(
@@ -10234,21 +10631,21 @@ var Minimap = memo33(function Minimap2({
10234
10631
  children: pageIndicators
10235
10632
  }
10236
10633
  ),
10237
- /* @__PURE__ */ jsx34("div", { className: "mt-3 pt-2 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ jsxs28("div", { className: "flex flex-wrap gap-3 text-xs text-gray-500 dark:text-gray-400", children: [
10238
- /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-1", children: [
10239
- /* @__PURE__ */ jsx34("div", { className: "w-2 h-2 rounded-sm bg-blue-500" }),
10240
- /* @__PURE__ */ jsx34("span", { children: "Current" })
10634
+ /* @__PURE__ */ jsx35("div", { className: "mt-3 pt-2 border-t border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ jsxs29("div", { className: "flex flex-wrap gap-3 text-xs text-gray-500 dark:text-gray-400", children: [
10635
+ /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-1", children: [
10636
+ /* @__PURE__ */ jsx35("div", { className: "w-2 h-2 rounded-sm bg-blue-500" }),
10637
+ /* @__PURE__ */ jsx35("span", { children: "Current" })
10241
10638
  ] }),
10242
- /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-1", children: [
10243
- /* @__PURE__ */ jsx34("div", { className: "w-2 h-2 rounded-sm bg-green-400" }),
10244
- /* @__PURE__ */ jsx34("span", { children: "Visited" })
10639
+ /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-1", children: [
10640
+ /* @__PURE__ */ jsx35("div", { className: "w-2 h-2 rounded-sm bg-green-400" }),
10641
+ /* @__PURE__ */ jsx35("span", { children: "Visited" })
10245
10642
  ] }),
10246
- /* @__PURE__ */ jsxs28("div", { className: "flex items-center gap-1", children: [
10247
- /* @__PURE__ */ jsx34("div", { className: "w-2 h-2 rounded-sm bg-yellow-400" }),
10248
- /* @__PURE__ */ jsx34("span", { children: "Bookmarked" })
10643
+ /* @__PURE__ */ jsxs29("div", { className: "flex items-center gap-1", children: [
10644
+ /* @__PURE__ */ jsx35("div", { className: "w-2 h-2 rounded-sm bg-yellow-400" }),
10645
+ /* @__PURE__ */ jsx35("span", { children: "Bookmarked" })
10249
10646
  ] })
10250
10647
  ] }) }),
10251
- /* @__PURE__ */ jsxs28("div", { className: "mt-2 text-xs text-gray-500 dark:text-gray-400", children: [
10648
+ /* @__PURE__ */ jsxs29("div", { className: "mt-2 text-xs text-gray-500 dark:text-gray-400", children: [
10252
10649
  visitedCount,
10253
10650
  " of ",
10254
10651
  numPages,
@@ -10256,7 +10653,7 @@ var Minimap = memo33(function Minimap2({
10256
10653
  ] })
10257
10654
  ] });
10258
10655
  if (variant === "floating") {
10259
- return /* @__PURE__ */ jsxs28(
10656
+ return /* @__PURE__ */ jsxs29(
10260
10657
  "div",
10261
10658
  {
10262
10659
  className: cn(
@@ -10272,13 +10669,13 @@ var Minimap = memo33(function Minimap2({
10272
10669
  ),
10273
10670
  style: { maxHeight },
10274
10671
  children: [
10275
- /* @__PURE__ */ jsx34("h3", { className: "text-sm font-semibold text-gray-700 dark:text-gray-200 mb-2", children: "Reading Progress" }),
10672
+ /* @__PURE__ */ jsx35("h3", { className: "text-sm font-semibold text-gray-700 dark:text-gray-200 mb-2", children: "Reading Progress" }),
10276
10673
  content
10277
10674
  ]
10278
10675
  }
10279
10676
  );
10280
10677
  }
10281
- return /* @__PURE__ */ jsx34(
10678
+ return /* @__PURE__ */ jsx35(
10282
10679
  "div",
10283
10680
  {
10284
10681
  className: cn(
@@ -10292,10 +10689,13 @@ var Minimap = memo33(function Minimap2({
10292
10689
  );
10293
10690
  });
10294
10691
 
10692
+ // src/components/index.ts
10693
+ init_FloatingZoomControls2();
10694
+
10295
10695
  // src/components/ErrorBoundary/PDFErrorBoundary.tsx
10296
10696
  init_utils();
10297
10697
  import { Component } from "react";
10298
- import { jsx as jsx35, jsxs as jsxs29 } from "react/jsx-runtime";
10698
+ import { jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
10299
10699
  var PDFErrorBoundary = class extends Component {
10300
10700
  constructor(props) {
10301
10701
  super(props);
@@ -10323,7 +10723,7 @@ var PDFErrorBoundary = class extends Component {
10323
10723
  return fallback;
10324
10724
  }
10325
10725
  if (showDefaultUI) {
10326
- return /* @__PURE__ */ jsx35(
10726
+ return /* @__PURE__ */ jsx36(
10327
10727
  DefaultErrorUI,
10328
10728
  {
10329
10729
  error,
@@ -10342,7 +10742,7 @@ function DefaultErrorUI({ error, onReset, className }) {
10342
10742
  const isNetworkError = error.message.includes("fetch") || error.message.includes("network") || error.message.includes("Failed to load");
10343
10743
  let title = "Something went wrong";
10344
10744
  let description = error.message;
10345
- let icon = /* @__PURE__ */ jsx35("svg", { className: "w-12 h-12 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx35(
10745
+ let icon = /* @__PURE__ */ jsx36("svg", { className: "w-12 h-12 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx36(
10346
10746
  "path",
10347
10747
  {
10348
10748
  strokeLinecap: "round",
@@ -10354,7 +10754,7 @@ function DefaultErrorUI({ error, onReset, className }) {
10354
10754
  if (isPDFError) {
10355
10755
  title = "Unable to load PDF";
10356
10756
  description = "The PDF file could not be loaded. It may be corrupted or in an unsupported format.";
10357
- icon = /* @__PURE__ */ jsx35("svg", { className: "w-12 h-12 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx35(
10757
+ icon = /* @__PURE__ */ jsx36("svg", { className: "w-12 h-12 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx36(
10358
10758
  "path",
10359
10759
  {
10360
10760
  strokeLinecap: "round",
@@ -10366,7 +10766,7 @@ function DefaultErrorUI({ error, onReset, className }) {
10366
10766
  } else if (isNetworkError) {
10367
10767
  title = "Network error";
10368
10768
  description = "Unable to fetch the PDF file. Please check your internet connection and try again.";
10369
- icon = /* @__PURE__ */ jsx35("svg", { className: "w-12 h-12 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx35(
10769
+ icon = /* @__PURE__ */ jsx36("svg", { className: "w-12 h-12 text-red-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ jsx36(
10370
10770
  "path",
10371
10771
  {
10372
10772
  strokeLinecap: "round",
@@ -10376,7 +10776,7 @@ function DefaultErrorUI({ error, onReset, className }) {
10376
10776
  }
10377
10777
  ) });
10378
10778
  }
10379
- return /* @__PURE__ */ jsxs29(
10779
+ return /* @__PURE__ */ jsxs30(
10380
10780
  "div",
10381
10781
  {
10382
10782
  className: cn(
@@ -10389,14 +10789,14 @@ function DefaultErrorUI({ error, onReset, className }) {
10389
10789
  ),
10390
10790
  children: [
10391
10791
  icon,
10392
- /* @__PURE__ */ jsx35("h2", { className: "mt-4 text-xl font-semibold text-gray-900 dark:text-gray-100", children: title }),
10393
- /* @__PURE__ */ jsx35("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400 max-w-md", children: description }),
10394
- /* @__PURE__ */ jsxs29("details", { className: "mt-4 text-left max-w-md w-full", children: [
10395
- /* @__PURE__ */ jsx35("summary", { className: "cursor-pointer text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200", children: "Technical details" }),
10396
- /* @__PURE__ */ jsx35("pre", { className: "mt-2 p-2 bg-gray-100 dark:bg-gray-800 rounded text-xs overflow-auto", children: error.stack || error.message })
10792
+ /* @__PURE__ */ jsx36("h2", { className: "mt-4 text-xl font-semibold text-gray-900 dark:text-gray-100", children: title }),
10793
+ /* @__PURE__ */ jsx36("p", { className: "mt-2 text-sm text-gray-600 dark:text-gray-400 max-w-md", children: description }),
10794
+ /* @__PURE__ */ jsxs30("details", { className: "mt-4 text-left max-w-md w-full", children: [
10795
+ /* @__PURE__ */ jsx36("summary", { className: "cursor-pointer text-sm text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200", children: "Technical details" }),
10796
+ /* @__PURE__ */ jsx36("pre", { className: "mt-2 p-2 bg-gray-100 dark:bg-gray-800 rounded text-xs overflow-auto", children: error.stack || error.message })
10397
10797
  ] }),
10398
- /* @__PURE__ */ jsxs29("div", { className: "mt-6 flex gap-3", children: [
10399
- /* @__PURE__ */ jsx35(
10798
+ /* @__PURE__ */ jsxs30("div", { className: "mt-6 flex gap-3", children: [
10799
+ /* @__PURE__ */ jsx36(
10400
10800
  "button",
10401
10801
  {
10402
10802
  onClick: onReset,
@@ -10410,7 +10810,7 @@ function DefaultErrorUI({ error, onReset, className }) {
10410
10810
  children: "Try again"
10411
10811
  }
10412
10812
  ),
10413
- /* @__PURE__ */ jsx35(
10813
+ /* @__PURE__ */ jsx36(
10414
10814
  "button",
10415
10815
  {
10416
10816
  onClick: () => window.location.reload(),
@@ -10430,7 +10830,7 @@ function DefaultErrorUI({ error, onReset, className }) {
10430
10830
  );
10431
10831
  }
10432
10832
  function withErrorBoundary({ component, ...props }) {
10433
- return /* @__PURE__ */ jsx35(PDFErrorBoundary, { ...props, children: component });
10833
+ return /* @__PURE__ */ jsx36(PDFErrorBoundary, { ...props, children: component });
10434
10834
  }
10435
10835
 
10436
10836
  // src/index.ts
@@ -10453,6 +10853,7 @@ export {
10453
10853
  DocumentContainer,
10454
10854
  DrawingCanvas,
10455
10855
  DualPageContainer,
10856
+ FloatingZoomControls,
10456
10857
  FocusRegionLayer,
10457
10858
  HighlightLayer,
10458
10859
  HighlightPopover,