@nulib/clover 0.0.0-stage → 4.0.0-beta.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/LICENSE +9 -0
- package/README.md +120 -2
- package/dist/components/Annotations/Annotations.mjs +674 -0
- package/dist/components/Annotations/EntryBodies.mjs +52 -0
- package/dist/components/Annotations/languages.mjs +43 -0
- package/dist/components/Body/Body.mjs +51 -0
- package/dist/components/Body/BodyAlert.mjs +25 -0
- package/dist/components/Body/Caption.mjs +90 -0
- package/dist/components/Body/CaptionDetails.mjs +50 -0
- package/dist/components/Body/Pending.mjs +9 -0
- package/dist/components/Body/glyphs.mjs +66 -0
- package/dist/components/Body/renderers.mjs +30 -0
- package/dist/components/Body/useControlsVisibility.mjs +204 -0
- package/dist/components/Body/useNearViewport.mjs +27 -0
- package/dist/components/Canvas/AnnotationMenu.mjs +128 -0
- package/dist/components/Canvas/AnnotationState.mjs +338 -0
- package/dist/components/Canvas/Annotations.mjs +497 -0
- package/dist/components/Canvas/CanvasView.mjs +669 -0
- package/dist/components/Canvas/ChoiceMenu.mjs +77 -0
- package/dist/components/Canvas/Connected.mjs +228 -0
- package/dist/components/Canvas/ControlMenu.mjs +67 -0
- package/dist/components/Canvas/Controls.mjs +233 -0
- package/dist/components/Canvas/FrameAnimation.mjs +344 -0
- package/dist/components/Canvas/LoadedCanvas.mjs +177 -0
- package/dist/components/Canvas/Placeholder.mjs +105 -0
- package/dist/components/Canvas/fromManifest.mjs +44 -0
- package/dist/components/Canvas/index.mjs +19 -0
- package/dist/components/Canvas/layout.mjs +369 -0
- package/dist/components/Canvas/media/MediaBody.mjs +285 -0
- package/dist/components/Canvas/media/Player.mjs +193 -0
- package/dist/components/Canvas/media/Transport.mjs +511 -0
- package/dist/components/Canvas/media/TransportButton.mjs +39 -0
- package/dist/components/Canvas/media/useBarHeight.mjs +28 -0
- package/dist/components/Canvas/media/useCaptionTracks.mjs +131 -0
- package/dist/components/Canvas/media/useMediaController.mjs +77 -0
- package/dist/components/Canvas/media/useMediaElement.mjs +100 -0
- package/dist/components/Canvas/panClearOfControls.mjs +92 -0
- package/dist/components/Canvas/rendererSurface.mjs +6 -0
- package/dist/components/Canvas/surface.mjs +5 -0
- package/dist/components/Canvas/track.mjs +43 -0
- package/dist/components/Canvas/useSvgReader.mjs +23 -0
- package/dist/components/Collection/Collection.mjs +76 -0
- package/dist/components/CollectionSelect/CollectionSelect.mjs +114 -0
- package/dist/components/Contents/Contents.mjs +120 -0
- package/dist/components/Download/Download.mjs +105 -0
- package/dist/components/Items/Item.mjs +184 -0
- package/dist/components/Items/Items.mjs +455 -0
- package/dist/components/Items/Pager.mjs +190 -0
- package/dist/components/Items/StandaloneItems.mjs +80 -0
- package/dist/components/Items/clamped.mjs +90 -0
- package/dist/components/Label/Label.mjs +39 -0
- package/dist/components/Map/LoadedMap.mjs +26 -0
- package/dist/components/Map/Map.mjs +38 -0
- package/dist/components/Map/MapView.mjs +538 -0
- package/dist/components/Map/basemap.mjs +50 -0
- package/dist/components/Map/overlayImage.mjs +17 -0
- package/dist/components/Panel/About.mjs +143 -0
- package/dist/components/Panel/Panel.mjs +259 -0
- package/dist/components/Panel/PanelToggle.mjs +43 -0
- package/dist/components/Panel/PartOfManifest.mjs +52 -0
- package/dist/components/Primitives/Primitives.mjs +263 -0
- package/dist/components/Primitives/resource.mjs +11 -0
- package/dist/components/Provider/Provider.mjs +174 -0
- package/dist/components/Root/Announcer.mjs +58 -0
- package/dist/components/Root/Root.mjs +29 -0
- package/dist/components/Root/useRootState.mjs +188 -0
- package/dist/components/Scene/Connected.mjs +48 -0
- package/dist/components/Scene/Loaded.mjs +56 -0
- package/dist/components/Scene/RotatePad.mjs +204 -0
- package/dist/components/Scene/Scene.mjs +20 -0
- package/dist/components/Scene/SceneView.mjs +539 -0
- package/dist/components/Scene/cloverEngine.mjs +105 -0
- package/dist/components/Scene/engine.mjs +141 -0
- package/dist/components/Scene/engines.mjs +23 -0
- package/dist/components/Scene/gestures.mjs +74 -0
- package/dist/components/Scene/models.mjs +78 -0
- package/dist/components/Scene/orbit.mjs +60 -0
- package/dist/components/Search/Search.mjs +246 -0
- package/dist/components/Split/Split.mjs +203 -0
- package/dist/components/Split/splitting.mjs +203 -0
- package/dist/components/Status/Status.mjs +47 -0
- package/dist/components/Timeline/Connected.mjs +25 -0
- package/dist/components/Timeline/Timeline.mjs +40 -0
- package/dist/components/Timeline/playerSurface.mjs +84 -0
- package/dist/components/Transcript/Transcript.mjs +377 -0
- package/dist/components/Viewer/Viewer.mjs +19 -0
- package/dist/core/annotation-bodies.mjs +29 -0
- package/dist/core/annotation-collection.mjs +55 -0
- package/dist/core/annotation-name.mjs +31 -0
- package/dist/core/annotation-sets.mjs +155 -0
- package/dist/core/annotations-content.mjs +27 -0
- package/dist/core/annotations.mjs +73 -0
- package/dist/core/clover.mjs +393 -0
- package/dist/core/content-state-reader.mjs +82 -0
- package/dist/core/content-state.mjs +43 -0
- package/dist/core/direction.mjs +12 -0
- package/dist/core/geo-detect.mjs +30 -0
- package/dist/core/geo.mjs +283 -0
- package/dist/core/items.mjs +74 -0
- package/dist/core/keep-fragments.mjs +40 -0
- package/dist/core/link.mjs +28 -0
- package/dist/core/load.mjs +176 -0
- package/dist/core/map-config.mjs +12 -0
- package/dist/core/markdown.mjs +139 -0
- package/dist/core/pages.mjs +51 -0
- package/dist/core/painted-bodies.mjs +20 -0
- package/dist/core/painting.mjs +17 -0
- package/dist/core/presentation.mjs +27 -0
- package/dist/core/ranges.mjs +133 -0
- package/dist/core/region.mjs +32 -0
- package/dist/core/request.mjs +40 -0
- package/dist/core/sanitize.mjs +72 -0
- package/dist/core/search-service.mjs +22 -0
- package/dist/core/search.mjs +154 -0
- package/dist/core/selectors.mjs +94 -0
- package/dist/core/sequence.mjs +70 -0
- package/dist/core/show-link.mjs +16 -0
- package/dist/core/store.mjs +40 -0
- package/dist/core/svg-shape.mjs +183 -0
- package/dist/core/text.mjs +36 -0
- package/dist/core/thumbnail.mjs +55 -0
- package/dist/core/value.mjs +39 -0
- package/dist/core/vtt.mjs +111 -0
- package/dist/hooks/useFullscreen.mjs +21 -0
- package/dist/hooks/useFullscreenSupported.mjs +11 -0
- package/dist/hooks/useLoaded.mjs +27 -0
- package/dist/hooks/useWithinFullscreen.mjs +24 -0
- package/dist/i18n/config.mjs +170 -0
- package/dist/i18n/hostLanguage.mjs +6 -0
- package/dist/i18n/locales/en.json.mjs +5 -0
- package/dist/i18n/locales/es.json.mjs +5 -0
- package/dist/i18n/locales/fi.json.mjs +5 -0
- package/dist/i18n/locales/fr.json.mjs +5 -0
- package/dist/i18n/locales/index.mjs +13 -0
- package/dist/i18n/locales/nb.json.mjs +5 -0
- package/dist/i18n/locales/nn.json.mjs +5 -0
- package/dist/i18n/locales/no.json.mjs +5 -0
- package/dist/i18n/locales/pt.json.mjs +5 -0
- package/dist/i18n/reader.mjs +13 -0
- package/dist/i18n/useCloverTranslation.mjs +28 -0
- package/dist/index.d.mts +2204 -0
- package/dist/index.mjs +133 -0
- package/dist/lib/asArray.mjs +5 -0
- package/dist/lib/classnames.mjs +5 -0
- package/dist/lib/fullscreen.mjs +65 -0
- package/dist/lib/gltf/bounds.mjs +44 -0
- package/dist/lib/gltf/load.mjs +156 -0
- package/dist/lib/gltf/mat4.mjs +150 -0
- package/dist/lib/gltf/renderer.mjs +342 -0
- package/dist/lib/gltf/shaders.mjs +192 -0
- package/dist/lib/hls.mjs +6 -0
- package/dist/lib/pointer.mjs +38 -0
- package/dist/lib/renderer/CanvasRenderer.mjs +857 -0
- package/dist/lib/renderer/backends/backend.mjs +21 -0
- package/dist/lib/renderer/backends/canvas2d/Canvas2DBackend.mjs +91 -0
- package/dist/lib/renderer/backends/contexts.mjs +27 -0
- package/dist/lib/renderer/backends/dom/DomLayers.mjs +91 -0
- package/dist/lib/renderer/backends/webgl2/WebGL2Backend.mjs +248 -0
- package/dist/lib/renderer/backends/webgl2/shaders.mjs +28 -0
- package/dist/lib/renderer/camera/Camera.mjs +64 -0
- package/dist/lib/renderer/camera/CameraAnimator.mjs +90 -0
- package/dist/lib/renderer/input/GestureController.mjs +252 -0
- package/dist/lib/renderer/io/TileCache.mjs +207 -0
- package/dist/lib/renderer/io/decode.mjs +156 -0
- package/dist/lib/renderer/loop/FrameLoop.mjs +50 -0
- package/dist/lib/renderer/math/affine.mjs +68 -0
- package/dist/lib/renderer/math/rect.mjs +45 -0
- package/dist/lib/renderer/overlays/Navigator.mjs +141 -0
- package/dist/lib/renderer/overlays/OverlayLayer.mjs +94 -0
- package/dist/lib/renderer/scene/planFrame.mjs +168 -0
- package/dist/lib/renderer/scene/regions.mjs +30 -0
- package/dist/lib/renderer/scene/sceneItem.mjs +114 -0
- package/dist/lib/renderer/scene/uploadBudget.mjs +30 -0
- package/dist/lib/renderer/sources/imageService.mjs +160 -0
- package/dist/lib/renderer/sources/sizedImage.mjs +38 -0
- package/dist/lib/renderer/sources/tilePyramid.mjs +172 -0
- package/dist/lib/time.mjs +21 -0
- package/dist/map/index.d.mts +184 -0
- package/dist/map/index.mjs +16 -0
- package/dist/react/context.mjs +46 -0
- package/dist/react/hooks.mjs +69 -0
- package/dist/react/language.mjs +30 -0
- package/dist/styles.css +1 -0
- package/dist/templates/default/Default.mjs +229 -0
- package/dist/templates/document/Document.mjs +286 -0
- package/dist/templates/document/DocumentPanel.mjs +9 -0
- package/dist/templates/document/Sheets.mjs +360 -0
- package/dist/templates/gallery/Gallery.mjs +62 -0
- package/dist/templates/index.d.mts +273 -0
- package/dist/templates/index.mjs +11 -0
- package/dist/templates/shared/Lightbox.mjs +111 -0
- package/dist/templates/shared/LightboxBody.mjs +9 -0
- package/dist/templates/shared/dragToClose.mjs +129 -0
- package/dist/templates/shared/useDragToClose.mjs +35 -0
- package/dist/templates/shared/useDrawer.mjs +113 -0
- package/dist/templates/shared/useFollowFocus.mjs +24 -0
- package/dist/templates/shared/useSlide.mjs +52 -0
- package/dist/templates/shared/useSpine.mjs +26 -0
- package/dist/templates.css +1 -0
- package/dist/three/index.d.mts +6 -0
- package/dist/three/index.mjs +8 -0
- package/dist/ui/Button.mjs +53 -0
- package/dist/ui/ControlCluster.mjs +87 -0
- package/dist/ui/Cue.mjs +13 -0
- package/dist/ui/ErrorBoundary.mjs +26 -0
- package/dist/ui/ExitFullscreen.mjs +46 -0
- package/dist/ui/FieldPill.mjs +153 -0
- package/dist/ui/HideToggle.mjs +57 -0
- package/dist/ui/Loading.mjs +20 -0
- package/dist/ui/Markup.mjs +95 -0
- package/dist/ui/ReadMore.mjs +84 -0
- package/dist/ui/Sections.mjs +448 -0
- package/dist/ui/Steps.mjs +84 -0
- package/dist/ui/Tip.mjs +196 -0
- package/dist/ui/bringIntoView.mjs +27 -0
- package/dist/ui/controlGlyphs.mjs +120 -0
- package/dist/ui/heading.mjs +19 -0
- package/dist/ui/languageCode.mjs +8 -0
- package/dist/ui/mediaIcons.mjs +104 -0
- package/dist/ui/useClusterReach.mjs +50 -0
- package/dist/ui/useContainerName.mjs +19 -0
- package/dist/ui/useOneOpen.mjs +22 -0
- package/dist/ui/useRovingFocus.mjs +64 -0
- package/dist/ui/useScrollTrack.mjs +150 -0
- package/dist/ui/useUniqueId.mjs +10 -0
- package/dist/ui/visuallyHidden.mjs +15 -0
- package/dist/web-components/About-uKa1wfDr.mjs +1 -0
- package/dist/web-components/AnnotationMenu-BGIYRXW6.mjs +1 -0
- package/dist/web-components/AnnotationState-D2UIgIEC.mjs +1 -0
- package/dist/web-components/Annotations-BhwAv3ah.mjs +1 -0
- package/dist/web-components/Annotations-C_tBJHo3.mjs +2 -0
- package/dist/web-components/Body-DMEERFuB.mjs +1 -0
- package/dist/web-components/BodyAlert-BP8voSLv.mjs +1 -0
- package/dist/web-components/Button-Cl02BFDd.mjs +1 -0
- package/dist/web-components/Camera-Dw51CAfF.mjs +1 -0
- package/dist/web-components/Canvas2DBackend-RRN2bEkc.mjs +1 -0
- package/dist/web-components/CanvasView-B8lMMSou.mjs +1 -0
- package/dist/web-components/CaptionDetails-KLMDv-ec.mjs +1 -0
- package/dist/web-components/ChoiceMenu-CXrVOmJl.mjs +1 -0
- package/dist/web-components/Collection-DL4Ui4hF.mjs +1 -0
- package/dist/web-components/CollectionSelect-DL-bbpwJ.mjs +1 -0
- package/dist/web-components/Connected-B0S1HXQb.mjs +1 -0
- package/dist/web-components/Connected-BcjRA5si.mjs +1 -0
- package/dist/web-components/Connected-Q7iizBb8.mjs +1 -0
- package/dist/web-components/Contents-ZC8TiGaW.mjs +1 -0
- package/dist/web-components/ControlMenu-DIoU797-.mjs +1 -0
- package/dist/web-components/Cue-CJxnDMEy.mjs +1 -0
- package/dist/web-components/Document-DHBRAFEK.mjs +1 -0
- package/dist/web-components/DocumentPanel-CqvE2pu9.mjs +1 -0
- package/dist/web-components/DomLayers-BsR2AOy-.mjs +1 -0
- package/dist/web-components/Download-DBksL1C0.mjs +1 -0
- package/dist/web-components/EntryBodies-VwEkTVrw.mjs +1 -0
- package/dist/web-components/ErrorBoundary-Cy9PGoZv.mjs +1 -0
- package/dist/web-components/FieldPill-DCJBz6Vj.mjs +1 -0
- package/dist/web-components/FrameAnimation-DRbmgGpF.mjs +1 -0
- package/dist/web-components/Gallery-BM7-VJkB.mjs +1 -0
- package/dist/web-components/HideToggle-BdYgG7us.mjs +1 -0
- package/dist/web-components/Items-_1Jz3FMs.mjs +1 -0
- package/dist/web-components/Label-CAiJ49eA.mjs +1 -0
- package/dist/web-components/LightboxBody-DyhUZiDf.mjs +1 -0
- package/dist/web-components/Loaded-wQurAeJz.mjs +1 -0
- package/dist/web-components/LoadedCanvas-DWz5IK5m.mjs +1 -0
- package/dist/web-components/LoadedMap-DIeW313M.mjs +1 -0
- package/dist/web-components/Loading-BmA--pzr.mjs +1 -0
- package/dist/web-components/Map-DzVGblIS.mjs +1 -0
- package/dist/web-components/MapView-BJaN7VBI.mjs +1 -0
- package/dist/web-components/Markup-D91DbxLk.mjs +2 -0
- package/dist/web-components/MediaBody-BYcVPo2X.mjs +1 -0
- package/dist/web-components/MediaBody-FEzH8VVw.mjs +1 -0
- package/dist/web-components/Navigator-CIJFA3q1.mjs +1 -0
- package/dist/web-components/Pager-BGwCurxE.mjs +1 -0
- package/dist/web-components/Panel-B-GXOkzF.mjs +1 -0
- package/dist/web-components/PanelToggle-BYjV2t1j.mjs +1 -0
- package/dist/web-components/PartOfManifest-ClbGepVM.mjs +1 -0
- package/dist/web-components/Pending-BspZajh5.mjs +1 -0
- package/dist/web-components/Primitives-CTh59wvs.mjs +1 -0
- package/dist/web-components/Provider-C6rIiDXH.mjs +1 -0
- package/dist/web-components/ReadMore-BJ2i-0uN.mjs +1 -0
- package/dist/web-components/Root-DkkYDtur.mjs +1 -0
- package/dist/web-components/Scene-B_PU_TiX.mjs +1 -0
- package/dist/web-components/SceneView-qcW_sT3j.mjs +1 -0
- package/dist/web-components/Search-UOneIUcP.mjs +1 -0
- package/dist/web-components/Sections-we9U9fXq.mjs +2 -0
- package/dist/web-components/StandaloneItems-DU8oCFc_.mjs +1 -0
- package/dist/web-components/Status-Cs5ZvFvL.mjs +1 -0
- package/dist/web-components/Timeline-WtYZ1bIJ.mjs +1 -0
- package/dist/web-components/Tip-C8J3qsIK.mjs +1 -0
- package/dist/web-components/Transcript-CRL2zToL.mjs +1 -0
- package/dist/web-components/annotation-collection-ZPyvpLFc.mjs +1 -0
- package/dist/web-components/annotations-content-BZChKhJZ.mjs +1 -0
- package/dist/web-components/assets/maplibre-gl-worker-kTz9OPxr.js +13831 -0
- package/dist/web-components/body-UntgrmoV.mjs +1 -0
- package/dist/web-components/bringIntoView-CQH5ZgMM.mjs +1 -0
- package/dist/web-components/canvas-d_U4v_mh.mjs +1 -0
- package/dist/web-components/classnames-DukgfdpI.mjs +1 -0
- package/dist/web-components/cloverEngine-Dbv-26NP.mjs +164 -0
- package/dist/web-components/content-state-reader-DjdKWjit.mjs +1 -0
- package/dist/web-components/contexts-ByL3eA_T.mjs +1 -0
- package/dist/web-components/controls-qRYf2jO2.mjs +1 -0
- package/dist/web-components/custom-elements.json +2739 -0
- package/dist/web-components/dragToClose-C-Pf1IeO.mjs +1 -0
- package/dist/web-components/engine-D8JLgzqq.mjs +4228 -0
- package/dist/web-components/engines-BwVb9R_A.mjs +1 -0
- package/dist/web-components/es-BwMkoRod.mjs +1 -0
- package/dist/web-components/fi-gPFOn9RK.mjs +1 -0
- package/dist/web-components/fr-DUHmgdJo.mjs +1 -0
- package/dist/web-components/fromManifest-UrMJgktp.mjs +1 -0
- package/dist/web-components/glyphs-BoX0a88P.mjs +1 -0
- package/dist/web-components/heading-Cjt0f-Eu.mjs +1 -0
- package/dist/web-components/hls-CdKrthkC.mjs +40 -0
- package/dist/web-components/hooks-Dp8pjU8l.mjs +1 -0
- package/dist/web-components/imageService-C3yg9DxB.mjs +1 -0
- package/dist/web-components/index-DWxMuwDL.mjs +1 -0
- package/dist/web-components/index.d.mts +604 -0
- package/dist/web-components/index.mjs +1 -0
- package/dist/web-components/index.umd.js +18 -0
- package/dist/web-components/items--Tu7ZM3L.mjs +1 -0
- package/dist/web-components/items-W2vrwArM.mjs +1 -0
- package/dist/web-components/keep-fragments-B5nlv2ck.mjs +1 -0
- package/dist/web-components/label-CYQ7tVl6.mjs +1 -0
- package/dist/web-components/languageCode-cCpiU0b0.mjs +1 -0
- package/dist/web-components/layout-KL0V-iJu.mjs +1 -0
- package/dist/web-components/link-DRRTY4lY.mjs +1 -0
- package/dist/web-components/logo-CnQUCB3Y.mjs +1 -0
- package/dist/web-components/maplibre-gl-CQ4OueXY.mjs +823 -0
- package/dist/web-components/markdown-CCYJwzFn.mjs +5 -0
- package/dist/web-components/models-BP2qp9nT.mjs +1 -0
- package/dist/web-components/nb-BSvnQ6jd.mjs +1 -0
- package/dist/web-components/nn-Dg2_HdZu.mjs +1 -0
- package/dist/web-components/no-BSvnQ6jd.mjs +1 -0
- package/dist/web-components/nodes-Bf-Fb7e5.mjs +1 -0
- package/dist/web-components/overlayImage-DdPs2EGY.mjs +1 -0
- package/dist/web-components/panClearOfControls-ac9uf-Qs.mjs +1 -0
- package/dist/web-components/panel-CiqEFDzv.mjs +1 -0
- package/dist/web-components/part-CUBY90_b.mjs +1 -0
- package/dist/web-components/playerSurface-i2TJz-F4.mjs +1 -0
- package/dist/web-components/provider-LUmAQSoP.mjs +1 -0
- package/dist/web-components/pt-B3J80JgO.mjs +1 -0
- package/dist/web-components/read-more-BaaO77el.mjs +1 -0
- package/dist/web-components/rendererSurface-DAvatpMF.mjs +22 -0
- package/dist/web-components/renderers-Bg4QqawN.mjs +1 -0
- package/dist/web-components/resource-DzIvB_4m.mjs +1 -0
- package/dist/web-components/sanitize-Dc7nOsgO.mjs +3 -0
- package/dist/web-components/search-DgcgsI3I.mjs +1 -0
- package/dist/web-components/shared-J3w3gnXD.mjs +1 -0
- package/dist/web-components/show-link-DWRRXSBy.mjs +1 -0
- package/dist/web-components/sizedImage-DfjlV2-i.mjs +1 -0
- package/dist/web-components/split-m-_XivaW.mjs +1 -0
- package/dist/web-components/splitting-BnQUxxgH.mjs +1 -0
- package/dist/web-components/status-DDS7jLNd.mjs +1 -0
- package/dist/web-components/styles-Ypl9KrSK.mjs +1 -0
- package/dist/web-components/svg-shape-DLY3g7oq.mjs +1 -0
- package/dist/web-components/text-BTAkxEfQ.mjs +5 -0
- package/dist/web-components/three.mjs +1 -0
- package/dist/web-components/thumbnail-BZvLSwWW.mjs +1 -0
- package/dist/web-components/time-B9GZoYcm.mjs +1 -0
- package/dist/web-components/tip-BXByhOJ9.mjs +1 -0
- package/dist/web-components/toggle-AS72kq6v.mjs +1 -0
- package/dist/web-components/upgrader-XNxI-5jo.mjs +1 -0
- package/dist/web-components/useContainerName-DCbE5JXi.mjs +1 -0
- package/dist/web-components/useNearViewport-CyoK3l8W.mjs +1 -0
- package/dist/web-components/useScrollTrack-dLFWnT8N.mjs +1 -0
- package/dist/web-components/viewer/AnnotationMenu-Dd4tnzNV.mjs +1 -0
- package/dist/web-components/viewer/AnnotationState-DZaSy5lH.mjs +1 -0
- package/dist/web-components/viewer/Annotations-D1h-Yi5J.mjs +1 -0
- package/dist/web-components/viewer/Annotations-sj79EMen.mjs +2 -0
- package/dist/web-components/viewer/Canvas2DBackend-CkvI0wUT.mjs +1 -0
- package/dist/web-components/viewer/CaptionDetails-B_JdNjJ7.mjs +1 -0
- package/dist/web-components/viewer/ChoiceMenu-xa51a1DV.mjs +1 -0
- package/dist/web-components/viewer/Collection-CxuLCspj.mjs +1 -0
- package/dist/web-components/viewer/Connected-BSUBc3Ci.mjs +1 -0
- package/dist/web-components/viewer/Connected-CPIxNjF2.mjs +1 -0
- package/dist/web-components/viewer/Contents-DNh9mnsF.mjs +1 -0
- package/dist/web-components/viewer/ControlMenu-DdgIvBdf.mjs +1 -0
- package/dist/web-components/viewer/Cue-90H9_dXz.mjs +1 -0
- package/dist/web-components/viewer/Document-CNCpzkiN.mjs +1 -0
- package/dist/web-components/viewer/DocumentPanel-BdG4TVLE.mjs +1 -0
- package/dist/web-components/viewer/DomLayers-Dybz_aJv.mjs +1 -0
- package/dist/web-components/viewer/EntryBodies-DGXjFP3N.mjs +1 -0
- package/dist/web-components/viewer/FieldPill-Icmd98OY.mjs +1 -0
- package/dist/web-components/viewer/FrameAnimation-DJZN3Rd4.mjs +1 -0
- package/dist/web-components/viewer/Gallery-CEp3-bh2.mjs +1 -0
- package/dist/web-components/viewer/HideToggle-DB6HTmAO.mjs +1 -0
- package/dist/web-components/viewer/LightboxBody-ClQ4yrTh.mjs +1 -0
- package/dist/web-components/viewer/MapView-BVSdybIC.mjs +1 -0
- package/dist/web-components/viewer/MediaBody-BBbSMT1i.mjs +1 -0
- package/dist/web-components/viewer/MediaBody-BzMXMHIF.mjs +1 -0
- package/dist/web-components/viewer/Navigator-Duc69Yes.mjs +1 -0
- package/dist/web-components/viewer/PartOfManifest-X9_q-2t6.mjs +1 -0
- package/dist/web-components/viewer/Search-S4N5QU4R.mjs +1 -0
- package/dist/web-components/viewer/StandaloneItems-BO4VyWRW.mjs +1 -0
- package/dist/web-components/viewer/Transcript-BbDaS064.mjs +1 -0
- package/dist/web-components/viewer/annotation-collection-BjZ1DAHq.mjs +1 -0
- package/dist/web-components/viewer/annotations-content-jn3n5Y2-.mjs +1 -0
- package/dist/web-components/viewer/cloverEngine-CjuYjUhI.mjs +164 -0
- package/dist/web-components/viewer/content-state-reader-CPiShIjP.mjs +1 -0
- package/dist/web-components/viewer/host-yWi4R1bP.mjs +1 -0
- package/dist/web-components/viewer/index.d.mts +7 -0
- package/dist/web-components/viewer/index.mjs +1 -0
- package/dist/web-components/viewer/index.umd.js +18 -0
- package/dist/web-components/viewer/link-CwE-fg5G.mjs +1 -0
- package/dist/web-components/viewer/overlayImage-BpOgqsZ0.mjs +1 -0
- package/dist/web-components/viewer/renderers-L-IlGI1r.mjs +1 -0
- package/dist/web-components/viewer/search-DWkwRPo_.mjs +1 -0
- package/dist/web-components/viewer/styles-BRCkEU3w.mjs +1 -0
- package/dist/web-components/viewer/viewer--TreVlJ_.mjs +28 -0
- package/dist/web-components/viewer/vtt-1ZJwtElI.mjs +5 -0
- package/dist/web-components/viewer-DyV864Qe.mjs +1 -0
- package/dist/web-components/vtt-GFssZH8Y.mjs +5 -0
- package/package.json +110 -4
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var il=Object.defineProperty;var sl=(t,e,n)=>e in t?il(t,e,{enumerable:true,configurable:true,writable:true,value:n}):t[e]=n;var L=(t,e,n)=>sl(t,typeof e!="symbol"?e+"":e,n);import{s as Qi}from"./styles-BRCkEU3w.mjs";function al(t={}){return Promise.resolve().then(()=>sc).then(e=>e.initCloverI18n(t))}const ts="@layer clover{:is(clover-root,clover-items,clover-viewer,clover-panel,clover-read-more):not([hidden]){display:block}:is(clover-body,clover-canvas,clover-timeline,clover-scene):not([hidden]){display:block;height:var(--clover-body-height,60vh)}clover-split:not([hidden]){display:flex}:is(clover-label,clover-panel-toggle):not([hidden]){display:contents}clover-tab,clover-tip,clover-status>[slot]{display:none}}";let ll=null,Be=null;const cl=()=>ll??(ll=import("./host-yWi4R1bP.mjs").then(t=>Be=t)),ul=t=>t.trim().toLowerCase()==="false";function dl(t,{type:e,min:n},o){if(t===null)return;if(e==="string")return t;if(e==="boolean")return!ul(t);if(e==="number"){const i=Number(t);if(t.trim()===""||!Number.isFinite(i)){o("is not a number");return}if(n!==void 0&&i<n){o(`is less than ${n}`);return}return i}if(e==="data"){const i=t.trim();if(!/^[[{"]/.test(i))return t;try{return JSON.parse(i)}catch{o("is not JSON");return}}const r=t.trim().toLowerCase();if(e.includes(r))return r==="false"?false:r;o(`is not ${e.join(", ")}`)}const hl=(t,e)=>{const n=Object.keys(t);return n.length===Object.keys(e).length&&n.every(o=>Object.is(t[o],e[o]))};function fl(t){class e extends HTMLElement{constructor(){super(...arguments);L(this,"kind",t.kind)}static get observedAttributes(){return Object.keys(t.attributes)}connectedCallback(){Qi(this.ownerDocument).inject("elements",ts)}}customElements.define(t.tag,e)}function pl(t,e){if(typeof customElements>"u"||customElements.get(t.tag))return;if(t.kind==="config"||!e)return fl(t);const n=t.kind,o=t.properties??[],r=Object.entries(t.events??{});let i=null,s=null;const a=()=>s??(s=Promise.all([e().then(c=>i=c),cl()]));class l extends HTMLElement{constructor(){super(...arguments);L(this,"kind",n);L(this,"needsRoot",!!t.needsRoot);L(this,"values",{});L(this,"kept",{});L(this,"props",{});L(this,"listeners",new Set);L(this,"warned",new Set);L(this,"handlers",Object.fromEntries(r.map(([d,p])=>[p.prop,(...f)=>{var y;if(p.keeps&&(this.kept[p.keeps]=f[0]??null,f[0]==null))return true;const m=p.detail==="first"?f[0]:Object.fromEntries(p.detail.map((b,x)=>[b,f[x]])),g=new CustomEvent(d,{detail:m,bubbles:!p.keeps,composed:!p.keeps,cancelable:!!p.cancelable}),_=this.dispatchEvent(g);if(!_&&p.cancelable){const b=f[f.length-1];(y=b==null?void 0:b.preventDefault)==null||y.call(b)}return _}])));L(this,"getProps",()=>this.props);L(this,"subscribe",d=>(this.listeners.add(d),()=>{this.listeners.delete(d)}))}static get observedAttributes(){return Object.keys(t.attributes)}get element(){return this}get Component(){return i}connectedCallback(){for(const d of o){if(!Object.prototype.hasOwnProperty.call(this,d))continue;const p=this[d];delete this[d],p!=null&&(this.values[d]=p)}this.update(),this.warnOfAria(),Qi(this.ownerDocument).inject("elements",ts),a().then(()=>{this.isConnected&&Be.hostOf(this.ownerDocument).connect(this)})}disconnectedCallback(){queueMicrotask(()=>{this.isConnected||Be==null||Be.hostOf(this.ownerDocument).disconnect(this)})}attributeChangedCallback(){this.update()}warnOfAria(){if(!t.native)for(const d of["aria-label","aria-labelledby","role"])!this.hasAttribute(d)||this.warned.has(d)||(this.warned.add(d),console.warn(`<${t.tag}>: ${d} names the element, a box no reader is told of; Clover names what it draws itself.`))}update(){const d={...this.handlers,...this.values};for(const[p,f]of Object.entries(t.attributes)){if(f.prop in this.values)continue;const m=this.getAttribute(p),g=dl(m,f,_=>{const y=`${p}=${m}`;this.warned.has(y)||(this.warned.add(y),console.warn(`<${t.tag}>: ${p}="${m}" ${_}; ignored.`))});g!==void 0&&(d[f.prop]=g)}hl(d,this.props)||(this.props=d,this.listeners.forEach(p=>p()))}}L(l,"initCloverI18n",al);for(const c of o)Object.defineProperty(l.prototype,c,{configurable:true,enumerable:true,get(){return c in this.values?this.values[c]:this.getProps()[c]},set(u){u==null?delete this.values[c]:this.values[c]=u,this.update()}});for(const[,c]of r){if(!c.keeps)continue;const u=c.keeps;Object.defineProperty(l.prototype,u,{configurable:true,enumerable:true,get(){return this.kept[u]??null}})}customElements.define(t.tag,l)}var je,G,es,ae,Rr,ns,os,rs,Po,io,so,is,De={},ss=[],ml=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ve=Array.isArray;function Bt(t,e){for(var n in e)t[n]=e[n];return t}function Ao(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Vt(t,e,n){var o,r,i,s={};for(i in e)i=="key"?o=e[i]:i=="ref"?r=e[i]:s[i]=e[i];if(arguments.length>2&&(s.children=arguments.length>3?je.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)s[i]===void 0&&(s[i]=t.defaultProps[i]);return ze(t,s,o,r,null)}function ze(t,e,n,o,r){var i={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++es,__i:-1,__u:0};return r==null&&G.vnode!=null&&G.vnode(i),i}function gl(){return{current:null}}function mt(t){return t.children}function $t(t,e){this.props=t,this.context=e}function Se(t,e){if(e==null)return t.__?Se(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Se(t):null}function as(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return as(t)}}function ao(t){(!t.__d&&(t.__d=true)&&ae.push(t)&&!vn.__r++||Rr!=G.debounceRendering)&&((Rr=G.debounceRendering)||ns)(vn)}function vn(){for(var t,e,n,o,r,i,s,a=1;ae.length;)ae.length>a&&ae.sort(os),t=ae.shift(),a=ae.length,t.__d&&(n=void 0,o=void 0,r=(o=(e=t).__v).__e,i=[],s=[],e.__P&&((n=Bt({},o)).__v=o.__v+1,G.vnode&&G.vnode(n),Oo(e.__P,n,o,e.__n,e.__P.namespaceURI,32&o.__u?[r]:null,i,r??Se(o),!!(32&o.__u),s),n.__v=o.__v,n.__.__k[n.__i]=n,us(i,n,s),o.__e=o.__=null,n.__e!=r&&as(n)));vn.__r=0}function ls(t,e,n,o,r,i,s,a,l,c,u){var d,p,f,m,g,_,y,b=o&&o.__k||ss,x=e.length;for(l=vl(n,e,b,l,x),d=0;d<x;d++)(f=n.__k[d])!=null&&(p=f.__i==-1?De:b[f.__i]||De,f.__i=d,_=Oo(t,f,p,r,i,s,a,l,c,u),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&No(p.ref,null,f),u.push(f.ref,f.__c||m,f)),g==null&&m!=null&&(g=m),(y=!!(4&f.__u))||p.__k===f.__k?l=cs(f,l,t,y):typeof f.type=="function"&&_!==void 0?l=_:m&&(l=m.nextSibling),f.__u&=-7);return n.__e=g,l}function vl(t,e,n,o,r){var i,s,a,l,c,u=n.length,d=u,p=0;for(t.__k=new Array(r),i=0;i<r;i++)(s=e[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(l=i+p,(s=t.__k[i]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?ze(null,s,null,null,null):Ve(s)?ze(mt,{children:s},null,null,null):s.constructor==null&&s.__b>0?ze(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,a=null,(c=s.__i=yl(s,n,l,d))!=-1&&(d--,(a=n[c])&&(a.__u|=2)),a==null||a.__v==null?(c==-1&&(r>u?p--:r<u&&p++),typeof s.type!="function"&&(s.__u|=4)):c!=l&&(c==l-1?p--:c==l+1?p++:(c>l?p--:p++,s.__u|=4))):t.__k[i]=null;if(d)for(i=0;i<u;i++)(a=n[i])!=null&&!(2&a.__u)&&(a.__e==o&&(o=Se(a)),hs(a,a));return o}function cs(t,e,n,o){var r,i;if(typeof t.type=="function"){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,e=cs(r[i],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=Se(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function jt(t,e){return e=e||[],t==null||typeof t=="boolean"||(Ve(t)?t.some(function(n){jt(n,e)}):e.push(t)),e}function yl(t,e,n,o){var r,i,s,a=t.key,l=t.type,c=e[n],u=c!=null&&(2&c.__u)==0;if(c===null&&t.key==null||u&&a==c.key&&l==c.type)return n;if(o>(u?1:0)){for(r=n-1,i=n+1;r>=0||i<e.length;)if((c=e[s=r>=0?r--:i++])!=null&&!(2&c.__u)&&a==c.key&&l==c.type)return s}return-1}function Br(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||ml.test(e)?n:n+"px"}function cn(t,e,n,o,r){var i,s;t:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||Br(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||Br(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(rs,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?o?n.u=o.u:(n.u=Po,t.addEventListener(e,i?so:io,i)):t.removeEventListener(e,i?so:io,i);else{if(r=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break t}catch{}typeof n=="function"||(n==null||n===false&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function $r(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Po++;else if(e.t<n.u)return;return n(G.event?G.event(e):e)}}}function Oo(t,e,n,o,r,i,s,a,l,c){var u,d,p,f,m,g,_,y,b,x,C,A,T,N,W,j,J,V=e.type;if(e.constructor!=null)return null;128&n.__u&&(l=!!(32&n.__u),i=[a=e.__e=n.__e]),(u=G.__b)&&u(e);t:if(typeof V=="function")try{if(y=e.props,b="prototype"in V&&V.prototype.render,x=(u=V.contextType)&&o[u.__c],C=u?x?x.props.value:u.__:o,n.__c?_=(d=e.__c=n.__c).__=d.__E:(b?e.__c=d=new V(y,C):(e.__c=d=new $t(y,C),d.constructor=V,d.render=bl),x&&x.sub(d),d.props=y,d.state||(d.state={}),d.context=C,d.__n=o,p=d.__d=true,d.__h=[],d._sb=[]),b&&d.__s==null&&(d.__s=d.state),b&&V.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=Bt({},d.__s)),Bt(d.__s,V.getDerivedStateFromProps(y,d.__s))),f=d.props,m=d.state,d.__v=e,p)b&&V.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),b&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(b&&V.getDerivedStateFromProps==null&&y!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(y,C),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(y,d.__s,C)===false||e.__v==n.__v){for(e.__v!=n.__v&&(d.props=y,d.state=d.__s,d.__d=false),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(K){K&&(K.__=e)}),A=0;A<d._sb.length;A++)d.__h.push(d._sb[A]);d._sb=[],d.__h.length&&s.push(d);break t}d.componentWillUpdate!=null&&d.componentWillUpdate(y,d.__s,C),b&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,m,g)})}if(d.context=C,d.props=y,d.__P=t,d.__e=false,T=G.__r,N=0,b){for(d.state=d.__s,d.__d=false,T&&T(e),u=d.render(d.props,d.state,d.context),W=0;W<d._sb.length;W++)d.__h.push(d._sb[W]);d._sb=[]}else do d.__d=false,T&&T(e),u=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++N<25);d.state=d.__s,d.getChildContext!=null&&(o=Bt(Bt({},o),d.getChildContext())),b&&!p&&d.getSnapshotBeforeUpdate!=null&&(g=d.getSnapshotBeforeUpdate(f,m)),j=u,u!=null&&u.type===mt&&u.key==null&&(j=ds(u.props.children)),a=ls(t,Ve(j)?j:[j],e,n,o,r,i,s,a,l,c),d.base=e.__e,e.__u&=-161,d.__h.length&&s.push(d),_&&(d.__E=d.__=null)}catch(K){if(e.__v=null,l||i!=null)if(K.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,e.__e=a}else{for(J=i.length;J--;)Ao(i[J]);lo(e)}else e.__e=n.__e,e.__k=n.__k,K.then||lo(e);G.__e(K,e,n)}else i==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):a=e.__e=_l(n.__e,e,n,o,r,i,s,l,c);return(u=G.diffed)&&u(e),128&e.__u?void 0:a}function lo(t){t&&t.__c&&(t.__c.__e=true),t&&t.__k&&t.__k.forEach(lo)}function us(t,e,n){for(var o=0;o<n.length;o++)No(n[o],n[++o],n[++o]);G.__c&&G.__c(e,t),t.some(function(r){try{t=r.__h,r.__h=[],t.some(function(i){i.call(r)})}catch(i){G.__e(i,r.__v)}})}function ds(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:Ve(t)?t.map(ds):Bt({},t)}function _l(t,e,n,o,r,i,s,a,l){var c,u,d,p,f,m,g,_=n.props,y=e.props,b=e.type;if(b=="svg"?r="http://www.w3.org/2000/svg":b=="math"?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((f=i[c])&&"setAttribute"in f==!!b&&(b?f.localName==b:f.nodeType==3)){t=f,i[c]=null;break}}if(t==null){if(b==null)return document.createTextNode(y);t=document.createElementNS(r,b,y.is&&y),a&&(G.__m&&G.__m(e,i),a=false),i=null}if(b==null)_===y||a&&t.data==y||(t.data=y);else{if(i=i&&je.call(t.childNodes),_=n.props||De,!a&&i!=null)for(_={},c=0;c<t.attributes.length;c++)_[(f=t.attributes[c]).name]=f.value;for(c in _)if(f=_[c],c!="children"){if(c=="dangerouslySetInnerHTML")d=f;else if(!(c in y)){if(c=="value"&&"defaultValue"in y||c=="checked"&&"defaultChecked"in y)continue;cn(t,c,null,f,r)}}for(c in y)f=y[c],c=="children"?p=f:c=="dangerouslySetInnerHTML"?u=f:c=="value"?m=f:c=="checked"?g=f:a&&typeof f!="function"||_[c]===f||cn(t,c,f,_[c],r);if(u)a||d&&(u.__html==d.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(d&&(t.innerHTML=""),ls(e.type=="template"?t.content:t,Ve(p)?p:[p],e,n,o,b=="foreignObject"?"http://www.w3.org/1999/xhtml":r,i,s,i?i[0]:n.__k&&Se(n,0),a,l),i!=null)for(c=i.length;c--;)Ao(i[c]);a||(c="value",b=="progress"&&m==null?t.removeAttribute("value"):m!=null&&(m!==t[c]||b=="progress"&&!m||b=="option"&&m!=_[c])&&cn(t,c,m,_[c],r),c="checked",g!=null&&g!=t[c]&&cn(t,c,g,_[c],r))}return t}function No(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(r){G.__e(r,n)}}function hs(t,e,n){var o,r;if(G.unmount&&G.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||No(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(i){G.__e(i,e)}o.base=o.__P=null}if(o=t.__k)for(r=0;r<o.length;r++)o[r]&&hs(o[r],e,n||typeof t.type!="function");n||Ao(t.__e),t.__c=t.__=t.__e=void 0}function bl(t,e,n){return this.constructor(t,n)}function We(t,e,n){var o,r,i,s;e==document&&(e=document.documentElement),G.__&&G.__(t,e),r=(o=typeof n=="function")?null:n&&n.__k||e.__k,i=[],s=[],Oo(e,t=(!o&&n||e).__k=Vt(mt,null,[t]),r||De,De,e.namespaceURI,!o&&n?[n]:r?null:e.firstChild?je.call(e.childNodes):null,i,!o&&n?n:r?r.__e:e.firstChild,o,s),us(i,t,s)}function fs(t,e){We(t,e,fs)}function wl(t,e,n){var o,r,i,s,a=Bt({},t.props);for(i in t.type&&t.type.defaultProps&&(s=t.type.defaultProps),e)i=="key"?o=e[i]:i=="ref"?r=e[i]:a[i]=e[i]===void 0&&s!=null?s[i]:e[i];return arguments.length>2&&(a.children=arguments.length>3?je.call(arguments,2):n),ze(t.type,a,o||t.key,r||t.ref,null)}function Kt(t){function e(n){var o,r;return this.getChildContext||(o=new Set,(r={})[e.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&o.forEach(function(s){s.__e=true,ao(s)})},this.sub=function(i){o.add(i);var s=i.componentWillUnmount;i.componentWillUnmount=function(){o&&o.delete(i),s&&s.call(i)}}),n.children}return e.__c="__cC"+is++,e.__=t,e.Provider=e.__l=(e.Consumer=function(n,o){return n.children(o)}).contextType=e,e}je=ss.slice,G={__e:function(t,e,n,o){for(var r,i,s;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&i.getDerivedStateFromError!=null&&(r.setState(i.getDerivedStateFromError(t)),s=r.__d),r.componentDidCatch!=null&&(r.componentDidCatch(t,o||{}),s=r.__d),s)return r.__E=r}catch(a){t=a}throw t}},es=0,$t.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Bt({},this.state),typeof t=="function"&&(t=t(Bt({},n),this.props)),t&&Bt(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),ao(this))},$t.prototype.forceUpdate=function(t){this.__v&&(this.__e=true,t&&this.__h.push(t),ao(this))},$t.prototype.render=mt,ae=[],ns=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,os=function(t,e){return t.__v.__b-e.__v.__b},vn.__r=0,rs=/(PointerCapture)$|Capture$/i,Po=0,io=$r(false),so=$r(true),is=0;var xl=0;function h(t,e,n,o,r,i){e||(e={});var s,a,l=e;if("ref"in l)for(a in l={},e)a=="ref"?s=e[a]:l[a]=e[a];var c={type:t,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--xl,__i:-1,__u:0,__source:r,__self:i};if(typeof t=="function"&&(s=t.defaultProps))for(a in s)l[a]===void 0&&(l[a]=s[a]);return G.vnode&&G.vnode(c),c}var Gt,lt,qn,Fr,ke=0,ps=[],ft=G,zr=ft.__b,Hr=ft.__r,Dr=ft.diffed,Wr=ft.__c,Ur=ft.unmount,jr=ft.__;function Te(t,e){ft.__h&&ft.__h(lt,t,ke||e),ke=0;var n=lt.__H||(lt.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function D(t){return ke=1,Ro(vs,t)}function Ro(t,e,n){var o=Te(Gt++,2);if(o.t=t,!o.__c&&(o.__=[n?n(e):vs(void 0,e),function(a){var l=o.__N?o.__N[0]:o.__[0],c=o.t(l,a);l!==c&&(o.__N=[c,o.__[1]],o.__c.setState({}))}],o.__c=lt,!lt.__f)){var r=function(a,l,c){if(!o.__c.__H)return true;var u=o.__c.__H.__.filter(function(p){return!!p.__c});if(u.every(function(p){return!p.__N}))return!i||i.call(this,a,l,c);var d=o.__c.props!==a;return u.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(d=true)}}),i&&i.call(this,a,l,c)||d};lt.__f=true;var i=lt.shouldComponentUpdate,s=lt.componentWillUpdate;lt.componentWillUpdate=function(a,l,c){if(this.__e){var u=i;i=void 0,r(a,l,c),i=u}s&&s.call(this,a,l,c)},lt.shouldComponentUpdate=r}return o.__N||o.__}function H(t,e){var n=Te(Gt++,3);!ft.__s&&$o(n.__H,e)&&(n.__=t,n.u=e,lt.__H.__h.push(n))}function Tt(t,e){var n=Te(Gt++,4);!ft.__s&&$o(n.__H,e)&&(n.__=t,n.u=e,lt.__h.push(n))}function $(t){return ke=5,pt(function(){return{current:t}},[])}function ms(t,e,n){ke=6,Tt(function(){if(typeof t=="function"){var o=t(e());return function(){t(null),o&&typeof o=="function"&&o()}}if(t)return t.current=e(),function(){return t.current=null}},n==null?n:n.concat(t))}function pt(t,e){var n=Te(Gt++,7);return $o(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function ot(t,e){return ke=8,pt(function(){return t},e)}function Et(t){var e=lt.context[t.__c],n=Te(Gt++,9);return n.c=t,e?(n.__==null&&(n.__=true,e.sub(lt)),e.props.value):t.__}function gs(t,e){ft.useDebugValue&&ft.useDebugValue(e?e(t):t)}function Bo(){var t=Te(Gt++,11);if(!t.__){for(var e=lt.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var n=e.__m||(e.__m=[0,0]);t.__="P"+n[0]+"-"+n[1]++}return t.__}function Sl(){for(var t;t=ps.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(mn),t.__H.__h.forEach(co),t.__H.__h=[]}catch(e){t.__H.__h=[],ft.__e(e,t.__v)}}ft.__b=function(t){lt=null,zr&&zr(t)},ft.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),jr&&jr(t,e)},ft.__r=function(t){Hr&&Hr(t),Gt=0;var e=(lt=t.__c).__H;e&&(qn===lt?(e.__h=[],lt.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(mn),e.__h.forEach(co),e.__h=[],Gt=0)),qn=lt},ft.diffed=function(t){Dr&&Dr(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(ps.push(e)!==1&&Fr===ft.requestAnimationFrame||((Fr=ft.requestAnimationFrame)||kl)(Sl)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),qn=lt=null},ft.__c=function(t,e){e.some(function(n){try{n.__h.forEach(mn),n.__h=n.__h.filter(function(o){return!o.__||co(o)})}catch(o){e.some(function(r){r.__h&&(r.__h=[])}),e=[],ft.__e(o,n.__v)}}),Wr&&Wr(t,e)},ft.unmount=function(t){Ur&&Ur(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(o){try{mn(o)}catch(r){e=r}}),n.__H=void 0,e&&ft.__e(e,n.__v))};var Vr=typeof requestAnimationFrame=="function";function kl(t){var e,n=function(){clearTimeout(o),Vr&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);Vr&&(e=requestAnimationFrame(n))}function mn(t){var e=lt,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),lt=e}function co(t){var e=lt;t.__c=t.__(),lt=e}function $o(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function vs(t,e){return typeof e=="function"?e(t):e}function ys(t,e){for(var n in e)t[n]=e[n];return t}function uo(t,e){for(var n in t)if(n!=="__source"&&!(n in e))return true;for(var o in e)if(o!=="__source"&&t[o]!==e[o])return true;return false}function Ft(t,e){var n=e(),o=D({t:{__:n,u:e}}),r=o[0].t,i=o[1];return Tt(function(){r.__=n,r.u=e,Kn(r)&&i({t:r})},[t,n,e]),H(function(){return Kn(r)&&i({t:r}),t(function(){Kn(r)&&i({t:r})})},[t]),n}function Kn(t){var e,n,o=t.u,r=t.__;try{var i=o();return!((e=r)===(n=i)&&(e!==0||1/e==1/n)||e!=e&&n!=n)}catch{return true}}function _s(t){t()}function bs(t){return t}function ws(){return[false,_s]}var xs=Tt;function ho(t,e){this.props=t,this.context=e}function El(t,e){function n(r){var i=this.props.ref,s=i==r.ref;return!s&&i&&(i.call?i(null):i.current=null),e?!e(this.props,r)||!s:uo(this.props,r)}function o(r){return this.shouldComponentUpdate=n,Vt(t,r)}return o.displayName="Memo("+(t.displayName||t.name)+")",o.prototype.isReactComponent=true,o.__f=true,o.type=t,o}(ho.prototype=new $t).isPureReactComponent=true,ho.prototype.shouldComponentUpdate=function(t,e){return uo(this.props,t)||uo(this.state,e)};var qr=G.__b;G.__b=function(t){t.type&&t.type.__f&&t.ref&&(t.props.ref=t.ref,t.ref=null),qr&&qr(t)};var Cl=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Ct(t){function e(n){var o=ys({},n);return delete o.ref,t(o,n.ref||null)}return e.$$typeof=Cl,e.render=t,e.prototype.isReactComponent=e.__f=true,e.displayName="ForwardRef("+(t.displayName||t.name)+")",e}var Kr=function(t,e){return t==null?null:jt(jt(t).map(e))},Ml={map:Kr,forEach:Kr,count:function(t){return t?jt(t).length:0},only:function(t){var e=jt(t);if(e.length!==1)throw"Children.only";return e[0]},toArray:jt},Tl=G.__e;G.__e=function(t,e,n,o){if(t.then){for(var r,i=e;i=i.__;)if((r=i.__c)&&r.__c)return e.__e==null&&(e.__e=n.__e,e.__k=n.__k),r.__c(t,e)}Tl(t,e,n,o)};var Zr=G.unmount;function Ss(t,e,n){return t&&(t.__c&&t.__c.__H&&(t.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),t.__c.__H=null),(t=ys({},t)).__c!=null&&(t.__c.__P===n&&(t.__c.__P=e),t.__c.__e=true,t.__c=null),t.__k=t.__k&&t.__k.map(function(o){return Ss(o,e,n)})),t}function ks(t,e,n){return t&&n&&(t.__v=null,t.__k=t.__k&&t.__k.map(function(o){return ks(o,e,n)}),t.__c&&t.__c.__P===e&&(t.__e&&n.appendChild(t.__e),t.__c.__e=true,t.__c.__P=n)),t}function Mt(){this.__u=0,this.o=null,this.__b=null}function Es(t){var e=t.__.__c;return e&&e.__a&&e.__a(t)}function bt(t){var e,n,o;function r(i){if(e||(e=t()).then(function(s){n=s.default||s},function(s){o=s}),o)throw o;if(!n)throw e;return Vt(n,i)}return r.displayName="Lazy",r.__f=true,r}function $e(){this.i=null,this.l=null}G.unmount=function(t){var e=t.__c;e&&e.__R&&e.__R(),e&&32&t.__u&&(t.type=null),Zr&&Zr(t)},(Mt.prototype=new $t).__c=function(t,e){var n=e.__c,o=this;o.o==null&&(o.o=[]),o.o.push(n);var r=Es(o.__v),i=false,s=function(){i||(i=true,n.__R=null,r?r(a):a())};n.__R=s;var a=function(){if(!--o.__u){if(o.state.__a){var l=o.state.__a;o.__v.__k[0]=ks(l,l.__c.__P,l.__c.__O)}var c;for(o.setState({__a:o.__b=null});c=o.o.pop();)c.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),t.then(s,s)},Mt.prototype.componentWillUnmount=function(){this.o=[]},Mt.prototype.render=function(t,e){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=Ss(this.__b,n,o.__O=o.__P)}this.__b=null}var r=e.__a&&Vt(mt,null,t.fallback);return r&&(r.__u&=-33),[Vt(mt,null,e.__a?null:t.children),r]};var Xr=function(t,e,n){if(++n[1]===n[0]&&t.l.delete(e),t.props.revealOrder&&(t.props.revealOrder[0]!=="t"||!t.l.size))for(n=t.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;t.i=n=n[2]}};function Ll(t){return this.getChildContext=function(){return t.context},t.children}function Il(t){var e=this,n=t.h;if(e.componentWillUnmount=function(){We(null,e.v),e.v=null,e.h=null},e.h&&e.h!==n&&e.componentWillUnmount(),!e.v){for(var o=e.__v;o!==null&&!o.__m&&o.__!==null;)o=o.__;e.h=n,e.v={nodeType:1,parentNode:n,childNodes:[],__k:{__m:o.__m},contains:function(){return true},insertBefore:function(r,i){this.childNodes.push(r),e.h.insertBefore(r,i)},removeChild:function(r){this.childNodes.splice(this.childNodes.indexOf(r)>>>1,1),e.h.removeChild(r)}}}We(Vt(Ll,{context:e.context},t.__v),e.v)}function Pl(t,e){var n=Vt(Il,{__v:t,h:e});return n.containerInfo=e,n}($e.prototype=new $t).__a=function(t){var e=this,n=Es(e.__v),o=e.l.get(t);return o[0]++,function(r){var i=function(){e.props.revealOrder?(o.push(r),Xr(e,t,o)):r()};n?n(i):i()}},$e.prototype.render=function(t){this.i=null,this.l=new Map;var e=jt(t.children);t.revealOrder&&t.revealOrder[0]==="b"&&e.reverse();for(var n=e.length;n--;)this.l.set(e[n],this.i=[1,0,this.i]);return t.children},$e.prototype.componentDidUpdate=$e.prototype.componentDidMount=function(){var t=this;this.l.forEach(function(e,n){Xr(t,n,e)})};var Cs=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Al=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Ol=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Nl=/[A-Z0-9]/g,Rl=typeof document<"u",Bl=function(t){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(t)};function $l(t,e,n){return e.__k==null&&(e.textContent=""),We(t,e),typeof n=="function"&&n(),t?t.__c:null}function Fl(t,e,n){return fs(t,e),typeof n=="function"&&n(),t?t.__c:null}$t.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(t){Object.defineProperty($t.prototype,t,{configurable:true,get:function(){return this["UNSAFE_"+t]},set:function(e){Object.defineProperty(this,t,{configurable:true,writable:true,value:e})}})});var Yr=G.event;function zl(){}function Hl(){return this.cancelBubble}function Dl(){return this.defaultPrevented}G.event=function(t){return Yr&&(t=Yr(t)),t.persist=zl,t.isPropagationStopped=Hl,t.isDefaultPrevented=Dl,t.nativeEvent=t};var Fo,Wl={enumerable:false,configurable:true,get:function(){return this.class}},Gr=G.vnode;G.vnode=function(t){typeof t.type=="string"&&function(e){var n=e.props,o=e.type,r={},i=o.indexOf("-")===-1;for(var s in n){var a=n[s];if(!(s==="value"&&"defaultValue"in n&&a==null||Rl&&s==="children"&&o==="noscript"||s==="class"||s==="className")){var l=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&a===true?a="":l==="translate"&&a==="no"?a=false:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?s="ondblclick":l!=="onchange"||o!=="input"&&o!=="textarea"||Bl(n.type)?l==="onfocus"?s="onfocusin":l==="onblur"?s="onfocusout":Ol.test(s)&&(s=l):l=s="oninput":i&&Al.test(s)?s=s.replace(Nl,"-$&").toLowerCase():a===null&&(a=void 0),l==="oninput"&&r[s=l]&&(s="oninputCapture"),r[s]=a}}o=="select"&&r.multiple&&Array.isArray(r.value)&&(r.value=jt(n.children).forEach(function(c){c.props.selected=r.value.indexOf(c.props.value)!=-1})),o=="select"&&r.defaultValue!=null&&(r.value=jt(n.children).forEach(function(c){c.props.selected=r.multiple?r.defaultValue.indexOf(c.props.value)!=-1:r.defaultValue==c.props.value})),n.class&&!n.className?(r.class=n.class,Object.defineProperty(r,"className",Wl)):(n.className&&!n.class||n.class&&n.className)&&(r.class=r.className=n.className),e.props=r}(t),t.$$typeof=Cs,Gr&&Gr(t)};var Jr=G.__r;G.__r=function(t){Jr&&Jr(t),Fo=t.__c};var Qr=G.diffed;G.diffed=function(t){Qr&&Qr(t);var e=t.props,n=t.__e;n!=null&&t.type==="textarea"&&"value"in e&&e.value!==n.value&&(n.value=e.value==null?"":e.value),Fo=null};var Ul={ReactCurrentDispatcher:{current:{readContext:function(t){return Fo.__n[t.__c].props.value},useCallback:ot,useContext:Et,useDebugValue:gs,useDeferredValue:bs,useEffect:H,useId:Bo,useImperativeHandle:ms,useInsertionEffect:xs,useLayoutEffect:Tt,useMemo:pt,useReducer:Ro,useRef:$,useState:D,useSyncExternalStore:Ft,useTransition:ws}}};function jl(t){return Vt.bind(null,t)}function Mn(t){return!!t&&t.$$typeof===Cs}function Vl(t){return Mn(t)&&t.type===mt}function ql(t){return!!t&&!!t.displayName&&(typeof t.displayName=="string"||t.displayName instanceof String)&&t.displayName.startsWith("Memo(")}function Kl(t){return Mn(t)?wl.apply(null,arguments):t}function Zl(t){return!!t.__k&&(We(null,t),true)}function Xl(t){return t&&(t.base||t.nodeType===1&&t)||null}var Yl=function(t,e){return t(e)},Gl=function(t,e){return t(e)},Jl=mt,Ql=Mn,qt={useState:D,useId:Bo,useReducer:Ro,useEffect:H,useLayoutEffect:Tt,useInsertionEffect:xs,useTransition:ws,useDeferredValue:bs,useSyncExternalStore:Ft,startTransition:_s,useRef:$,useImperativeHandle:ms,useMemo:pt,useCallback:ot,useContext:Et,useDebugValue:gs,version:"18.3.1",Children:Ml,render:$l,hydrate:Fl,unmountComponentAtNode:Zl,createPortal:Pl,createElement:Vt,createContext:Kt,createFactory:jl,cloneElement:Kl,createRef:gl,Fragment:mt,isValidElement:Mn,isElement:Ql,isFragment:Vl,isMemo:ql,findDOMNode:Xl,Component:$t,PureComponent:ho,memo:El,forwardRef:Ct,flushSync:Gl,unstable_batchedUpdates:Yl,StrictMode:Jl,Suspense:Mt,SuspenseList:$e,lazy:bt,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Ul};const Le=Kt(void 0),ct=(...t)=>t.filter(Boolean).join(" "),Tn=Kt(null);function Qt(){return Et(Tn)}function te(t="This part"){const e=Et(Tn);if(!e)throw new Error(`${t} must be rendered inside <Clover.Root>.`);return e}function nt(t,e=Object.is,n){const{clover:o}=te(n),r=$(null),i=()=>{const s=t(o.store.get());return r.current&&e(r.current.value,s)?r.current.value:(r.current={value:s},s)};return Ft(o.store.subscribe,i)}const tc={subscribe:()=>()=>{}};function qe(t,e){const n=Et(Tn),o=n==null?void 0:n.clover.store,r=()=>o?t(o.get()):e;return Ft(o?o.subscribe:tc.subscribe,r)}const ec=JSON.parse('{"commonClose":"Close","commonNext":"Next","commonPrevious":"Previous","commonSearch":"Search","commonViewAll":"View all","controlShortcut":"{{label}} ({{shortcut}})","contentSearchLoading":"Loading...","contentSearchPlaceholder":"Search","contentSearchResultsNone":"No results","contentSearchResult":"1 result","contentSearchResults":"{{count}} results","contentSearchError":"The search could not be completed.","contentSearchPosition":"Result {{index}} of {{total}}","contentSearchClear":"Clear search","canvasPosition":"Item {{index}} of {{total}}","canvasImage":"Image","canvasRoleDescription":"zoomable image","canvasKeysImage":"Use the arrow keys to pan, with Shift for larger steps, plus and minus to zoom, 0 to reset the view, and R or Shift+R to rotate.","canvasKeysMedia":"Press Space or K to play or pause, J or L to skip ten seconds back or forward, and M to mute or unmute.","canvasKeysAnnotations":"Press Escape to clear the selected annotation.","sceneModel":"3D model","sceneRoleDescription":"rotatable 3D model","sceneKeys":"Use the arrow keys to rotate the model, with Shift for larger steps, plus and minus to zoom, 0 to reset the view, and R or Shift+R to rotate it right or left.","sceneRotateUp":"Rotate up","sceneRotateDown":"Rotate down","sceneRotate":"Rotate","sceneResetView":"Reset view","statusLoading":"Loading\u2026","statusError":"This could not be loaded.","itemsLabel":"Items","download":"Download","downloadPage":"This page","downloadAll":"All pages","templateSidebar":"Items","templateSidebarToggle":"Show items","collectionLabel":"Collection","itemsScrollBack":"Show previous items","itemsScrollForward":"Show more items","aboutRights":"Rights","aboutHomepage":"Homepage","aboutSeeAlso":"See also","aboutProvider":"Provider","logo":"Logo","aboutManifest":"IIIF Manifest","aboutCanvas":"IIIF Canvas","aboutPartOf":"Part of","aboutOpenManifest":"Open the full Manifest","aboutCollection":"IIIF Collection","annotationsHide":"Hide annotations","annotationsHideTip":"Hide","readMore":"Read more","readLess":"Read less","annotationsShow":"Find on the image","annotationsShowTime":"Find in the recording","annotationsImage":"Image","annotationsLanguage":"Language","annotationsOpenLink":"Open the link","transcriptLabel":"Transcript","imageViewerOpen":"Open image viewer","imageViewerClose":"Close image viewer","canvasChoice":"Choice","imageFullScreen":"Full screen","imageExitFullScreen":"Exit full screen","imageResetZoom":"Reset zoom","imageRotateLeft":"Rotate left","imageRotateRight":"Rotate right","imageZoomIn":"Zoom in","imageZoomOut":"Zoom out","informationPanelTabs":"Information panel","sectionsScrollBack":"Show previous tabs","sectionsScrollForward":"Show more tabs","informationPanelClose":"Close information panel","informationPanelTabsAbout":"About","informationPanelTabsAnnotations":"Annotations","informationPanelTabsSearch":"Search","informationPanelTabsContents":"Contents","informationPanelTabsMap":"Map","informationPanelTabsCollection":"Collection","mapUnavailable":"The map could not be shown.","mapLabel":"Map","mapAttribution":"Map credits","mapPlaceUntitled":"Place {{number}}","mapOverlay":"Georeferenced image","mapPlacesListed":"Places listed after the map: {{count}}","informationPanelToggle":"More information","playerPlay":"Play","playerPause":"Pause","playerClose":"Close player","playerMute":"Mute","playerUnmute":"Unmute","playerVolume":"Volume","playerSeek":"Seek","playerCaptions":"Captions","playerCaptionsOff":"Off","playerChapters":"Chapters","framePrevious":"Previous frame","frameNext":"Next frame","frameSeek":"Frame","frameRepeat":"Repeat","framePosition":"Frame {{index}} of {{total}}","playerCurrentTime":"Current time","playerDuration":"Duration","splitHandle":"Resize panels"}'),Ms={es:()=>import("../es-BwMkoRod.mjs"),fi:()=>import("../fi-gPFOn9RK.mjs"),fr:()=>import("../fr-DUHmgdJo.mjs"),nb:()=>import("../nb-BSvnQ6jd.mjs"),nn:()=>import("../nn-Dg2_HdZu.mjs"),no:()=>import("../no-BSvnQ6jd.mjs"),pt:()=>import("../pt-B3J80JgO.mjs")};function Ts(){const t=[];return typeof document<"u"&&t.push(document.documentElement.lang),typeof navigator<"u"&&t.push(...navigator.languages??[],navigator.language),t.filter(Boolean)}const Wt="clover",Rt={en:{[Wt]:{...ec}}};let be,Ls=[],yn=0;const fo=new Set;function zo(){yn++,fo.forEach(t=>t())}function nc(t){const e=t.split("-")[0];return e&&e!==t?[t,e]:[t]}const ti=new Map,oc=t=>Object.prototype.hasOwnProperty.call(Ms,t);function rc(t){let e=ti.get(t);return e||(e=Ms[t]().then(({default:n})=>{var o;Rt[t]={...Rt[t],[Wt]:{...n,...(o=Rt[t])==null?void 0:o[Wt]}},zo()},()=>{}),ti.set(t,e)),e}function Is(t){const e=t.find(n=>n==="en"||oc(n));return e&&e!=="en"?rc(e):Promise.resolve()}let un=[],ei="";function Fe(){const t=be?`${yn}`:`${yn} ${typeof document<"u"?document.documentElement.lang:""} ${typeof navigator<"u"?navigator.languages:""}`;if(t===ei)return un;ei=t;const e=be?[be]:Ts();return un=[...new Set([...e,...Ls].flatMap(nc).concat("en"))],Is(un),un}function Ps(t,e){const n=o=>o.split("-")[0].toLowerCase();return n(t)===n(e)}function Ho(t,e){if(t)return Ps(t,e||Nt.resolvedLanguage)?void 0:t}const Nt={get language(){return be??Fe().find(t=>Rt[t])??"en"},get resolvedLanguage(){return Fe().find(t=>{var e;return Object.keys(((e=Rt[t])==null?void 0:e[Wt])??{}).length>0})??"en"},changeLanguage(t){be=t,zo()},resolve(t,e,n=Wt){var r,i;let o={text:t};for(const s of Fe()){const a=(i=(r=Rt[s])==null?void 0:r[n])==null?void 0:i[t];if(a!==void 0){o={text:a,lang:s};break}}return e?{...o,text:o.text.replace(/\{\{(\w+)\}\}/g,(s,a)=>a in e?String(e[a]):s)}:o},t(t,e,n=Wt){return Nt.resolve(t,e,n).text},langOf(t,e,n=Wt){return Ho(Nt.resolve(t,void 0,n).lang,e)},ready(){return Is(Fe())},subscribe(t){return fo.add(t),()=>{fo.delete(t)}},getSnapshot(){return yn}};typeof document<"u"&&Fe();function ic(t={}){for(const[e,n]of Object.entries(t.resources??{}))for(const[o,r]of Object.entries(n??{}))Rt[e]??(Rt[e]={}),Rt[e][o]={...Rt[e][o],...r};return t.fallbackLng!==void 0&&(Ls=t.fallbackLng===false?[]:[t.fallbackLng].flat()),t.lng&&(be=t.lng),zo(),Nt}const sc=Object.freeze(Object.defineProperty({__proto__:null,CLOVER_I18N_NAMESPACE:Wt,cloverI18n:Nt,initCloverI18n:ic,langWithin:Ho,sameLanguage:Ps},Symbol.toStringTag,{value:"Module"}));function dt(t=Wt,e){const n=Ft(Nt.subscribe,Nt.getSnapshot,Nt.getSnapshot),o=Et(Le),r=e??o,i=ot((a,l)=>Nt.t(a,l,t),[t,n]),s=ot(a=>Nt.langOf(a,r,t),[t,n,r]);return{t:i,langOf:s,hostLanguage:r,i18n:Nt}}function Ke(t,e){const n=Et(Le),o=$(null),[r,i]=D(""),s=ot(u=>{o.current=u,typeof t=="function"?t(u):t&&(t.current=u)},[t]);H(()=>{var d,p;const u=(d=o.current)==null?void 0:d.parentElement;e!==void 0||n!==void 0||!u||i(((p=u.closest("[lang]"))==null?void 0:p.getAttribute("lang"))??"")});const l=e??n??r,{langOf:c}=dt(void 0,l);return{ref:s,hostLanguage:l,langOf:c}}const U=t=>Array.isArray(t)?t:t==null?[]:[t],ac=["left-to-right","right-to-left","top-to-bottom","bottom-to-top"];function As(t){return ac.includes(t)?t:"left-to-right"}const lc=["individuals","paged","continuous","unordered"];function cc(t){return U(t).find(n=>lc.includes(n))??"individuals"}function uc(t,e){if(!t.length)return[];if(e==="continuous")return[t.map((a,l)=>l)];if(e!=="paged")return t.map((a,l)=>[l]);const n=[];let o=[],r=0,i=false;const s=()=>{o.length&&n.push(o),o=[]};return t.forEach((a,l)=>{const c=U(a.behavior);if(c.includes("non-paged")){l===r&&r++,s(),n.push([l]);return}if(l===r||c.includes("facing-pages")){o.length&&(i=true),s(),n.push([l]);return}if(o.push(l),i){s(),i=false;return}o.length>1&&s()}),s(),n}function dc(t,e){const n=t.findIndex(o=>o.includes(e));return n===-1?0:n}const Os=["Independents","Composite","List"];function Do(t){return U(t==null?void 0:t.body).flatMap(e=>Os.includes(e==null?void 0:e.type)?U(e.items):[e])}function Wo(t){const e=U(t==null?void 0:t.motivation);return!e.length||e.includes("painting")}function Ns(t,e){const n=/(?:^|[#&])t=([^&]+)/.exec(e),o=n&&{t:n[1]},r=/(?:^|[#&])xywh=(?:pixel:)?([^&]+)/.exec(e);if(r){const[i,s,a,l]=r[1].split(",").map(Number);if([i,s,a,l].every(Number.isFinite))return{id:t,rect:{x:i,y:s,w:a,h:l},...o}}return o&&{id:t,...o}}function dn(t){const e=t.indexOf("#");if(e>=0){const o=t.slice(0,e);return Ns(o,t.slice(e))??{id:o}}const n=t.indexOf("&t=");return n>=0?{id:t.slice(0,n),t:t.slice(n+3)}:{id:t}}const po=t=>{var e;return Array.isArray(t)?po(t[0]):Os.includes(t==null?void 0:t.type)?po((e=t.items)==null?void 0:e[0]):t};function Ie(t){return hc(po(t))}function hc(t){var n;if(typeof t=="string")return dn(t);if(!t||typeof t!="object")return{id:""};if(t.type!=="SpecificResource"||t.source===void 0)return dn(t.id??"");const e=typeof t.source=="string"?dn(t.source):dn(((n=t.source)==null?void 0:n.id)??"");for(const o of U(t.selector)){const r=o;if((r==null?void 0:r.type)==="PointSelector")return{id:e.id,point:{x:Number(r.x),y:Number(r.y)}};if((r==null?void 0:r.type)==="SvgSelector"&&r.value)return{id:e.id,svg:String(r.value)};if((r==null?void 0:r.type)==="FragmentSelector"&&r.value){const i=Ns(e.id,String(r.value));if(i)return i}}return e}const Uo=t=>t==="Audio"||t==="Sound",fc=t=>{const e=U(t);return e.length>0&&e.every(n=>n==="supplementing")},pc=(t,e)=>fc(t)&&!!(e.rect||e.svg||e.point)&&!e.t,ni=new WeakMap,mc={canvases:[],views:[],direction:"left-to-right"};function xt(t){if(!t)return mc;let e=ni.get(t);if(!e){const n=(t.items??[]).filter(o=>(o==null?void 0:o.type)==="Canvas"||(o==null?void 0:o.type)==="Timeline"||(o==null?void 0:o.type)==="Scene");e={canvases:n,views:uc(n,cc(t.behavior)),direction:As(t.viewingDirection)},ni.set(t,e)}return e}const oi=new WeakMap;function ue(t,e){if(!e)return null;const n=xt(t);let o=oi.get(n);if(!o){o=new Map;for(const r of n.canvases)o.has(r.id)||o.set(r.id,r);oi.set(n,o)}return o.get(e)??null}function Ze(t,e){const{canvases:n,views:o}=xt(t),r=n.findIndex(i=>i.id===e);return r===-1?0:dc(o,r)}const ri=new WeakMap,gc=[];function we(t,e){if(!t)return gc;const n=Ze(t,e);let o=ri.get(t);o||ri.set(t,o=new Map);let r=o.get(n);if(!r){const i=xt(t);r=(i.views[n]??[]).map(s=>i.canvases[s]),o.set(n,r)}return r}function vc(t,e){var i,s;const{canvases:n,views:o}=xt(t),r=(i=o[e])==null?void 0:i[0];return r===void 0?null:((s=n[r])==null?void 0:s.id)??null}function yc(t){const e=t==null?void 0:t.start;if(!e)return null;const n=Ie(e);if(!n.id)return null;const o={canvasId:n.id};n.rect&&(o.region=n.rect);const r=n.t?Number(n.t.split(",")[0]):NaN;return Number.isFinite(r)&&(o.time=r),o}const se=(t,e)=>{const n=t==null?void 0:t.behavior;return Array.isArray(n)?n.includes(e):n===e},_c=t=>[(t==null?void 0:t.partOf)??[]].flat().find(e=>(e==null?void 0:e.id)&&e.type==="Collection"),Zn=t=>t.indexOf("-")===-1?null:t.slice(0,t.indexOf("-"));function bc(t,e,n=[]){if(!e.length)return;if(e.length===1)return e[0];const o=()=>e.includes("none")?"none":e.includes("@none")?"@none":e[0];if(!t)return e.includes("none")?"none":e[0];if(e.includes(t))return t;const r=Zn(t);if(r&&e.includes(r))return r;const i=n.find(a=>e.includes(a));if(i)return i;const s=e.findIndex(a=>Zn(a)===t);if(s!==-1)return e[s];for(const a of n){const l=Zn(a);if(l&&e.includes(l))return l}return o()}function at(t,e,n=", "){if(!t)return{text:""};if(typeof t=="string")return{text:t};const o=Object.keys(t).filter(c=>{var u;return(u=t[c])==null?void 0:u.length});if(!o.length)return{text:""};const[r,...i]=e?[e]:Ts(),s=bc(r,o,i)??o[0],a=t[s];return{text:Array.isArray(a)?a.join(n):String(a),lang:s==="none"?void 0:s}}const le={position:"absolute",width:1,height:1,margin:-1,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap",border:0};function wc({clover:t,language:e}){const{t:n,langOf:o}=dt(),[r,i]=D(null),s=$(n);return s.current=n,H(()=>{let a=null;return t.store.subscribe(()=>{const{manifest:l,canvasId:c,status:u}=t.store.get();if(u!=="ready"||c===a)return;const d=a===null;if(a=c,d)return;const p=ue(l,c),f=at(p==null?void 0:p.label,e),m=s.current("canvasPosition",{index:Ze(l,c)+1,total:xt(l).views.length});i({label:f.text,lang:f.lang,position:m})})},[t,e]),h("div",{className:"clover-announcer",role:"status","aria-live":"polite","aria-atomic":"true",style:le,children:[r!=null&&r.label?h(mt,{children:[h("span",{lang:r.lang,children:r.label}),","," "]}):null,r&&h("span",{lang:o("canvasPosition"),children:r.position})]})}const xc=t=>(t==null?void 0:t.format)==="text/vtt"||typeof(t==null?void 0:t.id)=="string"&&/\.vtt(\?|$)/i.test(t.id);function Sc(t){const e=[];for(let n of Do(t))if((n==null?void 0:n.type)==="Choice"&&(n=U(n.items)[0]),!(!n||xc(n))){if(n.type==="TextualBody"||typeof n.value=="string")e.push({value:String(n.value??""),format:n.format,language:U(n.language)[0]});else if(n.type==="Image"&&n.id){const o=n.label??t.label;e.push({image:n.id,format:n.format,...o?{label:o}:{}})}}return e}const jo="content-search",ii=/\/search\/([0-2])\//;function Rs(t){if(!t)return null;let e=null;for(const n of U(t.service)){const o=(n==null?void 0:n.id)??(n==null?void 0:n["@id"]);if(typeof o!="string")continue;const r=String(n.type??n["@type"]??""),i=[n.profile,n["@context"]].flat().map(a=>String(a??"")).join(" "),s=r==="SearchService2"?2:r==="SearchService1"?1:ii.test(i)?Number(ii.exec(i)[1])>=2?2:1:null;if(s===2)return{id:o,version:s};s===1&&(e??(e={id:o,version:s}))}return e}const kc=t=>U(t==null?void 0:t.motivation).includes("linking");function Bs(t,e,n){const o=[];for(const r of U(t==null?void 0:t.items)){const i=U(r==null?void 0:r.motivation);if(i.includes("painting"))continue;const s=Sc(r);if(!s.length&&!kc(r))continue;const a=Ie(U(r.target)[0]),l=a.id||n;!l||!r.id||o.push({id:r.id,setId:e,canvasId:l,target:a,motivation:i,bodies:s,annotation:r})}return o}const si=new WeakMap;function Ec(t){if(!t)return[];let e=si.get(t);if(!e){const n=new Map;for(const o of xt(t).canvases)for(const r of U(o.annotations)){if(!Array.isArray(r==null?void 0:r.items))continue;const i=r.id??`${o.id}#annotations`;let s=n.get(i);s||(s={id:i,label:r.label,source:"manifest",entries:[]},n.set(i,s)),s.entries.push(...Bs(r,i,o.id))}e=[...n.values()].filter(o=>o.entries.length),si.set(t,e)}return e}const ai=new WeakMap,li=[];function Vo(t,e){const n=Ec(t);if(!e.length)return n.length?n:li;const o=t??li;let r=ai.get(o);r||ai.set(o,r=new Map);let i=r.get(e);return i||(i=[...n,...e],r.set(e,i)),i}const ci=new WeakMap;function $s(t,e,n){const o=Vo(t,e);if(!(n!=null&&n.entries.length))return o;let r=ci.get(o);r||ci.set(o,r=new Map);let i=r.get(n);return i||(i=[...o,n],r.set(n,i)),i}const Cc=t=>Number(t==null?void 0:t.duration)>0;function Fs(t,e){return t.source==="search"||!t.entries.length?false:t.entries.every(n=>pc(n.motivation,n.target)&&!Cc(e(n.canvasId)))}const ui=new WeakMap;function Mc(t,e){const n=Vo(t,e);let o=ui.get(n);if(!o){const r=n.filter(i=>!Fs(i,s=>ue(t,s)??void 0));o=r.length===n.length?n:r,ui.set(n,o)}return o}const di=new WeakMap;function qo(t,e,n,o){const r=Vo(t,e),i=di.get(r);if(i&&i.hidden===n&&i.shown===o)return i.ids;const s=r.filter(l=>!n.includes(l.id)&&!o.includes(l.id)&&Fs(l,c=>ue(t,c)??void 0)).map(l=>l.id),a=s.length?[...n,...s]:n;return di.set(r,{hidden:n,shown:o,ids:a}),a}const hi=new WeakMap;function Tc(t,e,n,o){const r=qo(t,e,n,o),i=hi.get(r);if(i&&i.hidden===n)return i.ids;const s=[jo,...r.filter(a=>!n.includes(a))];return hi.set(r,{hidden:n,ids:s}),s}function Lc(t){for(const e of U(t==null?void 0:t.target)){const n=(e==null?void 0:e.type)==="SpecificResource"?e.source:e,o=U(n==null?void 0:n.partOf).find(r=>(r==null?void 0:r.id)&&(!r.type||r.type==="Manifest"));if(o)return o.id}}function Xn(t,e){if(!e)return null;for(const n of t){const o=n.entries.find(r=>r.id===e);if(o)return o}return null}function fi(t){const e=t;return!e||typeof e!="object"?false:e.type==="Annotation"?U(e.motivation).includes("contentState"):e.type==="SpecificResource"}function Ic(t){return btoa(encodeURIComponent(JSON.stringify(t))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Pc({manifestId:t,canvasId:e,region:n,time:o}){const r={id:e,type:"Canvas",partOf:[{id:t,type:"Manifest"}]},i=o!=null&&o>0?`t=${Math.round(o*100)/100}`:n?`xywh=${[n.x,n.y,n.w,n.h].map(Math.round).join(",")}`:null,s={"@context":"http://iiif.io/api/presentation/3/context.json",id:`${e}#content-state`,type:"Annotation",motivation:["contentState"],target:i?{type:"SpecificResource",source:r,selector:{type:"FragmentSelector",value:i}}:r};return{json:s,encoded:Ic(s)}}const Ac=/iiif\.io\/api\/presentation\/4\/context\.json/;function zs(t){const e=t==null?void 0:t["@context"];return(Array.isArray(e)?e:[e]).some(o=>typeof o=="string"&&Ac.test(o))}let pi=null;function Ko(){return pi??(pi=import("../upgrader-XNxI-5jo.mjs")),pi}async function ce(t){if(zs(t))return t;const[{upgradeToPresentation4:e},{keepFragments:n}]=await Promise.all([Ko(),import("../keep-fragments-B5nlv2ck.mjs")]);return e(n(t))}function Zo(t,e,n={}){return((t==null?void 0:t.fetch)??globalThis.fetch)(e,{credentials:(t==null?void 0:t.credentials)??"same-origin",...n,headers:{...n.headers,...t==null?void 0:t.headers}})}const Oc=t=>(t==null?void 0:t.credentials)==="include",Nc=t=>JSON.stringify([t==null?void 0:t.credentials,t==null?void 0:t.headers]);class Rc extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="CloverRequestError"}}async function Ee(t,e,n){const o=await Zo(t,e,{signal:n,headers:{Accept:"application/ld+json, application/json"}});if(!o.ok)throw new Rc(`${e} answered ${o.status}`,e,o.status);return o.json()}const mi=()=>import("./content-state-reader-CPiShIjP.mjs"),Bc=["summary","metadata","requiredStatement","rights","provider","homepage","seeAlso","rendering","thumbnail","navDate","partOf"];function $c(t){const e={"@context":zc,id:t.id,type:"Manifest",label:t.label??{none:[""]},items:[t]};for(const n of Bc)t[n]!==void 0&&n!=="label"&&(e[n]=t[n]);return e}const gi=t=>{var e,n;return!!t&&((n=(e=t.items)==null?void 0:e[0])==null?void 0:n.id)===t.id},Fc=/^(oa:)?Annotation(Page|Collection)$/;class hn extends Error{constructor(){super(...arguments);L(this,"name","CloverContentError")}}const zc="http://iiif.io/api/presentation/4/context.json",Hc=t=>/^https?:\/\//i.test(t);async function mo(t,{request:e,signal:n}){return Array.isArray(t.items)&&t.items.length>0||!t.id?t:await Ee(e,t.id,n)}const Dc=50;async function Xo(t,e){const n=t;if(Array.isArray(n.items)&&n.items.length||!n.first)return t;const o=[],r=new Set;let i=n.first;for(let s=0;i&&s<Dc;s++){const a=typeof i=="string"?{id:i}:i;if(r.has(a.id??a))break;r.add(a.id??a);const l=a.items?a:await Ee(e.request,a.id,e.signal),c=await ce({"@context":l["@context"]??n["@context"],...l,type:"Collection"});o.push(...c.items??[]),i=l.next}return{...n,items:o}}async function Hs(t,e={}){return ce(await mo(t,e))}async function Ds(t,e,n=0){for(const o of t.items??[]){if(o.type==="Manifest")return ce(await mo(o,e));if(o.type==="Collection"&&n<8){const r=await Xo(await ce(await mo(o,e)),e),i=await Ds(r,e,n+1);if(i)return i}}return null}async function Wc(t,{request:e,signal:n}={}){Ko();const o=typeof t=="string"?await Ee(e,t.trim(),n):t,r=await ce(o);return r.type==="Collection"?Xo(r,{request:e,signal:n}):r}async function Uc(t,e={}){var u;const{request:n,signal:o}=e;Ko();let r,i,s,a;const l=async d=>{const{resolveContentState:p}=await mi(),f=p(d);if(!f)throw new hn("Unreadable content state");return r=f.target??r,i=f.manifestId??i,s=f.annotation??s,Ee(n,f.id,o)};if(typeof t=="string")if(Hc(t.trim()))a=await Ee(n,t.trim(),o);else{const{decodeContentState:d}=await mi(),p=d(t);if(!p)throw new hn("Unreadable iiifContent");a=fi(p)?await l(p):p}else a=t;if(fi(a)&&(a=await l(a)),Fc.test(String((a==null?void 0:a.type)??""))){const{annotationsContent:d}=await import("./annotations-content-jn3n5Y2-.mjs");return d(a,e)}const c=await ce(a);switch((u=o==null?void 0:o.throwIfAborted)==null||u.call(o),c.type){case"Manifest":return{manifest:c,target:r,annotation:s};case"Collection":{const d=await Xo(c,e),p=e.manifestId??i,f=p?(d.items??[]).find(g=>g.id===p&&g.type==="Manifest"):void 0,m=f?await Hs(f,e):await Ds(d,e);if(!m)throw new hn("The Collection holds no Manifest");return{manifest:m,collection:d,target:r,annotation:s}}case"Canvas":case"Timeline":case"Scene":{const d=c;return r??(r={canvasId:d.id}),{manifest:$c(d),target:r,annotation:s}}default:throw new hn(`Cannot show a ${String(c.type??"resource without a type")}`)}}const Ws=t=>!!(t!=null&&t.id)&&t.type==="AnnotationPage"&&!t.items;function jc(t){const e=[];for(const n of t)for(const o of["items","annotations"])for(const r of n[o]??[])Ws(r)&&e.push([n.id,o,r.id]);return e}async function Vc(t,e,n,o){return qc(await Ee(n,t,o),e)}async function qc(t,e="urn:clover:annotation-page"){var r;const n=t;return zs(n)?n:((r=(await ce({"@context":n["@context"]??"http://iiif.io/api/presentation/3/context.json",id:e,type:"Canvas",items:[{...n,"@context":void 0}]})).items)==null?void 0:r[0])??n}function Kc(t,e,n,o){let r=false;const i=(t.items??[]).map(s=>{if(s.id!==e||!Array.isArray(s[n]))return s;const a=s[n].map(l=>l.id!==o.id||!Ws(l)?l:(r=true,o));return r?{...s,[n]:a}:s});return r?{...t,items:i}:t}function Zc(t){let e=t;const n=new Set;return{get:()=>e,set(o){const r=typeof o=="function"?o(e):o;Object.keys(r).some(s=>!Object.is(r[s],e[s]))&&(e={...e,...r},n.forEach(s=>s()))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function Ne(t){let e=t;const n=new Set;return{get:()=>e,emit(o){e=o,n.forEach(r=>r(o))},subscribe(o){return n.add(o),()=>n.delete(o)}}}function Xc(t,e,n){return{position:e,total:n,hasPrevious:e>0,hasNext:e+1<n,previous:()=>t.previous(),next:()=>t.next(),first:()=>t.first(),last:()=>t.last(),goTo:o=>t.goTo(o)}}const go={query:"",status:"idle",hits:[],set:null},vi={status:"idle",error:null,manifest:null,collection:null,canvasId:null,target:null,annotationId:null,hiddenSets:[],shownSets:[],addedSets:[],search:go};function Yc(t={}){const e=Zc(vi),n=Ne(null),o=Ne(null),r=Ne(null),i=Ne(null),s=Ne(null);let a=null,l=null,c=[],u=[],d=null;const p=()=>c.length||u.length?[...c,...u]:vi.addedSets;let f=t.request,m=null;const g=new Set;let _="view",y=0;const b=()=>{const{manifest:v,canvasId:k}=e.get();if(!v)return;const S=m==null?void 0:m.signal;for(const[M,w,P]of jc(_==="all"||y>0?xt(v).canvases:we(v,k)))g.has(P)||(g.add(P),Vc(P,M,f,S).then(F=>{S!=null&&S.aborted||e.set(Z=>Z.manifest?{manifest:Kc(Z.manifest,M,w,F)}:{})}).catch(()=>g.delete(P)))};e.subscribe(b);const x=(v,k,S,M,w)=>{var q,rt,Q;const{canvases:P}=xt(v),F=R=>!!R&&P.some(Y=>Y.id===R),Z=yc(v),O=F(S==null?void 0:S.canvasId)?S:F(Z==null?void 0:Z.canvasId)?Z:null,X=F(M.canvasId)?M.canvasId:(O==null?void 0:O.canvasId)??(F(M.defaultCanvasId)?M.defaultCanvasId:null)??((q=P[0])==null?void 0:q.id)??null;l==null||l.abort();const ht=w&&((rt=Xn(u,w))==null?void 0:rt.canvasId)===X?w:null,st=O&&ht?{...O,region:void 0}:O;e.set({status:"ready",search:go,manifest:v,collection:k,canvasId:X,target:st&&st.canvasId===X?st:null,addedSets:p(),annotationId:ht}),X&&X!==M.canvasId&&((Q=t.onCanvasChange)==null||Q.call(t,X))},C=(v,k)=>e.set(S=>{const M=S.hiddenSets.filter(P=>P!==v),w=S.shownSets.filter(P=>P!==v);return k?{hiddenSets:M,shownSets:[...w,v]}:{hiddenSets:[...M,v],shownSets:w}}),A=(v,k)=>{var M,w,P;if(!v)return;if((M=t.isControlled)!=null&&M.call(t)){k&&e.set({target:k}),(w=t.onCanvasChange)==null||w.call(t,v);return}const S=e.get().canvasId!==v;e.set({canvasId:v,target:k}),S&&((P=t.onCanvasChange)==null||P.call(t,v))},T=(v,k=false)=>{const{manifest:S}=e.get(),M=vc(S,v);A(M,M&&k?{canvasId:M,autoplay:k}:null)},N=()=>{const{manifest:v,canvasId:k}=e.get();return{at:Ze(v,k),total:xt(v).views.length}},W=()=>{m==null||m.abort();const v=new AbortController;return m=v,g.clear(),e.set({status:"loading",error:null,annotationId:null}),v.signal},j=v=>e.set({status:"error",error:v instanceof Error?v:new Error(String(v))});async function J(v,k={}){var M;const S=W();try{const w=await Uc(v,{request:f,signal:S,manifestId:k.manifestId??void 0});if(S.aborted)return;const P=w.annotation,F=P?Bs({items:[P]},`${P.id}#content-state`):[];u=F.length?[{id:`${P.id}#content-state`,source:"added",entries:F}]:w.annotationSets??[];const Z=d??((M=F[0])==null?void 0:M.id)??w.pick;d=null,x(w.manifest,w.collection??null,w.target,k,Z)}catch(w){S.aborted||j(w)}}const V=v=>{const{manifest:k,collection:S}=e.get();return(k==null?void 0:k.id)===v||(S==null?void 0:S.id)===v},K=v=>{var k;return(((k=e.get().collection)==null?void 0:k.items)??[]).find(S=>S.id===v)??{id:v,type:"Manifest"}},E=(v,k)=>{var S,M;if(d=k,(S=t.isManifestControlled)!=null&&S.call(t)){(M=t.onManifestChange)==null||M.call(t,v);return}I({id:v,type:"Manifest"}).then(w=>{var P;return w&&((P=t.onManifestChange)==null?void 0:P.call(t,v))})},I=async(v,k)=>{if(v.type==="Collection")return await J(v.id),e.get().status==="ready";const{collection:S}=e.get(),M=W(),w=d;d=null;const P=w?Xn(u,w):null;try{const F=await Hs(v,{request:f,signal:M});return M.aborted?false:(x(F,S,P?{canvasId:P.canvasId}:k?{canvasId:k}:void 0,{},w),true)}catch(F){return M.aborted||j(F),false}};return{store:e,viewport:n,media:o,captions:r,highlight:i,chapter:s,get request(){return f},setRequest(v){f=v},load:J,async openCollection(v){var S;const k=e.get().manifest;if(!(!k||((S=e.get().collection)==null?void 0:S.id)===v))try{const M=await Wc(v,{request:f});if(M.type!=="Collection"||e.get().manifest!==k)return;e.set({collection:M})}catch{}},async goToManifest(v,k){var M,w,P;if(V(v))return;const S=K(v);if(S.type!=="Collection"&&((M=t.isManifestControlled)!=null&&M.call(t))){(w=t.onManifestChange)==null||w.call(t,v);return}await I(S,k)&&((P=t.onManifestChange)==null||P.call(t,e.get().manifest.id))},async syncManifest(v){!v||V(v)||e.get().status!=="ready"||await I(K(v))},goTo(v,k){A(v,k?{...k,canvasId:v}:null)},next({autoplay:v=false,wrap:k=false}={}){const{at:S,total:M}=N();S+1<M?T(S+1,v):k&&M>1&&T(0,v)},previous(){const{at:v}=N();v>0&&T(v-1)},first(){T(0)},last(){T(N().total-1)},consumeTarget(){e.set({target:null})},syncCanvas(v){v&&e.set({canvasId:v})},selectAnnotation(v){const{manifest:k,addedSets:S,canvasId:M,search:w}=e.get(),P=Xn($s(k,S,w.set),v);if(e.set({annotationId:P?v:null}),!P)return;const{hiddenSets:F,shownSets:Z}=e.get();P.setId!==jo&&qo(k,S,F,Z).includes(P.setId)&&C(P.setId,true);const O=we(k,M).some(st=>st.id===P.canvasId),X=ue(k,P.canvasId)!==null;!O&&X&&A(P.canvasId,null);const ht=X?void 0:Lc(P.annotation);ht&&E(ht,P.id)},async search(v){l==null||l.abort();const k=Rs(e.get().manifest),S=v.trim();if(!S||!k){l=null,e.set({search:go,annotationId:null});return}const M=new AbortController;l=M,e.set(w=>({search:{...w.search,query:S,status:"loading"}}));try{const{searchInto:w}=await import("./search-DWkwRPo_.mjs");await w(e,k,S,f,M.signal)}catch{e.set({search:{query:S,status:"error",hits:[],set:null}})}},setSetVisible(v,k){C(v,k)},async loadAnnotations(v){if(a==null||a.abort(),!v){c=[],e.set({addedSets:p()});return}const k=new AbortController;a=k;try{const{loadAnnotationSets:S}=await import("./annotation-collection-BjZ1DAHq.mjs"),M=await S(v,{request:f,signal:k.signal});if(k.signal.aborted)return;c=M,e.set({addedSets:p()})}catch{}},getContentState(){const{manifest:v,canvasId:k}=e.get();if(!v||!k)return null;const S=n.get(),M=o.get(),w=M&&M.currentTime>0?M.currentTime:null,F=S&&we(v,k).some(Z=>Z.id===S.canvasId)&&!w?S:null;return Pc({manifestId:v.id,canvasId:(F==null?void 0:F.canvasId)??k,region:F==null?void 0:F.region,time:w})},setAnnotationPages(v){v!==_&&(_=v,b())},holdAllAnnotationPages(){y++,b();let v=true;return()=>{v&&y--,v=false}},dispose(){m==null||m.abort(),a==null||a.abort(),l==null||l.abort()}}}function Yo(t){const e=[];for(const n of U(t==null?void 0:t.items))for(const o of U(n==null?void 0:n.items))if(Wo(o))for(let r of Do(o))(r==null?void 0:r.type)==="Choice"&&(r=U(r.items)[0]),(r==null?void 0:r.type)==="SpecificResource"&&(r=typeof r.source=="string"?{id:r.source}:r.source),r&&e.push({body:r,annotation:o});return e}function Gc(t){return t.flatMap(e=>Yo(e).map(({body:n})=>n))}function Jc(t,e){if(!(t!=null&&t.length)||!e.canvases.length)return null;const n=e.canvases.map(r=>r.id),o=e.bodies.map(r=>r==null?void 0:r.format).filter(Boolean);return t.find(r=>{var i,s,a;return((i=r.canvasId)==null?void 0:i.some(l=>n.includes(l)))||((s=r.format)==null?void 0:s.some(l=>o.includes(l)))||!!((a=r.match)!=null&&a.call(r,e))})??null}function Qc(t,e){return t===e?true:!t||!e||t.length!==e.length?false:t.every((n,o)=>n.component===e[o].component&&n.match===e[o].match&&JSON.stringify([n.canvasId,n.format])===JSON.stringify([e[o].canvasId,e[o].format]))}function tu({iiifContent:t,canvasId:e,defaultCanvasId:n,onCanvasChange:o,onStatusChange:r,manifestId:i,defaultManifestId:s,onManifestChange:a,searchQuery:l,request:c,language:u,renderers:d,annotations:p,annotationPages:f="view",onContentStateChange:m,...g}){const _=e!==void 0,y=i!==void 0,b=$({controlled:_,manifestControlled:y,onCanvasChange:o,onStatusChange:r,onManifestChange:a});b.current={controlled:_,manifestControlled:y,onCanvasChange:o,onStatusChange:r,onManifestChange:a};const[x]=D(()=>Yc({request:c,onCanvasChange:k=>{var S,M;return(M=(S=b.current).onCanvasChange)==null?void 0:M.call(S,k)},onManifestChange:k=>{var S,M;return(M=(S=b.current).onManifestChange)==null?void 0:M.call(S,k)},isControlled:()=>b.current.controlled,isManifestControlled:()=>b.current.manifestControlled}));x.setRequest(c);const C=$({});C.current={canvasId:e,defaultCanvasId:n,manifestId:i??s};const A=Nc(c),T=$(t);T.current=t;const N=iu(t);H(()=>(x.load(T.current,C.current),()=>x.dispose()),[x,N,A]),H(()=>{_&&x.syncCanvas(e??null)},[x,_,e]);const[W,j]=D(x.store.get().status);H(()=>{let k=x.store.get().status;return x.store.subscribe(()=>{var w,P;const{status:S,error:M}=x.store.get();S!==k&&(k=S,j(S),(P=(w=b.current).onStatusChange)==null||P.call(w,S,M))})},[x]);const J=$(p);J.current=p;const V=nu(p);H(()=>{x.loadAnnotations(J.current??null)},[x,V,A]),H(()=>{x.setAnnotationPages(f)},[x,f]),ru(x,m),H(()=>{y&&W==="ready"&&x.syncManifest(i??null)},[x,y,i,W]);const K=eu(x,k=>{var S;return k.status==="ready"?((S=k.manifest)==null?void 0:S.id)??null:null});H(()=>{l&&K&&x.search(l)},[x,l,K]);const E=$(d);Qc(E.current,d)||(E.current=d);const I=E.current;return[pt(()=>({clover:x,language:u,renderers:I}),[x,u,I]),W,g]}function eu(t,e){return Ft(t.store.subscribe,()=>e(t.store.get()))}function nu(t){const e=Array.isArray(t)?t:t?[t]:[];return JSON.stringify(e.map(n=>typeof n=="string"?n:(n==null?void 0:n.id)??"object"))}const ou=300;function ru(t,e){const n=$(e);n.current=e;const o=!!e;H(()=>{if(!o)return;let r,i="";const s=()=>{clearTimeout(r),r=setTimeout(()=>{var m;const f=t.getContentState();!f||f.encoded===i||(i=f.encoded,(m=n.current)==null||m.call(n,f))},ou)};let a=t.store.get().canvasId;const l=t.store.subscribe(()=>{const f=t.store.get().canvasId;f!==a&&(a=f,s())}),c=t.viewport.subscribe(s);let u=null;const d=f=>{u==null||u.removeEventListener("pause",s),u==null||u.removeEventListener("seeked",s),u=f,u==null||u.addEventListener("pause",s),u==null||u.addEventListener("seeked",s)};d(t.media.get());const p=t.media.subscribe(d);return s(),()=>{clearTimeout(r),l(),c(),p(),d(null)}},[t,o])}function iu(t){return typeof t=="string"?t:t.id??t["@id"]??t}const su=Ct(function({as:e="div",className:n,children:o,...r},i){const[s,a,l]=tu(r),c=Ke(i,l.lang);return h(Tn.Provider,{value:s,children:h(Le.Provider,{value:c.hostLanguage,children:h(e,{ref:c.ref,className:ct("clover-root",n),"data-status":a,...l,children:[o,h(wc,{clover:s.clover,language:s.language})]})})})}),au=()=>h("path",{fillRule:"evenodd",stroke:"none",d:"M144 72H368A96 96 0 0 1 464 168V296A96 96 0 0 1 368 392H200L104 460L144 392A96 96 0 0 1 48 296V168A96 96 0 0 1 144 72Z M168 184H344A16 16 0 0 1 344 216H168A16 16 0 0 1 168 184Z M168 264H280A16 16 0 0 1 280 296H168A16 16 0 0 1 168 264Z"}),lu=()=>h("path",{stroke:"none",d:"M256 72A48 48 0 1 1 256 168A48 48 0 1 1 256 72Z M192 216H296V384H328V432H184V384H216V264H192Z"}),cu=()=>h("path",{strokeLinejoin:"round",strokeWidth:"40",d:"M184 128V384L392 256Z"}),Go=()=>h("path",{strokeLinecap:"round",strokeWidth:"45",d:"M154 154L358 358M358 154L154 358"}),uu=()=>h(mt,{children:[h("path",{stroke:"none",d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),h("path",{stroke:"none",d:"m279.5,197.76h-3.35s-28.47,0-28.47,0v-31.82c-.77-13.79-12.57-24.33-26.36-23.56-12.71.71-22.85,10.86-23.56,23.56v3.35h0v28.47h-31.82c-13.79.77-24.33,12.57-23.56,26.36.71,12.71,10.86,22.85,23.56,23.56h3.35s28.47,0,28.47,0v31.82c.77,13.79,12.57,24.33,26.36,23.56,12.71-.71,22.85-10.86,23.56-23.56v-3.35h0v-28.47h31.82c13.79-.77,24.33-12.57,23.56-26.36-.71-12.71-10.86-22.85-23.56-23.56Z"})]}),du=()=>h(mt,{children:[h("path",{stroke:"none",d:"m456.69,421.39l-94.09-94.09c22.65-30.16,34.88-66.86,34.84-104.58,0-96.34-78.38-174.72-174.72-174.72S48,126.38,48,222.72s78.38,174.72,174.72,174.72c37.72.04,74.42-12.19,104.58-34.84l94.09,94.09c10.29,9.2,26.1,8.32,35.3-1.98,8.48-9.49,8.48-23.83,0-33.32Zm-233.97-73.87c-68.89-.08-124.72-55.91-124.8-124.8h0c0-68.93,55.87-124.8,124.8-124.8s124.8,55.87,124.8,124.8-55.87,124.8-124.8,124.8Z"}),h("path",{stroke:"none",d:"M167.26 197.76H278.1a24.96 24.96 0 0 1 0 49.92H167.26a24.96 24.96 0 0 1 0-49.92Z"})]}),It={zoomIn:{keys:"Plus",glyph:"+"},zoomOut:{keys:"-",glyph:"\u2212"},reset:{keys:"0",glyph:"0"},rotateRight:{keys:"R",glyph:"R"},rotateLeft:{keys:"Shift+R",glyph:"\u21E7R"},play:{keys:"K Space",glyph:"K"},mute:{keys:"M",glyph:"M"}},hu=new Set(["+","=","-","_","0","r","R","k","K","m","M","j","J","l","L"]);function de({label:t,lang:e,shortcut:n,scrolls:o=false,image:r}){const{t:i}=dt(),s=$(null),a=n?i("controlShortcut",{label:t,shortcut:n.glyph}):t;return pu(),H(()=>{const l=s.current;l&&yi(l)&&vo(l)},[a]),h("span",{ref:s,className:"clover-tip","aria-hidden":"true",lang:e,...o&&{tabIndex:-1,onMouseDown:l=>{var c;l.preventDefault(),(c=l.currentTarget.parentElement)==null||c.focus({preventScroll:true})}},children:[r&&h("img",{className:"clover-tip-image",src:r,alt:"",loading:"lazy",onLoad:()=>{const l=s.current;l&&yi(l)&&vo(l)}}),a]})}function fn(t){const e=t.target instanceof Element&&Us(t.target),n=e&&Jo(e);n&&vo(n)}function Jo(t){return Array.from(t.children).find(e=>e.classList.contains("clover-tip"))}function Us(t){const e=t.matches("input")?t.parentElement:null;return e&&Jo(e)?e:t}function yi(t){var e;try{return!!((e=t.parentElement)!=null&&e.matches(":hover, :focus-visible, :has(> input:focus-visible)"))}catch{return false}}function vo(t){const e=t.parentElement;if(!e)return;t.style.removeProperty("--clover-tip-room"),t.style.removeProperty("--clover-tip-shift");const n=fu(e),o=parseFloat(getComputedStyle(t).paddingLeft)||0,r=n.left+o,i=n.right-o,s=e.getBoundingClientRect();let a=t.getBoundingClientRect();const l=a.right<=s.left?a.right-r:a.left>=s.right?i-a.left:i-r;a.width>l&&(t.style.setProperty("--clover-tip-room",`${Math.max(l,0)}px`),a=t.getBoundingClientRect());const c=a.left<r?r-a.left:a.right>i?i-a.right:0;c&&t.style.setProperty("--clover-tip-shift",`${c}px`)}function fu(t){let e=0,n=document.documentElement.clientWidth||window.innerWidth;for(let o=t.parentElement;o&&o!==document.documentElement;o=o.parentElement){const{display:r,overflow:i,overflowX:s}=getComputedStyle(o);if(r==="inline"||r==="contents")continue;const a=s||i;if(!a||a==="visible")continue;const l=o.getBoundingClientRect();e=Math.max(e,l.left+o.clientLeft),n=Math.min(n,l.left+o.clientLeft+o.clientWidth)}return{left:e,right:n}}let _i=0;function bi(t){if(t.key!=="Escape")return;const e=new Set;document.querySelectorAll(":hover > .clover-tip").forEach(r=>r.parentElement&&e.add(r.parentElement));const n=document.activeElement,o=n&&Us(n);o&&Jo(o)&&e.add(o),e.forEach(r=>js(r,"tipHidden",["pointerenter","focusout"]))}function js(t,e,n){t.dataset[e]="";const o=()=>{delete t.dataset[e],n.forEach(r=>t.removeEventListener(r,o))};n.forEach(r=>t.addEventListener(r,o))}function pu(){H(()=>(_i++===0&&(document.addEventListener("keydown",bi,true),document.addEventListener("pointerenter",fn,true),document.addEventListener("focus",fn,true)),()=>{--_i||(document.removeEventListener("keydown",bi,true),document.removeEventListener("pointerenter",fn,true),document.removeEventListener("focus",fn,true))}),[])}function mu(t,e){const n=t.target;!e||n===e||e.contains(n)||hu.has(t.key)&&(t.altKey||t.metaKey||t.ctrlKey||n.closest("input, select, textarea, [contenteditable]")||(t.preventDefault(),e.dispatchEvent(new KeyboardEvent("keydown",{key:t.key,shiftKey:t.shiftKey,bubbles:true,cancelable:true}))))}const Ce=({className:t,id:e,label:n,children:o,onClick:r,expanded:i,controls:s,shortcut:a,lang:l})=>{const u=e.split("-")[0].replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,"");return h("button",{id:e,className:ct("clover-canvas-button",t),"data-testid":"clover-canvas-button","data-button":u,onClick:r,"aria-expanded":i,"aria-controls":s,"aria-label":n,"aria-keyshortcuts":a==null?void 0:a.keys,lang:l,type:"button",children:[h("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true","data-testid":"clover-canvas-button-svg",focusable:"false",width:"16",height:"16",viewBox:"0 0 512 512",children:o}),h(de,{label:n,shortcut:a})]})},gu=Kt("");function zt(){return Et(gu)+Bo()}const Yn=new Map;function vu(t,e){const n=zt(),o=$(e);o.current=e,H(()=>t?yu(n,o):void 0,[t,n])}function yu(t,e){for(const[n,o]of[...Yn])n!==t&&o.current();return Yn.set(t,e),()=>{Yn.delete(t)}}const _u=bt(()=>import("./CaptionDetails-B_JdNjJ7.mjs"));function bu(t){var e;return!!t.summary||!!((e=t.metadata)!=null&&e.length)}const Vs=(t,e)=>`${t}-label-${e}`,wu=({id:t,canvases:e,comments:n,open:o,onClose:r,language:i})=>{const{t:s,langOf:a}=dt(),l=$(null),[c,u]=D(o);return o&&!c&&u(true),vu(o,()=>r(false)),H(()=>{var d;o&&((d=l.current)==null||d.focus())},[o]),h("figcaption",{className:"clover-canvas-caption","data-open":o,"data-testid":"clover-canvas-caption",id:t,onKeyDown:d=>{d.key==="Escape"&&(d.preventDefault(),d.stopPropagation(),r(true))},ref:l,tabIndex:-1,children:[h(Ce,{className:"clover-canvas-caption-close",id:`close-${t}`,label:s("commonClose"),lang:a("commonClose"),onClick:()=>r(true),children:h(Go,{})}),e.map((d,p)=>{const f=at(d.label,i);return h("section",{className:"clover-canvas-caption-canvas",children:[f.text&&h("p",{className:"clover-canvas-caption-label",id:Vs(t,p),lang:f.lang,children:f.text}),c&&h(Mt,{fallback:null,children:h(_u,{summary:d.summary,metadata:d.metadata,comments:n==null?void 0:n.get(d.id),language:i})})]},d.id)})]})},xu=()=>h("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M256 112v288M400 256H112"}),Su=()=>h("path",{strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 256H112"}),ku=()=>h("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M432 320v112H320M421.8 421.77L304 304M80 192V80h112M90.2 90.23L208 208M320 80h112v112M421.77 90.2L304 208M192 432H80V320M90.23 421.8L208 304"}),Eu=()=>h("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M304 416v-112h112M405.77 405.77L304 304M208 96v112H96M106.23 106.23L208 208M416 208H304V96M405.77 106.23L304 208M96 304h112v112M106.23 405.77L208 304"}),Cu=()=>h("path",{d:"M448 440a16 16 0 01-12.61-6.15c-22.86-29.27-44.07-51.86-73.32-67C335 352.88 301 345.59 256 344.23V424a16 16 0 01-27 11.57l-176-168a16 16 0 010-23.14l176-168A16 16 0 01256 88v80.36c74.14 3.41 129.38 30.91 164.35 81.87C449.32 292.44 464 350.9 464 424a16 16 0 01-16 16z"}),wi=()=>h(mt,{children:[h("path",{fill:"none",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"45",d:"M400 148l-21.12-24.57A191.43 191.43 0 00240 64C134 64 48 150 48 256s86 192 192 192a192.09 192.09 0 00181.07-128"}),h("path",{d:"M464 97.42V208a16 16 0 01-16 16H337.42c-14.26 0-21.4-17.23-11.32-27.31L436.69 86.1C446.77 76 464 83.16 464 97.42z"})]}),Mu=()=>h(mt,{children:[h("path",{fill:"none",strokeLinecap:"round",strokeWidth:"64",d:"M112 144h0M112 256h0M112 368h0"}),h("path",{fill:"none",strokeLinecap:"round",strokeWidth:"40",d:"M208 144h208M208 256h208M208 368h208"})]}),Tu=({children:t,label:e})=>h("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 512 512",fill:"currentColor",stroke:"currentColor",focusable:"false","aria-hidden":"true",role:"presentation","data-testid":"clover-canvas-button-svg","data-label":e,children:t}),Lu=112,Iu=128;function Pu(t){Tt(()=>{const e=t==null?void 0:t.closest(".clover-canvas");if(!t||!e)return;const n=(i=false)=>{let s=t.offsetWidth,a=0;for(const f of i?[]:Array.from(t.children))!(f instanceof HTMLElement)||!f.offsetParent||(s=Math.min(s,f.offsetLeft),a=Math.max(a,f.offsetTop+f.offsetHeight));const l={width:t.offsetWidth-s,height:a};for(const[f,m]of Object.entries(l)){const g=`--clover-canvas-controls-${f}`;a?e.style.setProperty(g,`${m}px`):e.style.removeProperty(g)}const c=t.offsetTop,u=e.querySelector(":scope > .clover-canvas-media > .clover-canvas-transport"),d=e.clientHeight-2*c-l.height-((u==null?void 0:u.offsetHeight)??0),p=t.offsetLeft+s-c;a&&d<Lu&&p>=Iu?e.dataset.popups="beside":delete e.dataset.popups};n();const o=new ResizeObserver(()=>n());o.observe(t),o.observe(e);const r=new MutationObserver(()=>n());return r.observe(t,{childList:true}),r.observe(e,{childList:true}),()=>{o.disconnect(),r.disconnect(),n(true)}},[t])}const Qo=()=>{if(typeof document>"u")return null;const t=document;return t.fullscreenElement??t.webkitFullscreenElement??null},qs=()=>{if(typeof document>"u")return false;const t=document;return!!(t.fullscreenEnabled??t.webkitFullscreenEnabled)},Au=t=>t==null?void 0:t.closest(".clover-canvas"),Ou=(t,e)=>{if(typeof t.webkitEnterFullscreen!="function")return;const n=e.closest(".clover-canvas"),o=!t.isConnected&&!!n;if(o&&n){const i=t.getAttribute("style");t.style.cssText="position:absolute;inset:0;z-index:-1;width:100%;height:100%;object-fit:contain;pointer-events:none",n.prepend(t),t.addEventListener("webkitendfullscreen",()=>{t.remove(),i===null?t.removeAttribute("style"):t.setAttribute("style",i)},{once:true})}const r=()=>{var i;try{(i=t.webkitEnterFullscreen)==null||i.call(t)}catch{}};o?requestAnimationFrame(r):r()},Ks=async(t,e)=>{var o,r,i,s;const n=Au(t);if(n)try{if(Qo()){const l=document;await(((o=l.exitFullscreen)==null?void 0:o.call(l))??((r=l.webkitExitFullscreen)==null?void 0:r.call(l)));return}if(!qs()){e&&t&&Ou(e,t);return}const a=n;await(((i=a.requestFullscreen)==null?void 0:i.call(a))??((s=a.webkitRequestFullscreen)==null?void 0:s.call(a)))}catch{}};function Nu(t){const[e,n]=D(false);return H(()=>{if(!t)return;const o=()=>{var r;return n(!!((r=Qo())!=null&&r.contains(t)))};return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}function Ru({key:t,id:e,label:n,glyph:o,onClick:r,expanded:i,controls:s,shortcut:a,lang:l},c){const u=c==null?void 0:c[t];return u?h(u,{buttonProps:{id:e,type:"button","aria-label":n,...l&&{lang:l},...a&&{"aria-keyshortcuts":a.keys},onClick:r,...i!==void 0&&{"aria-expanded":i,"aria-controls":s}},icon:h(Tu,{label:n,children:o}),label:n,tip:h(de,{label:n,shortcut:a})},t):h(Ce,{id:e,label:n,onClick:r,expanded:i,controls:s,shortcut:a,lang:l,children:o},t)}const Bu=({controls:t,controlButtons:e,hasPlaceholder:n=false,children:o})=>{const[r,i]=D(null),s=Nu(r);return Pu(r),h("div",{className:"clover-canvas-controls","data-fullscreen":s,"data-has-placeholder":n,"data-testid":"clover-canvas-controls",ref:i,children:[t(s).map(a=>Ru(a,e)),o]})},$u=()=>()=>{};function Fu(){return Ft($u,qs)}const xi=new WeakMap;function _n(t,e){const[n,o]=D(()=>xi.get(t)??null);return H(()=>{if(!e||n)return;let r=true;return t().then(i=>{xi.set(t,i),r&&o(()=>i)},()=>{}),()=>{r=false}},[t,e,n]),n}const zu=()=>import("./AnnotationMenu-Dd4tnzNV.mjs"),Hu=()=>import("./ChoiceMenu-xa51a1DV.mjs"),Si=2,Du=({renderer:t,instance:e,config:n,controlButtons:o,hasPlaceholder:r,choices:i=[],selections:s={},onSelect:a,annotations:l=[],hiddenPages:c,onPageVisibilityChange:u,selectedAnnotation:d=null,onAnnotationSelect:p,onAnnotationActivate:f,captionId:m,captionOpen:g=false,onCaptionToggle:_,language:y,children:b})=>{var st,q;const{t:x,langOf:C}=dt(),[A,T]=D(false),[N,W]=D(false),j=`annotations-${e}`,J=`${j}-menu`,V=x("informationPanelTabsAnnotations"),K=C("informationPanelTabsAnnotations"),E=ot(rt=>{var Q;W(false),f==null||f(null),rt&&((Q=document.getElementById(j))==null||Q.focus())},[j,f]),I=n.annotations&&l.length>0&&p,v=n.information&&m&&_,k=`choice-${e}`,S=i.length===1?at(i[0].label,y):null,M=(S==null?void 0:S.text)||x("canvasChoice"),w=S!=null&&S.text?S.lang:C("canvasChoice"),P=`${k}-menu`,F=(st=_n(zu,!!I))==null?void 0:st.default,Z=(q=_n(Hu,i.length>0&&!!a))==null?void 0:q.default,O=ot(rt=>{var Q;T(false),rt&&((Q=document.getElementById(k))==null||Q.focus())},[k]),X=Fu();return h(mt,{children:[h(Bu,{controls:rt=>{const Q=[],R=t;return n.zoom&&R&&Q.push({key:"zoomIn",id:`zoomIn-${e}`,shortcut:It.zoomIn,label:x("imageZoomIn"),lang:C("imageZoomIn"),glyph:h(xu,{}),onClick:()=>R.zoomBy(Si)},{key:"zoomOut",id:`zoomOut-${e}`,shortcut:It.zoomOut,label:x("imageZoomOut"),lang:C("imageZoomOut"),glyph:h(Su,{}),onClick:()=>R.zoomBy(1/Si)}),n.fullPage&&X&&Q.push({key:"fullPage",id:`fullPage-${e}`,label:x(rt?"imageExitFullScreen":"imageFullScreen"),lang:C(rt?"imageExitFullScreen":"imageFullScreen"),glyph:rt?h(Eu,{}):h(ku,{}),onClick:Y=>void Ks(Y.currentTarget)}),n.rotation&&R&&Q.push({key:"rotateRight",id:`rotateRight-${e}`,shortcut:It.rotateRight,label:x("imageRotateRight"),lang:C("imageRotateRight"),glyph:h(wi,{}),onClick:()=>R.rotateBy(90)},{key:"rotateLeft",id:`rotateLeft-${e}`,shortcut:It.rotateLeft,label:x("imageRotateLeft"),lang:C("imageRotateLeft"),glyph:h(wi,{}),onClick:()=>R.rotateBy(-90)}),n.reset&&R&&Q.push({key:"reset",id:`reset-${e}`,shortcut:It.reset,label:x("imageResetZoom"),lang:C("imageResetZoom"),glyph:h(Cu,{}),onClick:()=>R.home()}),i.length&&Q.push({key:"choice",id:k,label:M,lang:w,glyph:h(Mu,{}),onClick:()=>T(Y=>!Y),expanded:A,controls:P}),Q},controlButtons:o,hasPlaceholder:r,children:[I&&h(Ce,{id:j,label:V,lang:K,onClick:()=>W(rt=>!rt),expanded:N,controls:J,children:h(au,{})}),v&&h(Ce,{id:`information-${e}`,label:x("informationPanelTabsAbout"),lang:C("informationPanelTabsAbout"),onClick:_,expanded:g,controls:m,children:h(lu,{})}),b]}),F&&N&&I&&h(F,{id:J,triggerId:j,label:V,labelLang:K,annotations:l,hiddenPages:c,onPageVisibilityChange:u,selected:d,onSelect:p,onActivate:rt=>f==null?void 0:f(rt),onClose:E}),Z&&A&&i.length>0&&a&&h(Z,{id:P,triggerId:k,label:M,labelLang:w,language:y,choices:i,selections:s,onSelect:a,onClose:O})]})},Wu=["jpg","png","webp","gif"];class yo extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="ImageServiceError"}}function tr(t){return t.replace(/\/info\.json$/,"").replace(/\/+$/,"")}function Ln(t){const e=Array.isArray(t)?t:t?[t]:[];for(const n of e){if(!n||typeof n!="object")continue;const o=n,r=String(o.type??o["@type"]??""),i=JSON.stringify(o.profile??""),s=/ImageService/i.test(r)||/iiif\.io\/api\/image/.test(i)||/^"level[012]"$/.test(i)||!r&&!o.profile,a=o["@id"]??o.id;if(s&&typeof a=="string")return tr(a)}}function Uu(t,e){if(!t||typeof t!="object")throw new yo("info.json is not an object",e??"");const n=t,o=ju(n),r=o===3?n.id??n["@id"]:n["@id"]??n.id,i=tr(r??e??""),s=Number(n.width),a=Number(n.height);if(!i||!(s>0)||!(a>0))throw new yo("info.json is missing id, width or height",e??i);const l=Array.isArray(n.profile)?n.profile:[n.profile],c=l.find(b=>typeof b=="string"),u=l.filter(b=>!!b&&typeof b=="object"),d=Vu(c),p=new Set([...Array.isArray(n.extraFeatures)?n.extraFeatures:[],...u.flatMap(b=>Array.isArray(b.supports)?b.supports:[])]),m=[...Array.isArray(n.preferredFormats)?n.preferredFormats:[]].map(b=>String(b).toLowerCase()).find(b=>Wu.includes(b))??"jpg",g=b=>{var C;const x=n[b]??((C=u.find(A=>A[b]!==void 0))==null?void 0:C[b]);return Number(x)>0?Number(x):void 0};let _=g("maxWidth"),y=g("maxHeight");return _&&!y&&(y=_),y&&!_&&(_=void 0),{id:i,version:o,level:d,width:s,height:a,tiles:qu(n.tiles),sizes:Ku(n.sizes),maxWidth:_,maxHeight:y,maxArea:g("maxArea"),regionByPx:d>=1||p.has("regionByPx"),sizeByW:d>=1||p.has("sizeByW")||p.has("sizeByWh"),format:m,quality:"default"}}function ju(t){const e=[].concat(t["@context"]??[]).map(String);return e.some(n=>n.includes("/image/3"))?3:e.some(n=>n.includes("/image/2"))?2:t.type==="ImageService3"?3:t["@id"]?2:3}function Vu(t){const e=t==null?void 0:t.match(/level([012])/);return e?Number(e[1]):0}function qu(t){return Array.isArray(t)?t.map(e=>{const n=Number(e==null?void 0:e.width),o=Number((e==null?void 0:e.height)??(e==null?void 0:e.width)),r=(Array.isArray(e==null?void 0:e.scaleFactors)?e.scaleFactors:[1]).map(Number).filter(i=>i>0).sort((i,s)=>i-s);return{width:n,height:o,scaleFactors:r}}).filter(e=>e.width>0&&e.height>0&&e.scaleFactors.length):[]}function Ku(t){return Array.isArray(t)?t.map(e=>({width:Number(e==null?void 0:e.width),height:Number(e==null?void 0:e.height)})).filter(e=>e.width>0&&e.height>0).sort((e,n)=>e.width-n.width):[]}function bn(t,e,n,o,r=t.quality){const i=e.x===0&&e.y===0&&e.width===t.width&&e.height===t.height,s=i?"full":`${e.x},${e.y},${e.width},${e.height}`,a=i&&n===t.width&&o===t.height;let l;return t.version===3?l=a?"max":`${n},${o}`:l=a?"full":`${n},`,`${t.id}/${s}/${l}/0/${r}.${t.format}`}function Zu(t){return t.version===2&&t.level===0?"native":void 0}const Gn=new Map;function Zs(t,{request:e}={}){const n=tr(t),o=Gn.get(n);if(o)return o;const r=`${n}/info.json`,i=Zo(e,r,{headers:{Accept:"application/ld+json, application/json"}}).then(async s=>{if(!s.ok)throw new yo(`info.json request failed with ${s.status}`,r,s.status);return Uu(await s.json(),n)}).catch(s=>{throw Gn.delete(n),s});return Gn.set(n,i),i}const Xu={width:1600,height:900};function Yu(t,e){const n=new Array(t.length);if(!t.length)return n;const o=t.map(Me),r=e==="left-to-right"||e==="right-to-left",i=e==="right-to-left"||e==="bottom-to-top",s=r?o[0].height:o[0].width,a=t.map((c,u)=>u);i&&a.reverse();let l=0;for(const c of a){const u=o[c],d=s/(r?u.height:u.width),p=u.width*d,f=u.height*d;n[c]=r?{x:l,y:0,width:p,height:f}:{x:0,y:l,width:p,height:f},l+=r?p:f}return n}function Me(t){var i,s;if(t.width&&t.height)return{width:t.width,height:t.height};const e=Xs(t);if(e!=null&&e.width&&e.height)return{width:e.width,height:e.height};const n=((i=wn(t)[0])==null?void 0:i.body)??((s=xn(t)[0])==null?void 0:s.body),o=Number(n==null?void 0:n.width),r=Number(n==null?void 0:n.height);return o>0&&r>0?{width:o,height:r}:Xu}function Xs(t){return t.accompanyingContainer??t.placeholderContainer}function Gu(t,e,n,o,r){return`${t.id}|${e.id??`${n}:${o}`}|${r}`}function Ju(t){const e=[];for(const n of t)Ys(n,(o,r)=>{const i=o;if((i==null?void 0:i.type)!=="Choice")return;const s=U(i.items).filter(a=>!!a&&typeof a=="object");s.length>1&&e.push({key:r,canvasId:n.id,label:i.label,items:s.map(a=>({label:a.label,id:a.id}))})});return e}const ki=new WeakMap,Qu=[];function _o(t){var s;const e=ki.get(t);if(e)return e;const n=[];for(const a of t.items??[])for(const l of a.items??[]){if(!Wo(l))continue;const c=l.target?(s=Ie(l.target))==null?void 0:s.t:void 0;if(!c)continue;const[u,d]=c.split(",").map(Number);Number.isFinite(u)&&n.push({annotation:l,start:u,end:Number.isFinite(d)?d:NaN})}n.sort((a,l)=>a.start-l.start);const o=Number(t.duration),r=Number.isFinite(o)&&o/n.length||.5;n.forEach((a,l)=>{var u;const c=(u=n[l+1])==null?void 0:u.start;c!=null?a.end=c>a.start?c:a.start+r:Number.isFinite(o)&&o>a.start?a.end=o:a.end>a.start||(a.end=a.start+r)});const i=n.length>1?n:Qu;return ki.set(t,i),i}const Ue=t=>`frame:${t.id}`;function Ys(t,e){(t.items??[]).forEach((n,o)=>{(n.items??[]).forEach((r,i)=>{Wo(r)&&Do(r).forEach((s,a)=>e(s,Gu(t,r,o,i,a),r))})})}function wn(t,e={},{allFrames:n=false}={}){const o=[];return Gs(t,e,(r,i,s)=>{r.body.type==="Image"&&o.push({body:r.body,region:r.region,target:i,...s>=0?{frame:s}:{}})},n),o}function xn(t,e={}){const n=[];return Gs(t,e,(o,r)=>{const i=o.body.type;i!=="Video"&&!Uo(i)||n.push({kind:i==="Video"?"video":"audio",body:o.body,target:r})}),n}function Gs(t,e,n,o=false){const r=t.width??0,i=t.height??0,s=_o(t),a=Math.min(e[Ue(t)]??0,Math.max(0,s.length-1));Ys(t,(l,c,u)=>{const d=s.findIndex(g=>g.annotation===u);if(!o&&d>=0&&d!==a)return;const p=bo(l,e[c]??0);if(!p)return;const f=u.target?Ie(u.target):void 0,m=f==null?void 0:f.rect;n(p,m?{x:m.x,y:m.y,width:m.w,height:m.h}:{x:0,y:0,width:r||Number(p.body.width)||0,height:i||Number(p.body.height)||0},d)})}function Js(t){const e=[],n=[...t.annotations??[],...t.items??[]];for(const o of n)for(const r of o.items??[])if(U(r.motivation).includes("supplementing"))for(const i of U(r.body)){const s=i,a=(s==null?void 0:s.type)==="Choice"?U(s.items):[s];for(const l of a){const c=l==null?void 0:l.id;!((l==null?void 0:l.format)==="text/vtt"||typeof c=="string"&&/\.vtt(\?|$)/i.test(c))||typeof c!="string"||e.push({id:c,label:l.label,language:U(l.language)[0]})}}return e}function td(t){const e=[],n=r=>{const i=r,s=i==null?void 0:i.id;if(typeof s!="string"||e.some(l=>l.id===s))return;const a=i==null?void 0:i.format;(a?a!=="text/plain":!/\.txt(\?|$)/i.test(s))||e.push({id:s,label:i==null?void 0:i.label,language:U(i==null?void 0:i.language)[0]})},o=[...t.annotations??[],...t.items??[]];for(const r of o)for(const i of r.items??[])if(U(i.motivation).includes("supplementing"))for(const s of U(i.body)){const a=s;((a==null?void 0:a.type)==="Choice"?U(a.items):[a]).forEach(n)}return U(t.rendering).forEach(n),e}function bo(t,e=0){if(!t||typeof t!="object")return null;const n=t;if(n.type==="Choice"){const o=U(n.items);return bo(o[e]??o[0])}if(n.type==="SpecificResource"&&n.source){const o=typeof n.source=="string"?{id:n.source}:n.source,r=U(n.selector).find(s=>(s==null?void 0:s.type)==="ImageApiSelector"&&s.region),i=bo({type:"Image",...o});return i?{...i,region:(r==null?void 0:r.region)??i.region}:null}return n.type!=="Image"&&n.type!=="Video"&&!Uo(n.type)?null:{body:n,region:typeof n.region=="string"?n.region:void 0}}function ed(t,e,n={},{standIns:o=true}={}){const r=Yu(t,e),i=[],s=[],a={};return t.forEach((l,c)=>{const u=r[c],d=Me(l),p=u.width/d.width,f=u.height/d.height,m=C=>({x:u.x+C.x*p,y:u.y+C.y*f,width:C.width*p,height:C.height*f}),g=xn(l,n),_=wn(l,n,{allFrames:true}).map(C=>({...C,canvas:l})),y=Xs(l);if(o&&!_.length&&g.some(C=>C.kind==="audio")&&y){const C=Me(y);for(const A of wn(y))_.push({...A,canvas:y,target:{x:A.target.x/C.width*d.width,y:A.target.y/C.height*d.height,width:A.target.width/C.width*d.width,height:A.target.height/C.height*d.height}})}const b=n[Ue(l)]??0;_.forEach(({body:C,target:A,region:T,frame:N,canvas:W},j)=>{var E;const J=Ln(C.service);if(!J&&!C.id)return;const V=`${W.id}|${j}|${C.id??J}|${T??""}`,K=!(J&&T);if(i.push({id:V,service:J,url:C.id,width:K&&Number(C.width)||void 0,height:K&&Number(C.height)||void 0,region:T,placement:m(A),...N!=null&&N!==b?{hidden:true}:{}}),N!=null){const I=a[E=Ue(l)]??(a[E]=[]);(I[N]??(I[N]=[])).push(V)}});const[x]=g;x!=null&&x.body.id&&s.push({id:`${l.id}|media|${x.body.id}`,kind:x.kind,src:x.body.id,format:x.body.format,placement:m(x.target),duration:Number(x.body.duration??l.duration)||void 0,poster:nd(l),captions:Js(l)})}),{images:i,media:s,placements:r,frames:a}}function nd(t){var e;return(e=Qs(t))==null?void 0:e.source}const od=1280;function Qs(t){var l;const e=t.placeholderContainer;if(!e)return;const n=(l=wn(e)[0])==null?void 0:l.body;if(!n)return;const o=Ln(n.service),r=typeof n.id=="string"?n.id:void 0,i=o?{service:o,fallback:r}:r?{src:r}:void 0;if(!i)return;const{width:s,height:a}=Me(e);return{source:i,width:s,height:a}}function rd(t,e,n){const o=Me(t),r=e.width/o.width,i=e.height/o.height;return{x:e.x+n.x*r,y:e.y+n.y*i,width:n.width*r,height:n.height*i}}function id(t,e){const[n,o]=D(t.src),r=t.src??t.service??t.fallback;return H(()=>{if(t.src)return o(t.src);let i=true;return Promise.resolve().then(()=>df).then(({resolveThumbnail:s})=>s(t,od,e)).then(s=>i&&o(s)),()=>{i=false}},[r]),n}function sd({still:t,request:e,style:n}){const o=id(t.source,e);return o?h("img",{alt:t.alt,lang:t.alt?t.lang:void 0,src:o,style:n}):h("span",{style:n})}const ad=({instance:t,stills:e,vertical:n,media:o,active:r,lingering:i,onToggle:s,request:a})=>{const{t:l,langOf:c}=dt(),u=o?r?"playerPlay":"playerClose":r?"imageViewerOpen":"imageViewerClose",d=e.map(({width:m,height:g})=>n?g/m:m/g),p=d.reduce((m,g)=>m+g,0),f=n?1/p:p;return h(mt,{children:[h(Ce,{className:"clover-canvas-placeholder-toggle",id:`placeholder-${t}`,label:l(u),lang:c(u),onClick:s,children:o?r?h(cu,{}):h(Go,{}):r?h(uu,{}):h(du,{})}),(r||i)&&h("div",{"aria-hidden":r?void 0:true,className:"clover-canvas-placeholder","data-lingering":!r,"data-media":o,"data-testid":"clover-canvas-placeholder","data-vertical":n,onClick:r?s:void 0,children:h("div",{className:"clover-canvas-placeholder-frame",style:{"--ratio":f},children:e.map((m,g)=>h(sd,{still:m,request:a,style:{[n?"height":"width"]:`${d[g]/p*100}%`}},g))})})]})},ld=({hidden:t})=>{const{t:e,langOf:n}=dt(),o=e("imageExitFullScreen");return h("button",{"aria-label":o,lang:n("imageExitFullScreen"),className:"clover-canvas-exit-full-screen",hidden:t,onClick:r=>void Ks(r.currentTarget),type:"button",children:[h("svg",{viewBox:"0 0 512 512",width:"20",height:"20","aria-hidden":"true",focusable:"false",children:h("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"45",d:"M244 400L100 256l144-144M120 256h292"})}),o]})},er=5,Sn=300,ta=er*4;function wo(t,e=false){return t==="touch"||t==="pen"&&!e}function ea(t){return t.pointerType==="pen"&&t.buttons===0}function cd(t,e,n){for(let o=t;o&&o!==e;o=o.parentElement)if((n>0?o.scrollHeight-o.clientHeight-o.scrollTop:o.scrollTop)>=1&&/auto|scroll/.test(getComputedStyle(o).overflowY))return true;return false}function xo(t,e){var o;let n=t;for(;n&&n!==e;){if(n instanceof HTMLButtonElement||n instanceof HTMLAnchorElement||n instanceof HTMLInputElement||n instanceof HTMLSelectElement||((o=n.dataset)==null?void 0:o.cloverCanvasInteractive)!==void 0)return true;n=n.parentElement}return false}const ud=2e3,dd=1e3,hd=1e3,fd=[":scope > .clover-canvas-controls > *",":scope > .clover-canvas-navigator",":scope > .clover-canvas-media > .clover-canvas-transport > *"].join(", ");function pd(t,e=ud,n){const[o,r]=D(false);return H(()=>{if(!t)return;const i=t.ownerDocument;let s,a=false,l=false,c=false,u=false,d=-1/0,p=null,f=false,m,g=null,_=null;const y=w=>{a=w,r(w)},b=()=>{c||y(false)},x=()=>{s&&clearTimeout(s),s=void 0},C=()=>{_&&clearTimeout(_.timer),_=null},A=w=>wo(w.pointerType,u),T=w=>{l=w.type==="keydown",!l&&(y(true),x(),Number.isFinite(e)&&(s=setTimeout(b,e)))},N=()=>{y(true),x(),s=setTimeout(b,dd)},W=w=>{C(),_={...w,timer:setTimeout(()=>{_=null,y(w.onPicture?!a:true)},Sn)}},j=w=>{if(ea(w)&&(u=true),!A(w))return T(w);(g==null?void 0:g.id)===w.pointerId&&Math.hypot(w.clientX-g.x,w.clientY-g.y)>er&&(g=null)},J=w=>{if(!A(w))return T(w);l=false,x(),g=w.isPrimary===false?null:{id:w.pointerId,x:w.clientX,y:w.clientY,target:w.target}},V=w=>{if(!A(w)||(g==null?void 0:g.id)!==w.pointerId)return;const{target:P}=g;if(g=null,w.type!=="pointerup"||xo(P,t))return;const F=n==null?void 0:n.current,Z=!!(F&&P instanceof Node&&F.contains(P));if(Z&&(_!=null&&_.onPicture)&&Math.hypot(w.clientX-_.x,w.clientY-_.y)<ta){C();return}W({x:w.clientX,y:w.clientY,onPicture:Z})},K=w=>{const P=n==null?void 0:n.current,F=w.target;return!P||!F||!P.contains(F)?false:Array.from(t.querySelectorAll(fd)).some(Z=>{const O=Z.getBoundingClientRect();return O.width>0&&O.height>0&&w.clientX>=O.left&&w.clientX<=O.right&&w.clientY>=O.top&&w.clientY<=O.bottom})},E=w=>{if(w.type==="pointerdown"){if(p!==null||(clearTimeout(m),f=false,!K(w)))return;p=w.pointerId,f=true,A(w)?(l=false,x()):T(w)}else if(w.pointerId!==p)return;w.stopPropagation(),w.preventDefault(),w.type==="pointercancel"?(p=null,f=false):w.type==="pointerup"&&(p=null,A(w)&&W({x:w.clientX,y:w.clientY,onPicture:false}),clearTimeout(m),m=setTimeout(()=>f=false,Sn))},I=w=>{f&&(f=false,w.stopPropagation(),w.preventDefault())},v=w=>{d=Date.now(),w.type==="pointerdown"&&(c=false)},k=()=>{Date.now()-d<hd||(c=true,x(),y(true))},S=w=>{A(w)||a&&N()},M=w=>{t.contains(w.relatedTarget)||(c=false,(a||l)&&N())};i.addEventListener("pointerdown",v,true),i.addEventListener("pointerup",v,true);for(const w of["pointerdown","pointermove","pointerup"])t.addEventListener(w,E,true);return t.addEventListener("pointercancel",E,true),t.addEventListener("click",I,true),t.addEventListener("pointermove",j),t.addEventListener("pointerdown",J),t.addEventListener("pointerup",V),t.addEventListener("pointercancel",V),t.addEventListener("pointerleave",S),t.addEventListener("focusin",k),t.addEventListener("focusout",M),t.addEventListener("keydown",T),()=>{x(),C(),clearTimeout(m),i.removeEventListener("pointerdown",v,true),i.removeEventListener("pointerup",v,true);for(const w of["pointerdown","pointermove","pointerup"])t.removeEventListener(w,E,true);t.removeEventListener("pointercancel",E,true),t.removeEventListener("click",I,true),t.removeEventListener("pointermove",j),t.removeEventListener("pointerdown",J),t.removeEventListener("pointerup",V),t.removeEventListener("pointercancel",V),t.removeEventListener("pointerleave",S),t.removeEventListener("focusin",k),t.removeEventListener("focusout",M),t.removeEventListener("keydown",T)}},[t,e,n]),o}const na="50%";function oa(t,e=na,n=null){const[o,r]=D(()=>typeof IntersectionObserver>"u");return H(()=>{if(o||!t)return;const i=new IntersectionObserver(s=>{s.some(a=>a.isIntersecting)&&(r(true),i.disconnect())},{root:n,rootMargin:e});return i.observe(t),()=>i.disconnect()},[t,o,e,n]),o}function md(t){const[e,n]=D(false);return H(()=>{if(!t)return;const o=()=>n(Qo()===t);return o(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o),()=>{document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}},[t]),e}class gd extends qt.Component{constructor(){super(...arguments);L(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}render(){const{error:n}=this.state;return n?h("div",{className:"clover-canvas-error",role:"alert",lang:"en",children:[h("p",{className:"clover-canvas-error-headline","data-testid":"headline",children:"Something went wrong"}),n.message&&h("span",{className:"clover-canvas-error-body",children:`Error message: ${n.message}`})]}):this.props.children}}function He({overlay:t=false,className:e}){return h("span",{"aria-hidden":"true",className:ct("clover-loading",e),"data-overlay":t||void 0,children:h("span",{})})}function Xe(t,e,n=false,o){const r=zt(),{hostLanguage:i}=dt(void 0,o);if(n)return{props:{},node:null};const s=Ho(e,i);return s===void 0?{props:{"aria-label":t},node:null}:{props:{"aria-labelledby":r},node:h("span",{hidden:true,id:r,lang:s,children:t})}}const vd=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function Jt(t,e){return{a:1,b:0,c:0,d:1,e:t,f:e}}function he(t,e=t){return{a:t,b:0,c:0,d:e,e:0,f:0}}function Ye(t){const e=Math.cos(t),n=Math.sin(t);return{a:e,b:n,c:-n,d:e,e:0,f:0}}function yd(t,e){return{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function fe(...t){return t.reduce((e,n)=>yd(e,n),vd)}function Yt(t,e){return{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function um(t){return`matrix(${[t.a,t.b,t.c,t.d,t.e,t.f].map(bd).join(",")})`}function _d(t,e,n,o=new Float32Array(9)){const r=2/e,i=-2/n;return o[0]=t.a*r,o[1]=t.b*i,o[2]=0,o[3]=t.c*r,o[4]=t.d*i,o[5]=0,o[6]=t.e*r-1,o[7]=t.f*i+1,o[8]=1,o}function bd(t){const e=Math.round(t*1e6)/1e6;return Object.is(e,-0)?"0":String(e)}function wd(t){return{x:t.x+t.width/2,y:t.y+t.height/2}}function nr(t){if(!t.length)return null;let e=1/0,n=1/0,o=-1/0,r=-1/0;for(const i of t)e=Math.min(e,i.x),n=Math.min(n,i.y),o=Math.max(o,i.x+i.width),r=Math.max(r,i.y+i.height);return{x:e,y:n,width:o-e,height:r-n}}function xd(t,e){return t.x<e.x+e.width&&e.x<t.x+t.width&&t.y<e.y+e.height&&e.y<t.y+t.height}function ra(t,e){const n=[Yt(t,{x:e.x,y:e.y}),Yt(t,{x:e.x+e.width,y:e.y}),Yt(t,{x:e.x,y:e.y+e.height}),Yt(t,{x:e.x+e.width,y:e.y+e.height})],o=n.map(a=>a.x),r=n.map(a=>a.y),i=Math.min(...o),s=Math.min(...r);return{x:i,y:s,width:Math.max(...o)-i,height:Math.max(...r)-s}}function Re(t,e,n){return Math.min(Math.max(t,e),n)}const Ei=t=>!!(t&&"overlays"in t),Sd=bt(()=>import("./MediaBody-BBbSMT1i.mjs")),kd=()=>import("./AnnotationState-DZaSy5lH.mjs"),Ed=new Map,Cd={menu:[],placed:[],timed:[],hiddenPages:[],setPagesVisible:()=>{},listedCount:0,comments:Ed,selected:null,select:()=>{},activate:()=>{},release:()=>false,quietlyOpened:null},Md=bt(()=>import("./FrameAnimation-DJZN3Rd4.mjs")),Ci={zoom:true,fullPage:true,rotation:true,reset:true,annotations:true,information:true},Td={description:"canvasKeysImage",keys:["ArrowLeft ArrowRight ArrowUp ArrowDown",It.zoomIn.keys,It.zoomOut.keys,It.reset.keys,It.rotateRight.keys,It.rotateLeft.keys].join(" ")},Ld={description:"canvasKeysMedia",keys:[It.play.keys,"J L",It.mute.keys].join(" ")},Id={description:"canvasKeysAnnotations",keys:"Escape"},Pd=t=>{var n;return!!((n=t.canvases)!=null&&n.length)||ia(t.body,t.src).length>0?h(gd,{children:h(Ad,{...t})}):null},Ad=t=>{var Mr,Tr,Lr,Ir,Pr;const{surface:e,manifestId:n,canvases:o,viewingDirection:r,body:i,src:s,isTiledImage:a=false,label:l,partOf:c,language:u,instanceId:d,className:p,options:f,navigator:m=false,controls:g=true,controlButtons:_,annotations:y,onReady:b,onViewportChange:x,onMediaElement:C,onCaptionChange:A,caption:T,onEnded:N,chapters:W,highlightedChapter:j,onChapterHighlight:J,placeholder:V=true,children:K}=t,{t:E}=dt(),I=$(null),[v,k]=D(null),S=md(v),M=Ke(k),w=pd(v,f==null?void 0:f.hideDelay,I),P=oa(v),F=zt(),[Z]=D(()=>d??`clover-canvas-${F}`),O=$(null),[X,ht]=D(null),st=Ei(X)?X:null,[q,rt]=D(null),Q=g===false?null:g===true?Ci:{...Ci,...g},[R,Y]=D("loading"),[ut,vt]=D(0),St=$(b),Ht=$(x),ee=$(f);St.current=b,Ht.current=x,ee.current=f;const Lt=As(r),B=pt(()=>Ju(o??[]),[o]),[it,Pt]=D({}),Fa=(z,tt)=>Pt(wt=>({...wt,[z]:tt})),hr=!!(Q!=null&&Q.information),Ae=!!(y!=null&&y.length),fr=_n(kd,Ae),[za,Ha]=D(null),At=Ae&&za||Cd,Qe=$(At);Qe.current=At;const tn=ot(()=>Qe.current.release(),[]),{comments:On,listedCount:pr}=At,pe=pt(()=>hr?(o??[]).filter(z=>bu(z)||On.has(z.id)):[],[o,hr,On]),Nn=`caption-${Z}`,[Da,mr]=D(false),Rn=Da&&pe.length>0,gr=ot(z=>{var tt;mr(false),z&&((tt=document.getElementById(`information-${Z}`))==null||tt.focus())},[Z]),Zt=pt(()=>(o??[]).find(z=>_o(z).length)??null,[o]),Wa=Zt?_o(Zt):Nd,kt=pt(()=>o!=null&&o.length?ed(o,Lt,it,{standIns:o.length>1}):null,[o,Lt,it]),Ua=pt(()=>ia(i,s,a),[i,s,a]),et=(kt==null?void 0:kt.media[0])??null,[Oe,ja]=D(null),en=$(C);en.current=C;const Va=ot(z=>{var tt;ja(z),(tt=en.current)==null||tt.call(en,z)},[]),ne=kt?kt.images:Ua,oe=!!et&&(o==null?void 0:o.length)===1,re=oe&&(et==null?void 0:et.kind)==="audio",nn=!oe&&((Mr=f==null?void 0:f.gestures)==null?void 0:Mr.navigable)!==false,Dt=(o==null?void 0:o.map(z=>z.id).join("|"))??null,me=pt(()=>{if(!o||!V)return[];const z=o.flatMap(tt=>{const wt=Qs(tt),an=at(tt.label,u);return wt?[{...wt,alt:an.text,lang:an.lang}]:[]});return Lt==="right-to-left"||Lt==="bottom-to-top"?z.reverse():z},[o,Lt,V,u]),[qa,vr]=D(false),[Ka,yr]=D(null),gt=!re&&me.length>0&&(et?Ka!==Dt:!qa),_r=(z,{annotations:tt=false}={})=>({...z,zoom:false,rotation:false,reset:false,fullPage:false,annotations:tt&&z.annotations}),br=qt.Children.count(K)>0,on=Q?gt?pe.length||br||pr?_r(Q,{annotations:true}):null:oe?B.length||pe.length||br||pr?_r(Q,{annotations:true}):null:Q:null,Bn=m&&!gt&&(et?et.kind==="audio"&&!oe&&ne.length>0:true),[$n,Za]=D(null),ge=et?$n??et.placement:null,Fn=pt(()=>(et==null?void 0:et.kind)==="video"&&Oe&&ge?[...ne,{id:et.id,placement:ge,width:ge.width,height:ge.height,media:{element:Oe}}]:ne,[ne,et,Oe,ge]),wr=oe&&(et==null?void 0:et.kind)==="video"&&$n?$n:kt?nr(kt.placements):null,Xa=JSON.stringify([ne,wr,Fn.length!==ne.length&&[et==null?void 0:et.id,ge]]),rn=$(null),zn=$(false),Ya=()=>{et?yr(gt?Dt:null):vr(gt),gt||tn()},Hn=Array.isArray(i)?i[0]:i,yt=[l,(Tr=o==null?void 0:o[0])==null?void 0:Tr.label,Hn==null?void 0:Hn.label].map(z=>at(z,u)).find(z=>z.text),Ga=pt(()=>{const z=at(c,u);return z.text&&z.text!==(yt==null?void 0:yt.text)?z:void 0},[c,u,yt==null?void 0:yt.text]),xr=Xe((yt==null?void 0:yt.text)||E("canvasImage"),yt?yt.lang:M.langOf("canvasImage"),false,M.hostLanguage),sn=gt?[]:[...nn?[Td]:[],...et?[Ld]:[],...Ae?[Id]:[]],Sr=`keys-${Z}`,Ja=nn&&!gt&&!M.langOf("canvasRoleDescription")?E("canvasRoleDescription"):void 0,Dn=!!on&&pe.length>0,Qa=Dn&&pe.map((z,tt)=>at(z.label,u).text?Vs(Nn,tt):null).filter(Boolean).join(" ")||void 0,kr=$({canvases:o,scene:kt,canvasKey:Dt});kr.current={canvases:o,scene:kt,canvasKey:Dt};const Wn=$(null),Un=ot(()=>{const{canvases:z,scene:tt,canvasKey:wt}=kr.current;Wn.current=z&&tt&&rn.current===wt?{key:wt,canvases:z,placements:tt.placements}:null},[]),tl=!o||((Lr=Wn.current)==null?void 0:Lr.key)===Dt;H(()=>{const z=I.current;if(!z)return;const tt=e(z,ee.current),wt=Ei(tt)?tt:null;O.current=tt,ht(tt),tt.setDismiss(tn);const an=tt.on("open",()=>{var ie;jn(false),Un(),Y("ready"),vt(ln=>ln+1),wt&&((ie=St.current)==null||ie.call(St,Od(wt,()=>Wn.current,ln=>{var Or,Nr;const Ar=Qe.current.placed.find(Vn=>Vn.id===ln);return Ar?(Qe.current.select(Ar),(Nr=Array.from(((Or=wt.overlays)==null?void 0:Or.container.querySelectorAll("[id]"))??[]).find(Vn=>Vn.id===ln))==null||Nr.focus({preventScroll:true}),true):false})))}),nl=tt.on("change",()=>{jn(false),Un(),Y("ready"),vt(ie=>ie+1)}),ol=tt.on("error",()=>{tt.isOpen||Y("error")}),rl=tt.on("viewport",()=>{var ie;wt&&((ie=Ht.current)==null||ie.call(Ht,wt.getBounds()))});return()=>{an(),nl(),ol(),rl(),tt.dispose(),O.current=null,ht(null)}},[d,e,tn,Un]),H(()=>{if(!(!st||!q))return st.attachNavigator(q)},[st,q]),H(()=>{const z=O.current;if(gt&&(zn.current=true),!z||!P||gt)return;const tt=rn.current!==null&&rn.current!==Dt;(!z.isOpen||tt)&&Y("loading");const wt=oe||zn.current&&z.isOpen||tt;rn.current=Dt,zn.current=false,z.setImages(Fn,{world:wr??void 0,fit:wt})},[Xa,d,Oe,P,gt]);const Er=$(n),[el,jn]=D(false);Tt(()=>{var z;n!==Er.current&&(Er.current=n,(z=O.current)==null||z.clear(),jn(true),Y("loading"))},[n]);const Cr=R==="loading"&&Fn.length>0&&P&&!gt;return h(Le.Provider,{value:M.hostLanguage,children:h("figure",{"aria-labelledby":Qa,className:ct("clover-canvas",p),"data-testid":"clover-canvas","data-status":R,"data-has-navigator":Bn,"data-fullscreen":S,"data-controls":w?"visible":"hidden","data-media":et==null?void 0:et.kind,"data-player":re?"":void 0,"data-animated":Zt?"":void 0,"data-navigable":nn,"data-placeholder":me.length&&!re?gt:void 0,ref:M.ref,onKeyDown:z=>{if(z.key==="Escape"&&Rn&&!z.defaultPrevented){z.preventDefault(),gr(false);return}if(z.key==="Escape"&&!z.defaultPrevented&&!z.currentTarget.querySelector(".clover-canvas-menu")&&tn()){z.preventDefault();return}mu(z,I.current)},style:{position:"relative",width:"100%",height:"100%",margin:0,overflow:"hidden",isolation:"isolate"},children:[(on||Bn)&&h("div",{className:"clover-canvas-scrim","aria-hidden":"true"}),h(ld,{hidden:!S}),X&&on&&h(Du,{renderer:st,instance:Z,config:on,controlButtons:_,hasPlaceholder:me.length>0,choices:gt?[]:B,selections:it,onSelect:Fa,annotations:At.menu,hiddenPages:At.hiddenPages,onPageVisibilityChange:At.setPagesVisible,selectedAnnotation:At.selected,onAnnotationSelect:At.select,onAnnotationActivate:At.activate,captionId:Dn?Nn:void 0,captionOpen:Rn,onCaptionToggle:()=>mr(z=>!z),language:u,children:K}),Bn&&h("div",{ref:rt,className:"clover-canvas-navigator","data-testid":"clover-canvas-navigator","aria-hidden":"true"}),h("div",{ref:I,className:"clover-canvas-viewport",style:{position:"absolute",inset:0,overflow:"hidden",zIndex:-1},"data-testid":"clover-canvas-viewport",role:Ae?"group":"img","aria-roledescription":Ja,...xr.props,"aria-describedby":sn.length?Sr:void 0,"aria-keyshortcuts":sn.map(({keys:z})=>z).join(" ")||void 0,"aria-busy":Cr,tabIndex:0}),xr.node,sn.length>0&&h("span",{id:Sr,style:le,children:sn.map(({description:z},tt)=>h(qt.Fragment,{children:[tt>0&&" ",h("span",{lang:M.langOf(z),children:E(z)})]},z))}),(et==null?void 0:et.kind)==="audio"&&!re&&ne.length===0&&!gt&&(yt==null?void 0:yt.text)&&h("p",{className:"clover-canvas-sound-label","aria-hidden":"true",lang:yt.lang||void 0,children:yt.text}),me.length>0&&!re&&h(ad,{instance:Z,stills:me,vertical:Lt==="top-to-bottom"||Lt==="bottom-to-top",media:!!et,active:gt,lingering:R==="loading"&&!el,onToggle:Ya,request:f==null?void 0:f.request}),X&&et&&P&&!gt&&h(Mt,{fallback:null,children:h(Sd,{media:et,request:f==null?void 0:f.request,surface:X,instance:Z,onElement:Va,onFit:Za,onCaptionChange:A,caption:T,navigable:nn,fullscreen:oe&&!!(Q!=null&&Q.fullPage),isFullscreen:S,onEnded:N,chapters:W,highlightedChapter:j,onChapterHighlight:J,autoPlay:!re&&me.length>0&&At.quietlyOpened!==Dt,language:u,notes:At.timed,player:re&&o?{canvas:o[0],title:yt,partOf:Ga}:void 0})}),st&&Zt&&(kt==null?void 0:kt.frames[Ue(Zt)])&&!gt&&h(Mt,{fallback:null,children:h(Md,{renderer:st,frames:Wa,byFrame:kt.frames[Ue(Zt)],animationKey:Zt.id,sceneVersion:ut,autoplay:(Ir=f==null?void 0:f.animation)==null?void 0:Ir.autoplay,loop:(Pr=f==null?void 0:f.animation)==null?void 0:Pr.loop,onEnded:N,language:u},Zt.id)}),fr&&Ae&&y&&h(fr.AnnotationState,{given:t,annotations:y,scene:kt,renderer:st,sceneVersion:ut,drawn:tl,media:et,mediaElement:Oe,showPlaceholder:gt,canvasKey:Dt,openImages:vr,openMedia:yr,host:I,onModel:Ha}),Cr&&h(He,{overlay:true}),Dn&&h(wu,{id:Nn,canvases:pe,comments:On,open:Rn,onClose:gr,language:u})]})})};function Od(t,e,n){return{fitCanvasRect(o,r,i){const s=e(),a=(s==null?void 0:s.canvases.findIndex(l=>l.id===o))??-1;return!s||a===-1?false:(t.fitBounds(rd(s.canvases[a],s.placements[a],r),i),true)},getCanvasRegion(){const o=e();return o?Rd(t.getBounds(),o.canvases,o.placements):null},get backendKind(){return t.backendKind},get atHome(){return t.isAtHome},fitBounds:(o,r)=>t.fitBounds(o,r),fitItemRect:(o,r,i)=>t.fitItemRect(o,r,i),itemRectToWorld:(o,r)=>t.itemRectToWorld(o,r),getBounds:()=>t.getBounds(),getHomeBounds:()=>t.getHomeBounds(),getCamera:()=>t.getCamera(),home:o=>t.home(o),zoomBy:(o,r,i)=>t.zoomBy(o,r,i),panBy:(o,r,i)=>t.panBy(o,r,i),setRotation:(o,r)=>t.setRotation(o,r),getRotation:()=>t.getRotation(),rotateBy:o=>t.rotateBy(o),worldToScreenPoint:o=>t.worldToScreenPoint(o),screenToWorldPoint:o=>t.screenToWorldPoint(o),on:(o,r)=>t.on(o,r),zoomToAnnotation:n}}const Nd=[];function ia(t,e,n=false){const o=Array.isArray(t)?t:t?[t]:[];return o.length?o.map((i,s)=>{const a=Ln(i.service);return!a&&!i.id?null:{id:`${s}:${i.id??a}|${i.region??""}`,service:a,url:i.id,width:i.width,height:i.height,region:i.region}}).filter(i=>i!==null):(Array.isArray(e)?e:e?[e]:[]).filter(Boolean).map((i,s)=>({id:`${s}:${i}`,...n?{service:i}:{url:i}}))}function Rd(t,e,n){let o=null;if(n.forEach((d,p)=>{const f=Math.max(t.x,d.x),m=Math.max(t.y,d.y),g=Math.min(t.x+t.width,d.x+d.width)-f,_=Math.min(t.y+t.height,d.y+d.height)-m;if(g<=0||_<=0)return;const y=g*_;(!o||y>o.area)&&(o={index:p,area:y,clip:{x:f,y:m,width:g,height:_}})}),!o)return null;const{index:r,clip:i}=o,s=e[r],a=n[r],l=Me(s),c=l.width/a.width,u=l.height/a.height;return{canvasId:s.id,rect:{x:Math.round((i.x-a.x)*c),y:Math.round((i.y-a.y)*u),width:Math.round(i.width*c),height:Math.round(i.height*u)}}}function Bd(t,e,n,o){return pt(()=>((o==null?void 0:o(t??null,(e==null?void 0:e.id)??null,e==null?void 0:e.duration))??[]).map(r=>{const i=at(r.label,n);return{...r.id?{id:r.id}:{},label:i.text,lang:i.lang,start:r.start,end:r.end}}),[t,e,n,o])}function $d(t,e,n,o){if(t.region){if(!e)return false;const{x:r,y:i,w:s,h:a}=t.region;if(!e.fitCanvasRect(t.canvasId,{x:r,y:i,width:s,height:a},true))return false}if(o&&(t.time!==void 0||t.autoplay)){if(!n)return false;const r=()=>{t.time!==void 0&&(n.currentTime=t.time),t.autoplay&&n.play().catch(()=>{})};n.readyState>=HTMLMediaElement.HAVE_METADATA?r():n.addEventListener("loadedmetadata",r,{once:true})}return true}function Fd(t,e){const n=t.store.get().manifest;if(e.canvasId&&xt(n).canvases.some(r=>r.id===e.canvasId))t.goTo(e.canvasId);else if(e.manifestId&&e.manifestId!==(n==null?void 0:n.id))t.goToManifest(e.manifestId,e.canvasId);else return false;return true}function sa(t){if(!t)return;const[e,n]=t.split(","),o=Number(e);if(e===""||Number.isNaN(o))return;if(n===void 0||n==="")return{start:o};const r=Number(n);return Number.isNaN(r)?{start:o}:{start:o,end:r}}function aa(t){if(typeof t=="string")return Mi(t);const e=t;return(e==null?void 0:e.type)==="SpecificResource"?e:typeof(e==null?void 0:e.id)=="string"?Mi(e.id):e}const Mi=t=>t.replace(/\/((?:t|xywh)=[^/#]*)$/,"#$1"),Ti=new WeakMap,Li=[];function zd(t,e,n){if(!t||!e)return Li;let o=Ti.get(t);o||Ti.set(t,o=new Map);const r=`${e}|${n??""}`,i=o.get(r);if(i)return i;const s=[],a=new Set,l=u=>{if(!(!u||a.has(u.id??u))){a.add(u.id??u);for(const d of U(u.items)){if((d==null?void 0:d.type)==="Range"){l(d);continue}const p=Ie(aa(d));if(p.id.split("#")[0]!==e)continue;const f=sa(p.t);f&&s.push({...u.id?{id:u.id}:{},label:u.label,...f})}}};for(const u of U(t.structures))l(u);s.sort((u,d)=>u.start-d.start);const c=s.length?s.map((u,d)=>{var p;return{...u,end:u.end??((p=s[d+1])==null?void 0:p.start)??n}}):Li;return o.set(r,c),c}const Ii=new WeakMap,Pi=[];function Hd(t){if(!t)return Pi;const e=Ii.get(t);if(e)return e;const n=new Set,o=a=>{var g,_;if(!a||n.has(a.id??a))return[];n.add(a.id??a);const l=[],c=[];let u;for(const y of U(a.items))if((y==null?void 0:y.type)==="Range"){const b=o(y);l.push(...b),b.forEach(x=>c.push(...x.canvasIds))}else{const b=Ie(aa(y));if(!b.id)continue;u??(u=b),c.push(b.id)}if(U(a.behavior).includes("no-nav"))return l;const p=u??void 0,f={id:a.id??`range-${n.size}`,label:a.label,canvasId:(p==null?void 0:p.id)??((g=l[0])==null?void 0:g.canvasId),canvasIds:[...new Set(c)],children:l},m=sa(p==null?void 0:p.t);return m?f.time=m:!p&&((_=l[0])!=null&&_.time)&&(f.time=l[0].time),p!=null&&p.rect&&(f.region=p.rect),[f]},r=U(t.structures).flatMap(o),i=r.length===1&&r[0].children.length?r[0].children:r,s=i.length?i:Pi;return Ii.set(t,s),s}function dm(t,e,n){let o=null;const r=(i,s)=>{e&&i.canvasIds.includes(e)&&(!i.time||n!==void 0&&n>=i.time.start&&(i.time.end===void 0||n<i.time.end))&&(!o||s>=o.depth)&&(o={id:i.id,depth:s}),i.children.forEach(a=>r(a,s+1))};return t.forEach(i=>r(i,0)),o?o.id:null}function Dd(){const t=nt(n=>n.status),e=nt(n=>n.error);return pt(()=>({status:t,error:e}),[t,e])}function Wd(){return nt(t=>t.manifest)}function la(){return nt(t=>xt(t.manifest))}function or(){return nt(t=>we(t.manifest,t.canvasId))}function Ud(){return nt(t=>ue(t.manifest,t.canvasId))}function jd(){const{clover:t}=te("useNavigation"),e=nt(o=>Ze(o.manifest,o.canvasId)),n=nt(o=>xt(o.manifest).views.length);return pt(()=>Xc(t,e,n),[t,e,n])}function hm(t){const{language:e}=te("useLocalized");return pt(()=>at(t,e),[t,e])}function fm(){return dt().t}function pm(){return dt().langOf}const Vd=({options:t,onReady:e,onViewportChange:n,onMediaElement:o,onCaptionChange:r,caption:i,onEnded:s,placeholder:a=true,label:l,partOf:c,language:u,annotations:d,chapters:p,...f})=>{const m=te("Canvas"),{clover:g}=m,_=Ft(g.captions.subscribe,g.captions.get,g.captions.get),y=i??_,b=u??m.language,x=or(),{direction:C}=la(),A=Wd(),T=Ud(),N=nt(B=>{var it;return B.status==="loading"?"loading":((it=B.manifest)==null?void 0:it.id)??""}),W=nt(B=>B.target),j=nt(B=>$s(B.manifest,B.addedSets,B.search.set)),J=nt(B=>Tc(B.manifest,B.addedSets,B.hiddenSets,B.shownSets)),V=nt(B=>qo(B.manifest,B.addedSets,B.hiddenSets,B.shownSets)),K=nt(B=>B.annotationId),E=Ft(g.highlight.subscribe,g.highlight.get,g.highlight.get),I=Ft(g.chapter.subscribe,g.chapter.get,g.chapter.get),v=x.map(B=>B.id).join("|"),k=pt(()=>{if(d)return d;const B=x.map(it=>it.id);return j.flatMap(it=>it.entries.filter(Pt=>B.includes(Pt.canvasId)).map(Pt=>({annotation:Pt.annotation,targetIndex:B.indexOf(Pt.canvasId),pageId:it.id,...it.label?{pageLabel:it.label}:{}})))},[d,j,x]),M=W?(B=>!!B&&x.some(it=>it.id===B))(W.canvasId):false,w=$(null);M&&(w.current=v);const P=a&&w.current!==v,F=$(null),Z=$(null),O=pt(()=>x.some(B=>xn(B).length>0),[x]),X=O?x.find(B=>xn(B).length>0):void 0,ht=Bd(A,X,b,zd),st=$(O);st.current=O;const q=ot(()=>{const B=g.store.get().target;!B||!g.store.get().canvasId||$d(B,F.current,Z.current,st.current)&&g.consumeTarget()},[g]);H(()=>{W&&q()},[W,v,q]);const rt=$(e);rt.current=e;const Q=ot(B=>{var it;F.current=B,B.on("change",q),q(),(it=rt.current)==null||it.call(rt,B)},[q]),R=ot(B=>{var Pt;const it=(Pt=F.current)==null?void 0:Pt.getCanvasRegion();g.viewport.emit(it?{canvasId:it.canvasId,region:{x:it.rect.x,y:it.rect.y,w:it.rect.width,h:it.rect.height}}:null),n==null||n(B)},[g,n]),Y=ot(B=>{Z.current=B,g.media.emit(B),B&&q(),o==null||o(B)},[g,q,o]),ut=ot(()=>{s==null||s(),(se(A,"auto-advance")||se(T,"auto-advance"))&&g.next({autoplay:true,wrap:se(A,"repeat")})},[g,A,T,s]),vt=ot(B=>void Fd(g,B),[g]),St=(t==null?void 0:t.request)??g.request,Ht=se(T,"auto-advance")||se(A,"auto-advance"),ee=se(T,"repeat")||se(A,"repeat"),Lt=pt(()=>({...t,request:St,animation:(t==null?void 0:t.animation)??{autoplay:Ht,loop:ee}}),[t,St,Ht,ee]);return x.length?h(Pd,{...f,manifestId:N,canvases:x,viewingDirection:C,language:b,label:l??(T==null?void 0:T.label)??(A==null?void 0:A.label),partOf:c??(A==null?void 0:A.label),options:Lt,placeholder:P,onReady:Q,onViewportChange:R,onMediaElement:Y,caption:y,onCaptionChange:B=>{g.captions.emit((B==null?void 0:B.id)??null),r==null||r(B)},onEnded:ut,annotations:k,hiddenPages:V,unlistedPages:J,onPageVisibilityChange:(B,it)=>B.forEach(Pt=>g.setSetVisible(Pt,it)),chapters:p??ht,highlightedChapter:I,onChapterHighlight:B=>g.chapter.emit(B),selectedAnnotation:K,highlightedAnnotation:E,onAnnotationSelect:B=>g.selectAnnotation(B),onAnnotationLink:f.onAnnotationLink??vt,onAnnotationActive:B=>{var it;g.highlight.emit(B),(it=f.onAnnotationActive)==null||it.call(f,B)}}):null},qd=6,ye=new Set;function Kd(t){if(ye.has(t))return true;for(;ye.size>=qd;){let e;for(const n of ye)n.hiddenSince!==null&&(!e||n.hiddenSince<e.hiddenSince)&&(e=n);if(!e)return false;ye.delete(e),e.release()}return ye.add(t),true}function Ai(t){ye.delete(t)}function Zd(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement?t.complete&&t.naturalWidth>0:true}function Xd(t,e){if(!t.bleed)return{x:0,y:0};const n=t.transform,o=Math.hypot(n.a,n.b)*e,r=Math.hypot(n.c,n.d)*e;return{x:t.bleed.right&&o>0?1/o:0,y:t.bleed.bottom&&r>0?1/r:0}}const Yd=`#version 300 es
|
|
2
|
+
in vec2 a_position;
|
|
3
|
+
uniform mat3 u_matrix;
|
|
4
|
+
uniform vec4 u_crop;
|
|
5
|
+
out vec2 v_uv;
|
|
6
|
+
|
|
7
|
+
void main() {
|
|
8
|
+
vec3 clip = u_matrix * vec3(a_position, 1.0);
|
|
9
|
+
gl_Position = vec4(clip.xy, 0.0, 1.0);
|
|
10
|
+
v_uv = u_crop.xy + a_position * u_crop.zw;
|
|
11
|
+
}
|
|
12
|
+
`,Gd=`#version 300 es
|
|
13
|
+
precision highp float;
|
|
14
|
+
in vec2 v_uv;
|
|
15
|
+
uniform sampler2D u_texture;
|
|
16
|
+
uniform float u_opacity;
|
|
17
|
+
out vec4 outColor;
|
|
18
|
+
|
|
19
|
+
void main() {
|
|
20
|
+
outColor = texture(u_texture, v_uv) * u_opacity;
|
|
21
|
+
}
|
|
22
|
+
`;class kn{constructor(e,n,o){L(this,"kind","webgl2");L(this,"canvas");L(this,"maxTextureSize");L(this,"gl");L(this,"program",null);L(this,"vao",null);L(this,"uniforms",{matrix:null,crop:null,opacity:null,texture:null});L(this,"textures",new Map);L(this,"cssWidth",1);L(this,"cssHeight",1);L(this,"pixelRatio",1);L(this,"matrixScratch",new Float32Array(9));L(this,"isLost",false);L(this,"callbacks");L(this,"handleLost",()=>{var e2,n2;this.isLost=true,this.textures.clear(),(n2=(e2=this.callbacks).onLost)==null||n2.call(e2)});this.canvas=e,this.gl=n,this.callbacks=o,this.maxTextureSize=n.getParameter(n.MAX_TEXTURE_SIZE)||4096;const r=Jd(n,Yd,Gd);this.program=r,this.uniforms={matrix:n.getUniformLocation(r,"u_matrix"),crop:n.getUniformLocation(r,"u_crop"),opacity:n.getUniformLocation(r,"u_opacity"),texture:n.getUniformLocation(r,"u_texture")};const i=n.createVertexArray();n.bindVertexArray(i);const s=n.createBuffer();n.bindBuffer(n.ARRAY_BUFFER,s),n.bufferData(n.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),n.STATIC_DRAW);const a=n.getAttribLocation(r,"a_position");n.enableVertexAttribArray(a),n.vertexAttribPointer(a,2,n.FLOAT,false,0,0),n.bindVertexArray(null),this.vao=i,n.enable(n.BLEND),n.blendFunc(n.ONE,n.ONE_MINUS_SRC_ALPHA),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,false),n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL),e.addEventListener("webglcontextlost",this.handleLost)}static create(e,n={}){let o=null;try{o=e.getContext("webgl2",{alpha:true,premultipliedAlpha:true,antialias:false,depth:false,stencil:false,preserveDrawingBuffer:false})}catch{o=null}if(!o||typeof o.createShader!="function")return null;try{return new kn(e,o,n)}catch{return null}}resize(e,n,o){this.cssWidth=Math.max(1,e),this.cssHeight=Math.max(1,n),this.pixelRatio=o;const r=Math.max(1,Math.round(e*o)),i=Math.max(1,Math.round(n*o));this.canvas.width!==r&&(this.canvas.width=r),this.canvas.height!==i&&(this.canvas.height=i)}begin(){if(this.isLost)return;const e=this.gl;e.viewport(0,0,this.canvas.width,this.canvas.height),e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),e.useProgram(this.program),e.bindVertexArray(this.vao),e.activeTexture(e.TEXTURE0),e.uniform1i(this.uniforms.texture,0)}draw(e){if(this.isLost||!Zd(e.source))return"skipped";const n=this.gl,o=this.upload(e);if(o==="tainted")return"tainted";if(!o)return"skipped";const r=e.crop??{x:0,y:0,width:e.width,height:e.height},i=Xd(e,this.pixelRatio),s=fe(e.transform,Jt(r.x,r.y),he(r.width+i.x,r.height+i.y));return n.uniformMatrix3fv(this.uniforms.matrix,false,_d(s,this.cssWidth,this.cssHeight,this.matrixScratch)),n.uniform4f(this.uniforms.crop,r.x/e.width,r.y/e.height,r.width/e.width,r.height/e.height),n.uniform1f(this.uniforms.opacity,e.opacity),n.bindTexture(n.TEXTURE_2D,o.texture),n.drawArrays(n.TRIANGLE_STRIP,0,4),"drawn"}end(){this.isLost||this.gl.bindVertexArray(null)}has(e){return!this.isLost&&this.textures.has(e)}release(e){const n=this.textures.get(e);n&&(this.isLost||this.gl.deleteTexture(n.texture),this.textures.delete(e))}dispose(){var e;if(this.canvas.removeEventListener("webglcontextlost",this.handleLost),!this.isLost){for(const n of[...this.textures.keys()])this.release(n);this.program&&this.gl.deleteProgram(this.program),this.vao&&this.gl.deleteVertexArray(this.vao)}this.textures.clear(),(e=this.gl.getExtension("WEBGL_lose_context"))==null||e.loseContext(),this.isLost=true}upload(e){const n=this.gl,o=this.textures.get(e.key);if(o&&o.width===e.width&&o.height===e.height)return o;const r=(o==null?void 0:o.texture)??n.createTexture();if(!r)return null;n.bindTexture(n.TEXTURE_2D,r);try{n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,e.source)}catch(s){if(o||n.deleteTexture(r),Qd(s))return"tainted";throw s}n.generateMipmap(n.TEXTURE_2D),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR_MIPMAP_LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE);const i={texture:r,width:e.width,height:e.height};return this.textures.set(e.key,i),i}}function Jd(t,e,n){const o=Oi(t,t.VERTEX_SHADER,e),r=Oi(t,t.FRAGMENT_SHADER,n),i=t.createProgram();if(!i)throw new Error("Could not create WebGL program");if(t.attachShader(i,o),t.attachShader(i,r),t.linkProgram(i),t.deleteShader(o),t.deleteShader(r),!t.getProgramParameter(i,t.LINK_STATUS)){const s=t.getProgramInfoLog(i);throw t.deleteProgram(i),new Error(`Could not link WebGL program: ${s}`)}return i}function Oi(t,e,n){const o=t.createShader(e);if(!o)throw new Error("Could not create WebGL shader");if(t.shaderSource(o,n),t.compileShader(o),!t.getShaderParameter(o,t.COMPILE_STATUS)){const r=t.getShaderInfoLog(o);throw t.deleteShader(o),new Error(`Could not compile WebGL shader: ${r}`)}return o}function Qd(t){return typeof t=="object"&&t!==null&&t.name==="SecurityError"}function ca(t,e){return fe(Jt(e.width/2,e.height/2),Ye(t.rotation),he(t.zoom),Jt(-t.x,-t.y))}function ua(t,e){return fe(Jt(t.x,t.y),he(1/t.zoom),Ye(-t.rotation),Jt(-e.width/2,-e.height/2))}function Ni(t,e,n){return Yt(ua(t,e),n)}function th(t,e,n){return Yt(ca(t,e),n)}function So(t,e){return ra(ua(t,e),{x:0,y:0,width:e.width,height:e.height})}function Ri(t,e,n=0,o=0){const r=ra(Ye(n),t),i=Math.max(1,e.width*(1-o*2)),s=Math.max(1,e.height*(1-o*2)),a=Math.min(i/Math.max(r.width,Number.EPSILON),s/Math.max(r.height,Number.EPSILON)),l=wd(t);return{x:l.x,y:l.y,zoom:a,rotation:n}}function ko(t,e,n,o,r){const i=Yt(fe(he(1/n),Ye(-o)),{x:e.x-r.width/2,y:e.y-r.height/2});return{x:t.x-i.x,y:t.y-i.y}}function eh(t,e){return t.x===e.x&&t.y===e.y&&t.zoom===e.zoom&&t.rotation===e.rotation}const nh=.09,oh=1e-4,Bi=.05,rh=1e-4;class ih{constructor(e,n=nh){L(this,"current");L(this,"target",null);L(this,"timeConstant");this.current={...e},this.timeConstant=n}get destination(){return this.target?{...this.target.state}:{...this.current}}set(e){this.current={...e},this.target=null}animateTo(e,n,o=false){if(o||this.timeConstant===0){this.set(e.state);return}let r=e.anchor;if(r){const i=ko(r.world,r.screen,e.state.zoom,e.state.rotation,n);Math.hypot(i.x-e.state.x,i.y-e.state.y)*e.state.zoom>Bi&&(r=void 0)}this.target={state:{...e.state},anchor:r}}stop(){this.target=null}step(e,n){const o=this.target;if(!o)return false;const r=1-Math.exp(-Math.max(e,0)/this.timeConstant),i=this.current,s=o.state,a=Math.exp(Math.log(i.zoom)+(Math.log(s.zoom)-Math.log(i.zoom))*r),l=i.rotation+(s.rotation-i.rotation)*r;let c;return o.anchor?c=ko(o.anchor.world,o.anchor.screen,a,l,n):c={x:i.x+(s.x-i.x)*r,y:i.y+(s.y-i.y)*r},this.current={x:c.x,y:c.y,zoom:a,rotation:l},Math.abs(Math.log(s.zoom/a))<oh&&Math.abs(s.rotation-l)<rh&&Math.hypot(s.x-c.x,s.y-c.y)*a<Bi?(this.current={...s},this.target=null,false):true}}const Eo={clickToZoom:true,dblClickToZoom:true,pinchToZoom:true,scrollToZoom:false,navigable:true},Jn=2,$i=1.5,Fi=.1,sh=100,ah=200,lh=.002,ch=.01;class uh{constructor(e,n,o=Eo){L(this,"pointers",new Map);L(this,"samples",[]);L(this,"down",null);L(this,"pinch",null);L(this,"lastTap",null);L(this,"lastPointerType","");L(this,"penHovers",false);L(this,"onPointerDown",e2=>{var o2,r;if(this.lastPointerType=e2.pointerType,e2.pointerType==="mouse"&&e2.button!==0||xo(e2.target,this.element))return;(r=(o2=this.element).setPointerCapture)==null||r.call(o2,e2.pointerId);const n2=this.local(e2);this.pointers.set(e2.pointerId,n2),this.pointers.size===1?(this.down={x:n2.x,y:n2.y,t:e2.timeStamp,moved:false},this.samples=[{x:n2.x,y:n2.y,t:e2.timeStamp}],this.target.setInteracting(true)):this.pointers.size===2&&(this.pinch=this.pinchState(),this.down&&(this.down.moved=true))});L(this,"onPointerMove",e2=>{var r;ea(e2)&&(this.penHovers=true);const n2=this.pointers.get(e2.pointerId);if(!n2)return;const o2=this.local(e2);if(this.pointers.set(e2.pointerId,o2),this.pointers.size===1){const i=o2.x-n2.x,s=o2.y-n2.y;this.down&&Math.hypot(o2.x-this.down.x,o2.y-this.down.y)>er&&(this.down.moved=true),(r=this.down)!=null&&r.moved&&this.options.navigable&&this.target.panBy(i,s,false),this.samples.push({x:o2.x,y:o2.y,t:e2.timeStamp});const a=e2.timeStamp-sh;for(;this.samples.length>2&&this.samples[0].t<a;)this.samples.shift()}else if(this.pointers.size===2&&this.pinch&&this.options.navigable){const i=this.pinchState();this.options.pinchToZoom&&this.pinch.distance>0&&this.target.zoomBy(i.distance/this.pinch.distance,i.mid,false),this.target.panBy(i.mid.x-this.pinch.mid.x,i.mid.y-this.pinch.mid.y,false),this.pinch=i}});L(this,"onPointerUp",e2=>{var l,c,u,d,p,f;if(!this.pointers.has(e2.pointerId))return;if(this.pointers.delete(e2.pointerId),(c=(l=this.element).releasePointerCapture)==null||c.call(l,e2.pointerId),this.pointers.size===1){this.pinch=null;const[m]=this.pointers.values();this.samples=[{...m,t:e2.timeStamp}];return}if(this.pointers.size>0)return;const n2=this.down;if(this.down=null,this.pinch=null,this.target.setInteracting(false),!n2)return;const o2=this.local(e2);if(!n2.moved&&e2.type==="pointerup"&&e2.timeStamp-n2.t<Sn){if((d=(u=this.target).dismiss)!=null&&d.call(u)){this.lastTap=null;return}if(wo(e2.pointerType,this.penHovers)){const m=this.lastTap;this.options.navigable&&(this.options.clickToZoom||this.options.dblClickToZoom)&&m&&e2.timeStamp-m.t<Sn&&Math.hypot(o2.x-m.x,o2.y-m.y)<ta?(this.lastTap=null,this.zoomIn(o2)):this.lastTap={x:o2.x,y:o2.y,t:e2.timeStamp};return}this.options.clickToZoom&&this.options.navigable?e2.shiftKey?this.target.zoomBy(1/Jn,o2,true):this.zoomIn(o2):(f=(p=this.target).tap)==null||f.call(p,o2);return}if(!this.options.navigable)return;const i=this.samples[0],s=this.samples[this.samples.length-1],a=((s==null?void 0:s.t)??0)-((i==null?void 0:i.t)??0);if(i&&s&&a>0&&e2.timeStamp-s.t<50){const m=(s.x-i.x)/a*1e3,g=(s.y-i.y)/a*1e3;Math.hypot(m,g)>ah&&this.target.flick(m,g)}});L(this,"onDoubleClick",e2=>{this.options.navigable&&(this.options.clickToZoom||!this.options.dblClickToZoom||wo(this.lastPointerType,this.penHovers)||xo(e2.target,this.element)||(e2.shiftKey?this.target.zoomBy(1/Jn,this.local(e2),true):this.zoomIn(this.local(e2))))});L(this,"onWheel",e2=>{const n2=e2.ctrlKey;if(!this.options.navigable||!n2&&!this.options.scrollToZoom||!n2&&cd(e2.target,this.element,e2.deltaY))return;e2.preventDefault();const o2=dh(e2),r=n2?ch:lh;this.target.zoomBy(Math.exp(-o2*r),this.local(e2),!n2)});L(this,"onKeyDown",e2=>{if(e2.target!==this.element||!this.options.navigable||e2.altKey||e2.metaKey||e2.ctrlKey)return;const n2=this.element.getBoundingClientRect(),o2=n2.width*Fi*(e2.shiftKey?3:1),r=n2.height*Fi*(e2.shiftKey?3:1);switch(e2.key){case"ArrowLeft":this.target.panBy(o2,0,true);break;case"ArrowRight":this.target.panBy(-o2,0,true);break;case"ArrowUp":this.target.panBy(0,r,true);break;case"ArrowDown":this.target.panBy(0,-r,true);break;case"+":case"=":this.target.zoomBy($i,void 0,true);break;case"-":case"_":this.target.zoomBy(1/$i,void 0,true);break;case"0":this.target.home();break;case"r":this.target.rotateBy(90);break;case"R":this.target.rotateBy(-90);break;default:return}e2.preventDefault()});this.element=e,this.target=n,this.options=o,e.addEventListener("pointerdown",this.onPointerDown),e.addEventListener("pointermove",this.onPointerMove),e.addEventListener("pointerup",this.onPointerUp),e.addEventListener("pointercancel",this.onPointerUp),e.addEventListener("dblclick",this.onDoubleClick),e.addEventListener("wheel",this.onWheel,{passive:false}),e.addEventListener("keydown",this.onKeyDown)}setOptions(e){this.options=e}dispose(){const e=this.element;e.removeEventListener("pointerdown",this.onPointerDown),e.removeEventListener("pointermove",this.onPointerMove),e.removeEventListener("pointerup",this.onPointerUp),e.removeEventListener("pointercancel",this.onPointerUp),e.removeEventListener("dblclick",this.onDoubleClick),e.removeEventListener("wheel",this.onWheel),e.removeEventListener("keydown",this.onKeyDown)}local(e){const n=this.element.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}zoomIn(e){var n,o;(o=(n=this.target).atMaxZoom)!=null&&o.call(n)?this.target.home():this.target.zoomBy(Jn,e,true)}pinchState(){const[e,n]=[...this.pointers.values()];return{distance:Math.hypot(n.x-e.x,n.y-e.y),mid:{x:(e.x+n.x)/2,y:(e.y+n.y)/2}}}}function dh(t){return t.deltaMode===1?t.deltaY*16:t.deltaMode===2?t.deltaY*400:t.deltaY}class da extends Error{constructor(e,n,o){super(e),this.url=n,this.status=o,this.name="ImageLoadError"}}const zi=new Set;async function hh(t,e={}){const{signal:n,maxTextureSize:o,request:r}=e,i=Oc(r),s=ph(t);if(typeof createImageBitmap!="function"||typeof fetch!="function")return Qn(t,{signal:n,cors:true,withCredentials:i});if(s&&zi.has(s))return Qn(t,{signal:n,cors:false,withCredentials:i});let a;try{a=await Zo(r,t,{mode:"cors",signal:n})}catch(p){if(mh(p,n))throw p;const f=await Qn(t,{signal:n,cors:false,withCredentials:i});return s&&zi.add(s),f}if(!a.ok)throw new da(`Image request failed with ${a.status}`,t,a.status);const l=await a.blob();let c=await fh(l);const u=c.width,d=c.height;if(o&&(c.width>o||c.height>o)){const p=o/Math.max(c.width,c.height),f=await createImageBitmap(c,{resizeWidth:Math.max(1,Math.floor(c.width*p)),resizeHeight:Math.max(1,Math.floor(c.height*p)),resizeQuality:"high"});c.close(),c=f}if(n!=null&&n.aborted)throw c.close(),Co();return{kind:"bitmap",source:c,width:c.width,height:c.height,naturalWidth:u,naturalHeight:d,opaque:false}}async function fh(t){const e={imageOrientation:"from-image",premultiplyAlpha:"premultiply",colorSpaceConversion:"default"};try{return await createImageBitmap(t,e)}catch(n){if(n instanceof TypeError)return createImageBitmap(t);throw n}}function Qn(t,{signal:e,cors:n,withCredentials:o}){return new Promise((r,i)=>{if(e!=null&&e.aborted){i(Co());return}const s=new Image;s.decoding="async",n&&(s.crossOrigin=o?"use-credentials":"anonymous");const a=()=>{s.onload=null,s.onerror=null,e==null||e.removeEventListener("abort",l)},l=()=>{a(),s.src="",i(Co())};e==null||e.addEventListener("abort",l),s.onload=()=>{a();const c=()=>r({kind:"element",source:s,width:s.naturalWidth,height:s.naturalHeight,naturalWidth:s.naturalWidth,naturalHeight:s.naturalHeight,opaque:!n});typeof s.decode=="function"?s.decode().then(c,c):c()},s.onerror=()=>{a(),i(new da("Image failed to load",t))},s.src=t})}function ph(t){var e;try{return new URL(t,(e=globalThis.location)==null?void 0:e.href).origin}catch{return null}}function mh(t,e){return!!(e!=null&&e.aborted)||typeof t=="object"&&t!==null&&t.name==="AbortError"}function Co(){const t=new Error("Aborted");return t.name="AbortError",t}function Hi(t){t.kind==="bitmap"&&t.source.close()}const gh=192*1024*1024,vh=6,yh=2;class _h{constructor(e){L(this,"entries",new Map);L(this,"inFlight",0);L(this,"frame",0);L(this,"bytes",0);L(this,"wanted",[]);L(this,"disposed",false);L(this,"budget");L(this,"maxInFlight");this.options=e,this.budget=e.byteBudget??gh,this.maxInFlight=e.maxInFlight??vh}get(e){const n=this.entries.get(e);if((n==null?void 0:n.state)==="ready")return n.lastUsed=this.frame,n.image}has(e){var n;return((n=this.entries.get(e))==null?void 0:n.state)==="ready"}failed(e){var n;return((n=this.entries.get(e))==null?void 0:n.state)==="failed"}get byteSize(){return this.bytes}get pending(){return this.inFlight}seed(e,n){var r;const o=this.entries.get(e);(o==null?void 0:o.state)!=="ready"&&((r=o==null?void 0:o.controller)==null||r.abort(),this.entries.set(e,{url:e,state:"ready",image:n,bytes:to(n),lastUsed:this.frame,attempts:0,pinned:false,waiters:(o==null?void 0:o.waiters)??[]}),this.bytes+=to(n),this.flushWaiters(e))}prefetch(e){return Promise.all(e.map(n=>new Promise(o=>{const r=this.entries.get(n.url);if(r&&r.state!=="loading")return o();if(r){r.waiters.push(o);return}this.start({...n,priority:-1},o)}))).then(()=>{})}update(e){if(this.disposed)return;this.frame++;const n=new Set(e.map(o=>o.url));this.wanted=[...e].sort((o,r)=>o.priority-r.priority);for(const o of this.entries.values())o.state==="loading"&&!o.pinned&&!n.has(o.url)&&o.controller&&(o.controller.abort(),this.entries.delete(o.url),this.inFlight--);for(const o of this.wanted){const r=this.entries.get(o.url);r&&(r.lastUsed=this.frame)}this.pump(),this.evict(n)}dispose(){var e;this.disposed=true;for(const n of this.entries.values())(e=n.controller)==null||e.abort(),this.flushWaiters(n.url);this.entries.clear(),this.bytes=0}forEachReady(e){for(const n of this.entries.values())n.state==="ready"&&n.image&&e(n.url,n.image)}pump(){for(const e of this.wanted){if(this.inFlight>=this.maxInFlight)break;this.entries.has(e.url)||this.start(e)}}start(e,n){const o=new AbortController,r={url:e.url,state:"loading",bytes:0,lastUsed:this.frame,attempts:0,controller:o,pinned:!!n,waiters:n?[n]:[]};this.entries.set(e.url,r),this.inFlight++,this.attempt(r,e,o,e.url)}attempt(e,n,o,r){e.attempts++,this.options.load(r,o.signal).then(i=>{if(this.disposed||this.entries.get(e.url)!==e){Hi(i);return}e.state="ready",e.image=i,e.bytes=to(i),e.controller=void 0,e.pinned=false,this.bytes+=e.bytes,this.settle(e)},i=>{if(!(o.signal.aborted||this.disposed)&&this.entries.get(e.url)===e){if(e.attempts<yh&&!bh(i,n)){this.attempt(e,n,o,n.fallbackUrl??n.url);return}e.state="failed",e.controller=void 0,e.pinned=false,this.settle(e)}})}settle(e){this.inFlight--,this.flushWaiters(e.url),this.options.onSettled(),this.pump()}flushWaiters(e){const n=this.entries.get(e);if(!n)return;const o=n.waiters;n.waiters=[],o.forEach(r=>r())}evict(e){if(this.bytes<=this.budget)return;const n=[...this.entries.values()].filter(o=>o.state==="ready"&&!e.has(o.url)).sort((o,r)=>o.lastUsed-r.lastUsed);for(const o of n){if(this.bytes<=this.budget)break;this.entries.delete(o.url),this.bytes-=o.bytes,o.image&&Hi(o.image),this.options.onEvict(o.url)}}}function to(t){return t.width*t.height*4}function bh(t,e){if(e.fallbackUrl)return false;const n=t==null?void 0:t.status;return typeof n=="number"&&n>=400&&n<500&&n!==408&&n!==429}const wh=.1;class xh{constructor(e,n=r=>requestAnimationFrame(r),o=r=>cancelAnimationFrame(r)){L(this,"handle",0);L(this,"last",0);L(this,"disposed",false);L(this,"frame",e2=>{if(this.handle=0,this.disposed)return;const n2=this.last?Math.min((e2-this.last)/1e3,wh):1/60;this.last=e2,this.tick(n2,e2)?this.invalidate():this.last=0});this.tick=e,this.raf=n,this.caf=o}invalidate(){this.disposed||this.handle||(this.handle=this.raf(this.frame))}drawNow(){this.disposed||(this.handle&&this.caf(this.handle),this.frame(performance.now()))}dispose(){this.disposed=true,this.handle&&this.caf(this.handle),this.handle=0}}const Sh=2*1024*1024;function kh(t,e,n=Sh){const o=new Set;let r=n,i=false;return{get deferred(){return i},getTile(s){const a=t(s);if(!a||a.kind==="media"||a.opaque||o.has(s)||e(s))return a;const l=a.width*a.height*4;if(o.size>0&&l>r){i=true;return}return r-=l,o.add(s),a}}}function Eh(t,e,n){if(!t)return null;let o=t.trim().replace(/^xywh=/,""),r=false;o.startsWith("pct:")?(r=true,o=o.slice(4)):o.startsWith("pixel:")&&(o=o.slice(6));const i=o.split(",").map(Number);if(i.length!==4||i.some(m=>!Number.isFinite(m)))return null;let[s,a,l,c]=i;r&&(s=s/100*e,a=a/100*n,l=l/100*e,c=c/100*n);const u=Math.max(0,s),d=Math.max(0,a),p=Math.min(e,s+l),f=Math.min(n,a+c);return p<=u||f<=d?null:{x:u,y:d,width:p-u,height:f-d}}const eo=512,Ch=16e6;function ha(t,e,n){return{width:e,height:n,levels:[{scaleFactor:1,width:e,height:n,tileWidth:e,tileHeight:n,cols:1,rows:1}],tile:r=>({...r,url:t,region:{x:0,y:0,width:e,height:n}})}}function Mh(t){const{width:e,height:n}=t,o=[],r=t.regionByPx&&t.sizeByW,i=(p,f,m)=>{const g=Math.ceil(e/p),_=Math.ceil(n/p);return{scaleFactor:p,width:g,height:_,tileWidth:f,tileHeight:m,cols:Math.ceil(g/f),rows:Math.ceil(_/m)}},s=(p,f)=>({scaleFactor:e/p,width:p,height:f,tileWidth:p,tileHeight:f,cols:1,rows:1,whole:true}),a=t.tiles[0];if(a)for(const p of a.scaleFactors)o.push(i(p,a.width,a.height));else if(r)for(let p=1;;p*=2){const f=i(p,eo,eo);if(o.push(f),f.cols===1&&f.rows===1)break}const l=Math.max(0,...o.map(p=>p.scaleFactor));for(const p of t.sizes){const f=e/p.width;Th(t,p.width,p.height)&&f>l+1e-9&&o.push(s(p.width,p.height))}const c=o.reduce((p,f)=>!p||f.scaleFactor>p.scaleFactor?f:p,null);if(c&&c.cols*c.rows>1&&t.sizeByW){const p=Math.max(e,n)/eo;o.push(s(Math.ceil(e/p),Math.ceil(n/p)))}(!o.length||!a&&!r&&e*n<=Ch)&&(o.some(p=>p.scaleFactor===1)||o.push(s(e,n)));const u=Lh(o).sort((p,f)=>f.scaleFactor-p.scaleFactor),d=Zu(t);return{width:e,height:n,levels:u,tile(p){const f=u[p.level],m=f.scaleFactor,g=f.cols===1&&f.rows===1;let _,y,b;if(g)_={x:0,y:0,width:e,height:n},y=f.width,b=f.height;else{const x=Math.round(p.col*f.tileWidth*m),C=Math.round(p.row*f.tileHeight*m);_={x,y:C,width:Math.min(Math.round(f.tileWidth*m),e-x),height:Math.min(Math.round(f.tileHeight*m),n-C)},y=Math.ceil(_.width/m),b=Math.ceil(_.height/m)}return{...p,region:_,url:bn(t,_,y,b),fallbackUrl:d?bn(t,_,y,b,d):void 0}}}}function Th(t,e,n){return!(t.maxWidth&&e>t.maxWidth||t.maxHeight&&n>t.maxHeight||t.maxArea&&e*n>t.maxArea)}function Lh(t){const e=new Map;for(const n of t){const o=`${n.width}x${n.height}`,r=e.get(o);(!r||r.cols*r.rows<n.cols*n.rows)&&e.set(o,n)}return[...e.values()]}function Ih(t,e){const n=t.levels;for(let o=0;o<n.length;o++)if(n[o].scaleFactor<=e*(1+1e-6))return o;return n.length-1}function Xt(t,e,n){const o=t.levels[e],r=o.tileWidth*o.scaleFactor,i=o.tileHeight*o.scaleFactor,s=Math.max(0,n.x),a=Math.max(0,n.y),l=Math.min(t.width,n.x+n.width),c=Math.min(t.height,n.y+n.height);if(l<=s||c<=a)return[];const u=Math.max(0,Math.floor(s/r)),d=Math.min(o.cols-1,Math.floor((l-1e-9)/r)),p=Math.max(0,Math.floor(a/i)),f=Math.min(o.rows-1,Math.floor((c-1e-9)/i)),m=[];for(let g=p;g<=f;g++)for(let _=u;_<=d;_++)m.push({level:e,col:_,row:g});return m}async function Ph(t,e){if(t.media)return Ah(t,t.media);let n=null,o=null;if(t.service)try{n=Mh(await Zs(t.service,e.infoOptions))}catch(u){o=u}if(!n){if(!t.url)throw o??new Error("Image has no source");const u=await e.loadStatic(t.url);e.cache.seed(t.url,u),n=ha(t.url,u.naturalWidth,u.naturalHeight)}const r=t.width&&t.height&&t.width>0&&t.height>0?{width:t.width,height:t.height}:{width:n.width,height:n.height},i=Eh(t.region,r.width,r.height)??{x:0,y:0,width:r.width,height:r.height},s=n.width/r.width,a=n.height/r.height,l={x:i.x*s,y:i.y*a,width:i.width*s,height:i.height*a},c={id:t.id,spec:t,pyramid:n,size:r,clip:l,contentClip:i,rect:{x:0,y:0,width:i.width,height:i.height}};return await e.cache.prefetch(Xt(n,0,l).map(u=>{const d=n.tile(u);return{url:d.url,fallbackUrl:d.fallbackUrl}})),c}const fa="media:";function Ah(t,e){var a,l;const n=t.width||((a=t.placement)==null?void 0:a.width)||e.element.videoWidth||1600,o=t.height||((l=t.placement)==null?void 0:l.height)||e.element.videoHeight||900,r=`${fa}${t.id}`,i={width:n,height:o},s={x:0,y:0,width:n,height:o};return{id:t.id,spec:t,pyramid:ha(r,n,o),media:{kind:"media",source:e.element,width:n,height:o,naturalWidth:n,naturalHeight:o},size:i,clip:s,contentClip:s,rect:{...s}}}function Oh(t){if(!t.length)return null;if(t.every(o=>o.spec.placement)){for(const o of t)o.rect={...o.spec.placement};return nr(t.map(o=>o.rect))}const e=t[0].contentClip.height;let n=0;for(const o of t){const r=o.contentClip.width*e/o.contentClip.height;o.rect={x:n,y:0,width:r,height:e},n+=r}return{x:0,y:0,width:n,height:e}}function rr(t){return{x:t.rect.width/t.clip.width,y:t.rect.height/t.clip.height}}function Nh(t,e){var n,o;return t.service===e.service&&t.url===e.url&&t.width===e.width&&t.height===e.height&&t.region===e.region&&((n=t.media)==null?void 0:n.element)===((o=e.media)==null?void 0:o.element)&&JSON.stringify(t.placement)===JSON.stringify(e.placement)}const Rh=1e7,Bh=15e6,$h=2e7,Fh=2;function zh(t){const{items:e,camera:n,viewport:o,pixelRatio:r,getTile:i,destination:s}=t,a=ca(n,o),l=[],c=[],u=[],d=(p,f,m)=>{const g=p.tile(f);c.push({url:g.url,fallbackUrl:g.fallbackUrl,priority:m})};for(const p of e){const{pyramid:f,clip:m,rect:g}=p,_=rr(p);if(t.wantOverview)for(const E of Xt(f,0,m))d(f,E,$h);const y=Di(p,n,o,r),b=s?Di(p,s,o,r):y;if(u.push((y==null?void 0:y.target)??-1),!y&&!b)continue;const x=E=>I=>{const v=f.tile(I).region;return Math.hypot(v.x+v.width/2-E.x,v.y+v.height/2-E.y)};if(b){const E=x(b.center);for(const I of Xt(f,0,b.area))d(f,I,E(I)/1e3);if(b.target>0)for(const I of Xt(f,b.target,b.area))d(f,I,Rh+E(I))}if(!y)continue;const{area:C,target:A}=y,T=x(y.center),N=Xt(f,0,C),W=A===0?[]:Xt(f,A,C);if(b!==y){for(const I of N)d(f,I,T(I)/1e3);const E=A-Fh;if(E>0)for(const I of Xt(f,E,C))d(f,I,Bh+T(I))}if(p.spec.hidden)continue;const V=(A===0?N:W).every(E=>i(f.tile(E).url)!==void 0)?[A]:Array.from({length:A+1},(E,I)=>I),K=fe(a,Jt(g.x,g.y),he(_.x,_.y),Jt(-m.x,-m.y));for(const E of V){const I=E===0?N:E===A?W:Xt(f,E,C),v=f.levels[E].cols*f.levels[E].rows>1;for(const k of I){const S=f.tile(k),M=i(S.url);if(!M)continue;const w=Hh(p,S.region,M,K,v);w&&l.push({...w,url:S.url})}}}return c.sort((p,f)=>p.priority-f.priority),{draws:l,wants:Dh(c),levels:u}}function Di(t,e,n,o){const{pyramid:r,clip:i,rect:s}=t,a=So(e,n);if(!xd(a,s))return null;const l=rr(t),c=Math.max(a.x,s.x),u=Math.max(a.y,s.y),d=Math.min(a.x+a.width,s.x+s.width),p=Math.min(a.y+a.height,s.y+s.height),f=1/(l.x*e.zoom*o);return{area:{x:i.x+(c-s.x)/l.x,y:i.y+(u-s.y)/l.y,width:(d-c)/l.x,height:(p-u)/l.y},center:{x:i.x+(e.x-s.x)/l.x,y:i.y+(e.y-s.y)/l.y},target:Ih(r,f)}}function Hh(t,e,n,o,r){const{clip:i}=t,s=Math.max(e.x,i.x),a=Math.max(e.y,i.y),l=Math.min(e.x+e.width,i.x+i.width),c=Math.min(e.y+e.height,i.y+i.height);if(l<=s||c<=a)return null;const u=n.width/e.width,d=n.height/e.height,p=1e-6;return{item:t,image:n,transform:fe(o,Jt(e.x,e.y),he(1/u,1/d)),crop:{x:(s-e.x)*u,y:(a-e.y)*d,width:(l-s)*u,height:(c-a)*d},bleed:{right:r&&l<i.x+i.width-p,bottom:r&&c<i.y+i.height-p}}}function Dh(t){const e=new Set;return t.filter(n=>e.has(n.url)?false:(e.add(n.url),true))}const Wh={maxZoomPixelRatio:1.1,minZoomImageRatio:.9,animationTime:.09,request:void 0,byteBudget:192*1024*1024,maxInFlight:6,releaseAfterMs:2e3},Uh=2,jh=3,Vh=.1,qh=1e-6,pa={top:0,right:0,bottom:0,left:0};function Kh(t){if(typeof getComputedStyle!="function")return pa;const e=getComputedStyle(t),n=o=>parseFloat(o)||0;return{top:n(e.paddingTop),right:n(e.paddingRight),bottom:n(e.paddingBottom),left:n(e.paddingLeft)}}const Zh=(t,e)=>t.top===e.top&&t.right===e.right&&t.bottom===e.bottom&&t.left===e.left;let Xh;class Yh{constructor(e,n={}){L(this,"host");L(this,"overlays",null);L(this,"options");L(this,"backend",null);L(this,"backendPreference");L(this,"contextLosses",0);L(this,"holder",{hiddenSince:null,release:()=>this.giveBack()});L(this,"visible",true);L(this,"dom",null);L(this,"domAsked",false);L(this,"pending",null);L(this,"camera");L(this,"loop");L(this,"gestures");L(this,"gestureOptions",{});L(this,"cache");L(this,"navigator",null);L(this,"navigatorAsked",0);L(this,"viewport",{width:1,height:1});L(this,"inset",pa);L(this,"pixelRatio",1);L(this,"items",[]);L(this,"worldBounds",null);L(this,"contentVersion",0);L(this,"opaqueUrls",new Set);L(this,"mediaByKey",new Map);L(this,"detachMedia",[]);L(this,"opened",false);L(this,"atHome",true);L(this,"lastEmitted",null);L(this,"generation",0);L(this,"listeners",new Map);L(this,"resizeObserver",null);L(this,"intersectionObserver",null);L(this,"releaseTimer",null);L(this,"dprQuery",null);L(this,"disposed",false);L(this,"dismisser",null);L(this,"tick",e2=>{var a,l;if(this.disposed)return false;const n2=this.camera.step(e2,this.viewport),o=this.camera.current,r=this.backend,i=kh(this.getTile,c=>r?r.has(c):true),s=zh({items:this.items,camera:o,viewport:this.viewport,pixelRatio:this.pixelRatio,getTile:i.getTile,wantOverview:!!this.navigator,destination:n2?this.camera.destination:void 0});return this.cache.update(s.wants.filter(c=>!c.url.startsWith(fa))),this.paint(s.draws),(a=this.overlays)==null||a.position(o,this.viewport),(l=this.navigator)==null||l.render(this.items.filter(c=>!c.spec.hidden),this.worldBounds,So(o,this.viewport),this.pixelRatio,this.getTile,this.contentVersion),(!this.lastEmitted||!eh(this.lastEmitted,o))&&(this.lastEmitted={...o},this.opened&&this.emit("viewport")),n2||i.deferred});L(this,"getTile",e2=>this.mediaByKey.get(e2)??this.cache.get(e2));L(this,"onContextLost",()=>{this.contextLosses+=1,this.releaseBackend(),this.visible?this.acquireBackend(false):this.host.dataset.backend="released"});L(this,"onPixelRatioChange",()=>{this.measure(),this.watchPixelRatio()});this.host=e,this.backendPreference=n.backend??"auto",this.options={...Wh,...no(n)},Jh()&&(this.options.animationTime=0),this.camera=new ih({x:0,y:0,zoom:1,rotation:0},this.options.animationTime),this.loop=new xh(this.tick),this.gestureOptions=no(n.gestures??{}),this.gestures=new uh(e,this,{...Eo,...this.gestureOptions}),this.cache=new _h({load:(o,r)=>this.loadTile(o,r),onSettled:()=>{this.contentVersion++,this.invalidate()},onEvict:o=>{var r;return(r=this.backend)==null?void 0:r.release(o)},byteBudget:this.options.byteBudget,maxInFlight:this.options.maxInFlight}),this.visible=Gh(e),this.visible?this.acquireBackend():this.holder.hiddenSince=Wi(),this.measure(),this.observe()}get backendKind(){var e;return((e=this.backend)==null?void 0:e.kind)??"none"}get isOpen(){return this.opened}get isAtHome(){return this.atHome}on(e,n){let o=this.listeners.get(e);return o||(o=new Set,this.listeners.set(e,o)),o.add(n),()=>o==null?void 0:o.delete(n)}async setImages(e,{world:n,fit:o=false}={}){const r=++this.generation,i=new Map(this.items.map(u=>[u.id,u])),s=await Promise.allSettled(e.map(u=>{const d=i.get(u.id);return d&&Nh(d.spec,u)?(d.spec=u,Promise.resolve(d)):Ph(u,{cache:this.cache,loadStatic:p=>this.loadTile(p),infoOptions:{request:this.options.request}})}));if(r!==this.generation||this.disposed)return;const a=s.filter(u=>u.status==="fulfilled").map(u=>u.value),l=s.filter(u=>u.status==="rejected").map(u=>u.reason);this.items=a,this.watchMedia(a);const c=Oh(a);if(this.worldBounds=n?c?nr([n,c]):n:c,this.contentVersion++,l.length&&this.emit("error",l),!this.worldBounds){this.invalidate();return}this.opened?o?(this.home(true),this.emit("change")):(this.camera.set(this.constrain(this.camera.current)),this.emit("change")):(this.opened=true,this.home(true),this.emit("open")),this.invalidate()}clear(){this.generation++,this.items=[],this.watchMedia([]),this.worldBounds=null,this.contentVersion++,this.invalidate()}setHidden(e){const n=new Set(e);let o=false;for(const r of this.items){const i=n.has(r.id);!!r.spec.hidden!==i&&(r.spec={...r.spec,hidden:i},o=true)}o&&this.invalidate()}isReady(e){const n=this.items.find(r=>r.id===e);if(!n)return false;if(n.spec.media)return true;const o=n.pyramid.levels[0];if(!o)return false;for(let r=0;r<o.rows;r++)for(let i=0;i<o.cols;i++)if(!this.getTile(n.pyramid.tile({level:0,col:i,row:r}).url))return false;return true}fitBounds(e,n=false){const o=Ri(e,this.viewport,this.camera.destination.rotation,0);this.atHome=false,this.animateTo(this.constrain(o,{allowBeyondLimits:true}),n)}fitItemRect(e,n,o=false){const r=this.itemRectToWorld(e,n);r&&this.fitAnnotation(r,o)}fitAnnotation(e,n=false){const o=this.items[0];if(!o)return;const r=o.rect.width*Vh;this.fitBounds({x:e.x-r,y:e.y-r,width:e.width+r*2,height:e.height+r*2},n)}getBounds(){return So(this.camera.current,this.viewport)}getHomeBounds(){return this.worldBounds?{...this.worldBounds}:null}getCamera(){return{...this.camera.current}}getZoomLimits(){var o;const e=((o=this.homeCamera())==null?void 0:o.zoom)??1,n=this.items.length?Math.min(...this.items.map(r=>rr(r).x)):1;return{home:e,min:e*this.options.minZoomImageRatio,max:Math.max(e,this.options.maxZoomPixelRatio/n)}}home(e=false){const n=this.homeCamera();n&&(this.atHome=true,this.animateTo(n,e))}atMaxZoom(){return this.camera.destination.zoom>=this.getZoomLimits().max*(1-qh)}zoomBy(e,n,o=true){const r=o?this.camera.destination:this.camera.current,i=n??{x:this.viewport.width/2,y:this.viewport.height/2},s=Ni(r,this.viewport,i),{min:a,max:l}=this.getZoomLimits(),c=Re(r.zoom*e,a,l),u=ko(s,i,c,r.rotation,this.viewport),d=this.constrain({...r,...u,zoom:c});this.atHome=false,o?this.camera.animateTo({state:d,anchor:{world:s,screen:i}},this.viewport):this.camera.set(d),this.invalidate()}panBy(e,n,o=false){const r=o?this.camera.destination:this.camera.current,i=Yt(fe(he(1/r.zoom),Ye(-r.rotation)),{x:e,y:n}),s=this.constrain({...r,x:r.x-i.x,y:r.y-i.y});this.atHome=false,o?this.camera.animateTo({state:s},this.viewport):this.camera.set(s),this.invalidate()}panTo(e,n=false){const o=n?this.camera.current:this.camera.destination;this.atHome=false,this.animateTo(this.constrain({...o,...e}),n)}flick(e,n){this.panBy(e*.25,n*.25,true)}rotateBy(e){const n=this.camera.destination;this.setRotation(n.rotation*180/Math.PI+e)}setRotation(e,n=false){const o=this.camera.destination,r=e*Math.PI/180;this.animateTo(this.constrain({...o,rotation:r}),n)}getRotation(){return this.camera.destination.rotation*180/Math.PI}tap(e){this.emit("tap",e)}setDismiss(e){this.dismisser=e}dismiss(){var e;return((e=this.dismisser)==null?void 0:e.call(this))??false}setGestures(e){this.gestures.setOptions({...Eo,...this.gestureOptions,...no(e)})}setInteracting(e){e&&this.camera.stop()}worldToScreenPoint(e){return th(this.camera.current,this.viewport,e)}screenToWorldPoint(e){return Ni(this.camera.current,this.viewport,e)}itemRectToWorld(e,n){const o=this.items[e];if(!o)return null;const{contentClip:r}=o,i=o.rect.width/r.width,s=o.rect.height/r.height;return{x:o.rect.x+(n.x-r.x)*i,y:o.rect.y+(n.y-r.y)*s,width:n.width*i,height:n.height*s}}attachNavigator(e){var i;(i=this.navigator)==null||i.dispose(),this.navigator=null;const n=++this.navigatorAsked;let o=null,r=false;return import("./Navigator-Duc69Yes.mjs").then(s=>{r||this.disposed||n!==this.navigatorAsked||(o=new s.Navigator(e,(a,l)=>this.panTo(a,l)),this.navigator=o,this.invalidate())}),()=>{r=true,o==null||o.dispose(),o&&this.navigator===o&&(this.navigator=null)}}invalidate(){this.loop.invalidate()}dispose(){var e,n,o,r,i,s,a;this.disposed||(this.disposed=true,this.generation++,this.loop.dispose(),this.gestures.dispose(),(e=this.resizeObserver)==null||e.disconnect(),(n=this.intersectionObserver)==null||n.disconnect(),(r=(o=this.dprQuery)==null?void 0:o.removeEventListener)==null||r.call(o,"change",this.onPixelRatioChange),this.releaseTimer&&clearTimeout(this.releaseTimer),(i=this.navigator)==null||i.dispose(),this.navigator=null,this.releaseBackend(),this.cache.dispose(),(s=this.dom)==null||s.dispose(),(a=this.overlays)==null||a.dispose(),this.items=[],this.detachMedia.forEach(l=>l()),this.mediaByKey.clear(),this.listeners.clear(),delete this.host.dataset.backend)}watchMedia(e){this.detachMedia.forEach(n=>n()),this.detachMedia=[],this.mediaByKey.clear();for(const n of e){if(!n.media||n.media.kind!=="media")continue;const o=n.pyramid.tile({level:0,col:0,row:0}).url;this.mediaByKey.set(o,n.media);const r=n.media.source,i=()=>this.invalidate(),s=["play","seeked","loadeddata","resize"];s.forEach(a=>r.addEventListener(a,i)),this.detachMedia.push(()=>s.forEach(a=>r.removeEventListener(a,i)))}}paint(e){const n=this.backend,o=[],r=(n==null?void 0:n.kind)==="webgl2";n==null||n.begin();for(const i of e){const{image:s}=i;if(!(s.kind==="media"||s.kind==="element"&&r&&(s.opaque||this.opaqueUrls.has(i.url)))&&n){if(n.draw({key:i.url,source:s.source,width:s.width,height:s.height,transform:i.transform,crop:i.crop,opacity:1,bleed:i.bleed})!=="tainted"||s.kind==="bitmap")continue;this.opaqueUrls.add(i.url)}(s.kind==="element"||s.kind==="media")&&o.push({key:`${i.item.id}|${i.url}`,element:s.source,width:s.width,height:s.height,transform:i.transform,crop:i.crop,opacity:1})}n==null||n.end(),this.dom?this.dom.sync(o):o.length&&!this.domAsked&&(this.domAsked=true,import("./DomLayers-Dybz_aJv.mjs").then(({DomLayers:i})=>{if(this.disposed)return;const s=new i(this.host);this.overlays&&this.host.insertBefore(s.container,this.overlays.container),this.dom=s,this.invalidate()}))}loadTile(e,n){return hh(e,{signal:n,request:this.options.request,maxTextureSize:this.backend instanceof kn?this.backend.maxTextureSize:void 0})}animateTo(e,n){this.camera.animateTo({state:e},this.viewport,n),this.invalidate()}homeCamera(){if(!this.worldBounds)return null;const e=2*Math.PI,n=Math.round(this.camera.destination.rotation/e)*e||0,{top:o,right:r,bottom:i,left:s}=this.inset,a=Ri(this.worldBounds,{width:Math.max(1,this.viewport.width-s-r),height:Math.max(1,this.viewport.height-o-i)},n);return a.x-=(s-r)/2/a.zoom,a.y-=(o-i)/2/a.zoom,a}constrain(e,{allowBeyondLimits:n=false}={}){const o=this.worldBounds;if(!o)return e;const{min:r,max:i}=this.getZoomLimits(),s=n?Re(e.zoom,r,Math.max(i,e.zoom)):Re(e.zoom,r,i);return{...e,zoom:s,x:Re(e.x,o.x,o.x+o.width),y:Re(e.y,o.y,o.y+o.height)}}acquireBackend(e=true){var i,s;if(this.backend||this.pending||this.disposed)return;const n=document.createElement("canvas");n.className="clover-canvas-surface",n.setAttribute("aria-hidden","true"),Object.assign(n.style,{position:"absolute",inset:"0",width:"100%",height:"100%",display:"block",pointerEvents:"none"}),this.host.insertBefore(n,((i=this.dom)==null?void 0:i.container)??((s=this.overlays)==null?void 0:s.container)??null);const o=e&&(this.backendPreference==="webgl2"||this.backendPreference==="auto"&&this.contextLosses<jh);let r=null;o&&(Kd(this.holder)||this.backendPreference==="webgl2")&&(r=kn.create(n,{onLost:this.onContextLost}),r||Ai(this.holder)),r?this.install(r):this.backendPreference==="webgl2"?this.none(n):(this.pending=n,(Xh??(Xh=import("./Canvas2DBackend-CkvI0wUT.mjs"))).then(({Canvas2DBackend:a})=>{if(this.pending!==n)return;this.pending=null;const l=a.create(n);l?this.install(l):this.none(n)}))}none(e){e.remove(),this.host.dataset.backend="none"}install(e){this.backend=e,this.host.dataset.backend=e.kind,e.resize(this.viewport.width,this.viewport.height,this.pixelRatio),e.kind==="canvas2d"&&this.opaqueUrls.clear(),this.emit("backend",e.kind),this.invalidate()}releaseBackend(){var n;if(Ai(this.holder),(n=this.pending)==null||n.remove(),this.pending=null,!this.backend)return;const e=this.backend.canvas;this.backend.dispose(),e.remove(),this.backend=null}giveBack(){this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.releaseBackend(),this.host.dataset.backend="released"}observe(){typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(()=>this.measure(true)),this.resizeObserver.observe(this.host)),typeof IntersectionObserver<"u"&&(this.intersectionObserver=new IntersectionObserver(e=>{const n=e.some(o=>o.isIntersecting);this.setVisible(n)}),this.intersectionObserver.observe(this.host)),this.watchPixelRatio()}setVisible(e){var n;if(this.visible=e,e){this.holder.hiddenSince=null,this.releaseTimer&&clearTimeout(this.releaseTimer),this.releaseTimer=null,this.backend||this.acquireBackend();return}(n=this.holder).hiddenSince??(n.hiddenSince=Wi()),!(!this.backend||this.releaseTimer)&&(this.releaseTimer=setTimeout(()=>this.giveBack(),this.options.releaseAfterMs))}measure(e=false){var l;const n=this.host.getBoundingClientRect(),o=Math.max(1,n.width),r=Math.max(1,n.height),i=Kh(this.host),s=Math.min(typeof window<"u"&&window.devicePixelRatio||1,Uh);if(o===this.viewport.width&&r===this.viewport.height&&s===this.pixelRatio&&Zh(i,this.inset))return;const a=this.viewport;if(this.viewport={width:o,height:r},this.inset=i,this.pixelRatio=s,(l=this.backend)==null||l.resize(o,r,s),this.opened)if(this.atHome)this.home(true);else{const c=this.camera.current,u=o/Math.max(a.width,1);this.camera.set(this.constrain({...c,zoom:c.zoom*u}))}e?this.loop.drawNow():this.invalidate()}watchPixelRatio(){var e,n,o,r;typeof window>"u"||typeof window.matchMedia!="function"||((n=(e=this.dprQuery)==null?void 0:e.removeEventListener)==null||n.call(e,"change",this.onPixelRatioChange),this.dprQuery=window.matchMedia(`(resolution: ${window.devicePixelRatio||1}dppx)`),(r=(o=this.dprQuery).addEventListener)==null||r.call(o,"change",this.onPixelRatioChange))}emit(e,n){var o;(o=this.listeners.get(e))==null||o.forEach(r=>r(n))}}const Wi=()=>typeof performance<"u"?performance.now():Date.now();function Gh(t){if(typeof IntersectionObserver>"u"||typeof window>"u")return true;const{top:e,left:n,width:o,height:r}=t.getBoundingClientRect();return e+r>=0&&n+o>=0&&e<=window.innerHeight&&n<=window.innerWidth}function Jh(){return typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches}function no(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0))}const Qh=(t,e)=>new Yh(t,e),tf=bt(()=>import("./Connected-BSUBc3Ci.mjs")),ef=bt(()=>import("./Connected-CPIxNjF2.mjs").then(t=>t.C));function nf({className:t,style:e,renderers:n,children:o,...r}){var p;const i=te("Body"),s=or(),a=pt(()=>Gc(s),[s]),l=Jc(n??i.renderers,{canvases:s,bodies:a}),c=l==null?void 0:l.component,u=((p=s.find(({type:f})=>f==="Scene"||f==="Timeline"))==null?void 0:p.type)??"Canvas",d=nt(f=>f.status==="loading");return h("div",{"aria-busy":d,className:ct("clover-body",t),"data-renderer":c?"custom":u.toLowerCase(),style:{position:"relative",height:"var(--clover-body-height, 60vh)",...e},children:[c?h(c,{canvases:s,bodies:a,children:o}):u==="Scene"?h(Mt,{fallback:h(He,{overlay:true}),children:h(ef,{...r,children:o})}):u==="Timeline"?h(Mt,{fallback:h(He,{overlay:true}),children:h(tf,{...r,children:o})}):h(Vd,{...r,surface:Qh,children:o}),d&&h(He,{overlay:true})]})}const of={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function Ge(t){return t.replace(/<br\s*\/?>/gi,`
|
|
23
|
+
`).replace(/<[^>]*>/g,"").replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(e,n)=>{if(n[0]==="#"){const o=n[1]==="x"||n[1]==="X"?parseInt(n.slice(2),16):parseInt(n.slice(1),10);return o>0&&o<=1114111?String.fromCodePoint(o):e}return of[n.toLowerCase()]??e})}const rf=t=>/<[a-z!/]|&(#x?[0-9a-f]+|[a-z]+);/i.test(t);function sf(t,e=""){const n=t==null?void 0:t.split(";")[0].trim().toLowerCase();if(n)return n==="text/html"?"html":n==="text/markdown"?"markdown":"plain";const o=e.trim();return o.startsWith("<")&&o.endsWith(">")?"html":"plain"}function af(t){return t.replace(/\r\n?/g,`
|
|
24
|
+
`).replace(/^\[\^[^\]]+\]:[ \t]*/gm,"").replace(/\[\^[^\]]+\]/g,"").replace(/^#{1,6}[ \t]+(\S.*?)(?:[ \t]+#+)?[ \t]*$/gm,"$1").replace(/^[ \t]*(?:[-*+]|\d+[.)])[ \t]+/gm,"").replace(/\[([^\]]+)\]\((?:https?:\/\/|mailto:)[^\s)]+\)/g,"$1").replace(/\*\*([^*]+)\*\*|__([^_]+)__/g,(e,n,o)=>n??o).replace(/\*([^*\s][^*]*)\*|_([^_\s][^_]*)_/g,(e,n,o)=>n??o).replace(/\\\n/g,`
|
|
25
|
+
`).replace(/\n\s*\n/g,`
|
|
26
|
+
`).trim()}const In=(t,e)=>e==="canvas"?ue(t.manifest,t.canvasId):t.manifest,ma=Kt(null),ir=()=>Et(ma),Pn=Ct(function({of:e="manifest",label:n,as:o="span",className:r,...i},s){var p;const a=qe(f=>{var m,g;return e==="canvas"?(m=ue(f.manifest,f.canvasId))==null?void 0:m.label:(g=f.manifest)==null?void 0:g.label},void 0),l=ir(),c=(p=Qt())==null?void 0:p.language,{text:u,lang:d}=at(n??(l?l.label:a),c);return u?h(o,{ref:s,className:ct("clover-label",r),lang:d,...i,children:Ge(u)}):null});function lf(t,e,n){const o=(u,d)=>Math.min(Math.max(Math.round(u),0),d),r=n?o(n.x*t.width,t.width-1):0,i=n?o(n.y*t.height,t.height-1):0,s={x:r,y:i,width:n?Math.max(1,o(n.width*t.width,t.width-r)):t.width,height:n?Math.max(1,o(n.height*t.height,t.height-i)):t.height},a=s.width===t.width&&s.height===t.height;if(!a&&!t.regionByPx)return null;if(t.sizeByW){let u=Math.min(1,e/Math.max(s.width,s.height));return t.maxWidth&&(u=Math.min(u,t.maxWidth/s.width)),t.maxHeight&&(u=Math.min(u,t.maxHeight/s.height)),t.maxArea&&(u=Math.min(u,Math.sqrt(t.maxArea/(s.width*s.height)))),bn(t,s,Math.max(1,Math.floor(s.width*u)),Math.max(1,Math.floor(s.height*u)))}if(!a)return null;const l=[...t.sizes].sort((u,d)=>u.width-d.width),c=l.find(u=>Math.max(u.width,u.height)>=e)??l.at(-1)??{width:t.width,height:t.height};return bn(t,s,c.width,c.height)}function xe(t){var e;return(e=Yo(t).find(({body:n})=>n.type==="Image"||n.id&&!n.type))==null?void 0:e.body}function cf(t,{width:e,height:n}){if(t==="full")return{x:0,y:0,width:1,height:1};const o=/^(pct:)?([\d.]+),([\d.]+),([\d.]+),([\d.]+)$/.exec(t);if(!o)return null;const[r,i,s,a]=o.slice(2).map(Number),[l,c]=o[1]?[100,100]:[e,n];return{x:r/l,y:i/c,width:s/l,height:a/c}}function Ut(t,e="full"){if(!t)return null;const n=Ln(t.service);return n?e==="full"?{service:n,fallback:t.id}:{service:n,region:e,fallback:t.id}:t.id?{src:t.id}:null}function sr(t){const e=t;return e?Ut(U(e.thumbnail)[0])??Ut(xe(e))??Ut(xe(e.placeholderContainer))??Ut(xe(e.accompanyingContainer)):null}function uf(t){const e=t;return e?Ut(xe(e))??Ut(xe(e.placeholderContainer))??Ut(xe(e.accompanyingContainer))??Ut(U(e.thumbnail)[0]):null}async function ar(t,e=200,n){if(t.src)return t.src;if(!t.service)return t.fallback;try{const o=await Zs(t.service,{request:n}),r=typeof t.region=="string"?cf(t.region,o):t.region;return r===null?t.fallback:lf(o,e,r)??t.fallback}catch{return t.fallback}}const df=Object.freeze(Object.defineProperty({__proto__:null,imageSource:Ut,resolveThumbnail:ar,stillSource:uf,thumbnailSource:sr},Symbol.toStringTag,{value:"Module"})),Ui='.clover-items-item[role="option"], .clover-items-link',_e=new Map;let _t=null,Ot=null,Mo=0;function lr(t){const e=_e.get(t);if(!e)return;const n=t.clientHeight>0&&t.scrollHeight>t.clientHeight+1;n!==e.cut&&(e.cut=n,e.change(n))}function To(){cancelAnimationFrame(Mo),Mo=requestAnimationFrame(()=>_e.forEach((t,e)=>lr(e)))}function ga(t){var r,i;if(t.key!=="Escape")return;const e=new Set,n=(i=(r=document.activeElement)==null?void 0:r.closest)==null?void 0:i.call(r,Ui);n&&e.add(n);try{document.querySelectorAll(`:is(${Ui}):hover`).forEach(s=>e.add(s))}catch{}const o=[...e].filter(s=>s.dataset.fullHidden===void 0&&s.querySelector(".clover-items-label-full"));o.length&&(t.preventDefault(),t.stopPropagation(),o.forEach(s=>js(s,"fullHidden",["pointerenter",s===n?"blur":"focus"])))}function hf(){var t,e;_t=typeof ResizeObserver>"u"?null:new ResizeObserver(n=>n.forEach(o=>lr(o.target))),Ot=typeof MutationObserver>"u"?null:new MutationObserver(To),Ot==null||Ot.observe(document.head,{childList:true,subtree:true,characterData:true}),Ot==null||Ot.observe(document.documentElement,{attributes:true,attributeFilter:["style","class"]}),(e=(t=document.fonts)==null?void 0:t.addEventListener)==null||e.call(t,"loadingdone",To),document.addEventListener("keydown",ga,true)}function ff(){var t,e,n;cancelAnimationFrame(Mo),(t=_t==null?void 0:_t.disconnect)==null||t.call(_t),Ot==null||Ot.disconnect(),_t=Ot=null,(n=(e=document.fonts)==null?void 0:e.removeEventListener)==null||n.call(e,"loadingdone",To),document.removeEventListener("keydown",ga,true)}function pf(t,e){var n;return _e.size||hf(),_e.set(t,{change:e}),(n=_t==null?void 0:_t.observe)==null||n.call(_t,t),lr(t),()=>{var o;_e.delete(t),(o=_t==null?void 0:_t.unobserve)==null||o.call(_t,t),_e.size||ff()}}function mf(t){const e=Math.max(0,Math.round(t)),n=Math.floor(e/3600),o=Math.floor(e%3600/60),r=String(e%60).padStart(2,"0");return n?`${n}:${String(o).padStart(2,"0")}:${r}`:`${o}:${r}`}function gf(t,e,n,o){const r=sr(t.resource),[i,s]=D(r==null?void 0:r.src),a=(r==null?void 0:r.src)??(r==null?void 0:r.service)??(r==null?void 0:r.fallback);return H(()=>{if(!r)return s(void 0);if(r.src)return s(r.src);if(!o)return;let l=true;return ar(r,e,n).then(c=>{l&&s(c)}),()=>{l=false}},[a,e,o]),{src:i,none:!r}}const vf=()=>h("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 512 512",children:[h("path",{d:"M232 416a24 24 0 01-14.9-5.2L125.8 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.8l91.3-74.8A24 24 0 01256 120v272a24 24 0 01-24 24z"}),h("path",{d:"M336 176a112 112 0 010 160M384 128a176 176 0 010 256",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"32"})]});function yf({part:t,size:e,request:n,alt:o,altLang:r}){const[i,s]=D(null),a=oa(i,na,i==null?void 0:i.closest('[data-layout="slider"] .clover-items-viewport')),{src:l,none:c}=gf(t,e,n,a),[u,d]=D(false),{width:p,height:f}=t.resource??{},m=p&&f?p/f:1;return h("span",{ref:s,className:"clover-items-picture","data-loaded":u,"data-empty":l?void 0:true,style:l&&!(p&&f)?void 0:{"--clover-items-ratio":m},children:[!l&&c&&Uo(t.media)&&h(vf,{}),l&&h("img",{src:l,alt:o,lang:o?r:void 0,width:e,height:Math.round(e/m),loading:"lazy",decoding:"async",draggable:false,onLoad:()=>d(true),onError:()=>d(true)}),t.duration?h("span",{className:"clover-items-duration",children:mf(t.duration)}):null]})}function _f({text:t,lang:e,first:n}){const o=$(null),[r,i]=D(false);return H(()=>{const s=o.current;if(!(!s||!t))return pf(s,i)},[t]),h("span",{className:"clover-items-label","data-clamped":r||void 0,children:[!n&&" ",h("span",{ref:o,className:"clover-items-label-text",lang:t?e:void 0,children:t}),r&&h("span",{className:"clover-items-label-full",lang:e,"aria-hidden":"true",hidden:true,children:t})]})}function bf({item:t,size:e,language:n,request:o,showSummary:r=false}){var l,c;const i=t.parts.map(u=>at(t.parts.length===1?t.label:u.label,n)),s=r?at(t.summary,n):null,a=i.some(u=>u.text);return h("figure",{role:"none",className:"clover-items-figure","data-parts":t.parts.length,"data-media":(c=(l=t.parts[0])==null?void 0:l.media)==null?void 0:c.toLowerCase(),style:{"--parts":t.parts.length},children:[h("span",{className:"clover-items-pictures",children:t.parts.map((u,d)=>{const p=i[d].text?{text:""}:at(u.label,n);return h(yf,{part:u,size:e,request:o,alt:p.text,altLang:p.lang},u.id)})}),(a||(s==null?void 0:s.text))&&h("figcaption",{className:"clover-items-caption",children:[i.map((u,d)=>h(_f,{text:u.text,lang:u.lang,first:d===0},t.parts[d].id)),(s==null?void 0:s.text)&&h("span",{className:"clover-items-summary",lang:s.lang,children:s.text.replace(/<[^>]*>/g,"")})]})]})}function wf(t){var e;return(e=Yo(t).find(({body:n})=>n.type))==null?void 0:e.body.type}function va(t){const e=wf(t)??(t.type==="Timeline"?"Sound":void 0);return{id:t.id,type:t.type,label:t.label,resource:t,duration:Number(t.duration)||void 0,media:e}}const ji=new WeakMap;function ya(t){if(!t)return[];let e=ji.get(t);if(!e){const{canvases:n,views:o}=xt(t);e=o.map(r=>{const i=r.map(s=>va(n[s]));return{id:i[0].id,parts:i,label:i.length===1?i[0].label:{none:[i.map(s=>at(s.label).text).filter(Boolean).join(" \u2013 ")]}}}),ji.set(t,e)}return e}const Vi=new WeakMap;function En(t){if(!t)return[];let e=Vi.get(t);return e||(e=U(t.items).filter(n=>n==null?void 0:n.id).map(n=>{var o;return{id:n.id,parts:[va(n)],label:n.label,summary:n.summary,href:((o=U(n.homepage)[0])==null?void 0:o.id)??n.id}}),Vi.set(t,e)),e}function mm(t){return t?Array.isArray(t)?En({items:t}):t.type==="Collection"?En(t):ya(t):[]}function cr(t,e){const{clover:n}=te(e),o=jd(),{direction:r}=la(),i=nt(a=>a.collection),s=nt(a=>{var l;return((l=a.manifest)==null?void 0:l.id)??null});if(t==="members"){const a=En(i),l=a.findIndex(c=>c.id===s);return{position:l,total:a.length,direction:"left-to-right",step:c=>{const u=a[l+c];u&&n.goToManifest(u.id)}}}return{position:o.position,total:o.total,direction:r,step:a=>a<0?o.previous():o.next()}}const xf={"left-to-right":0,"right-to-left":180,"top-to-bottom":90,"bottom-to-top":270};function Sf({rotate:t}){return h("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",className:"clover-pager-icon",children:h("path",{d:"M6 3l5 5-5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",transform:`rotate(${t} 8 8)`})})}const Cn=Ct(function({steps:e,step:n,className:o,disabled:r,onClick:i,...s},a){const{t:l,langOf:c}=dt(),{position:u,total:d,direction:p}=e;if(d<2)return null;const f=n==="next",m=f?u+1<d:u>0,g=xf[p]+(f?0:180),_=f?"commonNext":"commonPrevious",y=l(_);return h("button",{ref:a,type:"button",className:ct(`clover-pager-${n}`,o),"data-direction":p,lang:c(_),disabled:r,"aria-disabled":!m||void 0,tabIndex:m?void 0:-1,onClick:b=>{m&&(i==null||i(b),b.defaultPrevented||e.step(f?1:-1,b))},...s,children:[h(Sf,{rotate:g}),h("span",{style:le,children:y}),h(de,{label:y})]})});Ct(function({of:e="views",...n},o){const r=cr(e,"Previous");return h(Cn,{ref:o,...n,steps:r,step:"previous"})});Ct(function({of:e="views",...n},o){const r=cr(e,"Next");return h(Cn,{ref:o,...n,steps:r,step:"next"})});const Lo=Ct(function({steps:e,as:n="span",className:o,...r},i){const{t:s,langOf:a}=dt(),{position:l,total:c}=e;if(c<2||l<0)return null;const u=l+1;return h(n,{ref:i,className:ct("clover-pager-position",o),...r,children:[h("span",{"aria-hidden":"true",children:[u," / ",c]}),h("span",{className:"clover-pager-room","aria-hidden":"true",hidden:true,children:[c," / ",c]}),h("span",{style:le,lang:a("canvasPosition"),children:s("canvasPosition",{index:u,total:c})})]})}),kf=Ct(function({of:e="views",...n},o){const r=cr(e,"Position");return h(Lo,{ref:o,...n,steps:r})});function Ef({steps:t,as:e="nav",className:n,forwardedRef:o,hostLanguage:r,...i}){const{t:s,langOf:a}=dt(void 0,r),l=Xe(s("itemsLabel"),a("itemsLabel"),i["aria-label"]!==void 0||i["aria-labelledby"]!==void 0,r);if(t.total<2)return null;const c=t.direction==="right-to-left";return h(e,{ref:o,...l.props,className:ct("clover-items clover-pager",n),"data-layout":"pager","data-direction":t.direction,...i,children:[l.node,!c&&h(Lo,{steps:t}),h(Cn,{steps:t,step:c?"next":"previous"}),h(Cn,{steps:t,step:c?"previous":"next"}),c&&h(Lo,{steps:t})]})}function _a(t){const e=Math.max(1,Math.round(t));return e<=6?`h${e}`:null}const An=(t,e="p")=>_a(t)??e;function ba(t,e,n="p"){const o=_a(t);return o?{as:o,title:{},group:{}}:{as:n,title:{id:e},group:{role:"group","aria-labelledby":e}}}function Cf(t,e,{orientation:n="both",rtl:o=false,onActivate:r,onMove:i}={}){const[s,a]=D(Math.max(0,e)),l=$([]),c=$(r);c.current=r;const u=$(i);u.current=i,H(()=>{e>=0&&a(e)},[e]);const d=Math.min(s,Math.max(0,t-1)),p=ot(g=>{var _;a(g),(_=l.current[g])==null||_.focus()},[]),f=ot((g,_)=>{var T,N;const y=o?"ArrowLeft":"ArrowRight",b=o?"ArrowRight":"ArrowLeft",x=n!=="vertical",C=n!=="horizontal";let A=null;if(x&&g.key===y||C&&g.key==="ArrowDown")A=Math.min(t-1,_+1);else if(x&&g.key===b||C&&g.key==="ArrowUp")A=Math.max(0,_-1);else if(g.key==="Home")A=0;else if(g.key==="End")A=t-1;else if(g.key==="Enter"||g.key===" "){(T=c.current)==null||T.call(c,_,g),g.preventDefault();return}A!==null&&(g.preventDefault(),p(A),A!==_&&((N=u.current)==null||N.call(u,A,g)))},[t,n,o,p]);return{focused:d,itemProps:g=>({ref:_=>{l.current[g]=_},tabIndex:g===d?0:-1,onKeyDown:_=>f(_,g),onFocus:()=>a(g)})}}const Mf=5,Tf=()=>{var t;return typeof window<"u"&&!!((t=window.matchMedia)!=null&&t.call(window,"(prefers-reduced-motion: reduce)").matches)};function wa({align:t="start",dragFree:e=false,itemCount:n=0}={}){const[o,r]=D(null),[i,s]=D(false),[a,l]=D(false),c=$(t);c.current=t;const u=e?"none":"x mandatory",d=ot(()=>{if(!o)return;const y=Math.abs(o.scrollLeft),b=o.scrollWidth-o.clientWidth;s(y>1),l(y<b-1)},[o]);H(()=>{if(!o)return;const y=o.style;y.overflowX="auto",y.overflowY="hidden",y.scrollSnapType=u,y.setProperty("--clover-track-align",t),y.overscrollBehaviorX="contain"},[o,u,t]),H(()=>{if(!o)return;let y=0;const b=()=>{cancelAnimationFrame(y),y=requestAnimationFrame(d)};d(),o.addEventListener("scroll",b,{passive:true});const x=typeof ResizeObserver<"u"?new ResizeObserver(b):null;return x==null||x.observe(o),o.firstElementChild&&(x==null||x.observe(o.firstElementChild)),()=>{cancelAnimationFrame(y),o.removeEventListener("scroll",b),x==null||x.disconnect()}},[o,d,n]);const p=ot((y,b=false)=>{if(!o||!y)return;const x=b||Tf()?"auto":"smooth";o.scrollBy({left:y,behavior:x})},[o]),f=ot((y,{instant:b=false}={})=>{const x=o==null?void 0:o.querySelector(`[data-track-index="${y}"]`);if(!o||!x)return;const C=o.getBoundingClientRect(),A=x.getBoundingClientRect(),T=getComputedStyle(o).direction==="rtl";p(c.current==="center"?A.left+A.width/2-(C.left+C.width/2):T?A.right-C.right:A.left-C.left,b)},[o,p]),m=ot(y=>{if(!o)return;const b=getComputedStyle(o).direction==="rtl";p(y*o.clientWidth*.9*(b?-1:1))},[o,p]),g=ot(()=>m(1),[m]),_=ot(()=>m(-1),[m]);return H(()=>{if(!o)return;let y=null,b=false;const x=N=>{N.pointerType!=="mouse"||N.button!==0||(y={x:N.clientX,scroll:o.scrollLeft},b=false)},C=N=>{var j;if(!y)return;const W=N.clientX-y.x;!b&&Math.abs(W)<Mf||(b||(b=true,(j=o.setPointerCapture)==null||j.call(o,N.pointerId),o.style.scrollSnapType="none",o.dataset.dragging="true"),o.scrollLeft=y.scroll-W)},A=N=>{var W;y&&(y=null,b&&((W=o.releasePointerCapture)==null||W.call(o,N.pointerId),delete o.dataset.dragging,o.style.scrollSnapType=u))},T=N=>{b&&(b=false,N.preventDefault(),N.stopPropagation())};return o.addEventListener("pointerdown",x),o.addEventListener("pointermove",C),o.addEventListener("pointerup",A),o.addEventListener("pointercancel",A),o.addEventListener("click",T,true),()=>{o.removeEventListener("pointerdown",x),o.removeEventListener("pointermove",C),o.removeEventListener("pointerup",A),o.removeEventListener("pointercancel",A),o.removeEventListener("click",T,true)}},[o,u]),{ref:r,canScrollPrev:i,canScrollNext:a,scrollPrev:_,scrollNext:g,scrollToIndex:f,measure:d}}const Lf=Ct(function(e,n){return!Qt()||e.iiifContent!==void 0||e.items!==void 0?h(Mt,{fallback:null,children:h(If,{...e,forwardedRef:n})}):h(Pf,{...e,forwardedRef:n})}),If=bt(()=>import("./StandaloneItems-BO4VyWRW.mjs"));function Pf({of:t="views",...e}){return t==="members"?h(Af,{...e}):h(Of,{...e})}function Af({onSelect:t,forwardedRef:e,...n}){const{clover:o,language:r}=Qt(),i=nt(c=>c.collection),s=nt(c=>{var u;return((u=c.manifest)==null?void 0:u.id)??null}),a=En(i);if(!a.length)return null;const l=(c,u)=>{t==null||t(c,u),o.goToManifest(c.id)};if(n.layout==="pager"){const c=a.findIndex(u=>u.id===s);return h(Sa,{...n,forwardedRef:e,steps:xa(a,c,"left-to-right",l)})}return h(ka,{...n,forwardedRef:e,items:a,selected:a.findIndex(c=>c.id===s),navigation:"id",language:r,request:o.request,showSummary:true,onActivate:l})}function Of({onSelect:t,forwardedRef:e,...n}){const{clover:o,language:r}=Qt(),i=nt(u=>u.manifest),s=nt(u=>Ze(u.manifest,u.canvasId)),a=nt(u=>xt(u.manifest).direction),l=ya(i);if(l.length<2)return null;const c=u=>o.goTo(u.id);return n.layout==="pager"?h(Sa,{...n,forwardedRef:e,steps:xa(l,s,a,c)}):h(ka,{...n,forwardedRef:e,items:l,selected:s,navigation:"id",rtl:a==="right-to-left",language:r,request:o.request,onActivate:(u,d)=>{t==null||t(u,d),o.goTo(u.id)},followFocus:c})}function xa(t,e,n,o){return{position:e,total:t.length,direction:n,step:(r,i)=>{const s=t[e+r];s&&o(s,i)}}}function Sa({steps:t,forwardedRef:e,layout:n,thumbnailSize:o,renderItem:r,header:i,headingLevel:s,request:a,language:l,navigation:c,of:u,...d}){const p=Ke(e,d.lang);return h(Le.Provider,{value:p.hostLanguage,children:h(Ef,{...d,steps:t,forwardedRef:p.ref,hostLanguage:p.hostLanguage})})}function ka({forwardedRef:t,items:e,selected:n,navigation:o,rtl:r=false,layout:i="slider",thumbnailSize:s=200,request:a,language:l,showSummary:c=false,heading:u,headingLevel:d=2,renderItem:p,onActivate:f,followFocus:m,as:g="section",className:_,"aria-label":y,...b}){var Q;const{t:x}=dt(),C=zt(),A=Ke(t,b.lang),{langOf:T}=A,N=i==="slider",W=o==="id",j=wa({align:W?"center":"start",itemCount:e.length}),J=$(void 0);H(()=>()=>window.clearTimeout(J.current),[]);const V=Cf(e.length,n,{orientation:i==="slider"?"horizontal":i==="list"?"vertical":"both",rtl:r,onActivate:(R,Y)=>f(e[R],Y),onMove:m?(R,Y)=>{window.clearTimeout(J.current);const ut=()=>m(e[R]);Y.repeat?J.current=window.setTimeout(ut,150):ut()}:void 0}),K=$(null),E=$(false);E.current=!!((Q=K.current)!=null&&Q.contains(K.current.ownerDocument.activeElement)),H(()=>{var vt;const R=K.current;if(!R||!E.current)return;const{activeElement:Y,body:ut}=R.ownerDocument;Y&&Y!==ut||(vt=R.querySelector(`[data-track-index="${Math.max(0,n)}"]`))==null||vt.focus()},[e]);const I=$(false);H(()=>{var ut;if(n<0)return;const R=!I.current;if(I.current=true,N){j.scrollToIndex(n,{instant:R});return}const Y=(ut=K.current)==null?void 0:ut.querySelector(`[data-track-index="${n}"]`);Y&&Nf(Y,R)},[N,n]);const v=An(d),k=u?at(u.label,l):null,S=u?at(u.summary,l):null,M=y===void 0&&!!(k!=null&&k.text),w=Xe(x("itemsLabel"),T("itemsLabel"),y!==void 0||M,A.hostLanguage),P=M?{"aria-labelledby":`${C}-title`}:y!==void 0?{"aria-label":y}:w.props,F=(R,Y)=>p?p(R,{selected:Y}):h(bf,{item:R,size:s,language:l,request:a,showSummary:c}),Z=R=>!(p||at(R.label,l).text||c&&at(R.summary,l).text),O=(R,Y)=>Z(R)?x("canvasPosition",{index:Y+1,total:e.length}):void 0,X=R=>Z(R)?T("canvasPosition"):void 0,ht=N?{display:"flex",margin:0,padding:0,listStyle:"none"}:void 0,st=N?{flex:"0 0 auto",scrollSnapAlign:W?"center":"start"}:void 0,q=W&&n>=0,rt=R=>{const Y=n+(R==="prev"?-1:1),ut=q?Y>=0&&Y<e.length:R==="prev"?j.canScrollPrev:j.canScrollNext,vt=q?R==="prev"?"commonPrevious":"commonNext":R==="prev"?"itemsScrollBack":"itemsScrollForward",St=x(vt),Ht=ee=>{if(!ut)return;if(!q)return(R==="prev"?j.scrollPrev:j.scrollNext)();const Lt=e[Y];m?m(Lt):f(Lt,ee)};return h("button",{type:"button",className:`clover-items-scroll-${R}`,"aria-controls":q?void 0:`${C}-viewport`,lang:T(vt),"aria-disabled":!ut||void 0,tabIndex:ut?void 0:-1,onClick:Ht,children:[h("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",children:h("path",{d:R==="next"!==r?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),h("span",{style:le,children:St}),h(de,{label:St})]})};return h(Le.Provider,{value:A.hostLanguage,children:h(g,{ref:A.ref,className:ct("clover-items",_),"data-layout":i,"data-navigation":o,...b,children:[u&&((k==null?void 0:k.text)||(S==null?void 0:S.text))&&h("header",{className:"clover-items-header",children:[(k==null?void 0:k.text)&&h(v,{className:"clover-items-title",id:`${C}-title`,lang:k.lang,children:k.text}),(S==null?void 0:S.text)&&h("p",{className:"clover-items-description",lang:S.lang,children:S.text.replace(/<[^>]*>/g,"")}),u.homepage&&h("a",{className:"clover-items-homepage",href:u.homepage,lang:T("commonViewAll"),children:x("commonViewAll")})]}),h("div",{className:"clover-items-frame",style:{position:"relative"},dir:r?"rtl":void 0,children:[N&&rt("prev"),h("div",{id:`${C}-viewport`,className:"clover-items-viewport",ref:N?j.ref:void 0,children:W?h("div",{ref:K,role:"listbox",...P,"aria-orientation":N?"horizontal":"vertical",className:"clover-items-track",style:ht,children:e.map((R,Y)=>{const ut=Y===n;return h("div",{id:`${C}-${Y}`,role:"option","aria-selected":ut,"aria-label":O(R,Y),lang:X(R),className:"clover-items-item","data-track-index":Y,style:st,...V.itemProps(Y),onClick:vt=>f(R,vt),children:F(R,ut)},R.id)})}):h("ul",{...P,className:"clover-items-track",style:ht,children:e.map((R,Y)=>h("li",{className:"clover-items-item","data-track-index":Y,style:st,children:h("a",{className:"clover-items-link",href:R.href,"aria-label":O(R,Y),lang:X(R),draggable:false,onClick:ut=>f(R,ut),children:F(R,false)})},R.id))})}),N&&rt("next")]}),w.node]})})}function Nf(t,e){var s;let n=t.parentElement;for(;n&&n!==document.body;){const{overflowY:a}=getComputedStyle(n);if(/(auto|scroll)/.test(a)&&n.scrollHeight>n.clientHeight)break;n=n.parentElement}if(!n||n===document.body)return;const o=n.getBoundingClientRect(),r=t.getBoundingClientRect(),i=r.top<o.top?r.top-o.top:r.bottom>o.bottom?r.bottom-o.bottom:0;i&&((s=n.scrollBy)==null||s.call(n,{top:i,behavior:e?"auto":"smooth"}))}function Rf({className:t,loading:e,error:n}){const{t:o,langOf:r}=dt(),{status:i,error:s}=Dd(),a=i==="loading",l=e!==void 0&&e!==false;return h(mt,{children:[h("p",{className:ct("clover-status",t),"data-status":a?i:void 0,role:"status",style:a&&e!==false?void 0:le,children:[a&&(l?e:e===void 0&&h(He,{})),a&&!l&&h("span",{style:le,lang:r("statusLoading"),children:o("statusLoading")})]}),i==="error"&&s&&h("div",{className:ct("clover-status",t),"data-status":i,role:"alert",children:n?n(s):h(mt,{children:[h("p",{lang:r("statusError"),children:o("statusError")}),h("p",{className:"clover-status-detail",lang:"en",children:s.message})]})})]})}const Bf=/^(ar|arc|ckb|dv|fa|he|iw|ks|ps|sd|syr|ug|ur|yi)$/,$f=/^(adlm|arab|hebr|nkoo|rohg|syrc|thaa)$/;function Ff(t){if(!t)return;const[e,...n]=t.toLowerCase().split(/[-_]/),o=n.find(r=>r.length===4);return(o?$f.test(o):Bf.test(e))?"rtl":void 0}function zf(t,e=false,n=3){const o=e||rf(t),r=e?`${n}
|
|
27
|
+
${t}`:t,[i,s]=D(null);return H(()=>{if(!o)return;let a=true;return Promise.all([import("../sanitize-Dc7nOsgO.mjs"),e?import("../markdown-CCYJwzFn.mjs"):null]).then(([{sanitizeHTML:l},c])=>{const u=c?c.markdownToHtml(t,{headingLevel:n}):t;a&&s({for:r,html:l(u,{markdown:!!c})})}),()=>{a=false}},[t,r,o,e,n]),o&&(i==null?void 0:i.for)===r?i.html:null}const Ea=Ct(function({as:e="span",markup:n,language:o,format:r,headingLevel:i,...s},a){const{text:l,lang:c}=at(n,o),u=Ff(c),d=sf(r,l),p=d==="markdown",f=zf(d==="plain"?"":l,p,i);return l?d==="plain"?h(e,{ref:a,...s,lang:c,dir:u,children:l.split(/\r?\n/).map((m,g)=>h(qt.Fragment,{children:[g>0&&h("br",{}),m]},g))}):f!==null?h(e,{ref:a,...s,lang:c,dir:u,dangerouslySetInnerHTML:{__html:f}}):h(e,{ref:a,...s,lang:c,dir:u,children:p?af(l):Ge(l)}):null}),Ca=({metadata:t,language:e,renderValue:n,...o})=>t!=null&&t.length?h("dl",{...o,children:t.map((r,i)=>{const s=at(r.label,e),a=n==null?void 0:n(r);return h("div",{"data-label":at(r.label,"none").text.replace(/\s+/g,"-").toLowerCase(),children:[h("dt",{lang:s.lang,children:s.text}),a!==void 0?h("dd",{children:a}):h(Ea,{as:"dd",markup:r.value,language:e})]},i)})}):null,Hf=typeof window>"u"?H:Tt;function Df({children:t}){const{t:e}=dt(),n=Ke(),o=$(null),r=zt(),i=qt.Children.only(t),s=i.props.id??r,{open:a,cut:l,toggle:c}=Wf(o);return h("div",{className:"clover-read-more",children:[qt.cloneElement(i,{ref:o,id:s,"data-read-more":a?"open":""}),(l||a)&&h("button",{type:"button",className:"clover-read-more-button","aria-expanded":a,"aria-controls":s,onClick:c,ref:n.ref,lang:n.langOf(a?"readLess":"readMore"),children:e(a?"readLess":"readMore")})]})}function Wf(t){const[e,n]=D(false),[o,r]=D(false),i=()=>{const s=t.current;s&&!e&&r(s.scrollHeight>s.clientHeight+1)};return Hf(i),H(()=>{var d,p;const s=t.current;if(!s)return;let a=0;const l=()=>{cancelAnimationFrame(a),a=requestAnimationFrame(i)},c=typeof ResizeObserver>"u"?null:new ResizeObserver(i);c==null||c.observe(s);const u=typeof MutationObserver>"u"?null:new MutationObserver(l);return u==null||u.observe(document.head,{childList:true,subtree:true,characterData:true}),u==null||u.observe(document.documentElement,{attributes:true,attributeFilter:["style","class"]}),u==null||u.observe(s,{attributes:true,attributeFilter:["style"]}),(p=(d=document.fonts)==null?void 0:d.addEventListener)==null||p.call(d,"loadingdone",l),()=>{var f,m;cancelAnimationFrame(a),c==null||c.disconnect(),u==null||u.disconnect(),(m=(f=document.fonts)==null?void 0:f.removeEventListener)==null||m.call(f,"loadingdone",l)}},[e,t.current]),{open:e,cut:o,toggle:()=>n(s=>!s)}}function Pe(t,e,n){const o=ir(),r=qe(i=>{var s;return(s=In(i,t))==null?void 0:s[e]},void 0);return n!==void 0?n:o?o[e]:r}const Je=()=>{var t;return(t=Qt())==null?void 0:t.language};function qi({of:t="manifest",as:e="p",value:n,className:o,...r}){const i=Pe(t,"summary",n),s=Je();return at(i,s).text?h(Df,{children:h(Ea,{as:e,markup:i,language:s,className:ct("clover-summary",o),...r})}):null}function Uf({of:t="manifest",value:e,className:n,renderValue:o,...r}){const i=Pe(t,"metadata",e),s=Je();return h(Ca,{metadata:i,language:s,renderValue:o,className:ct("clover-metadata",n),...r})}function jf({of:t="manifest",value:e,className:n,...o}){const r=Pe(t,"requiredStatement",e),i=Je();return h(Ca,{metadata:r?[r]:null,language:i,className:ct("clover-required-statement",n),...o})}function Vf({of:t="manifest",value:e,className:n,...o}){const r=Pe(t,"rights",e);return r?h("a",{href:r,className:ct("clover-rights",n),...o,children:r}):null}function qf({of:t="manifest",value:e,className:n,...o}){const r=Pe(t,"id",e);return r?h("a",{href:r,className:ct("clover-id",n),...o,children:r}):null}function Ma({property:t,className:e,of:n="manifest",value:o,...r}){const i=U(Pe(n,t,o)),s=Je(),a=i.filter(l=>l==null?void 0:l.id);return a.length?h("ul",{className:e,...r,children:a.map(l=>{const c=at(l.label,s);return h("li",{children:[h("a",{href:l.id,lang:c.text?c.lang:void 0,children:c.text?Ge(c.text):l.id}),l.format&&h("span",{className:"clover-link-format",children:[" (",l.format,")"]})]},l.id)})}):null}const Kf=({className:t,...e})=>h(Ma,{property:"homepage",className:ct("clover-homepage",t),...e}),Zf=({className:t,...e})=>h(Ma,{property:"seeAlso",className:ct("clover-see-also",t),...e});function Xf({of:t="manifest",value:e,size:n=400,className:o,...r}){var m;const i=qe(g=>In(g,t),null),s=e??i,a=Je(),l=s?sr(s):null,c=(l==null?void 0:l.src)??(l==null?void 0:l.service)??(l==null?void 0:l.fallback),[u,d]=D(l==null?void 0:l.src),p=(m=Qt())==null?void 0:m.clover.request;if(H(()=>{if(!l)return d(void 0);if(l.src)return d(l.src);let g=true;return ar(l,n,p).then(_=>g&&d(_)),()=>{g=false}},[c,n]),!u)return null;const f=at(s==null?void 0:s.label,a);return h("img",{src:u,alt:Ge(f.text),lang:r.alt===void 0&&f.text?f.lang:void 0,width:n,loading:"lazy",decoding:"async",className:ct("clover-thumbnail",o),...r})}const Yf=typeof window>"u"?H:Tt,Ta=Kt(null),Gf=t=>{var e;return!!((e=t.textContent)!=null&&e.trim())||t.querySelector("img, svg, picture, video, canvas, object")!==null},Jf=t=>!!t&&typeof t=="object"&&["label","logo","homepage"].some(e=>U(t[e]).length>0),Io=t=>!!t&&typeof t.id=="string",Qf=t=>{var e;return(e=U(t.homepage).find(Io))==null?void 0:e.id},tp=(t,e)=>{var n;if(!t)return null;for(const o of[t.label,(n=U(t.homepage).find(r=>r==null?void 0:r.label))==null?void 0:n.label]){const r=at(o,e);if(r.text)return{text:Ge(r.text),lang:r.lang}}return null};function La({of:t="manifest",value:e,link:n=true,children:o,className:r,...i}){var c;const s=qe(u=>{var d;return(d=In(u,t))==null?void 0:d.provider},void 0),a=(c=Qt())==null?void 0:c.language,l=U(e!==void 0?e:s).filter(Jf);return l.length?h("ul",{className:ct("clover-provider",r),...i,children:l.map((u,d)=>{const p=n?Qf(u):void 0,f=!!at(u.label,a).text;return h(ep,{agent:u,homepage:p,children:o??h(mt,{children:[h(Ia,{alt:f?"":void 0}),h(Pn,{className:"clover-provider-label"})]})},u.id??d)})}):null}function ep({agent:t,homepage:e,children:n}){const o=$(null),[r,i]=D(null),s=ot(()=>{o.current&&!Gf(o.current)&&i(t)},[t]);return r===t?null:h("li",{className:"clover-provider-agent",children:h(ma.Provider,{value:t,children:h(Ta.Provider,{value:s,children:e?h("a",{ref:o,href:e,className:"clover-provider-link",children:n}):h("span",{ref:o,className:"clover-provider-content",children:n})})})})}function Ia({of:t="manifest",value:e,alt:n,className:o,...r}){var p;const{t:i,langOf:s}=dt(),a=ir(),l=qe(f=>{var m;return(m=In(f,t))==null?void 0:m.provider},void 0),c=(p=Qt())==null?void 0:p.language,d=(e!==void 0?U(e):a?[a]:U(l)).flatMap(f=>{if(!f||typeof f!="object")return[];const m=f;if(m.type!=="Agent"&&Io(m)&&!m.logo)return[{image:m,agent:null}];const g=U(m.logo).find(Io);return g?[{image:g,agent:m}]:[]});return d.length?h(mt,{children:d.map(({image:f,agent:m},g)=>{const _=tp(m,c);return h(np,{src:f.id,alt:n??(_==null?void 0:_.text)??i("logo"),lang:n!==void 0?void 0:_?_.lang:s("logo"),width:f.width,height:f.height,loading:"lazy",decoding:"async",className:ct("clover-logo",o),...r},`${f.id}-${g}`)})}):null}function np({alt:t,onError:e,...n}){const o=Et(Ta),[r,i]=D(false),s=ot(()=>i(true),[]);Yf(()=>{r&&(o==null||o())},[r,o]);const a=ot(l=>{var c;l!=null&&l.complete&&!l.naturalWidth&&((c=l.decode)==null||c.call(l).catch(s))},[s]);return r?null:h("img",{ref:a,alt:t,onError:l=>{e==null||e(l),s()},...n})}function Ki(t,e){const n=new Set,o=[];for(const r of t)for(const i of U(r==null?void 0:r.rendering)){const s=(i==null?void 0:i.id)??(i==null?void 0:i["@id"]);if(typeof s!="string"||n.has(s))continue;n.add(s);const a=at(i.label,e);o.push({id:s,label:a.text||i.format||s,lang:a.text?a.lang:void 0,format:i.format})}return o}function Pa(){const{language:t}=te("Download"),e=nt(o=>o.manifest),n=nt(o=>we(o.manifest,o.canvasId));return{page:Ki(n,t),all:Ki([e],t)}}function Aa({page:t,all:e,headingLevel:n=3}){const{t:o,langOf:r}=dt(),i=zt(),s=An(n),a=(l,c,u)=>c.length>0&&h("section",{className:"clover-download-group","aria-labelledby":`${i}-${u}`,children:[h(s,{className:"clover-download-title",id:`${i}-${u}`,lang:r(l),children:o(l)}),h("ul",{className:"clover-download-list",children:c.map(d=>h("li",{children:h("a",{className:"clover-download-link",href:d.id,target:"_blank",rel:"noopener noreferrer",lang:d.lang,children:[d.label,d.format&&d.format!==d.label&&h("span",{className:"clover-download-format",children:[" ","(",d.format,")"]})]})},d.id))})]});return h("div",{className:"clover-download-groups",children:[a("downloadPage",t,"page"),a("downloadAll",e,"all")]})}function gm({className:t,headingLevel:e=3,...n}){const{page:o,all:r}=Pa();return!o.length&&!r.length?null:h("div",{...n,className:ct("clover-download",t),children:h(Aa,{page:o,all:r,headingLevel:e})})}const op=bt(()=>import("./PartOfManifest-X9_q-2t6.mjs"));function rp({canvasSummary:t=false,headingLevel:e=3,download:n=true,thumbnail:o=true,label:r=true,className:i,...s}){const{t:a,langOf:l}=dt(),c=Pa(),u=nt(_=>_.manifest,Object.is,"About"),d=$(null);H(()=>{const _=d.current,y=_==null?void 0:_.querySelector(".clover-about-thumbnail");if(!_||!y||typeof ResizeObserver>"u")return;const b=_.querySelector(".clover-about-label"),x=()=>{_.style.setProperty("--clover-about-label-height",`${(b==null?void 0:b.offsetHeight)??0}px`),_.style.setProperty("--clover-about-thumbnail-width",`${y.offsetWidth}px`)},C=new ResizeObserver(x);return C.observe(y),b&&C.observe(b),()=>{C.disconnect(),_.style.removeProperty("--clover-about-label-height"),_.style.removeProperty("--clover-about-thumbnail-width")}},[r,o,u]);const p=zt(),f=()=>{var b,x;const _=d.current;(x=((b=_==null?void 0:_.closest(".clover-sections-item"))==null?void 0:b.querySelector(".clover-sections-button"))??_)==null||x.focus({preventScroll:true})};if(!u)return null;const m=(_,y,b)=>{if(!y)return null;const{as:x,title:C,group:A}=ba(e,`${p}-${_}`);return h("section",{className:"clover-about-section",...A,children:[h(x,{className:"clover-about-heading",lang:l(_),...C,children:a(_)}),b]})},g=_=>Array.isArray(u[_])?u[_].length>0:!!u[_];return h("div",{ref:d,className:ct("clover-about",i),tabIndex:-1,...s,children:[(o||r)&&h("div",{className:"clover-about-head",children:[o&&h(Xf,{className:"clover-about-thumbnail",size:256,alt:r?"":void 0}),r&&h(Pn,{as:An(e),className:"clover-about-label"})]}),t&&h(qi,{of:"canvas",className:"clover-about-summary"}),gi(u)&&u.partOf&&h(Mt,{fallback:null,children:h(op,{manifest:u,headingLevel:e,onOpened:f})}),h(qi,{className:"clover-about-summary"}),h(Uf,{className:"clover-about-metadata"}),h(jf,{className:"clover-about-metadata"}),m("aboutProvider",g("provider"),h(La,{})),m("aboutRights",u.rights,h(Vf,{})),m("aboutHomepage",g("homepage"),h(Kf,{})),m("aboutSeeAlso",g("seeAlso"),h(Zf,{})),m("download",n&&c.page.length+c.all.length>0,h(Aa,{page:c.page,all:c.all,headingLevel:e+1})),m(gi(u)?"aboutCanvas":"aboutManifest",u.id,h(qf,{}))]})}function ip(t,e=null){if(!t)return false;if(e!=null&&e.navPlace||t.navPlace)return true;for(const n of xt(t).canvases){if(n.navPlace)return true;for(const o of U(n.annotations))for(const r of U(o==null?void 0:o.items))if(r!=null&&r.navPlace||U(r==null?void 0:r.motivation).includes("georeferencing")||U(r==null?void 0:r.body).some(s=>(s==null?void 0:s.type)==="Feature"||(s==null?void 0:s.type)==="FeatureCollection"))return true}return false}const Oa=typeof window>"u"?H:Tt,Na=Kt(null);function vm(){return Et(Na)}const Ra=Kt(0);function ym(){return Et(Ra)}function sp({items:t,layout:e="tabs",value:n,onValueChange:o,label:r,labelLang:i,headingLevel:s=3}){var K;const a=zt(),l=Xe(r??"",i,r===void 0),c=$([]),u=e==="tabs",{t:d,langOf:p}=dt(),f=wa({dragFree:true,itemCount:t.length}),m=t.some(E=>E.value===n)?n:((K=t[0])==null?void 0:K.value)??null,g=$(new Set);m&&g.current.add(m);const _=$(null),[y,b]=D({value:null,count:0});H(()=>{var M;if(u||!m||_.current!==m)return;_.current=null;const E=t.findIndex(w=>w.value===m),I=document.getElementById(`${a}-panel-${E}`),v=(M=c.current[E])==null?void 0:M.parentElement;if(!I||!v)return;const k=v.getBoundingClientRect().bottom-I.getBoundingClientRect().top;if(k<=0)return;const S=oo(I);S&&(S.scrollTop-=k)},[m,u,t,a]);const x=E=>{var Z,O,X,ht;const I=t.findIndex(st=>st.value===m),v=document.getElementById(`${a}-panel-${I}`),k=E.target;if(!v||k===v||!v.contains(k)||!lp(k))return;const S=(O=(Z=c.current[I])==null?void 0:Z.parentElement)==null?void 0:O.getBoundingClientRect(),M=I+1<t.length?(ht=(X=c.current[I+1])==null?void 0:X.parentElement)==null?void 0:ht.getBoundingClientRect():void 0;if(!S)return;const w=k.getBoundingClientRect(),P=w.top<S.bottom?Math.floor(w.top-S.bottom):M&&w.bottom>M.top?Math.ceil(Math.min(w.bottom-M.top,w.top-S.bottom)):0,F=P?oo(v):null;F&&(F.scrollTop+=P)},C=$(null),A=t.map(E=>E.value).join(`
|
|
28
|
+
`);Oa(()=>{const E=C.current;if(u||!E||typeof ResizeObserver>"u")return;const I=[...E.querySelectorAll(":scope > .clover-sections-item")],v=I.map(q=>q.firstElementChild),k=v[0],S=v[v.length-1],M=new Map,w=q=>(q&&M.get(q))??0,P=document.scrollingElement;let F=null,Z=0;const O=()=>{const q=v.reduce((vt,St)=>vt+w(St),0);let rt=0;I.forEach((vt,St)=>{vt.style.setProperty("--clover-sections-before",`${rt}px`),rt+=w(v[St]),vt.style.setProperty("--clover-sections-after",`${q-rt}px`)}),E.style.setProperty("--clover-sections-total",`${q}px`);const Q=k&&getComputedStyle(k);(Q==null?void 0:Q.position)==="sticky"&&S&&(Z=parseFloat(Q.top)+parseFloat(getComputedStyle(S).bottom)||0);const R=getComputedStyle(E),Y=parseFloat(R.lineHeight)||1.2*parseFloat(R.fontSize),ut=(F==null?void 0:F.clientHeight)??0;ut>0&&ut-Z-q<2*Y?E.dataset.stacks="off":delete E.dataset.stacks},X=new ResizeObserver(q=>{var rt,Q;for(const R of q)v.includes(R.target)&&M.set(R.target,((Q=(rt=R.borderBoxSize)==null?void 0:rt[0])==null?void 0:Q.blockSize)??R.target.getBoundingClientRect().height);O()}),ht=()=>{const q=oo(E);q!==F&&(F&&F!==P&&X.unobserve(F),q&&q!==P&&X.observe(q),F=q)},st=()=>{ht(),O()};ht();for(const q of v)q&&X.observe(q,{box:"border-box"});return window.addEventListener("resize",st),()=>{X.disconnect(),window.removeEventListener("resize",st);for(const q of I)q.style.removeProperty("--clover-sections-before"),q.style.removeProperty("--clover-sections-after");E.style.removeProperty("--clover-sections-total"),delete E.dataset.stacks}},[u,A,s]),H(()=>{if(u)return;const E=c.current.map(v=>v==null?void 0:v.parentElement).filter(v=>!!v),I=v=>{var w;if(v.ctrlKey)return;const k=v.currentTarget,S=Zi(k);if(!S||S===document.scrollingElement)return;v.preventDefault();const M=v.deltaMode===1?parseFloat(getComputedStyle(k).lineHeight)||16:v.deltaMode===2?S.clientHeight:1;(w=Zi(S)??document.scrollingElement)==null||w.scrollBy({left:v.deltaX*M,top:v.deltaY*M,behavior:"instant"})};for(const v of E)v.addEventListener("wheel",I,{passive:false});return()=>{for(const v of E)v.removeEventListener("wheel",I)}},[u,A]);const T=E=>{E!==m&&(_.current=E,u||b(I=>({value:E,count:I.count+1})),o==null||o(E))},N=(E,I)=>{var w;const v=t.length-1,[k,S]=u?["ArrowLeft","ArrowRight"]:["ArrowUp","ArrowDown"],M=E.key===S?(I+1)%t.length:E.key===k?(I-1+t.length)%t.length:E.key==="Home"?0:E.key==="End"?v:null;M!==null&&(E.preventDefault(),(w=c.current[M])==null||w.focus(),u&&T(t[M].value))},W=$(false);H(()=>{if(!u)return;const E=t.findIndex(F=>F.value===m),I=c.current[E],v=I==null?void 0:I.parentElement;if(!I||!v)return;const k=getComputedStyle(v),S=v.getBoundingClientRect(),M=I.getBoundingClientRect(),w=S.left+(parseFloat(k.scrollPaddingLeft)||0),P=S.right-(parseFloat(k.scrollPaddingRight)||0);(M.left<w-1||M.right>P+1)&&f.scrollToIndex(E,{instant:!W.current}),W.current=true},[m,u,t.length,f.scrollToIndex]);const j=E=>{const I=E==="prev"?f.canScrollPrev:f.canScrollNext,v=E==="prev"?"sectionsScrollBack":"sectionsScrollForward";return h("button",{type:"button",className:`clover-sections-scroll-${E}`,"aria-hidden":"true",tabIndex:-1,hidden:!I,lang:p(v),onMouseDown:k=>k.preventDefault(),onClick:E==="prev"?f.scrollPrev:f.scrollNext,children:[h("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16",children:h("path",{d:E==="next"?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),h(de,{label:d(v)})]})},J=An(s,"div"),V=(E,I)=>{const v=E.value===m;return h("button",{ref:k=>{c.current[I]=k},type:"button",id:`${a}-button-${I}`,className:"clover-sections-button","data-value":E.value,"data-track-index":u?I:void 0,"aria-controls":`${a}-panel-${I}`,...u?{role:"tab","aria-selected":v,tabIndex:v?0:-1}:{"aria-expanded":v,"aria-disabled":v||void 0},onClick:()=>T(E.value),onKeyDown:k=>N(k,I),children:[h("span",{className:"clover-sections-label",children:E.label}),!u&&!v&&h("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",className:"clover-sections-chevron",children:h("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]},E.value)};return h("div",{ref:C,className:"clover-sections","data-layout":e,onFocus:u?void 0:x,style:u?void 0:{"--clover-sections-count":t.length},children:[u&&h("div",{className:"clover-sections-tabs","data-more":[f.canScrollPrev&&"start",f.canScrollNext&&"end"].filter(Boolean).join(" ")||void 0,children:h("div",{className:"clover-sections-row",children:[h("div",{role:"tablist",ref:f.ref,...l.props,className:"clover-sections-list",children:t.map(V)}),j("prev"),j("next")]})}),u&&l.node,t.map((E,I)=>{const v=E.value===m;return h("section",{className:"clover-sections-item","data-value":E.value,"data-open":v,style:u?void 0:{"--clover-sections-index":I},children:[!u&&h(J,{className:"clover-sections-heading",children:[V(E,I),h("span",{className:"clover-sections-reach","aria-hidden":"true"})]}),h(Ra.Provider,{value:y.value===E.value?y.count:0,children:h(ap,{id:`${a}-panel-${I}`,tabs:u,labelledBy:`${a}-button-${I}`,hidden:!v,children:g.current.has(E.value)?E.content:null})})]},E.value)})]})}function ap({id:t,tabs:e,labelledBy:n,hidden:o,children:r}){const[i,s]=D(null);return Oa(()=>{const a=i==null?void 0:i.parentElement;if(o||!i||!a||typeof ResizeObserver>"u")return;const l=new ResizeObserver(()=>{const c=i.offsetWidth;c?a.style.setProperty("--clover-sections-actions",`${c}px`):a.style.removeProperty("--clover-sections-actions")});return l.observe(i),()=>{l.disconnect(),a.style.removeProperty("--clover-sections-actions")}},[i,o]),h(mt,{children:[!e&&h("div",{ref:s,className:"clover-sections-actions",hidden:o}),h("div",{id:t,role:e?"tabpanel":"region","aria-labelledby":n,tabIndex:e?0:void 0,className:"clover-sections-panel",hidden:o,children:h(Na.Provider,{value:e?null:i,children:r})})]})}function oo(t){for(let e=t.parentElement;e&&e!==document.body;e=e.parentElement)if(/auto|scroll|hidden/.test(getComputedStyle(e).overflowY))return e;return document.scrollingElement}function Zi(t){for(let e=t.parentElement;e&&e!==document.body;e=e.parentElement)if(/auto|scroll/.test(getComputedStyle(e).overflowY)&&e.scrollHeight>e.clientHeight)return e;return document.scrollingElement}function lp(t){try{return t.matches(":focus-visible")}catch{return true}}const cp=bt(()=>import("./MapView-BVSdybIC.mjs").then(t=>({default:t.RootMap}))),up=bt(()=>import("./Collection-CxuLCspj.mjs").then(t=>({default:t.Collection}))),dp=bt(()=>import("./Contents-DNh9mnsF.mjs").then(t=>({default:t.Contents}))),hp=bt(()=>import("./Search-S4N5QU4R.mjs").then(t=>({default:t.Search}))),fp=bt(()=>import("./Transcript-BbDaS064.mjs").then(t=>({default:t.Transcript}))),pp=bt(()=>import("./Annotations-sj79EMen.mjs").then(t=>({default:t.Annotations}))),ve=t=>h(Mt,{fallback:null,children:t}),mp=()=>null,gp=Ct(function({layout:e="tabs",value:n,defaultValue:o,onValueChange:r,onClose:i,closeOnEscape:s=false,headingLevel:a=3,as:l="aside",download:c=true,className:u,children:d,onKeyDown:p,...f},m){var Z;const{clover:g}=te("Panel"),_=$(null),{t:y,langOf:b}=dt(),x=Xe(y("informationPanelTabs"),b("informationPanelTabs"),!!(f["aria-label"]||f["aria-labelledby"])||!(["aside","section","nav"].includes(l)||f.role)),C=O=>{const X=b(O);return X?h("span",{lang:X,children:y(O)}):y(O)},A=nt(O=>Mc(O.manifest,O.addedSets).length>0),T=nt(O=>we(O.manifest,O.canvasId).some(X=>Js(X).length>0||td(X).length>0)),N=nt(O=>Hd(O.manifest).length>0),W=nt(O=>!!Rs(O.manifest)),j=nt(O=>ip(O.manifest,O.collection)),J=nt(O=>{var X,ht;return(((ht=(X=O.collection)==null?void 0:X.items)==null?void 0:ht.length)??0)>0||!!_c(O.manifest)}),V=qt.Children.toArray(d).filter(O=>qt.isValidElement(O)&&O.type===mp),K=e==="accordion"?a+1:a,E=V.length?V.map(({props:O})=>({value:O.value,label:O.label,content:O.children})):[{value:"about",label:C("informationPanelTabsAbout"),content:h(rp,{headingLevel:K,download:c})},...J?[{value:"collection",label:C("informationPanelTabsCollection"),content:ve(h(up,{headingLevel:K}))}]:[],...N?[{value:"contents",label:C("informationPanelTabsContents"),content:ve(h(dp,{}))}]:[],...W?[{value:"search",label:C("informationPanelTabsSearch"),content:ve(h(hp,{headingLevel:K,sticky:true,size:"small"}))}]:[],...j?[{value:"map",label:C("informationPanelTabsMap"),content:ve(h(cp,{}))}]:[],...T?[{value:"transcript",label:C("transcriptLabel"),content:ve(h(fp,{sticky:true,size:"small"}))}]:[],...A?[{value:"annotations",label:C("informationPanelTabsAnnotations"),content:ve(h(pp,{headingLevel:K}))}]:[]],I=nt(O=>O.search.query),v=E.some(O=>O.value==="search"),[k,S]=D(()=>I&&v?"search":o??null),M=$(I&&v?I:"");H(()=>{v&&(I&&I!==M.current&&n===void 0&&S("search"),M.current=I)},[I,v,n]);const w=n!==void 0?n:k,P=(E.some(O=>O.value===w)?w:(Z=E[0])==null?void 0:Z.value)==="search";if(H(()=>{v&&g.setSetVisible(jo,P)},[g,v,P]),!E.length)return null;const F=()=>{var X;const O=_.current;O!=null&&O.contains(document.activeElement)&&((X=vp(O))==null||X.focus()),i==null||i()};return h(l,{ref:O=>{_.current=O,typeof m=="function"?m(O):m&&(m.current=O)},className:ct("clover-panel",u),"data-layout":e,"data-closable":i?"":void 0,"data-floating":s?"":void 0,...x.props,onKeyDown:O=>{p==null||p(O),s&&i&&O.key==="Escape"&&!O.defaultPrevented&&(O.preventDefault(),F())},...f,children:[x.node,i&&h("button",{type:"button",className:"clover-panel-close","aria-label":y("informationPanelClose"),lang:b("informationPanelClose"),onClick:F,children:[h("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 512 512",fill:"none",stroke:"currentColor",children:h(Go,{})}),h(de,{label:y("informationPanelClose")})]}),h(sp,{items:E,layout:e,value:n!==void 0?n:k,onValueChange:O=>{n===void 0&&S(O),r==null||r(O)},label:y("informationPanelTabs"),labelLang:b("informationPanelTabs"),headingLevel:a})]})});function vp(t){for(let e=t;e&&e!==document.body;e=e.parentElement){if(!e.id)continue;const n=document.querySelector(`[aria-controls~="${e.id.replace(/["\\]/g,"\\$&")}"]`);if(n)return n}return null}const yp=1,_p=4,bp=8,wp=500,xp=4,Xi=["pointerdown","mousedown","pointerup","mouseup","click","dblclick"],Ba=()=>typeof document>"u"?16:parseFloat(getComputedStyle(document.documentElement).fontSize)||16;function gn(t,e){if(t===void 0)return;if(typeof t=="number")return t;const n=parseFloat(t);if(!Number.isNaN(n))return t.endsWith("rem")?n*Ba():t.endsWith("%")?n/100*e:n}const ro=t=>typeof t=="number"?`${t}px`:t,Sp=t=>{if(!t||typeof localStorage>"u")return{};try{const e=JSON.parse(localStorage.getItem(t)??"{}");return e&&typeof e=="object"?e:{}}catch{return{}}},kp=(t,e)=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},Ep=t=>t?Array.from(t.children).filter(e=>e.classList.contains("clover-split-pane")):[];function Cp(t){const e=s=>{let a=t[s];for(;a&&!a.classList.contains("clover-split-pane");)a=a[s];return a},n=e("previousElementSibling"),o=e("nextElementSibling"),r=o!=null&&o.hasAttribute("data-sized")?o:n!=null&&n.hasAttribute("data-sized")?n:null;return{sized:r,other:r===o?n:o}}function Mp(t,e,n){const{sized:o,other:r}=Cp(t);if(!o)return null;const i=e.clientWidth,s=o.dataset.splitKey??"",a=n[s]??{},l=n[(r==null?void 0:r.dataset.splitKey)??""]??{},c=gn(a.min,i)??0,d=o.getBoundingClientRect().width+((r==null?void 0:r.getBoundingClientRect().width)??0)-(gn(l.min,i)??0),p=Math.max(c,Math.min(gn(a.max,i)??d,d)),f=o.getBoundingClientRect().left>=t.getBoundingClientRect().left-1;return{sized:o,key:s,min:c,max:p,after:f}}function Tp(t,e,n){const o=e!==void 0&&e>t.min+1&&e<t.max-1?[t.min,e,t.max]:[t.min,t.max],r=n??e??t.sized.getBoundingClientRect().width,i=o.find(s=>s>r+1)??o[0];return{to:i,own:e!==void 0&&Math.abs(i-e)<=1}}function Lp(t,e){const n=e.sized.getBoundingClientRect().width,o=yp*Ba()*(t.shiftKey?4:1),r=e.after?"ArrowLeft":"ArrowRight",i=e.after?"ArrowRight":"ArrowLeft";if(t.key===r)return n+o;if(t.key===i)return n-o;if(t.key==="Home")return e.min;if(t.key==="End")return e.max}function Yi(t){var n,o,r;const e=(o=(n=t.target)==null?void 0:n.closest)==null?void 0:o.call(n,".clover-tip");return!!(e&&((r=t.currentTarget)!=null&&r.contains(e)))}function Ip(t,e){let n=null,o=false,r=null,i=null;const s=a=>{i==null||i();const l=t(),c=l==null?void 0:l.ownerDocument.defaultView;if(!l||!c)return;const u=g=>Math.hypot(g.clientX-a.x,g.clientY-a.y)>a.reach,d=()=>{Xi.forEach(g=>c.removeEventListener(g,p,true)),c.removeEventListener("pointermove",f,true),clearTimeout(m),i=null},p=g=>{if(!l.contains(g.target)){if(g.type==="pointerdown"&&u(g))return d();g.preventDefault(),g.stopPropagation()}},f=g=>u(g)&&d();Xi.forEach(g=>c.addEventListener(g,p,true)),c.addEventListener("pointermove",f,true);const m=setTimeout(d,wp);i=d};return{down(a){var u;if(o=false,r=null,a.defaultPrevented||a.button!==0||Yi(a))return;const l=e().limits();if(!l)return;a.preventDefault(),n={found:l,x:a.clientX,from:l.sized.getBoundingClientRect().width,slop:a.pointerType==="touch"?bp:_p,moved:false};const c=a.currentTarget;c.dataset.dragging="",(u=c.setPointerCapture)==null||u.call(c,a.pointerId)},move(a){const l=n;if(!l)return;const c=a.clientX-l.x;!l.moved&&Math.abs(c)<l.slop||(l.moved=true,e().resize(l.from+(l.found.after?-c:c)))},up(a){const l=n;o=(l==null?void 0:l.moved)??false,r=l&&!l.moved&&a.type==="pointerup"?{x:a.clientX,y:a.clientY,reach:l.slop*xp}:null,n=null,delete a.currentTarget.dataset.dragging},click(a){const l=o,c=r;o=false,r=null,!(a.defaultPrevented||l||Yi(a))&&(e().step(),c&&s(c))},key(a){if(a.defaultPrevented)return;const l=e().limits();if(!l)return;const c=Lp(a,l);c!==void 0&&(e().resize(c),a.preventDefault())},dispose(){i==null||i()}}}const ur=Kt(null);function dr(t,e){typeof t=="function"?t(e):t&&(t.current=e)}const Pp=Ct(function({as:e="div",storageKey:n,className:o,style:r,children:i,...s},a){const l=$(null),c=$({}),[u,d]=D({});H(()=>d(Sp(n)),[n]);const p=ot((m,g)=>d(_=>{const y={..._};return g===void 0?delete y[m]:y[m]=Math.round(g),kp(n,y),y}),[n]),f=pt(()=>({sizes:u,setSize:p,specs:c,element:l}),[u,p]);return h(ur.Provider,{value:f,children:h(e,{ref:m=>{l.current=m,dr(a,m)},className:["clover-split",o].filter(Boolean).join(" "),style:{display:"flex",...r},...s,children:i})})}),Gi=Ct(function({as:e="div",size:n,min:o,max:r,name:i,className:s,style:a,children:l,...c},u){const d=Et(ur),p=$(null),[f,m]=D(i??"");H(()=>{if(i)return m(i);const _=Ep(d==null?void 0:d.element.current);m(String(_.indexOf(p.current)))},[i,d]),d&&f&&(d.specs.current[f]={min:o,max:r,size:n});const g=d&&f?d.sizes[f]:void 0;return h(e,{ref:_=>{p.current=_,dr(u,_)},className:["clover-split-pane",s].filter(Boolean).join(" "),"data-split-key":f||void 0,"data-sized":n!==void 0?"":void 0,style:{minWidth:ro(o)??0,"--clover-split-size":g!==void 0?`${g}px`:ro(n),"--clover-split-max":ro(r),...a},...c,children:l})}),Ap=Ct(function({className:e,children:n,onPointerDown:o,onClick:r,onKeyDown:i,...s},a){const l=Et(ur),{t:c,langOf:u}=dt(),d=$(null),[p,f]=D(),m=ot(()=>{const T=d.current,N=l==null?void 0:l.element.current;return!T||!N||!l?null:Mp(T,N,l.specs.current)},[l]),g=ot(T=>{const N=m();if(!N||!l)return;const W=Math.min(N.max,Math.max(N.min,T));l.setSize(N.key,W),f({now:W,min:N.min,max:N.max})},[m,l]),_=ot(()=>{const T=m();T&&f({now:T.sized.getBoundingClientRect().width,min:T.min,max:T.max})},[m]);H(()=>{const T=l==null?void 0:l.element.current;if(_(),!T||typeof ResizeObserver>"u")return;const N=new ResizeObserver(_);return N.observe(T),()=>N.disconnect()},[_,l,l==null?void 0:l.sizes]);const y=T=>{var N;return Math.round(T/(((N=l==null?void 0:l.element.current)==null?void 0:N.clientWidth)||1)*100)},b=()=>{var J,V;const T=m();if(!T||!l)return;const N=((J=l.element.current)==null?void 0:J.clientWidth)??0,W=gn((V=l.specs.current[T.key])==null?void 0:V.size,N),j=Tp(T,W,l.sizes[T.key]);if(!j.own)return g(j.to);l.setSize(T.key,void 0),f({now:W,min:T.min,max:T.max})},x=$({limits:m,resize:g,step:b});x.current={limits:m,resize:g,step:b};const[C]=D(()=>Ip(()=>d.current,()=>x.current));H(()=>()=>C.dispose(),[C]);const A=s["aria-label"]??c("splitHandle");return h("div",{ref:T=>{d.current=T,dr(a,T)},role:"separator","aria-orientation":"vertical","aria-label":A,lang:s["aria-label"]===void 0?u("splitHandle"):void 0,"aria-valuenow":p?y(p.now):void 0,"aria-valuemin":p?y(p.min):void 0,"aria-valuemax":p?y(p.max):void 0,tabIndex:0,className:["clover-split-handle",e].filter(Boolean).join(" "),onPointerDown:T=>{o==null||o(T),C.down(T)},onPointerMove:T=>C.move(T),onPointerUp:T=>C.up(T),onPointerCancel:T=>C.up(T),onClick:T=>{r==null||r(T),C.click(T)},onKeyDown:T=>{i==null||i(T),C.key(T)},...s,children:[n,h(de,{label:A})]})});let $a;function Op(t){$a=t}function _m(){return $a}function Np({open:t,onOpenChange:e,controls:n}){const{t:o,langOf:r}=dt(),i=zt().replace(/:/g,"");return h(Ce,{id:`panel-${i}`,label:o("informationPanelToggle"),lang:r("informationPanelToggle"),expanded:t,controls:n,onClick:()=>e(!t),children:h(mt,{children:[h("rect",{x:"64",y:"96",width:"384",height:"320",rx:"40",fill:"none",strokeWidth:"36"}),h("path",{d:"M320 96v320",fill:"none",strokeWidth:"36"}),t&&h("path",{d:"M320 96h88a40 40 0 0 1 40 40v240a40 40 0 0 1-40 40h-88z"})]})})}let Rp,pn;function Bp(t,{enabled:e,side:n,onClose:o,scrim:r,alongside:i,exits:s=false}){const a=$({enabled:e,side:n,onClose:o,scrim:r,alongside:i,exits:s});a.current={enabled:e,side:n,onClose:o,scrim:r,alongside:i,exits:s},H(()=>{const l=t.current;if(!l||(pn==null||pn.reset(l,a),!e))return;let c=true,u;return(Rp??(Rp=import("../dragToClose-C-Pf1IeO.mjs").then(d=>pn=d))).then(d=>{c&&(u=d.attach(l,a))}),()=>{c=false,u==null||u()}},[t,e])}const $p=240;function Fp(t){const[e,n]=D(t),[o,r]=D(t);return H(()=>{if(t){n(true);const s=requestAnimationFrame(()=>requestAnimationFrame(()=>r(true)));return()=>cancelAnimationFrame(s)}r(false);const i=setTimeout(()=>n(false),$p);return()=>clearTimeout(i)},[t]),{mounted:e,open:t&&o}}function zp(t){const e=n=>t.querySelector(n);return e('[role="tab"][aria-selected="true"]')??e('.clover-sections-button[aria-expanded="true"]')??e(".clover-sections-button")}const Hp=typeof window>"u"?H:Tt;function Dp(t,e){const[n,o]=D();return Hp(()=>{const r=t.current;if(!r)return;const i=()=>{const a=r.clientWidth;if(!a)return;const l=parseFloat(getComputedStyle(document.documentElement).fontSize);o(a>=e*(l||16))};if(i(),typeof ResizeObserver>"u")return;const s=new ResizeObserver(i);return s.observe(r),()=>s.disconnect()},[t,e]),n}const Wp=30;function Up(){const t=$(0);return H(()=>()=>cancelAnimationFrame(t.current),[]),e=>{cancelAnimationFrame(t.current);let n=0;const o=()=>{const r=e();r&&jp()?r.focus():++n<Wp&&(t.current=requestAnimationFrame(o))};t.current=requestAnimationFrame(o)}}function jp(){const t=document.activeElement;return!t||t===document.body||!t.isConnected||t.closest("[hidden], [inert]")!==null}const Vp=typeof window>"u"?H:Tt;function qp(t,e,n){Vp(()=>{const o=t.current,r=o==null?void 0:o.parentElement;if(!n||!o||!r)return;const i=()=>{const l=e();o.style.setProperty("--clover-template-spine-top",`${l?l.getBoundingClientRect().top-r.getBoundingClientRect().top:0}px`)};i();const s=new ResizeObserver(i);for(const l of Array.from(r.children))s.observe(l);const a=e();return a&&s.observe(a),()=>s.disconnect()},[t,n])}const Kp="16rem",Zp="14rem",Xp=31,Yp=typeof window>"u"?H:Tt;function Gp({className:t,header:e=true,headingLevel:n=2,panel:o=true,defaultPanelOpen:r,panelLayout:i="accordion",download:s=true,items:a="slider",storageKey:l="clover-template-default",fill:c=false,...u}){const d=$(null),p=Dp(d,Xp),f=p??true,[m,g]=D(r??true),[_,y]=D(false),b=f?m:_,x=$(null),C=$(0);H(()=>{if(!C.current||!x.current)return;C.current-=1;const P=zp(x.current);P==null||P.focus({preventScroll:true}),P&&document.activeElement===P&&(C.current=0)});const A=P=>{C.current=!f&&P?3:0,f||y(P),g(P)},T=zt().replace(/:/g,""),N=`${T}-panel`,W=ba(n,`${T}-title`),j=Up(),J=()=>j(()=>document.querySelector(`[data-button="panel"][aria-controls~="${N}"]`)),V=()=>{var P;(P=x.current)!=null&&P.contains(document.activeElement)&&J()},K=$(p);Yp(()=>{K.current===true&&p===false&&J(),p===true&&y(false),K.current=p},[p]);const E=!f,I=o&&!E&&b,v=$(null);qp(v,()=>{var P,F;return(F=(P=v.current)==null?void 0:P.parentElement)==null?void 0:F.querySelector(".clover-template-default-body")},I);const k=h(Np,{open:b,onOpenChange:P=>{E||J(),A(P)},controls:N}),S=Fp(E&&b),M=$(null);Bp(x,{enabled:E&&S.open,side:"end",onClose:()=>{V(),A(false)},scrim:M});const w=E?S.mounted:b;return h(su,{className:["clover-template-default",t].filter(Boolean).join(" "),"data-fill":c||void 0,...e?W.group:null,...u,children:h(Pp,{ref:d,className:"clover-template-default-panes clover-template-panes","data-panel":E?"over":"beside",storageKey:l||void 0,onKeyDown:P=>{E&&b&&P.key==="Escape"&&!P.defaultPrevented&&(P.preventDefault(),A(false))},children:[h(Gi,{className:"clover-template-default-main",min:E?void 0:Kp,children:[e&&h("header",{className:"clover-template-default-header",children:[h(Pn,{as:W.as,className:"clover-template-default-title",...W.title}),h(La,{className:"clover-template-default-provider",children:h(Ia,{})})]}),h(Rf,{loading:false}),h(nf,{className:"clover-template-default-body",children:o&&!I&&k}),h("div",{className:"clover-template-default-rail",children:[h("div",{className:"clover-template-default-rail-header",children:[h(Qp,{}),h(kf,{})]}),a&&h(Lf,{layout:a})]})]}),I&&h(Ap,{"aria-controls":N}),I&&h("div",{ref:v,className:"clover-template-default-spine",children:k}),o&&h(Gi,{ref:x,id:N,"data-spine":E||void 0,name:"panel",className:"clover-template-default-panel clover-template-drawer",size:"24rem",min:E?void 0:Zp,"data-open":E?S.open:b,hidden:!w,children:h(gp,{layout:i,download:s,headingLevel:e?Jp(n):n,onClose:E?()=>A(false):void 0,closeOnEscape:E})}),o&&E&&S.mounted&&h("div",{ref:M,className:"clover-template-default-scrim clover-template-scrim","data-open":S.open,"aria-hidden":"true",onMouseDown:P=>P.preventDefault(),onClick:()=>{V(),A(false)}})]})})}const Jp=t=>t+1;function Qp(){const t=or();return h("p",{className:"clover-template-default-titles",children:t.map((e,n)=>h(qt.Fragment,{children:[n>0&&h("span",{className:"clover-template-default-titles-dot","aria-hidden":"true",children:"\xB7"}),h(Pn,{label:e.label})]},e.id))})}const tm=()=>import("./renderers-L-IlGI1r.mjs"),em=bt(()=>import("./Document-CNCpzkiN.mjs").then(t=>({default:t.Document}))),nm=bt(()=>import("./Gallery-CEp3-bh2.mjs").then(t=>({default:t.Gallery}))),Ji={default:Gp,document:em,gallery:nm},om={header:["default"],panel:["default"],items:["default"],fill:["default"],defaultPanelOpen:["default","document"],panelLayout:["default","document"],download:["default","document"],storageKey:["default","document"],defaultSidebarOpen:["document"],size:["gallery"]};function rm({props:t}){const e=typeof t.template=="string"&&t.template in Ji?t.template:"default",n=Object.fromEntries(Object.entries(t).filter(([s])=>{var a;return s!=="template"&&(((a=om[s])==null?void 0:a.includes(e))??true)})),o=_n(tm,!!t.renderers),r=pt(()=>o==null?void 0:o.toRenderers(t.renderers),[o,t.renderers]);if(t.renderers&&!o)return null;n.renderers=r,typeof n.storageKey=="string"&&(n.storageKey=n.storageKey.trim().toLowerCase()==="false"?false:n.storageKey);const i=Ji[e];return h(Mt,{fallback:null,children:h(i,{...n,iiifContent:t.iiifContent})})}const im=""+new URL("../assets/maplibre-gl-worker-kTz9OPxr.js",import.meta.url).href,sm={mapWorkerUrl:im},am={tag:"clover-viewer",kind:"alone",attributes:{template:{prop:"template",type:["default","document","gallery"]},"iiif-content":{prop:"iiifContent",type:"string"},"canvas-id":{prop:"defaultCanvasId",type:"string"},"manifest-id":{prop:"defaultManifestId",type:"string"},language:{prop:"language",type:"string"},"search-query":{prop:"searchQuery",type:"string"},annotations:{prop:"annotations",type:"data"},"heading-level":{prop:"headingLevel",type:"number",min:2},items:{prop:"items",type:["slider","list","grid","false"]},header:{prop:"header",type:"boolean"},panel:{prop:"panel",type:"boolean"},download:{prop:"download",type:"boolean"},"panel-open":{prop:"defaultPanelOpen",type:"boolean"},"panel-layout":{prop:"panelLayout",type:["accordion","tabs"]},"sidebar-open":{prop:"defaultSidebarOpen",type:"boolean"},"storage-key":{prop:"storageKey",type:"string"},fill:{prop:"fill",type:"boolean"},size:{prop:"size",type:"string"}},properties:["iiifContent","annotations","request","renderers"],events:{"clover-canvas-change":{prop:"onCanvasChange",detail:["canvasId"]},"clover-manifest-change":{prop:"onManifestChange",detail:["manifestId"]},"clover-status-change":{prop:"onStatusChange",detail:["status","error"]},"clover-content-state-change":{prop:"onContentStateChange",detail:"first"}}};Op(sm.mapWorkerUrl);pl(am,()=>Promise.resolve(rm));export{Pl as $,$ as A,nf as B,Ft as C,gm as D,Pp as E,Gi as F,Lf as G,Ap as H,gu as I,Np as J,hm as K,Pn as L,El as M,Ud as N,Mt as O,kf as P,bt as Q,su as R,Rf as S,pt as T,qi as U,Kt as V,Et as W,ea as X,wo as Y,Sn as Z,Tt as _,Fp as a,An as a$,er as a0,or as a1,ct as a2,Vd as a3,xo as a4,Wo as a5,Do as a6,U as a7,qt as a8,Ru as a9,Su as aA,Ks as aB,Eu as aC,ku as aD,Wd as aE,nt as aF,Wc as aG,mm as aH,xa as aI,Sa as aJ,ka as aK,xt as aL,Ie as aM,Ge as aN,Ct as aO,Qt as aP,qe as aQ,we as aR,_m as aS,Oc as aT,_c as aU,qf as aV,Kf as aW,Hd as aX,dm as aY,Rs as aZ,ym as a_,dt as aa,gd as ab,Ke as ac,md as ad,Fu as ae,pd as af,oa as ag,Nc as ah,Nu as ai,Kd as aj,Ai as ak,bu as al,at as am,Vs as an,Xe as ao,It as ap,Cu as aq,ld as ar,Bu as as,Ce as at,lu as au,He as av,wu as aw,mu as ax,Le as ay,xu as az,Zl as b,Js as b0,td as b1,vm as b2,Ln as b3,Mc as b4,qo as b5,Xn as b6,sa as b7,Lc as b8,Ho as b9,Ea as bA,sf as bB,af as bC,Os as bD,Sc as bE,Vt as bF,Df as bG,Ca as bH,gp as bI,Zs as bJ,lf as bK,al as bL,Hs as ba,Fd as bb,gi as bc,Ee as bd,jo as be,sr as bf,vu as bg,od as bh,Zo as bi,_n as bj,pc as bk,rd as bl,bo as bm,Ut as bn,Ri as bo,zh as bp,th as bq,Ni as br,um as bs,fe as bt,Jt as bu,Zd as bv,Xd as bw,hn as bx,qc as by,Bs as bz,Bp as c,D as d,te as e,la as f,jd as g,zt as h,fm as i,pm as j,mt as k,Up as l,Dp as m,$l as n,de as o,zp as p,ot as q,ar as r,uf as s,ba as t,h as u,le as v,La as w,$t as x,H as y,Ia as z};
|