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