@nulib/clover 4.2.0 → 4.3.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.
Files changed (335) hide show
  1. package/README.md +1 -1
  2. package/dist/components/Canvas/CanvasView.mjs +33 -4
  3. package/dist/components/Canvas/ChaptersMenu.mjs +6 -1
  4. package/dist/components/Canvas/ControlMenu.mjs +9 -2
  5. package/dist/components/Canvas/Controls.mjs +17 -4
  6. package/dist/components/Canvas/FrameAnimation.mjs +3 -0
  7. package/dist/components/Canvas/ImageControls.mjs +8 -3
  8. package/dist/components/Canvas/Placeholder.mjs +5 -2
  9. package/dist/components/Canvas/RowFits.mjs +3 -1
  10. package/dist/components/Canvas/media/MediaBody.mjs +3 -0
  11. package/dist/components/Canvas/media/Player.mjs +3 -0
  12. package/dist/components/Canvas/media/Transport.mjs +3 -0
  13. package/dist/components/Canvas/media/useMediaElement.mjs +32 -9
  14. package/dist/components/Items/masonry.mjs +2 -0
  15. package/dist/components/Map/MapView.mjs +42 -2
  16. package/dist/components/Map/maplibre-sheet.mjs +5 -0
  17. package/dist/components/Map/sheet.mjs +19 -0
  18. package/dist/components/Map/worker.mjs +28 -1
  19. package/dist/components/Scene/SceneView.mjs +3 -0
  20. package/dist/core/content-state.mjs +1 -11
  21. package/dist/core/load.mjs +9 -1
  22. package/dist/core/presentation.mjs +4 -5
  23. package/dist/core/sanitize.mjs +15 -3
  24. package/dist/core/svg-shape.mjs +2 -1
  25. package/dist/core/thumbnail.mjs +15 -4
  26. package/dist/core/trusted.mjs +26 -0
  27. package/dist/core/vtt.mjs +20 -9
  28. package/dist/index.d.mts +200 -1
  29. package/dist/index.mjs +11 -0
  30. package/dist/lib/renderer/CanvasRenderer.mjs +48 -7
  31. package/dist/lib/renderer/camera/CameraAnimator.mjs +39 -20
  32. package/dist/lib/renderer/input/GestureController.mjs +15 -5
  33. package/dist/map/index.d.mts +6 -1
  34. package/dist/styles/collection-select.css +1 -0
  35. package/dist/styles/core.css +1 -0
  36. package/dist/styles/default.css +1 -0
  37. package/dist/styles/items.css +1 -0
  38. package/dist/styles/map.css +1 -0
  39. package/dist/{web-components/Transport-VUxSEIQO.mjs → styles/media.css} +1 -1
  40. package/dist/styles/panel.css +1 -0
  41. package/dist/styles/scene.css +1 -0
  42. package/dist/styles/split.css +1 -0
  43. package/dist/styles.css +1 -1
  44. package/dist/templates/default/Default.mjs +2 -0
  45. package/dist/templates/document/Document.mjs +12 -2
  46. package/dist/templates/document/Sheets.mjs +2 -0
  47. package/dist/templates/gallery/Gallery.mjs +3 -1
  48. package/dist/templates/index.d.mts +102 -6
  49. package/dist/templates/shared/Lightbox.mjs +50 -3
  50. package/dist/templates/shared/LightboxView.mjs +3 -1
  51. package/dist/templates.css +1 -1
  52. package/dist/ui/Button.mjs +3 -1
  53. package/dist/ui/ControlCluster.mjs +6 -3
  54. package/dist/ui/Markup.mjs +8 -7
  55. package/dist/ui/Tip.mjs +6 -1
  56. package/dist/ui/adoptSheet.mjs +19 -0
  57. package/dist/ui/sheets/map.mjs +5 -0
  58. package/dist/ui/sheets/media.mjs +5 -0
  59. package/dist/ui/sheets/scene.mjs +5 -0
  60. package/dist/web-components/{About-D1TBGGPL.mjs → About-uNCjvWgs.mjs} +1 -1
  61. package/dist/web-components/{AnnotationItems-DTacmRA9.mjs → AnnotationItems-JwlcCvPo.mjs} +1 -1
  62. package/dist/web-components/{AnnotationMenu-DYc9ekWS.mjs → AnnotationMenu-BWyKEyvW.mjs} +1 -1
  63. package/dist/web-components/{AnnotationState--5ghW0C2.mjs → AnnotationState-Bhqs75Br.mjs} +1 -1
  64. package/dist/web-components/{Annotations-BG8lPjk1.mjs → Annotations-C7y0N8Lj.mjs} +1 -1
  65. package/dist/web-components/{Annotations-Bvc_FmJ5.mjs → Annotations-ZwcRh2UE.mjs} +2 -2
  66. package/dist/web-components/{Body-QQ1DmnbP.mjs → Body-DyrvRDkt.mjs} +1 -1
  67. package/dist/web-components/{BodyAlert-A4xRjOKr.mjs → BodyAlert-XV88XjL8.mjs} +1 -1
  68. package/dist/web-components/Button-BIaw5k1q.mjs +1 -0
  69. package/dist/web-components/{Camera-DqT_1MgD.mjs → Camera-7SlnmGtb.mjs} +1 -1
  70. package/dist/web-components/{Canvas2DBackend-TZtR3zHf.mjs → Canvas2DBackend-DBGZRGid.mjs} +1 -1
  71. package/dist/web-components/CanvasView-CmDxczm9.mjs +2 -0
  72. package/dist/web-components/{CaptionDetails-DMRWmtaY.mjs → CaptionDetails-Bxz8AXMz.mjs} +1 -1
  73. package/dist/web-components/ChaptersMenu-CMQiBqvx.mjs +1 -0
  74. package/dist/web-components/{Chevron-DFGbSGPI.mjs → Chevron-B3XaClVT.mjs} +1 -1
  75. package/dist/web-components/{ChoiceMenu-C80kdxvq.mjs → ChoiceMenu-pugo5zxI.mjs} +1 -1
  76. package/dist/web-components/{Collection-B4CxBsFL.mjs → Collection-Ch_FeSKp.mjs} +1 -1
  77. package/dist/web-components/{CollectionSelect-DO8YO2p7.mjs → CollectionSelect-2jDEkOcK.mjs} +1 -1
  78. package/dist/web-components/{Connected-DthCPaHl.mjs → Connected-3hnIPSWM.mjs} +1 -1
  79. package/dist/web-components/{Connected-sYBn_9MK.mjs → Connected-Bne3I5E1.mjs} +1 -1
  80. package/dist/web-components/{Connected-CcbVqzmj.mjs → Connected-DuANHN93.mjs} +1 -1
  81. package/dist/web-components/{Contents-AVPYYXht.mjs → Contents-DIQrin_-.mjs} +1 -1
  82. package/dist/web-components/ControlMenu-BydnCTTQ.mjs +1 -0
  83. package/dist/web-components/ControlsFade-CleBsk-W.mjs +1 -0
  84. package/dist/web-components/CountMenu-CReBYVwu.mjs +1 -0
  85. package/dist/web-components/Cue-2zGQuUOC.mjs +1 -0
  86. package/dist/web-components/Document-pjc2qOX4.mjs +1 -0
  87. package/dist/web-components/{DomLayers-DlRapZ1u.mjs → DomLayers-D9X_FPto.mjs} +1 -1
  88. package/dist/web-components/{Download-Ci_JUTVd.mjs → Download-B8MpVqgk.mjs} +1 -1
  89. package/dist/web-components/{EntryBodies-C0ICfS2R.mjs → EntryBodies-DdpRfU5U.mjs} +1 -1
  90. package/dist/web-components/{EntryThumbnail-DxHhfRo_.mjs → EntryThumbnail-DM7Zjj1z.mjs} +1 -1
  91. package/dist/web-components/{FieldPill-CVfeeafm.mjs → FieldPill-BAql8_6s.mjs} +1 -1
  92. package/dist/web-components/{FrameAnimation-AZpVvu0R.mjs → FrameAnimation-Dj46RxuL.mjs} +1 -1
  93. package/dist/web-components/Gallery-B9FNA02Z.mjs +1 -0
  94. package/dist/web-components/{HideToggle-0nlIo-f8.mjs → HideToggle-duXvDvDw.mjs} +1 -1
  95. package/dist/web-components/ImageControls-DODKjC0d.mjs +1 -0
  96. package/dist/web-components/{Items-Drd82_Jj.mjs → Items-BHTQJU7T.mjs} +1 -1
  97. package/dist/web-components/{Label-BIjqJ-_T.mjs → Label-D4dlrtpH.mjs} +1 -1
  98. package/dist/web-components/{LanguageChoice-DkSc-n6g.mjs → LanguageChoice-DR3X-dtJ.mjs} +1 -1
  99. package/dist/web-components/LightboxView-D-aBaKfB.mjs +1 -0
  100. package/dist/web-components/{ListEnd-pq-BgaDI.mjs → ListEnd-CQ4vX-NW.mjs} +1 -1
  101. package/dist/web-components/{Loaded-CSO5NFhm.mjs → Loaded-DsNSPXWf.mjs} +1 -1
  102. package/dist/web-components/{LoadedCanvas-DK6xMmM1.mjs → LoadedCanvas-Cq7_O2bw.mjs} +1 -1
  103. package/dist/web-components/LoadedMap-0_prxuA4.mjs +1 -0
  104. package/dist/web-components/{Loading-CoJLSRkv.mjs → Loading-4PmhMeZ-.mjs} +1 -1
  105. package/dist/web-components/{Map-BEVtD52O.mjs → Map-B29Ba50b.mjs} +1 -1
  106. package/dist/web-components/MapView-nHeg39Kz.mjs +3 -0
  107. package/dist/web-components/Markup-BZ7l5GbG.mjs +2 -0
  108. package/dist/web-components/MediaBody-DH-rr_0N.mjs +1 -0
  109. package/dist/web-components/{MediaBody-Co23JjUJ.mjs → MediaBody-eSThjFzH.mjs} +1 -1
  110. package/dist/web-components/{NavDate-CYNK0Qmp.mjs → NavDate-0MsHRjBW.mjs} +1 -1
  111. package/dist/web-components/{Navigator-DrYPepzN.mjs → Navigator-qJ79A8Nk.mjs} +1 -1
  112. package/dist/web-components/{Pager-CN4lHURv.mjs → Pager-SPd_u0qz.mjs} +1 -1
  113. package/dist/web-components/{PagerLayout-DeqnSQcF.mjs → PagerLayout-CkSwDAnp.mjs} +1 -1
  114. package/dist/web-components/{Panel-CFYUlXup.mjs → Panel-C8r3EsWn.mjs} +1 -1
  115. package/dist/web-components/PanelPart-BA1NoeLA.mjs +1 -0
  116. package/dist/web-components/{PanelToggle-9ud55NNI.mjs → PanelToggle-CrKP8BqE.mjs} +1 -1
  117. package/dist/web-components/{PartOfManifest-KUHUq-6q.mjs → PartOfManifest-BdDSxK4k.mjs} +1 -1
  118. package/dist/web-components/{Pending-mcmdyZPA.mjs → Pending-CmgVU1kF.mjs} +1 -1
  119. package/dist/web-components/{PlaceBox-DX4ZLDat.mjs → PlaceBox-D7HLNGxE.mjs} +1 -1
  120. package/dist/web-components/Placeholder-DVAlXejQ.mjs +1 -0
  121. package/dist/web-components/{Position-DO5qg5Sp.mjs → Position-C6KUAceQ.mjs} +1 -1
  122. package/dist/web-components/{Primitives-c9sIz0oQ.mjs → Primitives-ClQVjY6x.mjs} +1 -1
  123. package/dist/web-components/{Provider-a3xY016W.mjs → Provider-C0IUdU6v.mjs} +1 -1
  124. package/dist/web-components/{ReadMore-D_WmmKEP.mjs → ReadMore-BiEJA4yO.mjs} +1 -1
  125. package/dist/web-components/Root-Drt5N4_s.mjs +1 -0
  126. package/dist/web-components/Scene-C7t16NjC.mjs +1 -0
  127. package/dist/web-components/SceneView-BHg37-rs.mjs +1 -0
  128. package/dist/web-components/{Search-BgxEW1UT.mjs → Search-Bpd_lGzH.mjs} +1 -1
  129. package/dist/web-components/{Sections-DZVrhoAC.mjs → Sections-D_bS5IQH.mjs} +1 -1
  130. package/dist/web-components/{StandaloneItems-6cSw7nbF.mjs → StandaloneItems-YV9O9M8F.mjs} +1 -1
  131. package/dist/web-components/{Status-DHTzuTkh.mjs → Status-BCG7AN9B.mjs} +1 -1
  132. package/dist/web-components/{Steps-Dkpy9KiJ.mjs → Steps-Dnn8Ajqf.mjs} +1 -1
  133. package/dist/web-components/TargetItems-xxbtePln.mjs +1 -0
  134. package/dist/web-components/Timeline-Danuk_Nn.mjs +1 -0
  135. package/dist/web-components/Tip-DPFWlNLu.mjs +1 -0
  136. package/dist/web-components/{Transcript-WvFFAJQM.mjs → Transcript-C-_DbUO5.mjs} +1 -1
  137. package/dist/web-components/{Transport-FxLp_bdW.mjs → Transport-BKona8RD.mjs} +1 -1
  138. package/dist/web-components/Transport-Bonmu77-.mjs +1 -0
  139. package/dist/web-components/{annotation-collection-BkC3nBPA.mjs → annotation-collection-nmxzo_hO.mjs} +1 -1
  140. package/dist/web-components/{annotation-name-Du2KAWoD.mjs → annotation-name-DoUUo-8D.mjs} +1 -1
  141. package/dist/web-components/{annotations-content-CEzAS-P2.mjs → annotations-content-Cl1upbdd.mjs} +1 -1
  142. package/dist/web-components/{body-DPlfbLt3.mjs → body-DC8Oq8rY.mjs} +1 -1
  143. package/dist/web-components/{canvas-BUwBftJW.mjs → canvas-gzoTnBxw.mjs} +1 -1
  144. package/dist/web-components/{cloverEngine-UNw5K4Xg.mjs → cloverEngine-CFL1Bd7n.mjs} +1 -1
  145. package/dist/web-components/{content-state-reader-GgQF2MvJ.mjs → content-state-reader-DYbmXxCp.mjs} +1 -1
  146. package/dist/web-components/controlGlyphs-d7KUIUwi.mjs +1 -0
  147. package/dist/web-components/{controls-CC9G5LxK.mjs → controls-VC9D1mwr.mjs} +1 -1
  148. package/dist/web-components/custom-elements.json +10 -2
  149. package/dist/web-components/{downloads-CmAYeEIz.mjs → downloads-D2cnWDbs.mjs} +1 -1
  150. package/dist/web-components/{dragToClose-DK-eM097.mjs → dragToClose-CzYeh_12.mjs} +1 -1
  151. package/dist/web-components/{engine-Dok0z8WP.mjs → engine-Dcfyp2DV.mjs} +1 -1
  152. package/dist/web-components/{engines-BD2IfwQF.mjs → engines-BMr7naGM.mjs} +1 -1
  153. package/dist/web-components/{fetchManifest-tQXcfFiz.mjs → fetchManifest-DxptUh4u.mjs} +1 -1
  154. package/dist/web-components/{fromManifest-BwQdeAuL.mjs → fromManifest-BpPFLVyZ.mjs} +1 -1
  155. package/dist/web-components/{glyphs-dp_HK3Ja.mjs → glyphs-BCnJl8py.mjs} +1 -1
  156. package/dist/web-components/hooks-Dz_5UXXp.mjs +1 -0
  157. package/dist/web-components/{image-layers-xcBsiad9.mjs → image-layers-BPnq7jk1.mjs} +1 -1
  158. package/dist/web-components/{imageService-4sFnmAFX.mjs → imageService-DFPkPNfe.mjs} +1 -1
  159. package/dist/web-components/index-ClM6Kq8w.mjs +1 -0
  160. package/dist/web-components/index.d.mts +4 -2
  161. package/dist/web-components/index.mjs +1 -1
  162. package/dist/web-components/items-BHporT5i.mjs +1 -0
  163. package/dist/web-components/{items-BUmOy2QY.mjs → items-D03KhDg6.mjs} +1 -1
  164. package/dist/web-components/label-r0ki6r1U.mjs +1 -0
  165. package/dist/web-components/{layout-B29v2RKK.mjs → layout-DVa_DnGH.mjs} +1 -1
  166. package/dist/web-components/{link-Ct5PpHEY.mjs → link-DxXxMXiw.mjs} +1 -1
  167. package/dist/web-components/logo-Br42Vlsk.mjs +1 -0
  168. package/dist/web-components/maplibre-sheet-CfiZ6JFk.mjs +1 -0
  169. package/dist/web-components/masonry-BZCdA3bV.mjs +1 -0
  170. package/dist/web-components/{models-BXcT4ijX.mjs → models-pO77sm3z.mjs} +1 -1
  171. package/dist/web-components/{nodes-BleXuYE6.mjs → nodes-CmL3eoRE.mjs} +1 -1
  172. package/dist/web-components/{overlayImage-BJtfot4Y.mjs → overlayImage-DFGetjMh.mjs} +1 -1
  173. package/dist/web-components/{panel-BxxV_JkD.mjs → panel-B1vzUm6_.mjs} +1 -1
  174. package/dist/web-components/part-DmRBh4pf.mjs +1 -0
  175. package/dist/web-components/{playerSurface-BXNLaFk0.mjs → playerSurface-CQ1wrIAQ.mjs} +1 -1
  176. package/dist/web-components/pointer-DWnCT3D3.mjs +1 -0
  177. package/dist/web-components/{provider-CPp0Sgr_.mjs → provider-U7xzX_0T.mjs} +1 -1
  178. package/dist/web-components/{range-regions-DAaOu0IS.mjs → range-regions-Di_lmVqZ.mjs} +1 -1
  179. package/dist/web-components/{read-more-lcqGslUd.mjs → read-more-BtA1sriO.mjs} +1 -1
  180. package/dist/web-components/{readingLanguages-FyVsSWJ8.mjs → readingLanguages-Ptho-Co9.mjs} +1 -1
  181. package/dist/web-components/rendererSurface-BgZPnAwj.mjs +22 -0
  182. package/dist/web-components/{renderers-BFS7hFVU.mjs → renderers-hoD3WKYA.mjs} +1 -1
  183. package/dist/web-components/{resource-Bufu7lAr.mjs → resource-DuTMsPEj.mjs} +1 -1
  184. package/dist/web-components/{sanitize-qIOeyIww.mjs → sanitize-BedC_UE5.mjs} +3 -3
  185. package/dist/web-components/{save-file-CoknKOPz.mjs → save-file-CLB5IM4a.mjs} +1 -1
  186. package/dist/web-components/{search-5ocrsYmT.mjs → search-Dd2Y1dsZ.mjs} +1 -1
  187. package/dist/web-components/shared-CCg1Iag8.mjs +1 -0
  188. package/dist/web-components/{show-link-DBaJj4s_.mjs → show-link-NjacLIdz.mjs} +1 -1
  189. package/dist/web-components/{sizedImage-jnOGcIIZ.mjs → sizedImage-CKOGmqhN.mjs} +1 -1
  190. package/dist/web-components/{split-P6J0qqf5.mjs → split-CcoXZcGX.mjs} +1 -1
  191. package/dist/web-components/{status-honoOMNx.mjs → status-B4a3Izph.mjs} +1 -1
  192. package/dist/web-components/styles-C7PVxtkQ.mjs +1 -0
  193. package/dist/web-components/svg-shape-D1K-WNrY.mjs +1 -0
  194. package/dist/web-components/three.mjs +1 -1
  195. package/dist/web-components/thumbnail-ez20ssEY.mjs +1 -0
  196. package/dist/web-components/{tip-BhNI83aT.mjs → tip-DeFPN33O.mjs} +1 -1
  197. package/dist/web-components/{toggle-CJKdi5KH.mjs → toggle-CGSnnjW-.mjs} +1 -1
  198. package/dist/web-components/trusted-Bvpx307M.mjs +1 -0
  199. package/dist/web-components/{useContainerName-_48Cdi0m.mjs → useContainerName-BfyeBf6_.mjs} +1 -1
  200. package/dist/web-components/{useControlsVisibility-CieBxGnK.mjs → useControlsVisibility-oRiMiQhD.mjs} +1 -1
  201. package/dist/web-components/useLazyPanelPane-CReKsr8z.mjs +1 -0
  202. package/dist/web-components/{useNearViewport-B34ebmIW.mjs → useNearViewport-BADiMpLi.mjs} +1 -1
  203. package/dist/web-components/{useScrollTrack-DgRGFeP5.mjs → useScrollTrack-9QsMaHSx.mjs} +1 -1
  204. package/dist/web-components/viewer/{AnnotationItems-BNA_92Dv.mjs → AnnotationItems-Cvh3jfmf.mjs} +1 -1
  205. package/dist/web-components/viewer/{AnnotationMenu-BIQYVR4N.mjs → AnnotationMenu-d5PT7q8D.mjs} +1 -1
  206. package/dist/web-components/viewer/{AnnotationState-BbwQqA1U.mjs → AnnotationState-DbtYTHMy.mjs} +1 -1
  207. package/dist/web-components/viewer/{Annotations-CZzOZAFP.mjs → Annotations-DKWYJOo2.mjs} +2 -2
  208. package/dist/web-components/viewer/{Annotations-P4XzAlNc.mjs → Annotations-D_wg4O99.mjs} +1 -1
  209. package/dist/web-components/viewer/{Canvas2DBackend-DFfCzyjL.mjs → Canvas2DBackend-B4IXvdsN.mjs} +1 -1
  210. package/dist/web-components/viewer/{CaptionDetails-DPtE-RQQ.mjs → CaptionDetails-Bxh9VD7n.mjs} +1 -1
  211. package/dist/web-components/viewer/ChaptersMenu-CaAIaRZN.mjs +1 -0
  212. package/dist/web-components/viewer/{ChoiceMenu-GkqyTQRQ.mjs → ChoiceMenu-Clp4Zeog.mjs} +1 -1
  213. package/dist/web-components/viewer/{Collection-DjY_6qa6.mjs → Collection-C5BfoUOH.mjs} +1 -1
  214. package/dist/web-components/viewer/{Connected-DIOuI3Mv.mjs → Connected-9VGl2Xnx.mjs} +1 -1
  215. package/dist/web-components/viewer/{Connected-D5T-mtiy.mjs → Connected-Cd2qwuuo.mjs} +1 -1
  216. package/dist/web-components/viewer/{Contents-DV-VxXuf.mjs → Contents-CsG9e7v2.mjs} +1 -1
  217. package/dist/web-components/viewer/ControlMenu-q_u_UC8q.mjs +1 -0
  218. package/dist/web-components/viewer/ControlsFade-Db3IWArv.mjs +1 -0
  219. package/dist/web-components/viewer/CountMenu-Dn0-z5A9.mjs +1 -0
  220. package/dist/web-components/viewer/Cue-slOJQhPI.mjs +1 -0
  221. package/dist/web-components/viewer/Document-r3Sz3RfH.mjs +1 -0
  222. package/dist/web-components/viewer/{DomLayers-BCwCxPDU.mjs → DomLayers-CwHg1jZg.mjs} +1 -1
  223. package/dist/web-components/viewer/{Download-CL4IClAD.mjs → Download-Clx_e2ga.mjs} +1 -1
  224. package/dist/web-components/viewer/{EntryBodies-e40y47bl.mjs → EntryBodies-B4SnV6NJ.mjs} +1 -1
  225. package/dist/web-components/viewer/{EntryThumbnail-B_dP3w4o.mjs → EntryThumbnail-CsAqKh38.mjs} +1 -1
  226. package/dist/web-components/viewer/{FieldPill-Hse1cDBE.mjs → FieldPill-NQfq8SXA.mjs} +1 -1
  227. package/dist/web-components/viewer/{FrameAnimation-CE218DCr.mjs → FrameAnimation-wN2VNW7D.mjs} +1 -1
  228. package/dist/web-components/viewer/Gallery-nX9kQlft.mjs +1 -0
  229. package/dist/web-components/viewer/{HideToggle-CYoqe_ez.mjs → HideToggle-B843JuKU.mjs} +1 -1
  230. package/dist/web-components/viewer/ImageControls--qeUY5kg.mjs +1 -0
  231. package/dist/web-components/viewer/{LanguageChoice-BmO-322r.mjs → LanguageChoice-CZ6K3Mhv.mjs} +1 -1
  232. package/dist/web-components/viewer/LightboxView-BcbP3cJD.mjs +1 -0
  233. package/dist/web-components/viewer/{ListEnd-DX1jsvJk.mjs → ListEnd-DbYDv46a.mjs} +1 -1
  234. package/dist/web-components/viewer/MapView-Dj7Iq7P2.mjs +3 -0
  235. package/dist/web-components/viewer/MediaBody-TN4XsCm7.mjs +1 -0
  236. package/dist/web-components/viewer/{MediaBody-SkIgrEMj.mjs → MediaBody-iAxGgXNy.mjs} +1 -1
  237. package/dist/web-components/viewer/{NavDate-BZgeaMG9.mjs → NavDate-Clj6OMa6.mjs} +1 -1
  238. package/dist/web-components/viewer/{Navigator-Co76p-1n.mjs → Navigator-DPdR3SYX.mjs} +1 -1
  239. package/dist/web-components/viewer/{PagerLayout-tUkN1-FV.mjs → PagerLayout-CtlmDRjI.mjs} +1 -1
  240. package/dist/web-components/viewer/PanelPart-DzZWRlK1.mjs +1 -0
  241. package/dist/web-components/viewer/{PartOfManifest-DXnbEPzS.mjs → PartOfManifest-NAXs2DYd.mjs} +1 -1
  242. package/dist/web-components/viewer/{PlaceBox-xrJ4CGdN.mjs → PlaceBox-C2k5Fsfo.mjs} +1 -1
  243. package/dist/web-components/viewer/Placeholder-DF6dRMjt.mjs +1 -0
  244. package/dist/web-components/viewer/{Search-DTg1cHZ3.mjs → Search-DoUc8tWu.mjs} +1 -1
  245. package/dist/web-components/viewer/{StandaloneItems-BpBEQG8i.mjs → StandaloneItems-DuXasJO0.mjs} +1 -1
  246. package/dist/web-components/viewer/{Steps-SpwMQdCL.mjs → Steps-B3MrG4Cv.mjs} +1 -1
  247. package/dist/web-components/viewer/TargetItems-DOFSQtYR.mjs +1 -0
  248. package/dist/web-components/viewer/{Transcript-rTAhuXCF.mjs → Transcript-Dy-FHWMo.mjs} +1 -1
  249. package/dist/web-components/viewer/Transport-C5wkxVOF.mjs +1 -0
  250. package/dist/web-components/viewer/{Transport-vKIDALE-.mjs → Transport-CUXmY_jW.mjs} +1 -1
  251. package/dist/web-components/viewer/{annotation-collection-B7pZiLVk.mjs → annotation-collection-A0PNdPhI.mjs} +1 -1
  252. package/dist/web-components/viewer/annotation-name-CfQs7Mb2.mjs +1 -0
  253. package/dist/web-components/viewer/{annotations-content-9AtLlPNn.mjs → annotations-content-B52-zM99.mjs} +1 -1
  254. package/dist/web-components/viewer/{cloverEngine-jRrYLrWa.mjs → cloverEngine-4sgpB7Rz.mjs} +1 -1
  255. package/dist/web-components/viewer/{content-state-reader-CPvkju6Q.mjs → content-state-reader-vtATl-W3.mjs} +1 -1
  256. package/dist/web-components/viewer/{dragToClose-Co9kGk9q.mjs → dragToClose-B4rj1D3r.mjs} +1 -1
  257. package/dist/web-components/viewer/{fetchManifest-D7N9WhhF.mjs → fetchManifest-gAj8phm4.mjs} +1 -1
  258. package/dist/web-components/viewer/{host-DMD9LE4H.mjs → host-Hv8WXfiF.mjs} +1 -1
  259. package/dist/web-components/viewer/{image-layers-x_shzPvu.mjs → image-layers-gFEDKVkV.mjs} +1 -1
  260. package/dist/web-components/viewer/index.mjs +1 -1
  261. package/dist/web-components/viewer/{link-DikPGzNO.mjs → link-DIh6ysyo.mjs} +1 -1
  262. package/dist/web-components/viewer/{overlayImage-33kKKB0T.mjs → overlayImage-BRjcH40Q.mjs} +1 -1
  263. package/dist/web-components/viewer/{range-regions-TH6WWGTT.mjs → range-regions-uPqjKIER.mjs} +1 -1
  264. package/dist/web-components/viewer/{renderers-BxePmixF.mjs → renderers-C5EfPrd7.mjs} +1 -1
  265. package/dist/web-components/viewer/{save-file-QXKiPlST.mjs → save-file-dIa0LCAn.mjs} +1 -1
  266. package/dist/web-components/viewer/{search-B_NePyas.mjs → search-Bbv9dCNq.mjs} +1 -1
  267. package/dist/web-components/viewer/styles-L1HpSoL2.mjs +1 -0
  268. package/dist/web-components/viewer/{useControlsVisibility-Cu-jTDzs.mjs → useControlsVisibility-jopIdHZi.mjs} +1 -1
  269. package/dist/web-components/viewer/useLazyPanelPane-CoPgtYkx.mjs +1 -0
  270. package/dist/web-components/viewer/viewer-DqpSyvH-.mjs +29 -0
  271. package/dist/web-components/viewer/vtt-DpgB_K8v.mjs +5 -0
  272. package/dist/web-components/viewer-D2lGdifc.mjs +1 -0
  273. package/dist/web-components/vtt-KUQbi4PK.mjs +5 -0
  274. package/dist/web-components/worker-C9aVbya_.mjs +1 -0
  275. package/package.json +2 -1
  276. package/dist/web-components/Button-Cx6VE_UW.mjs +0 -1
  277. package/dist/web-components/CanvasView-DxZASM9E.mjs +0 -2
  278. package/dist/web-components/ChaptersMenu-BAZVVDrK.mjs +0 -1
  279. package/dist/web-components/ControlMenu-BjJsWnuZ.mjs +0 -1
  280. package/dist/web-components/ControlsFade-C-6WhSxB.mjs +0 -1
  281. package/dist/web-components/CountMenu-Dx8D_RJZ.mjs +0 -1
  282. package/dist/web-components/Cue-xuo5dgKE.mjs +0 -1
  283. package/dist/web-components/Document-BWdafeEi.mjs +0 -1
  284. package/dist/web-components/Gallery-C2PTJmvN.mjs +0 -1
  285. package/dist/web-components/ImageControls-tKVAMpaj.mjs +0 -1
  286. package/dist/web-components/LightboxView-Cuqx2H1m.mjs +0 -1
  287. package/dist/web-components/LoadedMap-DmPH-LKY.mjs +0 -1
  288. package/dist/web-components/MapView-DHJcn9gW.mjs +0 -3
  289. package/dist/web-components/Markup-Hm6bWOjm.mjs +0 -2
  290. package/dist/web-components/MediaBody-BpgNtpKZ.mjs +0 -1
  291. package/dist/web-components/PanelPart-CpUIRbxr.mjs +0 -1
  292. package/dist/web-components/Placeholder-0hE8q-SY.mjs +0 -1
  293. package/dist/web-components/Root-CU1o0wje.mjs +0 -1
  294. package/dist/web-components/Scene-CboEeptc.mjs +0 -1
  295. package/dist/web-components/SceneView-hcc78jQT.mjs +0 -1
  296. package/dist/web-components/TargetItems-CyOI9_Z4.mjs +0 -1
  297. package/dist/web-components/Timeline-B9tD3Rar.mjs +0 -1
  298. package/dist/web-components/Tip-nJSTYquc.mjs +0 -1
  299. package/dist/web-components/hooks-C4dJ5K_D.mjs +0 -1
  300. package/dist/web-components/index-DspT4wUm.mjs +0 -1
  301. package/dist/web-components/items-CWMI53aN.mjs +0 -1
  302. package/dist/web-components/label-BGjL7I4b.mjs +0 -1
  303. package/dist/web-components/logo-BFstM-0a.mjs +0 -1
  304. package/dist/web-components/masonry-0QfzOgbB.mjs +0 -1
  305. package/dist/web-components/part-D4gjnYmT.mjs +0 -1
  306. package/dist/web-components/pointer-CJELU3gI.mjs +0 -1
  307. package/dist/web-components/rendererSurface-nh6-EfuZ.mjs +0 -22
  308. package/dist/web-components/shared-DFAX0n3B.mjs +0 -1
  309. package/dist/web-components/styles-BwkYiCLC.mjs +0 -1
  310. package/dist/web-components/svg-shape-DLY3g7oq.mjs +0 -1
  311. package/dist/web-components/thumbnail-EbURh-UM.mjs +0 -1
  312. package/dist/web-components/useLazyPanelPane-Da3kJiOt.mjs +0 -1
  313. package/dist/web-components/viewer/ChaptersMenu-D6Jmujag.mjs +0 -1
  314. package/dist/web-components/viewer/ControlMenu-BsEpff6N.mjs +0 -1
  315. package/dist/web-components/viewer/ControlsFade-BowtN96W.mjs +0 -1
  316. package/dist/web-components/viewer/CountMenu-DCmA6HdK.mjs +0 -1
  317. package/dist/web-components/viewer/Cue-BjbVzrpl.mjs +0 -1
  318. package/dist/web-components/viewer/Document-4ZQd3W3o.mjs +0 -1
  319. package/dist/web-components/viewer/Gallery-F2sVj4ph.mjs +0 -1
  320. package/dist/web-components/viewer/ImageControls-C2G4x2Es.mjs +0 -1
  321. package/dist/web-components/viewer/LightboxView-DKR8dXcg.mjs +0 -1
  322. package/dist/web-components/viewer/MapView-Df0wZjCh.mjs +0 -3
  323. package/dist/web-components/viewer/MediaBody-CataNonO.mjs +0 -1
  324. package/dist/web-components/viewer/PanelPart-Cl4Sst60.mjs +0 -1
  325. package/dist/web-components/viewer/Placeholder-B1AcizHL.mjs +0 -1
  326. package/dist/web-components/viewer/TargetItems-B6Icep5k.mjs +0 -1
  327. package/dist/web-components/viewer/Transport-z_kdVisw.mjs +0 -1
  328. package/dist/web-components/viewer/annotation-name-BKj1O9lA.mjs +0 -1
  329. package/dist/web-components/viewer/styles-Bedyz7_l.mjs +0 -1
  330. package/dist/web-components/viewer/useLazyPanelPane-BhLtRixT.mjs +0 -1
  331. package/dist/web-components/viewer/viewer-nfPJPwwt.mjs +0 -29
  332. package/dist/web-components/viewer/vtt-CUn4h5JB.mjs +0 -5
  333. package/dist/web-components/viewer-DN2Mo3vc.mjs +0 -1
  334. package/dist/web-components/vtt-C5M5WPSG.mjs +0 -5
  335. package/dist/web-components/worker-CjXN0dku.mjs +0 -1
