@nxgt/material 3.62.0 → 3.64.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/CHANGELOG.md +33 -0
- package/README.md +1 -1
- package/dist/alert-dialog-RHm6WtQj.js +189 -0
- package/dist/{async-slice-HJY_VJjD.js → async-slice-DmX59NyA.js} +3 -4
- package/dist/{button-7BuUCGRm.js → button-DfS_amfQ.js} +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-kQOrHlDX.js → chip-Cbndukko.js} +2 -2
- package/dist/{code-editor-Ckc9TTCM.js → code-editor-B0tN8Ha_.js} +11 -11
- package/dist/code-editor.js +5 -5
- package/dist/{code-language-items-rCPB0Xee.js → code-language-items-andgHKrM.js} +2 -2
- package/dist/components/ui/layout/sidebar/sidebar-tokens.css +13 -1
- package/dist/{components-TDDUQ1Y0.js → components-2kTVPsMg.js} +15801 -15541
- package/dist/components.js +28 -26
- package/dist/dialog-Bd7Hid2L.js +219 -0
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-CiobN1wi.js → dropdown-menu-_SyVmSuy.js} +1 -1
- package/dist/editor.js +707 -706
- package/dist/{empty-state-DA517HAb.js → empty-state-D-2ZMXXJ.js} +2 -2
- package/dist/escape-owner-DpaP0lm1.js +19 -0
- package/dist/{field-blur-DdvY0NQQ.js → field-blur-DyOByjzw.js} +1 -1
- package/dist/{field-blur-context-DbJQZkEB.js → field-blur-context-DPe5_Nv5.js} +1 -1
- package/dist/hooks-a7_exKWS.js +329 -0
- package/dist/hooks.js +3 -3
- package/dist/{hover-card-DPs9huSs.js → hover-card-D_0smKBQ.js} +2 -2
- package/dist/i18n.js +8 -10
- package/dist/{icon-badge-C646JTOI.js → icon-badge-CBCU3ySF.js} +14 -14
- package/dist/{icon-button-DvP0Gy3j.js → icon-button-hKHsWTAt.js} +1 -1
- package/dist/lib/components/ui/actions/load-more-footer/load-more-footer.d.ts +11 -2
- package/dist/lib/components/ui/actions/load-more-footer/use-footer-focus.d.ts +15 -0
- package/dist/lib/components/ui/actions/load-more-footer/use-last-page.d.ts +9 -0
- package/dist/lib/components/ui/collections/filter/bar/partials/filter-inline-chips.d.ts +11 -0
- package/dist/lib/components/ui/collections/filter/bar/partials/filter-inline-list.d.ts +6 -0
- package/dist/lib/components/ui/collections/server-table/partials/server-table-grid-paging.d.ts +9 -0
- package/dist/lib/components/ui/collections/server-table/partials/server-table-load-more.d.ts +17 -0
- package/dist/lib/components/ui/collections/server-table/types-paging.d.ts +10 -0
- package/dist/lib/components/ui/feedback/index.d.ts +1 -0
- package/dist/lib/components/ui/feedback/unsaved-dialog/index.d.ts +1 -0
- package/dist/lib/components/ui/feedback/unsaved-dialog/unsaved-dialog.d.ts +20 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/fields/textarea-field/textarea-footer.d.ts +2 -1
- package/dist/lib/components/ui/widgets/education/questions/index.d.ts +3 -1
- package/dist/lib/components/ui/widgets/education/questions/partials/question-content.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/partials/question-top.d.ts +6 -0
- package/dist/lib/components/ui/widgets/education/questions/question-long-text.d.ts +5 -0
- package/dist/lib/components/ui/widgets/education/questions/question-media-content.d.ts +24 -0
- package/dist/lib/components/ui/widgets/education/questions/question-media-helpers.d.ts +11 -0
- package/dist/lib/components/ui/widgets/education/questions/question-media-view.d.ts +18 -0
- package/dist/lib/components/ui/widgets/education/questions/question-media-view.types.d.ts +32 -0
- package/dist/lib/components/ui/widgets/education/questions/question-options.d.ts +2 -2
- package/dist/lib/components/ui/widgets/education/questions/question-text.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/question.d.ts +1 -1
- package/dist/lib/components/ui/widgets/education/questions/types.d.ts +52 -1
- package/dist/lib/components/ui/widgets/education/questions/use-reload-focus.d.ts +13 -0
- package/dist/lib/hooks/index.d.ts +3 -0
- package/dist/lib/hooks/unsaved-guard-rules.d.ts +30 -0
- package/dist/lib/hooks/use-react-router-block.d.ts +11 -0
- package/dist/lib/hooks/use-unsaved-guard/guard-core.d.ts +30 -0
- package/dist/lib/hooks/use-unsaved-guard/index.d.ts +3 -0
- package/dist/lib/hooks/use-unsaved-guard/types.d.ts +63 -0
- package/dist/lib/hooks/use-unsaved-guard/use-discard-guard.d.ts +15 -0
- package/dist/lib/hooks/use-unsaved-guard/use-unsaved-guard.d.ts +19 -0
- package/dist/lib/i18n/resources/en/en.d.ts +20 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +21 -1
- package/dist/lib/i18n/resources/fr/fr.d.ts +20 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +21 -1
- package/dist/lib/i18n/resources/resources.d.ts +40 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +42 -43
- package/dist/map.js +63 -63
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +1 -2
- package/dist/{public-BYsrhyPW.js → public-D8JGp3PH.js} +823 -822
- package/dist/{rich-code-block-WJxDWPPY.js → rich-code-block-0R3bidsM.js} +5 -5
- package/dist/{sortable-provider-oPjlhlZo.js → sortable-provider-B75v53sB.js} +2 -2
- package/dist/{spinner-C5lObWXT.js → spinner-CAnpF3RK.js} +1 -1
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-CPEq5JG-.js → theme-toggle-pQ5F602V.js} +1 -1
- package/dist/{toolbar-items-ByvXcMHm.js → toolbar-items-_ezD5B0r.js} +4 -4
- package/dist/translate-material-CvZK8_S6.js +96 -0
- package/dist/{stored-language-B-tiWZU2.js → translator-Caf-d96e.js} +2497 -8
- package/dist/{escape-owner-r57kuPjn.js → typography-CEK19bj8.js} +17 -34
- package/dist/{use-chat-composer-CzOVaIed.js → use-chat-composer-Dpvi_-CR.js} +5164 -5338
- package/dist/{use-heading-spy-BOtygPFu.js → use-heading-spy-mmcyEGmm.js} +186 -71
- package/dist/{use-material-translation-B5j3jZs7.js → use-material-translation-C_1cWRzW.js} +1 -2
- package/dist/use-return-focus-1ZIchrBM.js +269 -0
- package/docs/components/buttons-and-actions.md +2 -2
- package/docs/components/data-table-filter-and-lists.md +96 -0
- package/docs/components/feedback-and-status.md +23 -0
- package/docs/components/navigation-and-layout.md +4 -3
- package/docs/components/rich-widgets.md +75 -1
- package/docs/guides/helpers.md +63 -0
- package/docs/guides/theming.md +13 -3
- package/docs/previews/feedback-status-unsaveddialog.webp +0 -0
- package/docs/roadmap.md +4 -0
- package/lib/components/ui/layout/sidebar/sidebar-tokens.css +13 -1
- package/package.json +2 -2
- package/dist/dialog-yfPkLqUQ.js +0 -482
- package/dist/hooks-CGnqFngB.js +0 -187
- package/dist/i18n-provider-BehR6cU7.js +0 -79
- package/dist/translate-material-tUaLZUmT.js +0 -20
- package/dist/translator-B9XjUDRu.js +0 -2451
|
@@ -3,61 +3,62 @@ import { n as t } from "./ui.utils-CAnKTCw5.js";
|
|
|
3
3
|
import { t as n } from "./utils-BLfntITJ.js";
|
|
4
4
|
import { o as r } from "./dist-DVRQkaTK.js";
|
|
5
5
|
import { c as i, i as a, l as o, n as s, o as c, s as l } from "./dist-lmHmz_bu.js";
|
|
6
|
-
import { n as u, s as d } from "./spinner-
|
|
6
|
+
import { n as u, s as d } from "./spinner-CAnpF3RK.js";
|
|
7
7
|
import { i as f } from "./dist-C4wtXCjf.js";
|
|
8
8
|
import { r as p, t as m } from "./in-dialog-Vwkyp-M5.js";
|
|
9
|
-
import {
|
|
10
|
-
import { c as
|
|
11
|
-
import { S as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import { n as
|
|
15
|
-
import {
|
|
16
|
-
import { t as
|
|
17
|
-
import {
|
|
18
|
-
import { n as
|
|
19
|
-
import { r as Te } from "./
|
|
20
|
-
import {
|
|
21
|
-
import { t as Oe } from "./
|
|
22
|
-
import { t as ke } from "./
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
9
|
+
import { a as h, c as g, i as _, l as v, n as y, o as b, r as x, s as ee, t as te, u as ne } from "./use-return-focus-1ZIchrBM.js";
|
|
10
|
+
import { c as S, d as C, f as w, i as T, l as re, n as ie, o as E, t as ae, u as D } from "./dropdown-menu-_SyVmSuy.js";
|
|
11
|
+
import { S as oe, a as O, d as k, g as se, h as ce, i as le, m as ue, n as A, r as de, t as j, u as fe, w as pe } from "./toolbar-items-_ezD5B0r.js";
|
|
12
|
+
import { t as me } from "./button-DfS_amfQ.js";
|
|
13
|
+
import { t as M } from "./use-material-translation-C_1cWRzW.js";
|
|
14
|
+
import { n as he, t as ge } from "./icon-button-hKHsWTAt.js";
|
|
15
|
+
import { t as _e } from "./useEvent-2fKq-6w8.js";
|
|
16
|
+
import { n as ve, t as ye } from "./toggle-group-BkH23Jk4.js";
|
|
17
|
+
import { i as be } from "./escape-owner-DpaP0lm1.js";
|
|
18
|
+
import { n as xe } from "./use-slice-reducer-BGkeGtML.js";
|
|
19
|
+
import { f as Se, r as Ce, t as we, u as Te } from "./dialog-Bd7Hid2L.js";
|
|
20
|
+
import { r as Ee } from "./use-csp-nonce-ZKs9k-ov.js";
|
|
21
|
+
import { n as De, t as Oe } from "./empty-state-D-2ZMXXJ.js";
|
|
22
|
+
import { t as ke } from "./client-only.utils-3nHNzCki.js";
|
|
23
|
+
import { t as Ae } from "./use-scroll-away-PQRFZkT2.js";
|
|
24
|
+
import * as N from "react";
|
|
25
|
+
import { createContext as je, memo as Me, useCallback as P, useContext as Ne, useEffect as F, useId as Pe, useLayoutEffect as I, useMemo as L, useReducer as Fe, useRef as R, useState as z, useSyncExternalStore as Ie } from "react";
|
|
26
|
+
import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
27
|
+
import { flushSync as Le } from "react-dom";
|
|
28
|
+
import { ArrowLeft as Re, BookOpenText as ze, ChevronDown as Be, ChevronLeft as Ve, ChevronRight as He, ChevronUp as Ue, Download as We, Eraser as Ge, FileText as Ke, FileWarning as qe, FileX2 as Je, Highlighter as Ye, KeyRound as Xe, LayoutGrid as Ze, List as Qe, Loader2 as $e, Maximize as et, MessageSquareText as tt, Minimize as nt, MoreVertical as rt, MousePointer2 as it, MoveHorizontal as at, PanelLeft as ot, Pen as st, PencilLine as ct, Printer as lt, RotateCw as ut, Search as dt, StickyNote as ft, Type as pt, Underline as mt, Undo2 as ht, Volume2 as gt, X as _t, XIcon as vt, ZoomIn as yt, ZoomOut as bt } from "lucide-react";
|
|
29
|
+
import { createSlice as xt } from "@reduxjs/toolkit";
|
|
30
|
+
import { STATE_ACTION_KEYS as St, describeError as Ct, stateCopy as wt } from "@nxgt/material-core/states";
|
|
31
|
+
import { formatFileSize as Tt } from "@nxgt/material-core/format-file-size";
|
|
32
|
+
import { anchorAt as Et, applyPageHighlight as Dt, classifyPdfError as Ot, createPdfLinkService as kt, layoutSpreads as At, mountedPages as jt, offsetOf as Mt, openPdfDocument as Nt, pageAtOffset as Pt, planRender as Ft, renderPageToCanvas as It, rowStarts as Lt } from "@nxgt/material-core/pdf-reader";
|
|
33
|
+
import { DEFAULT_PAGE_SIZE as Rt, FIT_PAGES as zt, createPageSizesLoader as Bt, fitScale as Vt, hitAt as Ht, labelLinkAnchors as Ut, mapPdfOutline as Wt, placeholderSize as Gt, readerFitScale as Kt, resolveDestinationPage as qt, revealHit as Jt, rotatedSize as Yt, searchDocument as Xt, stepHit as Zt, withPageMatches as Qt } from "@nxgt/material-core/pdf-viewer";
|
|
34
|
+
import { resolvePdfFileName as $t } from "@nxgt/material-core/pdf-file-name";
|
|
35
|
+
import { downloadPdfFile as en, printPdfFile as tn } from "@nxgt/material-core/pdf-download";
|
|
36
|
+
import { pdfSourceKey as nn, toPdfjsParams as rn } from "@nxgt/material-core/pdf-source";
|
|
36
37
|
//#region ../../node_modules/@radix-ui/number/dist/index.mjs
|
|
37
|
-
var
|
|
38
|
+
var an = Object.defineProperty, on = (e, t) => an(e, "name", {
|
|
38
39
|
value: t,
|
|
39
40
|
configurable: !0
|
|
40
41
|
});
|
|
41
|
-
function
|
|
42
|
+
function sn(e, [t, n]) {
|
|
42
43
|
return Math.min(n, Math.max(t, e));
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
+
on(sn, "clamp");
|
|
45
46
|
//#endregion
|
|
46
47
|
//#region ../../node_modules/@radix-ui/react-scroll-area/dist/index.mjs
|
|
47
|
-
var
|
|
48
|
+
var cn = Object.defineProperty, U = (e, t) => cn(e, "name", {
|
|
48
49
|
value: t,
|
|
49
50
|
configurable: !0
|
|
50
51
|
});
|
|
51
|
-
function
|
|
52
|
-
return
|
|
52
|
+
function ln(e, t) {
|
|
53
|
+
return N.useReducer((e, n) => t[e][n] ?? e, e);
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
-
var
|
|
56
|
-
let { __scopeScrollArea: n, type: i = "hover", dir: a, scrollHideDelay: s = 600, ...c } = e, [l, u] =
|
|
57
|
-
return /* @__PURE__ */
|
|
55
|
+
U(ln, "useStateMachine");
|
|
56
|
+
var un = "ScrollArea", [dn, fn] = i(un), [pn, W] = dn(un), mn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
57
|
+
let { __scopeScrollArea: n, type: i = "hover", dir: a, scrollHideDelay: s = 600, ...c } = e, [l, u] = N.useState(null), [d, p] = N.useState(null), [m, h] = N.useState(null), [g, _] = N.useState(null), [v, y] = N.useState(null), [b, x] = N.useState(0), [ee, te] = N.useState(0), [ne, S] = N.useState(!1), [C, w] = N.useState(!1), T = r(t, u), re = f(a);
|
|
58
|
+
return /* @__PURE__ */ V(pn, {
|
|
58
59
|
scope: n,
|
|
59
60
|
type: i,
|
|
60
|
-
dir:
|
|
61
|
+
dir: re,
|
|
61
62
|
scrollHideDelay: s,
|
|
62
63
|
scrollArea: l,
|
|
63
64
|
viewport: d,
|
|
@@ -66,29 +67,29 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
66
67
|
onContentChange: h,
|
|
67
68
|
scrollbarX: g,
|
|
68
69
|
onScrollbarXChange: _,
|
|
69
|
-
scrollbarXEnabled:
|
|
70
|
-
onScrollbarXEnabledChange:
|
|
70
|
+
scrollbarXEnabled: ne,
|
|
71
|
+
onScrollbarXEnabledChange: S,
|
|
71
72
|
scrollbarY: v,
|
|
72
73
|
onScrollbarYChange: y,
|
|
73
74
|
scrollbarYEnabled: C,
|
|
74
|
-
onScrollbarYEnabledChange:
|
|
75
|
+
onScrollbarYEnabledChange: w,
|
|
75
76
|
onCornerWidthChange: x,
|
|
76
|
-
onCornerHeightChange:
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
-
dir:
|
|
77
|
+
onCornerHeightChange: te,
|
|
78
|
+
children: /* @__PURE__ */ V(o.div, {
|
|
79
|
+
dir: re,
|
|
79
80
|
...c,
|
|
80
|
-
ref:
|
|
81
|
+
ref: T,
|
|
81
82
|
style: {
|
|
82
83
|
position: "relative",
|
|
83
84
|
"--radix-scroll-area-corner-width": b + "px",
|
|
84
|
-
"--radix-scroll-area-corner-height":
|
|
85
|
+
"--radix-scroll-area-corner-height": ee + "px",
|
|
85
86
|
...e.style
|
|
86
87
|
}
|
|
87
88
|
})
|
|
88
89
|
});
|
|
89
|
-
}, "ScrollArea")),
|
|
90
|
-
let { __scopeScrollArea: n, children: i, nonce: a, ...s } = e, c =
|
|
91
|
-
return /* @__PURE__ */
|
|
90
|
+
}, "ScrollArea")), hn = "ScrollAreaViewport", gn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
91
|
+
let { __scopeScrollArea: n, children: i, nonce: a, ...s } = e, c = W(hn, n), l = r(t, N.useRef(null), c.onViewportChange);
|
|
92
|
+
return /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(_n, { nonce: a }), /* @__PURE__ */ V(o.div, {
|
|
92
93
|
"data-radix-scroll-area-viewport": "",
|
|
93
94
|
...s,
|
|
94
95
|
ref: l,
|
|
@@ -97,7 +98,7 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
97
98
|
overflowY: c.scrollbarYEnabled ? "scroll" : "hidden",
|
|
98
99
|
...e.style
|
|
99
100
|
},
|
|
100
|
-
children: /* @__PURE__ */
|
|
101
|
+
children: /* @__PURE__ */ V("div", {
|
|
101
102
|
ref: c.onContentChange,
|
|
102
103
|
style: {
|
|
103
104
|
minWidth: "100%",
|
|
@@ -106,60 +107,60 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
106
107
|
children: i
|
|
107
108
|
})
|
|
108
109
|
})] });
|
|
109
|
-
}, "ScrollAreaViewport")),
|
|
110
|
-
return /* @__PURE__ */
|
|
110
|
+
}, "ScrollAreaViewport")), _n = /* @__PURE__ */ N.memo(/* @__PURE__ */ U(function({ nonce: e }) {
|
|
111
|
+
return /* @__PURE__ */ V("style", {
|
|
111
112
|
dangerouslySetInnerHTML: { __html: "[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}" },
|
|
112
113
|
nonce: e
|
|
113
114
|
});
|
|
114
|
-
}, "ScrollAreaViewportStyle"), (e, t) => e.nonce === t.nonce),
|
|
115
|
-
let { forceMount: n, ...r } = e, i = G
|
|
116
|
-
return
|
|
115
|
+
}, "ScrollAreaViewportStyle"), (e, t) => e.nonce === t.nonce), G = "ScrollAreaScrollbar", vn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
116
|
+
let { forceMount: n, ...r } = e, i = W(G, e.__scopeScrollArea), { onScrollbarXEnabledChange: a, onScrollbarYEnabledChange: o } = i, s = e.orientation === "horizontal";
|
|
117
|
+
return N.useEffect(() => (s ? a(!0) : o(!0), () => {
|
|
117
118
|
s ? a(!1) : o(!1);
|
|
118
119
|
}), [
|
|
119
120
|
s,
|
|
120
121
|
a,
|
|
121
122
|
o
|
|
122
|
-
]), i.type === "hover" ? /* @__PURE__ */
|
|
123
|
+
]), i.type === "hover" ? /* @__PURE__ */ V(yn, {
|
|
123
124
|
...r,
|
|
124
125
|
ref: t,
|
|
125
126
|
forceMount: n
|
|
126
|
-
}) : i.type === "scroll" ? /* @__PURE__ */
|
|
127
|
+
}) : i.type === "scroll" ? /* @__PURE__ */ V(bn, {
|
|
127
128
|
...r,
|
|
128
129
|
ref: t,
|
|
129
130
|
forceMount: n
|
|
130
|
-
}) : i.type === "auto" ? /* @__PURE__ */
|
|
131
|
+
}) : i.type === "auto" ? /* @__PURE__ */ V(xn, {
|
|
131
132
|
...r,
|
|
132
133
|
ref: t,
|
|
133
134
|
forceMount: n
|
|
134
|
-
}) : i.type === "always" ? /* @__PURE__ */
|
|
135
|
+
}) : i.type === "always" ? /* @__PURE__ */ V(Sn, {
|
|
135
136
|
...r,
|
|
136
137
|
ref: t,
|
|
137
138
|
"data-state": "visible"
|
|
138
139
|
}) : null;
|
|
139
|
-
}, "ScrollAreaScrollbar")),
|
|
140
|
-
let { forceMount: n, ...r } = e, i = G
|
|
141
|
-
return
|
|
140
|
+
}, "ScrollAreaScrollbar")), yn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
141
|
+
let { forceMount: n, ...r } = e, i = W(G, e.__scopeScrollArea), [o, s] = N.useState(!1);
|
|
142
|
+
return N.useEffect(() => {
|
|
142
143
|
let e = i.scrollArea, t = 0;
|
|
143
144
|
if (e) {
|
|
144
|
-
let n = /* @__PURE__ */
|
|
145
|
+
let n = /* @__PURE__ */ U(() => {
|
|
145
146
|
window.clearTimeout(t), s(!0);
|
|
146
|
-
}, "handlePointerEnter"), r = /* @__PURE__ */
|
|
147
|
+
}, "handlePointerEnter"), r = /* @__PURE__ */ U(() => {
|
|
147
148
|
t = window.setTimeout(() => s(!1), i.scrollHideDelay);
|
|
148
149
|
}, "handlePointerLeave");
|
|
149
150
|
return e.addEventListener("pointerenter", n), e.addEventListener("pointerleave", r), () => {
|
|
150
151
|
window.clearTimeout(t), e.removeEventListener("pointerenter", n), e.removeEventListener("pointerleave", r);
|
|
151
152
|
};
|
|
152
153
|
}
|
|
153
|
-
}, [i.scrollArea, i.scrollHideDelay]), /* @__PURE__ */
|
|
154
|
+
}, [i.scrollArea, i.scrollHideDelay]), /* @__PURE__ */ V(a, {
|
|
154
155
|
present: n || o,
|
|
155
|
-
children: /* @__PURE__ */
|
|
156
|
+
children: /* @__PURE__ */ V(xn, {
|
|
156
157
|
"data-state": o ? "visible" : "hidden",
|
|
157
158
|
...r,
|
|
158
159
|
ref: t
|
|
159
160
|
})
|
|
160
161
|
});
|
|
161
|
-
}, "ScrollAreaScrollbarHover")),
|
|
162
|
-
let { forceMount: n, ...r } = e, i = G
|
|
162
|
+
}, "ScrollAreaScrollbarHover")), bn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
163
|
+
let { forceMount: n, ...r } = e, i = W(G, e.__scopeScrollArea), o = e.orientation === "horizontal", s = J(() => u("SCROLL_END"), 100), [c, u] = ln("hidden", {
|
|
163
164
|
hidden: { SCROLL: "scrolling" },
|
|
164
165
|
scrolling: {
|
|
165
166
|
SCROLL_END: "idle",
|
|
@@ -175,7 +176,7 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
175
176
|
POINTER_ENTER: "interacting"
|
|
176
177
|
}
|
|
177
178
|
});
|
|
178
|
-
return
|
|
179
|
+
return N.useEffect(() => {
|
|
179
180
|
if (c === "idle") {
|
|
180
181
|
let e = window.setTimeout(() => u("HIDE"), i.scrollHideDelay);
|
|
181
182
|
return () => window.clearTimeout(e);
|
|
@@ -184,10 +185,10 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
184
185
|
c,
|
|
185
186
|
i.scrollHideDelay,
|
|
186
187
|
u
|
|
187
|
-
]),
|
|
188
|
+
]), N.useEffect(() => {
|
|
188
189
|
let e = i.viewport, t = o ? "scrollLeft" : "scrollTop";
|
|
189
190
|
if (e) {
|
|
190
|
-
let n = e[t], r = /* @__PURE__ */
|
|
191
|
+
let n = e[t], r = /* @__PURE__ */ U(() => {
|
|
191
192
|
let r = e[t];
|
|
192
193
|
n !== r && (u("SCROLL"), s()), n = r;
|
|
193
194
|
}, "handleScroll");
|
|
@@ -198,9 +199,9 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
198
199
|
o,
|
|
199
200
|
u,
|
|
200
201
|
s
|
|
201
|
-
]), /* @__PURE__ */
|
|
202
|
+
]), /* @__PURE__ */ V(a, {
|
|
202
203
|
present: n || c !== "hidden",
|
|
203
|
-
children: /* @__PURE__ */
|
|
204
|
+
children: /* @__PURE__ */ V(Sn, {
|
|
204
205
|
"data-state": c === "hidden" ? "hidden" : "visible",
|
|
205
206
|
...r,
|
|
206
207
|
ref: t,
|
|
@@ -208,23 +209,23 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
208
209
|
onPointerLeave: l(e.onPointerLeave, () => u("POINTER_LEAVE"))
|
|
209
210
|
})
|
|
210
211
|
});
|
|
211
|
-
}, "ScrollAreaScrollbarScroll")),
|
|
212
|
-
let n = G
|
|
212
|
+
}, "ScrollAreaScrollbarScroll")), xn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
213
|
+
let n = W(G, e.__scopeScrollArea), { forceMount: r, ...i } = e, [o, s] = N.useState(!1), c = e.orientation === "horizontal", l = J(() => {
|
|
213
214
|
if (n.viewport) {
|
|
214
215
|
let e = n.viewport.offsetWidth < n.viewport.scrollWidth, t = n.viewport.offsetHeight < n.viewport.scrollHeight;
|
|
215
216
|
s(c ? e : t);
|
|
216
217
|
}
|
|
217
218
|
}, 10);
|
|
218
|
-
return
|
|
219
|
+
return Y(n.viewport, l), Y(n.content, l), /* @__PURE__ */ V(a, {
|
|
219
220
|
present: r || o,
|
|
220
|
-
children: /* @__PURE__ */
|
|
221
|
+
children: /* @__PURE__ */ V(Sn, {
|
|
221
222
|
"data-state": o ? "visible" : "hidden",
|
|
222
223
|
...i,
|
|
223
224
|
ref: t
|
|
224
225
|
})
|
|
225
226
|
});
|
|
226
|
-
}, "ScrollAreaScrollbarAuto")),
|
|
227
|
-
let { orientation: n = "vertical", ...r } = e, i = G
|
|
227
|
+
}, "ScrollAreaScrollbarAuto")), Sn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
228
|
+
let { orientation: n = "vertical", ...r } = e, i = W(G, e.__scopeScrollArea), a = N.useRef(null), o = N.useRef(0), [s, c] = N.useState({
|
|
228
229
|
content: 0,
|
|
229
230
|
viewport: 0,
|
|
230
231
|
scrollbar: {
|
|
@@ -232,24 +233,24 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
232
233
|
paddingStart: 0,
|
|
233
234
|
paddingEnd: 0
|
|
234
235
|
}
|
|
235
|
-
}), l =
|
|
236
|
+
}), l = Pn(s.viewport, s.content), u = {
|
|
236
237
|
...r,
|
|
237
238
|
sizes: s,
|
|
238
239
|
onSizesChange: c,
|
|
239
240
|
hasThumb: l > 0 && l < 1,
|
|
240
|
-
onThumbChange: /* @__PURE__ */
|
|
241
|
-
onThumbPointerUp: /* @__PURE__ */
|
|
242
|
-
onThumbPointerDown: /* @__PURE__ */
|
|
241
|
+
onThumbChange: /* @__PURE__ */ U((e) => a.current = e, "onThumbChange"),
|
|
242
|
+
onThumbPointerUp: /* @__PURE__ */ U(() => o.current = 0, "onThumbPointerUp"),
|
|
243
|
+
onThumbPointerDown: /* @__PURE__ */ U((e) => o.current = e, "onThumbPointerDown")
|
|
243
244
|
};
|
|
244
245
|
function d(e, t) {
|
|
245
|
-
return
|
|
246
|
+
return Fn(e, o.current, s, t);
|
|
246
247
|
}
|
|
247
|
-
return
|
|
248
|
+
return U(d, "getScrollPosition"), n === "horizontal" ? /* @__PURE__ */ V(Cn, {
|
|
248
249
|
...u,
|
|
249
250
|
ref: t,
|
|
250
251
|
onThumbPositionChange: () => {
|
|
251
252
|
if (i.viewport && a.current) {
|
|
252
|
-
let e = i.viewport.scrollLeft, t =
|
|
253
|
+
let e = i.viewport.scrollLeft, t = In(e, s, i.dir);
|
|
253
254
|
a.current.style.transform = `translate3d(${t}px, 0, 0)`;
|
|
254
255
|
}
|
|
255
256
|
},
|
|
@@ -259,12 +260,12 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
259
260
|
onDragScroll: (e) => {
|
|
260
261
|
i.viewport && (i.viewport.scrollLeft = d(e, i.dir));
|
|
261
262
|
}
|
|
262
|
-
}) : n === "vertical" ? /* @__PURE__ */
|
|
263
|
+
}) : n === "vertical" ? /* @__PURE__ */ V(wn, {
|
|
263
264
|
...u,
|
|
264
265
|
ref: t,
|
|
265
266
|
onThumbPositionChange: () => {
|
|
266
267
|
if (i.viewport && a.current) {
|
|
267
|
-
let e = i.viewport.scrollTop, t =
|
|
268
|
+
let e = i.viewport.scrollTop, t = In(e, s);
|
|
268
269
|
a.current.style.transform = `translate3d(0, ${t}px, 0)`;
|
|
269
270
|
}
|
|
270
271
|
},
|
|
@@ -275,11 +276,11 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
275
276
|
i.viewport && (i.viewport.scrollTop = d(e));
|
|
276
277
|
}
|
|
277
278
|
}) : null;
|
|
278
|
-
}, "ScrollAreaScrollbarVisible")),
|
|
279
|
-
let { sizes: n, onSizesChange: i, ...a } = e, o = G
|
|
280
|
-
return
|
|
279
|
+
}, "ScrollAreaScrollbarVisible")), Cn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
280
|
+
let { sizes: n, onSizesChange: i, ...a } = e, o = W(G, e.__scopeScrollArea), [s, c] = N.useState(), l = N.useRef(null), u = r(t, l, o.onScrollbarXChange);
|
|
281
|
+
return N.useEffect(() => {
|
|
281
282
|
l.current && c(getComputedStyle(l.current));
|
|
282
|
-
}, [l]), /* @__PURE__ */
|
|
283
|
+
}, [l]), /* @__PURE__ */ V(Dn, {
|
|
283
284
|
"data-orientation": "horizontal",
|
|
284
285
|
...a,
|
|
285
286
|
ref: u,
|
|
@@ -288,7 +289,7 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
288
289
|
bottom: 0,
|
|
289
290
|
left: o.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
290
291
|
right: o.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
|
|
291
|
-
"--radix-scroll-area-thumb-width":
|
|
292
|
+
"--radix-scroll-area-thumb-width": q(n) + "px",
|
|
292
293
|
...e.style
|
|
293
294
|
},
|
|
294
295
|
onThumbPointerDown: (t) => e.onThumbPointerDown(t.x),
|
|
@@ -296,7 +297,7 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
296
297
|
onWheelScroll: (t, n) => {
|
|
297
298
|
if (o.viewport) {
|
|
298
299
|
let r = o.viewport.scrollLeft + t.deltaX;
|
|
299
|
-
e.onWheelScroll(r),
|
|
300
|
+
e.onWheelScroll(r), Rn(r, n) && t.preventDefault();
|
|
300
301
|
}
|
|
301
302
|
},
|
|
302
303
|
onResize: () => {
|
|
@@ -305,17 +306,17 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
305
306
|
viewport: o.viewport.offsetWidth,
|
|
306
307
|
scrollbar: {
|
|
307
308
|
size: l.current.clientWidth,
|
|
308
|
-
paddingStart:
|
|
309
|
-
paddingEnd:
|
|
309
|
+
paddingStart: K(s.paddingLeft),
|
|
310
|
+
paddingEnd: K(s.paddingRight)
|
|
310
311
|
}
|
|
311
312
|
});
|
|
312
313
|
}
|
|
313
314
|
});
|
|
314
|
-
}, "ScrollAreaScrollbarX")),
|
|
315
|
-
let { sizes: n, onSizesChange: i, ...a } = e, o = G
|
|
316
|
-
return
|
|
315
|
+
}, "ScrollAreaScrollbarX")), wn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
316
|
+
let { sizes: n, onSizesChange: i, ...a } = e, o = W(G, e.__scopeScrollArea), [s, c] = N.useState(), l = N.useRef(null), u = r(t, l, o.onScrollbarYChange);
|
|
317
|
+
return N.useEffect(() => {
|
|
317
318
|
l.current && c(getComputedStyle(l.current));
|
|
318
|
-
}, [l]), /* @__PURE__ */
|
|
319
|
+
}, [l]), /* @__PURE__ */ V(Dn, {
|
|
319
320
|
"data-orientation": "vertical",
|
|
320
321
|
...a,
|
|
321
322
|
ref: u,
|
|
@@ -325,7 +326,7 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
325
326
|
right: o.dir === "ltr" ? 0 : void 0,
|
|
326
327
|
left: o.dir === "rtl" ? 0 : void 0,
|
|
327
328
|
bottom: "var(--radix-scroll-area-corner-height)",
|
|
328
|
-
"--radix-scroll-area-thumb-height":
|
|
329
|
+
"--radix-scroll-area-thumb-height": q(n) + "px",
|
|
329
330
|
...e.style
|
|
330
331
|
},
|
|
331
332
|
onThumbPointerDown: (t) => e.onThumbPointerDown(t.y),
|
|
@@ -333,7 +334,7 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
333
334
|
onWheelScroll: (t, n) => {
|
|
334
335
|
if (o.viewport) {
|
|
335
336
|
let r = o.viewport.scrollTop + t.deltaY;
|
|
336
|
-
e.onWheelScroll(r),
|
|
337
|
+
e.onWheelScroll(r), Rn(r, n) && t.preventDefault();
|
|
337
338
|
}
|
|
338
339
|
},
|
|
339
340
|
onResize: () => {
|
|
@@ -342,15 +343,15 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
342
343
|
viewport: o.viewport.offsetHeight,
|
|
343
344
|
scrollbar: {
|
|
344
345
|
size: l.current.clientHeight,
|
|
345
|
-
paddingStart:
|
|
346
|
-
paddingEnd:
|
|
346
|
+
paddingStart: K(s.paddingTop),
|
|
347
|
+
paddingEnd: K(s.paddingBottom)
|
|
347
348
|
}
|
|
348
349
|
});
|
|
349
350
|
}
|
|
350
351
|
});
|
|
351
|
-
}, "ScrollAreaScrollbarY")), [
|
|
352
|
-
let { __scopeScrollArea: n, sizes: i, hasThumb: a, onThumbChange: c, onThumbPointerUp: u, onThumbPointerDown: d, onThumbPositionChange: f, onDragScroll: p, onWheelScroll: m, onResize: h, ...g } = e, _ = G
|
|
353
|
-
function
|
|
352
|
+
}, "ScrollAreaScrollbarY")), [Tn, En] = dn(G), Dn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
353
|
+
let { __scopeScrollArea: n, sizes: i, hasThumb: a, onThumbChange: c, onThumbPointerUp: u, onThumbPointerDown: d, onThumbPositionChange: f, onDragScroll: p, onWheelScroll: m, onResize: h, ...g } = e, _ = W(G, n), [v, y] = N.useState(null), b = r(t, y), x = N.useRef(null), ee = N.useRef(""), te = _.viewport, ne = i.content - i.viewport, S = s(m), C = s(f), w = J(h, 10);
|
|
354
|
+
function T(e) {
|
|
354
355
|
if (x.current) {
|
|
355
356
|
let t = e.clientX - x.current.left, n = e.clientY - x.current.top;
|
|
356
357
|
p({
|
|
@@ -359,18 +360,18 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
359
360
|
});
|
|
360
361
|
}
|
|
361
362
|
}
|
|
362
|
-
return
|
|
363
|
-
let e = /* @__PURE__ */
|
|
363
|
+
return U(T, "handleDragScroll"), N.useEffect(() => {
|
|
364
|
+
let e = /* @__PURE__ */ U((e) => {
|
|
364
365
|
let t = e.target;
|
|
365
|
-
v?.contains(t) &&
|
|
366
|
+
v?.contains(t) && S(e, ne);
|
|
366
367
|
}, "handleWheel");
|
|
367
368
|
return document.addEventListener("wheel", e, { passive: !1 }), () => document.removeEventListener("wheel", e, { passive: !1 });
|
|
368
369
|
}, [
|
|
369
|
-
ee,
|
|
370
|
-
v,
|
|
371
370
|
te,
|
|
372
|
-
|
|
373
|
-
|
|
371
|
+
v,
|
|
372
|
+
ne,
|
|
373
|
+
S
|
|
374
|
+
]), N.useEffect(C, [i, C]), Y(v, w), Y(_.content, w), /* @__PURE__ */ V(Tn, {
|
|
374
375
|
scope: n,
|
|
375
376
|
scrollbar: v,
|
|
376
377
|
hasThumb: a,
|
|
@@ -378,7 +379,7 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
378
379
|
onThumbPointerUp: s(u),
|
|
379
380
|
onThumbPositionChange: C,
|
|
380
381
|
onThumbPointerDown: s(d),
|
|
381
|
-
children: /* @__PURE__ */
|
|
382
|
+
children: /* @__PURE__ */ V(o.div, {
|
|
382
383
|
...g,
|
|
383
384
|
ref: b,
|
|
384
385
|
style: {
|
|
@@ -386,34 +387,34 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
386
387
|
...g.style
|
|
387
388
|
},
|
|
388
389
|
onPointerDown: l(e.onPointerDown, (e) => {
|
|
389
|
-
e.button === 0 && (e.target.setPointerCapture(e.pointerId), x.current = v.getBoundingClientRect(),
|
|
390
|
+
e.button === 0 && (e.target.setPointerCapture(e.pointerId), x.current = v.getBoundingClientRect(), ee.current = document.body.style.webkitUserSelect, document.body.style.webkitUserSelect = "none", _.viewport && (_.viewport.style.scrollBehavior = "auto"), T(e));
|
|
390
391
|
}),
|
|
391
|
-
onPointerMove: l(e.onPointerMove,
|
|
392
|
+
onPointerMove: l(e.onPointerMove, T),
|
|
392
393
|
onPointerUp: l(e.onPointerUp, (e) => {
|
|
393
394
|
let t = e.target;
|
|
394
|
-
t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId), document.body.style.webkitUserSelect =
|
|
395
|
+
t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId), document.body.style.webkitUserSelect = ee.current, _.viewport && (_.viewport.style.scrollBehavior = ""), x.current = null;
|
|
395
396
|
})
|
|
396
397
|
})
|
|
397
398
|
});
|
|
398
|
-
}, "ScrollAreaScrollbarImpl")),
|
|
399
|
-
let { forceMount: n, ...r } = e, i =
|
|
400
|
-
return /* @__PURE__ */
|
|
399
|
+
}, "ScrollAreaScrollbarImpl")), On = "ScrollAreaThumb", kn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
400
|
+
let { forceMount: n, ...r } = e, i = En(On, e.__scopeScrollArea);
|
|
401
|
+
return /* @__PURE__ */ V(a, {
|
|
401
402
|
present: n || i.hasThumb,
|
|
402
|
-
children: /* @__PURE__ */
|
|
403
|
+
children: /* @__PURE__ */ V(An, {
|
|
403
404
|
ref: t,
|
|
404
405
|
...r
|
|
405
406
|
})
|
|
406
407
|
});
|
|
407
|
-
}, "ScrollAreaThumb")),
|
|
408
|
-
let { __scopeScrollArea: n, style: i, ...a } = e, s =
|
|
408
|
+
}, "ScrollAreaThumb")), An = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
409
|
+
let { __scopeScrollArea: n, style: i, ...a } = e, s = W(On, n), c = En(On, n), { onThumbPositionChange: u } = c, d = r(t, c.onThumbChange), f = N.useRef(void 0), p = J(() => {
|
|
409
410
|
f.current &&= (f.current(), void 0);
|
|
410
411
|
}, 100);
|
|
411
|
-
return
|
|
412
|
+
return N.useEffect(() => {
|
|
412
413
|
let e = s.viewport;
|
|
413
414
|
if (e) {
|
|
414
|
-
let t = /* @__PURE__ */
|
|
415
|
+
let t = /* @__PURE__ */ U(() => {
|
|
415
416
|
if (p(), !f.current) {
|
|
416
|
-
let t =
|
|
417
|
+
let t = zn(e, u);
|
|
417
418
|
f.current = t, u();
|
|
418
419
|
}
|
|
419
420
|
}, "handleScroll");
|
|
@@ -423,7 +424,7 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
423
424
|
s.viewport,
|
|
424
425
|
p,
|
|
425
426
|
u
|
|
426
|
-
]), /* @__PURE__ */
|
|
427
|
+
]), /* @__PURE__ */ V(o.div, {
|
|
427
428
|
"data-state": c.hasThumb ? "visible" : "hidden",
|
|
428
429
|
...a,
|
|
429
430
|
ref: d,
|
|
@@ -441,23 +442,23 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
441
442
|
}),
|
|
442
443
|
onPointerUp: l(e.onPointerUp, c.onThumbPointerUp)
|
|
443
444
|
});
|
|
444
|
-
}, "ScrollAreaThumbImpl")),
|
|
445
|
-
let n =
|
|
446
|
-
return n.type !== "scroll" && r ? /* @__PURE__ */
|
|
445
|
+
}, "ScrollAreaThumbImpl")), jn = "ScrollAreaCorner", Mn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
446
|
+
let n = W(jn, e.__scopeScrollArea), r = !!(n.scrollbarX && n.scrollbarY);
|
|
447
|
+
return n.type !== "scroll" && r ? /* @__PURE__ */ V(Nn, {
|
|
447
448
|
...e,
|
|
448
449
|
ref: t
|
|
449
450
|
}) : null;
|
|
450
|
-
}, "ScrollAreaCorner")),
|
|
451
|
-
let { __scopeScrollArea: n, ...r } = e, i =
|
|
452
|
-
return
|
|
451
|
+
}, "ScrollAreaCorner")), Nn = /* @__PURE__ */ N.forwardRef(/* @__PURE__ */ U(function(e, t) {
|
|
452
|
+
let { __scopeScrollArea: n, ...r } = e, i = W(jn, n), [a, s] = N.useState(0), [c, l] = N.useState(0), u = !!(a && c), { onCornerWidthChange: d, onCornerHeightChange: f } = i;
|
|
453
|
+
return Y(i.scrollbarX, () => {
|
|
453
454
|
let e = i.scrollbarX?.offsetHeight || 0;
|
|
454
455
|
i.onCornerHeightChange(e), l(e);
|
|
455
|
-
}),
|
|
456
|
+
}), Y(i.scrollbarY, () => {
|
|
456
457
|
let e = i.scrollbarY?.offsetWidth || 0;
|
|
457
458
|
i.onCornerWidthChange(e), s(e);
|
|
458
|
-
}),
|
|
459
|
+
}), N.useEffect(() => () => {
|
|
459
460
|
d(0), f(0);
|
|
460
|
-
}, [d, f]), u ? /* @__PURE__ */
|
|
461
|
+
}, [d, f]), u ? /* @__PURE__ */ V(o.div, {
|
|
461
462
|
...r,
|
|
462
463
|
ref: t,
|
|
463
464
|
style: {
|
|
@@ -471,48 +472,48 @@ var ln = "ScrollArea", [un, dn] = i(ln), [fn, G] = un(ln), pn = /* @__PURE__ */
|
|
|
471
472
|
}
|
|
472
473
|
}) : null;
|
|
473
474
|
}, "ScrollAreaCornerImpl"));
|
|
474
|
-
function
|
|
475
|
+
function K(e) {
|
|
475
476
|
return e ? parseInt(e, 10) : 0;
|
|
476
477
|
}
|
|
477
|
-
|
|
478
|
-
function
|
|
478
|
+
U(K, "toInt");
|
|
479
|
+
function Pn(e, t) {
|
|
479
480
|
let n = e / t;
|
|
480
481
|
return isNaN(n) ? 0 : n;
|
|
481
482
|
}
|
|
482
|
-
|
|
483
|
-
function
|
|
484
|
-
let t =
|
|
483
|
+
U(Pn, "getThumbRatio");
|
|
484
|
+
function q(e) {
|
|
485
|
+
let t = Pn(e.viewport, e.content), n = e.scrollbar.paddingStart + e.scrollbar.paddingEnd, r = (e.scrollbar.size - n) * t;
|
|
485
486
|
return Math.max(r, 18);
|
|
486
487
|
}
|
|
487
|
-
|
|
488
|
-
function
|
|
489
|
-
let i =
|
|
490
|
-
return
|
|
488
|
+
U(q, "getThumbSize");
|
|
489
|
+
function Fn(e, t, n, r = "ltr") {
|
|
490
|
+
let i = q(n), a = i / 2, o = t || a, s = i - o, c = n.scrollbar.paddingStart + o, l = n.scrollbar.size - n.scrollbar.paddingEnd - s, u = n.content - n.viewport, d = r === "ltr" ? [0, u] : [u * -1, 0];
|
|
491
|
+
return Ln([c, l], d)(e);
|
|
491
492
|
}
|
|
492
|
-
|
|
493
|
-
function
|
|
494
|
-
let r =
|
|
495
|
-
return
|
|
493
|
+
U(Fn, "getScrollPositionFromPointer");
|
|
494
|
+
function In(e, t, n = "ltr") {
|
|
495
|
+
let r = q(t), i = t.scrollbar.paddingStart + t.scrollbar.paddingEnd, a = t.scrollbar.size - i, o = t.content - t.viewport, s = a - r, c = sn(e, n === "ltr" ? [0, o] : [o * -1, 0]);
|
|
496
|
+
return Ln([0, o], [0, s])(c);
|
|
496
497
|
}
|
|
497
|
-
|
|
498
|
-
function
|
|
498
|
+
U(In, "getThumbOffsetFromScroll");
|
|
499
|
+
function Ln(e, t) {
|
|
499
500
|
return (n) => {
|
|
500
501
|
if (e[0] === e[1] || t[0] === t[1]) return t[0];
|
|
501
502
|
let r = (t[1] - t[0]) / (e[1] - e[0]);
|
|
502
503
|
return t[0] + r * (n - e[0]);
|
|
503
504
|
};
|
|
504
505
|
}
|
|
505
|
-
|
|
506
|
-
function
|
|
506
|
+
U(Ln, "linearScale");
|
|
507
|
+
function Rn(e, t) {
|
|
507
508
|
return e > 0 && e < t;
|
|
508
509
|
}
|
|
509
|
-
|
|
510
|
-
var
|
|
510
|
+
U(Rn, "isScrollingWithinScrollbarBounds");
|
|
511
|
+
var zn = /* @__PURE__ */ U((e, t = () => {}) => {
|
|
511
512
|
let n = {
|
|
512
513
|
left: e.scrollLeft,
|
|
513
514
|
top: e.scrollTop
|
|
514
515
|
}, r = 0;
|
|
515
|
-
return (/* @__PURE__ */
|
|
516
|
+
return (/* @__PURE__ */ U((function i() {
|
|
516
517
|
let a = {
|
|
517
518
|
left: e.scrollLeft,
|
|
518
519
|
top: e.scrollTop
|
|
@@ -520,14 +521,14 @@ var Rn = /* @__PURE__ */ W((e, t = () => {}) => {
|
|
|
520
521
|
(o || s) && t(), n = a, r = window.requestAnimationFrame(i);
|
|
521
522
|
}), "loop"))(), () => window.cancelAnimationFrame(r);
|
|
522
523
|
}, "addUnlinkedScrollListener");
|
|
523
|
-
function
|
|
524
|
-
let n = s(e), r =
|
|
525
|
-
return
|
|
524
|
+
function J(e, t) {
|
|
525
|
+
let n = s(e), r = N.useRef(0);
|
|
526
|
+
return N.useEffect(() => () => window.clearTimeout(r.current), []), N.useCallback(() => {
|
|
526
527
|
window.clearTimeout(r.current), r.current = window.setTimeout(n, t);
|
|
527
528
|
}, [n, t]);
|
|
528
529
|
}
|
|
529
|
-
|
|
530
|
-
function
|
|
530
|
+
U(J, "useDebounceCallback");
|
|
531
|
+
function Y(e, t) {
|
|
531
532
|
let n = s(t);
|
|
532
533
|
c(() => {
|
|
533
534
|
let t = 0;
|
|
@@ -541,12 +542,12 @@ function X(e, t) {
|
|
|
541
542
|
}
|
|
542
543
|
}, [e, n]);
|
|
543
544
|
}
|
|
544
|
-
|
|
545
|
-
var
|
|
545
|
+
U(Y, "useResizeObserver");
|
|
546
|
+
var Bn = mn, Vn = gn, Hn = Mn;
|
|
546
547
|
//#endregion
|
|
547
548
|
//#region lib/components/ui/actions/toolbar/toolbar-toggle-group.tsx
|
|
548
|
-
function
|
|
549
|
-
let [r, i] =
|
|
549
|
+
function Un(e, t, n) {
|
|
550
|
+
let [r, i] = z(t ?? "");
|
|
550
551
|
return {
|
|
551
552
|
value: e ?? r,
|
|
552
553
|
onValueChange: (e) => {
|
|
@@ -554,28 +555,28 @@ function Hn(e, t, n) {
|
|
|
554
555
|
}
|
|
555
556
|
};
|
|
556
557
|
}
|
|
557
|
-
function
|
|
558
|
-
let { label: t, children: r, priority: i, moreAs: a, disabled: o, className: s } = e, { spilled: c, inside: l, props: u } =
|
|
558
|
+
function Wn(e) {
|
|
559
|
+
let { label: t, children: r, priority: i, moreAs: a, disabled: o, className: s } = e, { spilled: c, inside: l, props: u } = se({
|
|
559
560
|
label: t,
|
|
560
561
|
group: !0,
|
|
561
562
|
choice: e.type,
|
|
562
563
|
moreAs: a
|
|
563
|
-
}, i), d =
|
|
564
|
+
}, i), d = L(() => ({ spilled: c }), [c]), f = Un(e.type === "single" ? e.value : void 0, e.type === "single" ? e.defaultValue : void 0, e.type === "single" ? e.onValueChange : void 0), p = {
|
|
564
565
|
...u,
|
|
565
566
|
"aria-label": t,
|
|
566
567
|
disabled: o,
|
|
567
568
|
"data-slot": "toolbar-toggle-group",
|
|
568
569
|
className: n(l && "nxgt-toolbar-group", s),
|
|
569
|
-
children: /* @__PURE__ */
|
|
570
|
+
children: /* @__PURE__ */ V(ue, {
|
|
570
571
|
value: d,
|
|
571
572
|
children: r
|
|
572
573
|
})
|
|
573
574
|
};
|
|
574
|
-
return e.type === "single" ? /* @__PURE__ */
|
|
575
|
+
return e.type === "single" ? /* @__PURE__ */ V(pe, {
|
|
575
576
|
...p,
|
|
576
577
|
type: "single",
|
|
577
578
|
...f
|
|
578
|
-
}) : /* @__PURE__ */
|
|
579
|
+
}) : /* @__PURE__ */ V(pe, {
|
|
579
580
|
...p,
|
|
580
581
|
type: "multiple",
|
|
581
582
|
role: "group",
|
|
@@ -584,8 +585,8 @@ function Un(e) {
|
|
|
584
585
|
onValueChange: e.onValueChange
|
|
585
586
|
});
|
|
586
587
|
}
|
|
587
|
-
function
|
|
588
|
-
return /* @__PURE__ */
|
|
588
|
+
function Gn({ value: e, ...t }) {
|
|
589
|
+
return /* @__PURE__ */ V(le, {
|
|
589
590
|
...t,
|
|
590
591
|
toggle: !0,
|
|
591
592
|
toggleValue: e
|
|
@@ -593,7 +594,7 @@ function Wn({ value: e, ...t }) {
|
|
|
593
594
|
}
|
|
594
595
|
//#endregion
|
|
595
596
|
//#region lib/components/touch-box.ts
|
|
596
|
-
var
|
|
597
|
+
var Kn = "pointer-coarse:size-11 pointer-coarse:p-1.5 pointer-coarse:bg-clip-content", qn = `${Kn} pointer-coarse:-m-1.5`, Jn = "pointer-coarse:size-11 pointer-coarse:p-1 pointer-coarse:-m-1 pointer-coarse:bg-clip-content", Yn = u("nxgt-sheet fixed z-50 flex flex-col gap-4 overflow-y-auto overscroll-contain", {
|
|
597
598
|
variants: {
|
|
598
599
|
side: {
|
|
599
600
|
right: "inset-y-0 right-0 h-full w-[calc(100%-3.5rem)] sm:max-w-sm",
|
|
@@ -635,29 +636,29 @@ var Gn = "pointer-coarse:size-11 pointer-coarse:p-1.5 pointer-coarse:bg-clip-con
|
|
|
635
636
|
});
|
|
636
637
|
//#endregion
|
|
637
638
|
//#region lib/components/ui/overlays/sheet/sheet-parts.tsx
|
|
638
|
-
function
|
|
639
|
-
return /* @__PURE__ */
|
|
639
|
+
function Xn({ className: e, ...t }) {
|
|
640
|
+
return /* @__PURE__ */ V("div", {
|
|
640
641
|
"data-slot": "sheet-header",
|
|
641
642
|
className: n("flex flex-col gap-1.5 p-4", e),
|
|
642
643
|
...t
|
|
643
644
|
});
|
|
644
645
|
}
|
|
645
|
-
function
|
|
646
|
-
return /* @__PURE__ */
|
|
646
|
+
function Zn({ className: e, ...t }) {
|
|
647
|
+
return /* @__PURE__ */ V("div", {
|
|
647
648
|
"data-slot": "sheet-footer",
|
|
648
649
|
className: n("mt-auto flex flex-col gap-2 p-4 *:w-full", e),
|
|
649
650
|
...t
|
|
650
651
|
});
|
|
651
652
|
}
|
|
652
|
-
function
|
|
653
|
-
return /* @__PURE__ */
|
|
653
|
+
function Qn({ className: e, ...t }) {
|
|
654
|
+
return /* @__PURE__ */ V(v, {
|
|
654
655
|
"data-slot": "sheet-title",
|
|
655
656
|
className: n("text-foreground text-xl/7 font-medium tracking-tight", e),
|
|
656
657
|
...t
|
|
657
658
|
});
|
|
658
659
|
}
|
|
659
|
-
function
|
|
660
|
-
return /* @__PURE__ */
|
|
660
|
+
function $n({ className: e, ...t }) {
|
|
661
|
+
return /* @__PURE__ */ V(b, {
|
|
661
662
|
"data-slot": "sheet-description",
|
|
662
663
|
className: n("text-muted-foreground text-sm/5", e),
|
|
663
664
|
...t
|
|
@@ -665,70 +666,70 @@ function Qn({ className: e, ...t }) {
|
|
|
665
666
|
}
|
|
666
667
|
//#endregion
|
|
667
668
|
//#region lib/components/ui/overlays/sheet/sheet.tsx
|
|
668
|
-
function
|
|
669
|
-
return /* @__PURE__ */
|
|
669
|
+
function er({ ...e }) {
|
|
670
|
+
return /* @__PURE__ */ V(p, {
|
|
670
671
|
value: e.modal ?? !0,
|
|
671
|
-
children: /* @__PURE__ */
|
|
672
|
+
children: /* @__PURE__ */ V(x, {
|
|
672
673
|
"data-slot": "sheet",
|
|
673
674
|
...e
|
|
674
675
|
})
|
|
675
676
|
});
|
|
676
677
|
}
|
|
677
|
-
function
|
|
678
|
-
return /* @__PURE__ */
|
|
678
|
+
function tr({ ...e }) {
|
|
679
|
+
return /* @__PURE__ */ V(ne, {
|
|
679
680
|
"data-slot": "sheet-trigger",
|
|
680
681
|
...e
|
|
681
682
|
});
|
|
682
683
|
}
|
|
683
|
-
function
|
|
684
|
-
let { t: s } =
|
|
685
|
-
return /* @__PURE__ */
|
|
684
|
+
function nr({ className: e, color: t, children: r, type: i = "button", variant: a = "ghost", ...o }) {
|
|
685
|
+
let { t: s } = M();
|
|
686
|
+
return /* @__PURE__ */ V(_, {
|
|
686
687
|
"aria-label": r ? void 0 : s("material.buttons.close", "Close"),
|
|
687
688
|
...o,
|
|
688
689
|
type: i,
|
|
689
|
-
className: n("absolute top-2 right-2",
|
|
690
|
+
className: n("absolute top-2 right-2", he({
|
|
690
691
|
variant: a,
|
|
691
692
|
color: t,
|
|
692
|
-
className: n(
|
|
693
|
+
className: n(Jn, e)
|
|
693
694
|
})),
|
|
694
695
|
"data-slot": "sheet-close",
|
|
695
|
-
children: r || /* @__PURE__ */
|
|
696
|
+
children: r || /* @__PURE__ */ V(_t, { className: "size-4" })
|
|
696
697
|
});
|
|
697
698
|
}
|
|
698
|
-
function
|
|
699
|
-
return /* @__PURE__ */
|
|
699
|
+
function rr({ ...e }) {
|
|
700
|
+
return /* @__PURE__ */ V(g, {
|
|
700
701
|
"data-slot": "sheet-portal",
|
|
701
702
|
...e
|
|
702
703
|
});
|
|
703
704
|
}
|
|
704
|
-
function
|
|
705
|
-
return /* @__PURE__ */
|
|
705
|
+
function ir({ className: e, scrim: t = "dim", ...r }) {
|
|
706
|
+
return /* @__PURE__ */ V(ee, {
|
|
706
707
|
"data-slot": "sheet-overlay",
|
|
707
708
|
"data-scrim": t,
|
|
708
709
|
className: n("nxgt-scrim fixed inset-0 z-50", e),
|
|
709
710
|
...r
|
|
710
711
|
});
|
|
711
712
|
}
|
|
712
|
-
function
|
|
713
|
-
let { t: f } =
|
|
713
|
+
function ar({ className: e, children: t, side: r = "right", withCloseButton: i, inset: a = !1, scrim: o, onOpenAutoFocus: s, onCloseAutoFocus: c, onEscapeKeyDown: l, ref: u, ...d }) {
|
|
714
|
+
let { t: f } = M(), p = te({
|
|
714
715
|
onOpenAutoFocus: s,
|
|
715
716
|
onCloseAutoFocus: c
|
|
716
|
-
}), g =
|
|
717
|
+
}), g = y({
|
|
717
718
|
ref: u,
|
|
718
719
|
onEscapeKeyDown: l,
|
|
719
720
|
...d
|
|
720
721
|
});
|
|
721
|
-
return /* @__PURE__ */
|
|
722
|
+
return /* @__PURE__ */ V(be, { children: /* @__PURE__ */ V(m, {
|
|
722
723
|
value: !0,
|
|
723
|
-
children: /* @__PURE__ */
|
|
724
|
+
children: /* @__PURE__ */ H(rr, { children: [/* @__PURE__ */ V(ir, {
|
|
724
725
|
ref: g.overlayRef,
|
|
725
726
|
scrim: o
|
|
726
|
-
}), /* @__PURE__ */
|
|
727
|
+
}), /* @__PURE__ */ H(h, {
|
|
727
728
|
ref: g.ref,
|
|
728
729
|
"data-slot": "sheet-content",
|
|
729
730
|
"data-side": r,
|
|
730
731
|
"data-inset": a || void 0,
|
|
731
|
-
className: n(
|
|
732
|
+
className: n(Yn({
|
|
732
733
|
side: r,
|
|
733
734
|
inset: a
|
|
734
735
|
}), i && (r === "bottom" || a ? "pt-8" : "pt-[calc(2rem+env(safe-area-inset-top))]"), e),
|
|
@@ -737,45 +738,45 @@ function ir({ className: e, children: t, side: r = "right", withCloseButton: i,
|
|
|
737
738
|
onEscapeKeyDown: g.onEscapeKeyDown,
|
|
738
739
|
...d,
|
|
739
740
|
...g.outside,
|
|
740
|
-
children: [t, i && /* @__PURE__ */
|
|
741
|
+
children: [t, i && /* @__PURE__ */ V(_, {
|
|
741
742
|
"aria-label": f("material.buttons.close", "Close"),
|
|
742
|
-
className: n(
|
|
743
|
+
className: n(he({
|
|
743
744
|
variant: "tonal",
|
|
744
745
|
color: "default"
|
|
745
746
|
}), "absolute right-3 top-3", "pointer-coarse:size-11 pointer-coarse:p-1 pointer-coarse:-m-1 pointer-coarse:bg-clip-content", !a && r !== "bottom" && "top-[max(0.75rem,env(safe-area-inset-top))]", !a && r === "right" && "right-[max(0.75rem,env(safe-area-inset-right))]"),
|
|
746
|
-
children: /* @__PURE__ */
|
|
747
|
+
children: /* @__PURE__ */ V(vt, { className: "size-4" })
|
|
747
748
|
})]
|
|
748
749
|
})] })
|
|
749
750
|
}) });
|
|
750
751
|
}
|
|
751
752
|
//#endregion
|
|
752
753
|
//#region lib/components/ui/primitives/scroll-area/scroll-area.tsx
|
|
753
|
-
function
|
|
754
|
-
let a =
|
|
755
|
-
return /* @__PURE__ */
|
|
754
|
+
function or({ className: e, children: t, viewportProps: r, ...i }) {
|
|
755
|
+
let a = Ee();
|
|
756
|
+
return /* @__PURE__ */ H(Bn, {
|
|
756
757
|
"data-slot": "scroll-area",
|
|
757
758
|
className: n("relative", e),
|
|
758
759
|
...i,
|
|
759
760
|
children: [
|
|
760
|
-
/* @__PURE__ */
|
|
761
|
+
/* @__PURE__ */ V(Vn, {
|
|
761
762
|
...r,
|
|
762
763
|
"data-slot": "scroll-area-viewport",
|
|
763
764
|
nonce: a,
|
|
764
765
|
className: n("focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1", r?.className),
|
|
765
766
|
children: t
|
|
766
767
|
}),
|
|
767
|
-
/* @__PURE__ */
|
|
768
|
-
/* @__PURE__ */
|
|
768
|
+
/* @__PURE__ */ V(sr, {}),
|
|
769
|
+
/* @__PURE__ */ V(Hn, {})
|
|
769
770
|
]
|
|
770
771
|
});
|
|
771
772
|
}
|
|
772
|
-
function
|
|
773
|
-
return /* @__PURE__ */
|
|
773
|
+
function sr({ className: e, orientation: t = "vertical", ...r }) {
|
|
774
|
+
return /* @__PURE__ */ V(vn, {
|
|
774
775
|
"data-slot": "scroll-area-scrollbar",
|
|
775
776
|
orientation: t,
|
|
776
777
|
className: n("flex touch-none p-px transition-colors select-none", t === "vertical" && "h-full w-2.5 border-l border-l-transparent", t === "horizontal" && "h-2.5 flex-col border-t border-t-transparent", e),
|
|
777
778
|
...r,
|
|
778
|
-
children: /* @__PURE__ */
|
|
779
|
+
children: /* @__PURE__ */ V(kn, {
|
|
779
780
|
"data-slot": "scroll-area-thumb",
|
|
780
781
|
className: "bg-border relative flex-1 rounded-full"
|
|
781
782
|
})
|
|
@@ -783,9 +784,9 @@ function or({ className: e, orientation: t = "vertical", ...r }) {
|
|
|
783
784
|
}
|
|
784
785
|
//#endregion
|
|
785
786
|
//#region lib/components/ui/feedback/error-state/partials/error-state-actions.tsx
|
|
786
|
-
function
|
|
787
|
-
let { t: i } =
|
|
788
|
-
return /* @__PURE__ */
|
|
787
|
+
function cr({ onRetry: e, retrying: t, retryLabel: n, action: r }) {
|
|
788
|
+
let { t: i } = M(), [a, o] = z(!1);
|
|
789
|
+
return /* @__PURE__ */ H(B, { children: [e && /* @__PURE__ */ V(me, {
|
|
789
790
|
variant: "outlined",
|
|
790
791
|
className: "text-foreground",
|
|
791
792
|
"data-slot": "error-state-retry",
|
|
@@ -798,29 +799,29 @@ function sr({ onRetry: e, retrying: t, retryLabel: n, action: r }) {
|
|
|
798
799
|
t.then(e, e);
|
|
799
800
|
}
|
|
800
801
|
},
|
|
801
|
-
children: n ?? i(
|
|
802
|
+
children: n ?? i(St.retry.key, St.retry.fallback)
|
|
802
803
|
}), r] });
|
|
803
804
|
}
|
|
804
805
|
//#endregion
|
|
805
806
|
//#region lib/components/ui/feedback/error-state/partials/error-state-details.tsx
|
|
806
|
-
function
|
|
807
|
-
let { t } =
|
|
808
|
-
return /* @__PURE__ */
|
|
807
|
+
function lr({ details: e }) {
|
|
808
|
+
let { t } = M(), n = (e) => t(St[e].key, St[e].fallback);
|
|
809
|
+
return /* @__PURE__ */ H("details", {
|
|
809
810
|
"data-slot": "error-state-details",
|
|
810
811
|
className: "w-full max-w-sm rounded border border-border px-3 py-2 text-left text-sm text-foreground",
|
|
811
|
-
children: [/* @__PURE__ */
|
|
812
|
+
children: [/* @__PURE__ */ V("summary", {
|
|
812
813
|
className: "cursor-pointer font-medium",
|
|
813
814
|
children: n("details")
|
|
814
|
-
}), /* @__PURE__ */
|
|
815
|
+
}), /* @__PURE__ */ V("dl", {
|
|
815
816
|
className: "mt-2 flex flex-col gap-2",
|
|
816
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
817
|
+
children: e.map((e, t) => /* @__PURE__ */ H("div", {
|
|
817
818
|
className: "flex flex-col gap-0.5",
|
|
818
|
-
children: [/* @__PURE__ */
|
|
819
|
+
children: [/* @__PURE__ */ H("dt", {
|
|
819
820
|
className: "font-medium",
|
|
820
821
|
children: [n(t === 0 ? "detailsName" : "detailsCause"), `: ${e.name}`]
|
|
821
|
-
}), /* @__PURE__ */
|
|
822
|
+
}), /* @__PURE__ */ H("dd", {
|
|
822
823
|
className: "break-words",
|
|
823
|
-
children: [/* @__PURE__ */
|
|
824
|
+
children: [/* @__PURE__ */ H("span", {
|
|
824
825
|
className: "font-medium",
|
|
825
826
|
children: [n("detailsMessage"), ": "]
|
|
826
827
|
}), e.message]
|
|
@@ -831,17 +832,17 @@ function cr({ details: e }) {
|
|
|
831
832
|
}
|
|
832
833
|
//#endregion
|
|
833
834
|
//#region lib/components/ui/feedback/error-state/error-state.tsx
|
|
834
|
-
function
|
|
835
|
-
return e === void 0 ? n.length > 0 && /* @__PURE__ */
|
|
835
|
+
function ur(e, n) {
|
|
836
|
+
return e === void 0 ? n.length > 0 && /* @__PURE__ */ V(lr, { details: n }) : t(e, n);
|
|
836
837
|
}
|
|
837
|
-
function
|
|
838
|
-
let { t: h } =
|
|
838
|
+
function dr({ kind: e = "generic", size: t, title: n, description: r, illustration: i, icon: a, error: o, showDetails: s, details: c, onRetry: l, retrying: u, retryLabel: d, action: f, children: p, ...m }) {
|
|
839
|
+
let { t: h } = M(), g = wt(e, "error-state"), _ = s === !1 ? [] : Ct(o), v = (l || f) && /* @__PURE__ */ V(cr, {
|
|
839
840
|
onRetry: l,
|
|
840
841
|
retrying: u,
|
|
841
842
|
retryLabel: d,
|
|
842
843
|
action: f
|
|
843
844
|
});
|
|
844
|
-
return /* @__PURE__ */
|
|
845
|
+
return /* @__PURE__ */ H(De, {
|
|
845
846
|
role: "alert",
|
|
846
847
|
"data-slot": "error-state",
|
|
847
848
|
kind: e,
|
|
@@ -852,35 +853,35 @@ function ur({ kind: e = "generic", size: t, title: n, description: r, illustrati
|
|
|
852
853
|
description: r ?? (n == null ? h(g.descriptionKey, g.description) : void 0),
|
|
853
854
|
actions: v || void 0,
|
|
854
855
|
...m,
|
|
855
|
-
children: [p,
|
|
856
|
+
children: [p, ur(c, _)]
|
|
856
857
|
});
|
|
857
858
|
}
|
|
858
859
|
//#endregion
|
|
859
860
|
//#region lib/components/ui/media/pdf-viewer/pdf-reader-states.tsx
|
|
860
|
-
function
|
|
861
|
-
let { t } =
|
|
862
|
-
return /* @__PURE__ */
|
|
861
|
+
function fr({ className: e }) {
|
|
862
|
+
let { t } = M();
|
|
863
|
+
return /* @__PURE__ */ V(Oe, {
|
|
863
864
|
size: "compact",
|
|
864
865
|
kind: "empty",
|
|
865
866
|
className: n("min-h-64 h-full", e),
|
|
866
|
-
icon: /* @__PURE__ */
|
|
867
|
+
icon: /* @__PURE__ */ V(Je, { "aria-hidden": !0 }),
|
|
867
868
|
title: t("material.pdf-reader.empty", "No document selected")
|
|
868
869
|
});
|
|
869
870
|
}
|
|
870
|
-
function
|
|
871
|
-
let { t: e } =
|
|
872
|
-
return /* @__PURE__ */
|
|
871
|
+
function pr() {
|
|
872
|
+
let { t: e } = M();
|
|
873
|
+
return /* @__PURE__ */ H("div", {
|
|
873
874
|
role: "status",
|
|
874
875
|
className: "absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-background/80 backdrop-blur-sm",
|
|
875
|
-
children: [/* @__PURE__ */
|
|
876
|
+
children: [/* @__PURE__ */ V($e, { className: "size-8 animate-spin text-primary-text" }), /* @__PURE__ */ V("p", {
|
|
876
877
|
className: "text-sm text-muted-foreground",
|
|
877
878
|
children: e("material.pdf-reader.loading", "Loading document…")
|
|
878
879
|
})]
|
|
879
880
|
});
|
|
880
881
|
}
|
|
881
|
-
function
|
|
882
|
-
let { t: r } =
|
|
883
|
-
return /* @__PURE__ */
|
|
882
|
+
function mr({ error: e, onRetry: t, title: n }) {
|
|
883
|
+
let { t: r } = M();
|
|
884
|
+
return /* @__PURE__ */ V(dr, {
|
|
884
885
|
size: "compact",
|
|
885
886
|
className: "absolute inset-0",
|
|
886
887
|
title: n ?? r("material.pdf-reader.error", "Failed to load document"),
|
|
@@ -889,21 +890,21 @@ function pr({ error: e, onRetry: t, title: n }) {
|
|
|
889
890
|
retryLabel: r("material.pdf-reader.retry", "Retry")
|
|
890
891
|
});
|
|
891
892
|
}
|
|
892
|
-
function
|
|
893
|
-
let { t: i } =
|
|
894
|
-
return
|
|
893
|
+
function hr({ value: e, incorrect: t = !1, onChange: n, onSubmit: r }) {
|
|
894
|
+
let { t: i } = M(), a = Pe(), o = R(null);
|
|
895
|
+
return F(() => {
|
|
895
896
|
t && o.current?.focus();
|
|
896
|
-
}, [t]), /* @__PURE__ */
|
|
897
|
+
}, [t]), /* @__PURE__ */ H("div", {
|
|
897
898
|
className: "absolute inset-0 flex flex-col items-center justify-center gap-4",
|
|
898
899
|
children: [
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
/* @__PURE__ */
|
|
900
|
+
/* @__PURE__ */ V(Xe, { className: "size-10 text-primary-text opacity-70" }),
|
|
901
|
+
/* @__PURE__ */ V("p", {
|
|
901
902
|
className: "text-sm font-semibold",
|
|
902
903
|
children: i("material.pdf-reader.password", "Password protected")
|
|
903
904
|
}),
|
|
904
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ H("div", {
|
|
905
906
|
className: "flex gap-2",
|
|
906
|
-
children: [/* @__PURE__ */
|
|
907
|
+
children: [/* @__PURE__ */ V(Se, {
|
|
907
908
|
type: "password",
|
|
908
909
|
placeholder: i("material.pdf-reader.password-placeholder", "Enter password"),
|
|
909
910
|
ref: o,
|
|
@@ -917,14 +918,14 @@ function mr({ value: e, incorrect: t = !1, onChange: n, onSubmit: r }) {
|
|
|
917
918
|
e.key === "Enter" && r();
|
|
918
919
|
},
|
|
919
920
|
autoFocus: !0
|
|
920
|
-
}), /* @__PURE__ */
|
|
921
|
+
}), /* @__PURE__ */ V(me, {
|
|
921
922
|
variant: "filled",
|
|
922
923
|
color: "primary",
|
|
923
924
|
onClick: r,
|
|
924
925
|
children: i("material.pdf-reader.unlock", "Unlock")
|
|
925
926
|
})]
|
|
926
927
|
}),
|
|
927
|
-
t && /* @__PURE__ */
|
|
928
|
+
t && /* @__PURE__ */ V("p", {
|
|
928
929
|
id: a,
|
|
929
930
|
role: "alert",
|
|
930
931
|
className: "text-sm text-error-text",
|
|
@@ -935,26 +936,26 @@ function mr({ value: e, incorrect: t = !1, onChange: n, onSubmit: r }) {
|
|
|
935
936
|
}
|
|
936
937
|
//#endregion
|
|
937
938
|
//#region lib/components/ui/media/pdf-reader/use-open-focus-gate.ts
|
|
938
|
-
function
|
|
939
|
-
let e =
|
|
939
|
+
function gr() {
|
|
940
|
+
let e = R(!1);
|
|
940
941
|
return {
|
|
941
942
|
gate: e,
|
|
942
943
|
onOpenAutoFocus: () => {
|
|
943
944
|
e.current = !0;
|
|
944
945
|
},
|
|
945
|
-
clear:
|
|
946
|
+
clear: P(() => {
|
|
946
947
|
e.current = !1;
|
|
947
948
|
}, [])
|
|
948
949
|
};
|
|
949
950
|
}
|
|
950
951
|
//#endregion
|
|
951
952
|
//#region lib/components/ui/media/pdf-reader/modes/dialog-mode.tsx
|
|
952
|
-
function
|
|
953
|
-
let { t: i } =
|
|
954
|
-
return /* @__PURE__ */
|
|
953
|
+
function _r({ open: e, onOpenChange: t, title: n, children: r }) {
|
|
954
|
+
let { t: i } = M(), a = gr();
|
|
955
|
+
return /* @__PURE__ */ V(we, {
|
|
955
956
|
open: e,
|
|
956
957
|
onOpenChange: t,
|
|
957
|
-
children: /* @__PURE__ */
|
|
958
|
+
children: /* @__PURE__ */ H(Ce, {
|
|
958
959
|
size: "full",
|
|
959
960
|
mobilePresentation: "fullscreen",
|
|
960
961
|
"aria-describedby": void 0,
|
|
@@ -963,17 +964,17 @@ function gr({ open: e, onOpenChange: t, title: n, children: r }) {
|
|
|
963
964
|
onPointerMoveCapture: a.clear,
|
|
964
965
|
onKeyDownCapture: a.clear,
|
|
965
966
|
className: "h-[min(56rem,calc(100dvh-4rem))] gap-0 overflow-hidden p-0 max-sm:h-dvh max-sm:p-0",
|
|
966
|
-
children: [/* @__PURE__ */
|
|
967
|
+
children: [/* @__PURE__ */ V(Te, {
|
|
967
968
|
className: "sr-only",
|
|
968
969
|
children: n || i("material.pdf-reader.label", "PDF reader")
|
|
969
|
-
}), /* @__PURE__ */
|
|
970
|
+
}), /* @__PURE__ */ V(ce, {
|
|
970
971
|
value: a.gate,
|
|
971
972
|
children: r
|
|
972
973
|
})]
|
|
973
974
|
})
|
|
974
975
|
});
|
|
975
976
|
}
|
|
976
|
-
var
|
|
977
|
+
var vr = xt({
|
|
977
978
|
name: "pdf-reader",
|
|
978
979
|
initialState: ((e) => ({
|
|
979
980
|
size: "expanded",
|
|
@@ -1033,38 +1034,38 @@ var _r = bt({
|
|
|
1033
1034
|
}
|
|
1034
1035
|
}
|
|
1035
1036
|
});
|
|
1036
|
-
|
|
1037
|
-
var
|
|
1037
|
+
vr.actions;
|
|
1038
|
+
var yr = {
|
|
1038
1039
|
selectEscapeTarget: (e) => e.annotating ? "annotate" : e.searchOpen ? "search" : null,
|
|
1039
1040
|
selectHeaderKind: (e) => e.annotating ? "annotate" : e.searchOpen ? "search" : "default",
|
|
1040
1041
|
selectRailValue: (e) => e.panelOpen ? e.panelTab : ""
|
|
1041
|
-
},
|
|
1042
|
-
function
|
|
1042
|
+
}, br = je(null), xr = je(null);
|
|
1043
|
+
function Sr(e, t) {
|
|
1043
1044
|
if (!e) throw Error(`${t} must be used within PdfReader`);
|
|
1044
1045
|
return e;
|
|
1045
1046
|
}
|
|
1046
|
-
var
|
|
1047
|
-
function
|
|
1047
|
+
var X = () => Sr(Ne(br), "useReaderChrome"), Z = () => Sr(Ne(xr), "useReaderDocumentContext");
|
|
1048
|
+
function Cr(e) {
|
|
1048
1049
|
return e < 600 ? "compact" : e < 840 ? "medium" : "expanded";
|
|
1049
1050
|
}
|
|
1050
1051
|
//#endregion
|
|
1051
1052
|
//#region lib/components/ui/media/pdf-reader/use-container-size.ts
|
|
1052
|
-
function
|
|
1053
|
-
|
|
1053
|
+
function wr(e, t) {
|
|
1054
|
+
I(() => {
|
|
1054
1055
|
let n = e.current;
|
|
1055
|
-
if (!n || (t(
|
|
1056
|
+
if (!n || (t(Cr(n.getBoundingClientRect().width)), typeof ResizeObserver > "u")) return;
|
|
1056
1057
|
let r = new ResizeObserver((e) => {
|
|
1057
1058
|
let n = e[0]?.contentRect.width;
|
|
1058
|
-
n !== void 0 && t(
|
|
1059
|
+
n !== void 0 && t(Cr(n));
|
|
1059
1060
|
});
|
|
1060
1061
|
return r.observe(n), () => r.disconnect();
|
|
1061
1062
|
}, [e, t]);
|
|
1062
1063
|
}
|
|
1063
1064
|
//#endregion
|
|
1064
1065
|
//#region lib/components/ui/media/pdf-reader/use-focus-hand-off.ts
|
|
1065
|
-
function
|
|
1066
|
-
let n =
|
|
1067
|
-
|
|
1066
|
+
function Tr(e, t) {
|
|
1067
|
+
let n = R(t);
|
|
1068
|
+
F(() => {
|
|
1068
1069
|
let r = n.current;
|
|
1069
1070
|
n.current = t;
|
|
1070
1071
|
let i = e.current;
|
|
@@ -1075,7 +1076,7 @@ function wr(e, t) {
|
|
|
1075
1076
|
}
|
|
1076
1077
|
//#endregion
|
|
1077
1078
|
//#region lib/components/ui/media/pdf-reader/reader-keys.ts
|
|
1078
|
-
function
|
|
1079
|
+
function Er(e, { typing: t, inBar: n, scrollsSideways: r = !1, rtl: i = !1 }) {
|
|
1079
1080
|
if ((e.ctrlKey || e.metaKey) && e.key.toLowerCase() === "f") return "search";
|
|
1080
1081
|
if (e.altKey || e.ctrlKey || e.metaKey) return null;
|
|
1081
1082
|
if (e.key === "F3") return e.shiftKey ? "prev-search" : "next-search";
|
|
@@ -1110,14 +1111,14 @@ function Tr(e, { typing: t, inBar: n, scrollsSideways: r = !1, rtl: i = !1 }) {
|
|
|
1110
1111
|
}
|
|
1111
1112
|
//#endregion
|
|
1112
1113
|
//#region lib/components/ui/media/pdf-reader/use-reader-keys.ts
|
|
1113
|
-
var
|
|
1114
|
-
function
|
|
1115
|
-
let { chrome: e, chromeActions: t, frameRef: n, openSearch: r } =
|
|
1114
|
+
var Dr = 1, Or = "[role=\"toolbar\"], [role=\"menu\"], [role=\"radiogroup\"], [role=\"tablist\"], [role=\"listbox\"], [role=\"tree\"], [role=\"grid\"]";
|
|
1115
|
+
function kr() {
|
|
1116
|
+
let { chrome: e, chromeActions: t, frameRef: n, openSearch: r } = X(), { state: i, actions: a, searchHits: o } = Z(), s = oe(n) === "rtl", c = P((e) => {
|
|
1116
1117
|
if (e.defaultPrevented) return;
|
|
1117
|
-
let t = e.target, c = n.current?.querySelector("[data-slot=\"scroll-area-viewport\"]"), l =
|
|
1118
|
+
let t = e.target, c = n.current?.querySelector("[data-slot=\"scroll-area-viewport\"]"), l = Er(e.nativeEvent, {
|
|
1118
1119
|
typing: ["INPUT", "TEXTAREA"].includes(t.tagName),
|
|
1119
|
-
inBar: !!t.closest?.(
|
|
1120
|
-
scrollsSideways: !!(c && c.scrollWidth > c.clientWidth +
|
|
1120
|
+
inBar: !!t.closest?.(Or),
|
|
1121
|
+
scrollsSideways: !!(c && c.scrollWidth > c.clientWidth + Dr),
|
|
1121
1122
|
rtl: s
|
|
1122
1123
|
});
|
|
1123
1124
|
!l || t.closest?.("[role=\"menu\"]") || (e.preventDefault(), {
|
|
@@ -1143,7 +1144,7 @@ function Or() {
|
|
|
1143
1144
|
s,
|
|
1144
1145
|
o,
|
|
1145
1146
|
i.numPages
|
|
1146
|
-
]), l =
|
|
1147
|
+
]), l = yr.selectEscapeTarget(e), u = P((e) => {
|
|
1147
1148
|
if (e.key !== "Escape" || e.defaultPrevented) return;
|
|
1148
1149
|
let r = e.target;
|
|
1149
1150
|
!(r instanceof Node) || !n.current?.contains(r) || r instanceof Element && r.closest("[role=\"menu\"]") || (e.preventDefault(), e.stopPropagation(), l === "annotate" ? t.stopAnnotating() : t.closeSearchField());
|
|
@@ -1152,11 +1153,11 @@ function Or() {
|
|
|
1152
1153
|
l,
|
|
1153
1154
|
n
|
|
1154
1155
|
]);
|
|
1155
|
-
return
|
|
1156
|
+
return _e("keydown", l ? u : null, void 0, !0), c;
|
|
1156
1157
|
}
|
|
1157
1158
|
//#endregion
|
|
1158
1159
|
//#region lib/components/ui/media/pdf-reader/format-locale.ts
|
|
1159
|
-
function
|
|
1160
|
+
function Ar(e, t = "en") {
|
|
1160
1161
|
return new Intl.NumberFormat(t, {
|
|
1161
1162
|
style: "percent",
|
|
1162
1163
|
maximumFractionDigits: 0
|
|
@@ -1164,9 +1165,9 @@ function kr(e, t = "en") {
|
|
|
1164
1165
|
}
|
|
1165
1166
|
//#endregion
|
|
1166
1167
|
//#region lib/components/ui/media/pdf-reader/partials/announcer.tsx
|
|
1167
|
-
function
|
|
1168
|
-
let { t: e, language: t } =
|
|
1169
|
-
return
|
|
1168
|
+
function jr() {
|
|
1169
|
+
let { t: e, language: t } = M(), { state: n, scale: r, announcements: i } = Z(), [a, o] = z(""), { currentPage: s, numPages: c } = n, { recent: l } = i;
|
|
1170
|
+
return F(() => {
|
|
1170
1171
|
!l("page") || c === 0 || o(e("material.pdf-reader.next.announce-page", "Page {page} of {total}", {
|
|
1171
1172
|
page: s,
|
|
1172
1173
|
total: c
|
|
@@ -1175,13 +1176,13 @@ function Ar() {
|
|
|
1175
1176
|
s,
|
|
1176
1177
|
c,
|
|
1177
1178
|
l
|
|
1178
|
-
]),
|
|
1179
|
-
l("zoom") && o(e("material.pdf-reader.next.announce-zoom", "Zoom {level}", { level:
|
|
1179
|
+
]), F(() => {
|
|
1180
|
+
l("zoom") && o(e("material.pdf-reader.next.announce-zoom", "Zoom {level}", { level: Ar(r, t ?? "en") }));
|
|
1180
1181
|
}, [
|
|
1181
1182
|
r,
|
|
1182
1183
|
t,
|
|
1183
1184
|
l
|
|
1184
|
-
]), /* @__PURE__ */
|
|
1185
|
+
]), /* @__PURE__ */ V("div", {
|
|
1185
1186
|
"aria-live": "polite",
|
|
1186
1187
|
"aria-atomic": "true",
|
|
1187
1188
|
className: "sr-only",
|
|
@@ -1190,9 +1191,9 @@ function Ar() {
|
|
|
1190
1191
|
}
|
|
1191
1192
|
//#endregion
|
|
1192
1193
|
//#region lib/components/ui/media/pdf-reader/partials/reader-status.tsx
|
|
1193
|
-
function
|
|
1194
|
-
let { t } =
|
|
1195
|
-
if (n.isPasswordProtected) return /* @__PURE__ */
|
|
1194
|
+
function Mr({ onRetry: e }) {
|
|
1195
|
+
let { t } = M(), { state: n, password: r } = Z();
|
|
1196
|
+
if (n.isPasswordProtected) return /* @__PURE__ */ V(hr, {
|
|
1196
1197
|
value: r.input,
|
|
1197
1198
|
incorrect: n.passwordError ?? !1,
|
|
1198
1199
|
onChange: r.setInput,
|
|
@@ -1200,32 +1201,32 @@ function jr({ onRetry: e }) {
|
|
|
1200
1201
|
});
|
|
1201
1202
|
if (n.error) {
|
|
1202
1203
|
let r = n.loadError ?? Error(n.error);
|
|
1203
|
-
return /* @__PURE__ */
|
|
1204
|
+
return /* @__PURE__ */ V(mr, {
|
|
1204
1205
|
error: r,
|
|
1205
1206
|
onRetry: e,
|
|
1206
|
-
title:
|
|
1207
|
+
title: Ot(r).kind === "invalid" ? t("material.pdf-reader.next.invalid-error", "This file is not a valid PDF") : void 0
|
|
1207
1208
|
});
|
|
1208
1209
|
}
|
|
1209
|
-
return n.isLoading ? /* @__PURE__ */
|
|
1210
|
+
return n.isLoading ? /* @__PURE__ */ V(pr, {}) : null;
|
|
1210
1211
|
}
|
|
1211
1212
|
//#endregion
|
|
1212
1213
|
//#region lib/components/ui/media/pdf-reader/panel-surface.ts
|
|
1213
|
-
var
|
|
1214
|
+
var Nr = "bg-[color-mix(in_oklab,var(--primary)_5%,var(--background))] dark:bg-[color-mix(in_oklab,var(--primary)_14%,var(--card))]";
|
|
1214
1215
|
//#endregion
|
|
1215
1216
|
//#region lib/components/ui/media/pdf-viewer/pdf-outline-sidebar.tsx
|
|
1216
|
-
function
|
|
1217
|
-
let { t: i } =
|
|
1218
|
-
return /* @__PURE__ */
|
|
1217
|
+
function Pr({ items: e, onSelect: t, className: r }) {
|
|
1218
|
+
let { t: i } = M();
|
|
1219
|
+
return /* @__PURE__ */ V("div", {
|
|
1219
1220
|
className: n("flex min-h-0 flex-1 flex-col", r),
|
|
1220
|
-
children: e.length === 0 ? /* @__PURE__ */
|
|
1221
|
+
children: e.length === 0 ? /* @__PURE__ */ V("p", {
|
|
1221
1222
|
className: "px-3 py-6 text-center text-xs text-muted-foreground",
|
|
1222
1223
|
children: i("material.pdf-reader.outline-empty", "No outline in this document")
|
|
1223
|
-
}) : /* @__PURE__ */
|
|
1224
|
+
}) : /* @__PURE__ */ V(or, {
|
|
1224
1225
|
className: "flex-1",
|
|
1225
|
-
children: /* @__PURE__ */
|
|
1226
|
+
children: /* @__PURE__ */ V("nav", {
|
|
1226
1227
|
className: "p-2",
|
|
1227
1228
|
"aria-label": i("material.pdf-reader.outline", "Outline"),
|
|
1228
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
1229
|
+
children: e.map((e, n) => /* @__PURE__ */ V(Fr, {
|
|
1229
1230
|
item: e,
|
|
1230
1231
|
depth: 0,
|
|
1231
1232
|
onSelect: t
|
|
@@ -1234,23 +1235,23 @@ function Nr({ items: e, onSelect: t, className: r }) {
|
|
|
1234
1235
|
})
|
|
1235
1236
|
});
|
|
1236
1237
|
}
|
|
1237
|
-
function
|
|
1238
|
-
let { t: r } =
|
|
1239
|
-
return /* @__PURE__ */
|
|
1238
|
+
function Fr({ item: e, depth: t, onSelect: n }) {
|
|
1239
|
+
let { t: r } = M(), [i, a] = z(t < 1), o = e.items.length > 0;
|
|
1240
|
+
return /* @__PURE__ */ H("div", { children: [/* @__PURE__ */ H("button", {
|
|
1240
1241
|
type: "button",
|
|
1241
1242
|
style: { paddingLeft: 8 + t * 12 },
|
|
1242
1243
|
className: "flex w-full items-center gap-1 rounded px-2 py-1 text-left text-xs hover:bg-accent",
|
|
1243
1244
|
onClick: () => {
|
|
1244
1245
|
n(e), o && a((e) => !e);
|
|
1245
1246
|
},
|
|
1246
|
-
children: [o && /* @__PURE__ */
|
|
1247
|
+
children: [o && /* @__PURE__ */ V("span", {
|
|
1247
1248
|
className: "text-muted-foreground",
|
|
1248
1249
|
children: i ? "▾" : "▸"
|
|
1249
|
-
}), /* @__PURE__ */
|
|
1250
|
+
}), /* @__PURE__ */ V("span", {
|
|
1250
1251
|
className: "truncate",
|
|
1251
1252
|
children: e.title || r("material.pdf-reader.untitled", "Untitled")
|
|
1252
1253
|
})]
|
|
1253
|
-
}), o && i && e.items.map((e, r) => /* @__PURE__ */
|
|
1254
|
+
}), o && i && e.items.map((e, r) => /* @__PURE__ */ V(Fr, {
|
|
1254
1255
|
item: e,
|
|
1255
1256
|
depth: t + 1,
|
|
1256
1257
|
onSelect: n
|
|
@@ -1258,52 +1259,52 @@ function Pr({ item: e, depth: t, onSelect: n }) {
|
|
|
1258
1259
|
}
|
|
1259
1260
|
//#endregion
|
|
1260
1261
|
//#region lib/components/ui/media/pdf-reader/partials/search-nav-buttons.tsx
|
|
1261
|
-
function
|
|
1262
|
-
let { t } =
|
|
1263
|
-
return /* @__PURE__ */
|
|
1262
|
+
function Ir({ stacked: e }) {
|
|
1263
|
+
let { t } = M(), { searchHits: r } = Z(), i = t("material.pdf-reader.search-prev", "Previous match (Shift+F3)"), a = t("material.pdf-reader.search-next", "Next match (F3)");
|
|
1264
|
+
return /* @__PURE__ */ H("div", {
|
|
1264
1265
|
className: n(e ? "ms-auto flex gap-1" : "contents"),
|
|
1265
|
-
children: [/* @__PURE__ */
|
|
1266
|
+
children: [/* @__PURE__ */ V(O, {
|
|
1266
1267
|
label: i,
|
|
1267
|
-
children: /* @__PURE__ */
|
|
1268
|
+
children: /* @__PURE__ */ V(ge, {
|
|
1268
1269
|
variant: "ghost",
|
|
1269
1270
|
color: "default",
|
|
1270
1271
|
"aria-label": i,
|
|
1271
1272
|
tooltip: i,
|
|
1272
1273
|
disabled: r.hitCount === 0,
|
|
1273
1274
|
onClick: () => r.jump(-1),
|
|
1274
|
-
children: /* @__PURE__ */
|
|
1275
|
+
children: /* @__PURE__ */ V(Ue, {})
|
|
1275
1276
|
})
|
|
1276
|
-
}), /* @__PURE__ */
|
|
1277
|
+
}), /* @__PURE__ */ V(O, {
|
|
1277
1278
|
label: a,
|
|
1278
|
-
children: /* @__PURE__ */
|
|
1279
|
+
children: /* @__PURE__ */ V(ge, {
|
|
1279
1280
|
variant: "ghost",
|
|
1280
1281
|
color: "default",
|
|
1281
1282
|
"aria-label": a,
|
|
1282
1283
|
tooltip: a,
|
|
1283
1284
|
disabled: r.hitCount === 0,
|
|
1284
1285
|
onClick: () => r.jump(1),
|
|
1285
|
-
children: /* @__PURE__ */
|
|
1286
|
+
children: /* @__PURE__ */ V(Be, {})
|
|
1286
1287
|
})
|
|
1287
1288
|
})]
|
|
1288
1289
|
});
|
|
1289
1290
|
}
|
|
1290
1291
|
//#endregion
|
|
1291
1292
|
//#region lib/components/ui/media/pdf-reader/partials/search-field.tsx
|
|
1292
|
-
function
|
|
1293
|
-
let { t: r } =
|
|
1294
|
-
|
|
1293
|
+
function Lr({ autoFocus: e = !0, stacked: t = !1 }) {
|
|
1294
|
+
let { t: r } = M(), { state: i, actions: a, searchHits: o } = Z(), s = R(null), { chrome: c } = X(), l = c.searchFocusTick;
|
|
1295
|
+
F(() => {
|
|
1295
1296
|
e && s.current?.focus();
|
|
1296
1297
|
}, [e, l]);
|
|
1297
1298
|
let u = (e) => {
|
|
1298
1299
|
e.key === "Enter" && (e.preventDefault(), o.jump(e.shiftKey ? -1 : 1));
|
|
1299
1300
|
}, d = r("material.pdf-reader.search", "Search");
|
|
1300
|
-
return /* @__PURE__ */
|
|
1301
|
+
return /* @__PURE__ */ H("div", {
|
|
1301
1302
|
className: n("flex min-w-0 flex-1 items-center gap-1", t && "flex-wrap"),
|
|
1302
1303
|
children: [
|
|
1303
|
-
/* @__PURE__ */
|
|
1304
|
+
/* @__PURE__ */ V(O, {
|
|
1304
1305
|
label: d,
|
|
1305
1306
|
fit: !1,
|
|
1306
|
-
children: /* @__PURE__ */
|
|
1307
|
+
children: /* @__PURE__ */ V(Se, {
|
|
1307
1308
|
ref: s,
|
|
1308
1309
|
type: "search",
|
|
1309
1310
|
"aria-label": d,
|
|
@@ -1316,26 +1317,26 @@ function Ir({ autoFocus: e = !0, stacked: t = !1 }) {
|
|
|
1316
1317
|
onKeyDown: u
|
|
1317
1318
|
})
|
|
1318
1319
|
}),
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
+
/* @__PURE__ */ V("span", {
|
|
1320
1321
|
role: "status",
|
|
1321
1322
|
className: n("shrink-0 text-muted-foreground text-xs tabular-nums", t ? "me-auto text-start empty:w-0" : "min-w-14 text-center"),
|
|
1322
1323
|
children: i.searchQuery ? r("material.pdf-reader.next.search-count", "{count, plural, =0 {No match} one {# match} other {# matches}}", { count: o.hitCount }) : null
|
|
1323
1324
|
}),
|
|
1324
|
-
/* @__PURE__ */
|
|
1325
|
+
/* @__PURE__ */ V(Ir, { stacked: t })
|
|
1325
1326
|
]
|
|
1326
1327
|
});
|
|
1327
1328
|
}
|
|
1328
|
-
function
|
|
1329
|
-
return
|
|
1329
|
+
function Rr(e, t, n, r, i = "single", a = "ltr") {
|
|
1330
|
+
return At(Array.from({ length: e }, (e, i) => Gt(t[i], n, r)), {
|
|
1330
1331
|
mode: i,
|
|
1331
1332
|
gap: 16,
|
|
1332
1333
|
columnGap: 12,
|
|
1333
1334
|
dir: a
|
|
1334
1335
|
});
|
|
1335
1336
|
}
|
|
1336
|
-
function
|
|
1337
|
-
let o = Math.min(n || 1,
|
|
1338
|
-
return
|
|
1337
|
+
function zr(e, t, n, r, i, a) {
|
|
1338
|
+
let o = Math.min(n || 1, zt), s = Rr(o, r, 1, i, t), c = Rr(o, r, 2, i, t).maxWidth - s.maxWidth, l = s.maxWidth - c;
|
|
1339
|
+
return Vt(e, {
|
|
1339
1340
|
width: c,
|
|
1340
1341
|
height: Math.max(...s.rows.map((e) => e.height))
|
|
1341
1342
|
}, {
|
|
@@ -1343,7 +1344,7 @@ function Rr(e, t, n, r, i, a) {
|
|
|
1343
1344
|
height: a.height
|
|
1344
1345
|
});
|
|
1345
1346
|
}
|
|
1346
|
-
function
|
|
1347
|
+
function Br(e, t) {
|
|
1347
1348
|
let n = 0, r = e.length - 1, i = -1;
|
|
1348
1349
|
for (; n <= r;) {
|
|
1349
1350
|
let a = n + r >> 1;
|
|
@@ -1351,21 +1352,21 @@ function zr(e, t) {
|
|
|
1351
1352
|
}
|
|
1352
1353
|
return i;
|
|
1353
1354
|
}
|
|
1354
|
-
function
|
|
1355
|
-
let r =
|
|
1355
|
+
function Vr(e, t, n) {
|
|
1356
|
+
let r = Br(e, t);
|
|
1356
1357
|
return r < 0 ? null : e[r + n] ?? null;
|
|
1357
1358
|
}
|
|
1358
|
-
function
|
|
1359
|
-
let r =
|
|
1359
|
+
function Hr(e, t, n) {
|
|
1360
|
+
let r = Br(e, t), i = e[r];
|
|
1360
1361
|
return i === void 0 ? [t, t] : [i, Math.min(n, (e[r + 1] ?? n + 1) - 1)];
|
|
1361
1362
|
}
|
|
1362
1363
|
//#endregion
|
|
1363
1364
|
//#region lib/components/ui/media/pdf-reader/engine/canvas-cache.ts
|
|
1364
|
-
function
|
|
1365
|
+
function Ur(e) {
|
|
1365
1366
|
e && (e.width = 0, e.height = 0);
|
|
1366
1367
|
}
|
|
1367
|
-
var
|
|
1368
|
-
function
|
|
1368
|
+
var Wr = 5e7, Gr = ({ page: e, scale: t, rotation: n }) => `${e}@${t}/${n}`;
|
|
1369
|
+
function Kr(e = Wr) {
|
|
1369
1370
|
let t = /* @__PURE__ */ new Set(), n = 0, r = 0, i = 0, a = () => {
|
|
1370
1371
|
for (; n > e && r > 1;) {
|
|
1371
1372
|
let e;
|
|
@@ -1382,7 +1383,7 @@ function Gr(e = Ur) {
|
|
|
1382
1383
|
};
|
|
1383
1384
|
return {
|
|
1384
1385
|
cache() {
|
|
1385
|
-
return
|
|
1386
|
+
return qr({
|
|
1386
1387
|
members: t,
|
|
1387
1388
|
stamp: () => ++i,
|
|
1388
1389
|
added(e) {
|
|
@@ -1398,22 +1399,22 @@ function Gr(e = Ur) {
|
|
|
1398
1399
|
}
|
|
1399
1400
|
};
|
|
1400
1401
|
}
|
|
1401
|
-
function
|
|
1402
|
+
function qr(e) {
|
|
1402
1403
|
let t = /* @__PURE__ */ new Map(), n = !1, r = (n, r) => {
|
|
1403
1404
|
let i = t.get(n);
|
|
1404
|
-
i && (t.delete(n), e.removed(i.pixels), (r === "force" || r === "safe" && !i.canvas.isConnected) &&
|
|
1405
|
+
i && (t.delete(n), e.removed(i.pixels), (r === "force" || r === "safe" && !i.canvas.isConnected) && Ur(i.canvas));
|
|
1405
1406
|
}, i = {
|
|
1406
1407
|
oldest: () => t.values().next().value,
|
|
1407
|
-
drop: (e) => r(
|
|
1408
|
+
drop: (e) => r(Gr(e.key), "safe")
|
|
1408
1409
|
};
|
|
1409
1410
|
return e.members.add(i), {
|
|
1410
1411
|
take(e) {
|
|
1411
|
-
let n =
|
|
1412
|
+
let n = Gr(e), i = t.get(n);
|
|
1412
1413
|
if (i) return r(n, "keep"), i.canvas;
|
|
1413
1414
|
},
|
|
1414
1415
|
put(i, a) {
|
|
1415
|
-
if (n) return
|
|
1416
|
-
let o =
|
|
1416
|
+
if (n) return Ur(a);
|
|
1417
|
+
let o = Gr(i);
|
|
1417
1418
|
r(o, "safe"), t.set(o, {
|
|
1418
1419
|
key: i,
|
|
1419
1420
|
canvas: a,
|
|
@@ -1437,16 +1438,16 @@ function Kr(e) {
|
|
|
1437
1438
|
}
|
|
1438
1439
|
};
|
|
1439
1440
|
}
|
|
1440
|
-
var
|
|
1441
|
-
function
|
|
1442
|
-
return (e === void 0 ?
|
|
1441
|
+
var Jr = Kr();
|
|
1442
|
+
function Yr(e) {
|
|
1443
|
+
return (e === void 0 ? Jr : Kr(e)).cache();
|
|
1443
1444
|
}
|
|
1444
1445
|
//#endregion
|
|
1445
1446
|
//#region lib/components/ui/media/pdf-reader/engine/draw-page.ts
|
|
1446
|
-
function
|
|
1447
|
+
function Xr(e) {
|
|
1447
1448
|
return e instanceof Error ? e : Error(String(e));
|
|
1448
1449
|
}
|
|
1449
|
-
async function
|
|
1450
|
+
async function Zr(e, t, n, r, i) {
|
|
1450
1451
|
let a = await e.getPage(t);
|
|
1451
1452
|
if (i.aborted) return null;
|
|
1452
1453
|
let o = (a.rotate + n) % 360, s = "scale" in r ? r.scale : r.width / a.getViewport({
|
|
@@ -1463,9 +1464,9 @@ async function Xr(e, t, n, r, i) {
|
|
|
1463
1464
|
rotation: o
|
|
1464
1465
|
};
|
|
1465
1466
|
}
|
|
1466
|
-
async function
|
|
1467
|
+
async function Qr(e, t, n) {
|
|
1467
1468
|
let { page: r, viewport: i, scale: a, rotation: o } = e;
|
|
1468
|
-
return await
|
|
1469
|
+
return await It(r, t, Ft({
|
|
1469
1470
|
cssWidth: i.width,
|
|
1470
1471
|
cssHeight: i.height,
|
|
1471
1472
|
devicePixelRatio: window.devicePixelRatio,
|
|
@@ -1477,26 +1478,26 @@ async function Zr(e, t, n) {
|
|
|
1477
1478
|
}
|
|
1478
1479
|
//#endregion
|
|
1479
1480
|
//#region lib/components/ui/media/pdf-reader/engine/use-thumbnail.ts
|
|
1480
|
-
function
|
|
1481
|
-
let { doc: t, pageNumber: n, width: r, rotation: i, box: a, host: o } = e, [s, c] =
|
|
1482
|
-
|
|
1481
|
+
function $r(e) {
|
|
1482
|
+
let { doc: t, pageNumber: n, width: r, rotation: i, box: a, host: o } = e, [s, c] = z(!1), l = R(null), u = R(e.onError);
|
|
1483
|
+
I(() => {
|
|
1483
1484
|
u.current = e.onError;
|
|
1484
|
-
}),
|
|
1485
|
+
}), F(() => {
|
|
1485
1486
|
let e = a.current;
|
|
1486
1487
|
if (!e) return;
|
|
1487
1488
|
let t = new IntersectionObserver(([e]) => c(!!e?.isIntersecting), { rootMargin: "240px 0px" });
|
|
1488
1489
|
return t.observe(e), () => t.disconnect();
|
|
1489
|
-
}, [a]),
|
|
1490
|
+
}, [a]), F(() => {
|
|
1490
1491
|
let e = o.current;
|
|
1491
1492
|
if (!t || !e || !s) return;
|
|
1492
1493
|
let a = new AbortController(), { signal: c } = a, d = document.createElement("canvas");
|
|
1493
1494
|
return d.dataset.slot = "pdf-thumbnail-canvas", (async () => {
|
|
1494
|
-
let a = await
|
|
1495
|
-
a && await
|
|
1495
|
+
let a = await Zr(t, n, i, { width: r }, c);
|
|
1496
|
+
a && await Qr(a, d, c) && (l.current = a.page, e.replaceChildren(d));
|
|
1496
1497
|
})().catch((e) => {
|
|
1497
|
-
c.aborted || u.current?.(
|
|
1498
|
+
c.aborted || u.current?.(Xr(e));
|
|
1498
1499
|
}), () => {
|
|
1499
|
-
a.abort(), e.replaceChildren(),
|
|
1500
|
+
a.abort(), e.replaceChildren(), Ur(d);
|
|
1500
1501
|
};
|
|
1501
1502
|
}, [
|
|
1502
1503
|
t,
|
|
@@ -1505,7 +1506,7 @@ function Qr(e) {
|
|
|
1505
1506
|
i,
|
|
1506
1507
|
s,
|
|
1507
1508
|
o
|
|
1508
|
-
]),
|
|
1509
|
+
]), F(() => () => {
|
|
1509
1510
|
l.current?.cleanup(), l.current = null;
|
|
1510
1511
|
}, [
|
|
1511
1512
|
t,
|
|
@@ -1513,9 +1514,9 @@ function Qr(e) {
|
|
|
1513
1514
|
s
|
|
1514
1515
|
]);
|
|
1515
1516
|
}
|
|
1516
|
-
var
|
|
1517
|
-
let { t: l } =
|
|
1518
|
-
|
|
1517
|
+
var ei = Me(function({ pageNumber: e, doc: t, size: r, rotation: i, lit: a, current: o, tabStop: s, onGo: c }) {
|
|
1518
|
+
let { t: l } = M(), u = R(null), d = R(null);
|
|
1519
|
+
$r({
|
|
1519
1520
|
doc: t,
|
|
1520
1521
|
pageNumber: e,
|
|
1521
1522
|
width: 120,
|
|
@@ -1523,8 +1524,8 @@ var $r = je(function({ pageNumber: e, doc: t, size: r, rotation: i, lit: a, curr
|
|
|
1523
1524
|
box: u,
|
|
1524
1525
|
host: d
|
|
1525
1526
|
});
|
|
1526
|
-
let f =
|
|
1527
|
-
return /* @__PURE__ */
|
|
1527
|
+
let f = Gt(r, 120 / Yt(r ?? Rt, i).width, i);
|
|
1528
|
+
return /* @__PURE__ */ H("button", {
|
|
1528
1529
|
ref: u,
|
|
1529
1530
|
"data-lit": a ? "" : void 0,
|
|
1530
1531
|
"data-page-number": e,
|
|
@@ -1534,32 +1535,32 @@ var $r = je(function({ pageNumber: e, doc: t, size: r, rotation: i, lit: a, curr
|
|
|
1534
1535
|
"aria-label": l("material.pdf-reader.go-to-page", "Go to page {page}", { page: e }),
|
|
1535
1536
|
"aria-current": o ? "page" : void 0,
|
|
1536
1537
|
className: n("flex cursor-pointer flex-col items-center gap-1 rounded-lg p-1.5 outline-none transition-colors hover:bg-foreground/5 focus-visible:ring-2 focus-visible:ring-ring", a && "bg-primary/10"),
|
|
1537
|
-
children: [/* @__PURE__ */
|
|
1538
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1538
1539
|
ref: d,
|
|
1539
1540
|
className: n("overflow-hidden rounded-sm bg-white shadow-sm [&>canvas]:block [&>canvas]:size-full", a && "ring-2 ring-primary-indicator"),
|
|
1540
1541
|
style: f
|
|
1541
|
-
}), /* @__PURE__ */
|
|
1542
|
+
}), /* @__PURE__ */ V("span", {
|
|
1542
1543
|
"aria-hidden": !0,
|
|
1543
1544
|
className: n("text-xs tabular-nums", a ? "font-semibold text-primary-text" : "text-muted-foreground"),
|
|
1544
1545
|
children: e
|
|
1545
1546
|
})]
|
|
1546
1547
|
});
|
|
1547
|
-
}),
|
|
1548
|
+
}), ti = {
|
|
1548
1549
|
ArrowDown: (e) => e + 1,
|
|
1549
1550
|
ArrowUp: (e) => e - 1,
|
|
1550
1551
|
Home: () => 1,
|
|
1551
1552
|
End: (e, t) => t
|
|
1552
1553
|
};
|
|
1553
|
-
function
|
|
1554
|
-
let { t: e } =
|
|
1555
|
-
return /* @__PURE__ */
|
|
1554
|
+
function ni() {
|
|
1555
|
+
let { t: e } = M(), { state: t, actions: n, doc: r, rowStarts: i } = Z(), { numPages: a, currentPage: o, rotation: s } = t, c = R(null), [l, u] = z(null), [d, f] = Hr(i, o, a), p = Math.min(Math.max(l ?? o, 1), a);
|
|
1556
|
+
return /* @__PURE__ */ V("div", {
|
|
1556
1557
|
className: "min-h-0 flex-1 overflow-y-auto",
|
|
1557
|
-
children: /* @__PURE__ */
|
|
1558
|
+
children: /* @__PURE__ */ V("div", {
|
|
1558
1559
|
ref: c,
|
|
1559
1560
|
role: "group",
|
|
1560
1561
|
"aria-label": e("material.pdf-reader.thumbnails", "Page thumbnails"),
|
|
1561
1562
|
onKeyDown: (e) => {
|
|
1562
|
-
let t =
|
|
1563
|
+
let t = ti[e.key], n = Number(e.target.closest("[data-page-number]")?.getAttribute("data-page-number"));
|
|
1563
1564
|
if (!t || !n || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
1564
1565
|
e.preventDefault();
|
|
1565
1566
|
let r = Math.min(Math.max(t(n, a), 1), a);
|
|
@@ -1575,7 +1576,7 @@ function ti() {
|
|
|
1575
1576
|
className: "flex flex-col items-center gap-2 p-2",
|
|
1576
1577
|
children: Array.from({ length: a }, (e, i) => {
|
|
1577
1578
|
let a = i + 1;
|
|
1578
|
-
return /* @__PURE__ */
|
|
1579
|
+
return /* @__PURE__ */ V(ei, {
|
|
1579
1580
|
pageNumber: a,
|
|
1580
1581
|
doc: r,
|
|
1581
1582
|
size: t.pageSizes?.[i],
|
|
@@ -1591,51 +1592,51 @@ function ti() {
|
|
|
1591
1592
|
}
|
|
1592
1593
|
//#endregion
|
|
1593
1594
|
//#region lib/components/ui/media/pdf-reader/partials/panel-content.tsx
|
|
1594
|
-
function
|
|
1595
|
-
let { t: e } =
|
|
1596
|
-
return t.panelTab === "thumbs" ? /* @__PURE__ */
|
|
1595
|
+
function ri() {
|
|
1596
|
+
let { t: e } = M(), { chrome: t } = X(), { state: n, onOutlineSelect: r } = Z();
|
|
1597
|
+
return t.panelTab === "thumbs" ? /* @__PURE__ */ V(ni, {}) : t.panelTab === "outline" ? n.outline.length === 0 ? /* @__PURE__ */ H("div", {
|
|
1597
1598
|
className: "flex flex-col items-center gap-2 px-6 py-10 text-center text-muted-foreground text-sm",
|
|
1598
|
-
children: [/* @__PURE__ */
|
|
1599
|
+
children: [/* @__PURE__ */ V(Qe, {
|
|
1599
1600
|
"aria-hidden": !0,
|
|
1600
1601
|
className: "size-6 opacity-60"
|
|
1601
|
-
}), /* @__PURE__ */
|
|
1602
|
-
}) : /* @__PURE__ */
|
|
1602
|
+
}), /* @__PURE__ */ V("p", { children: e("material.pdf-reader.next.outline-empty", "This document has no outline") })]
|
|
1603
|
+
}) : /* @__PURE__ */ V(Pr, {
|
|
1603
1604
|
items: n.outline,
|
|
1604
1605
|
onSelect: r
|
|
1605
|
-
}) : t.panelTab === "search" ? /* @__PURE__ */
|
|
1606
|
+
}) : t.panelTab === "search" ? /* @__PURE__ */ V("div", {
|
|
1606
1607
|
className: "p-3",
|
|
1607
|
-
children: /* @__PURE__ */
|
|
1608
|
-
}) : /* @__PURE__ */
|
|
1608
|
+
children: /* @__PURE__ */ V(Lr, { stacked: !0 })
|
|
1609
|
+
}) : /* @__PURE__ */ V("p", {
|
|
1609
1610
|
className: "p-4 text-muted-foreground text-sm",
|
|
1610
1611
|
children: e("material.pdf-reader.next.annotations-empty", "No annotations yet")
|
|
1611
1612
|
});
|
|
1612
1613
|
}
|
|
1613
1614
|
//#endregion
|
|
1614
1615
|
//#region lib/components/ui/media/pdf-reader/types.ts
|
|
1615
|
-
var
|
|
1616
|
+
var ii = [
|
|
1616
1617
|
"thumbs",
|
|
1617
1618
|
"outline",
|
|
1618
1619
|
"annotations",
|
|
1619
1620
|
"search"
|
|
1620
|
-
],
|
|
1621
|
+
], ai = [
|
|
1621
1622
|
"yellow",
|
|
1622
1623
|
"green",
|
|
1623
1624
|
"blue",
|
|
1624
1625
|
"pink",
|
|
1625
1626
|
"red"
|
|
1626
|
-
],
|
|
1627
|
+
], oi = [
|
|
1627
1628
|
"annotate",
|
|
1628
1629
|
"annotationCount",
|
|
1629
1630
|
"initialChrome",
|
|
1630
1631
|
"showUnfinished"
|
|
1631
|
-
],
|
|
1632
|
-
thumbs:
|
|
1633
|
-
outline:
|
|
1634
|
-
annotations:
|
|
1635
|
-
search:
|
|
1632
|
+
], si = {
|
|
1633
|
+
thumbs: Ze,
|
|
1634
|
+
outline: Qe,
|
|
1635
|
+
annotations: tt,
|
|
1636
|
+
search: dt
|
|
1636
1637
|
};
|
|
1637
|
-
function
|
|
1638
|
-
let { t: e } =
|
|
1638
|
+
function ci() {
|
|
1639
|
+
let { t: e } = M();
|
|
1639
1640
|
return {
|
|
1640
1641
|
thumbs: e("material.pdf-reader.next.thumbnails", "Thumbnails"),
|
|
1641
1642
|
outline: e("material.pdf-reader.outline", "Outline"),
|
|
@@ -1643,15 +1644,15 @@ function si() {
|
|
|
1643
1644
|
search: e("material.pdf-reader.search", "Search")
|
|
1644
1645
|
};
|
|
1645
1646
|
}
|
|
1646
|
-
function
|
|
1647
|
-
let { props: e } =
|
|
1648
|
-
return e.annotate ?
|
|
1647
|
+
function li() {
|
|
1648
|
+
let { props: e } = X();
|
|
1649
|
+
return e.annotate ? ii : ii.filter((e) => e !== "annotations");
|
|
1649
1650
|
}
|
|
1650
1651
|
//#endregion
|
|
1651
1652
|
//#region lib/components/ui/media/pdf-reader/partials/panel-tabs.tsx
|
|
1652
|
-
function
|
|
1653
|
-
let { t } =
|
|
1654
|
-
return /* @__PURE__ */
|
|
1653
|
+
function ui({ iconOnly: e }) {
|
|
1654
|
+
let { t } = M(), { chrome: n, chromeActions: r } = X(), i = ci(), a = li(), o = e ? a : a.filter((e) => e !== "search");
|
|
1655
|
+
return /* @__PURE__ */ V(ye, {
|
|
1655
1656
|
type: "single",
|
|
1656
1657
|
variant: "segmented",
|
|
1657
1658
|
value: n.panelTab,
|
|
@@ -1659,41 +1660,41 @@ function li({ iconOnly: e }) {
|
|
|
1659
1660
|
onValueChange: (e) => e && r.openPanelTab(e),
|
|
1660
1661
|
className: "mx-3 mt-3 mb-1 w-auto shrink-0",
|
|
1661
1662
|
children: o.map((t) => {
|
|
1662
|
-
let n =
|
|
1663
|
-
return /* @__PURE__ */
|
|
1663
|
+
let n = si[t];
|
|
1664
|
+
return /* @__PURE__ */ H(ve, {
|
|
1664
1665
|
value: t,
|
|
1665
1666
|
"aria-label": e ? i[t] : void 0,
|
|
1666
1667
|
className: "flex-1",
|
|
1667
|
-
children: [/* @__PURE__ */
|
|
1668
|
+
children: [/* @__PURE__ */ V(n, {}), e ? null : i[t]]
|
|
1668
1669
|
}, t);
|
|
1669
1670
|
})
|
|
1670
1671
|
});
|
|
1671
1672
|
}
|
|
1672
1673
|
//#endregion
|
|
1673
1674
|
//#region lib/components/ui/media/pdf-reader/partials/phone-sheet.tsx
|
|
1674
|
-
function
|
|
1675
|
-
let { t: e } =
|
|
1675
|
+
function di() {
|
|
1676
|
+
let { t: e } = M(), { chrome: t, chromeActions: r, mode: i } = X(), a = e("material.pdf-reader.next.panel", "Document panel"), o = /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(ui, { iconOnly: !1 }), /* @__PURE__ */ V("div", {
|
|
1676
1677
|
className: "flex h-[min(46dvh,22rem)] min-h-0 flex-col",
|
|
1677
|
-
children: /* @__PURE__ */
|
|
1678
|
+
children: /* @__PURE__ */ V(ri, {})
|
|
1678
1679
|
})] });
|
|
1679
|
-
return i === "fullscreen" ? t.panelOpen ? /* @__PURE__ */
|
|
1680
|
+
return i === "fullscreen" ? t.panelOpen ? /* @__PURE__ */ H("aside", {
|
|
1680
1681
|
"aria-label": a,
|
|
1681
|
-
className: n("absolute inset-x-0 bottom-0 z-20 flex flex-col rounded-t-2xl border-t pb-2 shadow-2xl",
|
|
1682
|
-
children: [/* @__PURE__ */
|
|
1682
|
+
className: n("absolute inset-x-0 bottom-0 z-20 flex flex-col rounded-t-2xl border-t pb-2 shadow-2xl", Nr),
|
|
1683
|
+
children: [/* @__PURE__ */ V(ge, {
|
|
1683
1684
|
variant: "ghost",
|
|
1684
1685
|
color: "default",
|
|
1685
1686
|
"aria-label": e("material.buttons.close", "Close"),
|
|
1686
1687
|
className: "absolute end-1 top-1 z-10",
|
|
1687
1688
|
onClick: () => r.closePanel(),
|
|
1688
|
-
children: /* @__PURE__ */
|
|
1689
|
+
children: /* @__PURE__ */ V(_t, {})
|
|
1689
1690
|
}), o]
|
|
1690
|
-
}) : null : /* @__PURE__ */
|
|
1691
|
+
}) : null : /* @__PURE__ */ V(er, {
|
|
1691
1692
|
open: t.panelOpen,
|
|
1692
1693
|
onOpenChange: (e) => !e && r.closePanel(),
|
|
1693
|
-
children: /* @__PURE__ */
|
|
1694
|
+
children: /* @__PURE__ */ H(ar, {
|
|
1694
1695
|
side: "bottom",
|
|
1695
|
-
className: n("gap-0 rounded-t-2xl p-0",
|
|
1696
|
-
children: [/* @__PURE__ */
|
|
1696
|
+
className: n("gap-0 rounded-t-2xl p-0", Nr),
|
|
1697
|
+
children: [/* @__PURE__ */ V(Qn, {
|
|
1697
1698
|
className: "sr-only",
|
|
1698
1699
|
children: a
|
|
1699
1700
|
}), o]
|
|
@@ -1702,24 +1703,24 @@ function ui() {
|
|
|
1702
1703
|
}
|
|
1703
1704
|
//#endregion
|
|
1704
1705
|
//#region lib/components/ui/media/pdf-reader/partials/side-panel.tsx
|
|
1705
|
-
function
|
|
1706
|
-
let { t: e } =
|
|
1707
|
-
return t.size === "compact" ? /* @__PURE__ */
|
|
1706
|
+
function fi() {
|
|
1707
|
+
let { t: e } = M(), { chrome: t } = X();
|
|
1708
|
+
return t.size === "compact" ? /* @__PURE__ */ V(di, {}) : t.panelOpen ? /* @__PURE__ */ H("aside", {
|
|
1708
1709
|
"aria-label": e("material.pdf-reader.next.panel", "Document panel"),
|
|
1709
|
-
className: n("flex h-full w-56 shrink-0 flex-col border-e border-border",
|
|
1710
|
-
children: [t.size === "medium" ? /* @__PURE__ */
|
|
1710
|
+
className: n("flex h-full w-56 shrink-0 flex-col border-e border-border", Nr),
|
|
1711
|
+
children: [t.size === "medium" ? /* @__PURE__ */ V(ui, { iconOnly: !0 }) : null, /* @__PURE__ */ V("div", {
|
|
1711
1712
|
className: "flex min-h-0 flex-1 flex-col",
|
|
1712
|
-
children: /* @__PURE__ */
|
|
1713
|
+
children: /* @__PURE__ */ V(ri, {})
|
|
1713
1714
|
})]
|
|
1714
1715
|
}) : null;
|
|
1715
1716
|
}
|
|
1716
1717
|
//#endregion
|
|
1717
1718
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-canvas.ts
|
|
1718
|
-
function
|
|
1719
|
-
let { doc: t, pageNumber: n, scale: r, rotation: i, host: a, cache: o, attempt: s } = e, [c, l] =
|
|
1720
|
-
return
|
|
1719
|
+
function pi(e) {
|
|
1720
|
+
let { doc: t, pageNumber: n, scale: r, rotation: i, host: a, cache: o, attempt: s } = e, [c, l] = z(null), u = R(null), d = R(e.onError), f = R(e.onDrawn);
|
|
1721
|
+
return I(() => {
|
|
1721
1722
|
d.current = e.onError, f.current = e.onDrawn;
|
|
1722
|
-
}),
|
|
1723
|
+
}), F(() => {
|
|
1723
1724
|
let e = a.current;
|
|
1724
1725
|
if (!t || !e || !o) return;
|
|
1725
1726
|
let s = {
|
|
@@ -1728,10 +1729,10 @@ function fi(e) {
|
|
|
1728
1729
|
rotation: i
|
|
1729
1730
|
}, c = new AbortController(), { signal: p } = c, m = o.take(s), h = !!m;
|
|
1730
1731
|
return (async () => {
|
|
1731
|
-
let a = await
|
|
1732
|
+
let a = await Zr(t, n, i, { scale: r }, p);
|
|
1732
1733
|
if (a) {
|
|
1733
1734
|
if (!m) {
|
|
1734
|
-
if (m = document.createElement("canvas"), m.dataset.slot = "pdf-page-canvas", !await
|
|
1735
|
+
if (m = document.createElement("canvas"), m.dataset.slot = "pdf-page-canvas", !await Qr(a, m, p)) return;
|
|
1735
1736
|
h = !0;
|
|
1736
1737
|
}
|
|
1737
1738
|
m.setAttribute("aria-hidden", "true"), e.replaceChildren(m), o.keepScale(r), u.current = a.page, l({
|
|
@@ -1740,9 +1741,9 @@ function fi(e) {
|
|
|
1740
1741
|
}), f.current?.();
|
|
1741
1742
|
}
|
|
1742
1743
|
})().catch((e) => {
|
|
1743
|
-
p.aborted || d.current(
|
|
1744
|
+
p.aborted || d.current(Xr(e));
|
|
1744
1745
|
}), () => {
|
|
1745
|
-
c.abort(), m && h ? o.put(s, m) :
|
|
1746
|
+
c.abort(), m && h ? o.put(s, m) : Ur(m);
|
|
1746
1747
|
};
|
|
1747
1748
|
}, [
|
|
1748
1749
|
t,
|
|
@@ -1752,27 +1753,27 @@ function fi(e) {
|
|
|
1752
1753
|
a,
|
|
1753
1754
|
o,
|
|
1754
1755
|
s
|
|
1755
|
-
]),
|
|
1756
|
+
]), F(() => () => {
|
|
1756
1757
|
u.current?.cleanup(), u.current = null;
|
|
1757
1758
|
}, [t, n]), c;
|
|
1758
1759
|
}
|
|
1759
1760
|
//#endregion
|
|
1760
1761
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-failure.ts
|
|
1761
|
-
function
|
|
1762
|
-
let [e, t] =
|
|
1762
|
+
function mi() {
|
|
1763
|
+
let [e, t] = z(null), [n, r] = z(0), i = R(null);
|
|
1763
1764
|
return {
|
|
1764
1765
|
failure: e,
|
|
1765
1766
|
attempt: n,
|
|
1766
1767
|
box: i,
|
|
1767
|
-
onError:
|
|
1768
|
+
onError: P((e) => t({
|
|
1768
1769
|
error: e,
|
|
1769
1770
|
busy: !1
|
|
1770
1771
|
}), []),
|
|
1771
|
-
onDrawn:
|
|
1772
|
+
onDrawn: P(() => {
|
|
1772
1773
|
let e = i.current;
|
|
1773
1774
|
e?.contains(document.activeElement) && e.closest("[data-slot=\"scroll-area-viewport\"]")?.focus({ preventScroll: !0 }), t(null);
|
|
1774
1775
|
}, []),
|
|
1775
|
-
retry:
|
|
1776
|
+
retry: P(() => {
|
|
1776
1777
|
t((e) => e && {
|
|
1777
1778
|
...e,
|
|
1778
1779
|
busy: !0
|
|
@@ -1782,8 +1783,8 @@ function pi() {
|
|
|
1782
1783
|
}
|
|
1783
1784
|
//#endregion
|
|
1784
1785
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-link-labels.ts
|
|
1785
|
-
function
|
|
1786
|
-
let { t } =
|
|
1786
|
+
function hi(e) {
|
|
1787
|
+
let { t } = M(), n = R(/* @__PURE__ */ new Map()), r = L(() => ({
|
|
1787
1788
|
external: (e) => t("material.pdf-reader.link-external", "Link: {host}", { host: e }),
|
|
1788
1789
|
goToPage: (e) => t("material.pdf-reader.go-to-page", "Go to page {page}", { page: e }),
|
|
1789
1790
|
internal: t("material.pdf-reader.link-internal", "Link in document"),
|
|
@@ -1793,42 +1794,42 @@ function mi(e) {
|
|
|
1793
1794
|
})
|
|
1794
1795
|
}), [t]);
|
|
1795
1796
|
return {
|
|
1796
|
-
onAnnotations:
|
|
1797
|
+
onAnnotations: P((e) => {
|
|
1797
1798
|
for (let t of e) t.id && n.current.set(t.id, t);
|
|
1798
1799
|
}, []),
|
|
1799
|
-
labelLinks:
|
|
1800
|
+
labelLinks: P((t) => Ut(t, (e) => n.current.get(e), (t) => qt(e?.current, t), r), [e, r])
|
|
1800
1801
|
};
|
|
1801
1802
|
}
|
|
1802
1803
|
//#endregion
|
|
1803
1804
|
//#region lib/components/ui/media/pdf-viewer/pdf-note-icons.ts
|
|
1804
|
-
var
|
|
1805
|
-
async function
|
|
1806
|
-
let n = [...e?.querySelectorAll(".textAnnotation > img") ?? []].filter((e) =>
|
|
1805
|
+
var gi = "data:,", _i = /annotation-([a-z]+)\.svg$/, vi, yi = () => (vi ??= import("./pdf-note-icons.data-DtpqXoIm.js").then((e) => e.NOTE_ICONS), vi);
|
|
1806
|
+
async function bi(e, t = yi) {
|
|
1807
|
+
let n = [...e?.querySelectorAll(".textAnnotation > img") ?? []].filter((e) => _i.test(e.getAttribute("src") ?? ""));
|
|
1807
1808
|
if (n.length === 0) return;
|
|
1808
1809
|
let r = await t();
|
|
1809
1810
|
for (let e of n) {
|
|
1810
|
-
let t = r[
|
|
1811
|
+
let t = r[_i.exec(e.getAttribute("src") ?? "")?.[1] ?? ""] ?? r.note;
|
|
1811
1812
|
t && (e.src = t);
|
|
1812
1813
|
}
|
|
1813
1814
|
}
|
|
1814
1815
|
//#endregion
|
|
1815
1816
|
//#region lib/components/ui/media/pdf-viewer/pdf-worker-url.ts
|
|
1816
|
-
function
|
|
1817
|
+
function xi() {
|
|
1817
1818
|
return new URL("" + new URL("pdf.worker.min.mjs", import.meta.url).href, "" + import.meta.url).href;
|
|
1818
1819
|
}
|
|
1819
1820
|
//#endregion
|
|
1820
1821
|
//#region lib/components/ui/media/pdf-reader/engine/pdfjs.lazy.ts
|
|
1821
|
-
var
|
|
1822
|
-
function
|
|
1823
|
-
return
|
|
1822
|
+
var Si;
|
|
1823
|
+
function Ci() {
|
|
1824
|
+
return Si ??= import("./pdf-MkmivNXn.js").then((e) => {
|
|
1824
1825
|
let t = e;
|
|
1825
|
-
return t.GlobalWorkerOptions.workerSrc =
|
|
1826
|
-
}),
|
|
1826
|
+
return t.GlobalWorkerOptions.workerSrc = xi(), t;
|
|
1827
|
+
}), Si;
|
|
1827
1828
|
}
|
|
1828
1829
|
//#endregion
|
|
1829
1830
|
//#region lib/components/ui/media/pdf-reader/engine/draw-layers.ts
|
|
1830
|
-
async function
|
|
1831
|
-
let i = await
|
|
1831
|
+
async function wi({ page: e, viewport: t }, n, r) {
|
|
1832
|
+
let i = await Ci(), a = await e.getTextContent();
|
|
1832
1833
|
if (r.aborted) return null;
|
|
1833
1834
|
n.replaceChildren();
|
|
1834
1835
|
let o = new i.TextLayer({
|
|
@@ -1841,8 +1842,8 @@ async function Ci({ page: e, viewport: t }, n, r) {
|
|
|
1841
1842
|
strs: o.textContentItemsStr
|
|
1842
1843
|
};
|
|
1843
1844
|
}
|
|
1844
|
-
async function
|
|
1845
|
-
let a = await
|
|
1845
|
+
async function Ti({ page: e, viewport: t }, n, r, i) {
|
|
1846
|
+
let a = await Ci(), o = await e.getAnnotations({ intent: "display" });
|
|
1846
1847
|
if (i.aborted) return null;
|
|
1847
1848
|
n.replaceChildren();
|
|
1848
1849
|
let s = t.clone({ dontFlip: !0 }), { doc: c, linkService: l } = r;
|
|
@@ -1861,27 +1862,27 @@ async function wi({ page: e, viewport: t }, n, r, i) {
|
|
|
1861
1862
|
annotations: o,
|
|
1862
1863
|
annotationStorage: c.annotationStorage,
|
|
1863
1864
|
div: n,
|
|
1864
|
-
imageResourcesPath:
|
|
1865
|
+
imageResourcesPath: gi,
|
|
1865
1866
|
linkService: l,
|
|
1866
1867
|
page: e,
|
|
1867
1868
|
renderForms: !1,
|
|
1868
1869
|
viewport: s
|
|
1869
|
-
}), i.aborted ? null : (await
|
|
1870
|
+
}), i.aborted ? null : (await bi(n), o);
|
|
1870
1871
|
}
|
|
1871
1872
|
//#endregion
|
|
1872
1873
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-layers.ts
|
|
1873
|
-
function
|
|
1874
|
-
let { drawn: t, pageNumber: n, doc: r, linkService: i, highlight: a } = e, { text: o, annotations: s, page: c } = e, [l, u] =
|
|
1875
|
-
|
|
1874
|
+
function Ei(e) {
|
|
1875
|
+
let { drawn: t, pageNumber: n, doc: r, linkService: i, highlight: a } = e, { text: o, annotations: s, page: c } = e, [l, u] = z(null), [d, f] = z(0), { onAnnotations: p, labelLinks: m } = hi(e.pdfRef);
|
|
1876
|
+
F(() => {
|
|
1876
1877
|
let e = o.current;
|
|
1877
1878
|
if (!t || !e) return;
|
|
1878
1879
|
let n = new AbortController();
|
|
1879
|
-
return
|
|
1880
|
-
}, [t, o]),
|
|
1880
|
+
return wi(t, e, n.signal).then((e) => e && u(e)).catch(() => {}), () => n.abort();
|
|
1881
|
+
}, [t, o]), F(() => {
|
|
1881
1882
|
let e = s.current;
|
|
1882
1883
|
if (!t || !e || !r || !i) return;
|
|
1883
1884
|
let n = new AbortController();
|
|
1884
|
-
return
|
|
1885
|
+
return Ti(t, e, {
|
|
1885
1886
|
doc: r,
|
|
1886
1887
|
linkService: i
|
|
1887
1888
|
}, n.signal).then((e) => {
|
|
@@ -1893,7 +1894,7 @@ function Ti(e) {
|
|
|
1893
1894
|
r,
|
|
1894
1895
|
i,
|
|
1895
1896
|
p
|
|
1896
|
-
]),
|
|
1897
|
+
]), F(() => {
|
|
1897
1898
|
d && m(c.current);
|
|
1898
1899
|
}, [
|
|
1899
1900
|
d,
|
|
@@ -1901,8 +1902,8 @@ function Ti(e) {
|
|
|
1901
1902
|
c
|
|
1902
1903
|
]);
|
|
1903
1904
|
let h = a.texts[n - 1], g = a.matches[n - 1], _ = a.current?.page === n ? a.current.hit : -1;
|
|
1904
|
-
|
|
1905
|
-
l &&
|
|
1905
|
+
F(() => {
|
|
1906
|
+
l && Dt(l, {
|
|
1906
1907
|
text: h,
|
|
1907
1908
|
matches: g,
|
|
1908
1909
|
current: _,
|
|
@@ -1918,9 +1919,9 @@ function Ti(e) {
|
|
|
1918
1919
|
}
|
|
1919
1920
|
//#endregion
|
|
1920
1921
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-drawing.ts
|
|
1921
|
-
function
|
|
1922
|
+
function Di(e) {
|
|
1922
1923
|
let { doc: t, cache: n, pdfRef: r, pageRefs: i, highlight: a, linkService: o } = e, { scale: s, rotation: c, searchQuery: l, nightMode: u } = e;
|
|
1923
|
-
return
|
|
1924
|
+
return L(() => ({
|
|
1924
1925
|
doc: t,
|
|
1925
1926
|
cache: n,
|
|
1926
1927
|
pdfRef: r,
|
|
@@ -1944,8 +1945,8 @@ function Ei(e) {
|
|
|
1944
1945
|
u
|
|
1945
1946
|
]);
|
|
1946
1947
|
}
|
|
1947
|
-
function
|
|
1948
|
-
let { doc: n, scale: r, rotation: i, pageRefs: a } = t, o =
|
|
1948
|
+
function Oi(e, t) {
|
|
1949
|
+
let { doc: n, scale: r, rotation: i, pageRefs: a } = t, o = R(null), s = R(null), c = R(null), l = R(null), u = mi(), d = pi({
|
|
1949
1950
|
doc: n,
|
|
1950
1951
|
pageNumber: e,
|
|
1951
1952
|
scale: r,
|
|
@@ -1956,7 +1957,7 @@ function Di(e, t) {
|
|
|
1956
1957
|
onError: u.onError,
|
|
1957
1958
|
onDrawn: u.onDrawn
|
|
1958
1959
|
});
|
|
1959
|
-
return
|
|
1960
|
+
return Ei({
|
|
1960
1961
|
drawn: d,
|
|
1961
1962
|
pageNumber: e,
|
|
1962
1963
|
doc: n,
|
|
@@ -1968,7 +1969,7 @@ function Di(e, t) {
|
|
|
1968
1969
|
highlight: t.highlight,
|
|
1969
1970
|
searchQuery: t.searchQuery
|
|
1970
1971
|
}), {
|
|
1971
|
-
setPage:
|
|
1972
|
+
setPage: P((t) => {
|
|
1972
1973
|
o.current = t, t ? a.current.set(e, t) : a.current.delete(e);
|
|
1973
1974
|
}, [e, a]),
|
|
1974
1975
|
canvas: s,
|
|
@@ -1980,58 +1981,58 @@ function Di(e, t) {
|
|
|
1980
1981
|
}
|
|
1981
1982
|
//#endregion
|
|
1982
1983
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-scroll.ts
|
|
1983
|
-
function
|
|
1984
|
+
function ki(e, t, n) {
|
|
1984
1985
|
let { scrollTop: r, clientHeight: i } = e, a = e.scrollLeft + (t ? e.scrollWidth - e.clientWidth : 0) + e.clientWidth / 2 - e.scrollWidth / 2 + n.maxWidth / 2, o = r + i >= e.scrollHeight - 2;
|
|
1985
1986
|
return {
|
|
1986
|
-
anchor:
|
|
1987
|
-
page:
|
|
1987
|
+
anchor: Et(n, r, a),
|
|
1988
|
+
page: Pt(n, {
|
|
1988
1989
|
top: r - 20,
|
|
1989
1990
|
height: i,
|
|
1990
1991
|
atEnd: o
|
|
1991
1992
|
})
|
|
1992
1993
|
};
|
|
1993
1994
|
}
|
|
1994
|
-
function
|
|
1995
|
-
let { scroller: t, layout: n, currentPage: r } = e, [i, a] =
|
|
1995
|
+
function Ai(e) {
|
|
1996
|
+
let { scroller: t, layout: n, currentPage: r } = e, [i, a] = z({
|
|
1996
1997
|
top: 0,
|
|
1997
1998
|
height: 0
|
|
1998
|
-
}), o =
|
|
1999
|
+
}), o = R({
|
|
1999
2000
|
page: r,
|
|
2000
2001
|
fraction: 0
|
|
2001
|
-
}), s =
|
|
2002
|
+
}), s = R(r), c = R(null), l = R({
|
|
2002
2003
|
options: e,
|
|
2003
2004
|
layout: n
|
|
2004
2005
|
});
|
|
2005
|
-
|
|
2006
|
+
I(() => {
|
|
2006
2007
|
l.current = {
|
|
2007
2008
|
options: e,
|
|
2008
2009
|
layout: n
|
|
2009
2010
|
};
|
|
2010
2011
|
});
|
|
2011
|
-
let u =
|
|
2012
|
+
let u = P((e, t) => {
|
|
2012
2013
|
e.scrollTop = t, c.current = e.scrollTop, a({
|
|
2013
2014
|
top: e.scrollTop,
|
|
2014
2015
|
height: e.clientHeight
|
|
2015
2016
|
});
|
|
2016
2017
|
}, []);
|
|
2017
|
-
return
|
|
2018
|
+
return I(() => {
|
|
2018
2019
|
let e = t.current;
|
|
2019
|
-
e && u(e,
|
|
2020
|
+
e && u(e, Mt(n, o.current));
|
|
2020
2021
|
}, [
|
|
2021
2022
|
n,
|
|
2022
2023
|
t,
|
|
2023
2024
|
u
|
|
2024
|
-
]),
|
|
2025
|
+
]), I(() => {
|
|
2025
2026
|
let e = t.current;
|
|
2026
2027
|
!e || r === s.current || (s.current = r, o.current = {
|
|
2027
2028
|
page: r,
|
|
2028
2029
|
fraction: 0
|
|
2029
|
-
}, u(e,
|
|
2030
|
+
}, u(e, Mt(l.current.layout, o.current)));
|
|
2030
2031
|
}, [
|
|
2031
2032
|
r,
|
|
2032
2033
|
t,
|
|
2033
2034
|
u
|
|
2034
|
-
]),
|
|
2035
|
+
]), F(() => {
|
|
2035
2036
|
let e = t.current;
|
|
2036
2037
|
if (!e) return;
|
|
2037
2038
|
let n = 0, r = getComputedStyle(e).direction === "rtl", i = () => {
|
|
@@ -2042,7 +2043,7 @@ function ki(e) {
|
|
|
2042
2043
|
height: i
|
|
2043
2044
|
}), c.current !== null && Math.abs(t - (c.current ?? 0)) < 2) return;
|
|
2044
2045
|
c.current = null;
|
|
2045
|
-
let { options: u, layout: d } = l.current, f =
|
|
2046
|
+
let { options: u, layout: d } = l.current, f = ki(e, r, d);
|
|
2046
2047
|
o.current = f.anchor, !(performance.now() < u.spyHold.current) && f.page !== s.current && (s.current = f.page, u.goToPage(f.page));
|
|
2047
2048
|
}, u = () => {
|
|
2048
2049
|
n ||= requestAnimationFrame(i);
|
|
@@ -2054,16 +2055,16 @@ function ki(e) {
|
|
|
2054
2055
|
}
|
|
2055
2056
|
//#endregion
|
|
2056
2057
|
//#region lib/components/ui/media/pdf-reader/engine/use-page-window.ts
|
|
2057
|
-
var
|
|
2058
|
-
function
|
|
2059
|
-
let { state: i, scale: a, doc: o, actions: s } = e, { goToPage: c } = s, { reportPage: l } = e, u =
|
|
2058
|
+
var ji = 1;
|
|
2059
|
+
function Mi(e, t, n = "_blank", r = "single") {
|
|
2060
|
+
let { state: i, scale: a, doc: o, actions: s } = e, { goToPage: c } = s, { reportPage: l } = e, u = oe(t), d = L(() => Rr(i.numPages, i.pageSizes ?? [], a, i.rotation, r, u), [
|
|
2060
2061
|
i.numPages,
|
|
2061
2062
|
i.pageSizes,
|
|
2062
2063
|
a,
|
|
2063
2064
|
i.rotation,
|
|
2064
2065
|
r,
|
|
2065
2066
|
u
|
|
2066
|
-
]), f =
|
|
2067
|
+
]), f = Ai({
|
|
2067
2068
|
scroller: t,
|
|
2068
2069
|
layout: d,
|
|
2069
2070
|
currentPage: i.currentPage,
|
|
@@ -2072,11 +2073,11 @@ function ji(e, t, n = "_blank", r = "single") {
|
|
|
2072
2073
|
});
|
|
2073
2074
|
return {
|
|
2074
2075
|
layout: d,
|
|
2075
|
-
shown:
|
|
2076
|
+
shown: jt(d, {
|
|
2076
2077
|
top: f.top - 20,
|
|
2077
2078
|
height: f.height || (i.containerHeight ?? 800)
|
|
2078
|
-
},
|
|
2079
|
-
linkService:
|
|
2079
|
+
}, ji),
|
|
2080
|
+
linkService: L(() => o ? kt({
|
|
2080
2081
|
doc: o,
|
|
2081
2082
|
goToPage: c,
|
|
2082
2083
|
externalLinkTarget: n
|
|
@@ -2089,31 +2090,31 @@ function ji(e, t, n = "_blank", r = "single") {
|
|
|
2089
2090
|
}
|
|
2090
2091
|
//#endregion
|
|
2091
2092
|
//#region lib/components/ui/media/pdf-reader/partials/page-failure.tsx
|
|
2092
|
-
function
|
|
2093
|
-
let { t: o } =
|
|
2094
|
-
return /* @__PURE__ */
|
|
2093
|
+
function Ni({ pageNumber: e, error: t, busy: r, onRetry: i, ref: a }) {
|
|
2094
|
+
let { t: o } = M(), s = Ot(t).kind === "canvas" ? o("material.pdf-reader.next.canvas-error", "This page is too large to display on this device") : o("material.pdf-reader.next.page-error", "This page could not be displayed");
|
|
2095
|
+
return /* @__PURE__ */ H("div", {
|
|
2095
2096
|
ref: a,
|
|
2096
2097
|
"data-page-failure": "",
|
|
2097
2098
|
"aria-busy": r || void 0,
|
|
2098
2099
|
className: n("absolute inset-0 flex flex-col items-center gap-3 bg-muted p-4 text-center text-muted-foreground", "justify-start pt-[clamp(2rem,12%,7rem)]"),
|
|
2099
|
-
children: [/* @__PURE__ */
|
|
2100
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2100
2101
|
role: "status",
|
|
2101
2102
|
className: "flex flex-col items-center gap-3",
|
|
2102
|
-
children: [/* @__PURE__ */
|
|
2103
|
+
children: [/* @__PURE__ */ V(qe, {
|
|
2103
2104
|
"aria-hidden": !0,
|
|
2104
2105
|
className: "size-6 shrink-0"
|
|
2105
|
-
}), /* @__PURE__ */
|
|
2106
|
+
}), /* @__PURE__ */ V("p", {
|
|
2106
2107
|
className: "max-w-64 text-balance text-sm",
|
|
2107
2108
|
children: s
|
|
2108
2109
|
})]
|
|
2109
|
-
}), /* @__PURE__ */
|
|
2110
|
+
}), /* @__PURE__ */ H(me, {
|
|
2110
2111
|
variant: "outlined",
|
|
2111
2112
|
color: "default",
|
|
2112
2113
|
size: "sm",
|
|
2113
2114
|
"aria-disabled": r || void 0,
|
|
2114
2115
|
onClick: r ? void 0 : i,
|
|
2115
2116
|
"aria-label": o("material.pdf-reader.next.retry-page", "Retry page {page}", { page: e }),
|
|
2116
|
-
children: [/* @__PURE__ */
|
|
2117
|
+
children: [/* @__PURE__ */ V(ut, {
|
|
2117
2118
|
"aria-hidden": !0,
|
|
2118
2119
|
className: n(r && "animate-spin motion-reduce:animate-none")
|
|
2119
2120
|
}), o("material.pdf-reader.retry", "Retry")]
|
|
@@ -2122,8 +2123,8 @@ function Mi({ pageNumber: e, error: t, busy: r, onRetry: i, ref: a }) {
|
|
|
2122
2123
|
}
|
|
2123
2124
|
//#endregion
|
|
2124
2125
|
//#region lib/components/ui/media/pdf-reader/partials/page-view.tsx
|
|
2125
|
-
var
|
|
2126
|
-
let { setPage: s, canvas: c, text: l, annotations: u, drawn: d, failed: f } =
|
|
2126
|
+
var Pi = Me(function({ pageNumber: e, top: t, offset: r, width: i, height: a, env: o }) {
|
|
2127
|
+
let { setPage: s, canvas: c, text: l, annotations: u, drawn: d, failed: f } = Oi(e, o), p = {
|
|
2127
2128
|
top: t,
|
|
2128
2129
|
left: `calc(50% + ${r}px)`,
|
|
2129
2130
|
width: i,
|
|
@@ -2132,26 +2133,26 @@ var Ni = je(function({ pageNumber: e, top: t, offset: r, width: i, height: a, en
|
|
|
2132
2133
|
"--scale-round-x": "1px",
|
|
2133
2134
|
"--scale-round-y": "1px"
|
|
2134
2135
|
};
|
|
2135
|
-
return /* @__PURE__ */
|
|
2136
|
+
return /* @__PURE__ */ H("div", {
|
|
2136
2137
|
ref: s,
|
|
2137
2138
|
"data-page-number": e,
|
|
2138
2139
|
"data-drawn": d ? "" : void 0,
|
|
2139
2140
|
className: n("absolute overflow-hidden rounded-sm bg-white", "shadow-[0_1px_2px_rgb(0_0_0/0.08),0_4px_16px_-4px_rgb(0_0_0/0.18)]", o.nightMode && "pdf-night-page"),
|
|
2140
2141
|
style: p,
|
|
2141
2142
|
children: [
|
|
2142
|
-
/* @__PURE__ */
|
|
2143
|
+
/* @__PURE__ */ V("div", {
|
|
2143
2144
|
ref: c,
|
|
2144
2145
|
className: "absolute inset-0 [&>canvas]:block [&>canvas]:size-full"
|
|
2145
2146
|
}),
|
|
2146
|
-
/* @__PURE__ */
|
|
2147
|
+
/* @__PURE__ */ V("div", {
|
|
2147
2148
|
ref: l,
|
|
2148
2149
|
className: "textLayer"
|
|
2149
2150
|
}),
|
|
2150
|
-
/* @__PURE__ */
|
|
2151
|
+
/* @__PURE__ */ V("div", {
|
|
2151
2152
|
ref: u,
|
|
2152
2153
|
className: "annotationLayer"
|
|
2153
2154
|
}),
|
|
2154
|
-
f.failure && /* @__PURE__ */
|
|
2155
|
+
f.failure && /* @__PURE__ */ V(Ni, {
|
|
2155
2156
|
ref: f.box,
|
|
2156
2157
|
pageNumber: e,
|
|
2157
2158
|
error: f.failure.error,
|
|
@@ -2163,8 +2164,8 @@ var Ni = je(function({ pageNumber: e, top: t, offset: r, width: i, height: a, en
|
|
|
2163
2164
|
});
|
|
2164
2165
|
//#endregion
|
|
2165
2166
|
//#region lib/components/ui/media/pdf-reader/partials/viewport.tsx
|
|
2166
|
-
function
|
|
2167
|
-
let { t: e } =
|
|
2167
|
+
function Fi() {
|
|
2168
|
+
let { t: e } = M(), { props: t, ...r } = X(), i = Z(), a = R(null), { layout: o } = r, { layout: s, shown: c, linkService: l } = Mi(i, a, t.externalLinkTarget, o.mode), u = Di({
|
|
2168
2169
|
doc: i.doc,
|
|
2169
2170
|
cache: i.canvasCache,
|
|
2170
2171
|
pdfRef: i.pdfRef,
|
|
@@ -2176,7 +2177,7 @@ function Pi() {
|
|
|
2176
2177
|
searchQuery: i.state.searchQuery,
|
|
2177
2178
|
nightMode: i.state.nightMode
|
|
2178
2179
|
}), d = [];
|
|
2179
|
-
for (let e = c.first; e <= c.last; e++) d.push(/* @__PURE__ */
|
|
2180
|
+
for (let e = c.first; e <= c.last; e++) d.push(/* @__PURE__ */ V(Pi, {
|
|
2180
2181
|
pageNumber: e + 1,
|
|
2181
2182
|
top: 20 + (s.tops[e] ?? 0),
|
|
2182
2183
|
offset: (s.lefts[e] ?? 0) - s.maxWidth / 2,
|
|
@@ -2184,14 +2185,14 @@ function Pi() {
|
|
|
2184
2185
|
height: s.heights[e] ?? 0,
|
|
2185
2186
|
env: u
|
|
2186
2187
|
}, e + 1));
|
|
2187
|
-
return /* @__PURE__ */
|
|
2188
|
+
return /* @__PURE__ */ V("section", {
|
|
2188
2189
|
ref: a,
|
|
2189
2190
|
tabIndex: 0,
|
|
2190
2191
|
"aria-label": e("material.pdf-reader.pages", "Pages"),
|
|
2191
2192
|
"data-slot": "scroll-area-viewport",
|
|
2192
2193
|
"data-layout": o.mode,
|
|
2193
2194
|
className: n("size-full overflow-auto outline-none [overflow-anchor:none]", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", "scroll-pb-24"),
|
|
2194
|
-
children: /* @__PURE__ */
|
|
2195
|
+
children: /* @__PURE__ */ V("div", {
|
|
2195
2196
|
className: "relative min-w-full",
|
|
2196
2197
|
style: {
|
|
2197
2198
|
height: 20 + s.totalHeight + 112,
|
|
@@ -2203,16 +2204,16 @@ function Pi() {
|
|
|
2203
2204
|
}
|
|
2204
2205
|
//#endregion
|
|
2205
2206
|
//#region lib/components/ui/media/pdf-reader/partials/body.tsx
|
|
2206
|
-
function
|
|
2207
|
-
let { state: e, containerRef: t, handlers: n } =
|
|
2208
|
-
return /* @__PURE__ */
|
|
2207
|
+
function Ii() {
|
|
2208
|
+
let { state: e, containerRef: t, handlers: n } = Z(), r = e.numPages > 0 && !e.error && !e.isPasswordProtected;
|
|
2209
|
+
return /* @__PURE__ */ H("div", {
|
|
2209
2210
|
className: "flex min-h-0 min-w-0 flex-1",
|
|
2210
|
-
children: [r ? /* @__PURE__ */
|
|
2211
|
+
children: [r ? /* @__PURE__ */ V(fi, {}) : null, /* @__PURE__ */ H("div", {
|
|
2211
2212
|
ref: t,
|
|
2212
2213
|
tabIndex: -1,
|
|
2213
2214
|
"aria-busy": e.isLoading || void 0,
|
|
2214
2215
|
className: "relative min-w-0 flex-1 overflow-hidden bg-[color-mix(in_oklab,var(--primary)_5%,var(--background))] outline-none dark:bg-[color-mix(in_oklab,var(--primary)_10%,var(--background))]",
|
|
2215
|
-
children: [r ? /* @__PURE__ */
|
|
2216
|
+
children: [r ? /* @__PURE__ */ V(Fi, {}) : null, /* @__PURE__ */ V(Mr, { onRetry: () => {
|
|
2216
2217
|
t.current?.focus(), n.onRetry();
|
|
2217
2218
|
} })]
|
|
2218
2219
|
})]
|
|
@@ -2220,8 +2221,8 @@ function Fi() {
|
|
|
2220
2221
|
}
|
|
2221
2222
|
//#endregion
|
|
2222
2223
|
//#region lib/components/ui/media/pdf-reader/use-toolbar-look.ts
|
|
2223
|
-
function
|
|
2224
|
-
let { props: e } =
|
|
2224
|
+
function Q() {
|
|
2225
|
+
let { props: e } = X(), t = e.look === "classic";
|
|
2225
2226
|
return {
|
|
2226
2227
|
selectedLook: t ? "quiet" : "morph",
|
|
2227
2228
|
density: t ? void 0 : "comfortable",
|
|
@@ -2230,16 +2231,16 @@ function $() {
|
|
|
2230
2231
|
}
|
|
2231
2232
|
//#endregion
|
|
2232
2233
|
//#region lib/components/ui/media/pdf-reader/partials/fullscreen-exit.tsx
|
|
2233
|
-
function
|
|
2234
|
-
let { t: e } =
|
|
2235
|
-
return /* @__PURE__ */
|
|
2234
|
+
function Li() {
|
|
2235
|
+
let { t: e } = M(), t = Q(), { leave: n } = X(), r = e("material.pdf-reader.exit-fullscreen", "Exit fullscreen");
|
|
2236
|
+
return /* @__PURE__ */ V("div", {
|
|
2236
2237
|
className: "pointer-events-none absolute top-[max(0.75rem,env(safe-area-inset-top))] z-10 ltr:[inset-inline-end:max(0.75rem,env(safe-area-inset-right))] rtl:[inset-inline-end:max(0.75rem,env(safe-area-inset-left))]",
|
|
2237
|
-
children: /* @__PURE__ */
|
|
2238
|
+
children: /* @__PURE__ */ V(k, {
|
|
2238
2239
|
label: r,
|
|
2239
2240
|
...t,
|
|
2240
2241
|
className: "pointer-events-auto",
|
|
2241
|
-
children: /* @__PURE__ */
|
|
2242
|
-
icon: /* @__PURE__ */
|
|
2242
|
+
children: /* @__PURE__ */ V(j, {
|
|
2243
|
+
icon: /* @__PURE__ */ V(nt, {}),
|
|
2243
2244
|
label: r,
|
|
2244
2245
|
onClick: n
|
|
2245
2246
|
})
|
|
@@ -2248,7 +2249,7 @@ function Ii() {
|
|
|
2248
2249
|
}
|
|
2249
2250
|
//#endregion
|
|
2250
2251
|
//#region lib/components/ui/media/pdf-reader/mode-action.ts
|
|
2251
|
-
function
|
|
2252
|
+
function Ri(e, t, n = !0) {
|
|
2252
2253
|
switch (e) {
|
|
2253
2254
|
case "page": return {
|
|
2254
2255
|
kind: "back",
|
|
@@ -2270,39 +2271,39 @@ function Li(e, t, n = !0) {
|
|
|
2270
2271
|
}
|
|
2271
2272
|
//#endregion
|
|
2272
2273
|
//#region lib/components/ui/media/pdf-reader/use-fullscreen-enabled.ts
|
|
2273
|
-
var
|
|
2274
|
-
function
|
|
2275
|
-
return
|
|
2274
|
+
var zi = () => () => {};
|
|
2275
|
+
function Bi() {
|
|
2276
|
+
return Ie(zi, () => document.fullscreenEnabled === !0, () => !1);
|
|
2276
2277
|
}
|
|
2277
2278
|
//#endregion
|
|
2278
2279
|
//#region lib/components/ui/media/pdf-reader/partials/annotate-header.tsx
|
|
2279
|
-
function
|
|
2280
|
-
let { t: e } =
|
|
2281
|
-
return /* @__PURE__ */
|
|
2280
|
+
function Vi() {
|
|
2281
|
+
let { t: e } = M(), t = Q(), { chromeActions: n, props: r } = X(), i = e("material.pdf-reader.next.annotate-done", "Done"), a = e("material.pdf-reader.next.annotate-title", "Annotation");
|
|
2282
|
+
return /* @__PURE__ */ H(k, {
|
|
2282
2283
|
label: a,
|
|
2283
2284
|
variant: "docked",
|
|
2284
2285
|
...t,
|
|
2285
2286
|
className: "shrink-0 border-b border-border",
|
|
2286
2287
|
children: [
|
|
2287
|
-
/* @__PURE__ */
|
|
2288
|
+
/* @__PURE__ */ H("div", {
|
|
2288
2289
|
className: "flex min-w-0 flex-1 items-baseline gap-2 px-1.5",
|
|
2289
|
-
children: [/* @__PURE__ */
|
|
2290
|
+
children: [/* @__PURE__ */ V("span", {
|
|
2290
2291
|
className: "truncate font-semibold text-foreground",
|
|
2291
2292
|
children: a
|
|
2292
|
-
}), /* @__PURE__ */
|
|
2293
|
+
}), /* @__PURE__ */ V("span", {
|
|
2293
2294
|
className: "shrink-0 whitespace-nowrap text-muted-foreground text-sm",
|
|
2294
2295
|
children: e("material.pdf-reader.next.annotate-notes", "{count, plural, one {# note} other {# notes}}", { count: r.annotationCount ?? 0 })
|
|
2295
2296
|
})]
|
|
2296
2297
|
}),
|
|
2297
|
-
/* @__PURE__ */
|
|
2298
|
-
icon: /* @__PURE__ */
|
|
2298
|
+
/* @__PURE__ */ V(j, {
|
|
2299
|
+
icon: /* @__PURE__ */ V(ht, {}),
|
|
2299
2300
|
label: e("material.pdf-reader.next.annotate-undo", "Undo"),
|
|
2300
2301
|
disabled: !0
|
|
2301
2302
|
}),
|
|
2302
|
-
/* @__PURE__ */
|
|
2303
|
+
/* @__PURE__ */ V(O, {
|
|
2303
2304
|
label: i,
|
|
2304
2305
|
fit: !1,
|
|
2305
|
-
children: /* @__PURE__ */
|
|
2306
|
+
children: /* @__PURE__ */ V(me, {
|
|
2306
2307
|
size: "sm",
|
|
2307
2308
|
onClick: () => n.stopAnnotating(),
|
|
2308
2309
|
className: "min-h-9 min-w-0 px-4",
|
|
@@ -2314,52 +2315,52 @@ function Bi() {
|
|
|
2314
2315
|
}
|
|
2315
2316
|
//#endregion
|
|
2316
2317
|
//#region lib/components/ui/media/pdf-reader/partials/header-title.tsx
|
|
2317
|
-
function
|
|
2318
|
-
let { t: e, language: t } =
|
|
2318
|
+
function Hi() {
|
|
2319
|
+
let { t: e, language: t } = M(), { chrome: n, props: r } = X(), { state: i, bytes: a } = Z(), o = r.file ? $t(r.file, r.fileName, e("material.pdf-reader.default-file-name", "document")) : "", s = i.numPages > 0 ? e("material.pdf-reader.next.meta", "{pages, plural, one {# page} other {# pages}} · {size}", {
|
|
2319
2320
|
pages: i.numPages,
|
|
2320
|
-
size:
|
|
2321
|
+
size: Tt(a ?? 0, { locale: t ?? "en" })
|
|
2321
2322
|
}) : "";
|
|
2322
|
-
return /* @__PURE__ */
|
|
2323
|
+
return /* @__PURE__ */ H("div", {
|
|
2323
2324
|
className: "flex min-w-0 flex-1 items-center gap-2.5 px-1.5",
|
|
2324
2325
|
children: [
|
|
2325
|
-
/* @__PURE__ */
|
|
2326
|
+
/* @__PURE__ */ V(Ke, {
|
|
2326
2327
|
"aria-hidden": !0,
|
|
2327
2328
|
className: "size-5 shrink-0 text-primary-text"
|
|
2328
2329
|
}),
|
|
2329
|
-
/* @__PURE__ */
|
|
2330
|
+
/* @__PURE__ */ V("span", {
|
|
2330
2331
|
dir: "auto",
|
|
2331
2332
|
className: "truncate font-semibold text-foreground",
|
|
2332
2333
|
children: o
|
|
2333
2334
|
}),
|
|
2334
|
-
n.size !== "compact" && a !== null && s ? /* @__PURE__ */
|
|
2335
|
+
n.size !== "compact" && a !== null && s ? /* @__PURE__ */ V("span", {
|
|
2335
2336
|
className: "shrink-0 whitespace-nowrap text-muted-foreground text-sm",
|
|
2336
|
-
children: /* @__PURE__ */
|
|
2337
|
+
children: /* @__PURE__ */ V("bdi", { children: s })
|
|
2337
2338
|
}) : null
|
|
2338
2339
|
]
|
|
2339
2340
|
});
|
|
2340
2341
|
}
|
|
2341
2342
|
//#endregion
|
|
2342
2343
|
//#region lib/components/ui/media/pdf-reader/partials/mode-button.tsx
|
|
2343
|
-
function
|
|
2344
|
-
let { t } =
|
|
2344
|
+
function Ui({ action: e }) {
|
|
2345
|
+
let { t } = M(), { leave: n, toggleFullscreen: r } = X();
|
|
2345
2346
|
switch (e.kind) {
|
|
2346
|
-
case "back": return /* @__PURE__ */
|
|
2347
|
-
icon: /* @__PURE__ */
|
|
2347
|
+
case "back": return /* @__PURE__ */ V(j, {
|
|
2348
|
+
icon: /* @__PURE__ */ V(Re, {}),
|
|
2348
2349
|
label: t("material.pdf-reader.next.back", "Back"),
|
|
2349
2350
|
onClick: n
|
|
2350
2351
|
});
|
|
2351
|
-
case "close": return /* @__PURE__ */
|
|
2352
|
-
icon: /* @__PURE__ */
|
|
2352
|
+
case "close": return /* @__PURE__ */ V(j, {
|
|
2353
|
+
icon: /* @__PURE__ */ V(_t, {}),
|
|
2353
2354
|
label: t("material.buttons.close", "Close"),
|
|
2354
2355
|
onClick: n
|
|
2355
2356
|
});
|
|
2356
|
-
case "exit-fullscreen": return /* @__PURE__ */
|
|
2357
|
-
icon: /* @__PURE__ */
|
|
2357
|
+
case "exit-fullscreen": return /* @__PURE__ */ V(j, {
|
|
2358
|
+
icon: /* @__PURE__ */ V(nt, {}),
|
|
2358
2359
|
label: t("material.pdf-reader.exit-fullscreen", "Exit fullscreen"),
|
|
2359
2360
|
onClick: n
|
|
2360
2361
|
});
|
|
2361
|
-
case "fullscreen": return /* @__PURE__ */
|
|
2362
|
-
icon: /* @__PURE__ */
|
|
2362
|
+
case "fullscreen": return /* @__PURE__ */ V(j, {
|
|
2363
|
+
icon: /* @__PURE__ */ V(et, {}),
|
|
2363
2364
|
label: t("material.pdf-reader.fullscreen", "Fullscreen"),
|
|
2364
2365
|
onClick: r
|
|
2365
2366
|
});
|
|
@@ -2367,67 +2368,67 @@ function Hi({ action: e }) {
|
|
|
2367
2368
|
}
|
|
2368
2369
|
//#endregion
|
|
2369
2370
|
//#region lib/components/ui/media/pdf-reader/partials/compact-items.tsx
|
|
2370
|
-
function
|
|
2371
|
-
let { chromeActions: e } =
|
|
2372
|
-
return /* @__PURE__ */
|
|
2373
|
-
let r =
|
|
2374
|
-
return /* @__PURE__ */
|
|
2371
|
+
function Wi() {
|
|
2372
|
+
let { chromeActions: e } = X(), t = ci();
|
|
2373
|
+
return /* @__PURE__ */ H(B, { children: [li().filter((e) => e !== "search").map((n) => {
|
|
2374
|
+
let r = si[n];
|
|
2375
|
+
return /* @__PURE__ */ H(D, {
|
|
2375
2376
|
onSelect: () => e.openPanelTab(n),
|
|
2376
|
-
children: [/* @__PURE__ */
|
|
2377
|
+
children: [/* @__PURE__ */ V(r, {}), t[n]]
|
|
2377
2378
|
}, n);
|
|
2378
|
-
}), /* @__PURE__ */
|
|
2379
|
+
}), /* @__PURE__ */ V(E, {})] });
|
|
2379
2380
|
}
|
|
2380
|
-
function
|
|
2381
|
-
let { t: e } =
|
|
2382
|
-
return /* @__PURE__ */
|
|
2383
|
-
/* @__PURE__ */
|
|
2384
|
-
/* @__PURE__ */
|
|
2381
|
+
function Gi() {
|
|
2382
|
+
let { t: e } = M(), { actions: t } = Z();
|
|
2383
|
+
return /* @__PURE__ */ H(B, { children: [
|
|
2384
|
+
/* @__PURE__ */ V(E, {}),
|
|
2385
|
+
/* @__PURE__ */ H(D, {
|
|
2385
2386
|
onSelect: t.zoomIn,
|
|
2386
|
-
children: [/* @__PURE__ */
|
|
2387
|
+
children: [/* @__PURE__ */ V(yt, {}), e("material.pdf-reader.zoom-in", "Zoom in")]
|
|
2387
2388
|
}),
|
|
2388
|
-
/* @__PURE__ */
|
|
2389
|
+
/* @__PURE__ */ H(D, {
|
|
2389
2390
|
onSelect: t.zoomOut,
|
|
2390
|
-
children: [/* @__PURE__ */
|
|
2391
|
+
children: [/* @__PURE__ */ V(bt, {}), e("material.pdf-reader.zoom-out", "Zoom out")]
|
|
2391
2392
|
}),
|
|
2392
|
-
/* @__PURE__ */
|
|
2393
|
+
/* @__PURE__ */ H(D, {
|
|
2393
2394
|
onSelect: () => t.setFitMode("width"),
|
|
2394
|
-
children: [/* @__PURE__ */
|
|
2395
|
+
children: [/* @__PURE__ */ V(at, {}), e("material.pdf-reader.fit-width-full", "Fit Width")]
|
|
2395
2396
|
}),
|
|
2396
|
-
/* @__PURE__ */
|
|
2397
|
+
/* @__PURE__ */ H(D, {
|
|
2397
2398
|
onSelect: () => t.setFitMode("page"),
|
|
2398
|
-
children: [/* @__PURE__ */
|
|
2399
|
+
children: [/* @__PURE__ */ V(et, {}), e("material.pdf-reader.fit-page-full", "Fit Page")]
|
|
2399
2400
|
})
|
|
2400
2401
|
] });
|
|
2401
2402
|
}
|
|
2402
2403
|
//#endregion
|
|
2403
2404
|
//#region lib/components/ui/media/pdf-reader/partials/layout-choice.tsx
|
|
2404
|
-
var
|
|
2405
|
+
var Ki = [
|
|
2405
2406
|
"single",
|
|
2406
2407
|
"spread",
|
|
2407
2408
|
"spread-cover"
|
|
2408
2409
|
];
|
|
2409
|
-
function
|
|
2410
|
-
let { t: e } =
|
|
2410
|
+
function qi() {
|
|
2411
|
+
let { t: e } = M(), { chrome: t, chromeActions: n, layout: r } = X(), i = Pe(), a = r.narrow ? "single" : t.layout, o = {
|
|
2411
2412
|
single: e("material.pdf-reader.next.layout-single", "Single page"),
|
|
2412
2413
|
spread: e("material.pdf-reader.next.layout-two", "Two pages"),
|
|
2413
2414
|
"spread-cover": e("material.pdf-reader.next.layout-two-cover", "Two pages with cover")
|
|
2414
2415
|
};
|
|
2415
|
-
return /* @__PURE__ */
|
|
2416
|
-
/* @__PURE__ */
|
|
2417
|
-
/* @__PURE__ */
|
|
2416
|
+
return /* @__PURE__ */ H(B, { children: [
|
|
2417
|
+
/* @__PURE__ */ V(T, { children: e("material.pdf-reader.next.layout", "Page layout") }),
|
|
2418
|
+
/* @__PURE__ */ V(C, {
|
|
2418
2419
|
value: a,
|
|
2419
2420
|
"aria-label": e("material.pdf-reader.next.layout", "Page layout"),
|
|
2420
2421
|
onValueChange: (e) => {
|
|
2421
2422
|
e !== a && n.setLayout(e);
|
|
2422
2423
|
},
|
|
2423
|
-
children:
|
|
2424
|
+
children: Ki.map((e) => /* @__PURE__ */ V(w, {
|
|
2424
2425
|
value: e,
|
|
2425
2426
|
disabled: r.narrow && e !== "single",
|
|
2426
2427
|
"aria-describedby": r.narrow ? i : void 0,
|
|
2427
2428
|
children: o[e]
|
|
2428
2429
|
}, e))
|
|
2429
2430
|
}),
|
|
2430
|
-
r.narrow ? /* @__PURE__ */
|
|
2431
|
+
r.narrow ? /* @__PURE__ */ V(T, {
|
|
2431
2432
|
id: i,
|
|
2432
2433
|
className: "pt-0 font-normal text-muted-foreground text-xs",
|
|
2433
2434
|
children: e("material.pdf-reader.next.layout-narrow", "Two pages need a wider window")
|
|
@@ -2436,56 +2437,56 @@ function Ki() {
|
|
|
2436
2437
|
}
|
|
2437
2438
|
//#endregion
|
|
2438
2439
|
//#region lib/components/ui/media/pdf-reader/partials/more-menu.tsx
|
|
2439
|
-
function
|
|
2440
|
-
let { t: e } =
|
|
2441
|
-
return /* @__PURE__ */
|
|
2440
|
+
function Ji() {
|
|
2441
|
+
let { t: e } = M(), t = Q(), { chrome: n, mode: r, openSearch: i, props: a } = X(), { state: o, actions: s, fileActions: c } = Z(), l = d(), u = n.size === "compact", f = r === "fullscreen";
|
|
2442
|
+
return /* @__PURE__ */ H(ae, {
|
|
2442
2443
|
modal: !1,
|
|
2443
|
-
children: [/* @__PURE__ */
|
|
2444
|
+
children: [/* @__PURE__ */ V(S, {
|
|
2444
2445
|
asChild: !0,
|
|
2445
2446
|
className: t.selectedLook === "morph" ? "rounded-[var(--c-ss)] focus:bg-(--m-bg) hover:bg-(--m-bg)" : void 0,
|
|
2446
|
-
children: /* @__PURE__ */
|
|
2447
|
-
icon: /* @__PURE__ */
|
|
2447
|
+
children: /* @__PURE__ */ V(j, {
|
|
2448
|
+
icon: /* @__PURE__ */ V(rt, {}),
|
|
2448
2449
|
label: e("material.toolbar.more", "More")
|
|
2449
2450
|
})
|
|
2450
|
-
}), /* @__PURE__ */
|
|
2451
|
+
}), /* @__PURE__ */ H(ie, {
|
|
2451
2452
|
align: "end",
|
|
2452
2453
|
container: l,
|
|
2453
2454
|
className: "min-w-52",
|
|
2454
2455
|
children: [
|
|
2455
|
-
f ? /* @__PURE__ */
|
|
2456
|
+
f ? /* @__PURE__ */ H(D, {
|
|
2456
2457
|
onSelect: i,
|
|
2457
|
-
children: [/* @__PURE__ */
|
|
2458
|
+
children: [/* @__PURE__ */ V(dt, {}), e("material.pdf-reader.search", "Search")]
|
|
2458
2459
|
}) : null,
|
|
2459
|
-
u ? /* @__PURE__ */
|
|
2460
|
-
/* @__PURE__ */
|
|
2460
|
+
u ? /* @__PURE__ */ V(Wi, {}) : null,
|
|
2461
|
+
/* @__PURE__ */ H(D, {
|
|
2461
2462
|
onSelect: s.rotate,
|
|
2462
|
-
children: [/* @__PURE__ */
|
|
2463
|
+
children: [/* @__PURE__ */ V(ut, {}), e("material.pdf-reader.rotate", "Rotate")]
|
|
2463
2464
|
}),
|
|
2464
|
-
/* @__PURE__ */
|
|
2465
|
+
/* @__PURE__ */ H(D, {
|
|
2465
2466
|
onSelect: c.print,
|
|
2466
|
-
children: [/* @__PURE__ */
|
|
2467
|
+
children: [/* @__PURE__ */ V(lt, {}), e("material.pdf-reader.print", "Print")]
|
|
2467
2468
|
}),
|
|
2468
|
-
u || f ? /* @__PURE__ */
|
|
2469
|
+
u || f ? /* @__PURE__ */ H(D, {
|
|
2469
2470
|
onSelect: c.download,
|
|
2470
|
-
children: [/* @__PURE__ */
|
|
2471
|
+
children: [/* @__PURE__ */ V(We, {}), e("material.pdf-reader.download", "Download")]
|
|
2471
2472
|
}) : null,
|
|
2472
|
-
/* @__PURE__ */
|
|
2473
|
+
/* @__PURE__ */ V(re, {
|
|
2473
2474
|
checked: o.nightMode,
|
|
2474
2475
|
onCheckedChange: s.toggleNightMode,
|
|
2475
2476
|
children: e("material.pdf-reader.night", "Night mode")
|
|
2476
2477
|
}),
|
|
2477
|
-
u ? /* @__PURE__ */
|
|
2478
|
-
/* @__PURE__ */
|
|
2479
|
-
/* @__PURE__ */
|
|
2480
|
-
a.showUnfinished ? /* @__PURE__ */
|
|
2481
|
-
/* @__PURE__ */
|
|
2482
|
-
/* @__PURE__ */
|
|
2478
|
+
u ? /* @__PURE__ */ V(Gi, {}) : null,
|
|
2479
|
+
/* @__PURE__ */ V(E, {}),
|
|
2480
|
+
/* @__PURE__ */ V(qi, {}),
|
|
2481
|
+
a.showUnfinished ? /* @__PURE__ */ H(B, { children: [
|
|
2482
|
+
/* @__PURE__ */ V(E, {}),
|
|
2483
|
+
/* @__PURE__ */ H(D, {
|
|
2483
2484
|
disabled: !0,
|
|
2484
|
-
children: [/* @__PURE__ */
|
|
2485
|
+
children: [/* @__PURE__ */ V(gt, {}), e("material.pdf-reader.next.read-aloud", "Read aloud")]
|
|
2485
2486
|
}),
|
|
2486
|
-
/* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ H(D, {
|
|
2487
2488
|
disabled: !0,
|
|
2488
|
-
children: [/* @__PURE__ */
|
|
2489
|
+
children: [/* @__PURE__ */ V(ze, {}), e("material.pdf-reader.next.reflow", "Reflowed text")]
|
|
2489
2490
|
})
|
|
2490
2491
|
] }) : null
|
|
2491
2492
|
]
|
|
@@ -2494,93 +2495,93 @@ function qi() {
|
|
|
2494
2495
|
}
|
|
2495
2496
|
//#endregion
|
|
2496
2497
|
//#region lib/components/ui/media/pdf-reader/partials/search-header.tsx
|
|
2497
|
-
function
|
|
2498
|
-
let { t: e } =
|
|
2499
|
-
return /* @__PURE__ */
|
|
2498
|
+
function Yi() {
|
|
2499
|
+
let { t: e } = M(), t = Q(), { chromeActions: n } = X();
|
|
2500
|
+
return /* @__PURE__ */ H(k, {
|
|
2500
2501
|
label: e("material.pdf-reader.search", "Search"),
|
|
2501
2502
|
variant: "docked",
|
|
2502
2503
|
...t,
|
|
2503
2504
|
className: "shrink-0 border-b border-border",
|
|
2504
|
-
children: [/* @__PURE__ */
|
|
2505
|
-
icon: /* @__PURE__ */
|
|
2505
|
+
children: [/* @__PURE__ */ V(j, {
|
|
2506
|
+
icon: /* @__PURE__ */ V(Re, {}),
|
|
2506
2507
|
label: e("material.pdf-reader.next.search-close", "Close search"),
|
|
2507
2508
|
onClick: () => n.closeSearchField()
|
|
2508
|
-
}), /* @__PURE__ */
|
|
2509
|
+
}), /* @__PURE__ */ V(Lr, {})]
|
|
2509
2510
|
});
|
|
2510
2511
|
}
|
|
2511
2512
|
//#endregion
|
|
2512
2513
|
//#region lib/components/ui/media/pdf-reader/partials/header.tsx
|
|
2513
|
-
function Yi() {
|
|
2514
|
-
let { chrome: e } = Z(), t = vr.selectHeaderKind(e);
|
|
2515
|
-
return H(t === "annotate" ? Bi : t === "search" ? Ji : Xi, {});
|
|
2516
|
-
}
|
|
2517
2514
|
function Xi() {
|
|
2518
|
-
let {
|
|
2519
|
-
return
|
|
2515
|
+
let { chrome: e } = X(), t = yr.selectHeaderKind(e);
|
|
2516
|
+
return V(t === "annotate" ? Vi : t === "search" ? Yi : Zi, {});
|
|
2517
|
+
}
|
|
2518
|
+
function Zi() {
|
|
2519
|
+
let { t: e } = M(), t = Q(), { chrome: n, mode: r, props: i, openSearch: a } = X(), { fileActions: o } = Z(), s = n.size === "compact", c = Bi(), l = Ri(r, n.size, i.allowFullscreen !== !1 && c);
|
|
2520
|
+
return /* @__PURE__ */ H(k, {
|
|
2520
2521
|
label: e("material.pdf-reader.next.header", "Document actions"),
|
|
2521
2522
|
variant: "docked",
|
|
2522
2523
|
...t,
|
|
2523
2524
|
className: "shrink-0 border-b border-border",
|
|
2524
2525
|
children: [
|
|
2525
|
-
l?.place === "start" ? /* @__PURE__ */
|
|
2526
|
-
/* @__PURE__ */
|
|
2527
|
-
/* @__PURE__ */
|
|
2528
|
-
icon: /* @__PURE__ */
|
|
2526
|
+
l?.place === "start" ? /* @__PURE__ */ V(Ui, { action: l }) : null,
|
|
2527
|
+
/* @__PURE__ */ V(Hi, {}),
|
|
2528
|
+
/* @__PURE__ */ V(j, {
|
|
2529
|
+
icon: /* @__PURE__ */ V(dt, {}),
|
|
2529
2530
|
label: e("material.pdf-reader.search", "Search"),
|
|
2530
2531
|
onClick: a,
|
|
2531
2532
|
"data-focus-target": "search"
|
|
2532
2533
|
}),
|
|
2533
|
-
s ? null : /* @__PURE__ */
|
|
2534
|
-
icon: /* @__PURE__ */
|
|
2534
|
+
s ? null : /* @__PURE__ */ V(j, {
|
|
2535
|
+
icon: /* @__PURE__ */ V(We, {}),
|
|
2535
2536
|
label: e("material.pdf-reader.download", "Download"),
|
|
2536
2537
|
onClick: o.download
|
|
2537
2538
|
}),
|
|
2538
|
-
/* @__PURE__ */
|
|
2539
|
-
l?.place === "end" ? /* @__PURE__ */
|
|
2539
|
+
/* @__PURE__ */ V(Ji, {}),
|
|
2540
|
+
l?.place === "end" ? /* @__PURE__ */ V(Ui, { action: l }) : null
|
|
2540
2541
|
]
|
|
2541
2542
|
});
|
|
2542
2543
|
}
|
|
2543
2544
|
//#endregion
|
|
2544
2545
|
//#region lib/components/ui/media/pdf-reader/use-pill-visibility.ts
|
|
2545
|
-
function
|
|
2546
|
-
let r =
|
|
2547
|
-
|
|
2546
|
+
function Qi(e, t, n) {
|
|
2547
|
+
let r = R(null);
|
|
2548
|
+
I(() => {
|
|
2548
2549
|
r.current = e.current?.querySelector("[data-slot=\"scroll-area-viewport\"]") ?? null;
|
|
2549
2550
|
});
|
|
2550
|
-
let i =
|
|
2551
|
-
return
|
|
2551
|
+
let i = Ae(r), [a, o] = z(!1);
|
|
2552
|
+
return F(() => {
|
|
2552
2553
|
i || o(!1);
|
|
2553
|
-
}, [i]),
|
|
2554
|
+
}, [i]), F(() => {
|
|
2554
2555
|
let e = t.current;
|
|
2555
2556
|
if (!e || !i) return;
|
|
2556
2557
|
let n = (e) => {
|
|
2557
|
-
e.key === "Tab" &&
|
|
2558
|
+
e.key === "Tab" && Le(() => o(!0));
|
|
2558
2559
|
};
|
|
2559
2560
|
return e.addEventListener("keydown", n, !0), () => e.removeEventListener("keydown", n, !0);
|
|
2560
2561
|
}, [t, i]), i && !a && !n;
|
|
2561
2562
|
}
|
|
2562
2563
|
//#endregion
|
|
2563
2564
|
//#region lib/components/ui/media/pdf-reader/annotate-colors.ts
|
|
2564
|
-
var
|
|
2565
|
+
var $i = {
|
|
2565
2566
|
yellow: "bg-yellow-300",
|
|
2566
2567
|
green: "bg-green-400",
|
|
2567
2568
|
blue: "bg-blue-400",
|
|
2568
2569
|
pink: "bg-pink-400",
|
|
2569
2570
|
red: "bg-red-500"
|
|
2570
|
-
},
|
|
2571
|
-
pointer: /* @__PURE__ */
|
|
2572
|
-
highlight: /* @__PURE__ */
|
|
2573
|
-
underline: /* @__PURE__ */
|
|
2574
|
-
pen: /* @__PURE__ */
|
|
2575
|
-
note: /* @__PURE__ */
|
|
2576
|
-
text: /* @__PURE__ */
|
|
2577
|
-
eraser: /* @__PURE__ */
|
|
2578
|
-
},
|
|
2571
|
+
}, ea = "inline-flex cursor-pointer items-center justify-center whitespace-nowrap rounded-full border-0 bg-transparent px-2.5 text-inherit tabular-nums outline-0 outline-offset-2 transition-colors hover:bg-(--tb-hover) active:bg-(--tb-press) focus-visible:outline-2 focus-visible:outline-(--tb-focus,var(--primary-text))", ta = {
|
|
2572
|
+
pointer: /* @__PURE__ */ V(it, {}),
|
|
2573
|
+
highlight: /* @__PURE__ */ V(Ye, {}),
|
|
2574
|
+
underline: /* @__PURE__ */ V(mt, {}),
|
|
2575
|
+
pen: /* @__PURE__ */ V(st, {}),
|
|
2576
|
+
note: /* @__PURE__ */ V(ft, {}),
|
|
2577
|
+
text: /* @__PURE__ */ V(pt, {}),
|
|
2578
|
+
eraser: /* @__PURE__ */ V(Ge, {})
|
|
2579
|
+
}, na = [
|
|
2579
2580
|
"highlight",
|
|
2580
2581
|
"pen",
|
|
2581
2582
|
"note",
|
|
2582
2583
|
"eraser"
|
|
2583
|
-
],
|
|
2584
|
+
], ra = [
|
|
2584
2585
|
"highlight",
|
|
2585
2586
|
"underline",
|
|
2586
2587
|
"pen",
|
|
@@ -2588,8 +2589,8 @@ var Qi = {
|
|
|
2588
2589
|
"text",
|
|
2589
2590
|
"eraser"
|
|
2590
2591
|
];
|
|
2591
|
-
function
|
|
2592
|
-
let { t: e } =
|
|
2592
|
+
function ia() {
|
|
2593
|
+
let { t: e } = M();
|
|
2593
2594
|
return {
|
|
2594
2595
|
tool: {
|
|
2595
2596
|
pointer: e("material.pdf-reader.next.tool-pointer", "Select"),
|
|
@@ -2609,52 +2610,52 @@ function ra() {
|
|
|
2609
2610
|
}
|
|
2610
2611
|
};
|
|
2611
2612
|
}
|
|
2612
|
-
function
|
|
2613
|
-
let { t: e } =
|
|
2613
|
+
function aa() {
|
|
2614
|
+
let { t: e } = M(), { chrome: t, chromeActions: r } = X(), i = d(), a = ia(), o = t.size === "compact" ? na : ra, s = e("material.pdf-reader.next.color", "Colour: {color}", { color: a.color[t.color] }), c = (e) => /* @__PURE__ */ V(Gn, {
|
|
2614
2615
|
value: e,
|
|
2615
|
-
icon:
|
|
2616
|
+
icon: ta[e],
|
|
2616
2617
|
label: a.tool[e]
|
|
2617
2618
|
}, e);
|
|
2618
|
-
return /* @__PURE__ */
|
|
2619
|
-
/* @__PURE__ */
|
|
2619
|
+
return /* @__PURE__ */ H(B, { children: [
|
|
2620
|
+
/* @__PURE__ */ H(Wn, {
|
|
2620
2621
|
type: "single",
|
|
2621
2622
|
label: e("material.pdf-reader.next.tools", "Annotation tools"),
|
|
2622
2623
|
value: t.tool,
|
|
2623
2624
|
onValueChange: (e) => r.setTool(e),
|
|
2624
2625
|
children: [
|
|
2625
2626
|
c("pointer"),
|
|
2626
|
-
/* @__PURE__ */
|
|
2627
|
+
/* @__PURE__ */ V(A, {}),
|
|
2627
2628
|
o.map(c)
|
|
2628
2629
|
]
|
|
2629
2630
|
}),
|
|
2630
|
-
/* @__PURE__ */
|
|
2631
|
-
/* @__PURE__ */
|
|
2631
|
+
/* @__PURE__ */ V(A, {}),
|
|
2632
|
+
/* @__PURE__ */ H(ae, {
|
|
2632
2633
|
modal: !1,
|
|
2633
|
-
children: [/* @__PURE__ */
|
|
2634
|
+
children: [/* @__PURE__ */ V(O, {
|
|
2634
2635
|
label: s,
|
|
2635
|
-
children: /* @__PURE__ */
|
|
2636
|
+
children: /* @__PURE__ */ V(S, {
|
|
2636
2637
|
asChild: !0,
|
|
2637
|
-
children: /* @__PURE__ */
|
|
2638
|
+
children: /* @__PURE__ */ V("button", {
|
|
2638
2639
|
type: "button",
|
|
2639
2640
|
"aria-label": s,
|
|
2640
|
-
className:
|
|
2641
|
-
children: /* @__PURE__ */
|
|
2641
|
+
className: ea,
|
|
2642
|
+
children: /* @__PURE__ */ V("span", {
|
|
2642
2643
|
"aria-hidden": !0,
|
|
2643
|
-
className: n("size-[18px] rounded-full ring-2 ring-foreground/30",
|
|
2644
|
+
className: n("size-[18px] rounded-full ring-2 ring-foreground/30", $i[t.color])
|
|
2644
2645
|
})
|
|
2645
2646
|
})
|
|
2646
2647
|
})
|
|
2647
|
-
}), /* @__PURE__ */
|
|
2648
|
+
}), /* @__PURE__ */ V(ie, {
|
|
2648
2649
|
container: i,
|
|
2649
2650
|
className: "min-w-36",
|
|
2650
|
-
children: /* @__PURE__ */
|
|
2651
|
+
children: /* @__PURE__ */ V(C, {
|
|
2651
2652
|
value: t.color,
|
|
2652
2653
|
onValueChange: (e) => r.setColor(e),
|
|
2653
|
-
children:
|
|
2654
|
+
children: ai.map((e) => /* @__PURE__ */ H(w, {
|
|
2654
2655
|
value: e,
|
|
2655
|
-
children: [/* @__PURE__ */
|
|
2656
|
+
children: [/* @__PURE__ */ V("span", {
|
|
2656
2657
|
"aria-hidden": !0,
|
|
2657
|
-
className: n("size-3.5 rounded-full",
|
|
2658
|
+
className: n("size-3.5 rounded-full", $i[e])
|
|
2658
2659
|
}), a.color[e]]
|
|
2659
2660
|
}, e))
|
|
2660
2661
|
})
|
|
@@ -2664,19 +2665,19 @@ function ia() {
|
|
|
2664
2665
|
}
|
|
2665
2666
|
//#endregion
|
|
2666
2667
|
//#region lib/components/ui/media/pdf-reader/partials/page-field.tsx
|
|
2667
|
-
function
|
|
2668
|
-
let { t: e } =
|
|
2668
|
+
function oa() {
|
|
2669
|
+
let { t: e } = M(), { state: t, actions: n } = Z(), [r, i] = z(null), a = r ?? String(t.currentPage), o = () => {
|
|
2669
2670
|
let e = Number.parseInt(r ?? "", 10);
|
|
2670
2671
|
Number.isFinite(e) && n.goToPage(e), i(null);
|
|
2671
2672
|
};
|
|
2672
|
-
return /* @__PURE__ */
|
|
2673
|
+
return /* @__PURE__ */ H(fe, {
|
|
2673
2674
|
label: e("material.pdf-reader.next.page-group", "Page"),
|
|
2674
2675
|
priority: "pinned",
|
|
2675
2676
|
dir: "ltr",
|
|
2676
2677
|
className: "gap-1.5 px-1.5 text-sm",
|
|
2677
|
-
children: [/* @__PURE__ */
|
|
2678
|
+
children: [/* @__PURE__ */ V(O, {
|
|
2678
2679
|
label: e("material.pdf-reader.next.page-go", "Go to page"),
|
|
2679
|
-
children: /* @__PURE__ */
|
|
2680
|
+
children: /* @__PURE__ */ V("input", {
|
|
2680
2681
|
type: "text",
|
|
2681
2682
|
inputMode: "numeric",
|
|
2682
2683
|
pattern: "[0-9]*",
|
|
@@ -2691,7 +2692,7 @@ function aa() {
|
|
|
2691
2692
|
onBlur: () => i(null),
|
|
2692
2693
|
className: "h-8 min-w-9 rounded-full bg-foreground/[0.07] px-2 text-center font-semibold text-foreground tabular-nums outline-0 [field-sizing:content] focus-visible:outline-2 focus-visible:outline-primary-text"
|
|
2693
2694
|
})
|
|
2694
|
-
}), /* @__PURE__ */
|
|
2695
|
+
}), /* @__PURE__ */ V("span", {
|
|
2695
2696
|
"aria-hidden": !0,
|
|
2696
2697
|
className: "text-muted-foreground tabular-nums",
|
|
2697
2698
|
children: e("material.pdf-reader.next.page-total", "/ {total}", { total: t.numPages })
|
|
@@ -2700,7 +2701,7 @@ function aa() {
|
|
|
2700
2701
|
}
|
|
2701
2702
|
//#endregion
|
|
2702
2703
|
//#region lib/components/ui/media/pdf-reader/partials/zoom-control.tsx
|
|
2703
|
-
var
|
|
2704
|
+
var sa = [
|
|
2704
2705
|
.5,
|
|
2705
2706
|
.75,
|
|
2706
2707
|
1,
|
|
@@ -2708,45 +2709,45 @@ var oa = [
|
|
|
2708
2709
|
1.5,
|
|
2709
2710
|
2
|
|
2710
2711
|
];
|
|
2711
|
-
function
|
|
2712
|
-
let { t: e, language: t } =
|
|
2713
|
-
return /* @__PURE__ */
|
|
2714
|
-
/* @__PURE__ */
|
|
2715
|
-
icon: /* @__PURE__ */
|
|
2712
|
+
function ca() {
|
|
2713
|
+
let { t: e, language: t } = M(), { state: n, actions: r, scale: i, limits: a } = Z(), o = d(), s = (e) => Ar(e, t ?? "en"), c = n.fitMode === "custom" ? String(n.scale) : n.fitMode, l = (e) => e === "width" || e === "page" ? r.setFitMode(e) : r.setScale(Number(e)), u = e("material.pdf-reader.zoom-menu", "Zoom level {level}", { level: s(i) });
|
|
2714
|
+
return /* @__PURE__ */ H(B, { children: [
|
|
2715
|
+
/* @__PURE__ */ V(j, {
|
|
2716
|
+
icon: /* @__PURE__ */ V(bt, {}),
|
|
2716
2717
|
label: e("material.pdf-reader.zoom-out", "Zoom out"),
|
|
2717
2718
|
disabled: i <= a.minScale,
|
|
2718
2719
|
onClick: r.zoomOut
|
|
2719
2720
|
}),
|
|
2720
|
-
/* @__PURE__ */
|
|
2721
|
+
/* @__PURE__ */ H(ae, {
|
|
2721
2722
|
modal: !1,
|
|
2722
|
-
children: [/* @__PURE__ */
|
|
2723
|
+
children: [/* @__PURE__ */ V(O, {
|
|
2723
2724
|
label: u,
|
|
2724
|
-
children: /* @__PURE__ */
|
|
2725
|
+
children: /* @__PURE__ */ V(S, {
|
|
2725
2726
|
asChild: !0,
|
|
2726
|
-
children: /* @__PURE__ */
|
|
2727
|
+
children: /* @__PURE__ */ V("button", {
|
|
2727
2728
|
type: "button",
|
|
2728
2729
|
"aria-label": u,
|
|
2729
|
-
className:
|
|
2730
|
+
className: ea,
|
|
2730
2731
|
children: s(i)
|
|
2731
2732
|
})
|
|
2732
2733
|
})
|
|
2733
|
-
}), /* @__PURE__ */
|
|
2734
|
+
}), /* @__PURE__ */ V(ie, {
|
|
2734
2735
|
container: o,
|
|
2735
2736
|
className: "min-w-36",
|
|
2736
|
-
children: /* @__PURE__ */
|
|
2737
|
+
children: /* @__PURE__ */ H(C, {
|
|
2737
2738
|
value: c,
|
|
2738
2739
|
onValueChange: l,
|
|
2739
2740
|
children: [
|
|
2740
|
-
/* @__PURE__ */
|
|
2741
|
+
/* @__PURE__ */ V(w, {
|
|
2741
2742
|
value: "width",
|
|
2742
2743
|
children: e("material.pdf-reader.fit-width-full", "Fit Width")
|
|
2743
2744
|
}),
|
|
2744
|
-
/* @__PURE__ */
|
|
2745
|
+
/* @__PURE__ */ V(w, {
|
|
2745
2746
|
value: "page",
|
|
2746
2747
|
children: e("material.pdf-reader.fit-page-full", "Fit Page")
|
|
2747
2748
|
}),
|
|
2748
|
-
/* @__PURE__ */
|
|
2749
|
-
|
|
2749
|
+
/* @__PURE__ */ V(E, {}),
|
|
2750
|
+
sa.map((e) => /* @__PURE__ */ V(w, {
|
|
2750
2751
|
value: String(e),
|
|
2751
2752
|
children: s(e)
|
|
2752
2753
|
}, e))
|
|
@@ -2754,8 +2755,8 @@ function sa() {
|
|
|
2754
2755
|
})
|
|
2755
2756
|
})]
|
|
2756
2757
|
}),
|
|
2757
|
-
/* @__PURE__ */
|
|
2758
|
-
icon: /* @__PURE__ */
|
|
2758
|
+
/* @__PURE__ */ V(j, {
|
|
2759
|
+
icon: /* @__PURE__ */ V(yt, {}),
|
|
2759
2760
|
label: e("material.pdf-reader.zoom-in", "Zoom in"),
|
|
2760
2761
|
disabled: i >= a.maxScale,
|
|
2761
2762
|
onClick: r.zoomIn
|
|
@@ -2764,54 +2765,54 @@ function sa() {
|
|
|
2764
2765
|
}
|
|
2765
2766
|
//#endregion
|
|
2766
2767
|
//#region lib/components/ui/media/pdf-reader/partials/pill-nav.tsx
|
|
2767
|
-
function
|
|
2768
|
-
let { t: e } =
|
|
2769
|
-
return /* @__PURE__ */
|
|
2770
|
-
c === "medium" ? /* @__PURE__ */
|
|
2771
|
-
icon: /* @__PURE__ */
|
|
2768
|
+
function la() {
|
|
2769
|
+
let { t: e } = M(), { chrome: t, chromeActions: n, props: r, mode: i } = X(), { state: a, actions: o, rowStarts: s } = Z(), { size: c } = t;
|
|
2770
|
+
return /* @__PURE__ */ H(B, { children: [
|
|
2771
|
+
c === "medium" ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(de, {
|
|
2772
|
+
icon: /* @__PURE__ */ V(ot, {
|
|
2772
2773
|
"aria-hidden": !0,
|
|
2773
2774
|
className: "rtl:-scale-x-100"
|
|
2774
2775
|
}),
|
|
2775
2776
|
label: e("material.pdf-reader.next.panel-toggle", "Panel"),
|
|
2776
2777
|
pressed: t.panelOpen,
|
|
2777
2778
|
onPressedChange: () => n.togglePanel()
|
|
2778
|
-
}), /* @__PURE__ */
|
|
2779
|
-
/* @__PURE__ */
|
|
2780
|
-
icon: /* @__PURE__ */
|
|
2779
|
+
}), /* @__PURE__ */ V(A, {})] }) : null,
|
|
2780
|
+
/* @__PURE__ */ V(j, {
|
|
2781
|
+
icon: /* @__PURE__ */ V(Ve, {
|
|
2781
2782
|
"aria-hidden": !0,
|
|
2782
2783
|
className: "rtl:rotate-180"
|
|
2783
2784
|
}),
|
|
2784
2785
|
label: e("material.pdf-reader.previous-page", "Previous page"),
|
|
2785
|
-
disabled:
|
|
2786
|
+
disabled: Vr(s, a.currentPage, -1) === null,
|
|
2786
2787
|
onClick: o.prevPage
|
|
2787
2788
|
}),
|
|
2788
|
-
/* @__PURE__ */
|
|
2789
|
-
/* @__PURE__ */
|
|
2790
|
-
icon: /* @__PURE__ */
|
|
2789
|
+
/* @__PURE__ */ V(oa, {}),
|
|
2790
|
+
/* @__PURE__ */ V(j, {
|
|
2791
|
+
icon: /* @__PURE__ */ V(He, {
|
|
2791
2792
|
"aria-hidden": !0,
|
|
2792
2793
|
className: "rtl:rotate-180"
|
|
2793
2794
|
}),
|
|
2794
2795
|
label: e("material.pdf-reader.next-page", "Next page"),
|
|
2795
|
-
disabled:
|
|
2796
|
+
disabled: Vr(s, a.currentPage, 1) === null,
|
|
2796
2797
|
onClick: o.nextPage
|
|
2797
2798
|
}),
|
|
2798
|
-
c === "compact" ? null : /* @__PURE__ */
|
|
2799
|
-
r.annotate ? /* @__PURE__ */
|
|
2800
|
-
icon: /* @__PURE__ */
|
|
2799
|
+
c === "compact" ? null : /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(A, {}), /* @__PURE__ */ V(ca, {})] }),
|
|
2800
|
+
r.annotate ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(A, {}), /* @__PURE__ */ V(j, {
|
|
2801
|
+
icon: /* @__PURE__ */ V(ct, {}),
|
|
2801
2802
|
label: e("material.pdf-reader.next.annotate", "Annotate"),
|
|
2802
2803
|
onClick: () => n.startAnnotating(),
|
|
2803
2804
|
"data-focus-target": "annotate"
|
|
2804
2805
|
})] }) : null,
|
|
2805
|
-
i === "fullscreen" ? /* @__PURE__ */
|
|
2806
|
+
i === "fullscreen" ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(A, {}), /* @__PURE__ */ V(Ji, {})] }) : null
|
|
2806
2807
|
] });
|
|
2807
2808
|
}
|
|
2808
2809
|
//#endregion
|
|
2809
2810
|
//#region lib/components/ui/media/pdf-reader/partials/pill.tsx
|
|
2810
|
-
function
|
|
2811
|
-
let { t: e } =
|
|
2812
|
-
return i.numPages === 0 ? null : /* @__PURE__ */
|
|
2811
|
+
function ua() {
|
|
2812
|
+
let { t: e } = M(), t = Q(), { chrome: n, frameRef: r } = X(), { state: i, containerRef: a } = Z(), o = Qi(a, r, n.annotating);
|
|
2813
|
+
return i.numPages === 0 ? null : /* @__PURE__ */ V("div", {
|
|
2813
2814
|
className: "pointer-events-none absolute inset-x-0 bottom-4 z-10 flex justify-center px-4",
|
|
2814
|
-
children: /* @__PURE__ */
|
|
2815
|
+
children: /* @__PURE__ */ V(k, {
|
|
2815
2816
|
label: n.annotating ? e("material.pdf-reader.next.tools", "Annotation tools") : e("material.pdf-reader.next.pill", "Reader controls"),
|
|
2816
2817
|
...t,
|
|
2817
2818
|
density: n.annotating && n.size === "compact" && t.density ? "compact" : t.density,
|
|
@@ -2819,30 +2820,30 @@ function la() {
|
|
|
2819
2820
|
hidden: o,
|
|
2820
2821
|
className: "pointer-events-auto",
|
|
2821
2822
|
"data-focus-target": "pill",
|
|
2822
|
-
children: n.annotating ? /* @__PURE__ */
|
|
2823
|
+
children: n.annotating ? /* @__PURE__ */ V(aa, {}) : /* @__PURE__ */ V(la, {})
|
|
2823
2824
|
})
|
|
2824
2825
|
});
|
|
2825
2826
|
}
|
|
2826
2827
|
//#endregion
|
|
2827
2828
|
//#region lib/components/ui/media/pdf-reader/partials/rail.tsx
|
|
2828
|
-
function
|
|
2829
|
-
let { t: e } =
|
|
2830
|
-
return /* @__PURE__ */
|
|
2829
|
+
function da() {
|
|
2830
|
+
let { t: e } = M(), { chrome: t, chromeActions: n } = X(), r = ci(), i = li(), a = yr.selectRailValue(t), o = Q();
|
|
2831
|
+
return /* @__PURE__ */ V(k, {
|
|
2831
2832
|
label: e("material.pdf-reader.next.rail", "Document views"),
|
|
2832
2833
|
variant: "docked",
|
|
2833
2834
|
orientation: "vertical",
|
|
2834
2835
|
...o,
|
|
2835
2836
|
className: "h-auto w-14 shrink-0 self-stretch border-e border-border",
|
|
2836
|
-
children: /* @__PURE__ */
|
|
2837
|
+
children: /* @__PURE__ */ V(Wn, {
|
|
2837
2838
|
type: "single",
|
|
2838
2839
|
label: e("material.pdf-reader.next.panel-views", "Panel views"),
|
|
2839
2840
|
value: a,
|
|
2840
2841
|
onValueChange: (e) => n.openPanelTab(e),
|
|
2841
2842
|
children: i.map((e) => {
|
|
2842
|
-
let t =
|
|
2843
|
-
return /* @__PURE__ */
|
|
2843
|
+
let t = si[e];
|
|
2844
|
+
return /* @__PURE__ */ V(Gn, {
|
|
2844
2845
|
value: e,
|
|
2845
|
-
icon: /* @__PURE__ */
|
|
2846
|
+
icon: /* @__PURE__ */ V(t, {}),
|
|
2846
2847
|
label: r[e],
|
|
2847
2848
|
onClick: () => {
|
|
2848
2849
|
e === a && n.closePanel();
|
|
@@ -2854,11 +2855,11 @@ function ua() {
|
|
|
2854
2855
|
}
|
|
2855
2856
|
//#endregion
|
|
2856
2857
|
//#region lib/components/ui/media/pdf-reader/partials/frame.tsx
|
|
2857
|
-
function
|
|
2858
|
-
let { t: e } =
|
|
2859
|
-
|
|
2860
|
-
let s = a === "fullscreen" &&
|
|
2861
|
-
return /* @__PURE__ */
|
|
2858
|
+
function fa() {
|
|
2859
|
+
let { t: e } = M(), { chrome: t, chromeActions: r, frameRef: i, mode: a, props: o } = X();
|
|
2860
|
+
wr(i, r.setSize), Tr(i, t);
|
|
2861
|
+
let s = a === "fullscreen" && yr.selectHeaderKind(t) === "default", c = kr();
|
|
2862
|
+
return /* @__PURE__ */ H("section", {
|
|
2862
2863
|
ref: i,
|
|
2863
2864
|
"data-slot": "pdf-reader",
|
|
2864
2865
|
"data-mode": a,
|
|
@@ -2867,23 +2868,23 @@ function da() {
|
|
|
2867
2868
|
onKeyDown: c,
|
|
2868
2869
|
className: n("relative flex h-full min-h-0 flex-col overflow-hidden bg-background text-foreground", a === "embedded" && "rounded-xl border border-border", o.className),
|
|
2869
2870
|
children: [
|
|
2870
|
-
s ? null : /* @__PURE__ */
|
|
2871
|
-
/* @__PURE__ */
|
|
2871
|
+
s ? null : /* @__PURE__ */ V(Xi, {}),
|
|
2872
|
+
/* @__PURE__ */ H("div", {
|
|
2872
2873
|
className: "relative flex min-h-0 flex-1",
|
|
2873
2874
|
children: [
|
|
2874
|
-
s ? /* @__PURE__ */
|
|
2875
|
-
t.size === "expanded" ? /* @__PURE__ */
|
|
2876
|
-
/* @__PURE__ */
|
|
2877
|
-
/* @__PURE__ */
|
|
2875
|
+
s ? /* @__PURE__ */ V(Li, {}) : null,
|
|
2876
|
+
t.size === "expanded" ? /* @__PURE__ */ V(da, {}) : null,
|
|
2877
|
+
/* @__PURE__ */ V(Ii, {}),
|
|
2878
|
+
/* @__PURE__ */ V(ua, {})
|
|
2878
2879
|
]
|
|
2879
2880
|
}),
|
|
2880
|
-
/* @__PURE__ */
|
|
2881
|
+
/* @__PURE__ */ V(jr, {})
|
|
2881
2882
|
]
|
|
2882
2883
|
});
|
|
2883
2884
|
}
|
|
2884
2885
|
//#endregion
|
|
2885
2886
|
//#region lib/components/ui/media/pdf-reader/reader-layout.ts
|
|
2886
|
-
function
|
|
2887
|
+
function pa(e, t, n) {
|
|
2887
2888
|
let r = n === "compact";
|
|
2888
2889
|
return {
|
|
2889
2890
|
mode: r ? "single" : e === "spread" && t ? "spread-cover" : e,
|
|
@@ -2892,17 +2893,17 @@ function fa(e, t, n) {
|
|
|
2892
2893
|
}
|
|
2893
2894
|
//#endregion
|
|
2894
2895
|
//#region lib/components/ui/media/pdf-reader/use-reader-chrome-state.ts
|
|
2895
|
-
function
|
|
2896
|
-
let [t, n] =
|
|
2896
|
+
function ma(e) {
|
|
2897
|
+
let [t, n] = xe(vr, e.defaultLayout ? {
|
|
2897
2898
|
...e.initialChrome,
|
|
2898
2899
|
layout: e.defaultLayout
|
|
2899
|
-
} : e.initialChrome), r = e.layout ?? t.layout, i =
|
|
2900
|
+
} : e.initialChrome), r = e.layout ?? t.layout, i = L(() => ({
|
|
2900
2901
|
...t,
|
|
2901
2902
|
layout: r
|
|
2902
2903
|
}), [t, r]), { layout: a, onLayoutChange: o } = e;
|
|
2903
2904
|
return {
|
|
2904
2905
|
chrome: i,
|
|
2905
|
-
chromeActions:
|
|
2906
|
+
chromeActions: L(() => ({
|
|
2906
2907
|
...n,
|
|
2907
2908
|
setLayout: (e) => {
|
|
2908
2909
|
e !== r && (o?.(e), a === void 0 && n.setLayout(e));
|
|
@@ -2918,9 +2919,9 @@ function pa(e) {
|
|
|
2918
2919
|
}
|
|
2919
2920
|
//#endregion
|
|
2920
2921
|
//#region lib/components/ui/media/pdf-reader/use-reader-chrome-value.ts
|
|
2921
|
-
function
|
|
2922
|
+
function ha({ chrome: e, chromeActions: t, layout: n, mode: r, frameRef: i, props: a }) {
|
|
2922
2923
|
let { onOpenChange: o, onBack: s, onExitFullscreen: c } = a, l = e.size;
|
|
2923
|
-
return
|
|
2924
|
+
return L(() => ({
|
|
2924
2925
|
chrome: e,
|
|
2925
2926
|
chromeActions: t,
|
|
2926
2927
|
layout: n,
|
|
@@ -2951,25 +2952,25 @@ function ma({ chrome: e, chromeActions: t, layout: n, mode: r, frameRef: i, prop
|
|
|
2951
2952
|
}
|
|
2952
2953
|
//#endregion
|
|
2953
2954
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-file-actions.ts
|
|
2954
|
-
function
|
|
2955
|
-
let { t: a } =
|
|
2955
|
+
function ga({ file: e, fileName: t, pdfRef: n, onDownload: r, onPrint: i }) {
|
|
2956
|
+
let { t: a } = M(), o = () => n.current?.getData?.();
|
|
2956
2957
|
return {
|
|
2957
2958
|
download: r ?? (() => {
|
|
2958
|
-
e &&
|
|
2959
|
+
e && en(e, {
|
|
2959
2960
|
fileName: t,
|
|
2960
2961
|
getData: o,
|
|
2961
2962
|
defaultName: a("material.pdf-reader.default-file-name", "document")
|
|
2962
2963
|
});
|
|
2963
2964
|
}),
|
|
2964
2965
|
print: i ?? (() => {
|
|
2965
|
-
e &&
|
|
2966
|
+
e && tn(e, { getData: o });
|
|
2966
2967
|
})
|
|
2967
2968
|
};
|
|
2968
2969
|
}
|
|
2969
2970
|
//#endregion
|
|
2970
2971
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-outline-select.ts
|
|
2971
|
-
function
|
|
2972
|
-
return
|
|
2972
|
+
function _a(e, t) {
|
|
2973
|
+
return P(async (n) => {
|
|
2973
2974
|
let r = e.current;
|
|
2974
2975
|
if (!(!r || n.dest == null)) try {
|
|
2975
2976
|
let e = typeof n.dest == "string" ? await r.getDestination(n.dest) : n.dest, i = Array.isArray(e) ? e[0] : e;
|
|
@@ -2979,7 +2980,7 @@ function ga(e, t) {
|
|
|
2979
2980
|
}
|
|
2980
2981
|
//#endregion
|
|
2981
2982
|
//#region lib/components/ui/media/pdf-viewer/pdf-reader.reducer.ts
|
|
2982
|
-
var
|
|
2983
|
+
var $ = .15, va = .25;
|
|
2983
2984
|
function ya(e) {
|
|
2984
2985
|
return Math.min(Math.max(e, va), 5);
|
|
2985
2986
|
}
|
|
@@ -3171,7 +3172,7 @@ function Ta(e, t) {
|
|
|
3171
3172
|
//#endregion
|
|
3172
3173
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-computed-scale.ts
|
|
3173
3174
|
function Ea(e) {
|
|
3174
|
-
return
|
|
3175
|
+
return P(() => e.fitMode === "custom" ? e.scale : Kt(e.fitMode, e.pageSizes ?? [], e.rotation, {
|
|
3175
3176
|
width: e.containerWidth,
|
|
3176
3177
|
height: e.containerHeight ?? 600
|
|
3177
3178
|
}), [
|
|
@@ -3186,7 +3187,7 @@ function Ea(e) {
|
|
|
3186
3187
|
//#endregion
|
|
3187
3188
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-page-area.ts
|
|
3188
3189
|
function Da(e, t, n) {
|
|
3189
|
-
|
|
3190
|
+
F(() => {
|
|
3190
3191
|
let r = e.current;
|
|
3191
3192
|
if (!r || !t) return;
|
|
3192
3193
|
let i = new ResizeObserver((e) => {
|
|
@@ -3205,7 +3206,7 @@ function Da(e, t, n) {
|
|
|
3205
3206
|
t,
|
|
3206
3207
|
n
|
|
3207
3208
|
]);
|
|
3208
|
-
let [r] =
|
|
3209
|
+
let [r] = z(() => Bt((e) => n({
|
|
3209
3210
|
type: "SET_PAGE_SIZES",
|
|
3210
3211
|
payload: e
|
|
3211
3212
|
})));
|
|
@@ -3214,14 +3215,14 @@ function Da(e, t, n) {
|
|
|
3214
3215
|
//#endregion
|
|
3215
3216
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-page-report.ts
|
|
3216
3217
|
function Oa(e, t, n) {
|
|
3217
|
-
let r =
|
|
3218
|
+
let r = R(e.currentPage), i = P((e) => {
|
|
3218
3219
|
let { state: i, options: a } = n.current, o = ba(e, i.numPages);
|
|
3219
3220
|
o !== i.currentPage && (t({
|
|
3220
3221
|
type: "SET_PAGE",
|
|
3221
3222
|
payload: o
|
|
3222
3223
|
}), r.current = o, a.onPageChange?.(o));
|
|
3223
3224
|
}, [t, n]);
|
|
3224
|
-
return
|
|
3225
|
+
return F(() => {
|
|
3225
3226
|
e.numPages === 0 || e.currentPage === r.current || (r.current = e.currentPage, n.current.options.onPageChange?.(e.currentPage));
|
|
3226
3227
|
}, [
|
|
3227
3228
|
e.currentPage,
|
|
@@ -3232,24 +3233,24 @@ function Oa(e, t, n) {
|
|
|
3232
3233
|
//#endregion
|
|
3233
3234
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-reader.ts
|
|
3234
3235
|
function ka(e) {
|
|
3235
|
-
let [t, n] =
|
|
3236
|
-
|
|
3236
|
+
let [t, n] = Fe(Ca, e, xa), r = R(null), [i, a] = z(0), o = Da(r, t.numPages > 0, n);
|
|
3237
|
+
F(() => {
|
|
3237
3238
|
o.reset(), n({
|
|
3238
3239
|
type: "RESET_DOCUMENT",
|
|
3239
3240
|
payload: { page: c.current.options.initialPage ?? 1 }
|
|
3240
3241
|
});
|
|
3241
|
-
}, [
|
|
3242
|
-
let s = Ea(t), c =
|
|
3242
|
+
}, [nn(e.file), o]);
|
|
3243
|
+
let s = Ea(t), c = R({
|
|
3243
3244
|
state: t,
|
|
3244
3245
|
options: e
|
|
3245
3246
|
});
|
|
3246
|
-
|
|
3247
|
+
I(() => {
|
|
3247
3248
|
c.current = {
|
|
3248
3249
|
state: t,
|
|
3249
3250
|
options: e
|
|
3250
3251
|
};
|
|
3251
3252
|
});
|
|
3252
|
-
let l = Oa(t, n, c), u =
|
|
3253
|
+
let l = Oa(t, n, c), u = P((e) => {
|
|
3253
3254
|
let r = t.fitMode === "custom" ? t.scale : s();
|
|
3254
3255
|
n({
|
|
3255
3256
|
type: "SET_SCALE",
|
|
@@ -3268,8 +3269,8 @@ function ka(e) {
|
|
|
3268
3269
|
goToPage: l,
|
|
3269
3270
|
nextPage: () => l(t.currentPage + 1),
|
|
3270
3271
|
prevPage: () => l(t.currentPage - 1),
|
|
3271
|
-
zoomIn: () => u(
|
|
3272
|
-
zoomOut: () => u(
|
|
3272
|
+
zoomIn: () => u($),
|
|
3273
|
+
zoomOut: () => u(-$),
|
|
3273
3274
|
...Ta(n, t.rotation)
|
|
3274
3275
|
},
|
|
3275
3276
|
handlers: wa({
|
|
@@ -3292,13 +3293,13 @@ var Aa = {
|
|
|
3292
3293
|
matches: []
|
|
3293
3294
|
};
|
|
3294
3295
|
function ja(e, t, n, r = 150) {
|
|
3295
|
-
let [i, a] =
|
|
3296
|
-
return
|
|
3296
|
+
let [i, a] = z(Aa);
|
|
3297
|
+
return F(() => {
|
|
3297
3298
|
a(Aa);
|
|
3298
3299
|
let i = e.current;
|
|
3299
3300
|
if (!i || n === 0 || !t.trim()) return;
|
|
3300
3301
|
let o = !1, s = setTimeout(() => {
|
|
3301
|
-
|
|
3302
|
+
Xt(i, t, (e) => a((t) => Qt(t, e)), () => o).catch(() => {});
|
|
3302
3303
|
}, r);
|
|
3303
3304
|
return () => {
|
|
3304
3305
|
o = !0, clearTimeout(s);
|
|
@@ -3313,28 +3314,28 @@ function ja(e, t, n, r = 150) {
|
|
|
3313
3314
|
//#endregion
|
|
3314
3315
|
//#region lib/components/ui/media/pdf-viewer/use-pdf-search-hits.ts
|
|
3315
3316
|
function Ma(e) {
|
|
3316
|
-
let { pdfRef: t, query: n, numPages: r, goToPage: i, pageRefs: a, holdScrollSpy: o } = e, s = ja(t, n, r), [c, l] =
|
|
3317
|
-
|
|
3317
|
+
let { pdfRef: t, query: n, numPages: r, goToPage: i, pageRefs: a, holdScrollSpy: o } = e, s = ja(t, n, r), [c, l] = z(-1), u = R(() => {});
|
|
3318
|
+
F(() => {
|
|
3318
3319
|
l(-1), u.current();
|
|
3319
3320
|
}, [
|
|
3320
3321
|
t,
|
|
3321
3322
|
n,
|
|
3322
3323
|
r
|
|
3323
|
-
]),
|
|
3324
|
-
let d =
|
|
3324
|
+
]), F(() => () => u.current(), []);
|
|
3325
|
+
let d = L(() => Array.from(s.matches, (e) => e?.length ?? 0), [s.matches]), f = d.reduce((e, t) => e + t, 0), p = c < 0 ? null : Ht(d, c), m = R({
|
|
3325
3326
|
counts: d,
|
|
3326
3327
|
hitCount: f,
|
|
3327
3328
|
hitIndex: c
|
|
3328
3329
|
});
|
|
3329
|
-
|
|
3330
|
+
I(() => {
|
|
3330
3331
|
m.current = {
|
|
3331
3332
|
counts: d,
|
|
3332
3333
|
hitCount: f,
|
|
3333
3334
|
hitIndex: c
|
|
3334
3335
|
};
|
|
3335
3336
|
});
|
|
3336
|
-
let h =
|
|
3337
|
-
let { counts: t, hitCount: n, hitIndex: r } = m.current, s =
|
|
3337
|
+
let h = P((e) => {
|
|
3338
|
+
let { counts: t, hitCount: n, hitIndex: r } = m.current, s = Zt(r, e, n);
|
|
3338
3339
|
if (s < 0) return {
|
|
3339
3340
|
index: 0,
|
|
3340
3341
|
count: n
|
|
@@ -3343,8 +3344,8 @@ function Ma(e) {
|
|
|
3343
3344
|
...m.current,
|
|
3344
3345
|
hitIndex: s
|
|
3345
3346
|
}, l(s);
|
|
3346
|
-
let c =
|
|
3347
|
-
return c && (i(c.page), u.current(), u.current =
|
|
3347
|
+
let c = Ht(t, s);
|
|
3348
|
+
return c && (i(c.page), u.current(), u.current = Jt(() => a.current?.get(c.page), c.hit, o)), {
|
|
3348
3349
|
index: s,
|
|
3349
3350
|
count: n
|
|
3350
3351
|
};
|
|
@@ -3352,13 +3353,13 @@ function Ma(e) {
|
|
|
3352
3353
|
i,
|
|
3353
3354
|
a,
|
|
3354
3355
|
o
|
|
3355
|
-
]), g =
|
|
3356
|
+
]), g = P(() => l(-1), []), _ = p?.page ?? 0, v = p?.hit ?? -1;
|
|
3356
3357
|
return {
|
|
3357
3358
|
hitIndex: c,
|
|
3358
3359
|
hitCount: f,
|
|
3359
3360
|
jump: h,
|
|
3360
3361
|
reset: g,
|
|
3361
|
-
highlight:
|
|
3362
|
+
highlight: L(() => ({
|
|
3362
3363
|
texts: s.texts,
|
|
3363
3364
|
matches: s.matches,
|
|
3364
3365
|
current: _ ? {
|
|
@@ -3375,9 +3376,9 @@ function Ma(e) {
|
|
|
3375
3376
|
//#endregion
|
|
3376
3377
|
//#region lib/components/ui/media/pdf-reader/engine/open-engine-document.ts
|
|
3377
3378
|
async function Na(e, t, n) {
|
|
3378
|
-
let [r, i] = await Promise.all([
|
|
3379
|
+
let [r, i] = await Promise.all([Ci(), rn(e)]);
|
|
3379
3380
|
if (t.aborted) return null;
|
|
3380
|
-
let a = await
|
|
3381
|
+
let a = await Nt(r, i, {
|
|
3381
3382
|
signal: t,
|
|
3382
3383
|
onPassword: n
|
|
3383
3384
|
});
|
|
@@ -3386,39 +3387,39 @@ async function Na(e, t, n) {
|
|
|
3386
3387
|
//#endregion
|
|
3387
3388
|
//#region lib/components/ui/media/pdf-reader/engine/use-engine-document.ts
|
|
3388
3389
|
function Pa(e, t, n) {
|
|
3389
|
-
let r =
|
|
3390
|
+
let r = R({
|
|
3390
3391
|
file: e,
|
|
3391
3392
|
events: n
|
|
3392
3393
|
});
|
|
3393
|
-
|
|
3394
|
+
I(() => {
|
|
3394
3395
|
r.current = {
|
|
3395
3396
|
file: e,
|
|
3396
3397
|
events: n
|
|
3397
3398
|
};
|
|
3398
|
-
}),
|
|
3399
|
+
}), F(() => {
|
|
3399
3400
|
let e = r.current.file;
|
|
3400
3401
|
if (!e) return;
|
|
3401
3402
|
let t = new AbortController(), n;
|
|
3402
3403
|
return (async () => {
|
|
3403
3404
|
n = await Na(e, t.signal, (e, t) => r.current.events.onPassword(e, t === "wrong")) ?? void 0, n && r.current.events.onOpen(n.doc);
|
|
3404
3405
|
})().catch((e) => {
|
|
3405
|
-
t.signal.aborted ||
|
|
3406
|
+
t.signal.aborted || Ot(e).kind !== "aborted" && r.current.events.onFail(Xr(e));
|
|
3406
3407
|
}), () => {
|
|
3407
3408
|
t.abort(), n?.destroy().catch(() => {}), r.current.events.onClose();
|
|
3408
3409
|
};
|
|
3409
|
-
}, [
|
|
3410
|
+
}, [nn(e), t]);
|
|
3410
3411
|
}
|
|
3411
3412
|
//#endregion
|
|
3412
3413
|
//#region lib/components/ui/media/pdf-reader/engine/use-reader-password.ts
|
|
3413
3414
|
function Fa() {
|
|
3414
|
-
let [e, t] =
|
|
3415
|
+
let [e, t] = z(""), n = R(null);
|
|
3415
3416
|
return {
|
|
3416
3417
|
input: e,
|
|
3417
3418
|
setInput: t,
|
|
3418
|
-
ask:
|
|
3419
|
+
ask: P((e) => {
|
|
3419
3420
|
n.current = e;
|
|
3420
3421
|
}, []),
|
|
3421
|
-
forget:
|
|
3422
|
+
forget: P(() => {
|
|
3422
3423
|
n.current = null, t("");
|
|
3423
3424
|
}, []),
|
|
3424
3425
|
submit: () => {
|
|
@@ -3429,20 +3430,20 @@ function Fa() {
|
|
|
3429
3430
|
//#endregion
|
|
3430
3431
|
//#region lib/components/ui/media/pdf-reader/engine/use-reader-engine.ts
|
|
3431
3432
|
function Ia(e) {
|
|
3432
|
-
let [t, n] =
|
|
3433
|
-
return
|
|
3433
|
+
let [t, n] = z(null);
|
|
3434
|
+
return F(() => {
|
|
3434
3435
|
if (!e) return;
|
|
3435
|
-
let t =
|
|
3436
|
+
let t = Yr();
|
|
3436
3437
|
return n(t), () => {
|
|
3437
3438
|
t.dispose(), n(null);
|
|
3438
3439
|
};
|
|
3439
3440
|
}, [e]), t;
|
|
3440
3441
|
}
|
|
3441
3442
|
function La(e, t) {
|
|
3442
|
-
let { actions: n, handlers: r } = t, [i, a] =
|
|
3443
|
+
let { actions: n, handlers: r } = t, [i, a] = z(null), o = R(null), [s, c] = z(null), l = Fa(), u = Ia(i);
|
|
3443
3444
|
return Pa(e, t.reloadKey, {
|
|
3444
3445
|
onOpen: (e) => {
|
|
3445
|
-
o.current = e, a(e), r.onDocumentLoadSuccess(e), e.getOutline().then((e) => n.setOutline(
|
|
3446
|
+
o.current = e, a(e), r.onDocumentLoadSuccess(e), e.getOutline().then((e) => n.setOutline(Wt(e))).catch(() => {}), e.getDownloadInfo().then((e) => c(e.length)).catch(() => c(null));
|
|
3446
3447
|
},
|
|
3447
3448
|
onFail: r.onDocumentLoadError,
|
|
3448
3449
|
onPassword: (e, t) => {
|
|
@@ -3463,11 +3464,11 @@ function La(e, t) {
|
|
|
3463
3464
|
//#region lib/components/ui/media/pdf-reader/use-announcements.ts
|
|
3464
3465
|
var Ra = 1e3;
|
|
3465
3466
|
function za() {
|
|
3466
|
-
let e =
|
|
3467
|
+
let e = R({
|
|
3467
3468
|
page: -Infinity,
|
|
3468
3469
|
zoom: -Infinity
|
|
3469
3470
|
});
|
|
3470
|
-
return
|
|
3471
|
+
return L(() => ({
|
|
3471
3472
|
asked(t, n) {
|
|
3472
3473
|
return (...r) => {
|
|
3473
3474
|
e.current[t] = performance.now(), n(...r);
|
|
@@ -3480,7 +3481,7 @@ function za() {
|
|
|
3480
3481
|
//#region lib/components/ui/media/pdf-reader/use-asked-actions.ts
|
|
3481
3482
|
function Ba(e) {
|
|
3482
3483
|
let { reader: t, announcements: n, askedPage: r, layout: i, starts: a, scale: o } = e, { actions: s, state: c } = t, { asked: l } = n, u = (e) => s.setScale(ya(o + e)), d = (e) => {
|
|
3483
|
-
let t =
|
|
3484
|
+
let t = Vr(a, c.currentPage, e);
|
|
3484
3485
|
t !== null && s.goToPage(t);
|
|
3485
3486
|
}, f = i !== "single";
|
|
3486
3487
|
return {
|
|
@@ -3488,8 +3489,8 @@ function Ba(e) {
|
|
|
3488
3489
|
goToPage: r,
|
|
3489
3490
|
nextPage: l("page", f ? () => d(1) : s.nextPage),
|
|
3490
3491
|
prevPage: l("page", f ? () => d(-1) : s.prevPage),
|
|
3491
|
-
zoomIn: l("zoom", f ? () => u(
|
|
3492
|
-
zoomOut: l("zoom", f ? () => u(
|
|
3492
|
+
zoomIn: l("zoom", f ? () => u($) : s.zoomIn),
|
|
3493
|
+
zoomOut: l("zoom", f ? () => u(-$) : s.zoomOut),
|
|
3493
3494
|
setScale: l("zoom", s.setScale),
|
|
3494
3495
|
setFitMode: l("zoom", s.setFitMode)
|
|
3495
3496
|
};
|
|
@@ -3499,7 +3500,7 @@ function Ba(e) {
|
|
|
3499
3500
|
var Va = 900;
|
|
3500
3501
|
function Ha(e, t) {
|
|
3501
3502
|
let { state: n, computedScale: r } = e;
|
|
3502
|
-
return t === "single" || n.fitMode === "custom" ? r() :
|
|
3503
|
+
return t === "single" || n.fitMode === "custom" ? r() : zr(n.fitMode, t, n.numPages, n.pageSizes ?? [], n.rotation, {
|
|
3503
3504
|
width: n.containerWidth,
|
|
3504
3505
|
height: n.containerHeight ?? 600
|
|
3505
3506
|
});
|
|
@@ -3513,7 +3514,7 @@ function Ua(e, t = "single") {
|
|
|
3513
3514
|
onPageChange: e.onPageChange,
|
|
3514
3515
|
onLoadSuccess: e.onLoadSuccess,
|
|
3515
3516
|
onLoadError: e.onLoadError
|
|
3516
|
-
}), { state: s, actions: c } = o, l = La(n, o), { pdfRef: u } = l, d = za(), { asked: f } = d, p =
|
|
3517
|
+
}), { state: s, actions: c } = o, l = La(n, o), { pdfRef: u } = l, d = za(), { asked: f } = d, p = L(() => f("page", c.goToPage), [f, c.goToPage]), m = R(/* @__PURE__ */ new Map()), h = R(0), g = Ma({
|
|
3517
3518
|
pdfRef: u,
|
|
3518
3519
|
query: s.searchQuery,
|
|
3519
3520
|
numPages: s.numPages,
|
|
@@ -3522,13 +3523,13 @@ function Ua(e, t = "single") {
|
|
|
3522
3523
|
holdScrollSpy: () => {
|
|
3523
3524
|
h.current = performance.now() + Va;
|
|
3524
3525
|
}
|
|
3525
|
-
}), _ =
|
|
3526
|
+
}), _ = ga({
|
|
3526
3527
|
file: n,
|
|
3527
3528
|
fileName: r,
|
|
3528
3529
|
pdfRef: u,
|
|
3529
3530
|
onDownload: i,
|
|
3530
3531
|
onPrint: a
|
|
3531
|
-
}), v =
|
|
3532
|
+
}), v = _a(u, p), y = Ha(o, t), b = L(() => Lt(s.numPages, t), [s.numPages, t]), x = Ba({
|
|
3532
3533
|
reader: o,
|
|
3533
3534
|
announcements: d,
|
|
3534
3535
|
askedPage: p,
|
|
@@ -3554,13 +3555,13 @@ function Ua(e, t = "single") {
|
|
|
3554
3555
|
//#endregion
|
|
3555
3556
|
//#region lib/components/ui/media/pdf-reader/pdf-reader-provider.tsx
|
|
3556
3557
|
function Wa({ props: e, children: t }) {
|
|
3557
|
-
let { chrome: n, chromeActions: r, asked: i } =
|
|
3558
|
+
let { chrome: n, chromeActions: r, asked: i } = ma(e), a = L(() => pa(i, e.coverPage, n.size), [
|
|
3558
3559
|
i,
|
|
3559
3560
|
e.coverPage,
|
|
3560
3561
|
n.size
|
|
3561
|
-
]), o = Ua(e, a.mode), s =
|
|
3562
|
-
return /* @__PURE__ */
|
|
3563
|
-
value:
|
|
3562
|
+
]), o = Ua(e, a.mode), s = R(null), c = d();
|
|
3563
|
+
return /* @__PURE__ */ V(br, {
|
|
3564
|
+
value: ha({
|
|
3564
3565
|
chrome: n,
|
|
3565
3566
|
chromeActions: r,
|
|
3566
3567
|
layout: a,
|
|
@@ -3568,7 +3569,7 @@ function Wa({ props: e, children: t }) {
|
|
|
3568
3569
|
frameRef: s,
|
|
3569
3570
|
props: e
|
|
3570
3571
|
}),
|
|
3571
|
-
children: /* @__PURE__ */
|
|
3572
|
+
children: /* @__PURE__ */ V(xr, {
|
|
3572
3573
|
value: o,
|
|
3573
3574
|
children: t
|
|
3574
3575
|
})
|
|
@@ -3577,23 +3578,23 @@ function Wa({ props: e, children: t }) {
|
|
|
3577
3578
|
//#endregion
|
|
3578
3579
|
//#region lib/components/ui/media/pdf-reader/pdf-reader.tsx
|
|
3579
3580
|
function Ga(e) {
|
|
3580
|
-
let t = e.file ? /* @__PURE__ */
|
|
3581
|
+
let t = e.file ? /* @__PURE__ */ V(Wa, {
|
|
3581
3582
|
props: e,
|
|
3582
|
-
children: /* @__PURE__ */
|
|
3583
|
-
}) : /* @__PURE__ */
|
|
3584
|
-
return e.mode === "dialog" ? /* @__PURE__ */
|
|
3583
|
+
children: /* @__PURE__ */ V(fa, {})
|
|
3584
|
+
}) : /* @__PURE__ */ V(fr, { className: e.className });
|
|
3585
|
+
return e.mode === "dialog" ? /* @__PURE__ */ V(_r, {
|
|
3585
3586
|
open: e.open ?? !0,
|
|
3586
3587
|
onOpenChange: e.onOpenChange,
|
|
3587
3588
|
title: e.fileName,
|
|
3588
3589
|
children: t
|
|
3589
3590
|
}) : t;
|
|
3590
3591
|
}
|
|
3591
|
-
var Ka =
|
|
3592
|
+
var Ka = ke(Ga), qa = /* @__PURE__ */ e({ PdfReader: () => Xa }), Ja = new Set(oi);
|
|
3592
3593
|
function Ya(e) {
|
|
3593
3594
|
return Object.fromEntries(Object.entries(e).filter(([e]) => !Ja.has(e)));
|
|
3594
3595
|
}
|
|
3595
3596
|
function Xa(e) {
|
|
3596
|
-
return /* @__PURE__ */
|
|
3597
|
+
return /* @__PURE__ */ V(Ka, { ...Ya(e) });
|
|
3597
3598
|
}
|
|
3598
3599
|
//#endregion
|
|
3599
|
-
export {
|
|
3600
|
+
export { Gn as _, sr as a, ar as c, Zn as d, Xn as f, Wn as g, qn as h, or as i, tr as l, Kn as m, qa as n, er as o, Qn as p, dr as r, nr as s, Xa as t, $n as u, sn as v };
|