@alfadocs/ui-kit 0.69.0 → 0.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{agenda-card-BxSFkqgY.js → agenda-card-BQ-IKAru.js} +2 -2
- package/dist/_chunks/{agenda-tray-g0kg7HwB.js → agenda-tray-CGXRk58j.js} +2 -2
- package/dist/_chunks/{ai-consent-banner-CXlsNX1c.js → ai-consent-banner-Be-h9mRI.js} +3 -3
- package/dist/_chunks/ai-tools-rail-B5NEghsp.js +511 -0
- package/dist/_chunks/{alert-_mUKLmwA.js → alert-CHYZ96tR.js} +150 -96
- package/dist/_chunks/{anamnesis-card-DRmE24OQ.js → anamnesis-card-DvYCa16e.js} +2 -2
- package/dist/_chunks/anatomy-scheme-CJB6dI6p.js +2445 -0
- package/dist/_chunks/annotation-marker-qt5R9WZX.js +120 -0
- package/dist/_chunks/{antenatal-schedule-timeline-35ebkcZT.js → antenatal-schedule-timeline-CwXrQRm1.js} +2 -2
- package/dist/_chunks/appointment-card-C06aZqA7.js +310 -0
- package/dist/_chunks/appointment-timeline-BJM0S_Fg.js +386 -0
- package/dist/_chunks/appointment-tray-DRRw5ROi.js +193 -0
- package/dist/_chunks/{audio-recorder-DYXXnGug.js → audio-recorder-Cpdk5qpQ.js} +2 -2
- package/dist/_chunks/{badge-CqGsX32l.js → badge-DCOqV9mI.js} +32 -27
- package/dist/_chunks/{bishop-score-PJI3AXzA.js → bishop-score-DnYWtZa_.js} +2 -2
- package/dist/_chunks/{bmi-calculator-BZtIJ53x.js → bmi-calculator-zjeY4E7J.js} +2 -2
- package/dist/_chunks/{booking-C3VqFReX.js → booking-DUBI0oqt.js} +4 -4
- package/dist/_chunks/{care-plan-card-CvFGXa2z.js → care-plan-card-C5sTfY9G.js} +5 -5
- package/dist/_chunks/{care-plan-entry-card-C3E_gClk.js → care-plan-entry-card-CXnxGCWA.js} +5 -5
- package/dist/_chunks/care-plan-header-BUwqDTtz.js +206 -0
- package/dist/_chunks/clinical-note-card-BUvNMNGL.js +436 -0
- package/dist/_chunks/{contact-profile-card-Dramqa9C.js → contact-profile-card-DDPwRFiP.js} +2 -2
- package/dist/_chunks/control-room-rail-Y8ryLYsP.js +229 -0
- package/dist/_chunks/{cycle-calculator-DmRGJNaT.js → cycle-calculator-CCmPwcBl.js} +2 -2
- package/dist/_chunks/{dependent-selector-CG_FOHya.js → dependent-selector-DUV4thxX.js} +2 -2
- package/dist/_chunks/{document-scanner-CTubA0-N.js → document-scanner-C_AxLooF.js} +3 -3
- package/dist/_chunks/{due-date-calculator-BTmsIQqD.js → due-date-calculator-Brdj-euS.js} +3 -3
- package/dist/_chunks/editable-currency-cell-renderer-C9twtALM.js +328 -0
- package/dist/_chunks/email-input-DJ7EXklP.js +397 -0
- package/dist/_chunks/{entity-card-COhmqHly.js → entity-card-9_62gY7l.js} +38 -20
- package/dist/_chunks/entity-summary-BxRjFh_4.js +138 -0
- package/dist/_chunks/{fetal-weight-CRz7KE2D.js → fetal-weight-DNCkyeVo.js} +2 -2
- package/dist/_chunks/field-value-NXYczdpO.js +415 -0
- package/dist/_chunks/{file-upload-5ScQd4fE.js → file-upload-DwZcAK8D.js} +2 -1
- package/dist/_chunks/{freemium-paywall-DZ2mBS3w.js → freemium-paywall-WYlNO7yT.js} +2 -2
- package/dist/_chunks/{gestational-age-calculator-BleUdhbI.js → gestational-age-calculator-CF2ISaYQ.js} +3 -3
- package/dist/_chunks/hash-CysBBS_N.js +17 -0
- package/dist/_chunks/{hcg-doubling-CnjDXX6U.js → hcg-doubling-C7bmuaU3.js} +2 -2
- package/dist/_chunks/{actions-cell-renderer-DrcaxB0w.js → link-cell-renderer-CTXqtXV-.js} +715 -592
- package/dist/_chunks/lock-CKOIn0IK.js +15 -0
- package/dist/_chunks/{marketplace-app-shell-6T9W4Knl.js → marketplace-app-shell-Skhfp6vK.js} +3 -3
- package/dist/_chunks/notes-panel-ay8_lPrA.js +158 -0
- package/dist/_chunks/{notification-card-BiESdm8q.js → notification-card-D2jiKSJJ.js} +27 -23
- package/dist/_chunks/{notification-tray-Btb9oQeZ.js → notification-tray-AEun6DN2.js} +2 -2
- package/dist/_chunks/{operator-hero-CP2Nhupm.js → operator-hero-CR0Rqh4-.js} +3 -3
- package/dist/_chunks/patient-details-Dlhqb5ig.js +675 -0
- package/dist/_chunks/{patient-search-CBC_ySF6.js → patient-search-Be6cLrHR.js} +2 -2
- package/dist/_chunks/patient-summary-card-WySCMwwA.js +437 -0
- package/dist/_chunks/patient-table-CHxf3Oqk.js +1110 -0
- package/dist/_chunks/{payment-form-DvjwYVIT.js → payment-form-CxqIXqw7.js} +2 -2
- package/dist/_chunks/{payment-request-card-DioWKBUq.js → payment-request-card-BcZJwu9z.js} +125 -136
- package/dist/_chunks/{pdf-viewer-D6BPfW2D.js → pdf-viewer-QfebdLOd.js} +192 -214
- package/dist/_chunks/{periodontal-chart-card-BuDEMbHE.js → periodontal-chart-card-hRRJY1NN.js} +2 -2
- package/dist/_chunks/{practice-results-KrTHqZua.js → practice-results-C6qDfxos.js} +3 -3
- package/dist/_chunks/{pregnancy-dating-DORUAOHB.js → pregnancy-dating-CRVWswD-.js} +3 -3
- package/dist/_chunks/{pregnancy-weight-gain-DVz4rr7-.js → pregnancy-weight-gain-BUNpTsH-.js} +2 -2
- package/dist/_chunks/radiograph-panel.agent-CAX-C3g3.js +558 -0
- package/dist/_chunks/{rich-text-editor-BsV7zUdg.js → rich-text-editor-DlCqPixb.js} +410 -394
- package/dist/_chunks/{sign-document-B4DeRhTe.js → sign-document-By6hMOra.js} +2 -2
- package/dist/_chunks/{stepper-accordion-Dki6r9ZE.js → stepper-accordion-DC-H-8v4.js} +38 -48
- package/dist/_chunks/tab-bar-Bv9nGNdO.js +262 -0
- package/dist/_chunks/tooth-scheme-BhQoPNBD.js +2131 -0
- package/dist/_chunks/{transaction-chip-DK84XCBU.js → transaction-chip-CscoQbxF.js} +88 -61
- package/dist/_chunks/use-clamp-overflow-DQE2kwZ9.js +20 -0
- package/dist/_chunks/use-overflow-collapse-BIOzKbni.js +32 -0
- package/dist/_chunks/use-persistent-state-nZwZAnE9.js +24 -0
- package/dist/_chunks/{warning-stack-BsgaEbL8.js → warning-stack--sTrrBDA.js} +86 -101
- package/dist/_chunks/{workflow-map-Bdam9pGp.js → workflow-map-Dy8mLCqF.js} +3 -3
- package/dist/_chunks/zoom-out-CgVtf2Wx.js +29 -0
- package/dist/agent/index.js +5 -4
- package/dist/agent/types.d.ts +19 -2
- package/dist/agent-catalog.json +1253 -86
- package/dist/agent-i18n/en.json +108 -6
- package/dist/components/_shared/entity-card/entity-card.d.ts +6 -0
- package/dist/components/_shared/entity-card/index.d.ts +1 -1
- package/dist/components/_shared/field-value.d.ts +21 -0
- package/dist/components/_shared/field-visibility-cog.d.ts +20 -0
- package/dist/components/_shared/field-visibility.d.ts +36 -0
- package/dist/components/_shared/patient-fields.d.ts +119 -0
- package/dist/components/agenda-card/index.js +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-consent-banner/index.js +1 -1
- package/dist/components/ai-tools-rail/ai-tools-rail.d.ts +75 -0
- package/dist/components/ai-tools-rail/index.js +1 -1
- package/dist/components/alert/alert.d.ts +5 -0
- package/dist/components/alert/index.js +1 -1
- package/dist/components/anamnesis-card/index.js +1 -1
- package/dist/components/anatomy-scheme/anatomy-face-paths.d.ts +15 -0
- package/dist/components/anatomy-scheme/anatomy-muscle-paths.d.ts +20 -0
- package/dist/components/anatomy-scheme/anatomy-scheme-data.d.ts +121 -0
- package/dist/components/anatomy-scheme/anatomy-scheme.agent.d.ts +6 -0
- package/dist/components/anatomy-scheme/anatomy-scheme.d.ts +69 -0
- package/dist/components/anatomy-scheme/index.d.ts +6 -0
- package/dist/components/anatomy-scheme/index.js +17 -0
- package/dist/components/annotation-marker/annotation-marker.d.ts +33 -0
- package/dist/components/annotation-marker/index.d.ts +3 -0
- package/dist/components/annotation-marker/index.js +7 -0
- package/dist/components/appointment-card/appointment-card.d.ts +25 -1
- package/dist/components/appointment-card/index.js +6 -5
- package/dist/components/appointment-timeline/appointment-timeline.agent.d.ts +4 -0
- package/dist/components/appointment-timeline/appointment-timeline.d.ts +66 -0
- package/dist/components/appointment-timeline/index.d.ts +4 -0
- package/dist/components/appointment-timeline/index.js +6 -0
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/badge/badge.d.ts +6 -2
- package/dist/components/badge/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/care-plan-header/care-plan-header.agent.d.ts +4 -0
- package/dist/components/care-plan-header/care-plan-header.d.ts +100 -0
- package/dist/components/care-plan-header/index.d.ts +4 -0
- package/dist/components/care-plan-header/index.js +6 -0
- package/dist/components/clinical-note-card/clinical-note-card.d.ts +21 -1
- package/dist/components/clinical-note-card/index.js +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/control-room-rail/control-room-context.d.ts +53 -0
- package/dist/components/control-room-rail/control-room-rail.d.ts +35 -0
- package/dist/components/control-room-rail/index.d.ts +5 -0
- package/dist/components/control-room-rail/index.js +9 -0
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/cell-renderers/actions-cell-renderer.d.ts +18 -0
- package/dist/components/data-table/index.d.ts +1 -1
- package/dist/components/data-table/index.js +32 -31
- package/dist/components/dependent-selector/index.js +1 -1
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/email-input/index.js +1 -1
- package/dist/components/entity-summary/entity-summary.d.ts +43 -0
- package/dist/components/entity-summary/index.d.ts +3 -0
- package/dist/components/entity-summary/index.js +5 -0
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/file-upload/index.js +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/index.d.ts +9 -0
- package/dist/components/notes-panel/index.d.ts +3 -0
- package/dist/components/notes-panel/index.js +5 -0
- package/dist/components/notes-panel/notes-panel.d.ts +64 -0
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/operator-hero/index.js +1 -1
- package/dist/components/patient-details/index.d.ts +5 -0
- package/dist/components/patient-details/index.js +6 -0
- package/dist/components/patient-details/patient-details.agent.d.ts +4 -0
- package/dist/components/patient-details/patient-details.d.ts +96 -0
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-summary-card/patient-summary-card.d.ts +40 -1
- package/dist/components/patient-table/columns.d.ts +69 -40
- package/dist/components/patient-table/index.d.ts +2 -6
- package/dist/components/patient-table/index.js +8 -9
- package/dist/components/patient-table/patient-table.d.ts +38 -4
- package/dist/components/patient-table/types.d.ts +52 -2
- package/dist/components/patient-table/use-responsive-columns.d.ts +8 -6
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/payment-form/index.js +1 -1
- package/dist/components/pdf-viewer/index.js +1 -1
- package/dist/components/periodontal-chart-card/index.js +1 -1
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/radiograph-panel/index.d.ts +4 -0
- package/dist/components/radiograph-panel/index.js +7 -0
- package/dist/components/radiograph-panel/radiograph-panel.agent.d.ts +13 -0
- package/dist/components/radiograph-panel/radiograph-panel.d.ts +36 -0
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/stepper-accordion/index.js +1 -1
- package/dist/components/tab-bar/index.js +1 -1
- package/dist/components/tab-bar/tab-bar.d.ts +18 -1
- package/dist/components/tooth-scheme/index.d.ts +2 -2
- package/dist/components/tooth-scheme/index.js +30 -23
- package/dist/components/tooth-scheme/tooth-data.d.ts +112 -1
- package/dist/components/tooth-scheme/tooth-scheme.agent.d.ts +2 -2
- package/dist/components/tooth-scheme/tooth-scheme.d.ts +75 -11
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/transaction-chip/transaction-chip.d.ts +2 -2
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/warning-stack/warning-stack.d.ts +10 -7
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +24 -22
- package/dist/hooks/use-clamp-overflow.d.ts +19 -0
- package/dist/hooks/use-overflow-collapse.d.ts +46 -0
- package/dist/hooks/use-persistent-state.d.ts +7 -1
- package/dist/hooks/use-scroll-overflow.d.ts +36 -0
- package/dist/i18n/locales/ar.d.ts +308 -24
- package/dist/i18n/locales/ar.js +322 -27
- package/dist/i18n/locales/de.d.ts +308 -24
- package/dist/i18n/locales/de.js +322 -27
- package/dist/i18n/locales/el.d.ts +308 -24
- package/dist/i18n/locales/el.js +322 -27
- package/dist/i18n/locales/en.d.ts +309 -32
- package/dist/i18n/locales/en.js +323 -35
- package/dist/i18n/locales/es.d.ts +308 -24
- package/dist/i18n/locales/es.js +322 -27
- package/dist/i18n/locales/fr.d.ts +308 -24
- package/dist/i18n/locales/fr.js +322 -27
- package/dist/i18n/locales/hi.d.ts +308 -24
- package/dist/i18n/locales/hi.js +322 -27
- package/dist/i18n/locales/it.d.ts +308 -24
- package/dist/i18n/locales/it.js +322 -27
- package/dist/i18n/locales/ja.d.ts +308 -24
- package/dist/i18n/locales/ja.js +322 -27
- package/dist/i18n/locales/nl.d.ts +308 -24
- package/dist/i18n/locales/nl.js +322 -27
- package/dist/i18n/locales/pl.d.ts +308 -24
- package/dist/i18n/locales/pl.js +322 -27
- package/dist/i18n/locales/pt.d.ts +308 -24
- package/dist/i18n/locales/pt.js +322 -27
- package/dist/i18n/locales/ro.d.ts +308 -24
- package/dist/i18n/locales/ro.js +322 -27
- package/dist/i18n/locales/ru.d.ts +308 -24
- package/dist/i18n/locales/ru.js +322 -27
- package/dist/i18n/locales/sq.d.ts +308 -24
- package/dist/i18n/locales/sq.js +322 -27
- package/dist/i18n/locales/sv.d.ts +308 -24
- package/dist/i18n/locales/sv.js +322 -27
- package/dist/i18n/locales/tr.d.ts +308 -24
- package/dist/i18n/locales/tr.js +322 -27
- package/dist/i18n/locales/zh.d.ts +308 -24
- package/dist/i18n/locales/zh.js +322 -27
- package/dist/index.js +672 -623
- package/dist/locales/ar.json +311 -27
- package/dist/locales/de.json +311 -27
- package/dist/locales/el.json +311 -27
- package/dist/locales/en.json +311 -27
- package/dist/locales/es.json +311 -27
- package/dist/locales/fr.json +311 -27
- package/dist/locales/hi.json +311 -27
- package/dist/locales/it.json +311 -27
- package/dist/locales/ja.json +311 -27
- package/dist/locales/nl.json +311 -27
- package/dist/locales/pl.json +311 -27
- package/dist/locales/pt.json +311 -27
- package/dist/locales/ro.json +311 -27
- package/dist/locales/ru.json +311 -27
- package/dist/locales/sq.json +311 -27
- package/dist/locales/sv.json +311 -27
- package/dist/locales/tr.json +311 -27
- package/dist/locales/zh.json +311 -27
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/tokens.css +1 -1
- package/package.json +37 -1
- package/dist/_chunks/ai-tools-rail-BA_sqy1A.js +0 -373
- package/dist/_chunks/appointment-tray-CZtvtaH-.js +0 -431
- package/dist/_chunks/clinical-note-card-DqQYf_D4.js +0 -333
- package/dist/_chunks/editable-currency-cell-renderer-kgqp_mIw.js +0 -448
- package/dist/_chunks/email-input-B_Y55f5G.js +0 -396
- package/dist/_chunks/patient-summary-card-B836_fDB.js +0 -435
- package/dist/_chunks/patient-table-CDuosVru.js +0 -889
- package/dist/_chunks/tab-bar-B1ovILzh.js +0 -105
- package/dist/_chunks/tooth-scheme-yBr53cvv.js +0 -1330
- package/dist/_chunks/use-persistent-state-i23OWy6G.js +0 -24
- package/dist/components/patient-table/cell-renderers/contact-cell.d.ts +0 -45
- package/dist/components/patient-table/cell-renderers/patient-identity-cell.d.ts +0 -26
|
@@ -1,42 +1,20 @@
|
|
|
1
|
-
import { jsx as a, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsx as a, jsxs as Z, Fragment as xe } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Ze, useId as Ke, useMemo as ze, useState as y, useEffect as T, useRef as E, useCallback as H, useImperativeHandle as Le } from "react";
|
|
3
3
|
import * as pe from "pdfjs-dist/legacy/build/pdf.min.mjs";
|
|
4
|
-
import { c as
|
|
4
|
+
import { c as $ } from "./index-D2ZczOXr.js";
|
|
5
5
|
import { useTranslation as me } from "react-i18next";
|
|
6
6
|
import * as re from "@radix-ui/react-popover";
|
|
7
7
|
import De from "pdfjs-dist/legacy/build/pdf.worker.min.mjs?url";
|
|
8
|
-
import { S as
|
|
9
|
-
import { A as
|
|
10
|
-
import { u as
|
|
11
|
-
import { X as
|
|
12
|
-
import { C as
|
|
13
|
-
import { C as
|
|
14
|
-
import {
|
|
15
|
-
import { S as
|
|
16
|
-
import { P as
|
|
17
|
-
|
|
18
|
-
* @license lucide-react v1.8.0 - ISC
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the ISC license.
|
|
21
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
22
|
-
*/
|
|
23
|
-
const $e = [
|
|
24
|
-
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
25
|
-
["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
|
|
26
|
-
["line", { x1: "11", x2: "11", y1: "8", y2: "14", key: "1vmskp" }],
|
|
27
|
-
["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
|
|
28
|
-
], Xe = Te("zoom-in", $e);
|
|
29
|
-
/**
|
|
30
|
-
* @license lucide-react v1.8.0 - ISC
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the ISC license.
|
|
33
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/
|
|
35
|
-
const Ge = [
|
|
36
|
-
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
37
|
-
["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65", key: "13gj7c" }],
|
|
38
|
-
["line", { x1: "8", x2: "14", y1: "11", y2: "11", key: "durymu" }]
|
|
39
|
-
], Ye = Te("zoom-out", Ge), et = {
|
|
8
|
+
import { S as _e } from "./spinner-hbwuKwMf.js";
|
|
9
|
+
import { A as ke } from "./alert-CHYZ96tR.js";
|
|
10
|
+
import { u as qe } from "./registry-DvAUVLHh.js";
|
|
11
|
+
import { X as Be } from "./x-CCcI3eJp.js";
|
|
12
|
+
import { C as He } from "./chevron-left-CX1jqD2M.js";
|
|
13
|
+
import { C as Qe } from "./chevron-right-BrpYejk0.js";
|
|
14
|
+
import { Z as We, a as Ue } from "./zoom-out-CgVtf2Wx.js";
|
|
15
|
+
import { S as Je } from "./search-BonnQsHv.js";
|
|
16
|
+
import { P as Xe } from "./printer-CeVEWfQq.js";
|
|
17
|
+
const $e = {
|
|
40
18
|
id: "pdf-viewer",
|
|
41
19
|
// `paginate` (go_to_page), `set_value` (zoom preset — ephemeral view state),
|
|
42
20
|
// `filter` (in-document search/highlight). Zoom maps to `set_value` rather
|
|
@@ -131,7 +109,7 @@ const Ge = [
|
|
|
131
109
|
}
|
|
132
110
|
};
|
|
133
111
|
pe.GlobalWorkerOptions.workerSrc = De;
|
|
134
|
-
const Pe =
|
|
112
|
+
const Pe = $(
|
|
135
113
|
[
|
|
136
114
|
"ds:pdf-viewer-alfadocs ds:flex ds:flex-col",
|
|
137
115
|
// Allow the viewer to shrink below its content's intrinsic width when it
|
|
@@ -148,7 +126,7 @@ const Pe = X(
|
|
|
148
126
|
"ds:focus-visible:outline-[var(--ring)]",
|
|
149
127
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
150
128
|
].join(" ")
|
|
151
|
-
),
|
|
129
|
+
), Ge = $(
|
|
152
130
|
[
|
|
153
131
|
"ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]",
|
|
154
132
|
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
|
|
@@ -156,7 +134,7 @@ const Pe = X(
|
|
|
156
134
|
"ds:bg-[var(--background)]",
|
|
157
135
|
"ds:border-b ds:border-[color:var(--border)]"
|
|
158
136
|
].join(" ")
|
|
159
|
-
), Se =
|
|
137
|
+
), Se = $(
|
|
160
138
|
[
|
|
161
139
|
"ds:inline-flex ds:items-center ds:justify-center",
|
|
162
140
|
"ds:[min-block-size:var(--min-target-size)]",
|
|
@@ -173,7 +151,7 @@ const Pe = X(
|
|
|
173
151
|
"ds:forced-colors:focus-visible:outline-[CanvasText]",
|
|
174
152
|
"ds:aria-disabled:opacity-[var(--opacity-50)] ds:aria-disabled:cursor-not-allowed"
|
|
175
153
|
].join(" ")
|
|
176
|
-
), Me =
|
|
154
|
+
), Me = $(
|
|
177
155
|
[
|
|
178
156
|
"ds:[min-block-size:var(--min-target-size)]",
|
|
179
157
|
"ds:inline-size-[4rem] ds:text-center",
|
|
@@ -185,7 +163,7 @@ const Pe = X(
|
|
|
185
163
|
"ds:focus-visible:outline-[var(--ring)]",
|
|
186
164
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
187
165
|
].join(" ")
|
|
188
|
-
),
|
|
166
|
+
), Ye = $(
|
|
189
167
|
[
|
|
190
168
|
"ds:[min-block-size:var(--min-target-size)]",
|
|
191
169
|
"ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]",
|
|
@@ -196,7 +174,7 @@ const Pe = X(
|
|
|
196
174
|
"ds:focus-visible:outline-[var(--ring)]",
|
|
197
175
|
"ds:forced-colors:focus-visible:outline-[CanvasText]"
|
|
198
176
|
].join(" ")
|
|
199
|
-
),
|
|
177
|
+
), et = $(
|
|
200
178
|
[
|
|
201
179
|
"ds:relative ds:flex ds:flex-col ds:items-center",
|
|
202
180
|
"ds:gap-[var(--spacing-md)]",
|
|
@@ -217,14 +195,14 @@ const Pe = X(
|
|
|
217
195
|
"ds:min-h-[30rem]",
|
|
218
196
|
"ds:max-h-[80vh]"
|
|
219
197
|
].join(" ")
|
|
220
|
-
),
|
|
198
|
+
), tt = $(
|
|
221
199
|
[
|
|
222
200
|
"ds:relative ds:flex ds:items-center ds:justify-center",
|
|
223
201
|
"ds:bg-[var(--background)]",
|
|
224
202
|
"ds:shadow-[var(--shadow-md)]",
|
|
225
203
|
"ds:rounded-[var(--radius-sm)]"
|
|
226
204
|
].join(" ")
|
|
227
|
-
),
|
|
205
|
+
), rt = [
|
|
228
206
|
"fit-width",
|
|
229
207
|
"fit-page",
|
|
230
208
|
"actual-size",
|
|
@@ -238,13 +216,13 @@ const Pe = X(
|
|
|
238
216
|
function Y(o) {
|
|
239
217
|
return typeof o == "number";
|
|
240
218
|
}
|
|
241
|
-
function
|
|
219
|
+
function Ce(o, t, v) {
|
|
242
220
|
if (Y(o)) return o;
|
|
243
221
|
if (o === "actual-size" || !v) return 1;
|
|
244
|
-
const m = window.getComputedStyle(v), g = parseFloat(m.paddingInlineStart || "0") + parseFloat(m.paddingInlineEnd || "0"), h = parseFloat(m.paddingBlockStart || "0") + parseFloat(m.paddingBlockEnd || "0"),
|
|
245
|
-
return o === "fit-width" ?
|
|
222
|
+
const m = window.getComputedStyle(v), g = parseFloat(m.paddingInlineStart || "0") + parseFloat(m.paddingInlineEnd || "0"), h = parseFloat(m.paddingBlockStart || "0") + parseFloat(m.paddingBlockEnd || "0"), w = Math.max(v.clientWidth - g, 1), x = Math.max(v.clientHeight - h, 1), z = t.width, k = t.height;
|
|
223
|
+
return o === "fit-width" ? w / z : Math.min(w / z, x / k);
|
|
246
224
|
}
|
|
247
|
-
const
|
|
225
|
+
const nt = Ze(
|
|
248
226
|
({
|
|
249
227
|
id: o,
|
|
250
228
|
src: t,
|
|
@@ -252,34 +230,34 @@ const ot = Le(
|
|
|
252
230
|
initialZoom: m = "fit-width",
|
|
253
231
|
pageRotation: g,
|
|
254
232
|
renderPageOverlay: h,
|
|
255
|
-
onPageChange:
|
|
256
|
-
onLoadComplete:
|
|
257
|
-
onError:
|
|
258
|
-
toolbar:
|
|
259
|
-
toolbarVariant:
|
|
233
|
+
onPageChange: w,
|
|
234
|
+
onLoadComplete: x,
|
|
235
|
+
onError: z,
|
|
236
|
+
toolbar: k = !0,
|
|
237
|
+
toolbarVariant: K = "full",
|
|
260
238
|
ariaLabel: P,
|
|
261
239
|
className: S
|
|
262
240
|
}, b) => {
|
|
263
|
-
const { t: l } = me(), M =
|
|
241
|
+
const { t: l } = me(), M = Ke(), C = ze(
|
|
264
242
|
() => `pdf-${M.replace(/[^a-zA-Z0-9-_]/g, "")}`,
|
|
265
243
|
[M]
|
|
266
|
-
), [A, p] = y(!1), [
|
|
244
|
+
), [A, p] = y(!1), [_, Q] = y(!1);
|
|
267
245
|
T(() => {
|
|
268
246
|
if (typeof document > "u") return;
|
|
269
247
|
p(document.documentElement.dir === "rtl");
|
|
270
248
|
const e = window.matchMedia("(prefers-reduced-motion: reduce)"), r = () => Q(e.matches);
|
|
271
249
|
return r(), e.addEventListener("change", r), () => e.removeEventListener("change", r);
|
|
272
250
|
}, []);
|
|
273
|
-
const [s, W] = y(null), [i,
|
|
251
|
+
const [s, W] = y(null), [i, I] = y(null), [u, O] = y(v), [N, D] = y(m), [L, q] = y({ start: Math.max(1, v - 1), end: v + 1 }), [U, R] = y(""), [n, f] = y(!1), [ee, ge] = y(""), [Te, Oe] = y({ current: 0, total: 0 }), ne = E(w), ae = E(x), se = E(z);
|
|
274
252
|
T(() => {
|
|
275
|
-
ne.current =
|
|
276
|
-
}, [
|
|
253
|
+
ne.current = w, ae.current = x, se.current = z;
|
|
254
|
+
}, [w, x, z]);
|
|
277
255
|
const ce = E(null);
|
|
278
256
|
T(() => {
|
|
279
257
|
ce.current = s;
|
|
280
258
|
}, [s]), T(() => {
|
|
281
259
|
let e = !1;
|
|
282
|
-
W(null),
|
|
260
|
+
W(null), I(null);
|
|
283
261
|
const r = {
|
|
284
262
|
disableJavaScript: !0,
|
|
285
263
|
isEvalSupported: !1
|
|
@@ -290,12 +268,12 @@ const ot = Le(
|
|
|
290
268
|
async (d) => {
|
|
291
269
|
var J;
|
|
292
270
|
if (e) return;
|
|
293
|
-
let
|
|
271
|
+
let V;
|
|
294
272
|
try {
|
|
295
|
-
const
|
|
296
|
-
|
|
273
|
+
const X = await d.getMetadata(), F = X == null ? void 0 : X.info;
|
|
274
|
+
V = F == null ? void 0 : F.Title;
|
|
297
275
|
} catch {
|
|
298
|
-
|
|
276
|
+
V = void 0;
|
|
299
277
|
}
|
|
300
278
|
if (e) {
|
|
301
279
|
try {
|
|
@@ -304,14 +282,14 @@ const ot = Le(
|
|
|
304
282
|
}
|
|
305
283
|
return;
|
|
306
284
|
}
|
|
307
|
-
const B = { doc: d, numPages: d.numPages, title:
|
|
308
|
-
W(B), (J = ae.current) == null || J.call(ae, { numPages: d.numPages, title:
|
|
285
|
+
const B = { doc: d, numPages: d.numPages, title: V };
|
|
286
|
+
W(B), (J = ae.current) == null || J.call(ae, { numPages: d.numPages, title: V });
|
|
309
287
|
},
|
|
310
288
|
(d) => {
|
|
311
289
|
var B;
|
|
312
290
|
if (e) return;
|
|
313
|
-
const
|
|
314
|
-
|
|
291
|
+
const V = d instanceof Error ? d : new Error(String(d));
|
|
292
|
+
I(V), (B = se.current) == null || B.call(se, V);
|
|
315
293
|
}
|
|
316
294
|
), () => {
|
|
317
295
|
e = !0, c.destroy();
|
|
@@ -330,7 +308,7 @@ const ot = Le(
|
|
|
330
308
|
l("pdf.pageOf", { current: u, total: s.numPages })
|
|
331
309
|
), (e = ne.current) == null || e.call(ne, u));
|
|
332
310
|
}, [u, s, l]);
|
|
333
|
-
const oe = E(null), le = E([]),
|
|
311
|
+
const oe = E(null), le = E([]), j = H(
|
|
334
312
|
(e) => {
|
|
335
313
|
if (!s) return;
|
|
336
314
|
const r = Math.max(1, Math.min(e, s.numPages));
|
|
@@ -341,41 +319,41 @@ const ot = Le(
|
|
|
341
319
|
block: "start"
|
|
342
320
|
});
|
|
343
321
|
},
|
|
344
|
-
[s,
|
|
322
|
+
[s, _]
|
|
345
323
|
), he = H((e) => {
|
|
346
324
|
D(e);
|
|
347
325
|
}, []), te = H(() => {
|
|
348
326
|
typeof window < "u" && window.print();
|
|
349
327
|
}, []), ve = H((e) => {
|
|
350
328
|
ge(e), f(e.length > 0);
|
|
351
|
-
}, []), ue =
|
|
329
|
+
}, []), ue = ze(
|
|
352
330
|
() => ({
|
|
353
|
-
goToPage:
|
|
331
|
+
goToPage: j,
|
|
354
332
|
setZoom: he,
|
|
355
333
|
search: ve,
|
|
356
334
|
print: te
|
|
357
335
|
}),
|
|
358
|
-
[
|
|
336
|
+
[j, he, ve, te]
|
|
359
337
|
);
|
|
360
|
-
|
|
361
|
-
const
|
|
338
|
+
Le(b, () => ue, [ue]), qe($e, ue, o);
|
|
339
|
+
const Re = H(
|
|
362
340
|
(e) => {
|
|
363
341
|
if (!s) return;
|
|
364
342
|
const r = e.metaKey || e.ctrlKey;
|
|
365
343
|
if (e.key === "PageDown") {
|
|
366
|
-
e.preventDefault(),
|
|
344
|
+
e.preventDefault(), j(u + 1);
|
|
367
345
|
return;
|
|
368
346
|
}
|
|
369
347
|
if (e.key === "PageUp") {
|
|
370
|
-
e.preventDefault(),
|
|
348
|
+
e.preventDefault(), j(u - 1);
|
|
371
349
|
return;
|
|
372
350
|
}
|
|
373
351
|
if (e.key === "Home") {
|
|
374
|
-
e.preventDefault(),
|
|
352
|
+
e.preventDefault(), j(1);
|
|
375
353
|
return;
|
|
376
354
|
}
|
|
377
355
|
if (e.key === "End") {
|
|
378
|
-
e.preventDefault(),
|
|
356
|
+
e.preventDefault(), j(s.numPages);
|
|
379
357
|
return;
|
|
380
358
|
}
|
|
381
359
|
if (r && e.key.toLowerCase() === "f") {
|
|
@@ -398,7 +376,7 @@ const ot = Le(
|
|
|
398
376
|
}
|
|
399
377
|
r && e.key.toLowerCase() === "p" && (e.preventDefault(), te());
|
|
400
378
|
},
|
|
401
|
-
[u,
|
|
379
|
+
[u, j, te, s]
|
|
402
380
|
), fe = E(u);
|
|
403
381
|
T(() => {
|
|
404
382
|
fe.current = u;
|
|
@@ -411,15 +389,15 @@ const ot = Le(
|
|
|
411
389
|
for (const F of d) {
|
|
412
390
|
const G = F.target.dataset.pageNumber;
|
|
413
391
|
if (!G) continue;
|
|
414
|
-
const
|
|
415
|
-
r.set(
|
|
392
|
+
const Ee = Number(G);
|
|
393
|
+
r.set(Ee, F.intersectionRatio);
|
|
416
394
|
}
|
|
417
|
-
let
|
|
395
|
+
let V = fe.current, B = 0, J = 1 / 0, X = -1 / 0;
|
|
418
396
|
for (const [F, G] of r.entries())
|
|
419
|
-
G > B && (
|
|
420
|
-
B > 0 &&
|
|
397
|
+
G > B && (V = F, B = G), G > 0 && (J = Math.min(J, F), X = Math.max(X, F));
|
|
398
|
+
B > 0 && V !== fe.current && O(V), J !== 1 / 0 && q({
|
|
421
399
|
start: Math.max(1, J - 1),
|
|
422
|
-
end: Math.min(s.numPages,
|
|
400
|
+
end: Math.min(s.numPages, X + 1)
|
|
423
401
|
});
|
|
424
402
|
},
|
|
425
403
|
{ root: e, threshold: [0, 0.25, 0.5, 0.75, 1] }
|
|
@@ -428,37 +406,37 @@ const ot = Le(
|
|
|
428
406
|
d && c.observe(d);
|
|
429
407
|
}), () => c.disconnect();
|
|
430
408
|
}, [s]);
|
|
431
|
-
const [
|
|
409
|
+
const [Ae, Ve] = y(0);
|
|
432
410
|
T(() => {
|
|
433
411
|
const e = oe.current;
|
|
434
412
|
if (!e || typeof ResizeObserver > "u") return;
|
|
435
413
|
const r = new ResizeObserver(() => {
|
|
436
|
-
(
|
|
414
|
+
(N === "fit-width" || N === "fit-page") && Ve((c) => c + 1);
|
|
437
415
|
});
|
|
438
416
|
return r.observe(e), () => r.disconnect();
|
|
439
|
-
}, [
|
|
440
|
-
const be = E([]), [ie, ye] = y(0),
|
|
417
|
+
}, [N]);
|
|
418
|
+
const be = E([]), [ie, ye] = y(0), je = H(
|
|
441
419
|
(e) => (r) => {
|
|
442
420
|
be.current[e] = r;
|
|
443
421
|
},
|
|
444
422
|
[]
|
|
445
|
-
),
|
|
423
|
+
), we = H((e) => {
|
|
446
424
|
const r = be.current[e];
|
|
447
425
|
r && r.focus();
|
|
448
|
-
}, []), de =
|
|
426
|
+
}, []), de = K === "minimal" ? 2 : 8, Fe = H(
|
|
449
427
|
(e) => {
|
|
450
428
|
const r = A ? "ArrowLeft" : "ArrowRight", c = A ? "ArrowRight" : "ArrowLeft";
|
|
451
429
|
let d = null;
|
|
452
|
-
e.key === r ? d = (ie + 1) % de : e.key === c ? d = (ie - 1 + de) % de : e.key === "Home" ? d = 0 : e.key === "End" && (d = de - 1), d !== null && (e.preventDefault(), ye(d),
|
|
430
|
+
e.key === r ? d = (ie + 1) % de : e.key === c ? d = (ie - 1 + de) % de : e.key === "Home" ? d = 0 : e.key === "End" && (d = de - 1), d !== null && (e.preventDefault(), ye(d), we(d));
|
|
453
431
|
},
|
|
454
|
-
[
|
|
432
|
+
[we, A, ie]
|
|
455
433
|
);
|
|
456
434
|
return i ? /* @__PURE__ */ a(
|
|
457
435
|
"div",
|
|
458
436
|
{
|
|
459
437
|
className: [Pe(), S].filter(Boolean).join(" "),
|
|
460
438
|
"aria-label": P ?? l("pdf.error"),
|
|
461
|
-
children: /* @__PURE__ */ a("div", { className: "ds:p-[var(--spacing-lg)]", children: /* @__PURE__ */ a(
|
|
439
|
+
children: /* @__PURE__ */ a("div", { className: "ds:p-[var(--spacing-lg)]", children: /* @__PURE__ */ a(ke, { variant: "error", live: "polite", children: /* @__PURE__ */ Z(ke.Description, { children: [
|
|
462
440
|
l("pdf.error"),
|
|
463
441
|
": ",
|
|
464
442
|
i.message
|
|
@@ -466,30 +444,30 @@ const ot = Le(
|
|
|
466
444
|
}
|
|
467
445
|
) : (
|
|
468
446
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions -- region-level keyboard shortcuts (search, zoom) intentionally captured at the wrapper for the entire PDF viewer
|
|
469
|
-
/* @__PURE__ */
|
|
447
|
+
/* @__PURE__ */ Z(
|
|
470
448
|
"div",
|
|
471
449
|
{
|
|
472
|
-
id:
|
|
450
|
+
id: C,
|
|
473
451
|
role: "region",
|
|
474
452
|
"aria-label": P ?? l("pdf.toolbarLabel"),
|
|
475
453
|
className: [Pe(), S].filter(Boolean).join(" "),
|
|
476
454
|
dir: A ? "rtl" : void 0,
|
|
477
|
-
onKeyDown:
|
|
455
|
+
onKeyDown: Re,
|
|
478
456
|
tabIndex: -1,
|
|
479
457
|
"data-component": "pdf-viewer",
|
|
480
458
|
"data-component-id": o,
|
|
481
459
|
"data-pdfjs-worker-src": De,
|
|
482
460
|
children: [
|
|
483
|
-
|
|
484
|
-
|
|
461
|
+
k ? /* @__PURE__ */ a(
|
|
462
|
+
at,
|
|
485
463
|
{
|
|
486
|
-
variant:
|
|
464
|
+
variant: K,
|
|
487
465
|
currentPage: u,
|
|
488
466
|
numPages: (s == null ? void 0 : s.numPages) ?? 0,
|
|
489
|
-
zoom:
|
|
490
|
-
onPrev: () =>
|
|
491
|
-
onNext: () =>
|
|
492
|
-
onJump: (e) =>
|
|
467
|
+
zoom: N,
|
|
468
|
+
onPrev: () => j(u - 1),
|
|
469
|
+
onNext: () => j(u + 1),
|
|
470
|
+
onJump: (e) => j(e),
|
|
493
471
|
onZoomIn: () => {
|
|
494
472
|
D(
|
|
495
473
|
(e) => Y(e) ? Math.min(e * 1.25, 4) : 1.25
|
|
@@ -509,11 +487,11 @@ const ot = Le(
|
|
|
509
487
|
onSearchQueryChange: (e) => {
|
|
510
488
|
ge(e);
|
|
511
489
|
},
|
|
512
|
-
searchMatches:
|
|
513
|
-
register:
|
|
490
|
+
searchMatches: Te,
|
|
491
|
+
register: je,
|
|
514
492
|
focusIndex: ie,
|
|
515
493
|
setFocusIndex: ye,
|
|
516
|
-
onToolbarKeyDown:
|
|
494
|
+
onToolbarKeyDown: Fe,
|
|
517
495
|
isRtl: A
|
|
518
496
|
}
|
|
519
497
|
) : null,
|
|
@@ -522,29 +500,29 @@ const ot = Le(
|
|
|
522
500
|
"div",
|
|
523
501
|
{
|
|
524
502
|
ref: oe,
|
|
525
|
-
className:
|
|
503
|
+
className: et(),
|
|
526
504
|
"data-testid": "pdf-pages-container",
|
|
527
505
|
tabIndex: 0,
|
|
528
506
|
"aria-label": l("pdf.pagesRegionLabel"),
|
|
529
507
|
children: s ? Array.from({ length: s.numPages }, (e, r) => r + 1).map(
|
|
530
508
|
(e) => /* @__PURE__ */ a(
|
|
531
|
-
|
|
509
|
+
st,
|
|
532
510
|
{
|
|
533
511
|
pageNumber: e,
|
|
534
512
|
totalPages: s.numPages,
|
|
535
513
|
doc: s.doc,
|
|
536
|
-
zoom:
|
|
514
|
+
zoom: N,
|
|
537
515
|
pageRotation: g,
|
|
538
516
|
renderPageOverlay: h,
|
|
539
517
|
container: oe.current,
|
|
540
|
-
resizeTick:
|
|
541
|
-
shouldRender: e >=
|
|
518
|
+
resizeTick: Ae,
|
|
519
|
+
shouldRender: e >= L.start && e <= L.end,
|
|
542
520
|
registerRef: (r) => {
|
|
543
521
|
le.current[e - 1] = r;
|
|
544
522
|
},
|
|
545
523
|
searchQuery: ee,
|
|
546
524
|
onMatchCount: (r) => {
|
|
547
|
-
|
|
525
|
+
Oe((c) => r === 0 && c.total === 0 ? c : {
|
|
548
526
|
current: Math.min(c.current || 1, r || 1),
|
|
549
527
|
total: Math.max(c.total, r)
|
|
550
528
|
});
|
|
@@ -552,8 +530,8 @@ const ot = Le(
|
|
|
552
530
|
},
|
|
553
531
|
e
|
|
554
532
|
)
|
|
555
|
-
) : /* @__PURE__ */
|
|
556
|
-
/* @__PURE__ */ a(
|
|
533
|
+
) : /* @__PURE__ */ Z("div", { className: "ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)] ds:text-[var(--muted-foreground)] ds:p-[var(--spacing-lg)]", children: [
|
|
534
|
+
/* @__PURE__ */ a(_e, { variant: "pulse", size: "sm", label: l("pdf.loading") }),
|
|
557
535
|
/* @__PURE__ */ a("span", { children: l("pdf.loading") })
|
|
558
536
|
] })
|
|
559
537
|
}
|
|
@@ -564,45 +542,45 @@ const ot = Le(
|
|
|
564
542
|
);
|
|
565
543
|
}
|
|
566
544
|
);
|
|
567
|
-
|
|
568
|
-
function
|
|
545
|
+
nt.displayName = "PDFViewer";
|
|
546
|
+
function at(o) {
|
|
569
547
|
const { t } = me(), {
|
|
570
548
|
variant: v,
|
|
571
549
|
currentPage: m,
|
|
572
550
|
numPages: g,
|
|
573
551
|
zoom: h,
|
|
574
|
-
onPrev:
|
|
575
|
-
onNext:
|
|
576
|
-
onJump:
|
|
577
|
-
onZoomIn:
|
|
578
|
-
onZoomOut:
|
|
552
|
+
onPrev: w,
|
|
553
|
+
onNext: x,
|
|
554
|
+
onJump: z,
|
|
555
|
+
onZoomIn: k,
|
|
556
|
+
onZoomOut: K,
|
|
579
557
|
onZoomPreset: P,
|
|
580
558
|
onOpenSearch: S,
|
|
581
559
|
onPrint: b,
|
|
582
560
|
searchOpen: l,
|
|
583
561
|
onSearchOpenChange: M,
|
|
584
|
-
searchQuery:
|
|
562
|
+
searchQuery: C,
|
|
585
563
|
onSearchQueryChange: A,
|
|
586
564
|
searchMatches: p,
|
|
587
|
-
register:
|
|
565
|
+
register: _,
|
|
588
566
|
focusIndex: Q,
|
|
589
567
|
setFocusIndex: s,
|
|
590
568
|
onToolbarKeyDown: W
|
|
591
|
-
} = o, i = v === "minimal",
|
|
569
|
+
} = o, i = v === "minimal", I = i ? 0 : 3, u = i ? 1 : 4, O = 5, [N, D] = y(String(m));
|
|
592
570
|
T(() => {
|
|
593
571
|
D(String(m));
|
|
594
572
|
}, [m]);
|
|
595
|
-
const
|
|
573
|
+
const L = m <= 1, q = m >= g;
|
|
596
574
|
function U() {
|
|
597
|
-
const n = Number(
|
|
598
|
-
Number.isFinite(n) && n >= 1 ?
|
|
575
|
+
const n = Number(N);
|
|
576
|
+
Number.isFinite(n) && n >= 1 ? z(Math.min(n, g)) : D(String(m));
|
|
599
577
|
}
|
|
600
578
|
function R(n) {
|
|
601
579
|
return /* @__PURE__ */ a(
|
|
602
580
|
"button",
|
|
603
581
|
{
|
|
604
582
|
type: "button",
|
|
605
|
-
ref:
|
|
583
|
+
ref: _(n.index),
|
|
606
584
|
tabIndex: n.index === Q ? 0 : -1,
|
|
607
585
|
onFocus: () => s(n.index),
|
|
608
586
|
onKeyDown: W,
|
|
@@ -621,21 +599,21 @@ function it(o) {
|
|
|
621
599
|
}
|
|
622
600
|
);
|
|
623
601
|
}
|
|
624
|
-
return /* @__PURE__ */
|
|
602
|
+
return /* @__PURE__ */ Z(
|
|
625
603
|
"div",
|
|
626
604
|
{
|
|
627
605
|
role: "toolbar",
|
|
628
606
|
"aria-label": t("pdf.toolbarLabel"),
|
|
629
|
-
className:
|
|
607
|
+
className: Ge(),
|
|
630
608
|
children: [
|
|
631
|
-
!i && /* @__PURE__ */
|
|
609
|
+
!i && /* @__PURE__ */ Z(xe, { children: [
|
|
632
610
|
R({
|
|
633
611
|
index: 0,
|
|
634
612
|
label: t("pdf.previousPage"),
|
|
635
|
-
disabled:
|
|
636
|
-
onActivate:
|
|
613
|
+
disabled: L,
|
|
614
|
+
onActivate: w,
|
|
637
615
|
icon: /* @__PURE__ */ a(
|
|
638
|
-
|
|
616
|
+
He,
|
|
639
617
|
{
|
|
640
618
|
"aria-hidden": "true",
|
|
641
619
|
className: "ds:block-size-4 ds:inline-size-4 ds:rtl:rotate-180"
|
|
@@ -646,9 +624,9 @@ function it(o) {
|
|
|
646
624
|
index: 1,
|
|
647
625
|
label: t("pdf.nextPage"),
|
|
648
626
|
disabled: q,
|
|
649
|
-
onActivate:
|
|
627
|
+
onActivate: x,
|
|
650
628
|
icon: /* @__PURE__ */ a(
|
|
651
|
-
|
|
629
|
+
Qe,
|
|
652
630
|
{
|
|
653
631
|
"aria-hidden": "true",
|
|
654
632
|
className: "ds:block-size-4 ds:inline-size-4 ds:rtl:rotate-180"
|
|
@@ -661,14 +639,14 @@ function it(o) {
|
|
|
661
639
|
type: "number",
|
|
662
640
|
min: 1,
|
|
663
641
|
max: Math.max(g, 1),
|
|
664
|
-
value:
|
|
642
|
+
value: N,
|
|
665
643
|
onChange: (n) => D(n.target.value),
|
|
666
644
|
onKeyDown: (n) => {
|
|
667
645
|
n.key === "Enter" && (n.preventDefault(), U());
|
|
668
646
|
},
|
|
669
647
|
onBlur: U,
|
|
670
648
|
onFocus: () => s(2),
|
|
671
|
-
ref:
|
|
649
|
+
ref: _(2),
|
|
672
650
|
tabIndex: Q === 2 ? 0 : -1,
|
|
673
651
|
"aria-label": t("pdf.currentPageInput"),
|
|
674
652
|
className: Me()
|
|
@@ -691,11 +669,11 @@ function it(o) {
|
|
|
691
669
|
)
|
|
692
670
|
] }),
|
|
693
671
|
R({
|
|
694
|
-
index:
|
|
672
|
+
index: I,
|
|
695
673
|
label: t("pdf.zoom.out"),
|
|
696
|
-
onActivate:
|
|
674
|
+
onActivate: K,
|
|
697
675
|
icon: /* @__PURE__ */ a(
|
|
698
|
-
|
|
676
|
+
We,
|
|
699
677
|
{
|
|
700
678
|
"aria-hidden": "true",
|
|
701
679
|
className: "ds:block-size-4 ds:inline-size-4"
|
|
@@ -705,16 +683,16 @@ function it(o) {
|
|
|
705
683
|
R({
|
|
706
684
|
index: u,
|
|
707
685
|
label: t("pdf.zoom.in"),
|
|
708
|
-
onActivate:
|
|
686
|
+
onActivate: k,
|
|
709
687
|
icon: /* @__PURE__ */ a(
|
|
710
|
-
|
|
688
|
+
Ue,
|
|
711
689
|
{
|
|
712
690
|
"aria-hidden": "true",
|
|
713
691
|
className: "ds:block-size-4 ds:inline-size-4"
|
|
714
692
|
}
|
|
715
693
|
)
|
|
716
694
|
}),
|
|
717
|
-
!i && /* @__PURE__ */
|
|
695
|
+
!i && /* @__PURE__ */ Z(
|
|
718
696
|
"select",
|
|
719
697
|
{
|
|
720
698
|
"aria-label": t("pdf.zoom.preset"),
|
|
@@ -728,21 +706,21 @@ function it(o) {
|
|
|
728
706
|
Number.isFinite(ee) && P(ee);
|
|
729
707
|
}
|
|
730
708
|
},
|
|
731
|
-
ref:
|
|
709
|
+
ref: _(O),
|
|
732
710
|
tabIndex: Q === O ? 0 : -1,
|
|
733
711
|
onFocus: () => s(O),
|
|
734
712
|
onKeyDown: W,
|
|
735
|
-
className:
|
|
713
|
+
className: Ye(),
|
|
736
714
|
children: [
|
|
737
715
|
/* @__PURE__ */ a("option", { value: "fit-width", children: t("pdf.zoom.fitWidth") }),
|
|
738
716
|
/* @__PURE__ */ a("option", { value: "fit-page", children: t("pdf.zoom.fitPage") }),
|
|
739
717
|
/* @__PURE__ */ a("option", { value: "actual-size", children: t("pdf.zoom.actualSize") }),
|
|
740
|
-
|
|
718
|
+
rt.filter(Y).map((n) => /* @__PURE__ */ a("option", { value: String(n), children: `${Math.round(n * 100)}%` }, n))
|
|
741
719
|
]
|
|
742
720
|
}
|
|
743
721
|
),
|
|
744
|
-
!i && /* @__PURE__ */
|
|
745
|
-
/* @__PURE__ */
|
|
722
|
+
!i && /* @__PURE__ */ Z(xe, { children: [
|
|
723
|
+
/* @__PURE__ */ Z(
|
|
746
724
|
re.Root,
|
|
747
725
|
{
|
|
748
726
|
open: l,
|
|
@@ -753,14 +731,14 @@ function it(o) {
|
|
|
753
731
|
label: t("pdf.search.open"),
|
|
754
732
|
onActivate: S,
|
|
755
733
|
icon: /* @__PURE__ */ a(
|
|
756
|
-
|
|
734
|
+
Je,
|
|
757
735
|
{
|
|
758
736
|
"aria-hidden": "true",
|
|
759
737
|
className: "ds:block-size-4 ds:inline-size-4"
|
|
760
738
|
}
|
|
761
739
|
)
|
|
762
740
|
}) }),
|
|
763
|
-
/* @__PURE__ */ a(re.Portal, { children: /* @__PURE__ */
|
|
741
|
+
/* @__PURE__ */ a(re.Portal, { children: /* @__PURE__ */ Z(
|
|
764
742
|
re.Content,
|
|
765
743
|
{
|
|
766
744
|
sideOffset: 8,
|
|
@@ -778,7 +756,7 @@ function it(o) {
|
|
|
778
756
|
{
|
|
779
757
|
type: "search",
|
|
780
758
|
autoFocus: !0,
|
|
781
|
-
value:
|
|
759
|
+
value: C,
|
|
782
760
|
onChange: (n) => A(n.target.value),
|
|
783
761
|
placeholder: t("pdf.search.placeholder"),
|
|
784
762
|
"aria-label": t("pdf.search.placeholder"),
|
|
@@ -795,7 +773,7 @@ function it(o) {
|
|
|
795
773
|
children: p.total > 0 ? t("pdf.search.countOfTotal", {
|
|
796
774
|
current: p.current,
|
|
797
775
|
total: p.total
|
|
798
|
-
}) :
|
|
776
|
+
}) : C ? t("pdf.search.noResults") : ""
|
|
799
777
|
}
|
|
800
778
|
),
|
|
801
779
|
/* @__PURE__ */ a(re.Close, { asChild: !0, children: /* @__PURE__ */ a(
|
|
@@ -805,7 +783,7 @@ function it(o) {
|
|
|
805
783
|
"aria-label": t("pdf.search.close"),
|
|
806
784
|
className: Se(),
|
|
807
785
|
children: /* @__PURE__ */ a(
|
|
808
|
-
|
|
786
|
+
Be,
|
|
809
787
|
{
|
|
810
788
|
"aria-hidden": "true",
|
|
811
789
|
className: "ds:block-size-4 ds:inline-size-4"
|
|
@@ -824,7 +802,7 @@ function it(o) {
|
|
|
824
802
|
label: t("pdf.print"),
|
|
825
803
|
onActivate: b,
|
|
826
804
|
icon: /* @__PURE__ */ a(
|
|
827
|
-
|
|
805
|
+
Xe,
|
|
828
806
|
{
|
|
829
807
|
"aria-hidden": "true",
|
|
830
808
|
className: "ds:block-size-4 ds:inline-size-4"
|
|
@@ -836,67 +814,67 @@ function it(o) {
|
|
|
836
814
|
}
|
|
837
815
|
);
|
|
838
816
|
}
|
|
839
|
-
function
|
|
817
|
+
function st(o) {
|
|
840
818
|
const {
|
|
841
819
|
pageNumber: t,
|
|
842
820
|
totalPages: v,
|
|
843
821
|
doc: m,
|
|
844
822
|
zoom: g,
|
|
845
823
|
pageRotation: h,
|
|
846
|
-
renderPageOverlay:
|
|
847
|
-
container:
|
|
848
|
-
resizeTick:
|
|
849
|
-
shouldRender:
|
|
850
|
-
registerRef:
|
|
824
|
+
renderPageOverlay: w,
|
|
825
|
+
container: x,
|
|
826
|
+
resizeTick: z,
|
|
827
|
+
shouldRender: k,
|
|
828
|
+
registerRef: K,
|
|
851
829
|
searchQuery: P,
|
|
852
830
|
onMatchCount: S
|
|
853
|
-
} = o, { t: b } = me(), l = E(null), M = E(null), [
|
|
831
|
+
} = o, { t: b } = me(), l = E(null), M = E(null), [C, A] = y({
|
|
854
832
|
width: 612,
|
|
855
833
|
height: 792
|
|
856
|
-
}), [p,
|
|
834
|
+
}), [p, _] = y(null);
|
|
857
835
|
T(() => {
|
|
858
836
|
let i = !1;
|
|
859
|
-
return m.getPage(t).then((
|
|
860
|
-
i ||
|
|
837
|
+
return m.getPage(t).then((I) => {
|
|
838
|
+
i || _(I);
|
|
861
839
|
}), () => {
|
|
862
840
|
i = !0;
|
|
863
841
|
};
|
|
864
842
|
}, [m, t]), T(() => {
|
|
865
843
|
if (!p) return;
|
|
866
|
-
const i = (
|
|
844
|
+
const i = (N) => h === void 0 ? { scale: N } : { scale: N, rotation: h }, I = p.getViewport(i(1)), u = Ce(g, I, x), O = p.getViewport(i(u));
|
|
867
845
|
A({
|
|
868
846
|
width: Math.floor(O.width),
|
|
869
847
|
height: Math.floor(O.height)
|
|
870
848
|
});
|
|
871
|
-
}, [p, g,
|
|
849
|
+
}, [p, g, x, z, h]);
|
|
872
850
|
const Q = h ?? (p == null ? void 0 : p.rotate) ?? 0;
|
|
873
851
|
T(() => {
|
|
874
|
-
if (!p || !
|
|
852
|
+
if (!p || !k) {
|
|
875
853
|
const f = l.current;
|
|
876
|
-
f && !
|
|
854
|
+
f && !k && (f.width = 0);
|
|
877
855
|
return;
|
|
878
856
|
}
|
|
879
|
-
const i = l.current,
|
|
857
|
+
const i = l.current, I = M.current;
|
|
880
858
|
if (!i) return;
|
|
881
859
|
const u = i.getContext("2d");
|
|
882
860
|
if (!u) return;
|
|
883
|
-
const O = (f) => h === void 0 ? { scale: f } : { scale: f, rotation: h },
|
|
884
|
-
i.width = Math.floor(
|
|
861
|
+
const O = (f) => h === void 0 ? { scale: f } : { scale: f, rotation: h }, N = p.getViewport(O(1)), D = Ce(g, N, x), L = p.getViewport(O(D)), q = Math.max(1, window.devicePixelRatio || 1);
|
|
862
|
+
i.width = Math.floor(L.width * q), i.height = Math.floor(L.height * q), u.setTransform(q, 0, 0, q, 0, 0);
|
|
885
863
|
const U = p.render({
|
|
886
864
|
canvas: i,
|
|
887
865
|
canvasContext: u,
|
|
888
|
-
viewport:
|
|
866
|
+
viewport: L
|
|
889
867
|
});
|
|
890
868
|
let R = !1, n = null;
|
|
891
869
|
return U.promise.then(async () => {
|
|
892
|
-
if (R || !
|
|
893
|
-
|
|
870
|
+
if (R || !I) return;
|
|
871
|
+
I.textContent = "";
|
|
894
872
|
const f = await p.getTextContent();
|
|
895
873
|
R || (n = new pe.TextLayer({
|
|
896
874
|
textContentSource: f,
|
|
897
|
-
container:
|
|
898
|
-
viewport:
|
|
899
|
-
}), await n.render(),
|
|
875
|
+
container: I,
|
|
876
|
+
viewport: L
|
|
877
|
+
}), await n.render(), Ne(I, P, S));
|
|
900
878
|
}).catch(() => {
|
|
901
879
|
}), () => {
|
|
902
880
|
R = !0;
|
|
@@ -912,34 +890,34 @@ function dt(o) {
|
|
|
912
890
|
};
|
|
913
891
|
}, [
|
|
914
892
|
p,
|
|
915
|
-
z,
|
|
916
|
-
g,
|
|
917
|
-
w,
|
|
918
893
|
k,
|
|
894
|
+
g,
|
|
895
|
+
x,
|
|
896
|
+
z,
|
|
919
897
|
P,
|
|
920
898
|
S,
|
|
921
899
|
h
|
|
922
900
|
]), T(() => {
|
|
923
|
-
if (!
|
|
901
|
+
if (!k) return;
|
|
924
902
|
const i = M.current;
|
|
925
|
-
i &&
|
|
926
|
-
}, [P,
|
|
903
|
+
i && Ne(i, P, S);
|
|
904
|
+
}, [P, k, S]);
|
|
927
905
|
const s = {
|
|
928
|
-
width:
|
|
929
|
-
height:
|
|
906
|
+
width: C.width,
|
|
907
|
+
height: C.height
|
|
930
908
|
}, W = {
|
|
931
|
-
width:
|
|
932
|
-
height:
|
|
909
|
+
width: C.width,
|
|
910
|
+
height: C.height
|
|
933
911
|
};
|
|
934
|
-
return /* @__PURE__ */
|
|
912
|
+
return /* @__PURE__ */ Z(
|
|
935
913
|
"article",
|
|
936
914
|
{
|
|
937
915
|
ref: (i) => {
|
|
938
|
-
|
|
916
|
+
K(i);
|
|
939
917
|
},
|
|
940
918
|
"data-page-number": t,
|
|
941
919
|
"aria-label": b("pdf.pageOf", { current: t, total: v }),
|
|
942
|
-
className:
|
|
920
|
+
className: tt(),
|
|
943
921
|
style: W,
|
|
944
922
|
children: [
|
|
945
923
|
/* @__PURE__ */ a("canvas", { ref: l, style: s }),
|
|
@@ -960,7 +938,7 @@ function dt(o) {
|
|
|
960
938
|
].join(" ")
|
|
961
939
|
}
|
|
962
940
|
),
|
|
963
|
-
|
|
941
|
+
k && w ? /* @__PURE__ */ a(
|
|
964
942
|
"div",
|
|
965
943
|
{
|
|
966
944
|
role: "group",
|
|
@@ -968,10 +946,10 @@ function dt(o) {
|
|
|
968
946
|
className: "ds:absolute ds:inset-0 ds:pointer-events-auto",
|
|
969
947
|
"data-pdf-page-overlay": "",
|
|
970
948
|
"data-page-number": t,
|
|
971
|
-
children:
|
|
949
|
+
children: w({
|
|
972
950
|
pageNumber: t,
|
|
973
|
-
pageWidthCss:
|
|
974
|
-
pageHeightCss:
|
|
951
|
+
pageWidthCss: C.width,
|
|
952
|
+
pageHeightCss: C.height,
|
|
975
953
|
rotation: Q
|
|
976
954
|
})
|
|
977
955
|
}
|
|
@@ -980,48 +958,48 @@ function dt(o) {
|
|
|
980
958
|
}
|
|
981
959
|
);
|
|
982
960
|
}
|
|
983
|
-
function
|
|
961
|
+
function Ie(o) {
|
|
984
962
|
return o.normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "").toLowerCase();
|
|
985
963
|
}
|
|
986
|
-
function
|
|
964
|
+
function Ne(o, t, v) {
|
|
987
965
|
if (o.querySelectorAll("[data-match]").forEach((b) => {
|
|
988
966
|
b.removeAttribute("data-match");
|
|
989
967
|
}), !t) {
|
|
990
968
|
v(0);
|
|
991
969
|
return;
|
|
992
970
|
}
|
|
993
|
-
const g =
|
|
971
|
+
const g = Ie(t);
|
|
994
972
|
if (!g) {
|
|
995
973
|
v(0);
|
|
996
974
|
return;
|
|
997
975
|
}
|
|
998
|
-
const h = Array.from(o.querySelectorAll("span")),
|
|
999
|
-
let
|
|
976
|
+
const h = Array.from(o.querySelectorAll("span")), w = [], x = [];
|
|
977
|
+
let z = 0;
|
|
1000
978
|
for (const b of h) {
|
|
1001
|
-
const l =
|
|
1002
|
-
|
|
979
|
+
const l = Ie(b.textContent ?? "");
|
|
980
|
+
w.push({ start: z, end: z + l.length }), x.push(l), z += l.length;
|
|
1003
981
|
}
|
|
1004
|
-
const
|
|
1005
|
-
let
|
|
982
|
+
const k = x.join("");
|
|
983
|
+
let K = 0;
|
|
1006
984
|
const P = /* @__PURE__ */ new Set();
|
|
1007
985
|
let S = 0;
|
|
1008
|
-
for (; S <=
|
|
1009
|
-
const b =
|
|
986
|
+
for (; S <= k.length - g.length; ) {
|
|
987
|
+
const b = k.indexOf(g, S);
|
|
1010
988
|
if (b === -1) break;
|
|
1011
|
-
|
|
989
|
+
K += 1;
|
|
1012
990
|
const l = b + g.length;
|
|
1013
|
-
for (let M = 0; M <
|
|
1014
|
-
const { start:
|
|
1015
|
-
|
|
991
|
+
for (let M = 0; M < w.length; M++) {
|
|
992
|
+
const { start: C, end: A } = w[M];
|
|
993
|
+
C < l && A > b && P.add(M);
|
|
1016
994
|
}
|
|
1017
995
|
S = l;
|
|
1018
996
|
}
|
|
1019
997
|
P.forEach((b) => {
|
|
1020
998
|
h[b].setAttribute("data-match", "true");
|
|
1021
|
-
}), v(
|
|
999
|
+
}), v(K);
|
|
1022
1000
|
}
|
|
1023
1001
|
export {
|
|
1024
|
-
|
|
1025
|
-
|
|
1002
|
+
nt as P,
|
|
1003
|
+
$e as p
|
|
1026
1004
|
};
|
|
1027
|
-
//# sourceMappingURL=pdf-viewer-
|
|
1005
|
+
//# sourceMappingURL=pdf-viewer-QfebdLOd.js.map
|