@@ -1 +1 @@
1
- import{e as b,A as I,y as L,Z as V,T as k,a0 as F,a1 as M,u as p,a2 as P,a3 as R,a4 as T,a5 as Z}from"./viewer-nfPJPwwt.mjs";function q({iiifContent:t,items:e,navigation:w,onSelect:n,request:c,header:x=true,forwardedRef:i,...g}){var O;const[a,A]=b(null),[h,m]=b(0),v=typeof t=="string"?t:t==null?void 0:t.id,l=I({iiifContent:t,request:c});l.current={iiifContent:t,request:c},L(()=>{if(e||l.current.iiifContent===void 0)return;const s=new AbortController;return V(l.current.iiifContent,{request:l.current.request,signal:s.signal}).then(o=>{s.signal.aborted||A(o)}).catch(()=>{}),()=>s.abort()},[v,e]);const r=k(()=>F(e||a),[e,a]);if(!r.length)return null;const f=!e&&(a==null?void 0:a.type)==="Manifest",d=M(a==null?void 0:a.viewingDirection),y=w??(f?"id":"homepage");if(g.layout==="pager")return p(R,{...g,forwardedRef:i,steps:P(r,h,d,(s,o)=>{n==null||n(s,o),m(r.indexOf(s))})});const u=(O=a==null?void 0:a.homepage)==null?void 0:O[0],D=u==null?void 0:u.id;return p(Z,{...g,forwardedRef:i,items:r,selected:y==="id"?h:-1,navigation:y,rtl:d==="right-to-left",request:c,showSummary:!f,heading:x&&a?{label:a.label,summary:a.summary,homepage:D,homepageLang:T(u)}:void 0,onActivate:(s,o)=>{n==null||n(s,o),m(r.indexOf(s))},followFocus:s=>m(r.indexOf(s))})}export{q as default};
1
+ import{e as b,A as I,y as L,Z as V,T as k,a0 as F,a1 as M,u as p,a2 as P,a3 as R,a4 as T,a5 as Z}from"./viewer-DqpSyvH-.mjs";function q({iiifContent:t,items:e,navigation:w,onSelect:n,request:c,header:x=true,forwardedRef:i,...g}){var O;const[a,A]=b(null),[h,m]=b(0),v=typeof t=="string"?t:t==null?void 0:t.id,l=I({iiifContent:t,request:c});l.current={iiifContent:t,request:c},L(()=>{if(e||l.current.iiifContent===void 0)return;const s=new AbortController;return V(l.current.iiifContent,{request:l.current.request,signal:s.signal}).then(o=>{s.signal.aborted||A(o)}).catch(()=>{}),()=>s.abort()},[v,e]);const r=k(()=>F(e||a),[e,a]);if(!r.length)return null;const f=!e&&(a==null?void 0:a.type)==="Manifest",d=M(a==null?void 0:a.viewingDirection),y=w??(f?"id":"homepage");if(g.layout==="pager")return p(R,{...g,forwardedRef:i,steps:P(r,h,d,(s,o)=>{n==null||n(s,o),m(r.indexOf(s))})});const u=(O=a==null?void 0:a.homepage)==null?void 0:O[0],D=u==null?void 0:u.id;return p(Z,{...g,forwardedRef:i,items:r,selected:y==="id"?h:-1,navigation:y,rtl:d==="right-to-left",request:c,showSummary:!f,heading:x&&a?{label:a.label,summary:a.summary,homepage:D,homepageLang:T(u)}:void 0,onActivate:(s,o)=>{n==null||n(s,o),m(r.indexOf(s))},followFocus:s=>m(r.indexOf(s))})}export{q as default};
@@ -1 +1 @@
1
- import{ae as c,u as e,ag as h,a9 as p,v as u,o as v}from"./viewer-nfPJPwwt.mjs";import"./styles-Bedyz7_l.mjs";function x({steps:i,sentence:t,className:r}){const{t:l,langOf:n}=c(),{position:a,total:o}=i;if(o<1)return null;const s=a+1;return e("div",{className:h("clover-steps",r),children:[e("span",{"aria-live":"polite",className:"clover-steps-position",children:[e("span",{"aria-hidden":t?"true":void 0,children:[s>0?s:"\u2013"," / ",o]}),e("span",{className:"clover-steps-room","aria-hidden":"true",hidden:true,children:[o," / ",o]}),t&&s>0&&e("span",{style:u,...p(n(t)),children:l(t,{index:s,total:o})})]}),e(d,{steps:i,step:"previous"}),e(d,{steps:i,step:"next"})]})}function d({steps:i,step:t}){const{t:r,langOf:l}=c(),n=t==="next",a=n?i.position+1<i.total:i.position>0,o=n?"commonNext":"commonPrevious";return e("button",{type:"button",className:"clover-steps-step","data-step":t,...p(l(o)),"aria-disabled":!a||void 0,tabIndex:a?void 0:-1,onClick:()=>{a&&i.step(n?1:-1)},children:[e("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 16 16",children:e("path",{d:n?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),e("span",{style:u,children:r(o)}),e(v,{label:r(o)})]})}export{x as S};
1
+ import{ae as c,u as e,ag as h,a9 as p,v as u,o as v}from"./viewer-DqpSyvH-.mjs";import"./styles-L1HpSoL2.mjs";function x({steps:i,sentence:t,className:r}){const{t:l,langOf:n}=c(),{position:a,total:o}=i;if(o<1)return null;const s=a+1;return e("div",{className:h("clover-steps",r),children:[e("span",{"aria-live":"polite",className:"clover-steps-position",children:[e("span",{"aria-hidden":t?"true":void 0,children:[s>0?s:"\u2013"," / ",o]}),e("span",{className:"clover-steps-room","aria-hidden":"true",hidden:true,children:[o," / ",o]}),t&&s>0&&e("span",{style:u,...p(n(t)),children:l(t,{index:s,total:o})})]}),e(d,{steps:i,step:"previous"}),e(d,{steps:i,step:"next"})]})}function d({steps:i,step:t}){const{t:r,langOf:l}=c(),n=t==="next",a=n?i.position+1<i.total:i.position>0,o=n?"commonNext":"commonPrevious";return e("button",{type:"button",className:"clover-steps-step","data-step":t,...p(l(o)),"aria-disabled":!a||void 0,tabIndex:a?void 0:-1,onClick:()=>{a&&i.step(n?1:-1)},children:[e("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 16 16",children:e("path",{d:n?"M6 3l5 5-5 5":"M10 3L5 8l5 5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),e("span",{style:u,children:r(o)}),e(v,{label:r(o)})]})}export{x as S};
@@ -0,0 +1 @@
1
+ import{a as g,u as d,a2 as h,a3 as x,a5 as y,K as u,a6 as p,a7 as f,a8 as b,a9 as w,T as v,e as M,y as C,aa as S}from"./viewer-DqpSyvH-.mjs";import{C as N}from"./CountMenu-Dn0-z5A9.mjs";import{f as P,r as q}from"./fetchManifest-gAj8phm4.mjs";import{S as A}from"./Steps-B3MrG4Cv.mjs";import"./styles-L1HpSoL2.mjs";function I({onSelect:s,forwardedRef:t,...i}){const{clover:l,language:n}=g("Items"),{items:a,position:e}=K(),r=(o,c)=>{s==null||s(o,c);const m=a.findIndex(T=>T.id===o.id);m>=0&&l.goToTarget(m)};return i.layout==="pager"?d(x,{...i,forwardedRef:t,steps:h(a,e,"left-to-right",r),nameKey:"informationPanelTabsTargets",position:d(N,{position:e,total:a.length,list:o=>d(I,{layout:"list",forwardedRef:null,onSelect:o})})}):d(y,{...i,forwardedRef:t,items:a,selected:e,navigation:"id",language:n,request:l.request,showSummary:true,onActivate:r})}function K(){const{language:s}=g("Items"),t=u(e=>e.targets),i=u(e=>e.manifest),l=u(e=>p(e.targets,e.targetIndex,e.manifest,e.canvasId)),n=z(t==null?void 0:t.items,i);return{items:v(()=>((t==null?void 0:t.items)??[]).map(e=>B(e,n.get(e.manifestId)??(e.manifestAs?n.get(e.manifestAs):void 0),s)),[t,n,s]),position:l}}function z(s,t){const{clover:i}=g("Items"),l=v(()=>[...new Set((s??[]).map(e=>e.manifestId))],[s]),[n,a]=M(new Map);return C(()=>{let e=true;return Promise.all(l.map(async r=>[r,await P(i,r)])).then(r=>{e&&a(new Map(r.filter(o=>!!o[1])))}),()=>{e=false}},[i,l]),v(()=>{const e=new Map(n);return t&&e.set(t.id,t),e},[n,t])}function B(s,t,i){const l=t?S(t).canvases:[],n=l.find(m=>m.id===s.canvasId)??l[0],a=t==null?void 0:t.label,e=n==null?void 0:n.label,r=f(e,i).text?e:a,o=a&&r!==a&&f(a,i).text!==f(r,i).text?a:void 0,c=n&&s.region?q(n,s.region):void 0;return{id:s.id,label:r,summary:o,parts:[{id:s.id,type:"Canvas",label:r,resource:n??{id:s.canvasId??s.manifestId},...c?{source:c}:{}}]}}function k({headingLevel:s=3}){const{clover:t,language:i}=g("Items"),l=u(o=>{var c;return(c=o.targets)==null?void 0:c.label}),n=u(o=>{var c;return((c=o.targets)==null?void 0:c.items.length)??0}),a=u(o=>p(o.targets,o.targetIndex,o.manifest,o.canvasId));if(n<2)return null;const e=f(l,i),r=b(s);return d("div",{className:"clover-about clover-collection clover-targets",children:[d("div",{className:"clover-targets-head",children:[e.text&&d(r,{className:"clover-collection-title clover-title",...w(e.lang),children:e.text}),d(A,{className:"clover-targets-steps",steps:{position:a,total:n,step:o=>{const c=a+o;c>=0&&c<n&&t.goToTarget(c)}}})]}),d(I,{layout:"list",forwardedRef:null})]})}export{k as TargetsSection,I as default,K as useTargetItems};
@@ -1 +1 @@
1
- import{ai as Le,ae as Oe,a as Ie,K as $e,bb as Me,bc as ie,bd as le,T as ue,e as C,be as Re,y as v,bf as Se,C as we,A as L,f as Ae,bg as Ee,af as Pe,u as n,a7 as ze,k as de,a9 as M,v as Fe,o as Ke,$ as Ve,ag as He,b7 as qe}from"./viewer-nfPJPwwt.mjs";import{l as De,a as Ue,p as Xe,b as je,c as Be}from"./vtt-CUn4h5JB.mjs";import{b as pe,s as Ge}from"../bringIntoView-CQH5ZgMM.mjs";import{C as Je}from"./Cue-BjbVzrpl.mjs";import{F as Qe}from"./FieldPill-Hse1cDBE.mjs";import{l as We}from"../languageCode-cCpiU0b0.mjs";import"./styles-Bedyz7_l.mjs";const q=40,D=s=>s.toLocaleLowerCase();function Ye(s,i){if(!i)return s;const m=D(s),f=[];let a=0;for(let p=m.indexOf(i);p>=0;p=m.indexOf(i,p+i.length))p>a&&f.push(s.slice(a,p)),f.push(n("mark",{children:s.slice(p,p+i.length)},p)),a=p+i.length;return a<s.length&&f.push(s.slice(a)),f}const R=s=>s.read==="cues"&&s.kind!=="transcript",ot=Le(function({as:i="div",follow:m=true,find:f=true,sticky:a=false,size:p="large",className:ge,...fe},ve){const{t:U,langOf:X}=Oe(),{clover:o,language:j}=Ie("Transcript"),T=$e(e=>Me(e.manifest,e.canvasId)).find(e=>ie(e).length>0||le(e).length>0),l=ue(()=>T?[...ie(T).map(e=>({...e,read:"cues"})),...le(T).map(e=>({...e,read:"text"}))]:[],[T]),[B,S]=C(0),u=l[B]??l[0],O=Re(),w=(O==null?void 0:O.chosen)??j;v(()=>{if(!w)return;const e=l.findIndex(r=>r.language&&r.language!=="none"&&Se(r.language,w));if(e<0)return;S(e);const t=l[e];R(t)&&o.captions.get()!==t.id&&o.captions.emit(t.id)},[w,l,o]),v(()=>{const e=t=>{const r=l.findIndex(d=>R(d)&&d.id===t);r>=0&&S(r)};return e(o.captions.get()),o.captions.subscribe(e)},[o,l]);const[c,G]=C([]),[me,J]=C([]);v(()=>{if(G([]),J([]),!u)return;let e=true;return(u.read==="cues"?De(u.id,o.request).then(t=>e&&G(Xe(t))):Ue(u.id,o.request).then(t=>e&&J(je(t)))).catch(()=>{}),()=>{e=false}},[u,o]);const h=we(o.media.subscribe,o.media.get,o.media.get),N=Ze(h,c),A=L(null);v(()=>{var t;if(!m||N<0||!h||h.paused)return;const e=(t=A.current)==null?void 0:t.children[N];e&&pe(e,"nearest")},[N,m,h]);const[Q,W]=C(""),g=D(Q.trim()),b=ue(()=>g?c.flatMap((e,t)=>D(e.text).includes(g)?[t]:[]):[],[c,g]),[E,he]=C({query:"",at:0}),x=E.query===g?E.at:0,P=L(null),z=L(false),[Y,be]=C({cues:[],count:q}),Z=Y.cues===c?Y.count:q,F=()=>be({cues:c,count:Z+q}),_=L(F);_.current=F;const K=typeof IntersectionObserver<"u",y=K?Math.min(c.length,Math.max(Z,N+1,(b[x]??-1)+1)):c.length,ee=L(null);v(()=>{const e=ee.current;if(!e||!K||y>=c.length)return;const t=new IntersectionObserver(r=>{r.some(d=>d.isIntersecting)&&_.current()},{root:Ge(e),rootMargin:"0px 0px 400px 0px"});return t.observe(e),()=>t.disconnect()},[K,y,c.length]);const I=b[x];v(()=>{var t;if(I===void 0)return;const e=(t=A.current)==null?void 0:t.children[I];e&&pe(e,"nearest"),z.current=false},[I,g]);const Ce=c.length>0;v(()=>{var d;const e=(d=P.current)==null?void 0:d.closest(".clover-transcript-find"),t=e==null?void 0:e.parentElement;if(!a||!e||!t||typeof ResizeObserver>"u")return;const r=new ResizeObserver(()=>t.style.setProperty("--clover-transcript-find",`${e.offsetHeight}px`));return r.observe(e),()=>{r.disconnect(),t.style.removeProperty("--clover-transcript-find")}},[a,Ce,f]);const V=Ae(),te=Ee(),ne=l.every(R)?"playerCaptions":"transcriptLabel",se=Pe(U(ne),X(ne));if(!T||!u)return null;const Te=l.filter(e=>e.read==="text").length,re=l.map(e=>{const t=We(e.language);return e.read==="cues"?t:Te>1&&t?`TXT ${t}`:"TXT"}),xe=re.map(e=>e&&re.filter(t=>t===e).length===1?e:void 0),ae=u.language&&u.language!=="none"?u.language:void 0,H=l.length>1&&!O&&n(de,{children:[se.node,n("fieldset",{...se.props,className:"clover-transcript-languages",children:l.map((e,t)=>{const r=ze(e.label,j),d=xe[t],ke=r.text||e.language||String(t+1);return n("label",{className:"clover-transcript-language",children:[n("input",{type:"radio",name:`${V}-language`,checked:t===B,onChange:()=>{S(t),R(e)&&o.captions.emit(e.id)}}),d&&n(de,{children:[n("span",{className:"clover-transcript-code",children:d})," "]}),n("span",{style:d?Fe:void 0,...M(r.text?r.lang:void 0),children:ke}),d&&r.text&&n(Ke,{label:r.text,lang:r.lang})]},e.id)})})]}),ce=(e,t=true)=>{if(h){t?qe(h,e.start):h.currentTime=e.start;return}o.goTo(T.id,{time:e.start,...t&&{autoplay:true}})},oe=e=>{const t=c[b[e]];t&&(z.current=true,he({query:g,at:e}),ce(t,false))},ye={position:b.length?x:-1,total:b.length,step:e=>oe(x+e)},k=b.length,$=g?k===0?"contentSearchResultsNone":k===1?"contentSearchResult":"contentSearchResults":null,Ne=f&&u.read==="cues"&&c.length>0&&n("div",{className:"clover-transcript-find",children:[n(Qe,{ref:P,id:`${V}-find`,value:Q,onChange:W,onSubmit:()=>{if(!k)return;const e=E.query===g&&z.current;oe(e?(x+1)%k:x)},onClear:()=>{var e;W(""),(e=P.current)==null||e.focus()},results:g?ye:null,size:p,classes:{form:"clover-transcript-find-field"}}),n("p",{className:"clover-transcript-find-status",role:"status",...M($?X($):void 0),children:$?U($,{count:k}):""})]});return n(i,{ref:ve,className:He("clover-transcript",ge),"data-sticky":a||void 0,...fe,children:[H&&(te?Ve(H,te):H),Ne,u.read==="text"?n("div",{className:"clover-transcript-body",...M(ae),children:me.map((e,t)=>n("p",{children:e},t))}):n("ol",{ref:A,className:"clover-transcript-cues",id:`${V}-cues`,...M(ae),children:c.slice(0,y).map((e,t)=>n("li",{className:"clover-transcript-cue","aria-current":t===N?"true":void 0,"data-match":g&&b.includes(t)?t===I?"current":"true":void 0,children:n("button",{type:"button",onClick:()=>ce(e),onFocus:()=>{y<c.length&&t>=y-5&&F()},children:[n(Je,{start:e.start,className:"clover-transcript-time"}),n("span",{className:"clover-transcript-text clover-cue-text",children:[e.voice&&n("span",{className:"clover-transcript-voice",children:[e.voice,":"," "]}),Ye(e.text,g)]})]})},`${e.start}-${t}`))}),u.read==="cues"&&y<c.length&&n("div",{ref:ee,className:"clover-transcript-more","aria-hidden":"true"})]})});function Ze(s,i){const[m,f]=C(-1);return v(()=>{if(!s||!i.length){f(-1);return}const a=()=>f(Be(i,s.currentTime));return a(),s.addEventListener("timeupdate",a),s.addEventListener("seeked",a),()=>{s.removeEventListener("timeupdate",a),s.removeEventListener("seeked",a)}},[s,i]),m}export{ot as Transcript};
1
+ import{ai as Le,ae as Oe,a as Ie,K as $e,bb as Me,bc as ie,bd as le,T as ue,e as C,be as Re,y as v,bf as Se,C as we,A as L,f as Ae,bg as Ee,af as Pe,u as n,a7 as ze,k as de,a9 as M,v as Fe,o as Ke,$ as Ve,ag as He,b7 as qe}from"./viewer-DqpSyvH-.mjs";import{l as De,a as Ue,p as Xe,b as je,c as Be}from"./vtt-DpgB_K8v.mjs";import{b as pe,s as Ge}from"../bringIntoView-CQH5ZgMM.mjs";import{C as Je}from"./Cue-slOJQhPI.mjs";import{F as Qe}from"./FieldPill-NQfq8SXA.mjs";import{l as We}from"../languageCode-cCpiU0b0.mjs";import"./styles-L1HpSoL2.mjs";const q=40,D=s=>s.toLocaleLowerCase();function Ye(s,i){if(!i)return s;const m=D(s),f=[];let a=0;for(let p=m.indexOf(i);p>=0;p=m.indexOf(i,p+i.length))p>a&&f.push(s.slice(a,p)),f.push(n("mark",{children:s.slice(p,p+i.length)},p)),a=p+i.length;return a<s.length&&f.push(s.slice(a)),f}const R=s=>s.read==="cues"&&s.kind!=="transcript",ot=Le(function({as:i="div",follow:m=true,find:f=true,sticky:a=false,size:p="large",className:ge,...fe},ve){const{t:U,langOf:X}=Oe(),{clover:o,language:j}=Ie("Transcript"),T=$e(e=>Me(e.manifest,e.canvasId)).find(e=>ie(e).length>0||le(e).length>0),l=ue(()=>T?[...ie(T).map(e=>({...e,read:"cues"})),...le(T).map(e=>({...e,read:"text"}))]:[],[T]),[B,S]=C(0),u=l[B]??l[0],O=Re(),w=(O==null?void 0:O.chosen)??j;v(()=>{if(!w)return;const e=l.findIndex(r=>r.language&&r.language!=="none"&&Se(r.language,w));if(e<0)return;S(e);const t=l[e];R(t)&&o.captions.get()!==t.id&&o.captions.emit(t.id)},[w,l,o]),v(()=>{const e=t=>{const r=l.findIndex(d=>R(d)&&d.id===t);r>=0&&S(r)};return e(o.captions.get()),o.captions.subscribe(e)},[o,l]);const[c,G]=C([]),[me,J]=C([]);v(()=>{if(G([]),J([]),!u)return;let e=true;return(u.read==="cues"?De(u.id,o.request).then(t=>e&&G(Xe(t))):Ue(u.id,o.request).then(t=>e&&J(je(t)))).catch(()=>{}),()=>{e=false}},[u,o]);const h=we(o.media.subscribe,o.media.get,o.media.get),N=Ze(h,c),A=L(null);v(()=>{var t;if(!m||N<0||!h||h.paused)return;const e=(t=A.current)==null?void 0:t.children[N];e&&pe(e,"nearest")},[N,m,h]);const[Q,W]=C(""),g=D(Q.trim()),b=ue(()=>g?c.flatMap((e,t)=>D(e.text).includes(g)?[t]:[]):[],[c,g]),[E,he]=C({query:"",at:0}),x=E.query===g?E.at:0,P=L(null),z=L(false),[Y,be]=C({cues:[],count:q}),Z=Y.cues===c?Y.count:q,F=()=>be({cues:c,count:Z+q}),_=L(F);_.current=F;const K=typeof IntersectionObserver<"u",y=K?Math.min(c.length,Math.max(Z,N+1,(b[x]??-1)+1)):c.length,ee=L(null);v(()=>{const e=ee.current;if(!e||!K||y>=c.length)return;const t=new IntersectionObserver(r=>{r.some(d=>d.isIntersecting)&&_.current()},{root:Ge(e),rootMargin:"0px 0px 400px 0px"});return t.observe(e),()=>t.disconnect()},[K,y,c.length]);const I=b[x];v(()=>{var t;if(I===void 0)return;const e=(t=A.current)==null?void 0:t.children[I];e&&pe(e,"nearest"),z.current=false},[I,g]);const Ce=c.length>0;v(()=>{var d;const e=(d=P.current)==null?void 0:d.closest(".clover-transcript-find"),t=e==null?void 0:e.parentElement;if(!a||!e||!t||typeof ResizeObserver>"u")return;const r=new ResizeObserver(()=>t.style.setProperty("--clover-transcript-find",`${e.offsetHeight}px`));return r.observe(e),()=>{r.disconnect(),t.style.removeProperty("--clover-transcript-find")}},[a,Ce,f]);const V=Ae(),te=Ee(),ne=l.every(R)?"playerCaptions":"transcriptLabel",se=Pe(U(ne),X(ne));if(!T||!u)return null;const Te=l.filter(e=>e.read==="text").length,re=l.map(e=>{const t=We(e.language);return e.read==="cues"?t:Te>1&&t?`TXT ${t}`:"TXT"}),xe=re.map(e=>e&&re.filter(t=>t===e).length===1?e:void 0),ae=u.language&&u.language!=="none"?u.language:void 0,H=l.length>1&&!O&&n(de,{children:[se.node,n("fieldset",{...se.props,className:"clover-transcript-languages",children:l.map((e,t)=>{const r=ze(e.label,j),d=xe[t],ke=r.text||e.language||String(t+1);return n("label",{className:"clover-transcript-language",children:[n("input",{type:"radio",name:`${V}-language`,checked:t===B,onChange:()=>{S(t),R(e)&&o.captions.emit(e.id)}}),d&&n(de,{children:[n("span",{className:"clover-transcript-code",children:d})," "]}),n("span",{style:d?Fe:void 0,...M(r.text?r.lang:void 0),children:ke}),d&&r.text&&n(Ke,{label:r.text,lang:r.lang})]},e.id)})})]}),ce=(e,t=true)=>{if(h){t?qe(h,e.start):h.currentTime=e.start;return}o.goTo(T.id,{time:e.start,...t&&{autoplay:true}})},oe=e=>{const t=c[b[e]];t&&(z.current=true,he({query:g,at:e}),ce(t,false))},ye={position:b.length?x:-1,total:b.length,step:e=>oe(x+e)},k=b.length,$=g?k===0?"contentSearchResultsNone":k===1?"contentSearchResult":"contentSearchResults":null,Ne=f&&u.read==="cues"&&c.length>0&&n("div",{className:"clover-transcript-find",children:[n(Qe,{ref:P,id:`${V}-find`,value:Q,onChange:W,onSubmit:()=>{if(!k)return;const e=E.query===g&&z.current;oe(e?(x+1)%k:x)},onClear:()=>{var e;W(""),(e=P.current)==null||e.focus()},results:g?ye:null,size:p,classes:{form:"clover-transcript-find-field"}}),n("p",{className:"clover-transcript-find-status",role:"status",...M($?X($):void 0),children:$?U($,{count:k}):""})]});return n(i,{ref:ve,className:He("clover-transcript",ge),"data-sticky":a||void 0,...fe,children:[H&&(te?Ve(H,te):H),Ne,u.read==="text"?n("div",{className:"clover-transcript-body",...M(ae),children:me.map((e,t)=>n("p",{children:e},t))}):n("ol",{ref:A,className:"clover-transcript-cues",id:`${V}-cues`,...M(ae),children:c.slice(0,y).map((e,t)=>n("li",{className:"clover-transcript-cue","aria-current":t===N?"true":void 0,"data-match":g&&b.includes(t)?t===I?"current":"true":void 0,children:n("button",{type:"button",onClick:()=>ce(e),onFocus:()=>{y<c.length&&t>=y-5&&F()},children:[n(Je,{start:e.start,className:"clover-transcript-time"}),n("span",{className:"clover-transcript-text clover-cue-text",children:[e.voice&&n("span",{className:"clover-transcript-voice",children:[e.voice,":"," "]}),Ye(e.text,g)]})]})},`${e.start}-${t}`))}),u.read==="cues"&&y<c.length&&n("div",{ref:ee,className:"clover-transcript-more","aria-hidden":"true"})]})});function Ze(s,i){const[m,f]=C(-1);return v(()=>{if(!s||!i.length){f(-1);return}const a=()=>f(Be(i,s.currentTime));return a(),s.addEventListener("timeupdate",a),s.addEventListener("seeked",a),()=>{s.removeEventListener("timeupdate",a),s.removeEventListener("seeked",a)}},[s,i]),m}export{ot as Transcript};
@@ -0,0 +1 @@
1
+ import{ae as b,u as o,a9 as g,o as m,_ as x,a_ as f,a$ as k}from"./viewer-DqpSyvH-.mjs";import{a as y}from"./styles-L1HpSoL2.mjs";function z({words:r,button:e,shortcut:t,disabled:n,pressed:s,onClick:a,buttonRef:c,children:v}){const{t:i,langOf:h}=b(),d=i(r);return o("button",{"aria-label":d,...g(h(r)),"aria-keyshortcuts":t==null?void 0:t.keys,"aria-disabled":n||void 0,"aria-pressed":s,className:"clover-canvas-transport-button","data-button":e,onClick:a,ref:c,type:"button",children:[v,o(m,{label:d,shortcut:t})]})}function M(r){x(()=>{const e=r.current,t=e==null?void 0:e.closest(".clover-canvas");if(!e||!t)return;const n=()=>{const a=e.offsetHeight;a&&t.style.setProperty("--clover-transport-bar-height",`${a}px`)};n();const s=new ResizeObserver(n);return s.observe(e),()=>{s.disconnect(),t.style.removeProperty("--clover-transport-bar-height")}},[r])}const p=r=>`var(--clover-transport-thumb) / 2 + (100% - var(--clover-transport-thumb)) * ${r/100}`,T=r=>`calc(${p(r)})`,B=r=>`calc((100% - var(--clover-transport-thumb)) * ${r/100})`;function F(r){const e="var(--clover-transport-gap) / 2";return`linear-gradient(to right, ${[...r.flatMap(n=>[`#000 0 calc(${p(n)} - ${e})`,`transparent 0 calc(${p(n)} + ${e})`]),"#000 0"].join(", ")})`}function $(r,e){if(!(e>0))return[];const t=(a,c)=>Math.abs(a-c)<.05,n=[],s=a=>{a>0&&a<e&&!n.some(c=>t(c,a))&&n.push(a)};for(const a of r)s(a.start);for(const a of r)a.end!==void 0&&Number.isFinite(a.end)&&!r.some(c=>t(c.start,a.end))&&s(a.end);return n.sort((a,c)=>a-c).map(a=>a/e*100)}function H(r,e){const t=r.querySelector("input")??r,n=t.getBoundingClientRect(),s=parseFloat(getComputedStyle(t).getPropertyValue("--clover-transport-thumb"))||0,a=n.width-s;return a>0?Math.min(1,Math.max(0,(e-n.left-s/2)/a)):0}function P(r,e,t,n){const s=n.getBoundingClientRect(),a=s.height-(t.getBoundingClientRect().bottom-e.getBoundingClientRect().top);r.style.setProperty("--clover-transport-menu-above",`${a}px`),r.style.removeProperty("--clover-transport-menu-shift");const c=r.getBoundingClientRect(),v=parseFloat(getComputedStyle(t).paddingRight)||0,i=Math.max(s.left+v-c.left,Math.min(0,s.right-v-c.right));i&&r.style.setProperty("--clover-transport-menu-shift",`${i}px`)}const l={xmlns:"http://www.w3.org/2000/svg",width:16,height:16,viewBox:"0 0 512 512","aria-hidden":true,focusable:false},L=()=>o("svg",{...l,children:o("path",{d:"M133 440a35.37 35.37 0 01-17.5-4.67c-12-6.8-19.46-20-19.46-34.33V111c0-14.37 7.46-27.53 19.46-34.33a35.13 35.13 0 0135.77.45l247.85 148.36a36 36 0 010 61.11L151.23 435a35.5 35.5 0 01-18.23 5z"})}),I=()=>o("svg",{...l,children:o("path",{d:"M224 432h-80V80h80zm144 0h-80V80h80z"})}),S=()=>o("svg",{...l,children:[o("path",{d:"M232 416a23.88 23.88 0 01-14.2-4.68 8.27 8.27 0 01-.66-.51L125.76 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.75l91.37-74.81a8.27 8.27 0 01.66-.51A24 24 0 01256 120v272a24 24 0 01-24 24z"}),o("path",{d:"M320 336a16 16 0 01-14.29-23.16c8.34-16.63 12.29-34.5 12.29-56.84s-3.95-40.21-12.29-56.84a16 16 0 0128.58-14.32C345.06 205.86 350 228.13 350 256s-4.94 50.14-15.71 71.16A16 16 0 01320 336zM368 384a16 16 0 01-13.87-24C373.85 325.75 384 292.28 384 256c0-36.28-10.15-69.75-29.87-104a16 16 0 0127.74-16C404.19 174.71 416 214.17 416 256s-11.81 81.29-34.13 120A16 16 0 01368 384z",fillOpacity:"0.85"})]}),V=()=>o("svg",{...l,children:[o("path",{d:"M232 416a23.88 23.88 0 01-14.2-4.68 8.27 8.27 0 01-.66-.51L125.76 336H56a24 24 0 01-24-24V200a24 24 0 0124-24h69.75l91.37-74.81a8.27 8.27 0 01.66-.51A24 24 0 01256 120v272a24 24 0 01-24 24z"}),o("path",{d:"M320 196l128 120M448 196L320 316",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"32"})]}),q=({on:r=false})=>o("svg",{...l,"data-on":r||void 0,className:"clover-captions-icon",children:[r?o("rect",{x:"22",y:"86",width:"468",height:"340",rx:"74",fill:"currentColor"}):o("rect",{x:"40",y:"104",width:"432",height:"304",rx:"56",fill:"none",stroke:"currentColor",strokeWidth:"36"}),o("path",{className:"clover-captions-icon-letters",d:"M228 216a48 48 0 1 0 0 80M356 216a48 48 0 1 0 0 80",fill:"none",stroke:r?"var(--clover-color-control, #1a1d1e)":"currentColor",strokeLinecap:"round",strokeWidth:"36"})]}),u=()=>o("rect",{x:"40",y:"104",width:"432",height:"304",rx:"56",fill:"none",stroke:"currentColor",strokeWidth:"36"}),R=()=>o("svg",{...l,children:[o(u,{}),o("path",{d:"M204 208l-48 48 48 48M308 208l48 48-48 48",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"36"})]}),j=()=>o("svg",{...l,children:[o(u,{}),o("path",{d:"M140 208l48 48-48 48M372 208l-48 48 48 48",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"36"})]}),W=()=>o("svg",{...l,children:o(k,{})}),O=()=>o("svg",{...l,children:o(f,{})});y(14,"components/Canvas/media/Transport",'@layer clover{.clover-canvas-transport{position:absolute;inset:auto 0 0;z-index:2;display:flex;flex-direction:column;padding:var(--clover-space-xl) var(--clover-canvas-controls-inset) var(--clover-canvas-controls-inset);--clover-controls-edge: 1;--clover-transport-thumb: 12px;--clover-transport-track: var(--clover-space-xs);-webkit-user-select:none;user-select:none;--clover-transport-menu-room: calc( 100cqb - var(--clover-canvas-controls-inset) - var(--clover-control) - var(--clover-space-s) - var(--clover-space-xs) )}.clover-canvas-transport:before{position:absolute;inset:0;z-index:-1;background:linear-gradient(to top,#000000c7,#0009 calc(100% - var(--clover-space-xl)),#0000);pointer-events:none;content:""}.clover-canvas-transport:has([aria-expanded=true],:focus-visible,>.clover-canvas-transport-seek-area:hover){z-index:4}.clover-canvas-transport-bar{display:flex;flex-wrap:wrap;align-items:center;gap:var(--clover-space-xs) var(--clover-space-s);min-width:0}.clover-canvas-transport-bar>*{flex-shrink:0}.clover-canvas-transport-bar>:is(:hover,:active,:focus-within){z-index:1}.clover-canvas-transport-bar>.clover-canvas-transport-status{display:flex;flex:1 1 0;align-items:center;gap:var(--clover-space-s);min-width:min-content}.clover-canvas-transport-end{display:flex;gap:var(--clover-space-s);margin-inline-start:auto}@container (max-width: 37.5rem){.clover-canvas-transport-bar:has([data-button=chapters])>.clover-canvas-transport-status{order:-1;flex-basis:100%}.clover-canvas-transport-status>.clover-canvas-transport-chapter{max-width:none}}@container (max-width: 28rem){.clover-canvas-transport-bar>.clover-canvas-transport-status{order:-1;flex-basis:100%}}.clover-canvas-transport-button svg{fill:currentColor;stroke:none}.clover-canvas-transport-button svg [stroke]{fill:none}.clover-canvas-transport-button:hover,.clover-canvas-transport-button:focus-visible{background-color:var(--clover-color-accent, #0065c3)}:where([data-high-contrast]) .clover-canvas-transport-button:is(:hover,:focus-visible){background-color:var(--clover-accent-fill)}:where([data-high-contrast]) .clover-canvas-transport-button:hover:not(:focus-visible){outline:var(--clover-accent-ring-hover);outline-offset:1px}button.clover-canvas-transport-button[aria-pressed=true]:after{content:"";position:absolute;inset-inline:var(--clover-space-s);bottom:var(--clover-space-2xs);border-bottom:2px solid;border-radius:1px}.clover-canvas-transport-button:focus-visible{outline:none;box-shadow:0 0 0 2px var(--clover-color-secondary, #fff),0 0 0 4px var(--clover-color-accent, #0065c3)}.clover-canvas-transport-seek-area{position:relative;display:flex;margin-bottom:var(--clover-space-xs);--clover-transport-gap: var(--clover-space-2xs)}.clover-canvas-transport input[type=range]{appearance:none;-webkit-appearance:none;width:100%;height:var(--clover-space-l);margin:0;background:transparent;cursor:pointer;touch-action:none}.clover-canvas-transport input.clover-canvas-transport-volume{width:var(--clover-space-2xl)}@container (max-width: 28rem){.clover-canvas-transport input.clover-canvas-transport-volume{width:var(--clover-space-xl)}.clover-canvas-transport-bar,.clover-canvas-transport-end{column-gap:var(--clover-space-xs)}}.clover-canvas-transport input[type=range]::-webkit-slider-runnable-track{height:var(--clover-transport-track);border-radius:var(--clover-radius, 3px);background:linear-gradient(to right,var(--clover-color-accent, #0065c3) var(--clover-transport-progress, 0%),rgb(255 255 255 / 90%) var(--clover-transport-progress, 0%),rgb(255 255 255 / 90%) var(--clover-transport-loaded, 0%),var(--clover-player-track, rgb(255 255 255 / 65%)) var(--clover-transport-loaded, 0%));box-shadow:var(--clover-player-track-shadow, none)}.clover-canvas-transport input[type=range]::-moz-range-track{height:var(--clover-transport-track);border-radius:var(--clover-radius, 3px);background:linear-gradient(to right,var(--clover-color-accent, #0065c3) var(--clover-transport-progress, 0%),rgb(255 255 255 / 90%) var(--clover-transport-progress, 0%),rgb(255 255 255 / 90%) var(--clover-transport-loaded, 0%),var(--clover-player-track, rgb(255 255 255 / 65%)) var(--clover-transport-loaded, 0%));box-shadow:var(--clover-player-track-shadow, none)}.clover-canvas-transport input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:var(--clover-transport-thumb);height:var(--clover-transport-thumb);margin-top:calc((var(--clover-transport-track) - var(--clover-transport-thumb)) / 2);border:none;border-radius:var(--clover-radius-pill, 2rem);background-color:var(--clover-player-text, #fff)}.clover-canvas-transport input[type=range]::-moz-range-thumb{width:var(--clover-transport-thumb);height:var(--clover-transport-thumb);border:none;border-radius:var(--clover-radius-pill, 2rem);background-color:var(--clover-player-text, #fff)}.clover-canvas-transport input[type=range]:focus-visible{outline:none}.clover-canvas-transport input[type=range]:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 2px var(--clover-color-accent, #0065c3),0 0 0 4px var(--clover-player-text, #fff),0 0 0 6px #0009}.clover-canvas-transport input[type=range]:focus-visible::-moz-range-thumb{box-shadow:0 0 0 2px var(--clover-color-accent, #0065c3),0 0 0 4px var(--clover-player-text, #fff),0 0 0 6px #0009}.clover-canvas-transport-time{display:flex;align-items:center;gap:var(--clover-space-xs);color:var(--clover-player-text, #fff);font-size:var(--clover-text-s);font-variant-numeric:tabular-nums;white-space:nowrap;text-shadow:0 1px 2px rgb(0 0 0 / 90%)}.clover-canvas-transport-frames{position:relative;display:flex}button.clover-canvas-transport-time{margin:0;padding:var(--clover-space-2xs) var(--clover-space-xs);border:0;border-radius:var(--clover-radius, 3px);background:none;font:inherit;font-size:var(--clover-text-s);cursor:pointer}button.clover-canvas-transport-time:is(:hover,[aria-expanded=true]){background-color:#0006}button.clover-canvas-transport-time:focus-visible{outline:2px solid var(--clover-player-text, #fff)}.clover-canvas-transport-place{display:inline-grid;justify-items:end;font-variant-numeric:tabular-nums}.clover-canvas-transport-place>*{grid-area:1 / 1}.clover-canvas-transport-place>.clover-canvas-transport-place-room[hidden]{display:block;visibility:hidden}.clover-canvas-transport-frames>.clover-canvas-menu{right:0;bottom:calc(100% + var(--clover-space-s));left:auto;max-width:min(20rem,100cqi - 2 * var(--clover-canvas-controls-inset));max-height:min(24rem,var(--clover-transport-menu-room),var(--clover-transport-menu-above, 100cqb) - var(--clover-space-s) - var(--clover-space-xs));translate:var(--clover-transport-menu-shift, 0px) 0}.clover-canvas-transport-menu{position:relative;display:flex}.clover-canvas-transport-options{position:absolute;right:0;bottom:calc(100% + var(--clover-space-s));display:flex;flex-direction:column;box-sizing:border-box;min-width:min(11rem,100cqi - 2 * var(--clover-canvas-controls-inset));max-width:calc(100cqi - 2 * var(--clover-canvas-controls-inset));max-height:min(16rem,var(--clover-transport-menu-room),var(--clover-transport-menu-above, 100cqb) - var(--clover-space-s) - var(--clover-space-xs));translate:var(--clover-transport-menu-shift, 0px) 0;margin:0;padding:var(--clover-space-xs);border:none;border-radius:var(--clover-radius, 3px);background-color:var(--clover-player-menu-surface, #151718);color:var(--clover-player-text, #fff);overflow-y:auto}.clover-canvas-transport-option{display:flex;flex:none;align-items:center;gap:var(--clover-space-xs);min-height:var(--clover-space-l);padding:var(--clover-space-xs) var(--clover-space-s);border-radius:var(--clover-radius, 3px);font-size:var(--clover-text-s);cursor:pointer}.clover-canvas-transport-option:hover{background-color:var(--clover-player-menu-hover, #26292b)}.clover-canvas-transport-option:has(input:checked){background-color:color-mix(in srgb,var(--clover-color-accent, #0065c3) 24%,transparent);font-weight:600}.clover-canvas-transport-option:has(input:focus-visible){box-shadow:inset 0 0 0 2px var(--clover-player-text, #fff)}.clover-canvas-transport-code{flex:none;min-width:var(--clover-space-l);color:color-mix(in srgb,currentColor 72%,transparent);font-size:var(--clover-text-xs);font-weight:600;line-height:1}.clover-canvas-transport-options:has(.clover-canvas-transport-code),.clover-canvas-transport-menu:has([data-button=chapters]) .clover-canvas-transport-options{min-width:min(16rem,100cqi - 2 * var(--clover-canvas-controls-inset))}.clover-canvas-transport-option:has(>.clover-entry-thumbnail){display:grid;grid-template-columns:auto minmax(0,1fr);justify-items:start;gap:var(--clover-space-2xs) var(--clover-space-s);padding-block-end:var(--clover-space-s)}.clover-canvas-transport-options.clover-canvas-menu{border-radius:var(--clover-radius, 6px);background-color:var(--clover-color-secondary, #fff);color:var(--clover-color-primary, #1a1d1e)}.clover-canvas-menu>.clover-canvas-transport-option{align-items:baseline;gap:var(--clover-space-s);font-size:inherit}.clover-canvas-menu>.clover-canvas-transport-option:hover{background-color:var(--clover-color-secondary-muted, #e6e8eb)}@media (forced-colors: none){.clover-canvas-menu>.clover-canvas-transport-option:has(input:checked){background-color:color-mix(in srgb,var(--clover-color-accent, #0065c3) 8%,transparent)}}.clover-canvas-menu>.clover-canvas-transport-option:has(input:focus-visible){box-shadow:none;outline:2px solid var(--clover-color-accent, #0065c3);outline-offset:-2px}.clover-canvas-transport-option input{position:absolute;opacity:0;pointer-events:none}@media (forced-colors: active){.clover-canvas-transport button.clover-canvas-transport-button{border:1px solid ButtonText}.clover-canvas-transport input[type=range]{forced-color-adjust:none}.clover-canvas-transport input[type=range]::-webkit-slider-runnable-track{border:1px solid CanvasText;background:linear-gradient(to right,Highlight var(--clover-transport-progress, 0%),Canvas var(--clover-transport-progress, 0%));box-shadow:none}.clover-canvas-transport input[type=range]::-moz-range-track{border:1px solid CanvasText;background:linear-gradient(to right,Highlight var(--clover-transport-progress, 0%),Canvas var(--clover-transport-progress, 0%));box-shadow:none}.clover-canvas-transport input[type=range]::-webkit-slider-thumb,.clover-canvas-transport input[type=range]:focus-visible::-webkit-slider-thumb{background-color:CanvasText;box-shadow:0 0 0 2px Canvas}.clover-canvas-transport input[type=range]::-moz-range-thumb,.clover-canvas-transport input[type=range]:focus-visible::-moz-range-thumb{background-color:CanvasText;box-shadow:0 0 0 2px Canvas}.clover-canvas-transport input[type=range]:focus-visible{outline:2px solid CanvasText;outline-offset:2px}.clover-canvas-transport-button:focus-visible{outline:3px solid CanvasText;outline-offset:2px;box-shadow:none}.clover-canvas-transport-button:is([data-active],[aria-pressed=true]),.clover-canvas-transport-option:has(input:checked){background-color:Highlight;color:HighlightText}.clover-captions-icon[data-on] .clover-captions-icon-letters{stroke:ButtonFace}.clover-canvas-transport-button[data-active] .clover-captions-icon[data-on] .clover-captions-icon-letters{stroke:Highlight}}@media (prefers-reduced-motion: reduce){.clover-canvas-transport,.clover-canvas-transport-button,.clover-canvas-transport-button svg{transition:none}}.clover-canvas-transport-seek[data-gaps]{--clover-transport-disk: calc(var(--clover-transport-thumb) / 2 + 1px);-webkit-mask-image:radial-gradient(circle at calc(var(--clover-transport-thumb) / 2 + (100% - var(--clover-transport-thumb)) * var(--clover-transport-at, 0)) 50%,#000 var(--clover-transport-disk),transparent var(--clover-transport-disk)),var(--clover-transport-gaps);mask-image:radial-gradient(circle at calc(var(--clover-transport-thumb) / 2 + (100% - var(--clover-transport-thumb)) * var(--clover-transport-at, 0)) 50%,#000 var(--clover-transport-disk),transparent var(--clover-transport-disk)),var(--clover-transport-gaps)}.clover-canvas-transport-seek[data-gaps]:focus-visible{--clover-transport-disk: calc(var(--clover-transport-thumb) / 2 + 6px)}.clover-canvas-transport-chapter-span{position:absolute;top:50%;box-sizing:border-box;border-inline:calc(var(--clover-transport-gap) / 2) solid transparent;background-clip:padding-box;height:var(--clover-space-s);translate:0 -50%;border-radius:var(--clover-radius, 3px);background-color:var(--clover-player-text, #fff);opacity:.5;pointer-events:none}.clover-canvas-transport-seek-area>.clover-tip{left:var(--clover-transport-preview, 50%)}.clover-canvas-transport-seek-area>.clover-tip:has(>.clover-tip-image){padding:var(--clover-space-s)}.clover-canvas-transport-seek-area>.clover-tip .clover-tip-image{width:var(--clover-picture);max-height:none;margin-block-end:var(--clover-space-xs)}.clover-canvas-transport-seek-area:is(:hover,:has(>input:focus-visible)):not([data-tip-hidden])>.clover-tip{opacity:1;visibility:visible;pointer-events:auto;transition-delay:0s}@media (forced-colors: active){.clover-canvas-transport-chapter-span{background-color:Highlight;opacity:1}}.clover-canvas-transport-status>.clover-canvas-transport-chapter{flex:1 1 auto;overflow:hidden;width:0;min-width:0;max-width:16rem;color:color-mix(in srgb,var(--clover-player-text, #fff) 85%,transparent);font-size:var(--clover-text-s);text-overflow:ellipsis;white-space:nowrap;text-shadow:0 1px 2px rgb(0 0 0 / 90%)}}');export{q as C,O as E,j as F,L as P,z as T,V,F as a,T as b,I as c,S as d,R as e,W as f,$ as g,B as l,P as p,H as s,M as u};
@@ -1 +1 @@
1
- import{b4 as he,ae as ke,aF as Ne,A as T,e as M,_ as Z,T as Te,u as e,bM as B,o as pe,aN as le,a9 as S,aZ as Ce,af as we,c0 as Ee,y as Fe,ag as Pe,k as ce}from"./viewer-nfPJPwwt.mjs";import{u as Se,g as Ie,a as Oe,b as ue,l as $e,s as Be,T as A,c as Me,P as Re,V as Ve,d as xe,C as De,F as Ae,e as Ke,E as Le,f as Ue,p as qe}from"./Transport-z_kdVisw.mjs";import{u as ze,P as Ze,E as _e}from"./EntryThumbnail-B_dP3w4o.mjs";import{l as ie}from"../languageCode-cCpiU0b0.mjs";import"./styles-Bedyz7_l.mjs";const je=a=>typeof(a==null?void 0:a.thumbnail)=="string"?{src:a.thumbnail}:he(a==null?void 0:a.thumbnail);function de(a,i){var h;let b=-1;a.forEach((I,C)=>{I.start<=i&&(b=C)});const f=(h=a[b])==null?void 0:h.end;return f!==void 0&&i>=f?-1:b}let z;function Xe(){if(z===void 0){if(typeof document>"u")return true;const a=document.createElement("video");a.volume=.5,z=a.volume===.5}return z}function Ge({id:a,label:i,labelLang:b,button:f,icon:h,active:I,current:C,options:O,selected:R,onSelect:l,request:K,asMenu:$=false}){const[p,v]=M(false),d=T(null),g=T(null),V=T(null),w=T(false),E=we(i,b),k=O.some(r=>ie(r.language));Ee(p,()=>v(false));const s=()=>{var r;v(false),(r=g.current)==null||r.focus()};return Fe(()=>{if(!p)return;const r=t=>{var c,u,N;if(t instanceof KeyboardEvent){if(t.key!=="Escape")return;(c=d.current)!=null&&c.contains(document.activeElement)&&(t.preventDefault(),(u=g.current)==null||u.focus())}else if((N=d.current)!=null&&N.contains(t.target))return;v(false)};return document.addEventListener("pointerdown",r),document.addEventListener("keydown",r,true),()=>{document.removeEventListener("pointerdown",r),document.removeEventListener("keydown",r,true)}},[p]),Z(()=>{const r=V.current,t=d.current,c=t==null?void 0:t.closest(".clover-canvas-transport"),u=t==null?void 0:t.closest(".clover-canvas-media");if(!p||!r||!t||!c||!u)return;const N=()=>qe(r,t,c,u);N();const F=new ResizeObserver(N);return F.observe(u),F.observe(c),F.observe(r),()=>F.disconnect()},[p]),e("div",{className:"clover-canvas-transport-menu",ref:d,onBlur:r=>{var c;const t=r.relatedTarget;p&&t instanceof Node&&!((c=d.current)!=null&&c.contains(t))&&v(false)},children:[e("button",{"aria-controls":a,"aria-describedby":C?`${a}-current`:void 0,"aria-expanded":p,"aria-label":i,...S(b),className:"clover-canvas-transport-button","data-active":I?"":void 0,"data-button":f,onClick:()=>v(r=>!r),ref:g,type:"button",children:[h,e(pe,{label:i})]}),C&&e("span",{hidden:true,id:`${a}-current`,...S(C.lang),children:C.label}),p&&E.node,p&&e("fieldset",{...E.props,className:Pe("clover-canvas-transport-options",$&&"clover-canvas-menu"),id:a,ref:V,children:O.map((r,t)=>{const c=ie(r.language);return e("label",{className:"clover-canvas-transport-option",onPointerDown:()=>{w.current=true},children:[e("input",{checked:R===t,name:a,onChange:()=>l(t),onClick:()=>{w.current&&s()},onKeyDown:u=>{w.current=false,u.key==="Enter"&&(u.preventDefault(),l(t),s())},type:"radio"}),r.time&&e(ce,{children:[e("span",{className:"clover-cue-time",children:r.time})," "]}),k&&(c?e(ce,{children:[e("span",{className:"clover-canvas-transport-code",children:c})," "]}):e("span",{className:"clover-canvas-transport-code","aria-hidden":"true"})),e("span",{className:"clover-cue-text",...S(r.lang),children:r.label}),R===t&&e(_e,{source:r.thumbnail,request:K,large:true})]},t)})})]})}const Je=a=>a.querySelector(":scope > .clover-tip"),Qe=a=>{try{return a.matches(":focus-visible")}catch{return false}},tn=({instance:a,controller:i,kind:b,captions:f,activeCaption:h,onCaptionChange:I,fullscreen:C=false,isFullscreen:O=false,video:R,chapters:l=[],highlightedChapter:K=null,onChapterHighlight:$,request:p,fill:v})=>{var te,re;const{t:d,langOf:g}=ke(),V=Ne()||b==="video",w=T(null);Se(w);const{paused:E,currentTime:k,duration:s,buffered:r,muted:t,volume:c}=i,u=de(l,k),[N,F]=M(-1),[_,ve]=M(0),j=T(-1),X=n=>{var o;j.current!==n&&(j.current=n,F(n),$==null||$(((o=l[n])==null?void 0:o.id)??null))},[G,J]=M(false),[x,Q]=M(false),y=x?N:G?u:-1,W=(x||G)&&s>0,me=ze(je(l[y]),Ze,p),L=N>=0?N:l.findIndex(n=>n.id!==void 0&&n.id===K),Y=T(null);Z(()=>{const n=Y.current,o=n==null?void 0:n.closest(".clover-canvas"),m=n&&y>=0?Je(n):null;if(!o||!m)return;const ae="--clover-transport-preview-top",se=()=>o.style.setProperty(ae,`${o.getBoundingClientRect().bottom-m.getBoundingClientRect().top}px`);se();const oe=new ResizeObserver(se);return oe.observe(m),()=>{oe.disconnect(),o.style.removeProperty(ae)}},[y]);const D=n=>{const{start:o,end:m=s}=l[n];return{left:o/s*100,width:(m-o)/s*100}},fe=E?"playerPlay":"playerPause",H={label:d("playerCaptionsOff"),lang:g("playerCaptionsOff")},ge=t?"playerUnmute":"playerMute",ye=O?"imageExitFullScreen":"imageFullScreen",ee=s?k/s*100:0,U=Te(()=>{const n=Ie(l,s);return n.length?Oe(n):void 0},[l,s]),be=s?r/s*100:0,q=C&&V,P=T(null),ne=T(null);return Z(()=>{var m;const n=P.current;if(!n||n.isConnected)return;P.current=null;const o=document.activeElement;(!o||o===document.body)&&((m=ne.current)==null||m.focus())},[f.length,l.length,q]),e("div",{className:"clover-canvas-transport","data-kind":b,"data-testid":"clover-canvas-transport",onFocus:n=>{P.current=n.target},onBlur:n=>{const o=n.target,m=n.relatedTarget;if(m instanceof Node){n.currentTarget.contains(m)||(P.current=null);return}queueMicrotask(()=>{P.current===o&&o.isConnected&&(P.current=null)})},children:[e("div",{ref:Y,className:"clover-canvas-transport-seek-area",onPointerMove:n=>{if(!s||n.target.closest(".clover-tip"))return;const o=Be(n.currentTarget,n.clientX)*s;Q(true),ve(Math.floor(o)),X(de(l,o))},onPointerLeave:()=>{Q(false),X(-1)},style:W?{"--clover-transport-preview":ue(y>=0?D(y).left+D(y).width/2:(x?_:k)/s*100)}:void 0,children:[e("input",{"aria-label":d("playerSeek"),lang:g("playerSeek"),"aria-valuetext":`${B(k)} / ${B(s)}${u>=0?`, ${l[u].label}`:""}`,className:"clover-canvas-transport-seek",onFocus:n=>J(Qe(n.currentTarget)),onBlur:()=>J(false),max:s||0,min:0,onChange:n=>i.seek(Number(n.target.value)),step:"any","data-gaps":U?"":void 0,style:{"--clover-transport-progress":`${ee}%`,"--clover-transport-loaded":`${be}%`,...U&&{"--clover-transport-gaps":U,"--clover-transport-at":ee/100}},type:"range",value:k}),L>=0&&s>0&&e("span",{"aria-hidden":"true",className:"clover-canvas-transport-chapter-span",style:{left:ue(D(L).left),width:$e(D(L).width)}}),W&&e(pe,{lead:B(x?_:k),label:((te=l[y])==null?void 0:te.label)??"",lang:(re=l[y])==null?void 0:re.lang,image:y>=0?me:void 0},y)]}),e("div",{className:"clover-canvas-transport-bar",ref:w,children:[e(A,{words:fe,button:E?"play":"pause",shortcut:le.play,onClick:i.toggle,buttonRef:ne,children:E?e(Me,{}):e(Re,{})}),e(A,{words:ge,button:"mute",shortcut:le.mute,onClick:i.toggleMute,children:t||c===0?e(Ve,{}):e(xe,{})}),Xe()&&e("input",{"aria-label":d("playerVolume"),lang:g("playerVolume"),className:"clover-canvas-transport-volume",max:1,min:0,onChange:n=>i.setVolume(Number(n.target.value)),step:.05,style:{"--clover-transport-progress":`${(t?0:c)*100}%`},type:"range",value:t?0:c}),e("span",{className:"clover-canvas-transport-status",children:[e("span",{className:"clover-canvas-transport-time",children:[e("span",{"aria-label":d("playerCurrentTime"),...S(g("playerCurrentTime")),children:B(k)}),e("span",{"aria-hidden":"true",children:" / "}),e("span",{"aria-label":d("playerDuration"),...S(g("playerDuration")),children:B(s)})]}),u>=0&&e("span",{className:"clover-canvas-transport-chapter",...S(l[u].lang),children:l[u].label})]}),(f.length>0||q||v)&&e("div",{className:"clover-canvas-transport-end",children:[f.length>0&&e(Ge,{id:`${a}-captions`,label:d("playerCaptions"),labelLang:g("playerCaptions"),button:"captions",icon:e(De,{on:h>=0}),active:h>=0,current:f[h]??H,options:[H,...f],selected:h+1,onSelect:n=>I(n-1)}),v&&e(A,{words:v.filled?"playerFit":"playerFill",button:"fill",onClick:v.onToggle,children:v.filled?e(Ae,{}):e(Ke,{})}),q&&e(A,{words:ye,button:"fullscreen",onClick:n=>void Ce(n.currentTarget,R),children:O?e(Le,{}):e(Ue,{})})]})]})]})};export{tn as T,je as a,de as c};
1
+ import{b4 as he,ae as ke,aF as Ne,A as T,e as M,_ as z,T as Te,u as e,bX as B,o as pe,aN as le,a9 as S,aZ as Ce,af as we,bZ as Ee,y as Fe,ag as Pe,k as ce}from"./viewer-DqpSyvH-.mjs";import{u as Se,g as Ie,a as Oe,b as ue,l as $e,s as Be,T as A,P as Me,c as Re,V as Ve,d as xe,C as De,F as Ae,e as Ke,E as Le,f as Ue,p as Ze}from"./Transport-C5wkxVOF.mjs";import{u as qe,P as ze,E as Xe}from"./EntryThumbnail-CsAqKh38.mjs";import{l as ie}from"../languageCode-cCpiU0b0.mjs";import"./styles-L1HpSoL2.mjs";const _e=a=>typeof(a==null?void 0:a.thumbnail)=="string"?{src:a.thumbnail}:he(a==null?void 0:a.thumbnail);function de(a,i){var h;let y=-1;a.forEach((I,C)=>{I.start<=i&&(y=C)});const f=(h=a[y])==null?void 0:h.end;return f!==void 0&&i>=f?-1:y}let q;function je(){if(q===void 0){if(typeof document>"u")return true;const a=document.createElement("video");a.volume=.5,q=a.volume===.5}return q}function Ge({id:a,label:i,labelLang:y,button:f,icon:h,active:I,current:C,options:O,selected:R,onSelect:l,request:K,asMenu:$=false}){const[p,v]=M(false),d=T(null),g=T(null),V=T(null),w=T(false),E=we(i,y),k=O.some(r=>ie(r.language));Ee(p,()=>v(false));const s=()=>{var r;v(false),(r=g.current)==null||r.focus()};return Fe(()=>{if(!p)return;const r=t=>{var c,u,N;if(t instanceof KeyboardEvent){if(t.key!=="Escape")return;(c=d.current)!=null&&c.contains(document.activeElement)&&(t.preventDefault(),(u=g.current)==null||u.focus())}else if((N=d.current)!=null&&N.contains(t.target))return;v(false)};return document.addEventListener("pointerdown",r),document.addEventListener("keydown",r,true),()=>{document.removeEventListener("pointerdown",r),document.removeEventListener("keydown",r,true)}},[p]),z(()=>{const r=V.current,t=d.current,c=t==null?void 0:t.closest(".clover-canvas-transport"),u=t==null?void 0:t.closest(".clover-canvas-media");if(!p||!r||!t||!c||!u)return;const N=()=>Ze(r,t,c,u);N();const F=new ResizeObserver(N);return F.observe(u),F.observe(c),F.observe(r),()=>F.disconnect()},[p]),e("div",{className:"clover-canvas-transport-menu",ref:d,onBlur:r=>{var c;const t=r.relatedTarget;p&&t instanceof Node&&!((c=d.current)!=null&&c.contains(t))&&v(false)},children:[e("button",{"aria-controls":a,"aria-describedby":C?`${a}-current`:void 0,"aria-expanded":p,"aria-label":i,...S(y),className:"clover-canvas-transport-button","data-active":I?"":void 0,"data-button":f,onClick:()=>v(r=>!r),ref:g,type:"button",children:[h,e(pe,{label:i})]}),C&&e("span",{hidden:true,id:`${a}-current`,...S(C.lang),children:C.label}),p&&E.node,p&&e("fieldset",{...E.props,className:Pe("clover-canvas-transport-options",$&&"clover-canvas-menu"),id:a,ref:V,children:O.map((r,t)=>{const c=ie(r.language);return e("label",{className:"clover-canvas-transport-option",onPointerDown:()=>{w.current=true},children:[e("input",{checked:R===t,name:a,onChange:()=>l(t),onClick:()=>{w.current&&s()},onKeyDown:u=>{w.current=false,u.key==="Enter"&&(u.preventDefault(),l(t),s())},type:"radio"}),r.time&&e(ce,{children:[e("span",{className:"clover-cue-time",children:r.time})," "]}),k&&(c?e(ce,{children:[e("span",{className:"clover-canvas-transport-code",children:c})," "]}):e("span",{className:"clover-canvas-transport-code","aria-hidden":"true"})),e("span",{className:"clover-cue-text",...S(r.lang),children:r.label}),R===t&&e(Xe,{source:r.thumbnail,request:K,large:true})]},t)})})]})}const Je=a=>a.querySelector(":scope > .clover-tip"),Qe=a=>{try{return a.matches(":focus-visible")}catch{return false}},tn=({instance:a,controller:i,kind:y,captions:f,activeCaption:h,onCaptionChange:I,fullscreen:C=false,isFullscreen:O=false,video:R,chapters:l=[],highlightedChapter:K=null,onChapterHighlight:$,request:p,fill:v})=>{var te,re;const{t:d,langOf:g}=ke(),V=Ne()||y==="video",w=T(null);Se(w);const{paused:E,currentTime:k,duration:s,buffered:r,muted:t,volume:c}=i,u=de(l,k),[N,F]=M(-1),[X,ve]=M(0),_=T(-1),j=n=>{var o;_.current!==n&&(_.current=n,F(n),$==null||$(((o=l[n])==null?void 0:o.id)??null))},[G,J]=M(false),[x,Q]=M(false),b=x?N:G?u:-1,W=(x||G)&&s>0,me=qe(_e(l[b]),ze,p),L=N>=0?N:l.findIndex(n=>n.id!==void 0&&n.id===K),Y=T(null);z(()=>{const n=Y.current,o=n==null?void 0:n.closest(".clover-canvas"),m=n&&b>=0?Je(n):null;if(!o||!m)return;const ae="--clover-transport-preview-top",se=()=>o.style.setProperty(ae,`${o.getBoundingClientRect().bottom-m.getBoundingClientRect().top}px`);se();const oe=new ResizeObserver(se);return oe.observe(m),()=>{oe.disconnect(),o.style.removeProperty(ae)}},[b]);const D=n=>{const{start:o,end:m=s}=l[n];return{left:o/s*100,width:(m-o)/s*100}},fe=E?"playerPlay":"playerPause",H={label:d("playerCaptionsOff"),lang:g("playerCaptionsOff")},ge=t?"playerUnmute":"playerMute",be=O?"imageExitFullScreen":"imageFullScreen",ee=s?k/s*100:0,U=Te(()=>{const n=Ie(l,s);return n.length?Oe(n):void 0},[l,s]),ye=s?r/s*100:0,Z=C&&V,P=T(null),ne=T(null);return z(()=>{var m;const n=P.current;if(!n||n.isConnected)return;P.current=null;const o=document.activeElement;(!o||o===document.body)&&((m=ne.current)==null||m.focus())},[f.length,l.length,Z]),e("div",{className:"clover-canvas-transport","data-kind":y,"data-testid":"clover-canvas-transport",onFocus:n=>{P.current=n.target},onBlur:n=>{const o=n.target,m=n.relatedTarget;if(m instanceof Node){n.currentTarget.contains(m)||(P.current=null);return}queueMicrotask(()=>{P.current===o&&o.isConnected&&(P.current=null)})},children:[e("div",{ref:Y,className:"clover-canvas-transport-seek-area",onPointerMove:n=>{if(!s||n.target.closest(".clover-tip"))return;const o=Be(n.currentTarget,n.clientX)*s;Q(true),ve(Math.floor(o)),j(de(l,o))},onPointerLeave:()=>{Q(false),j(-1)},style:W?{"--clover-transport-preview":ue(b>=0?D(b).left+D(b).width/2:(x?X:k)/s*100)}:void 0,children:[e("input",{"aria-label":d("playerSeek"),lang:g("playerSeek"),"aria-valuetext":`${B(k)} / ${B(s)}${u>=0?`, ${l[u].label}`:""}`,className:"clover-canvas-transport-seek",onFocus:n=>J(Qe(n.currentTarget)),onBlur:()=>J(false),max:s||0,min:0,onChange:n=>i.seek(Number(n.target.value)),step:"any","data-gaps":U?"":void 0,style:{"--clover-transport-progress":`${ee}%`,"--clover-transport-loaded":`${ye}%`,...U&&{"--clover-transport-gaps":U,"--clover-transport-at":ee/100}},type:"range",value:k}),L>=0&&s>0&&e("span",{"aria-hidden":"true",className:"clover-canvas-transport-chapter-span",style:{left:ue(D(L).left),width:$e(D(L).width)}}),W&&e(pe,{lead:B(x?X:k),label:((te=l[b])==null?void 0:te.label)??"",lang:(re=l[b])==null?void 0:re.lang,image:b>=0?me:void 0},b)]}),e("div",{className:"clover-canvas-transport-bar",ref:w,children:[e(A,{words:fe,button:E?"play":"pause",shortcut:le.play,onClick:i.toggle,buttonRef:ne,children:E?e(Me,{}):e(Re,{})}),e(A,{words:ge,button:"mute",shortcut:le.mute,onClick:i.toggleMute,children:t||c===0?e(Ve,{}):e(xe,{})}),je()&&e("input",{"aria-label":d("playerVolume"),lang:g("playerVolume"),className:"clover-canvas-transport-volume",max:1,min:0,onChange:n=>i.setVolume(Number(n.target.value)),step:.05,style:{"--clover-transport-progress":`${(t?0:c)*100}%`},type:"range",value:t?0:c}),e("span",{className:"clover-canvas-transport-status",children:[e("span",{className:"clover-canvas-transport-time",children:[e("span",{"aria-label":d("playerCurrentTime"),...S(g("playerCurrentTime")),children:B(k)}),e("span",{"aria-hidden":"true",children:" / "}),e("span",{"aria-label":d("playerDuration"),...S(g("playerDuration")),children:B(s)})]}),u>=0&&e("span",{className:"clover-canvas-transport-chapter",...S(l[u].lang),children:l[u].label})]}),(f.length>0||Z||v)&&e("div",{className:"clover-canvas-transport-end",children:[f.length>0&&e(Ge,{id:`${a}-captions`,label:d("playerCaptions"),labelLang:g("playerCaptions"),button:"captions",icon:e(De,{on:h>=0}),active:h>=0,current:f[h]??H,options:[H,...f],selected:h+1,onSelect:n=>I(n-1)}),v&&e(A,{words:v.filled?"playerFit":"playerFill",button:"fill",onClick:v.onToggle,children:v.filled?e(Ae,{}):e(Ke,{})}),Z&&e(A,{words:be,button:"fullscreen",onClick:n=>void Ce(n.currentTarget,R),children:O?e(Le,{}):e(Ue,{})})]})]})]})};export{tn as T,_e as a,de as c};
@@ -1 +1 @@
1
- import{ax as l,c1 as g,bA as u,c2 as y,bB as f}from"./viewer-nfPJPwwt.mjs";const w=100;async function p(t,n,i){if(typeof t=="string")return await f(n,t,i);const e=t;return e!=null&&e.id&&e.type==="AnnotationPage"&&!e.items?await f(n,e.id,i):e}async function h(t,n,i){const e=String((t==null?void 0:t.type)??(t==null?void 0:t["@type"])??""),c=/AnnotationCollection/.test(e),o=c?[]:[t],r=new Set(c?[]:[t.id]);let a=c?t.first:t.next;for(;a&&o.length<w;){const s=typeof a=="string"?a:a.id;if(r.has(s??a))break;r.add(s??a);const d=await p(a,n,i);o.push(d),a=d.next}return o}async function b(t,{request:n,signal:i}={}){const e=[];for(const c of l(t)){const o=await p(c,n,i);for(const r of await h(o,n,i)){const a=await g(r),s=a.id??`added-${e.length}`,d=u(a,s);d.length&&e.push({id:s,label:y(a,r===o?c:void 0)??o.label,source:"added",entries:d})}}return e}export{b as loadAnnotationSets};
1
+ import{ax as l,b_ as g,bA as u,b$ as y,bB as f}from"./viewer-DqpSyvH-.mjs";const w=100;async function p(t,n,i){if(typeof t=="string")return await f(n,t,i);const e=t;return e!=null&&e.id&&e.type==="AnnotationPage"&&!e.items?await f(n,e.id,i):e}async function b(t,n,i){const e=String((t==null?void 0:t.type)??(t==null?void 0:t["@type"])??""),c=/AnnotationCollection/.test(e),o=c?[]:[t],r=new Set(c?[]:[t.id]);let a=c?t.first:t.next;for(;a&&o.length<w;){const s=typeof a=="string"?a:a.id;if(r.has(s??a))break;r.add(s??a);const d=await p(a,n,i);o.push(d),a=d.next}return o}async function A(t,{request:n,signal:i}={}){const e=[];for(const c of l(t)){const o=await p(c,n,i);for(const r of await b(o,n,i)){const a=await g(r),s=a.id??`added-${e.length}`,d=u(a,s);d.length&&e.push({id:s,label:y(a,r===o?c:void 0)??o.label,source:"added",entries:d})}}return e}export{A as loadAnnotationSets};
@@ -0,0 +1 @@
1
+ import{a7 as d,bN as u,bO as p,bP as v,bQ as T}from"./viewer-DqpSyvH-.mjs";const c=n=>n.language&&n.language!=="none"?n.language:"none";function b(n,e){const o=T([...new Set(n.map(c))],e);return n.find(r=>c(r)===o)}function w(n,e){const o=(t,a)=>t?{text:t,...a?{lang:a}:{}}:{},r=n.filter(t=>{var a;return(a=t.value)==null?void 0:a.trim()});if(!r.length){const t=n.find(i=>(i.image||i.place)&&i.label);if(!t)return{};const{text:a,lang:x}=d(t.label,e);return o(u(a).trim(),x)}const s=b(r,e),l=s.value,g=p(s.format,l),f=g==="markdown"?v(l):g==="html"?u(l):l,m=c(s);return o(f.trim(),m==="none"?void 0:m)}export{w as a,b};
@@ -1 +1 @@
1
- import{loadAnnotationSets as f}from"./annotation-collection-B7pZiLVk.mjs";import{ac as i,cj as c,bt as l}from"./viewer-nfPJPwwt.mjs";async function y(n,a){const r={id:String(n.id??""),type:/Collection/.test(String(n.type??n["@type"]))?"AnnotationCollection":"AnnotationPage",...n.label?{label:n.label}:{}},o=(await f(n,a)).map(t=>({...t,content:r})),s=o.flatMap(t=>t.entries),e=s.find(t=>a.manifestId&&i(t.annotation)===a.manifestId)??s.find(t=>i(t.annotation));if(!e)throw new c("The annotations name no Manifest");return{manifest:await l({id:i(e.annotation),type:"Manifest"},a),target:{canvasId:e.canvasId},annotationSets:o,pick:e.id}}export{y as annotationsContent};
1
+ import{loadAnnotationSets as f}from"./annotation-collection-A0PNdPhI.mjs";import{ac as i,cj as c,bt as l}from"./viewer-DqpSyvH-.mjs";async function y(n,a){const r={id:String(n.id??""),type:/Collection/.test(String(n.type??n["@type"]))?"AnnotationCollection":"AnnotationPage",...n.label?{label:n.label}:{}},o=(await f(n,a)).map(t=>({...t,content:r})),s=o.flatMap(t=>t.entries),e=s.find(t=>a.manifestId&&i(t.annotation)===a.manifestId)??s.find(t=>i(t.annotation));if(!e)throw new c("The annotations name no Manifest");return{manifest:await l({id:i(e.annotation),type:"Manifest"},a),target:{canvasId:e.canvasId},annotationSets:o,pick:e.id}}export{y as annotationsContent};
@@ -1,4 +1,4 @@
1
- import{c as ne,F as ae,i as se,M as ie}from"./Connected-DIOuI3Mv.mjs";import{aH as ce,bJ as ue}from"./viewer-nfPJPwwt.mjs";const le=["KHR_materials_unlit","KHR_materials_ior","KHR_materials_specular","KHR_mesh_quantization"],Z=1179937895,fe=1313821514,de=5130562;function me(e){const s=new DataView(e);if(s.getUint32(0,true)!==Z)throw new Error("This is not a GLB.");if(s.getUint32(4,true)!==2)throw new Error("Only glTF 2.0 is drawn.");let o,t;const n=Math.min(s.getUint32(8,true),e.byteLength);for(let a=12;a+8<=n;){const i=s.getUint32(a,true),l=s.getUint32(a+4,true),c=a+8;l===fe?o=JSON.parse(new TextDecoder().decode(new Uint8Array(e,c,i))):l===de&&(t=e.slice(c,c+i)),a=c+i}if(!o)throw new Error("The GLB has no JSON chunk.");return{json:o,bin:t}}async function z(e,s,o){const t=new URL(e,s).href,n=t.startsWith("data:")?await fetch(t):await ue(o,t);if(!n.ok)throw new Error(`${t} answered ${n.status}`);return n.arrayBuffer()}const $=new WeakMap;function ve(e,s,o){const t=(s==null?void 0:s.fetch)??globalThis.fetch,n=$.get(t)??new Map;$.set(t,n);const a=`${ce(s)} ${o??""} ${e}`;let i=n.get(a);return i||(i=he(e,s,o).finally(()=>n.delete(a)),n.set(a,i)),i}async function he(e,s,o){const t=await z(e,location.href,s),n=new DataView(t).getUint32(0,true)===Z,{json:a,bin:i}=n?me(t):{json:JSON.parse(new TextDecoder().decode(t))},l=(a.extensionsRequired??[]).filter(f=>!le.includes(f));if(l.length)throw new Error(`Clover's renderer cannot draw this model: it requires ${l.join(", ")}.`);const c=await Promise.all((a.buffers??[]).map((f,r)=>{if(f.uri!==void 0)return z(f.uri,e,s);if(r===0&&i)return i;throw new Error("A buffer of the model has no data.")})),u=await Promise.all((a.images??[]).map(async f=>{try{let r;if(f.bufferView!==void 0){const d=a.bufferViews[f.bufferView];r=new Blob([new Uint8Array(c[d.buffer],d.byteOffset??0,d.byteLength)],{type:f.mimeType})}else if(f.uri!==void 0)r=new Blob([await z(f.uri,e,s)],{type:f.mimeType});else return null;const m={premultiplyAlpha:"none",colorSpaceConversion:"none"};return await pe(await createImageBitmap(r,m),o,m)}catch{return null}}));return{json:a,buffers:c,images:u}}async function pe(e,s,o){const t=Math.max(e.width,e.height);if(!s||t<=s)return e;const n=s/t,a=await createImageBitmap(e,{...o,resizeWidth:Math.max(1,Math.floor(e.width*n)),resizeHeight:Math.max(1,Math.floor(e.height*n)),resizeQuality:"high"});return e.close(),a}const we={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ee={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},q=e=>we[e];function Te(e,s){const o=e.json.accessors[s],t=q(o.type),n=new Float32Array(o.count*t);if(o.bufferView===void 0)return n;const a=e.json.bufferViews[o.bufferView],i=Ee[o.componentType],l=a.byteStride||i*t,c=new DataView(e.buffers[a.buffer],(a.byteOffset??0)+(o.byteOffset??0)),u={5120:r=>c.getInt8(r),5121:r=>c.getUint8(r),5122:r=>c.getInt16(r,true),5123:r=>c.getUint16(r,true),5125:r=>c.getUint32(r,true),5126:r=>c.getFloat32(r,true)}[o.componentType]??(()=>0),f=o.normalized?{5120:127,5121:255,5122:32767,5123:65535}[o.componentType]:void 0;for(let r=0;r<o.count;r++)for(let m=0;m<t;m++){const d=u(r*l+m*i);n[r*t+m]=f?Math.max(d/f,-1):d}return n}const ee=()=>new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function I(e,s){const o=new Float32Array(16);for(let t=0;t<4;t++)for(let n=0;n<4;n++){let a=0;for(let i=0;i<4;i++)a+=e[i*4+n]*s[t*4+i];o[t*4+n]=a}return o}function X([e,s,o],[t,n,a,i],[l,c,u]){const f=t+t,r=n+n,m=a+a,d=t*f,M=t*r,p=t*m,w=n*r,S=n*m,y=a*m,k=i*f,L=i*r,O=i*m;return new Float32Array([(1-(w+y))*l,(M+O)*l,(p-L)*l,0,(M-O)*c,(1-(d+y))*c,(S+k)*c,0,(p+L)*u,(S-k)*u,(1-(d+w))*u,0,e,s,o,1])}const K=e=>X(e,[0,0,0,1],[1,1,1]),xe=e=>X([0,0,0],[0,0,0,1],e);function be([e,s,o]){const t=(n,a)=>{const i=a*Math.PI/180,l=Math.cos(i),c=Math.sin(i),u=ee(),[f,r]=n===0?[1,2]:n===1?[2,0]:[0,1];return u[f*4+f]=l,u[f*4+r]=c,u[r*4+f]=-c,u[r*4+r]=l,u};return I(t(2,o),I(t(1,s),t(0,e)))}function ye(e,s,o,t){const n=1/Math.tan(e/2),a=1/(o-t);return new Float32Array([n/s,0,0,0,0,n,0,0,0,0,(t+o)*a,-1,0,0,2*t*o*a,0])}function Ae(e,s){const o=c=>{const u=Math.hypot(...c)||1;return[c[0]/u,c[1]/u,c[2]/u]},t=(c,u)=>[c[1]*u[2]-c[2]*u[1],c[2]*u[0]-c[0]*u[2],c[0]*u[1]-c[1]*u[0]],n=(c,u)=>c[0]*u[0]+c[1]*u[1]+c[2]*u[2],a=o([e[0]-s[0],e[1]-s[1],e[2]-s[2]]),i=o(t([0,1,0],a)),l=t(a,i);return new Float32Array([i[0],l[0],a[0],0,i[1],l[1],a[1],0,i[2],l[2],a[2],0,-n(i,e),-n(l,e),-n(a,e),1])}function Re(e){const[s,o,t,,n,a,i,,l,c,u]=e,f=a*u-i*c,r=i*l-n*u,m=n*c-a*l,d=s*f+o*r+t*m||1;return new Float32Array([f/d,r/d,m/d,(t*c-o*u)/d,(s*u-t*l)/d,(o*l-s*c)/d,(o*i-t*a)/d,(t*n-s*i)/d,(s*a-o*n)/d])}const Me=()=>({min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]});function _e(e){for(let s=0;s<3;s++){let o=0;for(let t=0;t<3;t++)Math.abs(e[s*4+t])>1e-6&&o++;if(o>1)return false}return true}function Ne(e,s,o,t){const n=s.json.accessors[o];let a;if(_e(t)&&n.min&&n.max&&!n.normalized){const[l,c]=[n.min,n.max];a=Array.from({length:8},(u,f)=>[f&1?c[0]:l[0],f&2?c[1]:l[1],f&4?c[2]:l[2]]).flat()}else a=Te(s,o);const i=t;for(let l=0;l+2<a.length;l+=3){const c=a[l],u=a[l+1],f=a[l+2];for(let r=0;r<3;r++){const m=i[r]*c+i[4+r]*u+i[8+r]*f+i[12+r];m<e.min[r]&&(e.min[r]=m),m>e.max[r]&&(e.max[r]=m)}}return e}const C={normals:1,normalMap:2,unlit:4,mask:8},Y={POSITION:0,NORMAL:1,TEXCOORD_0:2,COLOR_0:3},J=["uBaseTexture","uMetalRoughTexture","uNormalTexture","uOcclusionTexture","uEmissiveTexture"],Se=`#version 300 es
1
+ import{c as ne,F as ae,i as se,M as ie}from"./Connected-9VGl2Xnx.mjs";import{aH as ce,bJ as ue}from"./viewer-DqpSyvH-.mjs";const le=["KHR_materials_unlit","KHR_materials_ior","KHR_materials_specular","KHR_mesh_quantization"],Z=1179937895,fe=1313821514,de=5130562;function me(e){const s=new DataView(e);if(s.getUint32(0,true)!==Z)throw new Error("This is not a GLB.");if(s.getUint32(4,true)!==2)throw new Error("Only glTF 2.0 is drawn.");let o,t;const n=Math.min(s.getUint32(8,true),e.byteLength);for(let a=12;a+8<=n;){const i=s.getUint32(a,true),l=s.getUint32(a+4,true),c=a+8;l===fe?o=JSON.parse(new TextDecoder().decode(new Uint8Array(e,c,i))):l===de&&(t=e.slice(c,c+i)),a=c+i}if(!o)throw new Error("The GLB has no JSON chunk.");return{json:o,bin:t}}async function z(e,s,o){const t=new URL(e,s).href,n=t.startsWith("data:")?await fetch(t):await ue(o,t);if(!n.ok)throw new Error(`${t} answered ${n.status}`);return n.arrayBuffer()}const $=new WeakMap;function ve(e,s,o){const t=(s==null?void 0:s.fetch)??globalThis.fetch,n=$.get(t)??new Map;$.set(t,n);const a=`${ce(s)} ${o??""} ${e}`;let i=n.get(a);return i||(i=he(e,s,o).finally(()=>n.delete(a)),n.set(a,i)),i}async function he(e,s,o){const t=await z(e,location.href,s),n=new DataView(t).getUint32(0,true)===Z,{json:a,bin:i}=n?me(t):{json:JSON.parse(new TextDecoder().decode(t))},l=(a.extensionsRequired??[]).filter(f=>!le.includes(f));if(l.length)throw new Error(`Clover's renderer cannot draw this model: it requires ${l.join(", ")}.`);const c=await Promise.all((a.buffers??[]).map((f,r)=>{if(f.uri!==void 0)return z(f.uri,e,s);if(r===0&&i)return i;throw new Error("A buffer of the model has no data.")})),u=await Promise.all((a.images??[]).map(async f=>{try{let r;if(f.bufferView!==void 0){const d=a.bufferViews[f.bufferView];r=new Blob([new Uint8Array(c[d.buffer],d.byteOffset??0,d.byteLength)],{type:f.mimeType})}else if(f.uri!==void 0)r=new Blob([await z(f.uri,e,s)],{type:f.mimeType});else return null;const m={premultiplyAlpha:"none",colorSpaceConversion:"none"};return await pe(await createImageBitmap(r,m),o,m)}catch{return null}}));return{json:a,buffers:c,images:u}}async function pe(e,s,o){const t=Math.max(e.width,e.height);if(!s||t<=s)return e;const n=s/t,a=await createImageBitmap(e,{...o,resizeWidth:Math.max(1,Math.floor(e.width*n)),resizeHeight:Math.max(1,Math.floor(e.height*n)),resizeQuality:"high"});return e.close(),a}const we={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ee={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},q=e=>we[e];function Te(e,s){const o=e.json.accessors[s],t=q(o.type),n=new Float32Array(o.count*t);if(o.bufferView===void 0)return n;const a=e.json.bufferViews[o.bufferView],i=Ee[o.componentType],l=a.byteStride||i*t,c=new DataView(e.buffers[a.buffer],(a.byteOffset??0)+(o.byteOffset??0)),u={5120:r=>c.getInt8(r),5121:r=>c.getUint8(r),5122:r=>c.getInt16(r,true),5123:r=>c.getUint16(r,true),5125:r=>c.getUint32(r,true),5126:r=>c.getFloat32(r,true)}[o.componentType]??(()=>0),f=o.normalized?{5120:127,5121:255,5122:32767,5123:65535}[o.componentType]:void 0;for(let r=0;r<o.count;r++)for(let m=0;m<t;m++){const d=u(r*l+m*i);n[r*t+m]=f?Math.max(d/f,-1):d}return n}const ee=()=>new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function I(e,s){const o=new Float32Array(16);for(let t=0;t<4;t++)for(let n=0;n<4;n++){let a=0;for(let i=0;i<4;i++)a+=e[i*4+n]*s[t*4+i];o[t*4+n]=a}return o}function X([e,s,o],[t,n,a,i],[l,c,u]){const f=t+t,r=n+n,m=a+a,d=t*f,M=t*r,p=t*m,w=n*r,S=n*m,y=a*m,k=i*f,L=i*r,O=i*m;return new Float32Array([(1-(w+y))*l,(M+O)*l,(p-L)*l,0,(M-O)*c,(1-(d+y))*c,(S+k)*c,0,(p+L)*u,(S-k)*u,(1-(d+w))*u,0,e,s,o,1])}const K=e=>X(e,[0,0,0,1],[1,1,1]),xe=e=>X([0,0,0],[0,0,0,1],e);function be([e,s,o]){const t=(n,a)=>{const i=a*Math.PI/180,l=Math.cos(i),c=Math.sin(i),u=ee(),[f,r]=n===0?[1,2]:n===1?[2,0]:[0,1];return u[f*4+f]=l,u[f*4+r]=c,u[r*4+f]=-c,u[r*4+r]=l,u};return I(t(2,o),I(t(1,s),t(0,e)))}function ye(e,s,o,t){const n=1/Math.tan(e/2),a=1/(o-t);return new Float32Array([n/s,0,0,0,0,n,0,0,0,0,(t+o)*a,-1,0,0,2*t*o*a,0])}function Ae(e,s){const o=c=>{const u=Math.hypot(...c)||1;return[c[0]/u,c[1]/u,c[2]/u]},t=(c,u)=>[c[1]*u[2]-c[2]*u[1],c[2]*u[0]-c[0]*u[2],c[0]*u[1]-c[1]*u[0]],n=(c,u)=>c[0]*u[0]+c[1]*u[1]+c[2]*u[2],a=o([e[0]-s[0],e[1]-s[1],e[2]-s[2]]),i=o(t([0,1,0],a)),l=t(a,i);return new Float32Array([i[0],l[0],a[0],0,i[1],l[1],a[1],0,i[2],l[2],a[2],0,-n(i,e),-n(l,e),-n(a,e),1])}function Re(e){const[s,o,t,,n,a,i,,l,c,u]=e,f=a*u-i*c,r=i*l-n*u,m=n*c-a*l,d=s*f+o*r+t*m||1;return new Float32Array([f/d,r/d,m/d,(t*c-o*u)/d,(s*u-t*l)/d,(o*l-s*c)/d,(o*i-t*a)/d,(t*n-s*i)/d,(s*a-o*n)/d])}const Me=()=>({min:[1/0,1/0,1/0],max:[-1/0,-1/0,-1/0]});function _e(e){for(let s=0;s<3;s++){let o=0;for(let t=0;t<3;t++)Math.abs(e[s*4+t])>1e-6&&o++;if(o>1)return false}return true}function Ne(e,s,o,t){const n=s.json.accessors[o];let a;if(_e(t)&&n.min&&n.max&&!n.normalized){const[l,c]=[n.min,n.max];a=Array.from({length:8},(u,f)=>[f&1?c[0]:l[0],f&2?c[1]:l[1],f&4?c[2]:l[2]]).flat()}else a=Te(s,o);const i=t;for(let l=0;l+2<a.length;l+=3){const c=a[l],u=a[l+1],f=a[l+2];for(let r=0;r<3;r++){const m=i[r]*c+i[4+r]*u+i[8+r]*f+i[12+r];m<e.min[r]&&(e.min[r]=m),m>e.max[r]&&(e.max[r]=m)}}return e}const C={normals:1,normalMap:2,unlit:4,mask:8},Y={POSITION:0,NORMAL:1,TEXCOORD_0:2,COLOR_0:3},J=["uBaseTexture","uMetalRoughTexture","uNormalTexture","uOcclusionTexture","uEmissiveTexture"],Se=`#version 300 es
2
2
  layout(location = 0) in vec3 aPosition;
3
3
  layout(location = 1) in vec3 aNormal;
4
4
  layout(location = 2) in vec2 aUv;
@@ -1 +1 @@
1
- import{ax as l,bs as g}from"./viewer-nfPJPwwt.mjs";function b(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e+"=".repeat((4-e.length%4)%4),o=atob(n);try{return decodeURIComponent(o)}catch{const a=Uint8Array.from(o,s=>s.charCodeAt(0));return new TextDecoder().decode(a)}}function I(t){const e=t.trim();for(const n of[()=>JSON.parse(e),()=>JSON.parse(b(e))])try{const o=n();if(o&&typeof o=="object")return o}catch{}return null}function v(t){if(!t)return;const e=Number(t.split(",")[0]);return Number.isFinite(e)?e:void 0}const u=t=>l(t==null?void 0:t.partOf).find(e=>(e==null?void 0:e.id)&&e.type==="Collection");function h(t){const e=t.type==="Annotation"?l(t.target):[t],n=e[0]?m(e[0],t):null;if(!n||e.length<2)return n;const o=typeof t.id=="string"?t.id:"content-state",a=e.flatMap((s,d)=>{var y,p,f;const i=d===0?n:m(s,t),r=(i==null?void 0:i.type)==="Manifest"?i.id:i==null?void 0:i.manifestId;return!i||!r?[]:[{id:`${o}#target-${d+1}`,manifestId:r,...((y=i.target)==null?void 0:y.canvasId)&&{canvasId:i.target.canvasId},...((p=i.target)==null?void 0:p.region)&&{region:i.target.region},...((f=i.target)==null?void 0:f.time)!==void 0&&{time:i.target.time}}]});return a.length>1?{...n,targets:{id:o,...t.label&&typeof t.label=="object"?{label:t.label}:{},items:a}}:n}function m(t,e){const n=g(t),o=typeof t=="string"?{id:n.id}:t.type==="SpecificResource"?typeof t.source=="string"?{id:t.source}:t.source??{}:t,a=o.type;if(a==="Manifest"||a==="Collection"){const c=a==="Manifest"?u(o):void 0;return c?{id:c.id,type:"Collection",manifestId:n.id}:{id:n.id,type:a}}const s=l(t.selector).find(c=>(c==null?void 0:c.type)==="PointSelector"&&c.t!=null),d={canvasId:n.id};n.rect&&(d.region=n.rect);const i=(s==null?void 0:s.t)??v(n.t);i!==void 0&&(d.time=Number(i));const r=l(o.partOf).find(c=>(c==null?void 0:c.id)&&(!c.type||c.type==="Manifest")),y=u(r),p=e.type==="Annotation"&&l(e.body).length?{id:e.id??`${n.id}#content-state`,type:"Annotation",motivation:l(e.motivation),body:e.body,target:t}:void 0,f=p?{annotation:p}:{};return y&&r?{id:y.id,type:"Collection",manifestId:r.id,target:d,...f}:r?{id:r.id,type:"Manifest",target:d,...f}:{id:n.id,type:a??"Canvas",target:d,...f}}export{I as decodeContentState,h as resolveContentState};
1
+ import{ax as l,bs as g}from"./viewer-DqpSyvH-.mjs";function b(t){const e=t.replace(/-/g,"+").replace(/_/g,"/"),n=e+"=".repeat((4-e.length%4)%4),o=atob(n);try{return decodeURIComponent(o)}catch{const a=Uint8Array.from(o,s=>s.charCodeAt(0));return new TextDecoder().decode(a)}}function I(t){const e=t.trim();for(const n of[()=>JSON.parse(e),()=>JSON.parse(b(e))])try{const o=n();if(o&&typeof o=="object")return o}catch{}return null}function v(t){if(!t)return;const e=Number(t.split(",")[0]);return Number.isFinite(e)?e:void 0}const u=t=>l(t==null?void 0:t.partOf).find(e=>(e==null?void 0:e.id)&&e.type==="Collection");function h(t){const e=t.type==="Annotation"?l(t.target):[t],n=e[0]?m(e[0],t):null;if(!n||e.length<2)return n;const o=typeof t.id=="string"?t.id:"content-state",a=e.flatMap((s,d)=>{var y,p,f;const i=d===0?n:m(s,t),r=(i==null?void 0:i.type)==="Manifest"?i.id:i==null?void 0:i.manifestId;return!i||!r?[]:[{id:`${o}#target-${d+1}`,manifestId:r,...((y=i.target)==null?void 0:y.canvasId)&&{canvasId:i.target.canvasId},...((p=i.target)==null?void 0:p.region)&&{region:i.target.region},...((f=i.target)==null?void 0:f.time)!==void 0&&{time:i.target.time}}]});return a.length>1?{...n,targets:{id:o,...t.label&&typeof t.label=="object"?{label:t.label}:{},items:a}}:n}function m(t,e){const n=g(t),o=typeof t=="string"?{id:n.id}:t.type==="SpecificResource"?typeof t.source=="string"?{id:t.source}:t.source??{}:t,a=o.type;if(a==="Manifest"||a==="Collection"){const c=a==="Manifest"?u(o):void 0;return c?{id:c.id,type:"Collection",manifestId:n.id}:{id:n.id,type:a}}const s=l(t.selector).find(c=>(c==null?void 0:c.type)==="PointSelector"&&c.t!=null),d={canvasId:n.id};n.rect&&(d.region=n.rect);const i=(s==null?void 0:s.t)??v(n.t);i!==void 0&&(d.time=Number(i));const r=l(o.partOf).find(c=>(c==null?void 0:c.id)&&(!c.type||c.type==="Manifest")),y=u(r),p=e.type==="Annotation"&&l(e.body).length?{id:e.id??`${n.id}#content-state`,type:"Annotation",motivation:l(e.motivation),body:e.body,target:t}:void 0,f=p?{annotation:p}:{};return y&&r?{id:y.id,type:"Collection",manifestId:r.id,target:d,...f}:r?{id:r.id,type:"Manifest",target:d,...f}:{id:n.id,type:a??"Canvas",target:d,...f}}export{I as decodeContentState,h as resolveContentState};
@@ -1 +1 @@
1
- import{bu as _}from"./viewer-nfPJPwwt.mjs";const k=1/3,Y=.5,P=8,z="translate 240ms cubic-bezier(0.16, 1, 0.3, 1)",D=[120,_],A="cubic-bezier(0.33, 0.67, 0.67, 1)",E=new WeakMap;function O(t,n){let o=null,i="idle",a=0,S=0,s=0,d=1,e=1,c=[];const f=()=>{var r;return[t,(r=n.current.alongside)==null?void 0:r.current]},M=r=>{if(r.pointerType==="mouse"||!r.isPrimary||!n.current.enabled)return;o=r.pointerId,i="pending",a=r.clientX,S=r.clientY,s=0,d=t.getBoundingClientRect().width||1;const p=getComputedStyle(t).direction==="rtl";e=n.current.side==="end"!==p?1:-1,c=[[r.timeStamp,0]]},$=r=>{var g,v;if(r.pointerId!==o||i==="idle"||i==="scroll")return;const p=(r.clientX-a)*e,y=r.clientY-S;if(i==="pending"){if(Math.abs(y)>P&&Math.abs(y)>Math.abs(p)){i="scroll";return}if(p<P)return;i="drag",a=r.clientX,c=[[r.timeStamp,0]];try{(g=t.setPointerCapture)==null||g.call(t,r.pointerId)}catch{}u(f(),void 0,"none")}s=Math.max(0,(r.clientX-a)*e),u(f(),`${s*e}px 0`);const h=(v=n.current.scrim)==null?void 0:v.current;h&&(h.style.transition="none",h.style.opacity=String(1-s/d)),c.push([r.timeStamp,s]),c.length>5&&c.shift(),r.preventDefault()},m=r=>{var X,C,T;if(r.pointerId!==o)return;const p=i==="drag";if(i="idle",o=null,!p)return;t.addEventListener("click",b,{capture:true,once:true}),setTimeout(()=>t.removeEventListener("click",b,true),0);const[y,h]=c[0],[g,v]=c[c.length-1],I=g>y?(v-h)/(g-y):0,l=(X=n.current.scrim)==null?void 0:X.current,L=(C=window.matchMedia)==null?void 0:C.call(window,"(prefers-reduced-motion: reduce)").matches;if(s>d*k||I>Y){const x=L?0:Math.min(D[1],Math.max(D[0],2*(d-s)/Math.max(I,.001))),w=`${x}ms ${A}`;if(l&&(l.style.transition=`opacity ${w}`,l.style.opacity="0"),n.current.exits){u(f(),`${d*e}px 0`,`translate ${w}`),setTimeout(()=>n.current.onClose(),x);return}t.style.transition="none",t.style.translate="",t.style.transform=`translateX(${s*e}px)`,t.getBoundingClientRect(),t.style.transition=`transform ${w}`,t.style.transform=`var(--clover-template-out, translateX(${e*100}%))`,u([(T=n.current.alongside)==null?void 0:T.current],`${d*e}px 0`,`translate ${w}`),E.set(t,setTimeout(()=>R(t,n),x)),n.current.onClose();return}u(f(),"",L?"none":z),l&&(l.style.transition=L?"none":"opacity 240ms ease",l.style.opacity=""),setTimeout(()=>{i==="idle"&&!E.has(t)&&u(f(),void 0,"")},240)},b=r=>{r.stopPropagation(),r.preventDefault()};return t.addEventListener("pointerdown",M),t.addEventListener("pointermove",$,{passive:false}),t.addEventListener("pointerup",m),t.addEventListener("pointercancel",m),()=>{t.removeEventListener("pointerdown",M),t.removeEventListener("pointermove",$),t.removeEventListener("pointerup",m),t.removeEventListener("pointercancel",m)}}function F(t,n){E.has(t)&&!n.current.enabled||R(t,n)}function R(t,n){var i,a;clearTimeout(E.get(t)),E.delete(t),u([t,(i=n.current.alongside)==null?void 0:i.current],"",""),t.style.transform="";const o=(a=n.current.scrim)==null?void 0:a.current;o&&(o.style.opacity="",o.style.transition="")}function u(t,n,o){for(const i of t)i&&(o!==void 0&&(i.style.transition=o),n!==void 0&&(i.style.translate=n))}export{O as attach,F as reset};
1
+ import{bu as _}from"./viewer-DqpSyvH-.mjs";const k=1/3,Y=.5,P=8,z="translate 240ms cubic-bezier(0.16, 1, 0.3, 1)",D=[120,_],A="cubic-bezier(0.33, 0.67, 0.67, 1)",E=new WeakMap;function O(t,n){let o=null,i="idle",a=0,S=0,s=0,d=1,e=1,c=[];const f=()=>{var r;return[t,(r=n.current.alongside)==null?void 0:r.current]},M=r=>{if(r.pointerType==="mouse"||!r.isPrimary||!n.current.enabled)return;o=r.pointerId,i="pending",a=r.clientX,S=r.clientY,s=0,d=t.getBoundingClientRect().width||1;const p=getComputedStyle(t).direction==="rtl";e=n.current.side==="end"!==p?1:-1,c=[[r.timeStamp,0]]},$=r=>{var g,v;if(r.pointerId!==o||i==="idle"||i==="scroll")return;const p=(r.clientX-a)*e,y=r.clientY-S;if(i==="pending"){if(Math.abs(y)>P&&Math.abs(y)>Math.abs(p)){i="scroll";return}if(p<P)return;i="drag",a=r.clientX,c=[[r.timeStamp,0]];try{(g=t.setPointerCapture)==null||g.call(t,r.pointerId)}catch{}u(f(),void 0,"none")}s=Math.max(0,(r.clientX-a)*e),u(f(),`${s*e}px 0`);const h=(v=n.current.scrim)==null?void 0:v.current;h&&(h.style.transition="none",h.style.opacity=String(1-s/d)),c.push([r.timeStamp,s]),c.length>5&&c.shift(),r.preventDefault()},m=r=>{var X,C,T;if(r.pointerId!==o)return;const p=i==="drag";if(i="idle",o=null,!p)return;t.addEventListener("click",b,{capture:true,once:true}),setTimeout(()=>t.removeEventListener("click",b,true),0);const[y,h]=c[0],[g,v]=c[c.length-1],I=g>y?(v-h)/(g-y):0,l=(X=n.current.scrim)==null?void 0:X.current,L=(C=window.matchMedia)==null?void 0:C.call(window,"(prefers-reduced-motion: reduce)").matches;if(s>d*k||I>Y){const x=L?0:Math.min(D[1],Math.max(D[0],2*(d-s)/Math.max(I,.001))),w=`${x}ms ${A}`;if(l&&(l.style.transition=`opacity ${w}`,l.style.opacity="0"),n.current.exits){u(f(),`${d*e}px 0`,`translate ${w}`),setTimeout(()=>n.current.onClose(),x);return}t.style.transition="none",t.style.translate="",t.style.transform=`translateX(${s*e}px)`,t.getBoundingClientRect(),t.style.transition=`transform ${w}`,t.style.transform=`var(--clover-template-out, translateX(${e*100}%))`,u([(T=n.current.alongside)==null?void 0:T.current],`${d*e}px 0`,`translate ${w}`),E.set(t,setTimeout(()=>R(t,n),x)),n.current.onClose();return}u(f(),"",L?"none":z),l&&(l.style.transition=L?"none":"opacity 240ms ease",l.style.opacity=""),setTimeout(()=>{i==="idle"&&!E.has(t)&&u(f(),void 0,"")},240)},b=r=>{r.stopPropagation(),r.preventDefault()};return t.addEventListener("pointerdown",M),t.addEventListener("pointermove",$,{passive:false}),t.addEventListener("pointerup",m),t.addEventListener("pointercancel",m),()=>{t.removeEventListener("pointerdown",M),t.removeEventListener("pointermove",$),t.removeEventListener("pointerup",m),t.removeEventListener("pointercancel",m)}}function F(t,n){E.has(t)&&!n.current.enabled||R(t,n)}function R(t,n){var i,a;clearTimeout(E.get(t)),E.delete(t),u([t,(i=n.current.alongside)==null?void 0:i.current],"",""),t.style.transform="";const o=(a=n.current.scrim)==null?void 0:a.current;o&&(o.style.opacity="",o.style.transition="")}function u(t,n,o){for(const i of t)i&&(o!==void 0&&(i.style.transition=o),n!==void 0&&(i.style.translate=n))}export{O as attach,F as reset};
@@ -1 +1 @@
1
- import{ax as h,av as x,br as m,bs as I,bt as q}from"./viewer-nfPJPwwt.mjs";function S(e,i,n){for(const s of h(e==null?void 0:e.items))for(const o of h(s==null?void 0:s.items)){if(!x(o))continue;const l=h(o==null?void 0:o.body).flatMap(t=>(t==null?void 0:t.type)==="Choice"?h(t.items).filter((r,f)=>n?(r==null?void 0:r.id)===n:f===0):n&&(t==null?void 0:t.id)!==n?[]:[t]);for(const t of l){if((t==null?void 0:t.type)!=="Image"||!t.width||!t.height)continue;const r=m(t.service);if(!r)continue;const f=I(h(o.target)[0]).rect??{x:0,y:0,w:e.width,h:e.height},a=(i.x-f.x)/f.w,c=(i.y-f.y)/f.h,u=Math.max(0,a),M=Math.max(0,c),g=Math.min(1,a+i.w/f.w)-u,p=Math.min(1,c+i.h/f.h)-M;if(g>0&&p>0)return{service:r,region:{x:u,y:M,width:g,height:p}}}}return null}const w=new WeakMap;function k(e,i){let n=w.get(e);n||w.set(e,n=new Map);let s=n.get(i);return s||(s=q({id:i,type:"Manifest"},{request:e.request}).catch(()=>null),n.set(i,s)),s}export{k as f,S as r};
1
+ import{ax as h,av as x,br as m,bs as I,bt as q}from"./viewer-DqpSyvH-.mjs";function S(e,i,n){for(const s of h(e==null?void 0:e.items))for(const o of h(s==null?void 0:s.items)){if(!x(o))continue;const l=h(o==null?void 0:o.body).flatMap(t=>(t==null?void 0:t.type)==="Choice"?h(t.items).filter((r,f)=>n?(r==null?void 0:r.id)===n:f===0):n&&(t==null?void 0:t.id)!==n?[]:[t]);for(const t of l){if((t==null?void 0:t.type)!=="Image"||!t.width||!t.height)continue;const r=m(t.service);if(!r)continue;const f=I(h(o.target)[0]).rect??{x:0,y:0,w:e.width,h:e.height},a=(i.x-f.x)/f.w,c=(i.y-f.y)/f.h,u=Math.max(0,a),M=Math.max(0,c),g=Math.min(1,a+i.w/f.w)-u,p=Math.min(1,c+i.h/f.h)-M;if(g>0&&p>0)return{service:r,region:{x:u,y:M,width:g,height:p}}}}return null}const w=new WeakMap;function k(e,i){let n=w.get(e);n||w.set(e,n=new Map);let s=n.get(i);return s||(s=q({id:i,type:"Manifest"},{request:e.request}).catch(()=>null),n.set(i,s)),s}export{k as f,S as r};
@@ -1 +1 @@
1
- var R=Object.defineProperty;var k=(s,t,e)=>t in s?R(s,t,{enumerable:true,configurable:true,writable:true,value:e}):s[t]=e;var l=(s,t,e)=>k(s,typeof t!="symbol"?t+"":t,e);import{b as x,n as E,u as r,M as p,k as O,q as M,C as m,I as g,$ as C,x as D}from"./viewer-nfPJPwwt.mjs";import"./styles-Bedyz7_l.mjs";function N(s){return{render:function(t){E(t,s)},unmount:function(){x(s)}}}const $="clover-root",b=Symbol("roots"),A=[];class F{constructor(t){l(this,"entries",new Map);l(this,"lists",new Map);l(this,"listeners",new Map);l(this,"languages",new I(t2=>this.entries.has(t2)));this.count=t}list(t){return this.lists.get(t)??A}subscribe(t,e){let n=this.listeners.get(t);return n||this.listeners.set(t,n=new Set),n.add(e),()=>{n.delete(e)}}connect(t){var i;const e=t.kind==="part"?((i=t.element.parentElement)==null?void 0:i.closest($))??null:null,n=this.entries.get(t.element);if(n&&n.root===e)return;const o={hosted:t,key:(n==null?void 0:n.key)??++this.count.made,root:e};this.entries.set(t.element,o),n&&this.change(h(n),a=>a.filter(c=>c!==n)),this.change(h(o),a=>[...a,o]),t.needsRoot&&!e&&console.warn(`<${t.element.localName}> shows a <clover-root>'s state: put it inside one.`),t.kind!=="root"&&this.languages.draws(t.element.localName),(t.kind!=="part"||!e)&&this.languages.watch(t.element)}disconnect(t){const e=this.entries.get(t);e&&(this.entries.delete(t),this.change(h(e),n=>n.filter(o=>o!==e)))}change(t,e){var n;this.lists.set(t,e(this.list(t))),(n=this.listeners.get(t))==null||n.forEach(o=>o())}}const h=s=>s.hosted.kind==="root"?b:s.root;class I{constructor(t){l(this,"observer",null);l(this,"tags",new Set);this.isElement=t}draws(t){this.tags.add(t)}watch(t){this.observer??(this.observer=new MutationObserver(e=>{const n=[...this.tags,".clover-announcer"].join(",");for(const{target:o}of e){const i=o;i.getAttribute("lang")!==""||this.isElement(i)||i.closest(n)&&i.removeAttribute("lang")}})),this.observer.observe(t,{subtree:true,attributes:true,attributeFilter:["lang"]})}}function d(s,t){const e=M(o=>s.subscribe(t,o),[s,t]);return m(e,()=>s.list(t))}function w(s){return m(s.subscribe,s.getProps,s.getProps)}function L({registry:s}){const t=d(s,b),e=d(s,null);return r(O,{children:[t.map(n=>r(W,{entry:n,registry:s},n.key)),e.map(n=>r(S,{entry:n},n.key))]})}const v=s=>`clover-${s.key}-`,W=p(function({entry:t,registry:e}){const{hosted:n}=t,o=d(e,n.element),i=w(n),a=n.Component;return r(P,{hosted:n,props:i,children:r(g.Provider,{value:v(t),children:r(a,{hosted:n,props:i,children:o.map(c=>r(S,{entry:c},c.key))})})})}),S=p(function({entry:t}){const{hosted:e}=t,n=w(e);if(e.needsRoot&&!t.root)return null;const o=e.Component;return C(r(P,{hosted:e,props:n,children:r(g.Provider,{value:v(t),children:r(o,{hosted:e,props:n})})}),e.element)});class P extends D{constructor(){super(...arguments);l(this,"state",{failed:false})}static getDerivedStateFromError(){return{failed:true}}componentDidCatch(e,n){console.error(`<${this.props.hosted.element.localName}>:`,e)}componentDidUpdate(e){this.state.failed&&e.props!==this.props.props&&this.setState({failed:false})}render(){return this.state.failed?null:this.props.children}}const f=new WeakMap,u=Symbol.for("clover.elements");function H(s){let t=f.get(s);if(!t){const e=s;e[u]&&console.warn("Clover is loaded twice on this page: load one entry."),t=new F(e[u]??(e[u]={made:0})),f.set(s,t),N(s.createElement("div")).render(r(L,{registry:t}))}return t}export{F as Registry,H as hostOf};
1
+ var R=Object.defineProperty;var k=(s,t,e)=>t in s?R(s,t,{enumerable:true,configurable:true,writable:true,value:e}):s[t]=e;var l=(s,t,e)=>k(s,typeof t!="symbol"?t+"":t,e);import{b as x,n as E,u as r,M as p,k as O,q as M,C as m,I as g,$ as C,x as D}from"./viewer-DqpSyvH-.mjs";import"./styles-L1HpSoL2.mjs";function N(s){return{render:function(t){E(t,s)},unmount:function(){x(s)}}}const $="clover-root",b=Symbol("roots"),A=[];class F{constructor(t){l(this,"entries",new Map);l(this,"lists",new Map);l(this,"listeners",new Map);l(this,"languages",new I(t2=>this.entries.has(t2)));this.count=t}list(t){return this.lists.get(t)??A}subscribe(t,e){let n=this.listeners.get(t);return n||this.listeners.set(t,n=new Set),n.add(e),()=>{n.delete(e)}}connect(t){var i;const e=t.kind==="part"?((i=t.element.parentElement)==null?void 0:i.closest($))??null:null,n=this.entries.get(t.element);if(n&&n.root===e)return;const o={hosted:t,key:(n==null?void 0:n.key)??++this.count.made,root:e};this.entries.set(t.element,o),n&&this.change(h(n),a=>a.filter(c=>c!==n)),this.change(h(o),a=>[...a,o]),t.needsRoot&&!e&&console.warn(`<${t.element.localName}> shows a <clover-root>'s state: put it inside one.`),t.kind!=="root"&&this.languages.draws(t.element.localName),(t.kind!=="part"||!e)&&this.languages.watch(t.element)}disconnect(t){const e=this.entries.get(t);e&&(this.entries.delete(t),this.change(h(e),n=>n.filter(o=>o!==e)))}change(t,e){var n;this.lists.set(t,e(this.list(t))),(n=this.listeners.get(t))==null||n.forEach(o=>o())}}const h=s=>s.hosted.kind==="root"?b:s.root;class I{constructor(t){l(this,"observer",null);l(this,"tags",new Set);this.isElement=t}draws(t){this.tags.add(t)}watch(t){this.observer??(this.observer=new MutationObserver(e=>{const n=[...this.tags,".clover-announcer"].join(",");for(const{target:o}of e){const i=o;i.getAttribute("lang")!==""||this.isElement(i)||i.closest(n)&&i.removeAttribute("lang")}})),this.observer.observe(t,{subtree:true,attributes:true,attributeFilter:["lang"]})}}function d(s,t){const e=M(o=>s.subscribe(t,o),[s,t]);return m(e,()=>s.list(t))}function w(s){return m(s.subscribe,s.getProps,s.getProps)}function L({registry:s}){const t=d(s,b),e=d(s,null);return r(O,{children:[t.map(n=>r(W,{entry:n,registry:s},n.key)),e.map(n=>r(S,{entry:n},n.key))]})}const v=s=>`clover-${s.key}-`,W=p(function({entry:t,registry:e}){const{hosted:n}=t,o=d(e,n.element),i=w(n),a=n.Component;return r(P,{hosted:n,props:i,children:r(g.Provider,{value:v(t),children:r(a,{hosted:n,props:i,children:o.map(c=>r(S,{entry:c},c.key))})})})}),S=p(function({entry:t}){const{hosted:e}=t,n=w(e);if(e.needsRoot&&!t.root)return null;const o=e.Component;return C(r(P,{hosted:e,props:n,children:r(g.Provider,{value:v(t),children:r(o,{hosted:e,props:n})})}),e.element)});class P extends D{constructor(){super(...arguments);l(this,"state",{failed:false})}static getDerivedStateFromError(){return{failed:true}}componentDidCatch(e,n){console.error(`<${this.props.hosted.element.localName}>:`,e)}componentDidUpdate(e){this.state.failed&&e.props!==this.props.props&&this.setState({failed:false})}render(){return this.state.failed?null:this.props.children}}const f=new WeakMap,u=Symbol.for("clover.elements");function H(s){let t=f.get(s);if(!t){const e=s;e[u]&&console.warn("Clover is loaded twice on this page: load one entry."),t=new F(e[u]??(e[u]={made:0})),f.set(s,t),N(s.createElement("div")).render(r(L,{registry:t}))}return t}export{F as Registry,H as hostOf};
@@ -1 +1 @@
1
- import{aa as I,ax as u,av as L,bs as $,bz as P,bA as S}from"./viewer-nfPJPwwt.mjs";function z(t){const c=new Map;for(const e of I(t).canvases)j(e,c);return[...c.values()]}function j(t,c){u(t.items).forEach((e,r)=>u(e==null?void 0:e.items).forEach((d,f)=>{if(!L(d))return;const a=$(u(d.target)[0]).rect??{x:0,y:0,w:Number(t.width)||0,h:Number(t.height)||0};u(d.body).forEach((o,y)=>{const w=(o==null?void 0:o.type)==="Choice";(w?u(o.items):[o]).forEach((s,x)=>{for(const n of u(s==null?void 0:s.annotations)){if(!Array.isArray(n==null?void 0:n.items)||typeof(s==null?void 0:s.id)!="string")continue;const l=n.id??`${s.id}#annotations`,p=w?{key:P(t.id,d.id,r,f,y),item:x,image:s.id}:void 0,A=S(n,l,t.id).map(b=>{const h=k(b.annotation,s),N=Math.round(a.x+h.x*(a.w/h.width)),E=Math.round(a.y+h.y*(a.h/h.height)),g=Math.round(h.w*(a.w/h.width)),v=Math.round(h.h*(a.h/h.height)),M=`${t.id}#xywh=${N},${E},${g},${v}`;return{...b,canvasId:t.id,target:$(M),annotation:{...b.annotation,target:M},...p?{layer:p}:{}}});if(!A.length)continue;let m=c.get(l);m||(m={id:l,label:n.label??s.label,source:"manifest",entries:[]},c.set(l,m)),m.entries.push(...A)}})})}))}function k(t,c){const e=Number(c.width)||1,r=Number(c.height)||1,d={x:0,y:0,w:e,h:r,width:e,height:r},f=u(t==null?void 0:t.target)[0],o=(typeof f=="object"?u(f==null?void 0:f.selector):[]).find(i=>(i==null?void 0:i.type)==="ImageApiSelector"),y=typeof(o==null?void 0:o.region)=="string"?o.region:void 0;if(y){const i=/^(pct:)?([\d.]+),([\d.]+),([\d.]+),([\d.]+)$/.exec(y);if(!i)return d;const[s,x,n,l]=i.slice(2).map(Number);return i[1]?{x:s/100*e,y:x/100*r,w:n/100*e,h:l/100*r,width:e,height:r}:{x:s,y:x,w:n,h:l,width:e,height:r}}const w=$(f).rect;return w?{...w,width:e,height:r}:d}export{z as imageLayers};
1
+ import{aa as I,ax as u,av as L,bs as $,bz as P,bA as S}from"./viewer-DqpSyvH-.mjs";function z(t){const c=new Map;for(const e of I(t).canvases)j(e,c);return[...c.values()]}function j(t,c){u(t.items).forEach((e,r)=>u(e==null?void 0:e.items).forEach((d,f)=>{if(!L(d))return;const a=$(u(d.target)[0]).rect??{x:0,y:0,w:Number(t.width)||0,h:Number(t.height)||0};u(d.body).forEach((o,y)=>{const w=(o==null?void 0:o.type)==="Choice";(w?u(o.items):[o]).forEach((s,x)=>{for(const n of u(s==null?void 0:s.annotations)){if(!Array.isArray(n==null?void 0:n.items)||typeof(s==null?void 0:s.id)!="string")continue;const l=n.id??`${s.id}#annotations`,p=w?{key:P(t.id,d.id,r,f,y),item:x,image:s.id}:void 0,A=S(n,l,t.id).map(b=>{const h=k(b.annotation,s),N=Math.round(a.x+h.x*(a.w/h.width)),E=Math.round(a.y+h.y*(a.h/h.height)),g=Math.round(h.w*(a.w/h.width)),v=Math.round(h.h*(a.h/h.height)),M=`${t.id}#xywh=${N},${E},${g},${v}`;return{...b,canvasId:t.id,target:$(M),annotation:{...b.annotation,target:M},...p?{layer:p}:{}}});if(!A.length)continue;let m=c.get(l);m||(m={id:l,label:n.label??s.label,source:"manifest",entries:[]},c.set(l,m)),m.entries.push(...A)}})})}))}function k(t,c){const e=Number(c.width)||1,r=Number(c.height)||1,d={x:0,y:0,w:e,h:r,width:e,height:r},f=u(t==null?void 0:t.target)[0],o=(typeof f=="object"?u(f==null?void 0:f.selector):[]).find(i=>(i==null?void 0:i.type)==="ImageApiSelector"),y=typeof(o==null?void 0:o.region)=="string"?o.region:void 0;if(y){const i=/^(pct:)?([\d.]+),([\d.]+),([\d.]+),([\d.]+)$/.exec(y);if(!i)return d;const[s,x,n,l]=i.slice(2).map(Number);return i[1]?{x:s/100*e,y:x/100*r,w:n/100*e,h:l/100*r,width:e,height:r}:{x:s,y:x,w:n,h:l,width:e,height:r}}const w=$(f).rect;return w?{...w,width:e,height:r}:d}export{z as imageLayers};
@@ -1 +1 @@
1
- import{cp as e}from"./viewer-nfPJPwwt.mjs";export{e as initCloverI18n};
1
+ import{cq as e}from"./viewer-DqpSyvH-.mjs";export{e as initCloverI18n};
@@ -1 +1 @@
1
- import{ax as n,aw as p,bs as c}from"./viewer-nfPJPwwt.mjs";function g(r){if(n(r==null?void 0:r.motivation).includes("linking"))for(const i of p(r)){if((i==null?void 0:i.type)==="TextualBody"||typeof(i==null?void 0:i.value)=="string")continue;const t=(i==null?void 0:i.type)==="SpecificResource"?i.source:i,e=typeof t=="string"?t:t==null?void 0:t.id;if(!(typeof e!="string"||!e)){if((t==null?void 0:t.type)==="Canvas"){const s=n(t.partOf).find(f=>(f==null?void 0:f.id)&&(!f.type||f.type==="Manifest")),u=c(e).id;return{id:e,canvasId:u,...s?{manifestId:s.id}:{}}}if((t==null?void 0:t.type)==="Manifest"||(t==null?void 0:t.type)==="Collection")return{id:e,manifestId:e};if(/^https?:\/\//i.test(e))return{id:e}}}}function o(r){const i=n(r==null?void 0:r.motivation);if(!(!i.includes("tagging")&&!i.includes("identifying")))for(const t of p(r)){if((t==null?void 0:t.type)==="TextualBody"||typeof(t==null?void 0:t.value)=="string")continue;const e=(t==null?void 0:t.type)==="SpecificResource"?t.source:t,s=typeof e=="string"?e:e==null?void 0:e.id;if(typeof s=="string"&&/^https?:\/\//i.test(s))return{id:s}}}export{o as a,g as r};
1
+ import{ax as n,aw as p,bs as c}from"./viewer-DqpSyvH-.mjs";function g(r){if(n(r==null?void 0:r.motivation).includes("linking"))for(const i of p(r)){if((i==null?void 0:i.type)==="TextualBody"||typeof(i==null?void 0:i.value)=="string")continue;const t=(i==null?void 0:i.type)==="SpecificResource"?i.source:i,e=typeof t=="string"?t:t==null?void 0:t.id;if(!(typeof e!="string"||!e)){if((t==null?void 0:t.type)==="Canvas"){const s=n(t.partOf).find(f=>(f==null?void 0:f.id)&&(!f.type||f.type==="Manifest")),u=c(e).id;return{id:e,canvasId:u,...s?{manifestId:s.id}:{}}}if((t==null?void 0:t.type)==="Manifest"||(t==null?void 0:t.type)==="Collection")return{id:e,manifestId:e};if(/^https?:\/\//i.test(e))return{id:e}}}}function o(r){const i=n(r==null?void 0:r.motivation);if(!(!i.includes("tagging")&&!i.includes("identifying")))for(const t of p(r)){if((t==null?void 0:t.type)==="TextualBody"||typeof(t==null?void 0:t.value)=="string")continue;const e=(t==null?void 0:t.type)==="SpecificResource"?t.source:t,s=typeof e=="string"?e:e==null?void 0:e.id;if(typeof s=="string"&&/^https?:\/\//i.test(s))return{id:s}}}export{o as a,g as r};
@@ -1 +1 @@
1
- import{br as i,cn as a,co as s}from"./viewer-nfPJPwwt.mjs";async function d(r,c,n){const e=typeof r.id=="string"?r.id:void 0,t=i(r.service);if(!t)return e;try{const o=await a(t,{request:n});return s(o,c)??e}catch{return e}}export{d as overlayImageUrl};
1
+ import{br as i,co as a,cp as s}from"./viewer-DqpSyvH-.mjs";async function d(r,c,n){const e=typeof r.id=="string"?r.id:void 0,t=i(r.service);if(!t)return e;try{const o=await a(t,{request:n});return s(o,c)??e}catch{return e}}export{d as overlayImageUrl};
@@ -1 +1 @@
1
- import{ax as c,bx as l,bs as g,by as x,b8 as E}from"./viewer-nfPJPwwt.mjs";const A=t=>t&&typeof t=="object"?Object.entries(t).flatMap(([i,r])=>c(r).filter(s=>typeof s=="string").map(s=>({value:s,...i!=="none"?{language:i}:{}}))):typeof t=="string"?[{value:t}]:[],a=new WeakMap;function j(t){if(!t)return null;if(a.has(t))return a.get(t);const i=[],r=new Set,s=n=>{if(!n||r.has(n.id??n))return;r.add(n.id??n);const b=typeof n.id=="string"&&!c(n.behavior).includes("no-nav"),d=A(n.label),h=c(n.items).filter(o=>(o==null?void 0:o.type)!=="Range"&&g(x(o)).id).length;let v=0;for(const o of c(n.items)){if((o==null?void 0:o.type)==="Range"){s(o);continue}const e=g(x(o));if(!e.id)continue;const f=v++;if(!b||!e.rect)continue;const{x:w,y:T,w:I,h:S}=e.rect,u=E(n.id,f);i.push({id:u,setId:l,canvasId:e.id,target:{id:e.id,rect:e.rect},motivation:["highlighting"],bodies:d,...h>1?{place:{index:f+1,total:h}}:{},annotation:{id:u,type:"Annotation",motivation:["highlighting"],...d.length&&{body:d.map(({value:$,language:y})=>({type:"TextualBody",value:$,...y?{language:y}:{}}))},target:`${e.id}#xywh=${w},${T},${I},${S}`}})}};c(t.structures).forEach(s);const p=i.length?{id:l,source:"contents",entries:i}:null;return a.set(t,p),p}export{j as contentsSet};
1
+ import{ax as c,bx as l,bs as g,by as x,b8 as E}from"./viewer-DqpSyvH-.mjs";const A=t=>t&&typeof t=="object"?Object.entries(t).flatMap(([i,r])=>c(r).filter(s=>typeof s=="string").map(s=>({value:s,...i!=="none"?{language:i}:{}}))):typeof t=="string"?[{value:t}]:[],a=new WeakMap;function j(t){if(!t)return null;if(a.has(t))return a.get(t);const i=[],r=new Set,s=n=>{if(!n||r.has(n.id??n))return;r.add(n.id??n);const b=typeof n.id=="string"&&!c(n.behavior).includes("no-nav"),d=A(n.label),h=c(n.items).filter(o=>(o==null?void 0:o.type)!=="Range"&&g(x(o)).id).length;let v=0;for(const o of c(n.items)){if((o==null?void 0:o.type)==="Range"){s(o);continue}const e=g(x(o));if(!e.id)continue;const f=v++;if(!b||!e.rect)continue;const{x:w,y:T,w:I,h:S}=e.rect,u=E(n.id,f);i.push({id:u,setId:l,canvasId:e.id,target:{id:e.id,rect:e.rect},motivation:["highlighting"],bodies:d,...h>1?{place:{index:f+1,total:h}}:{},annotation:{id:u,type:"Annotation",motivation:["highlighting"],...d.length&&{body:d.map(({value:$,language:y})=>({type:"TextualBody",value:$,...y?{language:y}:{}}))},target:`${e.id}#xywh=${w},${T},${I},${S}`}})}};c(t.structures).forEach(s);const p=i.length?{id:l,source:"contents",entries:i}:null;return a.set(t,p),p}export{j as contentsSet};
@@ -1 +1 @@
1
- import{X as f,u as r,A as u,Y as p,_ as d,k as m}from"./viewer-nfPJPwwt.mjs";import"./styles-Bedyz7_l.mjs";const v=f(null),l=new WeakMap;function y(t){let n=l.get(t);if(!n){const{render:o}=t;n={canvasId:t.canvasId,format:t.format,match:t.match,component:c=>r(A,{...c,render:o})},l.set(t,n)}return n}function h(t){if(Array.isArray(t))return t.filter(n=>typeof n=="object"&&n!==null&&typeof n.render=="function").map(y)}function A({render:t,canvases:n,bodies:o,children:c}){const a=u(null),s=p(v);return d(()=>{const e=a.current;if(!e)return;const i=t(e,{canvases:n,bodies:o,clover:s});return()=>{typeof i=="function"&&i(),e.replaceChildren()}},[t,n,o,s]),r(m,{children:[r("div",{ref:a,className:"clover-body-renderer",style:{position:"absolute",inset:0}}),c&&r("div",{className:"clover-canvas-controls",children:c})]})}export{h as toRenderers};
1
+ import{X as f,u as r,A as u,Y as p,_ as d,k as m}from"./viewer-DqpSyvH-.mjs";import"./styles-L1HpSoL2.mjs";const v=f(null),l=new WeakMap;function y(t){let n=l.get(t);if(!n){const{render:o}=t;n={canvasId:t.canvasId,format:t.format,match:t.match,component:c=>r(A,{...c,render:o})},l.set(t,n)}return n}function h(t){if(Array.isArray(t))return t.filter(n=>typeof n=="object"&&n!==null&&typeof n.render=="function").map(y)}function A({render:t,canvases:n,bodies:o,children:c}){const a=u(null),s=p(v);return d(()=>{const e=a.current;if(!e)return;const i=t(e,{canvases:n,bodies:o,clover:s});return()=>{typeof i=="function"&&i(),e.replaceChildren()}},[t,n,o,s]),r(m,{children:[r("div",{ref:a,className:"clover-body-renderer",style:{position:"absolute",inset:0}}),c&&r("div",{className:"clover-canvas-controls",children:c})]})}export{h as toRenderers};
@@ -1 +1 @@
1
- import{bJ as a}from"./viewer-nfPJPwwt.mjs";function c(t){try{const o=new URL(t).pathname.split("/").filter(Boolean).pop();return o?decodeURIComponent(o):"download"}catch{return"download"}}async function i(t,o){try{const r=await a(o,t,{referrerPolicy:"no-referrer"});if(!r.ok)return false;const n=URL.createObjectURL(await r.blob()),e=document.createElement("a");return e.href=n,e.download=c(t),document.body.append(e),e.click(),e.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e4),true}catch{return false}}export{c as fileName,i as saveFile};
1
+ import{bJ as a}from"./viewer-DqpSyvH-.mjs";function c(t){try{const o=new URL(t).pathname.split("/").filter(Boolean).pop();return o?decodeURIComponent(o):"download"}catch{return"download"}}async function i(t,o){try{const r=await a(o,t,{referrerPolicy:"no-referrer"});if(!r.ok)return false;const n=URL.createObjectURL(await r.blob()),e=document.createElement("a");return e.href=n,e.download=c(t),document.body.append(e),e.click(),e.remove(),setTimeout(()=>URL.revokeObjectURL(n),1e4),true}catch{return false}}export{c as fileName,i as saveFile};
@@ -1 +1 @@
1
- import{bB as b,ax as f,bs as x,bC as S}from"./viewer-nfPJPwwt.mjs";const w=10;async function R(r,t,s,o,e){var n,d;const i=(n=r.get().manifest)==null?void 0:n.id;try{const{hits:c,set:u}=await A(t,s,{request:o,signal:e});if(e.aborted||((d=r.get().manifest)==null?void 0:d.id)!==i)return;r.set({search:{query:s,status:"ready",hits:c,set:u}})}catch{if(e.aborted)return;r.set({search:{query:s,status:"error",hits:[],set:null}})}}async function A(r,t,{request:s,signal:o}={}){const e=new URL(r.id);e.searchParams.set("q",t);const i=[];let n=e.toString();const d=new Set;for(;n&&i.length<w&&!d.has(n);){d.add(n);const c=await b(s,n,o);i.push(c),n=$(c)}return E(i,t)}function T(r){var e;const t=f(r)[0];if(typeof t=="string"||!t)return t;const s=t.full??t["@id"],o=(e=f(t.selector)[0])==null?void 0:e.value;return typeof o=="string"&&typeof s=="string"?`${s}#${o}`:s}function $(r){var o;const t=r.next??((o=r.within)==null?void 0:o.next),s=typeof t=="string"?t:(t==null?void 0:t.id)??(t==null?void 0:t["@id"]);return typeof s=="string"?s:null}function E(r,t){var e,i;const s=[],o=[];for(const n of r){const d=Array.isArray(n.resources),c=d?n.resources:f(n.items),u=new Map;for(const a of c){const p=a.id??a["@id"],m=d?T(a.on):f(a.target)[0],v=x(m);if(!p||!v.id)continue;const y=d?(e=a.resource)==null?void 0:e.chars:f(a.body).map(l=>l==null?void 0:l.value).find(l=>typeof l=="string"),I={id:p,setId:S,canvasId:v.id,target:v,motivation:["highlighting"],bodies:[{value:String(y??t)}],annotation:{id:p,type:"Annotation",motivation:["highlighting"],body:{type:"TextualBody",value:String(y??t)},target:m}};u.set(p,I),s.push(I)}const g=d?H(n,u):M(n,u),h=new Set(g.flatMap(a=>a.entryIds));o.push(...g);for(const a of u.values())h.has(a.id)||o.push({id:a.id,canvasId:a.canvasId,entryIds:[a.id],match:((i=a.bodies[0])==null?void 0:i.value)??t})}return{query:t,hits:o,set:{id:S,label:{none:[t]},source:"search",entries:s}}}function H(r,t){var o;const s=[];for(const e of f(r.hits)){const i=f(e.annotations).filter(n=>t.has(n));i.length&&s.push({id:i.join(" "),canvasId:t.get(i[0]).canvasId,entryIds:i,before:e.before,match:String(e.match??((o=t.get(i[0]).bodies[0])==null?void 0:o.value)??""),after:e.after})}return s}function M(r,t){var o,e;const s=[];for(const i of f(r.annotations))for(const n of f(i==null?void 0:i.items))if(f(n==null?void 0:n.motivation).includes("contextualizing"))for(const c of f(n.target)){const u=typeof(c==null?void 0:c.source)=="string"?c.source:(o=c==null?void 0:c.source)==null?void 0:o.id,g=u?t.get(u):void 0;if(!g)continue;const h=f(c.selector).find(a=>(a==null?void 0:a.type)==="TextQuoteSelector");s.push({id:`${n.id??u}#${u}`,canvasId:g.canvasId,entryIds:[g.id],before:h==null?void 0:h.prefix,match:String((h==null?void 0:h.exact)??((e=g.bodies[0])==null?void 0:e.value)??""),after:h==null?void 0:h.suffix})}return s}export{E as readResults,A as search,R as searchInto};
1
+ import{bB as b,ax as f,bs as x,bC as S}from"./viewer-DqpSyvH-.mjs";const w=10;async function R(r,t,s,o,e){var n,d;const i=(n=r.get().manifest)==null?void 0:n.id;try{const{hits:c,set:u}=await A(t,s,{request:o,signal:e});if(e.aborted||((d=r.get().manifest)==null?void 0:d.id)!==i)return;r.set({search:{query:s,status:"ready",hits:c,set:u}})}catch{if(e.aborted)return;r.set({search:{query:s,status:"error",hits:[],set:null}})}}async function A(r,t,{request:s,signal:o}={}){const e=new URL(r.id);e.searchParams.set("q",t);const i=[];let n=e.toString();const d=new Set;for(;n&&i.length<w&&!d.has(n);){d.add(n);const c=await b(s,n,o);i.push(c),n=$(c)}return E(i,t)}function T(r){var e;const t=f(r)[0];if(typeof t=="string"||!t)return t;const s=t.full??t["@id"],o=(e=f(t.selector)[0])==null?void 0:e.value;return typeof o=="string"&&typeof s=="string"?`${s}#${o}`:s}function $(r){var o;const t=r.next??((o=r.within)==null?void 0:o.next),s=typeof t=="string"?t:(t==null?void 0:t.id)??(t==null?void 0:t["@id"]);return typeof s=="string"?s:null}function E(r,t){var e,i;const s=[],o=[];for(const n of r){const d=Array.isArray(n.resources),c=d?n.resources:f(n.items),u=new Map;for(const a of c){const p=a.id??a["@id"],m=d?T(a.on):f(a.target)[0],v=x(m);if(!p||!v.id)continue;const y=d?(e=a.resource)==null?void 0:e.chars:f(a.body).map(l=>l==null?void 0:l.value).find(l=>typeof l=="string"),I={id:p,setId:S,canvasId:v.id,target:v,motivation:["highlighting"],bodies:[{value:String(y??t)}],annotation:{id:p,type:"Annotation",motivation:["highlighting"],body:{type:"TextualBody",value:String(y??t)},target:m}};u.set(p,I),s.push(I)}const g=d?H(n,u):M(n,u),h=new Set(g.flatMap(a=>a.entryIds));o.push(...g);for(const a of u.values())h.has(a.id)||o.push({id:a.id,canvasId:a.canvasId,entryIds:[a.id],match:((i=a.bodies[0])==null?void 0:i.value)??t})}return{query:t,hits:o,set:{id:S,label:{none:[t]},source:"search",entries:s}}}function H(r,t){var o;const s=[];for(const e of f(r.hits)){const i=f(e.annotations).filter(n=>t.has(n));i.length&&s.push({id:i.join(" "),canvasId:t.get(i[0]).canvasId,entryIds:i,before:e.before,match:String(e.match??((o=t.get(i[0]).bodies[0])==null?void 0:o.value)??""),after:e.after})}return s}function M(r,t){var o,e;const s=[];for(const i of f(r.annotations))for(const n of f(i==null?void 0:i.items))if(f(n==null?void 0:n.motivation).includes("contextualizing"))for(const c of f(n.target)){const u=typeof(c==null?void 0:c.source)=="string"?c.source:(o=c==null?void 0:c.source)==null?void 0:o.id,g=u?t.get(u):void 0;if(!g)continue;const h=f(c.selector).find(a=>(a==null?void 0:a.type)==="TextQuoteSelector");s.push({id:`${n.id??u}#${u}`,canvasId:g.canvasId,entryIds:[g.id],before:h==null?void 0:h.prefix,match:String((h==null?void 0:h.exact)??((e=g.bodies[0])==null?void 0:e.value)??""),after:h==null?void 0:h.suffix})}return s}export{E as readResults,A as search,R as searchInto};