@nulib/clover 4.5.2 → 4.5.4

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 (274) hide show
  1. package/dist/components/Annotations/Annotations.mjs +1 -1
  2. package/dist/components/Canvas/AnnotationState.mjs +1 -1
  3. package/dist/components/Canvas/CanvasView.mjs +4 -1
  4. package/dist/components/Canvas/Connected.mjs +3 -1
  5. package/dist/components/Canvas/layout.mjs +10 -3
  6. package/dist/components/Canvas/media/MediaBody.mjs +11 -1
  7. package/dist/components/Canvas/media/useCaptionTracks.mjs +3 -3
  8. package/dist/components/Panel/Panel.mjs +1 -1
  9. package/dist/components/Transcript/Transcript.mjs +12 -5
  10. package/dist/core/annotation-sets.mjs +5 -4
  11. package/dist/core/clover.mjs +2 -1
  12. package/dist/core/language-choice.mjs +1 -9
  13. package/dist/core/search-service.mjs +0 -2
  14. package/dist/core/search-set-id.mjs +5 -0
  15. package/dist/core/search.mjs +1 -1
  16. package/dist/i18n/languages.mjs +7 -0
  17. package/dist/index.d.mts +8 -4
  18. package/dist/index.mjs +2 -1
  19. package/dist/react/readingLanguages.mjs +2 -2
  20. package/dist/styles/core.css +1 -1
  21. package/dist/styles/default.css +1 -1
  22. package/dist/styles.css +1 -1
  23. package/dist/templates.css +1 -1
  24. package/dist/web-components/{About-CQxtgS3v.mjs → About-DCeIMPXs.mjs} +1 -1
  25. package/dist/web-components/AnnotationItems-vokjqFpJ.mjs +1 -0
  26. package/dist/web-components/{AnnotationMenu-Byf1nA-O.mjs → AnnotationMenu-n8wZulkI.mjs} +1 -1
  27. package/dist/web-components/AnnotationState-DJSkyiw0.mjs +1 -0
  28. package/dist/web-components/{Annotations-BznHfXJT.mjs → Annotations-CgPEcwft.mjs} +1 -1
  29. package/dist/web-components/{Annotations-0gzRTwNG.mjs → Annotations-D2Iy6k3X.mjs} +2 -2
  30. package/dist/web-components/{Body-Do9PiELy.mjs → Body-h5ykt3jO.mjs} +1 -1
  31. package/dist/web-components/{BodyAlert-CpsyVtYl.mjs → BodyAlert-COFJjxVV.mjs} +1 -1
  32. package/dist/web-components/{Button-DqfkGSl5.mjs → Button-CgTdpmNf.mjs} +1 -1
  33. package/dist/web-components/{Camera-bs3W3OK0.mjs → Camera-i2fafLIh.mjs} +1 -1
  34. package/dist/web-components/{Canvas2DBackend-9VTWQiW6.mjs → Canvas2DBackend-C2AYDVCI.mjs} +1 -1
  35. package/dist/web-components/{CanvasView-m9ooNUhD.mjs → CanvasView-uvJ5kDYN.mjs} +2 -2
  36. package/dist/web-components/{CaptionDetails-yyxvF-_h.mjs → CaptionDetails-m7amd8MS.mjs} +1 -1
  37. package/dist/web-components/{ChaptersMenu-DCyICayx.mjs → ChaptersMenu-6dDzuI0m.mjs} +1 -1
  38. package/dist/web-components/{Chevron-DpLzbCaE.mjs → Chevron-DVax9RTn.mjs} +1 -1
  39. package/dist/web-components/{ChoiceMenu-_z-WmYj6.mjs → ChoiceMenu-DH4n5jdL.mjs} +1 -1
  40. package/dist/web-components/Collection-CCjFTuVG.mjs +1 -0
  41. package/dist/web-components/{CollectionSelect-vO2qCVbK.mjs → CollectionSelect-0wNC970P.mjs} +1 -1
  42. package/dist/web-components/Connected-CGF0cSzv.mjs +1 -0
  43. package/dist/web-components/{Connected-wXkAqvjL.mjs → Connected-Cr4h-tHh.mjs} +1 -1
  44. package/dist/web-components/{Connected-DdmRznGj.mjs → Connected-CssvezHA.mjs} +1 -1
  45. package/dist/web-components/{Contents-Bfmghfq-.mjs → Contents-Cs7_X8jD.mjs} +1 -1
  46. package/dist/web-components/{ControlMenu-BaBwqPBx.mjs → ControlMenu-J-gMDza-.mjs} +1 -1
  47. package/dist/web-components/ControlsFade-BDjMo25i.mjs +1 -0
  48. package/dist/web-components/{CountMenu-mvPiRqfS.mjs → CountMenu--Z7rGivu.mjs} +1 -1
  49. package/dist/web-components/Cue-BzhK_KTz.mjs +1 -0
  50. package/dist/web-components/Document-D5r6QJ9F.mjs +1 -0
  51. package/dist/web-components/{DomLayers-B4wyEylP.mjs → DomLayers-6wCUT5ap.mjs} +1 -1
  52. package/dist/web-components/{Download-DPJ0jEM8.mjs → Download-Cff-mZmi.mjs} +1 -1
  53. package/dist/web-components/{EntryBodies-BeD_WacH.mjs → EntryBodies-D2OorCCX.mjs} +1 -1
  54. package/dist/web-components/{EntryThumbnail-Cs_9m02f.mjs → EntryThumbnail-iY1cnsAP.mjs} +1 -1
  55. package/dist/web-components/{FieldPill-3OFVRLOg.mjs → FieldPill-Swznzuhd.mjs} +1 -1
  56. package/dist/web-components/FrameAnimation-CjHUil6t.mjs +1 -0
  57. package/dist/web-components/{Gallery-Bt8ZE7KN.mjs → Gallery-CCKnJzQY.mjs} +1 -1
  58. package/dist/web-components/{GlobeGlyph-BcR00ptO.mjs → GlobeGlyph-D_ZaGUO8.mjs} +1 -1
  59. package/dist/web-components/{HideToggle-CzoPlLH7.mjs → HideToggle-D_n5lwkp.mjs} +1 -1
  60. package/dist/web-components/{ImageControls-6aS0WiPB.mjs → ImageControls-Dk8F5lUA.mjs} +1 -1
  61. package/dist/web-components/{Items-Cylhcqm3.mjs → Items-CbO0GqAH.mjs} +1 -1
  62. package/dist/web-components/Label-jKQGRD5d.mjs +1 -0
  63. package/dist/web-components/{LanguageChoice-I2zbqR8s.mjs → LanguageChoice-e7MGPRCd.mjs} +1 -1
  64. package/dist/web-components/{LanguageMenu-D7wMhxR_.mjs → LanguageMenu-BsWzKg__.mjs} +1 -1
  65. package/dist/web-components/{LightboxView-P-bt35KW.mjs → LightboxView-BjJ20ylQ.mjs} +1 -1
  66. package/dist/web-components/{ListEnd-Ch79vv6H.mjs → ListEnd-BXjH6six.mjs} +1 -1
  67. package/dist/web-components/{Loaded-nfW9JcE1.mjs → Loaded-CL-mpRHG.mjs} +1 -1
  68. package/dist/web-components/LoadedCanvas-juLvz5vu.mjs +1 -0
  69. package/dist/web-components/LoadedMap-CowAds3f.mjs +1 -0
  70. package/dist/web-components/{Loading-27_CRfmr.mjs → Loading-DGPqbYw2.mjs} +1 -1
  71. package/dist/web-components/{Map-VBS7o7LM.mjs → Map-0ImX0W-q.mjs} +1 -1
  72. package/dist/web-components/MapView-B-etTZqp.mjs +3 -0
  73. package/dist/web-components/{Markup-zy52Xoel.mjs → Markup-D5v_pfK-.mjs} +1 -1
  74. package/dist/web-components/{MediaBody-CMOc8TAG.mjs → MediaBody-BBu6nfi8.mjs} +1 -1
  75. package/dist/web-components/MediaBody-CU6BHhYo.mjs +1 -0
  76. package/dist/web-components/{NavDate-Hjz-ZUV8.mjs → NavDate-CJkis3CR.mjs} +1 -1
  77. package/dist/web-components/{Navigator-B-vYs2Cu.mjs → Navigator-CHoyJlHU.mjs} +1 -1
  78. package/dist/web-components/{Pager-DtwQLNol.mjs → Pager-CObS0xYo.mjs} +1 -1
  79. package/dist/web-components/PagerLayout-DEwXb6TF.mjs +1 -0
  80. package/dist/web-components/{Panel-DrIRuV4y.mjs → Panel-CyP3eeQ5.mjs} +1 -1
  81. package/dist/web-components/PanelPart-DzeT8Atv.mjs +1 -0
  82. package/dist/web-components/{PanelToggle-CXt2QzGI.mjs → PanelToggle-CxkqIgxi.mjs} +1 -1
  83. package/dist/web-components/{PartOfManifest-D5WYs-Kh.mjs → PartOfManifest-Cn_HgJ7I.mjs} +1 -1
  84. package/dist/web-components/{Pending-DRm1E_06.mjs → Pending-DI4VIePO.mjs} +1 -1
  85. package/dist/web-components/{PlaceBox-tTnsemz1.mjs → PlaceBox-CHl0X25c.mjs} +1 -1
  86. package/dist/web-components/{Placeholder-B8Y0k5OK.mjs → Placeholder-Cg3ByN0S.mjs} +1 -1
  87. package/dist/web-components/{Position-bBjejirV.mjs → Position-DMsgzBqP.mjs} +1 -1
  88. package/dist/web-components/Primitives-7dLlwNwr.mjs +1 -0
  89. package/dist/web-components/Provider-YGHeWGVP.mjs +1 -0
  90. package/dist/web-components/{ReadMore-EjrUmbD0.mjs → ReadMore-D80et8BG.mjs} +1 -1
  91. package/dist/web-components/Root-CUaKZDXj.mjs +1 -0
  92. package/dist/web-components/Scene-B9X0CUW5.mjs +1 -0
  93. package/dist/web-components/{SceneView-B38QNUQr.mjs → SceneView-CunAaAoN.mjs} +1 -1
  94. package/dist/web-components/{Search-D5f3L4Mi.mjs → Search-C3LFmKil.mjs} +1 -1
  95. package/dist/web-components/{Sections-kRJ1okE8.mjs → Sections-BT3WtluQ.mjs} +1 -1
  96. package/dist/web-components/{SeekMarks-DqKFHbLX.mjs → SeekMarks-DazilTox.mjs} +1 -1
  97. package/dist/web-components/StandaloneItems-8zvqQ2eQ.mjs +1 -0
  98. package/dist/web-components/{Status-CjtyBONJ.mjs → Status-CvunwdwM.mjs} +1 -1
  99. package/dist/web-components/{Steps-BEkT1NQg.mjs → Steps-Cw27EFcs.mjs} +1 -1
  100. package/dist/web-components/{TargetItems-Itkqt2Tb.mjs → TargetItems-_jmvEEEp.mjs} +1 -1
  101. package/dist/web-components/Timeline-CKGsgOW4.mjs +1 -0
  102. package/dist/web-components/{Tip-ByWHicZ5.mjs → Tip-DxvfQm-l.mjs} +1 -1
  103. package/dist/web-components/Transcript-C7pTS92q.mjs +1 -0
  104. package/dist/web-components/{Transport-C1bwJBQM.mjs → Transport-K0u9YhmA.mjs} +1 -1
  105. package/dist/web-components/{Transport-DXc48Ck8.mjs → Transport-hORVpyCc.mjs} +1 -1
  106. package/dist/web-components/{annotation-collection-x1YCBmx8.mjs → annotation-collection-y13MLLGX.mjs} +1 -1
  107. package/dist/web-components/{annotation-name-dLmSFXbG.mjs → annotation-name-U_Yiz_CP.mjs} +1 -1
  108. package/dist/web-components/{annotations-content-C0p3XB-1.mjs → annotations-content-B6PtnG5P.mjs} +1 -1
  109. package/dist/web-components/{body-DhIi0tSa.mjs → body-Eiq36Gou.mjs} +1 -1
  110. package/dist/web-components/{canvas-BMBhMAO5.mjs → canvas-CDjBaQ75.mjs} +1 -1
  111. package/dist/web-components/{cloverEngine-CgwMyPTV.mjs → cloverEngine-65MawacL.mjs} +1 -1
  112. package/dist/web-components/{content-state-reader-DYl2djp5.mjs → content-state-reader-CY-uQUXA.mjs} +1 -1
  113. package/dist/web-components/{controlGlyphs-CAs5NitM.mjs → controlGlyphs-BI3qUN6D.mjs} +1 -1
  114. package/dist/web-components/{controls-BFETnZ7b.mjs → controls-Cc5LuT8p.mjs} +1 -1
  115. package/dist/web-components/{downloads-Dxku671h.mjs → downloads-Pq5Aedpe.mjs} +1 -1
  116. package/dist/web-components/{dragToClose-BJ07Mayh.mjs → dragToClose-DBlTMmyC.mjs} +1 -1
  117. package/dist/web-components/{engine-zjivMDZQ.mjs → engine-BHQWLVxn.mjs} +1 -1
  118. package/dist/web-components/{engines-DdvyIGhW.mjs → engines-BnPu5Ggs.mjs} +1 -1
  119. package/dist/web-components/{fetchManifest-J64cuwEZ.mjs → fetchManifest-BKGaZzDw.mjs} +1 -1
  120. package/dist/web-components/{fromManifest-BByCRrb9.mjs → fromManifest-qxJrEfn6.mjs} +1 -1
  121. package/dist/web-components/{glyphs-3j_wsdG0.mjs → glyphs-PlEEwLrB.mjs} +1 -1
  122. package/dist/web-components/{hooks-uHKfYuKB.mjs → hooks--n9dMuHb.mjs} +1 -1
  123. package/dist/web-components/image-layers-BLqN0BKU.mjs +1 -0
  124. package/dist/web-components/{image-service-content-BzLp6nth.mjs → image-service-content-DHDgPYBV.mjs} +1 -1
  125. package/dist/web-components/{imageService-BIVE0K1I.mjs → imageService-DfXP25SW.mjs} +1 -1
  126. package/dist/web-components/{index-CjNkvvfl.mjs → index-BjpZQ9J-.mjs} +1 -1
  127. package/dist/web-components/index.mjs +1 -1
  128. package/dist/web-components/{items-DDv9RUBA.mjs → items-BwKkJEOS.mjs} +1 -1
  129. package/dist/web-components/items-Hk3_LJmo.mjs +1 -0
  130. package/dist/web-components/label-CGhzU3ki.mjs +1 -0
  131. package/dist/web-components/layout-DbMbjpx4.mjs +1 -0
  132. package/dist/web-components/{link-BiM9KdpG.mjs → link-BIc77IY3.mjs} +1 -1
  133. package/dist/web-components/logo-BV7vGA6L.mjs +1 -0
  134. package/dist/web-components/{models-CObUKgMl.mjs → models-BXBEOLKe.mjs} +1 -1
  135. package/dist/web-components/{nodes-BJ4P1NTa.mjs → nodes-BWN5jzoG.mjs} +1 -1
  136. package/dist/web-components/{overlayImage-lYLaIThc.mjs → overlayImage-jvgcflf8.mjs} +1 -1
  137. package/dist/web-components/{panel-CoYAVlbj.mjs → panel-BW39vvfB.mjs} +1 -1
  138. package/dist/web-components/part-C9K_lQE1.mjs +1 -0
  139. package/dist/web-components/{playerSurface-DuHYLLBb.mjs → playerSurface-PBbBGoj5.mjs} +1 -1
  140. package/dist/web-components/{pointer--iHWeLVV.mjs → pointer-DsqyiOIC.mjs} +1 -1
  141. package/dist/web-components/{provider-DcsevgMJ.mjs → provider-Dg6Gi5Ft.mjs} +1 -1
  142. package/dist/web-components/{range-regions-Bnyl9SWk.mjs → range-regions-BmSXWBAS.mjs} +1 -1
  143. package/dist/web-components/{read-more-C9PqroD1.mjs → read-more-BstyFDUC.mjs} +1 -1
  144. package/dist/web-components/readingLanguages-BY2NUfQE.mjs +1 -0
  145. package/dist/web-components/{rendererSurface-BAvGJcFy.mjs → rendererSurface-AGFetq7k.mjs} +2 -2
  146. package/dist/web-components/{renderers-DGfMWk93.mjs → renderers-BjtPgVnV.mjs} +1 -1
  147. package/dist/web-components/{resource-Dt6dILeb.mjs → resource-i359_a15.mjs} +1 -1
  148. package/dist/web-components/{save-file-DzI4VfDl.mjs → save-file-nlQm0Sup.mjs} +1 -1
  149. package/dist/web-components/{search-DLXYDW3B.mjs → search-BPTt1eUz.mjs} +1 -1
  150. package/dist/web-components/shared-Cqxks7jF.mjs +1 -0
  151. package/dist/web-components/{show-link-DRW4U86r.mjs → show-link-DwefC5LJ.mjs} +1 -1
  152. package/dist/web-components/{sizedImage-Bb488in6.mjs → sizedImage-BBoqi5ZU.mjs} +1 -1
  153. package/dist/web-components/{split-BSvilwgY.mjs → split-DqzkMVr3.mjs} +1 -1
  154. package/dist/web-components/{status-DCylOE_H.mjs → status-BSpwZ8rO.mjs} +1 -1
  155. package/dist/web-components/{styles-Cm1KSkd5.mjs → styles-C9QeBpjd.mjs} +1 -1
  156. package/dist/web-components/three.mjs +1 -1
  157. package/dist/web-components/{thumbnail-IWjwr85c.mjs → thumbnail-Ckf6EotT.mjs} +1 -1
  158. package/dist/web-components/{tip-XxruPb74.mjs → tip-DTTyG5KI.mjs} +1 -1
  159. package/dist/web-components/{toggle-Bm06TZio.mjs → toggle-DAC1XODI.mjs} +1 -1
  160. package/dist/web-components/{useContainerName-jjktq7OB.mjs → useContainerName-D_XCWIWP.mjs} +1 -1
  161. package/dist/web-components/{useControlsVisibility-K1HUKs93.mjs → useControlsVisibility-CIjHTnaa.mjs} +1 -1
  162. package/dist/web-components/{useNearViewport-DpYbV4NQ.mjs → useNearViewport-B5E-oZb_.mjs} +1 -1
  163. package/dist/web-components/{useScrollTrack-Cy6z-b7G.mjs → useScrollTrack-C2xSfGF6.mjs} +1 -1
  164. package/dist/web-components/viewer/{AnnotationItems-BnihkLNH.mjs → AnnotationItems-B16qAKiN.mjs} +1 -1
  165. package/dist/web-components/viewer/{AnnotationMenu-Dha0gE5m.mjs → AnnotationMenu-DgJSq4fy.mjs} +1 -1
  166. package/dist/web-components/viewer/AnnotationState-YuVCBM29.mjs +1 -0
  167. package/dist/web-components/viewer/{Annotations-CW-BFATW.mjs → Annotations-Cq5fXZrj.mjs} +1 -1
  168. package/dist/web-components/viewer/{Annotations-DuWIPFH3.mjs → Annotations-DYkHWOeR.mjs} +2 -2
  169. package/dist/web-components/viewer/{Canvas2DBackend-mmhuXqdi.mjs → Canvas2DBackend-DvKFoHuh.mjs} +1 -1
  170. package/dist/web-components/viewer/{CaptionDetails-DA6_oiQF.mjs → CaptionDetails-DxTKPbOM.mjs} +1 -1
  171. package/dist/web-components/viewer/{ChaptersMenu-C2WL8jFt.mjs → ChaptersMenu-BC3qFrhN.mjs} +1 -1
  172. package/dist/web-components/viewer/{ChoiceMenu-QB_5keQb.mjs → ChoiceMenu-DXBx-fGv.mjs} +1 -1
  173. package/dist/web-components/viewer/{Collection-D5a6WYZI.mjs → Collection-CeCEHMv-.mjs} +1 -1
  174. package/dist/web-components/viewer/{Connected-Di1-LIOg.mjs → Connected-CEraiqd1.mjs} +1 -1
  175. package/dist/web-components/viewer/{Connected-C1NtY97-.mjs → Connected-DakTdEny.mjs} +1 -1
  176. package/dist/web-components/viewer/{Contents-BzTwcDZy.mjs → Contents-DOuB3pTB.mjs} +1 -1
  177. package/dist/web-components/viewer/{ControlMenu-CxmfQ8Cm.mjs → ControlMenu-CBb7ZoP6.mjs} +1 -1
  178. package/dist/web-components/viewer/ControlsFade-WJ98Wqju.mjs +1 -0
  179. package/dist/web-components/viewer/{CountMenu-CgQWpBDd.mjs → CountMenu-WadMuI5T.mjs} +1 -1
  180. package/dist/web-components/viewer/Cue-BF5ZjVa8.mjs +1 -0
  181. package/dist/web-components/viewer/{Document-DId3Ww6w.mjs → Document-DfRQ7S0l.mjs} +1 -1
  182. package/dist/web-components/viewer/{DomLayers-D6T0qkEm.mjs → DomLayers-uwjfbBsp.mjs} +1 -1
  183. package/dist/web-components/viewer/{Download-Cj4jZnPF.mjs → Download-C1nPhWlq.mjs} +1 -1
  184. package/dist/web-components/viewer/{EntryBodies-JslI0mKb.mjs → EntryBodies-EWZ8rnB_.mjs} +1 -1
  185. package/dist/web-components/viewer/{EntryThumbnail-CHc7jDuf.mjs → EntryThumbnail-BGpml8t4.mjs} +1 -1
  186. package/dist/web-components/viewer/{FieldPill-CeO1-KpF.mjs → FieldPill-KWuDZTXX.mjs} +1 -1
  187. package/dist/web-components/viewer/{FrameAnimation-CCXxhEGY.mjs → FrameAnimation-ChvHbIgp.mjs} +1 -1
  188. package/dist/web-components/viewer/{Gallery-CLw13i4w.mjs → Gallery-DAal6sgL.mjs} +1 -1
  189. package/dist/web-components/viewer/{GlobeGlyph-XyW874Xa.mjs → GlobeGlyph-ByDERN9z.mjs} +1 -1
  190. package/dist/web-components/viewer/{HideToggle-CbduRY6y.mjs → HideToggle-C-gM8Mk8.mjs} +1 -1
  191. package/dist/web-components/viewer/{ImageControls-BlpTLXbh.mjs → ImageControls-B2aR8D82.mjs} +1 -1
  192. package/dist/web-components/viewer/{LanguageChoice-D26bb87S.mjs → LanguageChoice-CbcBytbo.mjs} +1 -1
  193. package/dist/web-components/viewer/{LanguageMenu-ECLF6mSI.mjs → LanguageMenu-D_tV0uO9.mjs} +1 -1
  194. package/dist/web-components/viewer/{LightboxView-CFvsyP57.mjs → LightboxView-C_Ofd0zk.mjs} +1 -1
  195. package/dist/web-components/viewer/{ListEnd-BbZ0cF34.mjs → ListEnd-DN2oUjyx.mjs} +1 -1
  196. package/dist/web-components/viewer/{MapView-DJ0uaPAX.mjs → MapView-C0qrLqaP.mjs} +2 -2
  197. package/dist/web-components/viewer/MediaBody-CfnBYVg-.mjs +1 -0
  198. package/dist/web-components/viewer/{MediaBody-BgBDbfHg.mjs → MediaBody-CnKOjrdE.mjs} +1 -1
  199. package/dist/web-components/viewer/{NavDate-1vpKxZK1.mjs → NavDate-NJcjaWOv.mjs} +1 -1
  200. package/dist/web-components/viewer/{Navigator-CSlUlVI-.mjs → Navigator-DRRodGLA.mjs} +1 -1
  201. package/dist/web-components/viewer/{PagerLayout-CeqR69iN.mjs → PagerLayout-Dgbs71Hu.mjs} +1 -1
  202. package/dist/web-components/viewer/PanelPart-BibD4mAY.mjs +1 -0
  203. package/dist/web-components/viewer/{PartOfManifest-BBTld3mZ.mjs → PartOfManifest-f8ZMHngG.mjs} +1 -1
  204. package/dist/web-components/viewer/{PlaceBox-jyu7a0on.mjs → PlaceBox-CamClgeV.mjs} +1 -1
  205. package/dist/web-components/viewer/{Placeholder-CedWZbsU.mjs → Placeholder-D7t4rsFp.mjs} +1 -1
  206. package/dist/web-components/viewer/{Search-D_hveAZH.mjs → Search-CednujgR.mjs} +1 -1
  207. package/dist/web-components/viewer/{SeekMarks-YIQFWYfI.mjs → SeekMarks-gvJ2UZoh.mjs} +1 -1
  208. package/dist/web-components/viewer/{StandaloneItems-DcLGj-VV.mjs → StandaloneItems-DkquLq5p.mjs} +1 -1
  209. package/dist/web-components/viewer/{Steps-BLXeVvHo.mjs → Steps-CFmYNpo3.mjs} +1 -1
  210. package/dist/web-components/viewer/{TargetItems-BNor7HFs.mjs → TargetItems-CfLAMuj8.mjs} +1 -1
  211. package/dist/web-components/viewer/Transcript-_eA-Dm0M.mjs +1 -0
  212. package/dist/web-components/viewer/{Transport-DFssphP9.mjs → Transport-5jVVRct0.mjs} +1 -1
  213. package/dist/web-components/viewer/{Transport-C_pFOBzJ.mjs → Transport-B4K4XAF-.mjs} +1 -1
  214. package/dist/web-components/viewer/{annotation-collection-BLtyEjru.mjs → annotation-collection-DBuApZiI.mjs} +1 -1
  215. package/dist/web-components/viewer/{annotation-name-mRcTA1c1.mjs → annotation-name-C-CMfd6g.mjs} +1 -1
  216. package/dist/web-components/viewer/{annotations-content-DBQgx1j7.mjs → annotations-content-D8UWdcFt.mjs} +1 -1
  217. package/dist/web-components/viewer/{cloverEngine-BF_4X8lm.mjs → cloverEngine-CKfaQ-Wc.mjs} +1 -1
  218. package/dist/web-components/viewer/{content-state-reader-Bmd-lwNd.mjs → content-state-reader-BvfAdXET.mjs} +1 -1
  219. package/dist/web-components/viewer/{dragToClose-aeU6bjg0.mjs → dragToClose-DDJ3XwRu.mjs} +1 -1
  220. package/dist/web-components/viewer/{fetchManifest-D3mfpSBh.mjs → fetchManifest-pVcLruTs.mjs} +1 -1
  221. package/dist/web-components/viewer/{host-DKJIdeDV.mjs → host-BbYrtAtM.mjs} +1 -1
  222. package/dist/web-components/viewer/{image-layers-CwutsuDL.mjs → image-layers-D0QWXFeZ.mjs} +1 -1
  223. package/dist/web-components/viewer/{image-service-content-DUG6BXnh.mjs → image-service-content-ClTuuZ5p.mjs} +1 -1
  224. package/dist/web-components/viewer/index.mjs +1 -1
  225. package/dist/web-components/viewer/{link-BUSPRbyE.mjs → link-CE5biAiK.mjs} +1 -1
  226. package/dist/web-components/viewer/{overlayImage-D8N9rwQF.mjs → overlayImage-ykHbPvnH.mjs} +1 -1
  227. package/dist/web-components/viewer/{range-regions-D4lx-cRg.mjs → range-regions-DD-NwcwE.mjs} +1 -1
  228. package/dist/web-components/viewer/{renderers-CFKRycnu.mjs → renderers-N8qGiR4Q.mjs} +1 -1
  229. package/dist/web-components/viewer/{save-file-D8fcn3qy.mjs → save-file-Bczd1gGN.mjs} +1 -1
  230. package/dist/web-components/viewer/{search-CXoMviyv.mjs → search--UfJW1mN.mjs} +1 -1
  231. package/dist/web-components/viewer/{styles-BjjJM8OS.mjs → styles-LW5XsRcK.mjs} +1 -1
  232. package/dist/web-components/viewer/{useControlsVisibility-nGLR8EFY.mjs → useControlsVisibility-B1Ag1zm_.mjs} +1 -1
  233. package/dist/web-components/viewer/viewer-DL8dyfj_.mjs +29 -0
  234. package/dist/web-components/viewer/{vtt-CMfIBDAL.mjs → vtt-U7j7H25c.mjs} +1 -1
  235. package/dist/web-components/{viewer-FSKFHjRd.mjs → viewer-CkXVnqu5.mjs} +1 -1
  236. package/dist/web-components/{vtt-COiqtr-4.mjs → vtt-Di31JcWg.mjs} +1 -1
  237. package/package.json +1 -1
  238. package/dist/web-components/AnnotationItems-CcK8lOdr.mjs +0 -1
  239. package/dist/web-components/AnnotationState-idcYZf3N.mjs +0 -1
  240. package/dist/web-components/Collection-Kwdu1S-6.mjs +0 -1
  241. package/dist/web-components/Connected-1kdGMIWC.mjs +0 -1
  242. package/dist/web-components/ControlsFade-BJe8pU1f.mjs +0 -1
  243. package/dist/web-components/Cue-DKACn0J1.mjs +0 -1
  244. package/dist/web-components/Document-CPD-9KDe.mjs +0 -1
  245. package/dist/web-components/FrameAnimation-2B6rRU4W.mjs +0 -1
  246. package/dist/web-components/Label-DHHchol3.mjs +0 -1
  247. package/dist/web-components/LoadedCanvas-Bfrvk-Yt.mjs +0 -1
  248. package/dist/web-components/LoadedMap-BaakosFd.mjs +0 -1
  249. package/dist/web-components/MapView-D-RJ69f2.mjs +0 -3
  250. package/dist/web-components/MediaBody-Bh8301OV.mjs +0 -1
  251. package/dist/web-components/PagerLayout-D10GPTRD.mjs +0 -1
  252. package/dist/web-components/PanelPart-xW94FuNJ.mjs +0 -1
  253. package/dist/web-components/Primitives-PRo4k-fb.mjs +0 -1
  254. package/dist/web-components/Provider-CrpDmnzZ.mjs +0 -1
  255. package/dist/web-components/Root-DK9ssTa2.mjs +0 -1
  256. package/dist/web-components/Scene-DYbvcQXW.mjs +0 -1
  257. package/dist/web-components/StandaloneItems-C2e9PPxg.mjs +0 -1
  258. package/dist/web-components/Timeline-g0fwghKo.mjs +0 -1
  259. package/dist/web-components/Transcript-CsQ9bYfS.mjs +0 -1
  260. package/dist/web-components/image-layers-BCWDCZEA.mjs +0 -1
  261. package/dist/web-components/items-Bc1JPQjI.mjs +0 -1
  262. package/dist/web-components/label-CS0CGhZ5.mjs +0 -1
  263. package/dist/web-components/layout-CdBuqKxn.mjs +0 -1
  264. package/dist/web-components/logo-CFz7_HVm.mjs +0 -1
  265. package/dist/web-components/part-cbvAb44O.mjs +0 -1
  266. package/dist/web-components/readingLanguages-BB0nHlI0.mjs +0 -1
  267. package/dist/web-components/shared-DJyYaNgB.mjs +0 -1
  268. package/dist/web-components/viewer/AnnotationState-fj1N93ri.mjs +0 -1
  269. package/dist/web-components/viewer/ControlsFade-BVpQ-3q7.mjs +0 -1
  270. package/dist/web-components/viewer/Cue-DuP2wssL.mjs +0 -1
  271. package/dist/web-components/viewer/MediaBody-CSzkjuJn.mjs +0 -1
  272. package/dist/web-components/viewer/PanelPart-BCQo2YZ-.mjs +0 -1
  273. package/dist/web-components/viewer/Transcript-Crl3zPhV.mjs +0 -1
  274. package/dist/web-components/viewer/viewer-4EayGlH3.mjs +0 -29
@@ -1 +1 @@
1
- import{e as M,y as j,u as t,z as C,P as N,X as w,a as x,Q as $,x as H,c as _,A as G,b as U,Y as T,U as V,l as k}from"./shared-DJyYaNgB.mjs";import{j as B}from"./classnames-DukgfdpI.mjs";import{u as Q}from"./readingLanguages-BB0nHlI0.mjs";import{Thumbnail as W,Summary as R,Metadata as X,RequiredStatement as Y,Rights as E,Homepage as J,SeeAlso as Z,Id as K}from"./Primitives-PRo4k-fb.mjs";import{u as ee}from"./downloads-Dxku671h.mjs";import{P as te}from"./Provider-CrpDmnzZ.mjs";import{a as oe,t as ae}from"./heading-Cjt0f-Eu.mjs";import{L as ne}from"./Label-DHHchol3.mjs";import{r as re}from"./dates-DR3gfcON.mjs";import"./styles-Cm1KSkd5.mjs";const se=C(()=>import("./LanguageChoice-I2zbqR8s.mjs").then(e=>e.b).then(e=>({default:e.LanguageChoice}))),le=e=>{var r;const s=e.closest(".clover-sections-actions"),a=(r=s==null?void 0:s.closest(".clover-sections-item"))==null?void 0:r.querySelector(".clover-sections-heading .clover-sections-label");return s&&a?{box:s,label:a}:null},ce=e=>void w.chooseInterfaceLanguage(e);function ue(){x();const{languages:e,chosen:s}=w.interfaceLanguages();return e.length>1?{languages:e,chosen:s}:null}function ie({values:e=true,interfaceLanguages:s=true}={}){const a=Q(),r=ue(),l=e?(a==null?void 0:a.languages)??[]:[],c=o=>l.some(b=>b===o||w.stringsFor(b)===o),g=[...l,...(s?(r==null?void 0:r.languages)??[]:[]).filter(o=>!c(o))];if(g.length<2)return null;const P=w.chosenLanguage,h=P&&w.stringsFor(P),L=h&&g.includes(h)&&!c(h)?h:e&&a?a.chosen:(r==null?void 0:r.chosen)??g[0];return{languages:g,chosen:L,onChange:o=>l.includes(o)&&a?a.onChange(o):ce(o)}}function me({values:e,interfaceLanguages:s}){const a=ie({values:e,interfaceLanguages:s}),{drawsToggle:r}=M("About"),l=!!a;return j(()=>l?r==null?void 0:r():void 0,[l,r]),a?t(N,{fallback:null,children:t(se,{...a,nameKey:"readingLanguage",part:"clover-about",fit:le})}):null}const de=$(false),ge=C(()=>import("./Download-DPJ0jEM8.mjs").then(({DownloadGroups:e})=>({default:e}))),he=C(()=>import("./NavDate-Hjz-ZUV8.mjs").then(e=>e.a).then(({NavDate:e})=>({default:e}))),be=C(()=>import("./PartOfManifest-D5WYs-Kh.mjs"));function fe({languages:e=true,interfaceLanguages:s=true,...a}){const r=H(de);return t(ve,{...a,download:!r&&a.download!==false,choice:r?null:t(me,{values:e,interfaceLanguages:s})})}function ve({choice:e,canvasSummary:s=false,headingLevel:a=3,download:r=true,thumbnail:l=true,label:c=true,className:g,...P}){const{t:h,langOf:L}=x(),v=ee(),o=_(n=>n.manifest,Object.is,"About"),b=G(null);j(()=>{const n=b.current,i=n==null?void 0:n.querySelector(".clover-about-head");if(!n||!i||typeof ResizeObserver>"u")return;const m=new Set,d=()=>{const D=i.querySelector(".clover-about-thumbnail"),A=i.querySelector(".clover-about-label");for(const S of[D,A])S&&!m.has(S)&&(m.add(S),y.observe(S));const f=n.style;if(!D){f.removeProperty("--clover-about-label-height"),f.removeProperty("--clover-about-thumbnail-width");return}const O=`${(A==null?void 0:A.offsetHeight)??0}px`,q=`${D.offsetWidth}px`;f.getPropertyValue("--clover-about-label-height")!==O&&f.setProperty("--clover-about-label-height",O),f.getPropertyValue("--clover-about-thumbnail-width")!==q&&f.setProperty("--clover-about-thumbnail-width",q)};let p=0;const y=new ResizeObserver(()=>{cancelAnimationFrame(p),p=requestAnimationFrame(d)});return y.observe(i),d(),()=>{cancelAnimationFrame(p),y.disconnect(),n.style.removeProperty("--clover-about-label-height"),n.style.removeProperty("--clover-about-thumbnail-width")}},[c,l,o]);const z=U(),F=()=>{var m,d;const n=b.current;(d=((m=n==null?void 0:n.closest(".clover-sections-item"))==null?void 0:m.querySelector(".clover-sections-button"))??n)==null||d.focus({preventScroll:true})};if(!o)return null;const u=(n,i,m)=>{if(!i)return null;const{as:d,title:p,group:y}=ae(a,`${z}-${n}`);return t("section",{className:"clover-about-section",...y,children:[t(d,{className:"clover-about-heading",...k(L(n)),...p,children:h(n)}),m]})},I=n=>Array.isArray(o[n])?o[n].length>0:!!o[n];return t("div",{ref:b,className:B("clover-about",g),tabIndex:-1,...P,children:[e,(l||c)&&t("div",{className:"clover-about-head",children:[l&&t(W,{className:"clover-about-thumbnail",size:256,alt:c?"":void 0}),c&&t(ne,{as:oe(a),className:"clover-about-label clover-title"})]}),s&&t(R,{of:"canvas",className:"clover-about-summary"}),T(o)&&o.partOf&&t(N,{fallback:null,children:t(be,{manifest:o,headingLevel:a,onOpened:F})}),t(R,{className:"clover-about-summary"}),t(X,{className:"clover-about-metadata"}),t(Y,{className:"clover-about-metadata"}),u("aboutDate",re(o.navDate),t(N,{fallback:null,children:t(he,{value:o.navDate,className:"clover-about-date"})})),u("aboutProvider",I("provider"),t(te,{})),u("aboutRights",o.rights,t(E,{})),u("aboutHomepage",I("homepage"),t(J,{})),u("aboutSeeAlso",I("seeAlso"),t(Z,{})),u("download",r&&v.page.length+v.all.length>0,t(N,{fallback:null,children:t(ge,{page:v.page,all:v.all,headingLevel:a+1})})),u(T(o)?"aboutCanvas":"aboutManifest",!V(o)&&o.id,t(K,{}))]})}const De=Object.freeze(Object.defineProperty({__proto__:null,About:fe},Symbol.toStringTag,{value:"Module"}));export{fe as A,de as I,me as L,De as a,ie as u};
1
+ import{e as M,y as j,u as t,z as C,P as N,Y as w,a as x,Q as $,x as H,c as _,A as V,b as G,Z as T,V as k,l as B}from"./shared-Cqxks7jF.mjs";import{j as Q}from"./classnames-DukgfdpI.mjs";import{u as U}from"./readingLanguages-BY2NUfQE.mjs";import{Thumbnail as W,Summary as R,Metadata as Y,RequiredStatement as Z,Rights as E,Homepage as J,SeeAlso as X,Id as K}from"./Primitives-7dLlwNwr.mjs";import{u as ee}from"./downloads-Pq5Aedpe.mjs";import{P as te}from"./Provider-YGHeWGVP.mjs";import{a as oe,t as ae}from"./heading-Cjt0f-Eu.mjs";import{L as ne}from"./Label-jKQGRD5d.mjs";import{r as re}from"./dates-DR3gfcON.mjs";import"./styles-C9QeBpjd.mjs";const se=C(()=>import("./LanguageChoice-e7MGPRCd.mjs").then(e=>e.b).then(e=>({default:e.LanguageChoice}))),le=e=>{var r;const s=e.closest(".clover-sections-actions"),a=(r=s==null?void 0:s.closest(".clover-sections-item"))==null?void 0:r.querySelector(".clover-sections-heading .clover-sections-label");return s&&a?{box:s,label:a}:null},ce=e=>void w.chooseInterfaceLanguage(e);function ue(){x();const{languages:e,chosen:s}=w.interfaceLanguages();return e.length>1?{languages:e,chosen:s}:null}function ie({values:e=true,interfaceLanguages:s=true}={}){const a=U(),r=ue(),l=e?(a==null?void 0:a.languages)??[]:[],c=o=>l.some(b=>b===o||w.stringsFor(b)===o),g=[...l,...(s?(r==null?void 0:r.languages)??[]:[]).filter(o=>!c(o))];if(g.length<2)return null;const P=w.chosenLanguage,h=P&&w.stringsFor(P),L=h&&g.includes(h)&&!c(h)?h:e&&a?a.chosen:(r==null?void 0:r.chosen)??g[0];return{languages:g,chosen:L,onChange:o=>l.includes(o)&&a?a.onChange(o):ce(o)}}function me({values:e,interfaceLanguages:s}){const a=ie({values:e,interfaceLanguages:s}),{drawsToggle:r}=M("About"),l=!!a;return j(()=>l?r==null?void 0:r():void 0,[l,r]),a?t(N,{fallback:null,children:t(se,{...a,nameKey:"readingLanguage",part:"clover-about",fit:le})}):null}const de=$(false),ge=C(()=>import("./Download-Cff-mZmi.mjs").then(({DownloadGroups:e})=>({default:e}))),he=C(()=>import("./NavDate-CJkis3CR.mjs").then(e=>e.a).then(({NavDate:e})=>({default:e}))),be=C(()=>import("./PartOfManifest-Cn_HgJ7I.mjs"));function fe({languages:e=true,interfaceLanguages:s=true,...a}){const r=H(de);return t(ve,{...a,download:!r&&a.download!==false,choice:r?null:t(me,{values:e,interfaceLanguages:s})})}function ve({choice:e,canvasSummary:s=false,headingLevel:a=3,download:r=true,thumbnail:l=true,label:c=true,className:g,...P}){const{t:h,langOf:L}=x(),v=ee(),o=_(n=>n.manifest,Object.is,"About"),b=V(null);j(()=>{const n=b.current,i=n==null?void 0:n.querySelector(".clover-about-head");if(!n||!i||typeof ResizeObserver>"u")return;const m=new Set,d=()=>{const D=i.querySelector(".clover-about-thumbnail"),A=i.querySelector(".clover-about-label");for(const S of[D,A])S&&!m.has(S)&&(m.add(S),y.observe(S));const f=n.style;if(!D){f.removeProperty("--clover-about-label-height"),f.removeProperty("--clover-about-thumbnail-width");return}const O=`${(A==null?void 0:A.offsetHeight)??0}px`,q=`${D.offsetWidth}px`;f.getPropertyValue("--clover-about-label-height")!==O&&f.setProperty("--clover-about-label-height",O),f.getPropertyValue("--clover-about-thumbnail-width")!==q&&f.setProperty("--clover-about-thumbnail-width",q)};let p=0;const y=new ResizeObserver(()=>{cancelAnimationFrame(p),p=requestAnimationFrame(d)});return y.observe(i),d(),()=>{cancelAnimationFrame(p),y.disconnect(),n.style.removeProperty("--clover-about-label-height"),n.style.removeProperty("--clover-about-thumbnail-width")}},[c,l,o]);const z=G(),F=()=>{var m,d;const n=b.current;(d=((m=n==null?void 0:n.closest(".clover-sections-item"))==null?void 0:m.querySelector(".clover-sections-button"))??n)==null||d.focus({preventScroll:true})};if(!o)return null;const u=(n,i,m)=>{if(!i)return null;const{as:d,title:p,group:y}=ae(a,`${z}-${n}`);return t("section",{className:"clover-about-section",...y,children:[t(d,{className:"clover-about-heading",...B(L(n)),...p,children:h(n)}),m]})},I=n=>Array.isArray(o[n])?o[n].length>0:!!o[n];return t("div",{ref:b,className:Q("clover-about",g),tabIndex:-1,...P,children:[e,(l||c)&&t("div",{className:"clover-about-head",children:[l&&t(W,{className:"clover-about-thumbnail",size:256,alt:c?"":void 0}),c&&t(ne,{as:oe(a),className:"clover-about-label clover-title"})]}),s&&t(R,{of:"canvas",className:"clover-about-summary"}),T(o)&&o.partOf&&t(N,{fallback:null,children:t(be,{manifest:o,headingLevel:a,onOpened:F})}),t(R,{className:"clover-about-summary"}),t(Y,{className:"clover-about-metadata"}),t(Z,{className:"clover-about-metadata"}),u("aboutDate",re(o.navDate),t(N,{fallback:null,children:t(he,{value:o.navDate,className:"clover-about-date"})})),u("aboutProvider",I("provider"),t(te,{})),u("aboutRights",o.rights,t(E,{})),u("aboutHomepage",I("homepage"),t(J,{})),u("aboutSeeAlso",I("seeAlso"),t(X,{})),u("download",r&&v.page.length+v.all.length>0,t(N,{fallback:null,children:t(ge,{page:v.page,all:v.all,headingLevel:a+1})})),u(T(o)?"aboutCanvas":"aboutManifest",!k(o)&&o.id,t(K,{}))]})}const De=Object.freeze(Object.defineProperty({__proto__:null,About:fe},Symbol.toStringTag,{value:"Module"}));export{fe as A,de as I,me as L,De as a,ie as u};
@@ -0,0 +1 @@
1
+ import{e as P,c as v,ak as _,T as E,H as O,A as k,y as T,u as f,k as R,d as q,a2 as F}from"./shared-Cqxks7jF.mjs";import{P as L,a as y}from"./Items-CbO0GqAH.mjs";import{C as B}from"./CountMenu--Z7rGivu.mjs";import{a as D}from"./annotation-name-U_Yiz_CP.mjs";import{f as G,r as H}from"./fetchManifest-BKGaZzDw.mjs";import{u as K,L as V}from"./ListEnd-BXjH6six.mjs";function j({onSelect:o,forwardedRef:r,...c}){const{clover:l,language:e}=P("Items"),n=v(t=>t.manifest),s=v(t=>_(t.manifest,t.addedSets)),u=v(t=>t.annotationId),d=(s==null?void 0:s.pages)??z,m=(s==null?void 0:s.entries)??J,{loaded:A,more:N,reachNext:S}=K(d),x=E(()=>[...new Set(m.map(t=>O(t.annotation)).filter(t=>!!t&&t!==(n==null?void 0:n.id)))],[m,n==null?void 0:n.id]),C=U(c.layout==="pager"?Q:x),M=x.length>0,i=E(()=>{const t=d.length?new Set(d.slice(0,A).map(a=>a.id)):null;return m.filter(a=>!t||t.has(a.setId)).map(a=>{const g=O(a.annotation),p=g&&g!==(n==null?void 0:n.id)?C.get(g)??null:n;return X(a,p,e,M)})},[d,A,m,n,C,M,e]),b=Math.max((s==null?void 0:s.total)??0,i.length),I=k(null);if(T(()=>{const t=I.current;t===null||!i[t]||(I.current=null,l.selectAnnotation(i[t].id))},[l,i]),!i.length)return null;const h=i.findIndex(t=>t.id===u),w=(t,a)=>{o==null||o(t,a),l.selectAnnotation(t.id)};return c.layout==="pager"?f(L,{...c,forwardedRef:r,steps:{position:h,total:b,direction:"left-to-right",step:(a,g)=>{const p=h+a;if(!(p<0)){if(i[p])return w(i[p],g);N&&(I.current=p,S())}}},nameKey:"informationPanelTabsAnnotations",position:f(B,{position:h,total:b,list:a=>f(j,{layout:"list",forwardedRef:null,onSelect:a})})}):f(R,{children:[f(y,{...c,forwardedRef:r,items:i,selected:h,navigation:"id",language:e,request:l.request,showSummary:true,onActivate:w}),N&&f(V,{onReached:S})]})}const z=[],J=[],Q=[];function U(o){const{clover:r}=P("Items"),[c,l]=q(W);return T(()=>{if(!o.length)return;let e=true;for(const n of o)G(r,n).then(s=>{e&&s&&l(u=>u.has(n)?u:new Map(u).set(n,s))});return()=>{e=false}},[r,o]),c}const W=new Map;function X(o,r,c,l){const e=F(r,o.canvasId),n=D(o.bodies,c),s=n.text?{[n.lang??"none"]:[n.text]}:e==null?void 0:e.label,u=l?r==null?void 0:r.label:e==null?void 0:e.label,d=e&&o.target.rect?H(e,o.target.rect):void 0;return{id:o.id,label:s,summary:n.text?u:void 0,parts:[{id:o.id,type:"Canvas",label:s,resource:e??{id:o.canvasId},...d?{source:d}:{}}]}}export{j as default};
@@ -1 +1 @@
1
- import{A as I,u as a,l as y}from"./shared-DJyYaNgB.mjs";import{s as H}from"./Annotations-BznHfXJT.mjs";import T from"./ControlMenu-BaBwqPBx.mjs";import{C as $}from"./Cue-DKACn0J1.mjs";import{H as z}from"./HideToggle-CzoPlLH7.mjs";import{u as B}from"./useContainerName-jjktq7OB.mjs";import"./styles-Cm1KSkd5.mjs";const G=({id:d,triggerId:C,label:M,labelLang:k,annotations:p,hiddenPages:x=[],onPageVisibilityChange:v,selected:w,onSelect:u,onActivate:i,onClose:D})=>{const h=B(M,k),m=I(false),r=[];p.forEach((n,c)=>{var s,l;const o=r[r.length-1];o&&((s=o.page)==null?void 0:s.text)===((l=n.page)==null?void 0:l.text)?o.items.push(c):r.push({page:n.page,items:[c]})});const E=r.some(n=>!n.page);return a(T,{className:"clover-canvas-annotation-menu","data-testid":"clover-canvas-annotation-menu",id:d,onClose:D,triggerId:C,children:[E&&h.node,r.map((n,c)=>{const o=[...new Set(n.items.flatMap(t=>p[t].pageId??[]))],s=`${d}-page-${c}`,l=v&&o.length>0&&a(z,{hidden:o.every(t=>x.includes(t)),onChange:t=>v(o,!t),of:n.page?s:void 0});return a("fieldset",{...n.page?{"aria-labelledby":s}:h.props,className:"clover-canvas-menu-group clover-annotations-set",children:[n.page?a("legend",{className:"clover-canvas-menu-legend clover-annotations-set-header",children:[a("span",{className:"clover-annotations-title",id:s,...y(n.page.lang),children:n.page.text}),l]}):l&&a("div",{className:"clover-annotations-set-header",children:l}),a("div",{className:"clover-annotations-list",children:n.items.map(t=>{const e=p[t],f=H(e),g=w===e.id,N="image"in e?e.image:void 0;return a("label",{className:"clover-canvas-menu-item clover-annotations-entry","data-selected":g,onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null),onPointerDown:()=>{m.current=true},children:[a("input",{type:"radio",name:d,checked:g,onChange:()=>u(e,m.current),onClick:()=>{(g||!m.current)&&u(e)},onKeyDown:b=>{m.current=false,b.key==="Enter"&&(b.preventDefault(),u(e))},onFocus:()=>i(e.id),onBlur:()=>i(null)}),f!==void 0&&a($,{start:f,className:"clover-annotations-time"}),a("span",{className:"clover-annotations-body clover-cue-text",children:[N&&a("img",{className:"clover-annotations-image",src:N,alt:"",loading:"lazy"}),a("span",{className:"clover-annotations-text",...y(e.label?e.lang:void 0),children:e.label??String(t+1)})]})]},e.id)})})]},c)})]})};export{G as default};
1
+ import{A as I,u as a,l as y}from"./shared-Cqxks7jF.mjs";import{s as H}from"./Annotations-CgPEcwft.mjs";import T from"./ControlMenu-J-gMDza-.mjs";import{C as $}from"./Cue-BzhK_KTz.mjs";import{H as z}from"./HideToggle-D_n5lwkp.mjs";import{u as B}from"./useContainerName-D_XCWIWP.mjs";import"./styles-C9QeBpjd.mjs";const G=({id:d,triggerId:C,label:M,labelLang:k,annotations:p,hiddenPages:x=[],onPageVisibilityChange:v,selected:w,onSelect:u,onActivate:i,onClose:D})=>{const h=B(M,k),m=I(false),r=[];p.forEach((n,c)=>{var s,l;const o=r[r.length-1];o&&((s=o.page)==null?void 0:s.text)===((l=n.page)==null?void 0:l.text)?o.items.push(c):r.push({page:n.page,items:[c]})});const E=r.some(n=>!n.page);return a(T,{className:"clover-canvas-annotation-menu","data-testid":"clover-canvas-annotation-menu",id:d,onClose:D,triggerId:C,children:[E&&h.node,r.map((n,c)=>{const o=[...new Set(n.items.flatMap(t=>p[t].pageId??[]))],s=`${d}-page-${c}`,l=v&&o.length>0&&a(z,{hidden:o.every(t=>x.includes(t)),onChange:t=>v(o,!t),of:n.page?s:void 0});return a("fieldset",{...n.page?{"aria-labelledby":s}:h.props,className:"clover-canvas-menu-group clover-annotations-set",children:[n.page?a("legend",{className:"clover-canvas-menu-legend clover-annotations-set-header",children:[a("span",{className:"clover-annotations-title",id:s,...y(n.page.lang),children:n.page.text}),l]}):l&&a("div",{className:"clover-annotations-set-header",children:l}),a("div",{className:"clover-annotations-list",children:n.items.map(t=>{const e=p[t],f=H(e),g=w===e.id,N="image"in e?e.image:void 0;return a("label",{className:"clover-canvas-menu-item clover-annotations-entry","data-selected":g,onMouseEnter:()=>i(e.id),onMouseLeave:()=>i(null),onPointerDown:()=>{m.current=true},children:[a("input",{type:"radio",name:d,checked:g,onChange:()=>u(e,m.current),onClick:()=>{(g||!m.current)&&u(e)},onKeyDown:b=>{m.current=false,b.key==="Enter"&&(b.preventDefault(),u(e))},onFocus:()=>i(e.id),onBlur:()=>i(null)}),f!==void 0&&a($,{start:f,className:"clover-annotations-time"}),a("span",{className:"clover-annotations-body clover-cue-text",children:[N&&a("img",{className:"clover-annotations-image",src:N,alt:"",loading:"lazy"}),a("span",{className:"clover-annotations-text",...y(e.label?e.lang:void 0),children:e.label??String(t+1)})]})]},e.id)})})]},c)})]})};export{G as default};
@@ -0,0 +1 @@
1
+ import{T as d,ad as qt,f as bt,d as C,aJ as Gt,q as k,A as l,E as Jt,y as j,_ as It,u as jt}from"./shared-Cqxks7jF.mjs";import{w as zt,p as Ot,g as xt,t as Dt,A as Ut}from"./Annotations-CgPEcwft.mjs";import{h as Xt}from"./layout-DbMbjpx4.mjs";const Yt=()=>import("./svg-shape-D1K-WNrY.mjs");function Zt(w){var S;const c=d(()=>!!(w!=null&&w.some(({annotation:s})=>{var p;return(p=qt(s==null?void 0:s.target))==null?void 0:p.svg})),[w]);return((S=bt(Yt,c))==null?void 0:S.readSvgShape)??null}const M=[];function Et({given:w,annotations:c,scene:S,renderer:s,sceneVersion:p,drawn:E,media:I,mediaElement:f,showPlaceholder:F,canvasKey:z,openImages:tt,openMedia:et,host:nt,onModel:H,refind:_=0}){const{canvases:g,language:v,hiddenPages:rt,unlistedPages:yt,onPageVisibilityChange:ct,onAnnotationActive:ut,selectedAnnotation:st,animateAnnotations:ot=false,highlightedAnnotation:Ct,onAnnotationSelect:lt,onAnnotationLink:D}=w,[B,Ft]=C([]),[it,Ht]=C([]),L=rt!==void 0,dt=d(()=>{var n;if(L)return M;const t=new Map;for(const r of c){if(!r.pageId)continue;const o=!(Number((n=g==null?void 0:g[r.targetIndex])==null?void 0:n.duration)>0)&&Gt(r.annotation.motivation,qt(Array.isArray(r.annotation.target)?r.annotation.target[0]:r.annotation.target));t.set(r.pageId,(t.get(r.pageId)??true)&&o)}const e=[...t].filter(([,r])=>r).map(([r])=>r);return e.length?e:M},[L,c,g]),_t=d(()=>{const t=dt.filter(e=>!it.includes(e)&&!B.includes(e));return t.length?[...B,...t]:B},[B,it,dt]),a=rt??_t,U=yt??M,N=k(t=>U.length?t.filter(e=>!e.pageId||!U.includes(e.pageId)):t,[U]),gt=d(()=>N(c).length,[c,N]),T=k(t=>a.length?t.filter(e=>!e.pageId||!a.includes(e.pageId)):t,[a]),Q=l(ct);Q.current=ct;const R=k((t,e)=>{var n;(n=Q.current)==null||n.call(Q,t,e),!L&&(Ft(r=>{const i=r.filter(o=>!t.includes(o));return e?i:[...i,...t]}),Ht(r=>{const i=r.filter(o=>!t.includes(o));return e?[...i,...t]:i}))},[L]),ft=d(()=>zt(T(c),g),[c,T,g]),O=d(()=>{if(!(!S||!g))return(t,e,n)=>{const r=g.findIndex(Wt=>Wt.id===e),i=r===-1?n:r,o=S.placements[i];return o?Xt(g[i],o,t):null}},[S,g]),W=Zt(c),P=d(()=>s&&p>0&&E?Ot(c,O??((t,e,n)=>s.itemRectToWorld(n,t)),W,v):[],[s,c,p,E,O,W,v]),x=d(()=>T(P),[P,T]),X=d(()=>P.length||!O?P:Ot(c,O,W,v),[P,O,c,W,v]),[Bt,Lt]=C(null),[Nt,pt]=C(null),u=st!==void 0?st:Nt,A=l(null),h=l(ut);h.current=ut;const m=l(lt);m.current=lt;const Y=k(t=>{var e;Lt(t),(e=h.current)==null||e.call(h,t)},[]),Z=l(ot);Z.current=ot;const at=l(false);at.current=F;const $=l(f);$.current=f;const Pt=l(s);Pt.current=s;const q=l(null),ht=l(a);ht.current=a;const mt=l(R);mt.current=R;const V=k((t,e=true)=>{var n,r,i;if(t.pageId&&ht.current.includes(t.pageId)&&mt.current([t.pageId],true),pt(t.id),(n=h.current)==null||n.call(h,t.id),(r=m.current)==null||r.call(m,t.id),!at.current){if("start"in t){const o=$.current;if(!o)return;q.current=t.id,e?Jt(o,t.start):o.currentTime=t.start;return}if(A.current=t.id,t.track){const o=$.current;o&&xt(t,o)&&(q.current=t.id);return}(i=Pt.current)==null||i.fitAnnotation(t.world,!Z.current)}},[]),wt=l(u);wt.current=u;const b=k(()=>{var t;return wt.current?(pt(null),A.current=null,(t=m.current)==null||t.call(m,null),true):false},[]),G=l(D);G.current=D;const St=!!D,Qt=d(()=>St?t=>{var e,n;(e=nt.current)==null||e.focus({preventScroll:true}),b(),t.link&&((n=G.current)==null||n.call(G,t.link))}:void 0,[St,b,nt]),vt=l(_);j(()=>{if(!u){A.current=null;return}if(vt.current!==_&&(vt.current=_,A.current=null),A.current===u)return;const t=r=>r.find(i=>i.id===u),e=t(x),n=e??t(P);if(n){if(A.current=n.id,n.track){!e&&f&&xt(n,f);return}s==null||s.fitAnnotation(n.world,!Z.current)}},[u,x,P,f,s,_]);const y=d(()=>I?Dt(c,v):[],[I,c,v]),J=d(()=>T(y),[y,T]),Tt=d(()=>N(y.length?[...X,...y]:X),[X,y,N]);j(()=>{if(!u){q.current=null;return}if(q.current===u||!f)return;const t=J.find(e=>e.id===u);t&&(q.current=t.id,f.currentTime=t.start)},[u,J,f]);const K=l(null),[At,Rt]=C(null);j(()=>{K.current=u??null},[u]),j(()=>{const t=K.current;if(!(!t||!c.some(e=>{var n;return((n=e.annotation)==null?void 0:n.id)===t}))&&(K.current=null,!!F)){if(!I){tt(true);return}et(z),Rt(z)}},[u,c,F,I,z,tt,et]);const kt=d(()=>({menu:Tt,placed:x,timed:J,hiddenPages:a,setPagesVisible:R,listedCount:gt,comments:ft,selected:u??null,select:V,activate:Y,release:b,quietlyOpened:At}),[Tt,x,J,a,R,gt,ft,u,V,Y,b,At]);return It(()=>H(kt),[kt,H]),It(()=>()=>H(null),[H]),s&&p>0&&!F?jt(Ut,{renderer:s,placed:x,sceneVersion:p,active:Bt??Ct??u,selected:u,onActivate:Y,onSelect:V,onFollow:Qt,media:I?f:void 0}):null}export{Et as AnnotationState};
@@ -1 +1 @@
1
- var Q=Object.defineProperty;var tt=(t,o,e)=>o in t?Q(t,o,{enumerable:true,configurable:true,writable:true,value:e}):t[o]=e;var B=(t,o,e)=>tt(t,typeof o!="symbol"?o+"":o,e);import{ac as N,aJ as ot,ad as D,B as W,T as et,A as L,y as j,q as K,_ as nt,$ as st,u as C,k as it,aK as rt,t as at,d as Z,l as ct,R as lt}from"./shared-DJyYaNgB.mjs";import{a as ht}from"./annotation-name-dLmSFXbG.mjs";import{r as ut}from"./link-BiM9KdpG.mjs";import{T as dt}from"./Tip-ByWHicZ5.mjs";import{c as pt}from"./Camera-bs3W3OK0.mjs";import"./styles-Cm1KSkd5.mjs";const q=t=>Array.isArray(t)?t.flatMap(q):ot.includes(t==null?void 0:t.type)?q(t.items??[]):t==null?[]:[t],ft=t=>q(t).map(o=>N(o)),gt=(t,o)=>Math.abs(t.end-o.start)<.001,H=(t,o,e)=>t+(o-t)*e;function vt(t){const o=[...t].sort((e,n)=>e.start-n.start);return o.map((e,n)=>{const i=o[n+1];return e.end===1/0&&i?{...e,end:i.start}:e})}function U(t,o){let e=0,n=t.length-1,i=-1;for(;e<=n;){const d=e+n>>1;t[d].start<=o?(i=d,e=d+1):n=d-1}const r=t[i];if(!r||o>=r.end)return null;const c=t[i+1];if(!c||!gt(r,c)||!Number.isFinite(r.end))return r.world;const a=(o-r.start)/(r.end-r.start||1),[h,l]=[r.world,c.world];return{x:H(h.x,l.x,a),y:H(h.y,l.y,a),width:H(h.width,l.width,a),height:H(h.height,l.height,a)}}const G=t=>t.overlays??(t.overlays=new wt(t.host));class wt{constructor(o){B(this,"container");B(this,"overlays",new Map);B(this,"view");const e=document.createElement("div");e.className="clover-canvas-overlays",Object.assign(e.style,{position:"absolute",inset:"0",overflow:"clip",pointerEvents:"none"}),o.appendChild(e),this.container=e}add(o,e){return this.overlays.set(o,e),o.classList.add("clover-canvas-overlay"),Object.assign(o.style,{position:"absolute",top:"0",left:"0",pointerEvents:"auto"}),o.parentElement!==this.container&&this.container.appendChild(o),()=>{this.overlays.delete(o)}}move(o,e){this.overlays.has(o)&&(this.overlays.set(o,e),this.view&&this.position(...this.view,o))}position(o,e,n){this.view=[o,e];const i=o.rotation*180/Math.PI,r=Math.cos(o.rotation)>.9999,c=r?window.devicePixelRatio||1:0,a=h=>c?Math.round(h*c)/c:h;for(const[h,l]of this.overlays){if(n&&h!==n)continue;const d=pt(o,e,{x:l.x+l.width/2,y:l.y+l.height/2}),f=a(d.x-l.width*o.zoom/2),g=a(d.y-l.height*o.zoom/2),p=a(l.width*o.zoom),v=a(l.height*o.zoom);h.style.width=`${p}px`,h.style.height=`${v}px`,h.style.transform=`translate(${f}px, ${g}px)`+(i?` rotate(${i}deg)`:"");const{style:w,dataset:m}=h;if(r){w.setProperty("--clover-overlay-x",`${d.x}px`),w.setProperty("--clover-overlay-top",`${g}px`),w.setProperty("--clover-overlay-bottom",`${g+v}px`);const $=d.y>e.height/2?"above":"below";m.overlayRoom!==$&&(m.overlayRoom=$)}else w.removeProperty("--clover-overlay-x"),w.removeProperty("--clover-overlay-top"),w.removeProperty("--clover-overlay-bottom"),delete m.overlayRoom}}dispose(){this.overlays.clear(),this.container.remove()}}const mt=t=>"start"in t,St=t=>{var o,e;return mt(t)?t.start:(e=(o=t.track)==null?void 0:o[0])==null?void 0:e.start},xt=(t,o)=>!t.track||U(t.track,o)!==null;function $t(t,o){return xt(t,o.currentTime)?false:(o.currentTime=t.track[0].start,true)}function yt(t,o,e){var r,c,a;const n=ft(t==null?void 0:t.target);if(!((r=n[0])!=null&&r.rect)||!((c=n[0])!=null&&c.t))return null;const i=[];for(const h of n){const l=W((a=h.t)==null?void 0:a.replace(/^npt:/,""));if(!h.rect||!l)continue;const{x:d,y:f,w:g,h:p}=h.rect,v=o({x:d,y:f,width:g,height:p},h.id,e);v&&i.push({start:l.start,end:l.end??1/0,world:v})}return i.length?vt(i):null}function J(t,o){const{text:e,lang:n}=at(t,o);return e?{page:{text:e,...n?{lang:n}:{}}}:{}}function Kt(t,o){var n;const e=[];for(const{annotation:i,pageLabel:r,pageId:c}of t){const a=N([i==null?void 0:i.target].flat()[0]),h=W((n=a==null?void 0:a.t)==null?void 0:n.replace(/^npt:/,""));if(!h||a.rect||a.point||a.svg)continue;const{text:l,lang:d}=X(i,o);e.push({id:i.id,...l?{label:l}:{},...d?{lang:d}:{},...h,...J(r,o),...c?{pageId:c}:{}})}return e}const S=40;function Nt(t,o,e=null,n){var r;const i=[];for(const{annotation:c,targetIndex:a,pageLabel:h,pageId:l,place:d}of t){const f=N(c==null?void 0:c.target);if(!f)continue;let g=null,p;const v=yt(c,o,a);if(v){const{x:s,y:u,w:k,h:R}=f.rect;g={x:s,y:u,width:k,height:R}}else if(f.rect){const{x:s,y:u,w:k,h:R}=f.rect;g={x:s,y:u,width:k,height:R}}else if(f.point){const{x:s,y:u}=f.point;g={x:s-S/2,y:u-S/2,width:S,height:S},p={kind:"point"}}else if(f.svg&&e){const s=e(f.svg);s&&(g=s.box,p={kind:"svg",svg:s})}if(!g)continue;const w=v?v[0].world:o(g,f.id,a);if(!w)continue;const{text:m,lang:$}=X(c,n),P=ut(c),T=(r=D(c).find(s=>(s==null?void 0:s.type)==="Image"&&/^https?:\/\//i.test(s.id??"")))==null?void 0:r.id;i.push({id:c.id,label:m,...$?{lang:$}:{},world:w,...p?{shape:p}:{},...v?{track:v}:{},...P?{link:P}:{},...T?{image:T}:{},...J(h,n),...l?{pageId:l}:{},...d?{place:d}:{}})}return i}const V=({world:t})=>t.width*t.height,kt=(t,o)=>t.x>=o.x&&t.y>=o.y&&t.x+t.width<=o.x+o.width&&t.y+t.height<=o.y+o.height,y=t=>String(Math.round(t*1e3)/1e3||0);function bt(t,o){var g,p;const e=t.world,n=o.world;if(((g=o.shape)==null?void 0:g.kind)==="point"||n.x>=e.x+e.width||n.x+n.width<=e.x||n.y>=e.y+e.height||n.y+n.height<=e.y)return null;const[i,r]=[e.width,e.height],[c,a]=[n.x-e.x,n.y-e.y],h=`${y(-i/10)} ${y(-r/10)} ${y(i*1.2)} ${y(r*1.2)}`,l=`M${y(-i/10)} ${y(-r/10)}h${y(i*1.2)}v${y(r*1.2)}h${y(-i*1.2)}Z`;let d;if(((p=o.shape)==null?void 0:p.kind)==="svg"){const{box:v,shapes:w}=o.shape.svg,m=w.map(({tag:$,attributes:P})=>`<${$} ${Object.entries(P).map(([T,s])=>`${T}="${s}"`).join(" ")}/>`).join("");d=`<mask id="m"><path fill="#fff" d="${l}"/><svg x="${y(c)}" y="${y(a)}" width="${y(n.width)}" height="${y(n.height)}" viewBox="${v.x} ${v.y} ${Math.max(v.width,1)} ${Math.max(v.height,1)}" preserveAspectRatio="none" overflow="visible"><g fill="#000">${m}</g></svg></mask><path d="${l}" mask="url(#m)"/>`}else d=`<path fill-rule="evenodd" d="${l}M${y(c)} ${y(a)}h${y(n.width)}v${y(n.height)}h${y(-n.width)}Z"/>`;const f=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${h}" preserveAspectRatio="none">${d}</svg>`;return`url("data:image/svg+xml,${encodeURIComponent(f)}")`}const qt=({renderer:t,placed:o,sceneVersion:e,active:n,selected:i,onActivate:r,onSelect:c,onFollow:a,media:h})=>{const l=et(()=>{const s=new Map;return[...o].sort((u,k)=>V(k)-V(u)).forEach((u,k)=>s.set(u,k)),s},[o]),d=o.find(s=>s.id===n),f=L(null);j(()=>{const s=o.find(u=>u.id===i&&u.track);i||(f.current=null),!(!s||!h||f.current===i)&&(f.current=i,$t(s,h))},[o,i,h]);const g=s=>{const u=l.get(s)??0;return d?s===d?o.length:u>(l.get(d)??0)&&!s.track&&!d.track&&kt(s.world,d.world)?o.length+1+u:u:u},p=L(new Map),v=L(new Map),w=L(new WeakMap),m=L({placed:o,current:d,depthOf:g});m.current={placed:o,current:d,depthOf:g};const $=K(s=>{const{placed:u,current:k,depthOf:R}=m.current,O=M=>v.current.get(M.id),x=k&&O(k)!==null?k:void 0,b=M=>{const A=p.current.get(M.id);if(!A)return;const F=O(M),I=x&&M!==x&&F!==null&&R(M)<u.length?bt({...M,world:F??M.world},{...x,world:O(x)??x.world}):null;(w.current.get(A)??"")!==(I??"")&&(w.current.set(A,I??""),I?A.style.setProperty("--clover-annotation-mask",I):A.style.removeProperty("--clover-annotation-mask"))};s&&s!==k?b(s):u.forEach(b)},[]);nt(()=>$());const P=K((s,u)=>{u?p.current.set(s,u):p.current.delete(s)},[]),T=K((s,u)=>{v.current.set(s.id,u),$(s)},[$]);return st(C(it,{children:o.map((s,u)=>C(Tt,{entry:s,name:s.label??String(u+1),lang:s.label?s.lang:void 0,depth:g(s),register:P,onMove:T,renderer:t,active:n===s.id,selected:i===s.id,onActivate:r,onSelect:c,onFollow:a,media:h},`${s.id}|${e}`))}),G(t).container)};let Mt;const _=()=>Mt??(Mt=import("./panClearOfControls-Cn2ZXsZi.mjs")),Tt=({entry:t,name:o,lang:e,depth:n,register:i,onMove:r,renderer:c,active:a,selected:h,onActivate:l,onSelect:d,onFollow:f,media:g})=>{var A,F,I;const[p,v]=Z(null),{id:w,place:m}=t,$=m&&`${m.index} / ${m.total}`,P=K(E=>{v(E),i(w,E)},[w,i]),{x:T,y:s,width:u,height:k}=t.world;j(()=>{if(!p)return;const E=G(c).add(p,{x:T,y:s,width:u,height:k});return c.invalidate(),E},[p,c,T,s,u,k]);const R=Et(p,t.track,c,g,()=>l(null),E=>r(t,E)),{link:O}=t,x=O&&!O.canvasId&&!O.manifestId?O.id:void 0,b=O&&!x&&f?()=>f(t):void 0;return C(x?"a":"button",{ref:P,...x?{href:x,target:"_blank",rel:"noopener noreferrer"}:{type:"button"},id:t.id,className:"clover-canvas-annotation",hidden:!R,"data-active":a?"true":"false","data-shape":((A=t.shape)==null?void 0:A.kind)??"rect","data-track":t.track?"":void 0,"data-link":x||b?"true":void 0,"aria-label":$?`${o} ${$}`:o,"aria-current":h?"true":void 0,...ct(e),style:{"--clover-annotation-depth":n},onMouseEnter:()=>l(t.id),onMouseLeave:()=>l(null),onFocus:()=>{l(t.id),_()},onKeyUp:E=>{if(E.key!=="Tab")return;const z=E.currentTarget;_().then(({panClearOfControls:Y})=>{document.activeElement===z&&Y(c,z)})},onBlur:()=>l(null),onKeyDown:At,onClick:E=>{E.stopPropagation(),!x&&(b?b():d(t))},children:[((F=t.shape)==null?void 0:F.kind)==="point"&&C("span",{className:"clover-canvas-annotation-point","aria-hidden":"true"}),((I=t.shape)==null?void 0:I.kind)==="svg"&&C(Ot,{svg:t.shape.svg}),C(dt,{label:o,scrolls:true,image:t.image,after:$})]})};function Et(t,o,e,n,i,r){const c=!!o&&n!==void 0,[a,h]=Z(()=>!c||(n?U(o,n.currentTime)!==null:false)),l=L(i);l.current=i;const d=L(r);return d.current=r,j(()=>{if(!o||n===void 0){h(true);return}if(!n){h(false);return}let f;const g=x=>{var A,F,I;const b=U(o,x);b&&t&&((A=e.overlays)==null||A.move(t,b)),d.current(b);const M=b!==null;if(M!==f){if(f=M,!M&&t){const E=t.matches(":hover");t.contains(document.activeElement)?(I=(F=e.overlays)==null?void 0:F.container.parentElement)==null||I.focus({preventScroll:true}):E&&l.current()}h(M)}},p=n,v=()=>typeof p.requestVideoFrameCallback=="function"&&p.videoWidth>0;let w=0,m=0;const $=(x,{mediaTime:b})=>{g(b),m=p.requestVideoFrameCallback($)},P=()=>{g(n.currentTime),w=requestAnimationFrame(P)},T=()=>{cancelAnimationFrame(w),m&&p.cancelVideoFrameCallback(m),w=m=0},s=()=>{T(),v()?m=p.requestVideoFrameCallback($):w=requestAnimationFrame(P)},u=()=>g(n.currentTime),k=()=>n.paused&&u(),R=()=>{T(),u()},O=[["play",s],["pause",R],["ended",R],["seeking",u],["seeked",u],["loadeddata",u],["timeupdate",k]];return O.forEach(([x,b])=>n.addEventListener(x,b)),u(),n.paused||s(),()=>{T(),O.forEach(([x,b])=>n.removeEventListener(x,b))}},[t,o,n,e]),a}const Ot=({svg:t})=>{const{x:o,y:e,width:n,height:i}=t.box,r=t.shapes.map(({tag:c,attributes:a},h)=>lt.createElement(c,{key:h,...a,vectorEffect:"non-scaling-stroke"}));return C("svg",{className:"clover-canvas-annotation-shape",viewBox:`${o} ${e} ${Math.max(n,1)} ${Math.max(i,1)}`,preserveAspectRatio:"none","aria-hidden":"true",focusable:"false",children:[C("g",{children:r}),C("g",{children:r}),C("g",{children:r})]})};function X(t,o){return ht(rt(t),o)}const Pt={ArrowDown:()=>32,ArrowUp:()=>-32,PageDown:t=>t.clientHeight-32,PageUp:t=>32-t.clientHeight,End:t=>t.scrollHeight,Home:t=>-t.scrollHeight};function At(t){const o=t.currentTarget.querySelector(":scope > .clover-tip"),e=Pt[t.key];if(!o||!e||t.altKey||t.ctrlKey||t.metaKey)return false;const n=e(o);return(n>0?o.scrollHeight-o.clientHeight-o.scrollTop:o.scrollTop)<1?false:(t.preventDefault(),o.scrollBy({top:n}),true)}function Ut(t,o){const e=new Map;for(const{annotation:n,targetIndex:i}of t??[]){const r=N([n==null?void 0:n.target].flat()[0]);if(r.rect||r.point||r.svg||r.t||!D(n).some(a=>typeof(a==null?void 0:a.value)=="string"||(a==null?void 0:a.type)==="Image"))continue;const c=(o==null?void 0:o.find(a=>a.id===r.id))??(r.id||o==null?void 0:o[i]);c&&e.set(c.id,[...e.get(c.id)??[],n])}return e}export{qt as A,$t as g,Nt as p,St as s,Kt as t,Ut as w};
1
+ var Q=Object.defineProperty;var tt=(t,o,e)=>o in t?Q(t,o,{enumerable:true,configurable:true,writable:true,value:e}):t[o]=e;var B=(t,o,e)=>tt(t,typeof o!="symbol"?o+"":o,e);import{ad as N,aK as ot,ae as D,B as W,T as et,A as L,y as j,q as K,_ as nt,$ as st,u as C,k as it,aL as rt,t as at,d as Z,l as ct,R as lt}from"./shared-Cqxks7jF.mjs";import{a as ht}from"./annotation-name-U_Yiz_CP.mjs";import{r as ut}from"./link-BIc77IY3.mjs";import{T as dt}from"./Tip-DxvfQm-l.mjs";import{c as pt}from"./Camera-i2fafLIh.mjs";import"./styles-C9QeBpjd.mjs";const q=t=>Array.isArray(t)?t.flatMap(q):ot.includes(t==null?void 0:t.type)?q(t.items??[]):t==null?[]:[t],ft=t=>q(t).map(o=>N(o)),gt=(t,o)=>Math.abs(t.end-o.start)<.001,H=(t,o,e)=>t+(o-t)*e;function vt(t){const o=[...t].sort((e,n)=>e.start-n.start);return o.map((e,n)=>{const i=o[n+1];return e.end===1/0&&i?{...e,end:i.start}:e})}function U(t,o){let e=0,n=t.length-1,i=-1;for(;e<=n;){const d=e+n>>1;t[d].start<=o?(i=d,e=d+1):n=d-1}const r=t[i];if(!r||o>=r.end)return null;const c=t[i+1];if(!c||!gt(r,c)||!Number.isFinite(r.end))return r.world;const a=(o-r.start)/(r.end-r.start||1),[h,l]=[r.world,c.world];return{x:H(h.x,l.x,a),y:H(h.y,l.y,a),width:H(h.width,l.width,a),height:H(h.height,l.height,a)}}const G=t=>t.overlays??(t.overlays=new wt(t.host));class wt{constructor(o){B(this,"container");B(this,"overlays",new Map);B(this,"view");const e=document.createElement("div");e.className="clover-canvas-overlays",Object.assign(e.style,{position:"absolute",inset:"0",overflow:"clip",pointerEvents:"none"}),o.appendChild(e),this.container=e}add(o,e){return this.overlays.set(o,e),o.classList.add("clover-canvas-overlay"),Object.assign(o.style,{position:"absolute",top:"0",left:"0",pointerEvents:"auto"}),o.parentElement!==this.container&&this.container.appendChild(o),()=>{this.overlays.delete(o)}}move(o,e){this.overlays.has(o)&&(this.overlays.set(o,e),this.view&&this.position(...this.view,o))}position(o,e,n){this.view=[o,e];const i=o.rotation*180/Math.PI,r=Math.cos(o.rotation)>.9999,c=r?window.devicePixelRatio||1:0,a=h=>c?Math.round(h*c)/c:h;for(const[h,l]of this.overlays){if(n&&h!==n)continue;const d=pt(o,e,{x:l.x+l.width/2,y:l.y+l.height/2}),f=a(d.x-l.width*o.zoom/2),g=a(d.y-l.height*o.zoom/2),p=a(l.width*o.zoom),v=a(l.height*o.zoom);h.style.width=`${p}px`,h.style.height=`${v}px`,h.style.transform=`translate(${f}px, ${g}px)`+(i?` rotate(${i}deg)`:"");const{style:w,dataset:m}=h;if(r){w.setProperty("--clover-overlay-x",`${d.x}px`),w.setProperty("--clover-overlay-top",`${g}px`),w.setProperty("--clover-overlay-bottom",`${g+v}px`);const $=d.y>e.height/2?"above":"below";m.overlayRoom!==$&&(m.overlayRoom=$)}else w.removeProperty("--clover-overlay-x"),w.removeProperty("--clover-overlay-top"),w.removeProperty("--clover-overlay-bottom"),delete m.overlayRoom}}dispose(){this.overlays.clear(),this.container.remove()}}const mt=t=>"start"in t,St=t=>{var o,e;return mt(t)?t.start:(e=(o=t.track)==null?void 0:o[0])==null?void 0:e.start},xt=(t,o)=>!t.track||U(t.track,o)!==null;function $t(t,o){return xt(t,o.currentTime)?false:(o.currentTime=t.track[0].start,true)}function yt(t,o,e){var r,c,a;const n=ft(t==null?void 0:t.target);if(!((r=n[0])!=null&&r.rect)||!((c=n[0])!=null&&c.t))return null;const i=[];for(const h of n){const l=W((a=h.t)==null?void 0:a.replace(/^npt:/,""));if(!h.rect||!l)continue;const{x:d,y:f,w:g,h:p}=h.rect,v=o({x:d,y:f,width:g,height:p},h.id,e);v&&i.push({start:l.start,end:l.end??1/0,world:v})}return i.length?vt(i):null}function X(t,o){const{text:e,lang:n}=at(t,o);return e?{page:{text:e,...n?{lang:n}:{}}}:{}}function Kt(t,o){var n;const e=[];for(const{annotation:i,pageLabel:r,pageId:c}of t){const a=N([i==null?void 0:i.target].flat()[0]),h=W((n=a==null?void 0:a.t)==null?void 0:n.replace(/^npt:/,""));if(!h||a.rect||a.point||a.svg)continue;const{text:l,lang:d}=Y(i,o);e.push({id:i.id,...l?{label:l}:{},...d?{lang:d}:{},...h,...X(r,o),...c?{pageId:c}:{}})}return e}const S=40;function Nt(t,o,e=null,n){var r;const i=[];for(const{annotation:c,targetIndex:a,pageLabel:h,pageId:l,place:d}of t){const f=N(c==null?void 0:c.target);if(!f)continue;let g=null,p;const v=yt(c,o,a);if(v){const{x:s,y:u,w:k,h:R}=f.rect;g={x:s,y:u,width:k,height:R}}else if(f.rect){const{x:s,y:u,w:k,h:R}=f.rect;g={x:s,y:u,width:k,height:R}}else if(f.point){const{x:s,y:u}=f.point;g={x:s-S/2,y:u-S/2,width:S,height:S},p={kind:"point"}}else if(f.svg&&e){const s=e(f.svg);s&&(g=s.box,p={kind:"svg",svg:s})}if(!g)continue;const w=v?v[0].world:o(g,f.id,a);if(!w)continue;const{text:m,lang:$}=Y(c,n),P=ut(c),T=(r=D(c).find(s=>(s==null?void 0:s.type)==="Image"&&/^https?:\/\//i.test(s.id??"")))==null?void 0:r.id;i.push({id:c.id,label:m,...$?{lang:$}:{},world:w,...p?{shape:p}:{},...v?{track:v}:{},...P?{link:P}:{},...T?{image:T}:{},...X(h,n),...l?{pageId:l}:{},...d?{place:d}:{}})}return i}const V=({world:t})=>t.width*t.height,kt=(t,o)=>t.x>=o.x&&t.y>=o.y&&t.x+t.width<=o.x+o.width&&t.y+t.height<=o.y+o.height,y=t=>String(Math.round(t*1e3)/1e3||0);function bt(t,o){var g,p;const e=t.world,n=o.world;if(((g=o.shape)==null?void 0:g.kind)==="point"||n.x>=e.x+e.width||n.x+n.width<=e.x||n.y>=e.y+e.height||n.y+n.height<=e.y)return null;const[i,r]=[e.width,e.height],[c,a]=[n.x-e.x,n.y-e.y],h=`${y(-i/10)} ${y(-r/10)} ${y(i*1.2)} ${y(r*1.2)}`,l=`M${y(-i/10)} ${y(-r/10)}h${y(i*1.2)}v${y(r*1.2)}h${y(-i*1.2)}Z`;let d;if(((p=o.shape)==null?void 0:p.kind)==="svg"){const{box:v,shapes:w}=o.shape.svg,m=w.map(({tag:$,attributes:P})=>`<${$} ${Object.entries(P).map(([T,s])=>`${T}="${s}"`).join(" ")}/>`).join("");d=`<mask id="m"><path fill="#fff" d="${l}"/><svg x="${y(c)}" y="${y(a)}" width="${y(n.width)}" height="${y(n.height)}" viewBox="${v.x} ${v.y} ${Math.max(v.width,1)} ${Math.max(v.height,1)}" preserveAspectRatio="none" overflow="visible"><g fill="#000">${m}</g></svg></mask><path d="${l}" mask="url(#m)"/>`}else d=`<path fill-rule="evenodd" d="${l}M${y(c)} ${y(a)}h${y(n.width)}v${y(n.height)}h${y(-n.width)}Z"/>`;const f=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="${h}" preserveAspectRatio="none">${d}</svg>`;return`url("data:image/svg+xml,${encodeURIComponent(f)}")`}const qt=({renderer:t,placed:o,sceneVersion:e,active:n,selected:i,onActivate:r,onSelect:c,onFollow:a,media:h})=>{const l=et(()=>{const s=new Map;return[...o].sort((u,k)=>V(k)-V(u)).forEach((u,k)=>s.set(u,k)),s},[o]),d=o.find(s=>s.id===n),f=L(null);j(()=>{const s=o.find(u=>u.id===i&&u.track);i||(f.current=null),!(!s||!h||f.current===i)&&(f.current=i,$t(s,h))},[o,i,h]);const g=s=>{const u=l.get(s)??0;return d?s===d?o.length:u>(l.get(d)??0)&&!s.track&&!d.track&&kt(s.world,d.world)?o.length+1+u:u:u},p=L(new Map),v=L(new Map),w=L(new WeakMap),m=L({placed:o,current:d,depthOf:g});m.current={placed:o,current:d,depthOf:g};const $=K(s=>{const{placed:u,current:k,depthOf:R}=m.current,O=M=>v.current.get(M.id),x=k&&O(k)!==null?k:void 0,b=M=>{const A=p.current.get(M.id);if(!A)return;const F=O(M),I=x&&M!==x&&F!==null&&R(M)<u.length?bt({...M,world:F??M.world},{...x,world:O(x)??x.world}):null;(w.current.get(A)??"")!==(I??"")&&(w.current.set(A,I??""),I?A.style.setProperty("--clover-annotation-mask",I):A.style.removeProperty("--clover-annotation-mask"))};s&&s!==k?b(s):u.forEach(b)},[]);nt(()=>$());const P=K((s,u)=>{u?p.current.set(s,u):p.current.delete(s)},[]),T=K((s,u)=>{v.current.set(s.id,u),$(s)},[$]);return st(C(it,{children:o.map((s,u)=>C(Tt,{entry:s,name:s.label??String(u+1),lang:s.label?s.lang:void 0,depth:g(s),register:P,onMove:T,renderer:t,active:n===s.id,selected:i===s.id,onActivate:r,onSelect:c,onFollow:a,media:h},`${s.id}|${e}`))}),G(t).container)};let Mt;const _=()=>Mt??(Mt=import("./panClearOfControls-Cn2ZXsZi.mjs")),Tt=({entry:t,name:o,lang:e,depth:n,register:i,onMove:r,renderer:c,active:a,selected:h,onActivate:l,onSelect:d,onFollow:f,media:g})=>{var A,F,I;const[p,v]=Z(null),{id:w,place:m}=t,$=m&&`${m.index} / ${m.total}`,P=K(E=>{v(E),i(w,E)},[w,i]),{x:T,y:s,width:u,height:k}=t.world;j(()=>{if(!p)return;const E=G(c).add(p,{x:T,y:s,width:u,height:k});return c.invalidate(),E},[p,c,T,s,u,k]);const R=Et(p,t.track,c,g,()=>l(null),E=>r(t,E)),{link:O}=t,x=O&&!O.canvasId&&!O.manifestId?O.id:void 0,b=O&&!x&&f?()=>f(t):void 0;return C(x?"a":"button",{ref:P,...x?{href:x,target:"_blank",rel:"noopener noreferrer"}:{type:"button"},id:t.id,className:"clover-canvas-annotation",hidden:!R,"data-active":a?"true":"false","data-shape":((A=t.shape)==null?void 0:A.kind)??"rect","data-track":t.track?"":void 0,"data-link":x||b?"true":void 0,"aria-label":$?`${o} ${$}`:o,"aria-current":h?"true":void 0,...ct(e),style:{"--clover-annotation-depth":n},onMouseEnter:()=>l(t.id),onMouseLeave:()=>l(null),onFocus:()=>{l(t.id),_()},onKeyUp:E=>{if(E.key!=="Tab")return;const z=E.currentTarget;_().then(({panClearOfControls:J})=>{document.activeElement===z&&J(c,z)})},onBlur:()=>l(null),onKeyDown:At,onClick:E=>{E.stopPropagation(),!x&&(b?b():d(t))},children:[((F=t.shape)==null?void 0:F.kind)==="point"&&C("span",{className:"clover-canvas-annotation-point","aria-hidden":"true"}),((I=t.shape)==null?void 0:I.kind)==="svg"&&C(Ot,{svg:t.shape.svg}),C(dt,{label:o,scrolls:true,image:t.image,after:$})]})};function Et(t,o,e,n,i,r){const c=!!o&&n!==void 0,[a,h]=Z(()=>!c||(n?U(o,n.currentTime)!==null:false)),l=L(i);l.current=i;const d=L(r);return d.current=r,j(()=>{if(!o||n===void 0){h(true);return}if(!n){h(false);return}let f;const g=x=>{var A,F,I;const b=U(o,x);b&&t&&((A=e.overlays)==null||A.move(t,b)),d.current(b);const M=b!==null;if(M!==f){if(f=M,!M&&t){const E=t.matches(":hover");t.contains(document.activeElement)?(I=(F=e.overlays)==null?void 0:F.container.parentElement)==null||I.focus({preventScroll:true}):E&&l.current()}h(M)}},p=n,v=()=>typeof p.requestVideoFrameCallback=="function"&&p.videoWidth>0;let w=0,m=0;const $=(x,{mediaTime:b})=>{g(b),m=p.requestVideoFrameCallback($)},P=()=>{g(n.currentTime),w=requestAnimationFrame(P)},T=()=>{cancelAnimationFrame(w),m&&p.cancelVideoFrameCallback(m),w=m=0},s=()=>{T(),v()?m=p.requestVideoFrameCallback($):w=requestAnimationFrame(P)},u=()=>g(n.currentTime),k=()=>n.paused&&u(),R=()=>{T(),u()},O=[["play",s],["pause",R],["ended",R],["seeking",u],["seeked",u],["loadeddata",u],["timeupdate",k]];return O.forEach(([x,b])=>n.addEventListener(x,b)),u(),n.paused||s(),()=>{T(),O.forEach(([x,b])=>n.removeEventListener(x,b))}},[t,o,n,e]),a}const Ot=({svg:t})=>{const{x:o,y:e,width:n,height:i}=t.box,r=t.shapes.map(({tag:c,attributes:a},h)=>lt.createElement(c,{key:h,...a,vectorEffect:"non-scaling-stroke"}));return C("svg",{className:"clover-canvas-annotation-shape",viewBox:`${o} ${e} ${Math.max(n,1)} ${Math.max(i,1)}`,preserveAspectRatio:"none","aria-hidden":"true",focusable:"false",children:[C("g",{children:r}),C("g",{children:r}),C("g",{children:r})]})};function Y(t,o){return ht(rt(t),o)}const Pt={ArrowDown:()=>32,ArrowUp:()=>-32,PageDown:t=>t.clientHeight-32,PageUp:t=>32-t.clientHeight,End:t=>t.scrollHeight,Home:t=>-t.scrollHeight};function At(t){const o=t.currentTarget.querySelector(":scope > .clover-tip"),e=Pt[t.key];if(!o||!e||t.altKey||t.ctrlKey||t.metaKey)return false;const n=e(o);return(n>0?o.scrollHeight-o.clientHeight-o.scrollTop:o.scrollTop)<1?false:(t.preventDefault(),o.scrollBy({top:n}),true)}function Ut(t,o){const e=new Map;for(const{annotation:n,targetIndex:i}of t??[]){const r=N([n==null?void 0:n.target].flat()[0]);if(r.rect||r.point||r.svg||r.t||!D(n).some(a=>typeof(a==null?void 0:a.value)=="string"||(a==null?void 0:a.type)==="Image"))continue;const c=(o==null?void 0:o.find(a=>a.id===r.id))??(r.id||o==null?void 0:o[i]);c&&e.set(c.id,[...e.get(c.id)??[],n])}return e}export{qt as A,$t as g,Nt as p,St as s,Kt as t,Ut as w};
@@ -1,2 +1,2 @@
1
- import{D as lt,a as Z,e as D,c as q,s as Ct,n as Nt,o as $t,R as rt,r as At,u as o,t as V,w as Tt,B as dt,E as Et,b as ut,F as mt,T as O,d as tt,A as Ot,y as X,l as M,G as Mt,H as Bt,v as qt,k as it,f as yt}from"./shared-DJyYaNgB.mjs";import{E as Pt}from"./EntryBodies-BeD_WacH.mjs";import{u as Rt,L as Vt}from"./ListEnd-Ch79vv6H.mjs";import{a as Ft}from"./annotation-name-dLmSFXbG.mjs";import{r as Ht,a as jt}from"./link-BiM9KdpG.mjs";import{s as Gt}from"./show-link-DRW4U86r.mjs";import{f as Kt,r as _t}from"./fetchManifest-J64cuwEZ.mjs";import{j as ht}from"./classnames-DukgfdpI.mjs";import{b as ct,s as zt}from"./bringIntoView-CQH5ZgMM.mjs";import{a as Y}from"./heading-Cjt0f-Eu.mjs";import{C as Dt}from"./Cue-DKACn0J1.mjs";import{E as Ut}from"./EntryThumbnail-Cs_9m02f.mjs";import{H as ft}from"./HideToggle-CzoPlLH7.mjs";import{u as gt,c as vt,s as z}from"./readingLanguages-BB0nHlI0.mjs";import{L as pt}from"./LanguageChoice-I2zbqR8s.mjs";import"./styles-Cm1KSkd5.mjs";function bt(n){const s=n.bodies.filter(e=>{var u;return!e.image&&((u=e.value)==null?void 0:u.trim())}).map(e=>e.language).filter(e=>!!e&&e!=="none");return[...new Set(s)]}function xt(n){const s=n.map(bt),e=[...new Set(s.flat())];return e.length<2?[]:s.some(a=>a.length&&e.some(c=>!a.includes(c)))?e:[]}function St(n,s){if(!s)return true;const e=bt(n);return!e.length||e.includes(s)}const Wt=[],wn=lt(function({scope:s="all",renderEntry:e,headingLevel:u=3,as:a="div",className:c,...m},l){const{t:r,langOf:h}=Z(),{clover:d,language:S}=D("Annotations"),I=q(t=>Ct(t.manifest,t.addedSets)),N=q(t=>Nt(t.manifest,t.canvasId)),T=q(t=>$t(t.manifest,t.addedSets,t.hiddenSets,t.shownSets)),b=q(t=>t.annotationId),$=rt.useSyncExternalStore(d.highlight.subscribe,d.highlight.get,d.highlight.get),f=t=>{const v=Tt(I,t),x=v&&dt(v.target.t),P=d.media.get();x&&P&&N.some(F=>F.id===v.canvasId)&&Et(P,x.start),d.selectAnnotation(t)},k=q(t=>s==="all"?At(t.manifest):Wt),w=Rt(k),L=t=>t.entries.filter(v=>N.some(x=>x.id===v.canvasId)),A=I.map(t=>({set:t,entries:L(t)})).filter(({entries:t})=>t.length),C=Y(u),y={text:r("annotationsShow"),lang:h("annotationsShow")};return s==="all"?o(Zt,{ref:l,as:a,className:c,rest:m,sets:I,shown:N.map(t=>t.id),headingLevel:u,language:S,showLabel:y,hiddenSets:T,selected:b,highlighted:$,renderEntry:e,onSelect:f,onHighlight:t=>d.highlight.emit(t),onVisible:(t,v)=>t.forEach(x=>d.setSetVisible(x,v)),end:w.more&&o(Vt,{onReached:w.reachNext})}):A.length?o(a,{ref:l,className:ht("clover-annotations",c),...m,children:A.map(({set:t,entries:v})=>o(Jt,{set:t,entries:v,canvases:N,Heading:C,headingLevel:u,language:S,title:V(t.label,S),showLabel:y,hidden:T.includes(t.id),selected:b,highlighted:$,renderEntry:e,onSelect:f,onHighlight:x=>d.highlight.emit(x),onVisible:x=>d.setSetVisible(t.id,x)},t.id))}):null});function Jt({set:n,entries:s,canvases:e,Heading:u,headingLevel:a,title:c,language:m,showLabel:l,hidden:r,selected:h,highlighted:d,renderEntry:S,onSelect:I,onHighlight:N,onVisible:T}){const b=ut(),$=c.text?a+1:a,f=O(()=>xt(s),[s]),[k,w]=tt(),L=gt(),A=vt(L,f),C=A?z(f,L.chosen):z(f,(L==null?void 0:L.chosen)??m,k),y=s.filter(t=>St(t,C));return o("section",{className:"clover-annotations-set","aria-labelledby":c.text?`${b}-title`:void 0,"data-set":n.id,children:[o("div",{className:"clover-annotations-set-header",children:[c.text&&o(u,{className:"clover-annotations-title",id:`${b}-title`,...M(c.lang),children:c.text}),C&&!A&&o(pt,{languages:f,chosen:C,onChange:w,nameKey:"annotationsLanguage",part:"clover-annotations"}),o(ft,{hidden:r,onChange:t=>T(!t),of:c.text?`${b}-title`:void 0})]}),o("ol",{className:"clover-annotations-list",children:y.map((t,v)=>o(wt,{entry:t,canvas:e.find(x=>x.id===t.canvasId),index:v,headingLevel:$,language:m,showLabel:l,selected:t.id===h,highlighted:t.id===d,renderEntry:S,onSelect:I,onHighlight:N},t.id))})]})}function Qt(n,s,e){const u=new Map(s.map((c,m)=>[c.id,m])),a=new Map;for(const c of n){const m=V(c.label,e),l=m.text;let r=a.get(l);r||(r={title:m,setIds:[],byCanvas:new Map},a.set(l,r)),r.setIds.push(c.id);for(const h of c.entries){const d=r.byCanvas.get(h.canvasId)??[];d.push(h),r.byCanvas.set(h.canvasId,d)}}return[...a.entries()].map(([c,m])=>({key:c,title:m.title,setIds:m.setIds,canvases:Xt([...m.byCanvas.entries()],u).map(([l,r])=>{var h;return{canvasId:l,label:V((h=s.find(d=>d.id===l))==null?void 0:h.label,e),entries:r}})}))}function Xt(n,s){return n.every(([e])=>s.has(e))?n.sort(([e],[u])=>s.get(e)-s.get(u)):n}function Yt(n,s){const{clover:e,language:u}=D("Annotations"),a=O(()=>{const l=new Set;for(const r of n)for(const h of r.canvases){if(s.has(h.canvasId))continue;const d=Mt(h.entries[0].annotation);d&&l.add(d)}return[...l]},[n,s]),[c,m]=tt([]);return X(()=>{let l=true;return Promise.all(a.map(r=>Kt(e,r))).then(r=>l&&m(r.filter(h=>!!h))),()=>{l=false}},[e,a]),O(()=>{const l=new Map;for(const r of c){const{canvases:h}=mt(r),d=V(r.label,u);for(const S of h){const I=V(S.label,u);l.set(S.id,{canvas:S,label:h.length>1&&I.text?[d,I]:[d]})}}return{named:a.length>0,of:l}},[c,a,u])}const Zt=lt(function({as:s,className:e,rest:u,sets:a,shown:c,headingLevel:m,language:l,showLabel:r,hiddenSets:h,selected:d,highlighted:S,renderEntry:I,onSelect:N,onHighlight:T,onVisible:b,end:$},f){const k=ut(),w=q(i=>mt(i.manifest).canvases),L=O(()=>Qt(a,w,l),[a,w,l]),A=O(()=>new Map(w.map(i=>[i.id,i])),[w]),C=Yt(L,A),[y,t]=tt({}),v=gt(),x=q(i=>{var g;return(g=i.manifest)==null?void 0:g.label}),P=O(()=>V(x,l),[x,l]),F=w.length>1||C.named,G=Ot(null),nt=()=>{const i=G.current;if(!i||!i.getClientRects().length)return true;const g=zt(i)??i;return g.matches(":hover")||g.contains(document.activeElement)},Lt=c.join(`
2
- `);return X(()=>{const i=G.current;if(!i||!F||nt())return;const g=c.map(U=>i.querySelector(`[data-canvas="${CSS.escape(U)}"]`)).find(Boolean);if(!g)return;const B=g.closest(".clover-annotations-set"),H=(B==null?void 0:B.querySelector("[data-canvas]"))===g;ct(H&&B?B:g,"start")},[Lt]),X(()=>{const i=G.current;if(!i||!d||nt())return;const g=i.querySelector(`[data-entry="${CSS.escape(d)}"]`);g&&ct(g,"nearest")},[d]),L.length?o(s,{ref:i=>{G.current=i,typeof f=="function"?f(i):f&&(f.current=i)},className:ht("clover-annotations",e),"data-scope":"all",...u,children:[L.map((i,g)=>{const B=Y(m),H=i.title.text?m+1:m,U=Y(H),It=i.setIds.every(p=>h.includes(p)),K=xt(i.canvases.flatMap(p=>p.entries)),et=vt(v,K),W=et?z(K,v.chosen):z(K,(v==null?void 0:v.chosen)??l,y[i.key]);return o("section",{className:"clover-annotations-set","aria-labelledby":i.title.text?`${k}-${g}`:void 0,children:[o("div",{className:"clover-annotations-set-header",children:[i.title.text&&o(B,{className:"clover-annotations-title",id:`${k}-${g}`,...M(i.title.lang),children:i.title.text}),W&&!et&&o(pt,{languages:K,chosen:W,onChange:p=>t(J=>({...J,[i.key]:p})),nameKey:"annotationsLanguage",part:"clover-annotations"}),o(ft,{hidden:It,onChange:p=>b(i.setIds,!p),of:i.title.text?`${k}-${g}`:void 0})]}),i.canvases.map((p,J)=>{var at;const st=p.entries.filter(E=>St(E,W));if(!st.length)return null;const j=C.of.get(p.canvasId),R=j?j.label:C.named&&P.text?w.length>1&&p.label.text?[P,p.label]:[P]:[p.label],Q=F&&!!((at=R[0])!=null&&at.text),kt=F&&c.includes(p.canvasId),ot=`${k}-${g}-${J}`;return o("section",{className:"clover-annotations-canvas","data-canvas":p.canvasId,"aria-labelledby":Q?ot:void 0,"aria-current":kt?"true":void 0,children:[Q&&o(U,{className:"clover-annotations-canvas-label",id:ot,...M(R.length===1?R[0].lang:void 0),children:R.length===1?R[0].text:R.map((E,_)=>o(rt.Fragment,{children:[_>0&&", ",o("span",{...M(E.lang),children:E.text})]},_))}),o("ol",{className:"clover-annotations-list",children:st.map((E,_)=>o(wt,{entry:E,canvas:A.get(p.canvasId)??(j==null?void 0:j.canvas),index:_,headingLevel:Q?H+1:H,language:l,showLabel:r,selected:E.id===d,highlighted:E.id===S,renderEntry:I,onSelect:N,onHighlight:T},E.id))})]},p.canvasId)})]},i.key)}),$]}):null});function tn(n,s){const e=n.target.rect?void 0:n.target.svg,u=yt(nn,!!e);return O(()=>{var m,l;const a=e?(m=u==null?void 0:u.readSvgShape(e))==null?void 0:m.box:void 0,c=n.target.rect??(a?{x:a.x,y:a.y,w:a.width,h:a.height}:void 0);return!c||!s||n.bodies.some(r=>r.image)?null:_t(s,c,(l=n.layer)==null?void 0:l.image)},[n,s,e,u])}const nn=()=>import("./svg-shape-D1K-WNrY.mjs");function wt({entry:n,canvas:s,index:e,headingLevel:u,language:a,showLabel:c,selected:m,highlighted:l,renderEntry:r,onSelect:h,onHighlight:d}){const{hostLanguage:S,t:I,langOf:N}=Z(),T=sn(n,a),b=T.text?T:{text:String(e+1)},$=dt(n.target.t),f=$?{text:I("annotationsShowTime"),lang:N("annotationsShowTime")}:c,k=!f.lang&&!Bt(b.lang,S),w=b.text?`${f.text}: ${b.text}`:f.text,{clover:L}=D("Annotations"),A=tn(n,s);return o("li",{className:"clover-annotations-entry","data-entry":n.id,"data-selected":m,"data-highlighted":l,onMouseEnter:()=>d(n.id),onMouseLeave:()=>d(null),onFocus:()=>d(n.id),onBlur:()=>d(null),onClick:C=>{C.target.closest("a, button")||h(n.id)},children:[$&&o(Dt,{start:$.start,className:"clover-annotations-time"}),o(Ut,{className:"clover-annotations-thumbnail",source:A,request:L.request}),o("div",{className:"clover-annotations-body clover-cue-text",children:[r?r(n):o(Pt,{bodies:n.bodies,language:a,headingLevel:u}),o(en,{annotation:n.annotation})]}),o("button",{type:"button",className:"clover-annotations-show","aria-pressed":m,"aria-label":k?w:void 0,style:qt,onClick:()=>h(n.id),children:!k&&o(it,{children:[o("span",{...M(f.lang),children:[f.text,b.text&&":"]}),b.text&&o(it,{children:[" ",o("span",{...M(b.lang),children:b.text})]})]})})]})}function en({annotation:n}){const{clover:s}=D("Annotations"),{t:e,langOf:u}=Z(),a=O(()=>Ht(n)??jt(n),[n]);if(!a)return null;const c=e("annotationsOpenLink"),m=u("annotationsOpenLink");return!a.canvasId&&!a.manifestId?o("a",{className:"clover-annotations-link",href:a.id,target:"_blank",rel:"noopener noreferrer",...M(m),children:c}):o("button",{type:"button",className:"clover-annotations-link",...M(m),onClick:l=>{var h;const r=l.currentTarget.closest(".clover-root");Gt(s,a)&&((h=r==null?void 0:r.querySelector(".clover-canvas-viewport"))==null||h.focus({preventScroll:true}))},children:c})}function sn(n,s){const{text:e="",lang:u}=Ft(n.bodies,s);return{text:e.slice(0,120),...u?{lang:u}:{}}}export{wn as Annotations};
1
+ import{D as lt,a as Z,e as D,c as q,s as Ct,n as Nt,o as $t,R as rt,r as At,u as o,t as V,w as Tt,B as dt,E as Et,b as ut,F as mt,T as O,d as tt,A as Ot,y as X,G as z,l as M,H as Mt,I as Bt,v as qt,k as it,f as yt}from"./shared-Cqxks7jF.mjs";import{E as Pt}from"./EntryBodies-D2OorCCX.mjs";import{u as Rt,L as Vt}from"./ListEnd-BXjH6six.mjs";import{a as Ft}from"./annotation-name-U_Yiz_CP.mjs";import{r as Ht,a as jt}from"./link-BIc77IY3.mjs";import{s as Gt}from"./show-link-DwefC5LJ.mjs";import{f as Kt,r as _t}from"./fetchManifest-BKGaZzDw.mjs";import{j as ht}from"./classnames-DukgfdpI.mjs";import{b as ct,s as zt}from"./bringIntoView-CQH5ZgMM.mjs";import{a as Y}from"./heading-Cjt0f-Eu.mjs";import{C as Dt}from"./Cue-BzhK_KTz.mjs";import{E as Ut}from"./EntryThumbnail-iY1cnsAP.mjs";import{H as ft}from"./HideToggle-D_n5lwkp.mjs";import{u as gt,c as vt}from"./readingLanguages-BY2NUfQE.mjs";import{L as pt}from"./LanguageChoice-e7MGPRCd.mjs";import"./styles-C9QeBpjd.mjs";function bt(n){const s=n.bodies.filter(e=>{var u;return!e.image&&((u=e.value)==null?void 0:u.trim())}).map(e=>e.language).filter(e=>!!e&&e!=="none");return[...new Set(s)]}function xt(n){const s=n.map(bt),e=[...new Set(s.flat())];return e.length<2?[]:s.some(a=>a.length&&e.some(c=>!a.includes(c)))?e:[]}function St(n,s){if(!s)return true;const e=bt(n);return!e.length||e.includes(s)}const Wt=[],wn=lt(function({scope:s="all",renderEntry:e,headingLevel:u=3,as:a="div",className:c,...m},l){const{t:r,langOf:h}=Z(),{clover:d,language:S}=D("Annotations"),L=q(t=>Ct(t.manifest,t.addedSets)),N=q(t=>Nt(t.manifest,t.canvasId)),T=q(t=>$t(t.manifest,t.addedSets,t.hiddenSets,t.shownSets)),b=q(t=>t.annotationId),$=rt.useSyncExternalStore(d.highlight.subscribe,d.highlight.get,d.highlight.get),f=t=>{const v=Tt(L,t),x=v&&dt(v.target.t),P=d.media.get();x&&P&&N.some(F=>F.id===v.canvasId)&&Et(P,x.start),d.selectAnnotation(t)},k=q(t=>s==="all"?At(t.manifest):Wt),w=Rt(k),I=t=>t.entries.filter(v=>N.some(x=>x.id===v.canvasId)),A=L.map(t=>({set:t,entries:I(t)})).filter(({entries:t})=>t.length),C=Y(u),y={text:r("annotationsShow"),lang:h("annotationsShow")};return s==="all"?o(Zt,{ref:l,as:a,className:c,rest:m,sets:L,shown:N.map(t=>t.id),headingLevel:u,language:S,showLabel:y,hiddenSets:T,selected:b,highlighted:$,renderEntry:e,onSelect:f,onHighlight:t=>d.highlight.emit(t),onVisible:(t,v)=>t.forEach(x=>d.setSetVisible(x,v)),end:w.more&&o(Vt,{onReached:w.reachNext})}):A.length?o(a,{ref:l,className:ht("clover-annotations",c),...m,children:A.map(({set:t,entries:v})=>o(Jt,{set:t,entries:v,canvases:N,Heading:C,headingLevel:u,language:S,title:V(t.label,S),showLabel:y,hidden:T.includes(t.id),selected:b,highlighted:$,renderEntry:e,onSelect:f,onHighlight:x=>d.highlight.emit(x),onVisible:x=>d.setSetVisible(t.id,x)},t.id))}):null});function Jt({set:n,entries:s,canvases:e,Heading:u,headingLevel:a,title:c,language:m,showLabel:l,hidden:r,selected:h,highlighted:d,renderEntry:S,onSelect:L,onHighlight:N,onVisible:T}){const b=ut(),$=c.text?a+1:a,f=O(()=>xt(s),[s]),[k,w]=tt(),I=gt(),A=vt(I,f),C=A?z(f,I.chosen):z(f,(I==null?void 0:I.chosen)??m,k),y=s.filter(t=>St(t,C));return o("section",{className:"clover-annotations-set","aria-labelledby":c.text?`${b}-title`:void 0,"data-set":n.id,children:[o("div",{className:"clover-annotations-set-header",children:[c.text&&o(u,{className:"clover-annotations-title",id:`${b}-title`,...M(c.lang),children:c.text}),C&&!A&&o(pt,{languages:f,chosen:C,onChange:w,nameKey:"annotationsLanguage",part:"clover-annotations"}),o(ft,{hidden:r,onChange:t=>T(!t),of:c.text?`${b}-title`:void 0})]}),o("ol",{className:"clover-annotations-list",children:y.map((t,v)=>o(wt,{entry:t,canvas:e.find(x=>x.id===t.canvasId),index:v,headingLevel:$,language:m,showLabel:l,selected:t.id===h,highlighted:t.id===d,renderEntry:S,onSelect:L,onHighlight:N},t.id))})]})}function Qt(n,s,e){const u=new Map(s.map((c,m)=>[c.id,m])),a=new Map;for(const c of n){const m=V(c.label,e),l=m.text;let r=a.get(l);r||(r={title:m,setIds:[],byCanvas:new Map},a.set(l,r)),r.setIds.push(c.id);for(const h of c.entries){const d=r.byCanvas.get(h.canvasId)??[];d.push(h),r.byCanvas.set(h.canvasId,d)}}return[...a.entries()].map(([c,m])=>({key:c,title:m.title,setIds:m.setIds,canvases:Xt([...m.byCanvas.entries()],u).map(([l,r])=>{var h;return{canvasId:l,label:V((h=s.find(d=>d.id===l))==null?void 0:h.label,e),entries:r}})}))}function Xt(n,s){return n.every(([e])=>s.has(e))?n.sort(([e],[u])=>s.get(e)-s.get(u)):n}function Yt(n,s){const{clover:e,language:u}=D("Annotations"),a=O(()=>{const l=new Set;for(const r of n)for(const h of r.canvases){if(s.has(h.canvasId))continue;const d=Mt(h.entries[0].annotation);d&&l.add(d)}return[...l]},[n,s]),[c,m]=tt([]);return X(()=>{let l=true;return Promise.all(a.map(r=>Kt(e,r))).then(r=>l&&m(r.filter(h=>!!h))),()=>{l=false}},[e,a]),O(()=>{const l=new Map;for(const r of c){const{canvases:h}=mt(r),d=V(r.label,u);for(const S of h){const L=V(S.label,u);l.set(S.id,{canvas:S,label:h.length>1&&L.text?[d,L]:[d]})}}return{named:a.length>0,of:l}},[c,a,u])}const Zt=lt(function({as:s,className:e,rest:u,sets:a,shown:c,headingLevel:m,language:l,showLabel:r,hiddenSets:h,selected:d,highlighted:S,renderEntry:L,onSelect:N,onHighlight:T,onVisible:b,end:$},f){const k=ut(),w=q(i=>mt(i.manifest).canvases),I=O(()=>Qt(a,w,l),[a,w,l]),A=O(()=>new Map(w.map(i=>[i.id,i])),[w]),C=Yt(I,A),[y,t]=tt({}),v=gt(),x=q(i=>{var g;return(g=i.manifest)==null?void 0:g.label}),P=O(()=>V(x,l),[x,l]),F=w.length>1||C.named,G=Ot(null),nt=()=>{const i=G.current;if(!i||!i.getClientRects().length)return true;const g=zt(i)??i;return g.matches(":hover")||g.contains(document.activeElement)},It=c.join(`
2
+ `);return X(()=>{const i=G.current;if(!i||!F||nt())return;const g=c.map(U=>i.querySelector(`[data-canvas="${CSS.escape(U)}"]`)).find(Boolean);if(!g)return;const B=g.closest(".clover-annotations-set"),H=(B==null?void 0:B.querySelector("[data-canvas]"))===g;ct(H&&B?B:g,"start")},[It]),X(()=>{const i=G.current;if(!i||!d||nt())return;const g=i.querySelector(`[data-entry="${CSS.escape(d)}"]`);g&&ct(g,"nearest")},[d]),I.length?o(s,{ref:i=>{G.current=i,typeof f=="function"?f(i):f&&(f.current=i)},className:ht("clover-annotations",e),"data-scope":"all",...u,children:[I.map((i,g)=>{const B=Y(m),H=i.title.text?m+1:m,U=Y(H),Lt=i.setIds.every(p=>h.includes(p)),K=xt(i.canvases.flatMap(p=>p.entries)),et=vt(v,K),W=et?z(K,v.chosen):z(K,(v==null?void 0:v.chosen)??l,y[i.key]);return o("section",{className:"clover-annotations-set","aria-labelledby":i.title.text?`${k}-${g}`:void 0,children:[o("div",{className:"clover-annotations-set-header",children:[i.title.text&&o(B,{className:"clover-annotations-title",id:`${k}-${g}`,...M(i.title.lang),children:i.title.text}),W&&!et&&o(pt,{languages:K,chosen:W,onChange:p=>t(J=>({...J,[i.key]:p})),nameKey:"annotationsLanguage",part:"clover-annotations"}),o(ft,{hidden:Lt,onChange:p=>b(i.setIds,!p),of:i.title.text?`${k}-${g}`:void 0})]}),i.canvases.map((p,J)=>{var at;const st=p.entries.filter(E=>St(E,W));if(!st.length)return null;const j=C.of.get(p.canvasId),R=j?j.label:C.named&&P.text?w.length>1&&p.label.text?[P,p.label]:[P]:[p.label],Q=F&&!!((at=R[0])!=null&&at.text),kt=F&&c.includes(p.canvasId),ot=`${k}-${g}-${J}`;return o("section",{className:"clover-annotations-canvas","data-canvas":p.canvasId,"aria-labelledby":Q?ot:void 0,"aria-current":kt?"true":void 0,children:[Q&&o(U,{className:"clover-annotations-canvas-label",id:ot,...M(R.length===1?R[0].lang:void 0),children:R.length===1?R[0].text:R.map((E,_)=>o(rt.Fragment,{children:[_>0&&", ",o("span",{...M(E.lang),children:E.text})]},_))}),o("ol",{className:"clover-annotations-list",children:st.map((E,_)=>o(wt,{entry:E,canvas:A.get(p.canvasId)??(j==null?void 0:j.canvas),index:_,headingLevel:Q?H+1:H,language:l,showLabel:r,selected:E.id===d,highlighted:E.id===S,renderEntry:L,onSelect:N,onHighlight:T},E.id))})]},p.canvasId)})]},i.key)}),$]}):null});function tn(n,s){const e=n.target.rect?void 0:n.target.svg,u=yt(nn,!!e);return O(()=>{var m,l;const a=e?(m=u==null?void 0:u.readSvgShape(e))==null?void 0:m.box:void 0,c=n.target.rect??(a?{x:a.x,y:a.y,w:a.width,h:a.height}:void 0);return!c||!s||n.bodies.some(r=>r.image)?null:_t(s,c,(l=n.layer)==null?void 0:l.image)},[n,s,e,u])}const nn=()=>import("./svg-shape-D1K-WNrY.mjs");function wt({entry:n,canvas:s,index:e,headingLevel:u,language:a,showLabel:c,selected:m,highlighted:l,renderEntry:r,onSelect:h,onHighlight:d}){const{hostLanguage:S,t:L,langOf:N}=Z(),T=sn(n,a),b=T.text?T:{text:String(e+1)},$=dt(n.target.t),f=$?{text:L("annotationsShowTime"),lang:N("annotationsShowTime")}:c,k=!f.lang&&!Bt(b.lang,S),w=b.text?`${f.text}: ${b.text}`:f.text,{clover:I}=D("Annotations"),A=tn(n,s);return o("li",{className:"clover-annotations-entry","data-entry":n.id,"data-selected":m,"data-highlighted":l,onMouseEnter:()=>d(n.id),onMouseLeave:()=>d(null),onFocus:()=>d(n.id),onBlur:()=>d(null),onClick:C=>{C.target.closest("a, button")||h(n.id)},children:[$&&o(Dt,{start:$.start,className:"clover-annotations-time"}),o(Ut,{className:"clover-annotations-thumbnail",source:A,request:I.request}),o("div",{className:"clover-annotations-body clover-cue-text",children:[r?r(n):o(Pt,{bodies:n.bodies,language:a,headingLevel:u}),o(en,{annotation:n.annotation})]}),o("button",{type:"button",className:"clover-annotations-show","aria-pressed":m,"aria-label":k?w:void 0,style:qt,onClick:()=>h(n.id),children:!k&&o(it,{children:[o("span",{...M(f.lang),children:[f.text,b.text&&":"]}),b.text&&o(it,{children:[" ",o("span",{...M(b.lang),children:b.text})]})]})})]})}function en({annotation:n}){const{clover:s}=D("Annotations"),{t:e,langOf:u}=Z(),a=O(()=>Ht(n)??jt(n),[n]);if(!a)return null;const c=e("annotationsOpenLink"),m=u("annotationsOpenLink");return!a.canvasId&&!a.manifestId?o("a",{className:"clover-annotations-link",href:a.id,target:"_blank",rel:"noopener noreferrer",...M(m),children:c}):o("button",{type:"button",className:"clover-annotations-link",...M(m),onClick:l=>{var h;const r=l.currentTarget.closest(".clover-root");Gt(s,a)&&((h=r==null?void 0:r.querySelector(".clover-canvas-viewport"))==null||h.focus({preventScroll:true}))},children:c})}function sn(n,s){const{text:e="",lang:u}=Ft(n.bodies,s);return{text:e.slice(0,120),...u?{lang:u}:{}}}export{wn as Annotations};
@@ -1 +1 @@
1
- import{e as g,j as h,T as k,p as B,m as T,c as j,u as e,P as p,z as v}from"./shared-DJyYaNgB.mjs";import L from"./Connected-1kdGMIWC.mjs";import{r as R}from"./rendererSurface-BAvGJcFy.mjs";import{j as w}from"./classnames-DukgfdpI.mjs";import{a as x}from"./hooks-uHKfYuKB.mjs";import{L as c}from"./Loading-27_CRfmr.mjs";const z=v(()=>import("./Connected-wXkAqvjL.mjs")),N=v(()=>import("./Connected-DdmRznGj.mjs"));function F({className:f,style:y,renderers:C,collapseControls:b,onContentStateChange:S,children:r,...n}){var u;const l=g("Body");h(l.clover,S);const o=x(),m=k(()=>B(o),[o]),s=T(C??l.renderers,{canvases:o,bodies:m}),a=s==null?void 0:s.component,i=((u=o.find(({type:t})=>t==="Scene"||t==="Timeline"))==null?void 0:u.type)??"Canvas",d=j(t=>t.status==="loading");return e("div",{"aria-busy":d,className:w("clover-body",f),"data-renderer":a?"custom":i.toLowerCase(),style:{position:"relative",height:"var(--clover-body-height, 60vh)",...y},children:[a?e(a,{canvases:o,bodies:m,children:r}):i==="Scene"?e(p,{fallback:e(c,{overlay:true}),children:e(N,{...n,children:r})}):i==="Timeline"?e(p,{fallback:e(c,{overlay:true}),children:e(z,{...n,children:r})}):e(L,{...n,collapseControls:b,surface:R,children:r}),d&&e(c,{overlay:true})]})}export{F as B};
1
+ import{e as g,j as h,T as k,p as B,m as T,c as j,u as e,P as p,z as v}from"./shared-Cqxks7jF.mjs";import L from"./Connected-CGF0cSzv.mjs";import{r as R}from"./rendererSurface-AGFetq7k.mjs";import{j as w}from"./classnames-DukgfdpI.mjs";import{a as x}from"./hooks--n9dMuHb.mjs";import{L as c}from"./Loading-DGPqbYw2.mjs";const z=v(()=>import("./Connected-Cr4h-tHh.mjs")),N=v(()=>import("./Connected-CssvezHA.mjs"));function F({className:f,style:y,renderers:C,collapseControls:b,onContentStateChange:S,children:r,...n}){var u;const l=g("Body");h(l.clover,S);const o=x(),m=k(()=>B(o),[o]),s=T(C??l.renderers,{canvases:o,bodies:m}),a=s==null?void 0:s.component,i=((u=o.find(({type:t})=>t==="Scene"||t==="Timeline"))==null?void 0:u.type)??"Canvas",d=j(t=>t.status==="loading");return e("div",{"aria-busy":d,className:w("clover-body",f),"data-renderer":a?"custom":i.toLowerCase(),style:{position:"relative",height:"var(--clover-body-height, 60vh)",...y},children:[a?e(a,{canvases:o,bodies:m,children:r}):i==="Scene"?e(p,{fallback:e(c,{overlay:true}),children:e(N,{...n,children:r})}):i==="Timeline"?e(p,{fallback:e(c,{overlay:true}),children:e(z,{...n,children:r})}):e(L,{...n,collapseControls:b,surface:R,children:r}),d&&e(c,{overlay:true})]})}export{F as B};
@@ -1 +1 @@
1
- import{a as o,u as r,l}from"./shared-DJyYaNgB.mjs";import{j as n}from"./classnames-DukgfdpI.mjs";function c({error:a,className:s}){const{t,langOf:e}=o();return r("div",{className:n("clover-status",s),"data-status":"error",role:"alert",children:[r("p",{...l(e("statusError")),children:t("statusError")}),r("p",{className:"clover-status-detail",lang:"en",children:a.message})]})}export{c as B};
1
+ import{a as o,u as r,l}from"./shared-Cqxks7jF.mjs";import{j as n}from"./classnames-DukgfdpI.mjs";function c({error:a,className:s}){const{t,langOf:e}=o();return r("div",{className:n("clover-status",s),"data-status":"error",role:"alert",children:[r("p",{...l(e("statusError")),children:t("statusError")}),r("p",{className:"clover-status-detail",lang:"en",children:a.message})]})}export{c as B};
@@ -1 +1 @@
1
- import{u as t,l as v}from"./shared-DJyYaNgB.mjs";import{j as b}from"./classnames-DukgfdpI.mjs";import{T as m}from"./Tip-ByWHicZ5.mjs";import"./styles-Cm1KSkd5.mjs";const B=({className:n,id:e,label:o,children:s,onClick:r,expanded:i,controls:d,shortcut:a,lang:l,unavailable:p,side:c})=>{const u=e.split("-")[0].replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,"");return t("button",{id:e,className:b("clover-canvas-button",n),"data-testid":"clover-canvas-button","data-button":u,"data-side":c,onClick:r,"aria-disabled":p||void 0,"aria-expanded":i,"aria-controls":d,"aria-label":o,"aria-keyshortcuts":a==null?void 0:a.keys,...v(l),type:"button",children:[t("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true","data-testid":"clover-canvas-button-svg",focusable:"false",width:"16",height:"16",viewBox:"0 0 512 512",children:s}),t(m,{label:o,shortcut:a})]})};export{B};
1
+ import{u as t,l as v}from"./shared-Cqxks7jF.mjs";import{j as b}from"./classnames-DukgfdpI.mjs";import{T as m}from"./Tip-DxvfQm-l.mjs";import"./styles-C9QeBpjd.mjs";const B=({className:n,id:e,label:o,children:s,onClick:r,expanded:i,controls:d,shortcut:a,lang:l,unavailable:p,side:c})=>{const u=e.split("-")[0].replace(/([A-Z])/g,"-$1").toLowerCase().replace(/^-/,"");return t("button",{id:e,className:b("clover-canvas-button",n),"data-testid":"clover-canvas-button","data-button":u,"data-side":c,onClick:r,"aria-disabled":p||void 0,"aria-expanded":i,"aria-controls":d,"aria-label":o,"aria-keyshortcuts":a==null?void 0:a.keys,...v(l),type:"button",children:[t("svg",{xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true","data-testid":"clover-canvas-button-svg",focusable:"false",width:"16",height:"16",viewBox:"0 0 512 512",children:s}),t(m,{label:o,shortcut:a})]})};export{B};
@@ -1 +1 @@
1
- import{d as f,r as l,b as i,c,g as a,s as u,t as h}from"./CanvasView-m9ooNUhD.mjs";function g(t,o){return c(h(o.width/2,o.height/2),a(t.rotation),u(t.zoom),h(-t.x,-t.y))}function m(t,o){return c(h(t.x,t.y),u(1/t.zoom),a(-t.rotation),h(-o.width/2,-o.height/2))}function M(t,o,n){return i(m(t,o),n)}function w(t,o,n){return i(g(t,o),n)}function C(t,o){return f(m(t,o),{x:0,y:0,width:o.width,height:o.height})}function N(t,o,n=0,r=0){const e=f(a(n),t),s=Math.max(1,o.width*(1-r*2)),y=Math.max(1,o.height*(1-r*2)),d=Math.min(s/Math.max(e.width,Number.EPSILON),y/Math.max(e.height,Number.EPSILON)),x=l(t);return{x:x.x,y:x.y,zoom:d,rotation:n}}function P(t,o,n,r,e){const s=i(c(u(1/n),a(-r)),{x:o.x-e.width/2,y:o.y-e.height/2});return{x:t.x-s.x,y:t.y-s.y}}function S(t,o){return t.x===o.x&&t.y===o.y&&t.zoom===o.zoom&&t.rotation===o.rotation}export{P as a,S as b,w as c,N as f,M as s,C as v,g as w};
1
+ import{d as f,r as l,b as i,c,g as a,s as u,t as h}from"./CanvasView-uvJ5kDYN.mjs";function g(t,o){return c(h(o.width/2,o.height/2),a(t.rotation),u(t.zoom),h(-t.x,-t.y))}function m(t,o){return c(h(t.x,t.y),u(1/t.zoom),a(-t.rotation),h(-o.width/2,-o.height/2))}function M(t,o,n){return i(m(t,o),n)}function w(t,o,n){return i(g(t,o),n)}function C(t,o){return f(m(t,o),{x:0,y:0,width:o.width,height:o.height})}function N(t,o,n=0,r=0){const e=f(a(n),t),s=Math.max(1,o.width*(1-r*2)),y=Math.max(1,o.height*(1-r*2)),d=Math.min(s/Math.max(e.width,Number.EPSILON),y/Math.max(e.height,Number.EPSILON)),x=l(t);return{x:x.x,y:x.y,zoom:d,rotation:n}}function P(t,o,n,r,e){const s=i(c(u(1/n),a(-r)),{x:o.x-e.width/2,y:o.y-e.height/2});return{x:t.x-s.x,y:t.y-s.y}}function S(t,o){return t.x===o.x&&t.y===o.y&&t.zoom===o.zoom&&t.rotation===o.rotation}export{P as a,S as b,w as c,N as f,M as s,C as v,g as w};
@@ -1 +1 @@
1
- var l=Object.defineProperty;var o=(r,t,s)=>t in r?l(r,t,{enumerable:true,configurable:true,writable:true,value:s}):r[t]=s;var i=(r,t,s)=>o(r,typeof t!="symbol"?t+"":t,s);import{h as d,b as g}from"./rendererSurface-BAvGJcFy.mjs";class c{constructor(t,s){i(this,"kind","canvas2d");i(this,"canvas");i(this,"ctx");i(this,"pixelRatio",1);i(this,"drawn",new Set);this.canvas=t,this.ctx=s}static create(t){let s=null;try{s=t.getContext("2d",{alpha:true})}catch{s=null}return!s||typeof s.drawImage!="function"?null:new c(t,s)}resize(t,s,a){this.pixelRatio=a;const e=Math.max(1,Math.round(t*a)),h=Math.max(1,Math.round(s*a));this.canvas.width!==e&&(this.canvas.width=e),this.canvas.height!==h&&(this.canvas.height=h)}begin(){const t=this.ctx;t.setTransform(1,0,0,1,0,0),t.globalAlpha=1,t.clearRect(0,0,this.canvas.width,this.canvas.height),t.imageSmoothingEnabled=true,t.imageSmoothingQuality="high"}draw(t){if(!d(t.source))return"skipped";const s=this.ctx,a=t.transform,e=this.pixelRatio,h=t.crop??{x:0,y:0,width:t.width,height:t.height},n=g(t,e);return s.setTransform(e*a.a,e*a.b,e*a.c,e*a.d,e*a.e,e*a.f),s.globalAlpha=t.opacity,s.drawImage(t.source,h.x,h.y,h.width,h.height,h.x,h.y,h.width+n.x,h.height+n.y),this.drawn.add(t.key),"drawn"}end(){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.globalAlpha=1}has(t){return this.drawn.has(t)}release(t){this.drawn.delete(t)}dispose(){this.drawn.clear(),this.canvas.width=0,this.canvas.height=0}}export{c as Canvas2DBackend};
1
+ var l=Object.defineProperty;var o=(r,t,s)=>t in r?l(r,t,{enumerable:true,configurable:true,writable:true,value:s}):r[t]=s;var i=(r,t,s)=>o(r,typeof t!="symbol"?t+"":t,s);import{h as d,b as g}from"./rendererSurface-AGFetq7k.mjs";class c{constructor(t,s){i(this,"kind","canvas2d");i(this,"canvas");i(this,"ctx");i(this,"pixelRatio",1);i(this,"drawn",new Set);this.canvas=t,this.ctx=s}static create(t){let s=null;try{s=t.getContext("2d",{alpha:true})}catch{s=null}return!s||typeof s.drawImage!="function"?null:new c(t,s)}resize(t,s,a){this.pixelRatio=a;const e=Math.max(1,Math.round(t*a)),h=Math.max(1,Math.round(s*a));this.canvas.width!==e&&(this.canvas.width=e),this.canvas.height!==h&&(this.canvas.height=h)}begin(){const t=this.ctx;t.setTransform(1,0,0,1,0,0),t.globalAlpha=1,t.clearRect(0,0,this.canvas.width,this.canvas.height),t.imageSmoothingEnabled=true,t.imageSmoothingQuality="high"}draw(t){if(!d(t.source))return"skipped";const s=this.ctx,a=t.transform,e=this.pixelRatio,h=t.crop??{x:0,y:0,width:t.width,height:t.height},n=g(t,e);return s.setTransform(e*a.a,e*a.b,e*a.c,e*a.d,e*a.e,e*a.f),s.globalAlpha=t.opacity,s.drawImage(t.source,h.x,h.y,h.width,h.height,h.x,h.y,h.width+n.x,h.height+n.y),this.drawn.add(t.key),"drawn"}end(){this.ctx.setTransform(1,0,0,1,0,0),this.ctx.globalAlpha=1}has(t){return this.drawn.has(t)}release(t){this.drawn.delete(t)}dispose(){this.drawn.clear(),this.canvas.width=0,this.canvas.height=0}}export{c as Canvas2DBackend};
@@ -1,2 +1,2 @@
1
- import{A as I,_ as Ut,a as Pn,d as p,q as be,y as V,t as Qe,f as et,u as i,R as Yt,k as oo,a4 as ao,a5 as so,b as lo,T as N,a6 as io,a7 as ro,a8 as co,a9 as uo,P as Se,z as Ve,v as fo,l as xn,aa as ho}from"./shared-DJyYaNgB.mjs";import{u as go,d as En,r as mo,C as po,t as yo,E as vo,e as bo,f as Co,h as wo,g as xo,j as Io,B as Mo,k as Oo,l as ko}from"./pointer--iHWeLVV.mjs";import{P as Bo,a as So,I as Po,b as Eo}from"./glyphs-3j_wsdG0.mjs";import{B as Ot}from"./Button-DqfkGSl5.mjs";import{Z as Ro,a as Fo,b as Lo,c as To,R as In,d as $o,C as zo}from"./controlGlyphs-CAs5NitM.mjs";import{S as U,f as Ao}from"./Tip-ByWHicZ5.mjs";import{f as No,s as Vo,b as Mn,d as Do,p as Ho,e as Ko,g as On,h as qo,i as jo}from"./layout-CdBuqKxn.mjs";import{u as _o}from"./useNearViewport-DpYbV4NQ.mjs";import{L as Wo}from"./Loading-27_CRfmr.mjs";import{j as Zo}from"./classnames-DukgfdpI.mjs";import{u as Uo}from"./useContainerName-jjktq7OB.mjs";import{b as Yo,f as Go}from"./imageService-BIVE0K1I.mjs";import"./styles-Cm1KSkd5.mjs";function Jo(e,n,s){return e.reduce((o,u)=>o+u+s,-s)<=n}function Xo(e,n,s){const o=e.ownerDocument,u=f=>f instanceof HTMLElement&&e.contains(f)&&!f.closest("[hidden]"),a=[o.getElementById(n),o.getElementById(s),...Array.from(e.querySelectorAll("button"))].find(u);a==null||a.focus()}function Qo({cluster:e,ids:n,more:s,fits:o,settled:u,onFits:a}){const f=I(o);f.current=o;const m=I(a);m.current=a;const q=I(new Map),j=I(n);j.current=n;const b=I(null),D=n.join(" ");return Ut(()=>{const H=e.ownerDocument,E=()=>{var ue;const K=j.current,Q=getComputedStyle(e),Pe=parseFloat(Q.columnGap)||0;let C=e.clientWidth-(parseFloat(Q.paddingLeft)||0)-(parseFloat(Q.paddingRight)||0),F=0;for(const O of K){const Ee=(ue=H.getElementById(O))==null?void 0:ue.offsetWidth;Ee&&q.current.set(O,Ee),F=Math.max(F,q.current.get(O)??0)}for(const O of Array.from(e.children))!(O instanceof HTMLElement)||K.includes(O.id)||O.id===s||O.classList.contains("clover-canvas-more")||!O.offsetWidth||getComputedStyle(O).position==="absolute"||(C-=O.offsetWidth+Pe);const ne=Jo(K.map(O=>q.current.get(O)??F),C,Pe);if(ne===f.current)return;const Ce=H.activeElement;b.current=Ce instanceof HTMLElement&&e.contains(Ce)?Ce.id:null,f.current=ne,m.current(ne)};E();const d=new ResizeObserver(()=>E());d.observe(e);const X=new MutationObserver(()=>E());return X.observe(e,{childList:true}),()=>{d.disconnect(),X.disconnect()}},[e,D,s]),Ut(()=>{if(!u)return;const H=b.current;if(b.current=null,H===null)return;const E=e.ownerDocument.activeElement;(!E||!e.contains(E)||E.closest("[hidden]"))&&Xo(e,H,s)},[o,u,e,s]),null}const ea=()=>import("./AnnotationMenu-Byf1nA-O.mjs"),ta=()=>import("./ChaptersMenu-DCyICayx.mjs"),na=()=>import("./ChoiceMenu-_z-WmYj6.mjs"),oa=()=>import("./ImageControls-6aS0WiPB.mjs"),kn=2,aa=new Set(["zoomIn","zoomOut","rotateRight","rotateLeft","reset","fullPage"]),Rn={atMax:false,atMin:false,atHome:false},sa=({renderer:e,instance:n,config:s,controlButtons:o,limits:u=Rn,placeholder:a,placeholderIsMore:f=false,choices:m=[],selections:q={},onSelect:j,annotations:b=[],chapters:D=[],mediaElement:H=null,onChapter:E,overStill:d,request:X,hiddenPages:K,onPageVisibilityChange:Q,selectedAnnotation:Pe=null,onAnnotationSelect:C,onAnnotationActivate:F,captionId:ne,captionOpen:Ce=false,onCaptionToggle:ue,placeId:O,placeOpen:Ee=false,onPlaceToggle:De,language:Y,fit:He=true,more:Bt="auto",children:tt})=>{var gt,mt,Be,Ge;const{t:k,langOf:B}=Pn(),[ee,oe]=p(false),[nt,ot]=p(false),ae=`annotations-${n}`,Ke=`${ae}-menu`,se=k("informationPanelTabsAnnotations"),at=B("informationPanelTabsAnnotations"),we=be(l=>{var h;ot(false),F==null||F(null),l&&((h=document.getElementById(ae))==null||h.focus())},[ae,F]),st=s.annotations&&b.length>0&&C,[lt,it]=p(false),te=`chapters-${n}`,xe=`${te}-menu`,Ie=D.length>0&&!!E,S=I(false),de=I(null);V(()=>{const l=()=>{var h;S.current=((h=document.activeElement)==null?void 0:h.id)===te};return document.addEventListener("focusin",l),()=>document.removeEventListener("focusin",l)},[te]);const L=be(()=>{var h,ge;if(!S.current)return;S.current=false;const l=document.activeElement;l&&l!==document.body||(ge=(h=de.current)==null?void 0:h.querySelector('.clover-canvas-transport :is([data-button="play"], [data-button="pause"])'))==null||ge.focus()},[]);V(()=>{Ie||L()},[Ie,L]),V(()=>()=>L(),[L]);const rt=be(l=>{var h;it(false),l&&((h=document.getElementById(te))==null||h.focus())},[te]),le=s.information&&ne&&ue,qe=s.map&&O&&De,Me=`choice-${n}`,v=m.length===1?Qe(m[0].label,Y):null,Re=(v==null?void 0:v.text)||k("canvasChoice"),fe=v!=null&&v.text?v.lang:B("canvasChoice"),je=`${Me}-menu`,ct=(gt=et(ea,!!st))==null?void 0:gt.default,_e=(mt=et(ta,Ie))==null?void 0:mt.default,We=(Be=et(na,m.length>0&&!!j))==null?void 0:Be.default,St=be(l=>{var h;oe(false),l&&((h=document.getElementById(Me))==null||h.focus())},[Me]),Pt=go(),[_,Fe]=p(null);V(()=>{de.current=(_==null?void 0:_.closest(".clover-canvas"))??null},[_]);const Le=En(_),[ie,Oe]=p(false),ut=l=>i(Ot,{className:l,id:ae,label:se,lang:at,onClick:()=>ot(h=>!h),expanded:nt,controls:Ke,children:i(Eo,{})},"annotations"),dt=(()=>{const l=[],h=e;return s.zoom&&h&&l.push({key:"zoomIn",id:`zoomIn-${n}`,shortcut:U.zoomIn,label:k("imageZoomIn"),lang:B("imageZoomIn"),glyph:i(Ro,{}),unavailable:u.atMax,onClick:()=>h.zoomBy(kn)},{key:"zoomOut",id:`zoomOut-${n}`,shortcut:U.zoomOut,label:k("imageZoomOut"),lang:B("imageZoomOut"),glyph:i(Fo,{}),unavailable:u.atMin,onClick:()=>h.zoomBy(1/kn)}),s.fullPage&&Pt&&l.push({key:"fullPage",id:`fullPage-${n}`,label:k(Le?"imageExitFullScreen":"imageFullScreen"),lang:B(Le?"imageExitFullScreen":"imageFullScreen"),glyph:Le?i(Lo,{}):i(To,{}),onClick:ge=>void yo(ge.currentTarget)}),s.rotation&&h&&l.push({key:"rotateRight",id:`rotateRight-${n}`,shortcut:U.rotateRight,label:k("imageRotateRight"),lang:B("imageRotateRight"),glyph:i(In,{}),onClick:()=>h.rotateBy(90)},{key:"rotateLeft",id:`rotateLeft-${n}`,shortcut:U.rotateLeft,label:k("imageRotateLeft"),lang:B("imageRotateLeft"),glyph:i(In,{}),onClick:()=>h.rotateBy(-90)}),s.reset&&h&&l.push({key:"reset",id:`reset-${n}`,shortcut:U.reset,label:k("imageResetZoom"),lang:B("imageResetZoom"),glyph:i($o,{}),unavailable:u.atHome,onClick:()=>h.home()}),m.length&&l.push({key:"choice",id:Me,label:Re,lang:fe,glyph:i(zo,{}),onClick:()=>oe(ge=>!ge),expanded:ee,controls:je}),l})(),G=[...dt.filter(l=>l.key!=="fullPage"),...dt.filter(l=>l.key==="fullPage")].map(l=>({id:l.id,view:aa.has(l.key),node:mo(l,o)})),Ze=[qe&&{id:`place-${n}`,view:false,node:i(Ot,{id:`place-${n}`,label:k("mapLabel"),lang:B("mapLabel"),onClick:De,expanded:Ee,controls:O,children:i(Bo,{})},"place")},Ie&&{id:te,view:false,node:i(Ot,{id:te,label:k("playerChapters"),lang:B("playerChapters"),onClick:()=>it(l=>!l),expanded:lt,controls:xe,children:i(So,{})},"chapters")},st&&{id:ae,view:false,node:ut()},le&&{id:`information-${n}`,view:false,node:i(Ot,{id:`information-${n}`,label:k("informationPanelTabsAbout"),lang:B("informationPanelTabsAbout"),onClick:ue,expanded:Ce,controls:ne,children:i(Po,{})},"information")},!!a&&{id:`placeholder-${n}`,view:false,node:i(Yt.Fragment,{children:a},"placeholder")}].filter(l=>!!l),ft=Ze.filter(l=>l.id===`placeholder-${n}`),T=[...G.filter(l=>l.view),...ft],Ue=[...G.filter(l=>!l.view),...Ze.filter(l=>!ft.includes(l))],J=[...T,...Ue],[ke,Rt]=p(true),Ye=Bt==="always"||f,w=(Ge=et(oa,He&&(f||(Ye||!ke)&&J.some(l=>l.view))))==null?void 0:Ge.ImageControls,$=ke&&!Ye||!w?[]:J.filter(l=>l.view),he=f&&!!a&&!!w;V(()=>{$.length||Oe(false)},[$.length]);const ht=l=>l.filter(h=>!$.includes(h)&&!(he&&h.id===`placeholder-${n}`)).map(({node:h})=>h);return i(oo,{children:[i(po,{fit:He,clusterRef:Fe,children:[ht(T),w&&($.length>0||he)&&i(w,{instance:n,open:he?$.length>0:ie,onOpenChange:Oe,toggle:he?a:void 0,children:$.map(({node:l})=>l)}),ht(Ue),tt]}),He&&!Ye&&_&&i(Qo,{cluster:_,ids:J.map(({id:l})=>l),more:`more-${n}`,fits:ke,settled:ke||$.length>0||!J.some(l=>l.view),onFits:Rt}),_e&&lt&&Ie&&i(_e,{id:xe,triggerId:te,label:k("playerChapters"),labelLang:B("playerChapters"),chapters:D,element:H,onChapter:E,overStill:d,request:X,onClose:rt}),ct&&nt&&st&&i(ct,{id:Ke,triggerId:ae,label:se,labelLang:at,annotations:b,hiddenPages:K,onPageVisibilityChange:Q,selected:Pe,onSelect:C,onActivate:l=>F==null?void 0:F(l),onClose:we}),We&&ee&&m.length>0&&j&&i(We,{id:je,triggerId:Me,label:Re,labelLang:fe,language:Y,choices:m,selections:q,onSelect:j,onClose:St})]})},la=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function Ha(e,n){return{a:1,b:0,c:0,d:1,e,f:n}}function Ka(e,n=e){return{a:e,b:0,c:0,d:n,e:0,f:0}}function qa(e){const n=Math.cos(e),s=Math.sin(e);return{a:n,b:s,c:-s,d:n,e:0,f:0}}function ia(e,n){return{a:e.a*n.a+e.c*n.b,b:e.b*n.a+e.d*n.b,c:e.a*n.c+e.c*n.d,d:e.b*n.c+e.d*n.d,e:e.a*n.e+e.c*n.f+e.e,f:e.b*n.e+e.d*n.f+e.f}}function ja(...e){return e.reduce((n,s)=>ia(n,s),la)}function _a(e){const n=e.a*e.d-e.b*e.c;if(!n||!Number.isFinite(n))return null;const s=1/n;return{a:e.d*s,b:-e.b*s,c:-e.c*s,d:e.a*s,e:(e.c*e.f-e.d*e.e)*s,f:(e.b*e.e-e.a*e.f)*s}}function kt(e,n){return{x:e.a*n.x+e.c*n.y+e.e,y:e.b*n.x+e.d*n.y+e.f}}function Wa(e){return`matrix(${[e.a,e.b,e.c,e.d,e.e,e.f].map(ra).join(",")})`}function Za(e,n,s,o=new Float32Array(9)){const u=2/n,a=-2/s;return o[0]=e.a*u,o[1]=e.b*a,o[2]=0,o[3]=e.c*u,o[4]=e.d*a,o[5]=0,o[6]=e.e*u-1,o[7]=e.f*a+1,o[8]=1,o}function ra(e){const n=Math.round(e*1e6)/1e6;return Object.is(n,-0)?"0":String(n)}function Ua(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function ca(e){if(!e.length)return null;let n=1/0,s=1/0,o=-1/0,u=-1/0;for(const a of e)n=Math.min(n,a.x),s=Math.min(s,a.y),o=Math.max(o,a.x+a.width),u=Math.max(u,a.y+a.height);return{x:n,y:s,width:o-n,height:u-s}}function Ya(e,n){return e.x<n.x+n.width&&n.x<e.x+e.width&&e.y<n.y+n.height&&n.y<e.y+e.height}function Ga(e,n){const s=[kt(e,{x:n.x,y:n.y}),kt(e,{x:n.x+n.width,y:n.y}),kt(e,{x:n.x,y:n.y+n.height}),kt(e,{x:n.x+n.width,y:n.y+n.height})],o=s.map(m=>m.x),u=s.map(m=>m.y),a=Math.min(...o),f=Math.min(...u);return{x:a,y:f,width:Math.max(...o)-a,height:Math.max(...u)-f}}function Ja(e,n,s){return Math.min(Math.max(e,n),s)}const Zt=e=>!!(e&&"overlays"in e);let Gt;const ua=()=>import("./shared-DJyYaNgB.mjs").then(e=>e.aO).then(e=>{Gt=e.buildContentState}),da=Ve(()=>import("./MediaBody-Bh8301OV.mjs")),fa=()=>import("./AnnotationState-idcYZf3N.mjs"),ha=new Map,ga={menu:[],placed:[],timed:[],hiddenPages:[],setPagesVisible:()=>{},listedCount:0,comments:ha,selected:null,select:()=>{},activate:()=>{},release:()=>false,quietlyOpened:null},ma=Ve(()=>import("./FrameAnimation-2B6rRU4W.mjs")),Bn=Ve(()=>import("./PlaceBox-tTnsemz1.mjs")),pa=Ve(()=>import("./Placeholder-B8Y0k5OK.mjs")),ya=Ve(()=>import("./ControlsFade-BJe8pU1f.mjs")),va=()=>true,ba=Ve(()=>import("./Placeholder-B8Y0k5OK.mjs").then(({PlaceholderToggle:e})=>({default:e}))),Sn={zoom:true,fullPage:true,rotation:true,reset:true,annotations:true,information:true,map:true},Ca={zoom:false,fullPage:false,rotation:false,reset:false,annotations:false,information:false,map:false},wa={description:"canvasKeysImage",keys:["ArrowLeft ArrowRight ArrowUp ArrowDown",U.zoomIn.keys,U.zoomOut.keys,U.reset.keys,U.rotateRight.keys,U.rotateLeft.keys].join(" ")},xa={description:"canvasKeysMedia",keys:[U.play.keys,"J L",U.mute.keys].join(" ")},Ia={description:"canvasKeysAnnotations",keys:"Escape"},Xa=e=>{var s;return!!((s=e.canvases)!=null&&s.length)||Fn(e.body,e.src).length>0?i(vo,{children:i(Ma,{...e})}):null},Ma=e=>{var hn,gn,mn,pn,yn,vn;const{surface:n,manifestId:s,canvases:o,viewingDirection:u,body:a,src:f,isTiledImage:m=false,label:q,partOf:j,language:b,highContrast:D,instanceId:H,className:E,options:d,navigator:X=false,controls:K=true,collapseControls:Q="auto",controlButtons:Pe,annotations:C,onReady:F,onViewportChange:ne,onContentStateChange:Ce,onMediaElement:ue,onCaptionChange:O,caption:Ee,onEnded:De,chapters:Y,highlightedChapter:He,onChapterHighlight:Bt,placeholder:tt=true,children:k}=e,{t:B}=Pn(),ee=I(null),[oe,nt]=p(null),ot=bo(oe),ae=En(oe),Ke=Co(oe),se=ao(nt),at=so(D),we=!!n.controlsVisibility,lt=(n.controlsVisibility??va)(we?oe:null,d==null?void 0:d.hideDelay,ee),[it,te]=p(false),xe=_o(oe),Ie=lo(),[S]=p(()=>H??`clover-canvas-${Ie}`),de=I(null),[L,rt]=p(null),le=Zt(L)?L:null,[qe,Me]=p(null),v=K===false?null:K===true?Sn:{...Sn,...K},[Re,fe]=p("loading"),[je,ct]=p(false),[_e,We]=p(0),[St,Pt]=p(Rn),_=I(F),Fe=I(ne),Le=I(d);_.current=F,Fe.current=ne,Le.current=d;const ie=io(u),Oe=N(()=>No(o??[]),[o]),ut=N(()=>Vo(Oe),[Oe]),[Et,dt]=p({}),G=N(()=>({...ut,...Et}),[ut,Et]),Ze=(t,r)=>dt(g=>({...g,[t]:r})),ft=N(()=>C==null?void 0:C.filter(t=>!t.layer||(G[t.layer.key]??0)===t.layer.item),[C,G]),T=(hn=C==null?void 0:C.find(t=>t.layer&&t.annotation.id===e.selectedAnnotation))==null?void 0:hn.layer;V(()=>{T&&(G[T.key]??0)!==T.item&&Ze(T.key,T.item)},[T==null?void 0:T.key,T==null?void 0:T.item,e.selectedAnnotation]);const Ue=!!(v!=null&&v.information),J=!!(C!=null&&C.length),ke=et(fa,J),[Rt,Ye]=p(null),w=J&&Rt||ga,$=N(()=>{var g,M;const t=(g=C==null?void 0:C.find(z=>z.annotation.id===w.selected))==null?void 0:g.annotation,r=(Array.isArray(t==null?void 0:t.body)?t==null?void 0:t.body:[t==null?void 0:t.body]).find(z=>(z==null?void 0:z.type)==="Feature");return t&&r?{id:String(t.id),feature:r,name:((M=r.properties)==null?void 0:M.label)??t.label}:null},[C,w.selected]),he=$?`${$.id}:${e.refind??0}`:null,[ht,gt]=p(null),mt=he!==null&&ht!==he,Be=N(()=>{var z,Ne;const t=(o??[]).map(Z=>Z.navPlace).filter(Boolean),r=t.length?t:e.navPlace?[e.navPlace]:[];if(!r.length)return null;const g=r.flatMap(Z=>(Z==null?void 0:Z.type)==="FeatureCollection"?Z.features??[]:(Z==null?void 0:Z.type)==="Feature"?[Z]:[]);if(!g.length)return null;const M=g.length===1?(Ne=(z=g[0])==null?void 0:z.properties)==null?void 0:Ne.label:void 0;return{feature:{type:"FeatureCollection",features:g},name:M??e.label}},[o,e.navPlace,e.label]),Ge=`place-box-${S}`,[l,h]=p(false),[ge,Tn]=p(false),pt=I(w);pt.current=w;const yt=be(()=>pt.current.release(),[]),{comments:Ft,listedCount:Jt}=w,Te=N(()=>Ue?(o??[]).filter(t=>wo(t)||Ft.has(t.id)):[],[o,Ue,Ft]),Lt=`caption-${S}`,[$n,Xt]=p(false),Tt=$n&&Te.length>0,Qt=be(t=>{var r;Xt(false),t&&((r=document.getElementById(`information-${S}`))==null||r.focus())},[S]),W=N(()=>(o??[]).find(t=>Mn(t).length)??null,[o]),zn=W?Mn(W):ka,R=N(()=>o!=null&&o.length?Do(o,ie,G,{standIns:o.length>1}):null,[o,ie,G]),An=N(()=>Fn(a,f,m),[a,f,m]),c=(R==null?void 0:R.media[0])??null,en=!we&&(c==null?void 0:c.kind)==="video",Nn=we||en,Vn=we?lt:it,Dn=N(()=>{if(o!=null&&o.length)return Ho(o,G);const t=(Array.isArray(a)?a:a?[a]:[])[0];return typeof(t==null?void 0:t.type)=="string"?t.type.toLowerCase():f?"image":void 0},[o,G,a,f]),[P,Hn]=p(null),vt=I(ue);vt.current=ue;const Kn=be(t=>{var r;Hn(t),(r=vt.current)==null||r.call(vt,t)},[]),me=R?R.images:An,pe=!!c&&(o==null?void 0:o.length)===1,ye=pe&&(c==null?void 0:c.kind)==="audio",qn=pe&&(c==null?void 0:c.kind)==="video",$e=(o==null?void 0:o.length)===1&&!c&&!W&&me.length===0,bt=!pe&&!$e&&((gn=d==null?void 0:d.gestures)==null?void 0:gn.navigable)!==false,re=o?`${s??""}
2
- ${o.map(t=>t.id).join("|")}`:null,ve=N(()=>{if(!o||!tt)return[];const t=o.flatMap(r=>{const g=Ko(r),M=Qe(r.label,b);return g?[{...g,alt:M.text,lang:M.lang}]:[]});return ie==="right-to-left"||ie==="bottom-to-top"?t.reverse():t},[o,ie,tt,b]),[jn,tn]=p(false),[_n,nn]=p(null),y=!ye&&ve.length>0&&(c?_n!==re:!jn),on=d==null?void 0:d.request;V(()=>{if(y){import("./thumbnail-IWjwr85c.mjs");for(const{source:t}of ve)t.service&&Go(t.service,{request:on}).catch(()=>{})}},[y,ve,on]);const an=(t,{annotations:r=false,fullPage:g=false}={})=>({...t,zoom:false,rotation:false,reset:false,fullPage:g&&t.fullPage,annotations:r&&t.annotations}),Je=$e&&ae,sn=Yt.Children.count(k)>0,$t=ve.length>0&&!ye&&!c,Xe=v?y?Te.length||sn||Jt||c&&(Y!=null&&Y.length)?an(v,{annotations:true}):null:pe||$e?Oe.length||Te.length||sn||Jt||c&&(Y!=null&&Y.length)||Je&&v.fullPage?an(v,{annotations:true,fullPage:Je}):null:v:null,zt=X&&!y&&(c?c.kind==="audio"&&!pe&&me.length>0:true),[At,Wn]=p(null),ze=c?At??c.placement:null,[Ct,Zn]=p(Ba),Nt=N(()=>{const t=(c==null?void 0:c.kind)==="video"&&P&&ze?[...me,{id:c.id,placement:ze,width:ze.width,height:ze.height,media:{element:P}}]:me;return Ct.length?[...t,...Ct]:t},[me,c,P,ze,Ct]),ln=pe&&(c==null?void 0:c.kind)==="video"&&At?At:R?ca(R.placements):null,Un=JSON.stringify([me,ln,Nt.length!==me.length&&[c==null?void 0:c.id,ze],Ct.map(t=>t.id)]),wt=I(null),Vt=I(false),Dt=()=>{c?nn(y?re:null):tn(y),y||yt()},xt=I(null),Yn=t=>{if(P&&!y){P.currentTime=t;return}xt.current=t,y&&Dt()};V(()=>{!P||xt.current===null||(P.currentTime=xt.current,xt.current=null)},[P]);const Ht=Array.isArray(a)?a[0]:a,x=[q,(mn=o==null?void 0:o[0])==null?void 0:mn.label,Ht==null?void 0:Ht.label].map(t=>Qe(t,b)).find(t=>t.text),Gn=N(()=>{const t=Qe(j,b);return t.text&&t.text!==(x==null?void 0:x.text)?t:void 0},[j,b,x==null?void 0:x.text]),rn=Uo((x==null?void 0:x.text)||B("canvasImage"),x?x.lang:se.langOf("canvasImage"),false,se.hostLanguage),It=y?[]:[...bt?[wa]:[],...c?[xa]:[],...J?[Ia]:[]],cn=`keys-${S}`,Jn=bt&&!y&&!se.langOf("canvasRoleDescription")?B("canvasRoleDescription"):void 0,Kt=!!Xe&&Te.length>0,Xn=Kt&&Te.map((t,r)=>Qe(t.label,b).text?xo(Lt,r):null).filter(Boolean).join(" ")||void 0,un=I({canvases:o,scene:R,canvasKey:re});un.current={canvases:o,scene:R,canvasKey:re};const Mt=I(null),qt=be(()=>{const{canvases:t,scene:r,canvasKey:g}=un.current;Mt.current=t&&r&&wt.current===g?{key:g,canvases:t,placements:r.placements}:null},[]),Qn=!o||((pn=Mt.current)==null?void 0:pn.key)===re,Ae=ro(()=>{const t=Mt.current,r=de.current;if(!t||s==="loading")return null;const g=P&&P.currentTime>0?P.currentTime:null,M=!g&&r&&Zt(r)?Ln(r.getBounds(),t.canvases,t.placements):null,z=t.canvases.find(Ne=>Ne.id===(M==null?void 0:M.canvasId))??t.canvases[0];return z?Gt?Gt({manifestId:s,canvasId:z.id,type:z.type,region:M&&{x:M.rect.x,y:M.rect.y,w:M.rect.width,h:M.rect.height},time:g}):(ua().then(()=>Ae()),null):null},Ce);V(()=>co(P,Ae),[P,Ae]),V(()=>{const t=ee.current;if(!t)return;const r=n(t,Le.current),g=Zt(r)?r:null;de.current=r,rt(r),r.setDismiss(yt);const M=()=>{if(!g)return;const A=g.viewLimits();Pt(ce=>ce.atMax===A.atMax&&ce.atMin===A.atMin&&ce.atHome===A.atHome?ce:A)},z=r.on("open",()=>{var A;M(),_t(false),qt(),Ae(),fe("ready"),We(ce=>ce+1),g&&((A=_.current)==null||A.call(_,Oa(g,()=>Mt.current,ce=>{var Cn,wn;const bn=pt.current.placed.find(Wt=>Wt.id===ce);return bn?(pt.current.select(bn),(wn=Array.from(((Cn=g.overlays)==null?void 0:Cn.container.querySelectorAll("[id]"))??[]).find(Wt=>Wt.id===ce))==null||wn.focus({preventScroll:true}),true):false})))}),Ne=r.on("change",()=>{M(),_t(false),qt(),Ae(),fe("ready"),We(A=>A+1)}),Z=r.on("error",()=>{r.isOpen||fe("error")}),to=r.on("unloadable",A=>ct(!!A)),no=r.on("viewport",()=>{var A;M(),g&&((A=Fe.current)==null||A.call(Fe,g.getBounds())),Ae()});return()=>{z(),Ne(),Z(),to(),no(),r.dispose(),de.current=null,rt(null)}},[H,n,yt,qt]),V(()=>{if(!(!le||!qe))return le.attachNavigator(qe)},[le,qe]),V(()=>{if(!(!L||!$e))return L.setGestures({navigable:false}),()=>L.setGestures({})},[L,$e]);const jt=I(false);V(()=>{var r;if(Je)return;const t=!document.activeElement||document.activeElement===document.body;jt.current&&t&&((r=ee.current)==null||r.focus()),jt.current=false},[Je]),V(()=>{const t=de.current;if(y&&(Vt.current=true),!t||!xe||y)return;const r=wt.current!==null&&wt.current!==re;(!t.isOpen||r)&&fe("loading");const g=pe||Vt.current&&t.isOpen||r;wt.current=re,Vt.current=false,t.setImages(Nt,{world:ln??void 0,fit:g})},[Un,H,P,xe,y]);const dn=I(s),[eo,_t]=p(false);Ut(()=>{var t;s!==dn.current&&(dn.current=s,(t=de.current)==null||t.clear(),_t(true),fe("loading"))},[s]);const fn=Re==="loading"&&Nt.length>0&&xe&&!y;return i(ho.Provider,{value:se.hostLanguage,children:i("figure",{"aria-labelledby":Xn,className:Zo("clover-canvas",E),"data-testid":"clover-canvas","data-status":Re,...uo(at),"data-unloadable":je||void 0,"data-has-navigator":zt,"data-fullscreen":ot,"data-exit":Ke||void 0,"data-controls":Nn?Vn?"visible":"hidden":void 0,"data-media":Dn,"data-recording":c?"":void 0,"data-player":ye?"":void 0,"data-animated":W?"":void 0,"data-navigable":bt,"data-placeholder":ve.length&&!ye?y:void 0,ref:se.ref,onFocus:t=>{jt.current=Je&&t.target.id===`fullPage-${S}`},onKeyDown:t=>{if(t.key==="Escape"&&Tt&&!t.defaultPrevented){t.preventDefault(),Qt(false);return}if(t.key==="Escape"&&!t.defaultPrevented&&!t.currentTarget.querySelector(".clover-canvas-menu")&&yt()){t.preventDefault();return}Ao(t,ee.current)},style:{position:"relative",width:"100%",height:"100%",margin:0,overflow:"hidden",isolation:"isolate"},children:[(Xe||zt)&&c&&i("div",{className:"clover-canvas-scrim","aria-hidden":"true"}),en&&i(Se,{fallback:null,children:i(ya,{element:oe,hideDelay:d==null?void 0:d.hideDelay,picture:ee,onChange:te})}),i(Io,{hidden:!Ke}),L&&(Xe||$t)&&i(sa,{renderer:le,instance:S,config:Xe??Ca,controlButtons:Pe,limits:St,placeholderIsMore:$t&&!c,chapters:c?Y:void 0,mediaElement:P,onChapter:Yn,overStill:!!c&&y,request:d==null?void 0:d.request,placeholder:$t&&i(Se,{fallback:null,children:i(ba,{instance:S,media:!!c,active:y,onToggle:Dt,more:!!v&&(v.zoom||v.rotation||v.reset||v.fullPage)})}),fit:!we,more:Q,choices:y?[]:Oe,selections:G,onSelect:Ze,annotations:w.menu,hiddenPages:w.hiddenPages,onPageVisibilityChange:w.setPagesVisible,selectedAnnotation:w.selected,onAnnotationSelect:w.select,onAnnotationActivate:w.activate,captionId:Kt?Lt:void 0,captionOpen:Tt,onCaptionToggle:()=>Xt(t=>!t),placeId:Be?Ge:void 0,placeOpen:l,onPlaceToggle:()=>{Tn(true),h(t=>!t)},language:b,children:Xe&&k}),zt&&i("div",{ref:Me,className:"clover-canvas-navigator","data-testid":"clover-canvas-navigator","aria-hidden":"true"}),i("div",{ref:ee,className:"clover-canvas-viewport",style:{position:"absolute",inset:0,overflow:"hidden",zIndex:-1},"data-testid":"clover-canvas-viewport",role:J?"group":"img","aria-roledescription":Jn,...rn.props,"aria-describedby":It.length?cn:void 0,"aria-keyshortcuts":It.map(({keys:t})=>t).join(" ")||void 0,"aria-busy":fn,tabIndex:0}),rn.node,It.length>0&&i("span",{id:cn,style:fo,children:It.map(({description:t},r)=>i(Yt.Fragment,{children:[r>0&&" ",i("span",{...xn(se.langOf(t)),children:B(t)})]},t))}),i(Mo,{kind:"image",shown:je&&!y}),$e&&!y&&(x==null?void 0:x.text)&&i(Oo,{text:x.text,lang:x.lang||void 0}),(c==null?void 0:c.kind)==="audio"&&!ye&&me.length===0&&!y&&(x==null?void 0:x.text)&&i("p",{className:"clover-canvas-sound-label","aria-hidden":"true",...xn(x.lang||void 0),children:x.text}),ve.length>0&&!ye&&i(Se,{fallback:null,children:i(pa,{instance:S,stills:ve,vertical:ie==="top-to-bottom"||ie==="bottom-to-top",media:!!c,active:y,lingering:Re==="loading"&&!eo,onToggle:Dt,request:d==null?void 0:d.request})}),L&&c&&xe&&!y&&i(Se,{fallback:null,children:i(da,{media:c,request:d==null?void 0:d.request,fillable:qn,surface:L,instance:S,onElement:Kn,onFit:Wn,onCaptionChange:O,caption:Ee,navigable:bt,fullscreen:pe&&!!(v!=null&&v.fullPage),isFullscreen:ae,onEnded:De,chapters:Y,highlightedChapter:He,onChapterHighlight:Bt,autoPlay:!ye&&ve.length>0&&w.quietlyOpened!==re,language:b,notes:w.timed,marked:w.placed,selectedAnnotation:w.selected,onAnnotationSelect:J?w.select:void 0,onAnnotationActivate:w.activate,player:ye&&o?{canvas:o[0],title:x,partOf:Gn}:void 0})}),le&&W&&(R==null?void 0:R.frames[On(W)])&&!y&&i(Se,{fallback:null,children:i(ma,{renderer:le,frames:zn,byFrame:R.frames[On(W)],animationKey:W.id,sceneVersion:_e,autoplay:(yn=d==null?void 0:d.animation)==null?void 0:yn.autoplay,loop:(vn=d==null?void 0:d.animation)==null?void 0:vn.loop,onEnded:De,language:b,duration:Number(W.duration),canvas:W,place:R.placements[o.indexOf(W)],onItems:Zn},W.id)}),ke&&J&&C&&i(ke.AnnotationState,{given:e,annotations:ft??C,scene:R,renderer:le,sceneVersion:_e,drawn:Qn,media:c,mediaElement:P,showPlaceholder:y,canvasKey:re,openImages:tn,openMedia:nn,host:ee,onModel:Ye,refind:e.refind??0}),fn&&i(Wo,{overlay:true}),$&&i(Se,{fallback:null,children:i(Bn,{id:`place-of-${S}`,open:mt,onClose:t=>{var r;gt(he),t&&((r=document.getElementById($.id))==null||r.focus())},feature:$.feature,name:$.name,language:b})}),Be&&ge&&i(Se,{fallback:null,children:i(Bn,{id:Ge,open:l,onClose:t=>{var r;h(false),t&&((r=document.getElementById(`place-${S}`))==null||r.focus())},feature:Be.feature,name:Be.name,language:b})}),Kt&&i(ko,{id:Lt,canvases:Te,comments:Ft,open:Tt,onClose:Qt,language:b})]})})};function Oa(e,n,s){return{fitCanvasRect(o,u,a){const f=n(),m=(f==null?void 0:f.canvases.findIndex(q=>q.id===o))??-1;return!f||m===-1?false:(e.fitBounds(qo(f.canvases[m],f.placements[m],u),a),true)},getCanvasRegion(){const o=n();return o?Ln(e.getBounds(),o.canvases,o.placements):null},get backendKind(){return e.backendKind},get atHome(){return e.isAtHome},fitBounds:(o,u)=>e.fitBounds(o,u),fitItemRect:(o,u,a)=>e.fitItemRect(o,u,a),itemRectToWorld:(o,u)=>e.itemRectToWorld(o,u),getBounds:()=>e.getBounds(),getHomeBounds:()=>e.getHomeBounds(),getCamera:()=>e.getCamera(),home:o=>e.home(o),zoomBy:(o,u,a)=>e.zoomBy(o,u,a),panBy:(o,u,a)=>e.panBy(o,u,a),setRotation:(o,u)=>e.setRotation(o,u),getRotation:()=>e.getRotation(),rotateBy:o=>e.rotateBy(o),worldToScreenPoint:o=>e.worldToScreenPoint(o),screenToWorldPoint:o=>e.screenToWorldPoint(o),on:(o,u)=>e.on(o,u),zoomToAnnotation:s}}const ka=[],Ba=[];function Fn(e,n,s=false){const o=Array.isArray(e)?e:e?[e]:[];return o.length?o.map((a,f)=>{const m=Yo(a.service);return!m&&!a.id?null:{id:`${f}:${a.id??m}|${a.region??""}`,service:m,url:a.id,width:a.width,height:a.height,region:a.region}}).filter(a=>a!==null):(Array.isArray(n)?n:n?[n]:[]).filter(Boolean).map((a,f)=>({id:`${f}:${a}`,...s?{service:a}:{url:a}}))}function Ln(e,n,s){let o=null;if(s.forEach((D,H)=>{const E=Math.max(e.x,D.x),d=Math.max(e.y,D.y),X=Math.min(e.x+e.width,D.x+D.width)-E,K=Math.min(e.y+e.height,D.y+D.height)-d;if(X<=0||K<=0)return;const Q=X*K;(!o||Q>o.area)&&(o={index:H,area:Q,clip:{x:E,y:d,width:X,height:K}})}),!o)return null;const{index:u,clip:a}=o,f=n[u],m=s[u],q=jo(f),j=q.width/m.width,b=q.height/m.height;return{canvasId:f.id,rect:{x:Math.round((a.x-m.x)*j),y:Math.round((a.y-m.y)*b),width:Math.round(a.width*j),height:Math.round(a.height*b)}}}export{Xa as C,Za as a,kt as b,ja as c,Ga as d,Ya as e,Ja as f,qa as g,Zt as h,_a as i,Wa as j,Ua as r,Ka as s,Ha as t,ca as u};
1
+ import{A as I,_ as Ut,a as Pn,d as p,q as be,y as V,t as Qe,f as et,u as i,R as Yt,k as oo,a5 as ao,a6 as so,b as lo,T as N,a7 as io,a8 as ro,a9 as co,aa as uo,P as Se,z as Ve,v as fo,l as xn,ab as ho}from"./shared-Cqxks7jF.mjs";import{u as go,d as En,r as mo,C as po,t as yo,E as vo,e as bo,f as Co,h as wo,g as xo,j as Io,B as Mo,k as ko,l as Oo}from"./pointer-DsqyiOIC.mjs";import{P as Bo,a as So,I as Po,b as Eo}from"./glyphs-PlEEwLrB.mjs";import{B as kt}from"./Button-CgTdpmNf.mjs";import{Z as Ro,a as Fo,b as Lo,c as To,R as In,d as $o,C as zo}from"./controlGlyphs-BI3qUN6D.mjs";import{S as U,f as Ao}from"./Tip-DxvfQm-l.mjs";import{f as No,s as Vo,b as Mn,d as Do,p as Ho,e as Ko,g as kn,h as qo,i as jo}from"./layout-DbMbjpx4.mjs";import{u as _o}from"./useNearViewport-B5E-oZb_.mjs";import{L as Wo}from"./Loading-DGPqbYw2.mjs";import{j as Zo}from"./classnames-DukgfdpI.mjs";import{u as Uo}from"./useContainerName-D_XCWIWP.mjs";import{b as Yo,f as Go}from"./imageService-DfXP25SW.mjs";import"./styles-C9QeBpjd.mjs";function Jo(e,n,s){return e.reduce((o,u)=>o+u+s,-s)<=n}function Xo(e,n,s){const o=e.ownerDocument,u=f=>f instanceof HTMLElement&&e.contains(f)&&!f.closest("[hidden]"),a=[o.getElementById(n),o.getElementById(s),...Array.from(e.querySelectorAll("button"))].find(u);a==null||a.focus()}function Qo({cluster:e,ids:n,more:s,fits:o,settled:u,onFits:a}){const f=I(o);f.current=o;const m=I(a);m.current=a;const q=I(new Map),j=I(n);j.current=n;const v=I(null),D=n.join(" ");return Ut(()=>{const H=e.ownerDocument,E=()=>{var ue;const K=j.current,Q=getComputedStyle(e),Pe=parseFloat(Q.columnGap)||0;let C=e.clientWidth-(parseFloat(Q.paddingLeft)||0)-(parseFloat(Q.paddingRight)||0),F=0;for(const k of K){const Ee=(ue=H.getElementById(k))==null?void 0:ue.offsetWidth;Ee&&q.current.set(k,Ee),F=Math.max(F,q.current.get(k)??0)}for(const k of Array.from(e.children))!(k instanceof HTMLElement)||K.includes(k.id)||k.id===s||k.classList.contains("clover-canvas-more")||!k.offsetWidth||getComputedStyle(k).position==="absolute"||(C-=k.offsetWidth+Pe);const ne=Jo(K.map(k=>q.current.get(k)??F),C,Pe);if(ne===f.current)return;const Ce=H.activeElement;v.current=Ce instanceof HTMLElement&&e.contains(Ce)?Ce.id:null,f.current=ne,m.current(ne)};E();const d=new ResizeObserver(()=>E());d.observe(e);const X=new MutationObserver(()=>E());return X.observe(e,{childList:true}),()=>{d.disconnect(),X.disconnect()}},[e,D,s]),Ut(()=>{if(!u)return;const H=v.current;if(v.current=null,H===null)return;const E=e.ownerDocument.activeElement;(!E||!e.contains(E)||E.closest("[hidden]"))&&Xo(e,H,s)},[o,u,e,s]),null}const ea=()=>import("./AnnotationMenu-n8wZulkI.mjs"),ta=()=>import("./ChaptersMenu-6dDzuI0m.mjs"),na=()=>import("./ChoiceMenu-DH4n5jdL.mjs"),oa=()=>import("./ImageControls-Dk8F5lUA.mjs"),On=2,aa=new Set(["zoomIn","zoomOut","rotateRight","rotateLeft","reset","fullPage"]),Rn={atMax:false,atMin:false,atHome:false},sa=({renderer:e,instance:n,config:s,controlButtons:o,limits:u=Rn,placeholder:a,placeholderIsMore:f=false,choices:m=[],selections:q={},onSelect:j,annotations:v=[],chapters:D=[],mediaElement:H=null,onChapter:E,overStill:d,request:X,hiddenPages:K,onPageVisibilityChange:Q,selectedAnnotation:Pe=null,onAnnotationSelect:C,onAnnotationActivate:F,captionId:ne,captionOpen:Ce=false,onCaptionToggle:ue,placeId:k,placeOpen:Ee=false,onPlaceToggle:De,language:Y,fit:He=true,more:Bt="auto",children:tt})=>{var gt,mt,Be,Ge;const{t:O,langOf:B}=Pn(),[ee,oe]=p(false),[nt,ot]=p(false),ae=`annotations-${n}`,Ke=`${ae}-menu`,se=O("informationPanelTabsAnnotations"),at=B("informationPanelTabsAnnotations"),we=be(l=>{var h;ot(false),F==null||F(null),l&&((h=document.getElementById(ae))==null||h.focus())},[ae,F]),st=s.annotations&&v.length>0&&C,[lt,it]=p(false),te=`chapters-${n}`,xe=`${te}-menu`,Ie=D.length>0&&!!E,S=I(false),de=I(null);V(()=>{const l=()=>{var h;S.current=((h=document.activeElement)==null?void 0:h.id)===te};return document.addEventListener("focusin",l),()=>document.removeEventListener("focusin",l)},[te]);const L=be(()=>{var h,ge;if(!S.current)return;S.current=false;const l=document.activeElement;l&&l!==document.body||(ge=(h=de.current)==null?void 0:h.querySelector('.clover-canvas-transport :is([data-button="play"], [data-button="pause"])'))==null||ge.focus()},[]);V(()=>{Ie||L()},[Ie,L]),V(()=>()=>L(),[L]);const rt=be(l=>{var h;it(false),l&&((h=document.getElementById(te))==null||h.focus())},[te]),le=s.information&&ne&&ue,qe=s.map&&k&&De,Me=`choice-${n}`,b=m.length===1?Qe(m[0].label,Y):null,Re=(b==null?void 0:b.text)||O("canvasChoice"),fe=b!=null&&b.text?b.lang:B("canvasChoice"),je=`${Me}-menu`,ct=(gt=et(ea,!!st))==null?void 0:gt.default,_e=(mt=et(ta,Ie))==null?void 0:mt.default,We=(Be=et(na,m.length>0&&!!j))==null?void 0:Be.default,St=be(l=>{var h;oe(false),l&&((h=document.getElementById(Me))==null||h.focus())},[Me]),Pt=go(),[_,Fe]=p(null);V(()=>{de.current=(_==null?void 0:_.closest(".clover-canvas"))??null},[_]);const Le=En(_),[ie,ke]=p(false),ut=l=>i(kt,{className:l,id:ae,label:se,lang:at,onClick:()=>ot(h=>!h),expanded:nt,controls:Ke,children:i(Eo,{})},"annotations"),dt=(()=>{const l=[],h=e;return s.zoom&&h&&l.push({key:"zoomIn",id:`zoomIn-${n}`,shortcut:U.zoomIn,label:O("imageZoomIn"),lang:B("imageZoomIn"),glyph:i(Ro,{}),unavailable:u.atMax,onClick:()=>h.zoomBy(On)},{key:"zoomOut",id:`zoomOut-${n}`,shortcut:U.zoomOut,label:O("imageZoomOut"),lang:B("imageZoomOut"),glyph:i(Fo,{}),unavailable:u.atMin,onClick:()=>h.zoomBy(1/On)}),s.fullPage&&Pt&&l.push({key:"fullPage",id:`fullPage-${n}`,label:O(Le?"imageExitFullScreen":"imageFullScreen"),lang:B(Le?"imageExitFullScreen":"imageFullScreen"),glyph:Le?i(Lo,{}):i(To,{}),onClick:ge=>void yo(ge.currentTarget)}),s.rotation&&h&&l.push({key:"rotateRight",id:`rotateRight-${n}`,shortcut:U.rotateRight,label:O("imageRotateRight"),lang:B("imageRotateRight"),glyph:i(In,{}),onClick:()=>h.rotateBy(90)},{key:"rotateLeft",id:`rotateLeft-${n}`,shortcut:U.rotateLeft,label:O("imageRotateLeft"),lang:B("imageRotateLeft"),glyph:i(In,{}),onClick:()=>h.rotateBy(-90)}),s.reset&&h&&l.push({key:"reset",id:`reset-${n}`,shortcut:U.reset,label:O("imageResetZoom"),lang:B("imageResetZoom"),glyph:i($o,{}),unavailable:u.atHome,onClick:()=>h.home()}),m.length&&l.push({key:"choice",id:Me,label:Re,lang:fe,glyph:i(zo,{}),onClick:()=>oe(ge=>!ge),expanded:ee,controls:je}),l})(),G=[...dt.filter(l=>l.key!=="fullPage"),...dt.filter(l=>l.key==="fullPage")].map(l=>({id:l.id,view:aa.has(l.key),node:mo(l,o)})),Ze=[qe&&{id:`place-${n}`,view:false,node:i(kt,{id:`place-${n}`,label:O("mapLabel"),lang:B("mapLabel"),onClick:De,expanded:Ee,controls:k,children:i(Bo,{})},"place")},Ie&&{id:te,view:false,node:i(kt,{id:te,label:O("playerChapters"),lang:B("playerChapters"),onClick:()=>it(l=>!l),expanded:lt,controls:xe,children:i(So,{})},"chapters")},st&&{id:ae,view:false,node:ut()},le&&{id:`information-${n}`,view:false,node:i(kt,{id:`information-${n}`,label:O("informationPanelTabsAbout"),lang:B("informationPanelTabsAbout"),onClick:ue,expanded:Ce,controls:ne,children:i(Po,{})},"information")},!!a&&{id:`placeholder-${n}`,view:false,node:i(Yt.Fragment,{children:a},"placeholder")}].filter(l=>!!l),ft=Ze.filter(l=>l.id===`placeholder-${n}`),T=[...G.filter(l=>l.view),...ft],Ue=[...G.filter(l=>!l.view),...Ze.filter(l=>!ft.includes(l))],J=[...T,...Ue],[Oe,Rt]=p(true),Ye=Bt==="always"||f,w=(Ge=et(oa,He&&(f||(Ye||!Oe)&&J.some(l=>l.view))))==null?void 0:Ge.ImageControls,$=Oe&&!Ye||!w?[]:J.filter(l=>l.view),he=f&&!!a&&!!w;V(()=>{$.length||ke(false)},[$.length]);const ht=l=>l.filter(h=>!$.includes(h)&&!(he&&h.id===`placeholder-${n}`)).map(({node:h})=>h);return i(oo,{children:[i(po,{fit:He,clusterRef:Fe,children:[ht(T),w&&($.length>0||he)&&i(w,{instance:n,open:he?$.length>0:ie,onOpenChange:ke,toggle:he?a:void 0,children:$.map(({node:l})=>l)}),ht(Ue),tt]}),He&&!Ye&&_&&i(Qo,{cluster:_,ids:J.map(({id:l})=>l),more:`more-${n}`,fits:Oe,settled:Oe||$.length>0||!J.some(l=>l.view),onFits:Rt}),_e&&lt&&Ie&&i(_e,{id:xe,triggerId:te,label:O("playerChapters"),labelLang:B("playerChapters"),chapters:D,element:H,onChapter:E,overStill:d,request:X,onClose:rt}),ct&&nt&&st&&i(ct,{id:Ke,triggerId:ae,label:se,labelLang:at,annotations:v,hiddenPages:K,onPageVisibilityChange:Q,selected:Pe,onSelect:C,onActivate:l=>F==null?void 0:F(l),onClose:we}),We&&ee&&m.length>0&&j&&i(We,{id:je,triggerId:Me,label:Re,labelLang:fe,language:Y,choices:m,selections:q,onSelect:j,onClose:St})]})},la=Object.freeze({a:1,b:0,c:0,d:1,e:0,f:0});function Ha(e,n){return{a:1,b:0,c:0,d:1,e,f:n}}function Ka(e,n=e){return{a:e,b:0,c:0,d:n,e:0,f:0}}function qa(e){const n=Math.cos(e),s=Math.sin(e);return{a:n,b:s,c:-s,d:n,e:0,f:0}}function ia(e,n){return{a:e.a*n.a+e.c*n.b,b:e.b*n.a+e.d*n.b,c:e.a*n.c+e.c*n.d,d:e.b*n.c+e.d*n.d,e:e.a*n.e+e.c*n.f+e.e,f:e.b*n.e+e.d*n.f+e.f}}function ja(...e){return e.reduce((n,s)=>ia(n,s),la)}function _a(e){const n=e.a*e.d-e.b*e.c;if(!n||!Number.isFinite(n))return null;const s=1/n;return{a:e.d*s,b:-e.b*s,c:-e.c*s,d:e.a*s,e:(e.c*e.f-e.d*e.e)*s,f:(e.b*e.e-e.a*e.f)*s}}function Ot(e,n){return{x:e.a*n.x+e.c*n.y+e.e,y:e.b*n.x+e.d*n.y+e.f}}function Wa(e){return`matrix(${[e.a,e.b,e.c,e.d,e.e,e.f].map(ra).join(",")})`}function Za(e,n,s,o=new Float32Array(9)){const u=2/n,a=-2/s;return o[0]=e.a*u,o[1]=e.b*a,o[2]=0,o[3]=e.c*u,o[4]=e.d*a,o[5]=0,o[6]=e.e*u-1,o[7]=e.f*a+1,o[8]=1,o}function ra(e){const n=Math.round(e*1e6)/1e6;return Object.is(n,-0)?"0":String(n)}function Ua(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}function ca(e){if(!e.length)return null;let n=1/0,s=1/0,o=-1/0,u=-1/0;for(const a of e)n=Math.min(n,a.x),s=Math.min(s,a.y),o=Math.max(o,a.x+a.width),u=Math.max(u,a.y+a.height);return{x:n,y:s,width:o-n,height:u-s}}function Ya(e,n){return e.x<n.x+n.width&&n.x<e.x+e.width&&e.y<n.y+n.height&&n.y<e.y+e.height}function Ga(e,n){const s=[Ot(e,{x:n.x,y:n.y}),Ot(e,{x:n.x+n.width,y:n.y}),Ot(e,{x:n.x,y:n.y+n.height}),Ot(e,{x:n.x+n.width,y:n.y+n.height})],o=s.map(m=>m.x),u=s.map(m=>m.y),a=Math.min(...o),f=Math.min(...u);return{x:a,y:f,width:Math.max(...o)-a,height:Math.max(...u)-f}}function Ja(e,n,s){return Math.min(Math.max(e,n),s)}const Zt=e=>!!(e&&"overlays"in e);let Gt;const ua=()=>import("./shared-Cqxks7jF.mjs").then(e=>e.aP).then(e=>{Gt=e.buildContentState}),da=Ve(()=>import("./MediaBody-CU6BHhYo.mjs")),fa=()=>import("./AnnotationState-DJSkyiw0.mjs"),ha=new Map,ga={menu:[],placed:[],timed:[],hiddenPages:[],setPagesVisible:()=>{},listedCount:0,comments:ha,selected:null,select:()=>{},activate:()=>{},release:()=>false,quietlyOpened:null},ma=Ve(()=>import("./FrameAnimation-CjHUil6t.mjs")),Bn=Ve(()=>import("./PlaceBox-CHl0X25c.mjs")),pa=Ve(()=>import("./Placeholder-Cg3ByN0S.mjs")),ya=Ve(()=>import("./ControlsFade-BDjMo25i.mjs")),va=()=>true,ba=Ve(()=>import("./Placeholder-Cg3ByN0S.mjs").then(({PlaceholderToggle:e})=>({default:e}))),Sn={zoom:true,fullPage:true,rotation:true,reset:true,annotations:true,information:true,map:true},Ca={zoom:false,fullPage:false,rotation:false,reset:false,annotations:false,information:false,map:false},wa={description:"canvasKeysImage",keys:["ArrowLeft ArrowRight ArrowUp ArrowDown",U.zoomIn.keys,U.zoomOut.keys,U.reset.keys,U.rotateRight.keys,U.rotateLeft.keys].join(" ")},xa={description:"canvasKeysMedia",keys:[U.play.keys,"J L",U.mute.keys].join(" ")},Ia={description:"canvasKeysAnnotations",keys:"Escape"},Xa=e=>{var s;return!!((s=e.canvases)!=null&&s.length)||Fn(e.body,e.src).length>0?i(vo,{children:i(Ma,{...e})}):null},Ma=e=>{var hn,gn,mn,pn,yn,vn;const{surface:n,manifestId:s,canvases:o,viewingDirection:u,body:a,src:f,isTiledImage:m=false,label:q,partOf:j,language:v,highContrast:D,instanceId:H,className:E,options:d,navigator:X=false,controls:K=true,collapseControls:Q="auto",controlButtons:Pe,annotations:C,onReady:F,onViewportChange:ne,onContentStateChange:Ce,onMediaElement:ue,onCaptionChange:k,caption:Ee,onEnded:De,chapters:Y,highlightedChapter:He,onChapterHighlight:Bt,placeholder:tt=true,children:O}=e,{t:B}=Pn(),ee=I(null),[oe,nt]=p(null),ot=bo(oe),ae=En(oe),Ke=Co(oe),se=ao(nt),at=so(D),we=!!n.controlsVisibility,lt=(n.controlsVisibility??va)(we?oe:null,d==null?void 0:d.hideDelay,ee),[it,te]=p(false),xe=_o(oe),Ie=lo(),[S]=p(()=>H??`clover-canvas-${Ie}`),de=I(null),[L,rt]=p(null),le=Zt(L)?L:null,[qe,Me]=p(null),b=K===false?null:K===true?Sn:{...Sn,...K},[Re,fe]=p("loading"),[je,ct]=p(false),[_e,We]=p(0),[St,Pt]=p(Rn),_=I(F),Fe=I(ne),Le=I(d);_.current=F,Fe.current=ne,Le.current=d;const ie=io(u),ke=N(()=>No(o??[]),[o]),ut=N(()=>Vo(ke,v),[ke,v]),[Et,dt]=p({}),G=N(()=>({...ut,...Et}),[ut,Et]),Ze=(t,r)=>dt(g=>({...g,[t]:r})),ft=N(()=>C==null?void 0:C.filter(t=>!t.layer||(G[t.layer.key]??0)===t.layer.item),[C,G]),T=(hn=C==null?void 0:C.find(t=>t.layer&&t.annotation.id===e.selectedAnnotation))==null?void 0:hn.layer;V(()=>{T&&(G[T.key]??0)!==T.item&&Ze(T.key,T.item)},[T==null?void 0:T.key,T==null?void 0:T.item,e.selectedAnnotation]);const Ue=!!(b!=null&&b.information),J=!!(C!=null&&C.length),Oe=et(fa,J),[Rt,Ye]=p(null),w=J&&Rt||ga,$=N(()=>{var g,M;const t=(g=C==null?void 0:C.find(z=>z.annotation.id===w.selected))==null?void 0:g.annotation,r=(Array.isArray(t==null?void 0:t.body)?t==null?void 0:t.body:[t==null?void 0:t.body]).find(z=>(z==null?void 0:z.type)==="Feature");return t&&r?{id:String(t.id),feature:r,name:((M=r.properties)==null?void 0:M.label)??t.label}:null},[C,w.selected]),he=$?`${$.id}:${e.refind??0}`:null,[ht,gt]=p(null),mt=he!==null&&ht!==he,Be=N(()=>{var z,Ne;const t=(o??[]).map(Z=>Z.navPlace).filter(Boolean),r=t.length?t:e.navPlace?[e.navPlace]:[];if(!r.length)return null;const g=r.flatMap(Z=>(Z==null?void 0:Z.type)==="FeatureCollection"?Z.features??[]:(Z==null?void 0:Z.type)==="Feature"?[Z]:[]);if(!g.length)return null;const M=g.length===1?(Ne=(z=g[0])==null?void 0:z.properties)==null?void 0:Ne.label:void 0;return{feature:{type:"FeatureCollection",features:g},name:M??e.label}},[o,e.navPlace,e.label]),Ge=`place-box-${S}`,[l,h]=p(false),[ge,Tn]=p(false),pt=I(w);pt.current=w;const yt=be(()=>pt.current.release(),[]),{comments:Ft,listedCount:Jt}=w,Te=N(()=>Ue?(o??[]).filter(t=>wo(t)||Ft.has(t.id)):[],[o,Ue,Ft]),Lt=`caption-${S}`,[$n,Xt]=p(false),Tt=$n&&Te.length>0,Qt=be(t=>{var r;Xt(false),t&&((r=document.getElementById(`information-${S}`))==null||r.focus())},[S]),W=N(()=>(o??[]).find(t=>Mn(t).length)??null,[o]),zn=W?Mn(W):Oa,R=N(()=>o!=null&&o.length?Do(o,ie,G,{standIns:o.length>1}):null,[o,ie,G]),An=N(()=>Fn(a,f,m),[a,f,m]),c=(R==null?void 0:R.media[0])??null,en=!we&&(c==null?void 0:c.kind)==="video",Nn=we||en,Vn=we?lt:it,Dn=N(()=>{if(o!=null&&o.length)return Ho(o,G);const t=(Array.isArray(a)?a:a?[a]:[])[0];return typeof(t==null?void 0:t.type)=="string"?t.type.toLowerCase():f?"image":void 0},[o,G,a,f]),[P,Hn]=p(null),vt=I(ue);vt.current=ue;const Kn=be(t=>{var r;Hn(t),(r=vt.current)==null||r.call(vt,t)},[]),me=R?R.images:An,pe=!!c&&(o==null?void 0:o.length)===1,ye=pe&&(c==null?void 0:c.kind)==="audio",qn=pe&&(c==null?void 0:c.kind)==="video",$e=(o==null?void 0:o.length)===1&&!c&&!W&&me.length===0,bt=!pe&&!$e&&((gn=d==null?void 0:d.gestures)==null?void 0:gn.navigable)!==false,re=o?`${s??""}
2
+ ${o.map(t=>t.id).join("|")}`:null,ve=N(()=>{if(!o||!tt)return[];const t=o.flatMap(r=>{const g=Ko(r),M=Qe(r.label,v);return g?[{...g,alt:M.text,lang:M.lang}]:[]});return ie==="right-to-left"||ie==="bottom-to-top"?t.reverse():t},[o,ie,tt,v]),[jn,tn]=p(false),[_n,nn]=p(null),y=!ye&&ve.length>0&&(c?_n!==re:!jn),on=d==null?void 0:d.request;V(()=>{if(y){import("./thumbnail-Ckf6EotT.mjs");for(const{source:t}of ve)t.service&&Go(t.service,{request:on}).catch(()=>{})}},[y,ve,on]);const an=(t,{annotations:r=false,fullPage:g=false}={})=>({...t,zoom:false,rotation:false,reset:false,fullPage:g&&t.fullPage,annotations:r&&t.annotations}),Je=$e&&ae,sn=Yt.Children.count(O)>0,$t=ve.length>0&&!ye&&!c,Xe=b?y?Te.length||sn||Jt||c&&(Y!=null&&Y.length)?an(b,{annotations:true}):null:pe||$e?ke.length||Te.length||sn||Jt||c&&(Y!=null&&Y.length)||Je&&b.fullPage?an(b,{annotations:true,fullPage:Je}):null:b:null,zt=X&&!y&&(c?c.kind==="audio"&&!pe&&me.length>0:true),[At,Wn]=p(null),ze=c?At??c.placement:null,[Ct,Zn]=p(Ba),Nt=N(()=>{const t=(c==null?void 0:c.kind)==="video"&&P&&ze?[...me,{id:c.id,placement:ze,width:ze.width,height:ze.height,media:{element:P}}]:me;return Ct.length?[...t,...Ct]:t},[me,c,P,ze,Ct]),ln=pe&&(c==null?void 0:c.kind)==="video"&&At?At:R?ca(R.placements):null,Un=JSON.stringify([me,ln,Nt.length!==me.length&&[c==null?void 0:c.id,ze],Ct.map(t=>t.id)]),wt=I(null),Vt=I(false),Dt=()=>{c?nn(y?re:null):tn(y),y||yt()},xt=I(null),Yn=t=>{if(P&&!y){P.currentTime=t;return}xt.current=t,y&&Dt()};V(()=>{!P||xt.current===null||(P.currentTime=xt.current,xt.current=null)},[P]);const Ht=Array.isArray(a)?a[0]:a,x=[q,(mn=o==null?void 0:o[0])==null?void 0:mn.label,Ht==null?void 0:Ht.label].map(t=>Qe(t,v)).find(t=>t.text),Gn=N(()=>{const t=Qe(j,v);return t.text&&t.text!==(x==null?void 0:x.text)?t:void 0},[j,v,x==null?void 0:x.text]),rn=Uo((x==null?void 0:x.text)||B("canvasImage"),x?x.lang:se.langOf("canvasImage"),false,se.hostLanguage),It=y?[]:[...bt?[wa]:[],...c?[xa]:[],...J?[Ia]:[]],cn=`keys-${S}`,Jn=bt&&!y&&!se.langOf("canvasRoleDescription")?B("canvasRoleDescription"):void 0,Kt=!!Xe&&Te.length>0,Xn=Kt&&Te.map((t,r)=>Qe(t.label,v).text?xo(Lt,r):null).filter(Boolean).join(" ")||void 0,un=I({canvases:o,scene:R,canvasKey:re});un.current={canvases:o,scene:R,canvasKey:re};const Mt=I(null),qt=be(()=>{const{canvases:t,scene:r,canvasKey:g}=un.current;Mt.current=t&&r&&wt.current===g?{key:g,canvases:t,placements:r.placements}:null},[]),Qn=!o||((pn=Mt.current)==null?void 0:pn.key)===re,Ae=ro(()=>{const t=Mt.current,r=de.current;if(!t||s==="loading")return null;const g=P&&P.currentTime>0?P.currentTime:null,M=!g&&r&&Zt(r)?Ln(r.getBounds(),t.canvases,t.placements):null,z=t.canvases.find(Ne=>Ne.id===(M==null?void 0:M.canvasId))??t.canvases[0];return z?Gt?Gt({manifestId:s,canvasId:z.id,type:z.type,region:M&&{x:M.rect.x,y:M.rect.y,w:M.rect.width,h:M.rect.height},time:g}):(ua().then(()=>Ae()),null):null},Ce);V(()=>co(P,Ae),[P,Ae]),V(()=>{const t=ee.current;if(!t)return;const r=n(t,Le.current),g=Zt(r)?r:null;de.current=r,rt(r),r.setDismiss(yt);const M=()=>{if(!g)return;const A=g.viewLimits();Pt(ce=>ce.atMax===A.atMax&&ce.atMin===A.atMin&&ce.atHome===A.atHome?ce:A)},z=r.on("open",()=>{var A;M(),_t(false),qt(),Ae(),fe("ready"),We(ce=>ce+1),g&&((A=_.current)==null||A.call(_,ka(g,()=>Mt.current,ce=>{var Cn,wn;const bn=pt.current.placed.find(Wt=>Wt.id===ce);return bn?(pt.current.select(bn),(wn=Array.from(((Cn=g.overlays)==null?void 0:Cn.container.querySelectorAll("[id]"))??[]).find(Wt=>Wt.id===ce))==null||wn.focus({preventScroll:true}),true):false})))}),Ne=r.on("change",()=>{M(),_t(false),qt(),Ae(),fe("ready"),We(A=>A+1)}),Z=r.on("error",()=>{r.isOpen||fe("error")}),to=r.on("unloadable",A=>ct(!!A)),no=r.on("viewport",()=>{var A;M(),g&&((A=Fe.current)==null||A.call(Fe,g.getBounds())),Ae()});return()=>{z(),Ne(),Z(),to(),no(),r.dispose(),de.current=null,rt(null)}},[H,n,yt,qt]),V(()=>{if(!(!le||!qe))return le.attachNavigator(qe)},[le,qe]),V(()=>{if(!(!L||!$e))return L.setGestures({navigable:false}),()=>L.setGestures({})},[L,$e]);const jt=I(false);V(()=>{var r;if(Je)return;const t=!document.activeElement||document.activeElement===document.body;jt.current&&t&&((r=ee.current)==null||r.focus()),jt.current=false},[Je]),V(()=>{const t=de.current;if(y&&(Vt.current=true),!t||!xe||y)return;const r=wt.current!==null&&wt.current!==re;(!t.isOpen||r)&&fe("loading");const g=pe||Vt.current&&t.isOpen||r;wt.current=re,Vt.current=false,t.setImages(Nt,{world:ln??void 0,fit:g})},[Un,H,P,xe,y]);const dn=I(s),[eo,_t]=p(false);Ut(()=>{var t;s!==dn.current&&(dn.current=s,(t=de.current)==null||t.clear(),_t(true),fe("loading"))},[s]);const fn=Re==="loading"&&Nt.length>0&&xe&&!y;return i(ho.Provider,{value:se.hostLanguage,children:i("figure",{"aria-labelledby":Xn,className:Zo("clover-canvas",E),"data-testid":"clover-canvas","data-status":Re,...uo(at),"data-unloadable":je||void 0,"data-has-navigator":zt,"data-fullscreen":ot,"data-exit":Ke||void 0,"data-controls":Nn?Vn?"visible":"hidden":void 0,"data-media":Dn,"data-recording":c?"":void 0,"data-player":ye?"":void 0,"data-animated":W?"":void 0,"data-navigable":bt,"data-placeholder":ve.length&&!ye?y:void 0,ref:se.ref,onFocus:t=>{jt.current=Je&&t.target.id===`fullPage-${S}`},onKeyDown:t=>{if(t.key==="Escape"&&Tt&&!t.defaultPrevented){t.preventDefault(),Qt(false);return}if(t.key==="Escape"&&!t.defaultPrevented&&!t.currentTarget.querySelector(".clover-canvas-menu")&&yt()){t.preventDefault();return}Ao(t,ee.current)},style:{position:"relative",width:"100%",height:"100%",margin:0,overflow:"hidden",isolation:"isolate"},children:[(Xe||zt)&&c&&i("div",{className:"clover-canvas-scrim","aria-hidden":"true"}),en&&i(Se,{fallback:null,children:i(ya,{element:oe,hideDelay:d==null?void 0:d.hideDelay,picture:ee,onChange:te})}),i(Io,{hidden:!Ke}),L&&(Xe||$t)&&i(sa,{renderer:le,instance:S,config:Xe??Ca,controlButtons:Pe,limits:St,placeholderIsMore:$t&&!c,chapters:c?Y:void 0,mediaElement:P,onChapter:Yn,overStill:!!c&&y,request:d==null?void 0:d.request,placeholder:$t&&i(Se,{fallback:null,children:i(ba,{instance:S,media:!!c,active:y,onToggle:Dt,more:!!b&&(b.zoom||b.rotation||b.reset||b.fullPage)})}),fit:!we,more:Q,choices:y?[]:ke,selections:G,onSelect:Ze,annotations:w.menu,hiddenPages:w.hiddenPages,onPageVisibilityChange:w.setPagesVisible,selectedAnnotation:w.selected,onAnnotationSelect:w.select,onAnnotationActivate:w.activate,captionId:Kt?Lt:void 0,captionOpen:Tt,onCaptionToggle:()=>Xt(t=>!t),placeId:Be?Ge:void 0,placeOpen:l,onPlaceToggle:()=>{Tn(true),h(t=>!t)},language:v,children:Xe&&O}),zt&&i("div",{ref:Me,className:"clover-canvas-navigator","data-testid":"clover-canvas-navigator","aria-hidden":"true"}),i("div",{ref:ee,className:"clover-canvas-viewport",style:{position:"absolute",inset:0,overflow:"hidden",zIndex:-1},"data-testid":"clover-canvas-viewport",role:J?"group":"img","aria-roledescription":Jn,...rn.props,"aria-describedby":It.length?cn:void 0,"aria-keyshortcuts":It.map(({keys:t})=>t).join(" ")||void 0,"aria-busy":fn,tabIndex:0}),rn.node,It.length>0&&i("span",{id:cn,style:fo,children:It.map(({description:t},r)=>i(Yt.Fragment,{children:[r>0&&" ",i("span",{...xn(se.langOf(t)),children:B(t)})]},t))}),i(Mo,{kind:"image",shown:je&&!y}),$e&&!y&&(x==null?void 0:x.text)&&i(ko,{text:x.text,lang:x.lang||void 0}),(c==null?void 0:c.kind)==="audio"&&!ye&&me.length===0&&!y&&(x==null?void 0:x.text)&&i("p",{className:"clover-canvas-sound-label","aria-hidden":"true",...xn(x.lang||void 0),children:x.text}),ve.length>0&&!ye&&i(Se,{fallback:null,children:i(pa,{instance:S,stills:ve,vertical:ie==="top-to-bottom"||ie==="bottom-to-top",media:!!c,active:y,lingering:Re==="loading"&&!eo,onToggle:Dt,request:d==null?void 0:d.request})}),L&&c&&xe&&!y&&i(Se,{fallback:null,children:i(da,{media:c,request:d==null?void 0:d.request,fillable:qn,surface:L,instance:S,onElement:Kn,onFit:Wn,onCaptionChange:k,caption:Ee,navigable:bt,fullscreen:pe&&!!(b!=null&&b.fullPage),isFullscreen:ae,onEnded:De,chapters:Y,highlightedChapter:He,onChapterHighlight:Bt,autoPlay:!ye&&ve.length>0&&w.quietlyOpened!==re,language:v,notes:w.timed,marked:w.placed,selectedAnnotation:w.selected,onAnnotationSelect:J?w.select:void 0,onAnnotationActivate:w.activate,player:ye&&o?{canvas:o[0],title:x,partOf:Gn}:void 0})}),le&&W&&(R==null?void 0:R.frames[kn(W)])&&!y&&i(Se,{fallback:null,children:i(ma,{renderer:le,frames:zn,byFrame:R.frames[kn(W)],animationKey:W.id,sceneVersion:_e,autoplay:(yn=d==null?void 0:d.animation)==null?void 0:yn.autoplay,loop:(vn=d==null?void 0:d.animation)==null?void 0:vn.loop,onEnded:De,language:v,duration:Number(W.duration),canvas:W,place:R.placements[o.indexOf(W)],onItems:Zn},W.id)}),Oe&&J&&C&&i(Oe.AnnotationState,{given:e,annotations:ft??C,scene:R,renderer:le,sceneVersion:_e,drawn:Qn,media:c,mediaElement:P,showPlaceholder:y,canvasKey:re,openImages:tn,openMedia:nn,host:ee,onModel:Ye,refind:e.refind??0}),fn&&i(Wo,{overlay:true}),$&&i(Se,{fallback:null,children:i(Bn,{id:`place-of-${S}`,open:mt,onClose:t=>{var r;gt(he),t&&((r=document.getElementById($.id))==null||r.focus())},feature:$.feature,name:$.name,language:v})}),Be&&ge&&i(Se,{fallback:null,children:i(Bn,{id:Ge,open:l,onClose:t=>{var r;h(false),t&&((r=document.getElementById(`place-${S}`))==null||r.focus())},feature:Be.feature,name:Be.name,language:v})}),Kt&&i(Oo,{id:Lt,canvases:Te,comments:Ft,open:Tt,onClose:Qt,language:v})]})})};function ka(e,n,s){return{fitCanvasRect(o,u,a){const f=n(),m=(f==null?void 0:f.canvases.findIndex(q=>q.id===o))??-1;return!f||m===-1?false:(e.fitBounds(qo(f.canvases[m],f.placements[m],u),a),true)},getCanvasRegion(){const o=n();return o?Ln(e.getBounds(),o.canvases,o.placements):null},get backendKind(){return e.backendKind},get atHome(){return e.isAtHome},fitBounds:(o,u)=>e.fitBounds(o,u),fitItemRect:(o,u,a)=>e.fitItemRect(o,u,a),itemRectToWorld:(o,u)=>e.itemRectToWorld(o,u),getBounds:()=>e.getBounds(),getHomeBounds:()=>e.getHomeBounds(),getCamera:()=>e.getCamera(),home:o=>e.home(o),zoomBy:(o,u,a)=>e.zoomBy(o,u,a),panBy:(o,u,a)=>e.panBy(o,u,a),setRotation:(o,u)=>e.setRotation(o,u),getRotation:()=>e.getRotation(),rotateBy:o=>e.rotateBy(o),worldToScreenPoint:o=>e.worldToScreenPoint(o),screenToWorldPoint:o=>e.screenToWorldPoint(o),on:(o,u)=>e.on(o,u),zoomToAnnotation:s}}const Oa=[],Ba=[];function Fn(e,n,s=false){const o=Array.isArray(e)?e:e?[e]:[];return o.length?o.map((a,f)=>{const m=Yo(a.service);return!m&&!a.id?null:{id:`${f}:${a.id??m}|${a.region??""}`,service:m,url:a.id,width:a.width,height:a.height,region:a.region}}).filter(a=>a!==null):(Array.isArray(n)?n:n?[n]:[]).filter(Boolean).map((a,f)=>({id:`${f}:${a}`,...s?{service:a}:{url:a}}))}function Ln(e,n,s){let o=null;if(s.forEach((D,H)=>{const E=Math.max(e.x,D.x),d=Math.max(e.y,D.y),X=Math.min(e.x+e.width,D.x+D.width)-E,K=Math.min(e.y+e.height,D.y+D.height)-d;if(X<=0||K<=0)return;const Q=X*K;(!o||Q>o.area)&&(o={index:H,area:Q,clip:{x:E,y:d,width:X,height:K}})}),!o)return null;const{index:u,clip:a}=o,f=n[u],m=s[u],q=jo(f),j=q.width/m.width,v=q.height/m.height;return{canvasId:f.id,rect:{x:Math.round((a.x-m.x)*j),y:Math.round((a.y-m.y)*v),width:Math.round(a.width*j),height:Math.round(a.height*v)}}}export{Xa as C,Za as a,Ot as b,ja as c,Ga as d,Ya as e,Ja as f,qa as g,Zt as h,_a as i,Wa as j,Ua as r,Ka as s,Ha as t,ca as u};
@@ -1 +1 @@
1
- import{a as c,u as a,t as d,l as p,aK as v,k as m}from"./shared-DJyYaNgB.mjs";import{M as f,a as h}from"./Markup-zy52Xoel.mjs";import{R as u}from"./ReadMore-EjrUmbD0.mjs";import{E as b}from"./EntryBodies-BeD_WacH.mjs";const T=({summary:s,metadata:n,comments:o,language:r})=>{const{t,langOf:l}=c();return a(m,{children:[d(s,r).text&&a(u,{children:a(f,{as:"p",markup:s,language:r,className:"clover-summary clover-canvas-caption-summary"})}),a(h,{metadata:n,language:r,className:"clover-metadata clover-canvas-caption-metadata"}),o!=null&&o.length?a("div",{className:"clover-canvas-caption-annotations",children:[a("p",{className:"clover-canvas-caption-annotations-label",...p(l("informationPanelTabsAnnotations")),children:t("informationPanelTabsAnnotations")}),a("ul",{children:o.map((i,e)=>a("li",{children:a(b,{bodies:v(i),language:r})},i.id??e))})]}):null]})};export{T as default};
1
+ import{a as c,u as a,t as d,l as p,aL as v,k as m}from"./shared-Cqxks7jF.mjs";import{M as f,a as h}from"./Markup-D5v_pfK-.mjs";import{R as u}from"./ReadMore-D80et8BG.mjs";import{E as b}from"./EntryBodies-D2OorCCX.mjs";const T=({summary:s,metadata:n,comments:o,language:r})=>{const{t,langOf:l}=c();return a(m,{children:[d(s,r).text&&a(u,{children:a(f,{as:"p",markup:s,language:r,className:"clover-summary clover-canvas-caption-summary"})}),a(h,{metadata:n,language:r,className:"clover-metadata clover-canvas-caption-metadata"}),o!=null&&o.length?a("div",{className:"clover-canvas-caption-annotations",children:[a("p",{className:"clover-canvas-caption-annotations-label",...p(l("informationPanelTabsAnnotations")),children:t("informationPanelTabsAnnotations")}),a("ul",{children:o.map((i,e)=>a("li",{children:a(b,{bodies:v(i),language:r})},i.id??e))})]}):null]})};export{T as default};
@@ -1 +1 @@
1
- import{d as y,y as N,A as T,u as t,al as L,l as b}from"./shared-DJyYaNgB.mjs";import C from"./ControlMenu-BaBwqPBx.mjs";import{c as D,a as P}from"./Transport-C1bwJBQM.mjs";import{u as w}from"./useContainerName-jjktq7OB.mjs";import{E as A}from"./EntryThumbnail-Cs_9m02f.mjs";const B=({id:u,triggerId:p,label:v,labelLang:f,chapters:s,element:e,onChapter:g,overStill:E=false,request:h,onClose:o})=>{const i=w(v,f),[k,c]=y(()=>(e==null?void 0:e.currentTime)??0);N(()=>{if(!e)return;const r=()=>c(e.currentTime);return r(),e.addEventListener("timeupdate",r),e.addEventListener("seeked",r),()=>{e.removeEventListener("timeupdate",r),e.removeEventListener("seeked",r)}},[e]);const m=D(s,k),n=T(false),l=r=>{g(s[r].start),c(s[r].start)};return t(C,{"data-testid":"clover-canvas-chapters",id:u,onClose:o,triggerId:p,children:[t("fieldset",{className:"clover-canvas-menu-group",...i.props,children:s.map((r,a)=>t("label",{className:"clover-canvas-menu-item clover-canvas-chapters-item",onPointerDown:()=>{n.current=true},children:[t("input",{type:"radio",name:u,checked:a===m,onChange:()=>{E&&!n.current?c(s[a].start):l(a)},onClick:()=>{n.current&&o(true)},onKeyDown:d=>{n.current=false,d.key==="Enter"&&(d.preventDefault(),l(a),o(true))}}),t("span",{className:"clover-cue-time",children:L(r.start)})," ",t("span",{className:"clover-cue-text",...b(r.lang||void 0),children:r.label}),a===m&&t(A,{source:P(r),request:h,large:true})]},r.id??a))}),i.node]})};export{B as default};
1
+ import{d as y,y as N,A as T,u as t,am as L,l as b}from"./shared-Cqxks7jF.mjs";import C from"./ControlMenu-J-gMDza-.mjs";import{c as D,a as P}from"./Transport-K0u9YhmA.mjs";import{u as w}from"./useContainerName-D_XCWIWP.mjs";import{E as A}from"./EntryThumbnail-iY1cnsAP.mjs";const B=({id:u,triggerId:p,label:v,labelLang:f,chapters:s,element:e,onChapter:g,overStill:E=false,request:h,onClose:o})=>{const i=w(v,f),[k,c]=y(()=>(e==null?void 0:e.currentTime)??0);N(()=>{if(!e)return;const r=()=>c(e.currentTime);return r(),e.addEventListener("timeupdate",r),e.addEventListener("seeked",r),()=>{e.removeEventListener("timeupdate",r),e.removeEventListener("seeked",r)}},[e]);const m=D(s,k),n=T(false),l=r=>{g(s[r].start),c(s[r].start)};return t(C,{"data-testid":"clover-canvas-chapters",id:u,onClose:o,triggerId:p,children:[t("fieldset",{className:"clover-canvas-menu-group",...i.props,children:s.map((r,a)=>t("label",{className:"clover-canvas-menu-item clover-canvas-chapters-item",onPointerDown:()=>{n.current=true},children:[t("input",{type:"radio",name:u,checked:a===m,onChange:()=>{E&&!n.current?c(s[a].start):l(a)},onClick:()=>{n.current&&o(true)},onKeyDown:d=>{n.current=false,d.key==="Enter"&&(d.preventDefault(),l(a),o(true))}}),t("span",{className:"clover-cue-time",children:L(r.start)})," ",t("span",{className:"clover-cue-text",...b(r.lang||void 0),children:r.label}),a===m&&t(A,{source:P(r),request:h,large:true})]},r.id??a))}),i.node]})};export{B as default};
@@ -1 +1 @@
1
- import{u as o}from"./shared-DJyYaNgB.mjs";import{j as i}from"./classnames-DukgfdpI.mjs";import"./styles-Cm1KSkd5.mjs";function s({open:e=false,className:r}){return o("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",className:i("clover-chevron",r),"data-open":e||void 0,children:o("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export{s as C};
1
+ import{u as o}from"./shared-Cqxks7jF.mjs";import{j as i}from"./classnames-DukgfdpI.mjs";import"./styles-C9QeBpjd.mjs";function s({open:e=false,className:r}){return o("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",className:i("clover-chevron",r),"data-open":e||void 0,children:o("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}export{s as C};
@@ -1 +1 @@
1
- import{t as r,u as a,l as v}from"./shared-DJyYaNgB.mjs";import x from"./ControlMenu-BaBwqPBx.mjs";import{m as C}from"./layout-CdBuqKxn.mjs";import{u as z}from"./useContainerName-jjktq7OB.mjs";import"./styles-Cm1KSkd5.mjs";const P=({id:m,triggerId:u,label:b,labelLang:g,choices:i,selections:h,onSelect:y,onClose:f,language:s})=>{const d=z(b,g),N=i.some(e=>!r(e.label,s).text);return a(x,{"data-testid":"clover-canvas-choice",id:m,onClose:f,triggerId:u,children:[N&&d.node,i.map((e,k)=>{const t=r(e.label,s);return a("fieldset",{...t.text?{}:d.props,className:"clover-canvas-menu-group",children:[t.text&&a("legend",{className:"clover-canvas-menu-legend",...v(t.lang),children:t.text}),e.items.map((l,n)=>{const o=r(l.label,s),c=o.text||(l.image?"":String(n+1)),p=!C(l);return a("label",{className:"clover-canvas-menu-item","data-disabled":p||void 0,children:[a("input",{type:"radio",name:`${m}-${k}`,"aria-label":c?void 0:String(n+1),checked:(h[e.key]??0)===n,disabled:p,onChange:()=>y(e.key,n)}),l.image&&a("img",{alt:"",className:"clover-canvas-menu-image",decoding:"async",loading:"lazy",src:l.image}),c&&a("span",{...v(o.text?o.lang:void 0),children:c})]},n)})]},e.key)})]})};export{P as default};
1
+ import{t as r,u as a,l as v}from"./shared-Cqxks7jF.mjs";import x from"./ControlMenu-J-gMDza-.mjs";import{m as C}from"./layout-DbMbjpx4.mjs";import{u as z}from"./useContainerName-D_XCWIWP.mjs";import"./styles-C9QeBpjd.mjs";const P=({id:m,triggerId:u,label:b,labelLang:g,choices:i,selections:h,onSelect:y,onClose:f,language:s})=>{const d=z(b,g),N=i.some(e=>!r(e.label,s).text);return a(x,{"data-testid":"clover-canvas-choice",id:m,onClose:f,triggerId:u,children:[N&&d.node,i.map((e,k)=>{const t=r(e.label,s);return a("fieldset",{...t.text?{}:d.props,className:"clover-canvas-menu-group",children:[t.text&&a("legend",{className:"clover-canvas-menu-legend",...v(t.lang),children:t.text}),e.items.map((l,n)=>{const o=r(l.label,s),c=o.text||(l.image?"":String(n+1)),p=!C(l);return a("label",{className:"clover-canvas-menu-item","data-disabled":p||void 0,children:[a("input",{type:"radio",name:`${m}-${k}`,"aria-label":c?void 0:String(n+1),checked:(h[e.key]??0)===n,disabled:p,onChange:()=>y(e.key,n)}),l.image&&a("img",{alt:"",className:"clover-canvas-menu-image",decoding:"async",loading:"lazy",src:l.image}),c&&a("span",{...v(o.text?o.lang:void 0),children:c})]},n)})]},e.key)})]})};export{P as default};
@@ -0,0 +1 @@
1
+ import{D as I,e as $,a as j,b as A,c as u,J as H,y as S,u as o,l as T}from"./shared-Cqxks7jF.mjs";import{I as q}from"./Items-CbO0GqAH.mjs";import{L as w}from"./Label-jKQGRD5d.mjs";import{Summary as x,Id as D,Homepage as J}from"./Primitives-7dLlwNwr.mjs";import{j as L}from"./classnames-DukgfdpI.mjs";import{t as p}from"./heading-Cjt0f-Eu.mjs";import"./styles-C9QeBpjd.mjs";const G=I(function({headingLevel:r=3,className:v,...b},d){const{clover:n}=$("Collection"),{t:f,langOf:g}=j(),i=A(),a=u(e=>e.collection),l=u(e=>H(e.manifest));S(()=>{!a&&(l!=null&&l.id)&&n.openCollection(l.id)},[n,a,l]);const t=a??l;if(!t)return null;const s=t.homepage,c=p(r,`${i}-label`),m=(e,C)=>{const{as:h,title:y,group:N}=p(r,`${i}-${e}`);return o("section",{className:"clover-about-section",...N,children:[o(h,{className:"clover-about-heading",...T(g(e)),...y,children:f(e)}),C]})};return o("div",{ref:d,className:L("clover-about clover-collection",v),...t.label?c.group:null,...b,children:[o(w,{as:c.as,label:t.label,className:"clover-collection-title clover-title",...c.title}),o(x,{value:t.summary,className:"clover-about-summary"}),o(q,{of:"members",layout:"list"}),Array.isArray(s)&&s.length>0&&m("aboutHomepage",o(J,{value:s})),m("aboutCollection",o(D,{value:t.id}))]})});export{G as Collection};
@@ -1 +1 @@
1
- import{D as C,a as k,e as I,c as v,b as K,d as L,y as w,A as b,t as h,u as r,l as S}from"./shared-DJyYaNgB.mjs";import{i as N}from"./items-DDv9RUBA.mjs";import{j as U}from"./classnames-DukgfdpI.mjs";import"./styles-Cm1KSkd5.mjs";const j=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]),B=100,z=C(function({onChange:s,className:y,...A},E){const{t:P,langOf:D}=k(),{clover:T,language:u}=I("CollectionSelect"),t=v(e=>e.collection),n=v(e=>{var l;return((l=e.manifest)==null?void 0:l.id)??""}),f=K(),[c,i]=L(null);w(()=>i(null),[n,t]);const d=b(-1/0),o=b(null);w(()=>{o.current=null},[n,t]);const p=e=>{!e||e===n||e===o.current||(o.current=e,s==null||s(e),T.goToManifest(e).finally(()=>{o.current===e&&(o.current=null)}))},m=()=>c===null||c===n||c===o.current?false:(i(null),true),g=N(t);if(g.length<2)return null;const a=h(t==null?void 0:t.label,u);return r("div",{ref:E,className:U("clover-collection-select",y),...A,children:[r("label",{htmlFor:`${f}-select`,className:"clover-collection-select-label",...S(a.text?a.lang:D("collectionLabel")),children:a.text||P("collectionLabel")}),r("select",{id:`${f}-select`,className:"clover-collection-select-control",value:c??n,onKeyDown:e=>{const{key:l}=e;l==="Enter"?p(c):l==="Escape"?m()&&e.preventDefault():(j.has(l)||l.length===1&&!e.ctrlKey&&!e.metaKey)&&(d.current=performance.now())},onBlur:m,onChange:e=>{const l=e.target.value;i(l),performance.now()-d.current>B&&p(l)},children:g.map(e=>{const l=h(e.label,u);return r("option",{value:e.id,...S(l.text?l.lang:void 0),children:l.text||e.id},e.id)})})]})});export{z as CollectionSelect};
1
+ import{D as C,a as k,e as I,c as v,b as K,d as L,y as w,A as b,t as h,u as r,l as S}from"./shared-Cqxks7jF.mjs";import{i as N}from"./items-BwKkJEOS.mjs";import{j as U}from"./classnames-DukgfdpI.mjs";import"./styles-C9QeBpjd.mjs";const j=new Set(["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown"]),B=100,z=C(function({onChange:s,className:y,...A},E){const{t:P,langOf:D}=k(),{clover:T,language:u}=I("CollectionSelect"),t=v(e=>e.collection),n=v(e=>{var l;return((l=e.manifest)==null?void 0:l.id)??""}),f=K(),[c,i]=L(null);w(()=>i(null),[n,t]);const d=b(-1/0),o=b(null);w(()=>{o.current=null},[n,t]);const p=e=>{!e||e===n||e===o.current||(o.current=e,s==null||s(e),T.goToManifest(e).finally(()=>{o.current===e&&(o.current=null)}))},m=()=>c===null||c===n||c===o.current?false:(i(null),true),g=N(t);if(g.length<2)return null;const a=h(t==null?void 0:t.label,u);return r("div",{ref:E,className:U("clover-collection-select",y),...A,children:[r("label",{htmlFor:`${f}-select`,className:"clover-collection-select-label",...S(a.text?a.lang:D("collectionLabel")),children:a.text||P("collectionLabel")}),r("select",{id:`${f}-select`,className:"clover-collection-select-control",value:c??n,onKeyDown:e=>{const{key:l}=e;l==="Enter"?p(c):l==="Escape"?m()&&e.preventDefault():(j.has(l)||l.length===1&&!e.ctrlKey&&!e.metaKey)&&(d.current=performance.now())},onBlur:m,onChange:e=>{const l=e.target.value;i(l),performance.now()-d.current>B&&p(l)},children:g.map(e=>{const l=h(e.label,u);return r("option",{value:e.id,...S(l.text?l.lang:void 0),children:l.text||e.id},e.id)})})]})});export{z as CollectionSelect};
@@ -0,0 +1 @@
1
+ import{e as ve,C as O,c as g,A as l,d as me,y as P,T as R,O as be,q as f,aq as d,u as Se,ar as we,as as Ae,at as Ie,N as Ce,o as Le}from"./shared-Cqxks7jF.mjs";import{C as ke}from"./CanvasView-uvJ5kDYN.mjs";import{u as xe,a as ye}from"./fromManifest-qxJrEfn6.mjs";import{j as z,k as qe}from"./layout-DbMbjpx4.mjs";import{s as Oe}from"./show-link-DwefC5LJ.mjs";import{a as Pe,d as Re,e as Te,f as Be}from"./hooks--n9dMuHb.mjs";const Ve=({options:i,onReady:T,onViewportChange:v,onMediaElement:m,onCaptionChange:A,caption:B,onEnded:b,placeholder:F=true,label:G,partOf:J,language:Q,annotations:I,chapters:W,...p})=>{const C=ve("Canvas"),{clover:t}=C,X=O(t.captions.subscribe,t.captions.get,t.captions.get),Y=B??X,j=Q??C.language,c=Pe(),{direction:Z}=Re(),n=Te(),o=Be(),_=g(e=>{var a;return e.status==="loading"?"loading":((a=e.manifest)==null?void 0:a.id)??""}),S=g(e=>e.target),D=g(e=>we(e.manifest,e.addedSets,e.search.set,e.regions)),E=g(e=>Ie(e.manifest,e.addedSets,e.hiddenSets,e.shownSets,!!Ce(e.manifest))),ee=g(e=>Le(e.manifest,e.addedSets,e.hiddenSets,e.shownSets)),L=g(e=>e.annotationId),H=l(L);H.current=L;const[te,ae]=me(0);P(()=>t.found.subscribe(e=>{e&&e===H.current&&ae(a=>a+1)}),[t]);const ne=O(t.highlight.subscribe,t.highlight.get,t.highlight.get),se=O(t.chapter.subscribe,t.chapter.get,t.chapter.get),u=c.map(e=>e.id).join("|"),ce=R(()=>{if(I)return I;const e=c.map(a=>a.id);return D.flatMap(a=>a.entries.filter(s=>e.includes(s.canvasId)).map(s=>({annotation:s.annotation,targetIndex:e.indexOf(s.canvasId),pageId:a.id,...a.label?{pageLabel:a.label}:{},...s.place?{place:s.place}:{},...s.layer?{layer:{key:s.layer.key,item:s.layer.item}}:{}})))},[I,D,c]),ie=S?(e=>!!e&&c.some(a=>a.id===e))(S.canvasId):false,M=l(null);ie&&(M.current=u);const oe=F&&M.current!==u,k=l(null),x=l(null),y=R(()=>c.some(e=>z(e).length>0),[c]),h=y?c.find(e=>z(e).length>0):void 0,re=xe(n,h,j,Ae),K=l(y);K.current=y;const q=B===void 0?C.language:void 0,le=h==null?void 0:h.id;P(()=>{if(!q||!h)return;const e=qe(h).find(a=>a.language&&be(a.language,q));e&&t.captions.get()!==e.id&&t.captions.emit(e.id)},[q,le,t]);const r=f(()=>{const e=t.store.get().target;!e||!t.store.get().canvasId||ye(e,k.current,x.current,K.current)&&t.consumeTarget()},[t]),N=l(u);P(()=>{N.current!==u&&(N.current=u,x.current=null),S&&r()},[S,u,r]);const w=l(T);w.current=T;const de=f(e=>{var a;k.current=e,e.on("change",r),r(),(a=w.current)==null||a.call(w,e)},[r]),ue=f(e=>{var s;const a=(s=k.current)==null?void 0:s.getCanvasRegion();t.viewport.emit(a?{canvasId:a.canvasId,region:{x:a.rect.x,y:a.rect.y,w:a.rect.width,h:a.rect.height}}:null),v==null||v(e)},[t,v]),he=f(e=>{x.current=e,t.media.emit(e),e&&r(),m==null||m(e)},[t,r,m]),ge=f(()=>{b==null||b(),(d(n,"auto-advance")||d(o,"auto-advance"))&&t.next({autoplay:true,wrap:d(n,"repeat")})},[t,n,o,b]),fe=f(e=>void Oe(t,e),[t]),U=(i==null?void 0:i.request)??t.request,V=d(o,"auto-advance")||d(n,"auto-advance"),$=d(o,"repeat")||d(n,"repeat"),pe=R(()=>({...i,request:U,animation:(i==null?void 0:i.animation)??{autoplay:V,loop:$}}),[i,U,V,$]);return c.length?Se(ke,{...p,manifestId:_,navPlace:n==null?void 0:n.navPlace,canvases:c,viewingDirection:Z,language:j,label:G??(o==null?void 0:o.label)??(n==null?void 0:n.label),partOf:J??(n==null?void 0:n.label),options:pe,placeholder:oe,onReady:de,onViewportChange:ue,onMediaElement:he,caption:Y,onCaptionChange:e=>{t.captions.emit((e==null?void 0:e.id)??null),A==null||A(e)},onEnded:ge,annotations:ce,hiddenPages:ee,unlistedPages:E,onPageVisibilityChange:(e,a)=>e.forEach(s=>t.setSetVisible(s,a)),chapters:W??re,highlightedChapter:se,onChapterHighlight:e=>t.chapter.emit(e),selectedAnnotation:L,refind:te,highlightedAnnotation:ne,onAnnotationSelect:e=>t.selectAnnotation(e),onAnnotationLink:p.onAnnotationLink??fe,onAnnotationActive:e=>{var a;t.highlight.emit(e),(a=p.onAnnotationActive)==null||a.call(p,e)}}):null};export{Ve as default};
@@ -1 +1 @@
1
- import{u as o}from"./shared-DJyYaNgB.mjs";import{p as a}from"./playerSurface-DuHYLLBb.mjs";import n from"./Connected-1kdGMIWC.mjs";import{j as t}from"./classnames-DukgfdpI.mjs";import{a as m}from"./hooks-uHKfYuKB.mjs";function v({className:e,...r}){return m().some(i=>i.type==="Timeline")?o(n,{...r,className:t("clover-timeline",e),navigator:false,surface:a}):null}export{v as default};
1
+ import{u as o}from"./shared-Cqxks7jF.mjs";import{p as a}from"./playerSurface-PBbBGoj5.mjs";import n from"./Connected-CGF0cSzv.mjs";import{j as t}from"./classnames-DukgfdpI.mjs";import{a as m}from"./hooks--n9dMuHb.mjs";function v({className:e,...r}){return m().some(i=>i.type==="Timeline")?o(n,{...r,className:t("clover-timeline",e),navigator:false,surface:a}):null}export{v as default};
@@ -1 +1 @@
1
- import{e as v,c as u,y as S,T as b,u as C}from"./shared-DJyYaNgB.mjs";import{S as q}from"./SceneView-B38QNUQr.mjs";import{a as w,e as x}from"./hooks-uHKfYuKB.mjs";function M({label:i,language:d,options:t,...f}){const r=v("Scene"),{clover:a}=r,e=w().find(n=>n.type==="Scene"),s=x(),g=u(n=>{var o;return n.status==="loading"?"loading":((o=n.manifest)==null?void 0:o.id)??""}),c=u(n=>n.target);S(()=>{c&&e&&c.canvasId===e.id&&a.consumeTarget()},[c,e,a]);const l=(t==null?void 0:t.request)??a.request,m=b(()=>({...t,request:l}),[t,l]);return e?C(q,{...f,scene:e,manifestId:g,label:i??e.label??(s==null?void 0:s.label),language:d??r.language,options:m}):null}export{M as default};
1
+ import{e as v,c as u,y as S,T as b,u as C}from"./shared-Cqxks7jF.mjs";import{S as q}from"./SceneView-CunAaAoN.mjs";import{a as w,e as x}from"./hooks--n9dMuHb.mjs";function M({label:i,language:d,options:t,...f}){const r=v("Scene"),{clover:a}=r,e=w().find(n=>n.type==="Scene"),s=x(),g=u(n=>{var o;return n.status==="loading"?"loading":((o=n.manifest)==null?void 0:o.id)??""}),c=u(n=>n.target);S(()=>{c&&e&&c.canvasId===e.id&&a.consumeTarget()},[c,e,a]);const l=(t==null?void 0:t.request)??a.request,m=b(()=>({...t,request:l}),[t,l]);return e?C(q,{...f,scene:e,manifestId:g,label:i??e.label??(s==null?void 0:s.label),language:d??r.language,options:m}):null}export{M as default};
@@ -1 +1 @@
1
- import{D as W,a as X,e as Y,c as $,J as Z,C as O,d as N,b as _,T as tt,A as et,y as B,u as o,t as rt,l as k,k as st,v as nt,K as j,E as at,L as A}from"./shared-DJyYaNgB.mjs";import{imageSource as it}from"./thumbnail-IWjwr85c.mjs";import{j as ot}from"./classnames-DukgfdpI.mjs";import{C as ct}from"./Chevron-DpLzbCaE.mjs";import{E as lt}from"./EntryThumbnail-Cs_9m02f.mjs";import{S as ut}from"./Steps-BEkT1NQg.mjs";import{C as dt}from"./Cue-DKACn0J1.mjs";import{u as mt}from"./useContainerName-jjktq7OB.mjs";import"./styles-Cm1KSkd5.mjs";const Nt=W(function({as:d="nav",className:n,...u},h){const{t:p,langOf:c}=X(),{clover:s,language:F}=Y("Contents"),x=mt(p("informationPanelTabsContents"),c("informationPanelTabsContents"),u["aria-label"]!==void 0||u["aria-labelledby"]!==void 0),f=$(e=>Z(e.manifest)),T=$(e=>e.canvasId),z=$(e=>e.annotationId),S=O(s.media.subscribe,s.media.get,s.media.get),[D,w]=N(null),v=gt(f,T,S,D),H=O(s.chapter.subscribe,s.chapter.get,s.chapter.get),J=_(),C=tt(()=>pt(f,v),[f,v]),[K,L]=N(()=>new Map),M=et(new Set);B(()=>{const e=[...C].filter(r=>!M.current.has(r));M.current=C,L(r=>{if(!e.some(t=>r.has(t)))return r;const i=new Map(r);return e.forEach(t=>i.delete(t)),i})},[C]);const[b,U]=N();if(!f.length)return null;const G=e=>K.get(e.id)??C.has(e.id),P=(e,r)=>{var m,l;const i=(m=e.parts)==null?void 0:m[r];if(!i)return;U({node:e.id,index:r}),w(e.id);const t=A(e.id,r);i.region&&((l=s.store.get().regions)!=null&&l.entries.some(a=>a.id===t))?s.selectAnnotation(t):s.goTo(i.canvasId,i.region?{region:i.region}:{})},Q=e=>{if(e.canvasId){if(w(e.id),e.parts){P(e,0);return}if(e.canvasId===T&&e.time&&S){at(S,e.time.start);return}s.goTo(e.canvasId,{...e.time?{time:e.time.start,autoplay:true}:{},...e.region?{region:e.region}:{}})}},R=(e,r)=>{var l;const i=r.findIndex((a,y)=>!!a.region&&A(e.id,y)===z),t=(b==null?void 0:b.node)===e.id&&((l=r[b.index])==null?void 0:l.canvasId)===T?b.index:-1,m=i>=0?i:t>=0?t:r.findIndex(a=>a.canvasId===T);return{position:m,total:r.length,step:a=>P(e,m+a)}},q=(e,r,i=false)=>o("ol",{className:"clover-contents-list",id:r,hidden:i,children:e.map((t,m)=>{const l=rt(t.label,F),a=r?`${r}-${m}`:`${J}-${m}`,y=t.children.length>0,I=y&&G(t),E=t.id===v?it(t.thumbnail):null;return o("li",{className:"clover-contents-item",children:[o("div",{className:"clover-contents-row","data-current":t.id===v?"true":void 0,children:[o("button",{type:"button",id:`${a}-entry`,className:"clover-contents-button","data-trail":C.has(t.id)?"true":void 0,"aria-current":t.id===v?"true":void 0,"data-highlighted":t.id===H?"true":void 0,disabled:!t.canvasId,onMouseEnter:()=>s.chapter.emit(t.id),onMouseLeave:()=>s.chapter.emit(null),onFocus:()=>s.chapter.emit(t.id),onBlur:()=>s.chapter.emit(null),"data-timed":t.time?"true":void 0,"data-pictured":E?"true":void 0,...k(l.text&&!t.time&&!E?l.lang:void 0),onClick:()=>Q(t),children:t.time||E?o(st,{children:[t.time&&o(dt,{start:t.time.start,className:"clover-contents-time"}),o("span",{className:"clover-cue-text",...k(l.text?l.lang:void 0),children:l.text||t.id}),o(lt,{source:E,request:s.request,large:true})]}):l.text||t.id}),t.id===v&&t.parts&&t.parts.length>1&&o(ut,{className:"clover-contents-steps",steps:R(t,t.parts)}),y&&o("button",{type:"button",className:"clover-contents-toggle","aria-expanded":I,"aria-controls":`${a}-list`,"aria-labelledby":`${a}-toggle ${a}-entry`,onClick:()=>L(V=>new Map(V).set(t.id,!I)),children:[o("span",{id:`${a}-toggle`,style:nt,...k(c("contentsSectionsIn")),children:p("contentsSectionsIn")}),o(ct,{open:I,className:"clover-contents-chevron"})]})]}),y&&q(t.children,`${a}-list`,!I)]},t.id)})});return o(d,{ref:h,...x.props,className:ot("clover-contents",n),...u,children:[x.node,q(f)]})});function pt(g,d){const n=new Set;if(!d)return n;const u=(h,p)=>h.some(c=>c.id===d?(p.forEach(s=>n.add(s)),true):u(c.children,[...p,c.id]));return u(g,[]),n}function gt(g,d,n,u){const[h,p]=N(()=>j(g,d,void 0,u));return B(()=>{const c=()=>p(j(g,d,n==null?void 0:n.currentTime,u));if(c(),!!n)return n.addEventListener("timeupdate",c),n.addEventListener("seeked",c),()=>{n.removeEventListener("timeupdate",c),n.removeEventListener("seeked",c)}},[g,d,n,u]),h}export{Nt as Contents};
1
+ import{D as W,a as X,e as Y,c as $,K as Z,C as O,d as N,b as _,T as tt,A as et,y as B,u as o,t as rt,l as k,k as st,v as nt,L as j,E as at,M as A}from"./shared-Cqxks7jF.mjs";import{imageSource as it}from"./thumbnail-Ckf6EotT.mjs";import{j as ot}from"./classnames-DukgfdpI.mjs";import{C as ct}from"./Chevron-DVax9RTn.mjs";import{E as lt}from"./EntryThumbnail-iY1cnsAP.mjs";import{S as ut}from"./Steps-Cw27EFcs.mjs";import{C as dt}from"./Cue-BzhK_KTz.mjs";import{u as mt}from"./useContainerName-D_XCWIWP.mjs";import"./styles-C9QeBpjd.mjs";const Nt=W(function({as:d="nav",className:n,...u},h){const{t:p,langOf:c}=X(),{clover:s,language:F}=Y("Contents"),x=mt(p("informationPanelTabsContents"),c("informationPanelTabsContents"),u["aria-label"]!==void 0||u["aria-labelledby"]!==void 0),f=$(e=>Z(e.manifest)),T=$(e=>e.canvasId),z=$(e=>e.annotationId),S=O(s.media.subscribe,s.media.get,s.media.get),[D,w]=N(null),v=gt(f,T,S,D),H=O(s.chapter.subscribe,s.chapter.get,s.chapter.get),K=_(),C=tt(()=>pt(f,v),[f,v]),[U,L]=N(()=>new Map),M=et(new Set);B(()=>{const e=[...C].filter(r=>!M.current.has(r));M.current=C,L(r=>{if(!e.some(t=>r.has(t)))return r;const i=new Map(r);return e.forEach(t=>i.delete(t)),i})},[C]);const[b,G]=N();if(!f.length)return null;const J=e=>U.get(e.id)??C.has(e.id),P=(e,r)=>{var m,l;const i=(m=e.parts)==null?void 0:m[r];if(!i)return;G({node:e.id,index:r}),w(e.id);const t=A(e.id,r);i.region&&((l=s.store.get().regions)!=null&&l.entries.some(a=>a.id===t))?s.selectAnnotation(t):s.goTo(i.canvasId,i.region?{region:i.region}:{})},Q=e=>{if(e.canvasId){if(w(e.id),e.parts){P(e,0);return}if(e.canvasId===T&&e.time&&S){at(S,e.time.start);return}s.goTo(e.canvasId,{...e.time?{time:e.time.start,autoplay:true}:{},...e.region?{region:e.region}:{}})}},R=(e,r)=>{var l;const i=r.findIndex((a,y)=>!!a.region&&A(e.id,y)===z),t=(b==null?void 0:b.node)===e.id&&((l=r[b.index])==null?void 0:l.canvasId)===T?b.index:-1,m=i>=0?i:t>=0?t:r.findIndex(a=>a.canvasId===T);return{position:m,total:r.length,step:a=>P(e,m+a)}},q=(e,r,i=false)=>o("ol",{className:"clover-contents-list",id:r,hidden:i,children:e.map((t,m)=>{const l=rt(t.label,F),a=r?`${r}-${m}`:`${K}-${m}`,y=t.children.length>0,I=y&&J(t),E=t.id===v?it(t.thumbnail):null;return o("li",{className:"clover-contents-item",children:[o("div",{className:"clover-contents-row","data-current":t.id===v?"true":void 0,children:[o("button",{type:"button",id:`${a}-entry`,className:"clover-contents-button","data-trail":C.has(t.id)?"true":void 0,"aria-current":t.id===v?"true":void 0,"data-highlighted":t.id===H?"true":void 0,disabled:!t.canvasId,onMouseEnter:()=>s.chapter.emit(t.id),onMouseLeave:()=>s.chapter.emit(null),onFocus:()=>s.chapter.emit(t.id),onBlur:()=>s.chapter.emit(null),"data-timed":t.time?"true":void 0,"data-pictured":E?"true":void 0,...k(l.text&&!t.time&&!E?l.lang:void 0),onClick:()=>Q(t),children:t.time||E?o(st,{children:[t.time&&o(dt,{start:t.time.start,className:"clover-contents-time"}),o("span",{className:"clover-cue-text",...k(l.text?l.lang:void 0),children:l.text||t.id}),o(lt,{source:E,request:s.request,large:true})]}):l.text||t.id}),t.id===v&&t.parts&&t.parts.length>1&&o(ut,{className:"clover-contents-steps",steps:R(t,t.parts)}),y&&o("button",{type:"button",className:"clover-contents-toggle","aria-expanded":I,"aria-controls":`${a}-list`,"aria-labelledby":`${a}-toggle ${a}-entry`,onClick:()=>L(V=>new Map(V).set(t.id,!I)),children:[o("span",{id:`${a}-toggle`,style:nt,...k(c("contentsSectionsIn")),children:p("contentsSectionsIn")}),o(ct,{open:I,className:"clover-contents-chevron"})]})]}),y&&q(t.children,`${a}-list`,!I)]},t.id)})});return o(d,{ref:h,...x.props,className:ot("clover-contents",n),...u,children:[x.node,q(f)]})});function pt(g,d){const n=new Set;if(!d)return n;const u=(h,p)=>h.some(c=>c.id===d?(p.forEach(s=>n.add(s)),true):u(c.children,[...p,c.id]));return u(g,[]),n}function gt(g,d,n,u){const[h,p]=N(()=>j(g,d,void 0,u));return B(()=>{const c=()=>p(j(g,d,n==null?void 0:n.currentTime,u));if(c(),!!n)return n.addEventListener("timeupdate",c),n.addEventListener("seeked",c),()=>{n.removeEventListener("timeupdate",c),n.removeEventListener("seeked",c)}},[g,d,n,u]),h}export{Nt as Contents};
@@ -1 +1 @@
1
- import{A as k,af as L,_ as T,y as x,u as S}from"./shared-DJyYaNgB.mjs";import{j as B}from"./classnames-DukgfdpI.mjs";import"./styles-Cm1KSkd5.mjs";const j=({id:l,triggerId:c,onClose:o,"data-testid":u,className:m,holds:r,inside:f=false,children:b})=>{const i=k(null);return L(true,()=>o(false)),T(()=>{const t=i.current;t&&f&&M(t)},[f]),x(()=>{const t=i.current,s=(t==null?void 0:t.querySelector('input[type="radio"]:checked'))??(t==null?void 0:t.querySelector('input[type="radio"]:not(:disabled)'))??(t==null?void 0:t.querySelector("input"))??(t==null?void 0:t.querySelector('[role="option"][tabindex="0"]')),d=s==null?void 0:s.closest('label, [role="option"]');if(t&&d){const n=d.offsetTop+d.offsetHeight;n>t.scrollTop+t.clientHeight&&(t.scrollTop=n-t.clientHeight),d.offsetTop<t.scrollTop&&(t.scrollTop=d.offsetTop)}s==null||s.focus({preventScroll:true});const y=n=>{var a,v,p;const e=n.target;(a=i.current)!=null&&a.contains(e)||(v=document.getElementById(c))!=null&&v.contains(e)||e&&((p=r==null?void 0:r())!=null&&p.contains(e))||o(false)},E=n=>{var p,w;if(n.key!=="Escape")return;const e=document.activeElement;if(!!((p=i.current)!=null&&p.contains(e)||(w=document.getElementById(c))!=null&&w.contains(e))){n.preventDefault(),o(true);return}const v=h=>{h===n&&!n.defaultPrevented&&o(false)};document.addEventListener("keydown",v,{once:true})},g=n=>{var a;const e=n.target;e!=null&&e.closest(".clover-canvas-viewport")&&((a=i.current)!=null&&a.contains(e)||o(false))};return document.addEventListener("pointerdown",y),document.addEventListener("keydown",E,true),document.addEventListener("focusin",g),()=>{document.removeEventListener("pointerdown",y),document.removeEventListener("keydown",E,true),document.removeEventListener("focusin",g)}},[c,o,r]),S("div",{className:B("clover-canvas-menu",m),"data-testid":u,id:l,ref:i,children:b})};function M(l){const c=l.getBoundingClientRect();let o=0,u=document.documentElement.clientWidth;for(let r=l.parentElement;r;r=r.parentElement){if(getComputedStyle(r).overflowX==="visible")continue;const f=r.getBoundingClientRect();o=Math.max(o,f.left),u=Math.min(u,f.right);break}const m=Math.max(o-c.left,Math.min(0,u-c.right));m&&(l.style.translate=`${m}px 0`)}export{j as default};
1
+ import{A as k,ag as L,_ as T,y as x,u as S}from"./shared-Cqxks7jF.mjs";import{j as B}from"./classnames-DukgfdpI.mjs";import"./styles-C9QeBpjd.mjs";const j=({id:l,triggerId:c,onClose:o,"data-testid":u,className:m,holds:r,inside:f=false,children:b})=>{const i=k(null);return L(true,()=>o(false)),T(()=>{const t=i.current;t&&f&&M(t)},[f]),x(()=>{const t=i.current,s=(t==null?void 0:t.querySelector('input[type="radio"]:checked'))??(t==null?void 0:t.querySelector('input[type="radio"]:not(:disabled)'))??(t==null?void 0:t.querySelector("input"))??(t==null?void 0:t.querySelector('[role="option"][tabindex="0"]')),d=s==null?void 0:s.closest('label, [role="option"]');if(t&&d){const n=d.offsetTop+d.offsetHeight;n>t.scrollTop+t.clientHeight&&(t.scrollTop=n-t.clientHeight),d.offsetTop<t.scrollTop&&(t.scrollTop=d.offsetTop)}s==null||s.focus({preventScroll:true});const y=n=>{var a,v,p;const e=n.target;(a=i.current)!=null&&a.contains(e)||(v=document.getElementById(c))!=null&&v.contains(e)||e&&((p=r==null?void 0:r())!=null&&p.contains(e))||o(false)},E=n=>{var p,w;if(n.key!=="Escape")return;const e=document.activeElement;if(!!((p=i.current)!=null&&p.contains(e)||(w=document.getElementById(c))!=null&&w.contains(e))){n.preventDefault(),o(true);return}const v=h=>{h===n&&!n.defaultPrevented&&o(false)};document.addEventListener("keydown",v,{once:true})},g=n=>{var a;const e=n.target;e!=null&&e.closest(".clover-canvas-viewport")&&((a=i.current)!=null&&a.contains(e)||o(false))};return document.addEventListener("pointerdown",y),document.addEventListener("keydown",E,true),document.addEventListener("focusin",g),()=>{document.removeEventListener("pointerdown",y),document.removeEventListener("keydown",E,true),document.removeEventListener("focusin",g)}},[c,o,r]),S("div",{className:B("clover-canvas-menu",m),"data-testid":u,id:l,ref:i,children:b})};function M(l){const c=l.getBoundingClientRect();let o=0,u=document.documentElement.clientWidth;for(let r=l.parentElement;r;r=r.parentElement){if(getComputedStyle(r).overflowX==="visible")continue;const f=r.getBoundingClientRect();o=Math.max(o,f.left),u=Math.min(u,f.right);break}const m=Math.max(o-c.left,Math.min(0,u-c.right));m&&(l.style.translate=`${m}px 0`)}export{j as default};
@@ -0,0 +1 @@
1
+ import{y as l}from"./shared-Cqxks7jF.mjs";import{u}from"./useControlsVisibility-CIjHTnaa.mjs";function f({element:i,hideDelay:r,picture:s,onChange:o}){const t=u(i,r,s);return l(()=>o(t),[t,o]),null}export{f as default};
@@ -1 +1 @@
1
- import{a as m,b as f,d as C,A as b,q as u,u as e,l as k,v as N,P as x,z as y}from"./shared-DJyYaNgB.mjs";import"./styles-Cm1KSkd5.mjs";const I=y(()=>import("./ControlMenu-BaBwqPBx.mjs"));function q({position:n,total:o,list:p}){const{t:h,langOf:v}=m(),r=`${f().replace(/:/g,"")}-count`,s=`${r}-menu`,[a,c]=C(false),i=b(null),g=u(()=>{var l;return(l=i.current)==null?void 0:l.closest(".clover-pager")},[]),t=u(l=>{var d;c(false),l&&((d=document.getElementById(r))==null||d.focus())},[r]);return e("span",{className:"clover-pager-count",ref:i,children:[e("button",{type:"button",id:r,className:"clover-pager-count-button","aria-controls":a?s:void 0,"aria-expanded":a,onClick:()=>c(!a),children:[e("span",{className:"clover-pager-position","aria-live":"polite",children:[e("span",{"aria-hidden":n>=0||void 0,children:[n>=0?n+1:"\u2013"," / ",o]}),n>=0&&e("span",{style:N,...k(v("canvasPosition")),children:h("canvasPosition",{index:n+1,total:o})}),e("span",{className:"clover-pager-room","aria-hidden":"true",hidden:true,children:[o," / ",o]})]}),e("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",children:e("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),a&&e(x,{fallback:null,children:e(I,{id:s,triggerId:r,onClose:t,holds:g,inside:true,className:"clover-pager-menu",children:e("div",{className:"clover-collection clover-pager-list",children:p(()=>t(true))})})})]})}export{q as C};
1
+ import{a as m,b as f,d as C,A as b,q as u,u as e,l as k,v as N,P as x,z as y}from"./shared-Cqxks7jF.mjs";import"./styles-C9QeBpjd.mjs";const I=y(()=>import("./ControlMenu-J-gMDza-.mjs"));function q({position:n,total:o,list:p}){const{t:h,langOf:v}=m(),r=`${f().replace(/:/g,"")}-count`,s=`${r}-menu`,[a,c]=C(false),i=b(null),g=u(()=>{var l;return(l=i.current)==null?void 0:l.closest(".clover-pager")},[]),t=u(l=>{var d;c(false),l&&((d=document.getElementById(r))==null||d.focus())},[r]);return e("span",{className:"clover-pager-count",ref:i,children:[e("button",{type:"button",id:r,className:"clover-pager-count-button","aria-controls":a?s:void 0,"aria-expanded":a,onClick:()=>c(!a),children:[e("span",{className:"clover-pager-position","aria-live":"polite",children:[e("span",{"aria-hidden":n>=0||void 0,children:[n>=0?n+1:"\u2013"," / ",o]}),n>=0&&e("span",{style:N,...k(v("canvasPosition")),children:h("canvasPosition",{index:n+1,total:o})}),e("span",{className:"clover-pager-room","aria-hidden":"true",hidden:true,children:[o," / ",o]})]}),e("svg",{"aria-hidden":"true",focusable:"false",width:"12",height:"12",viewBox:"0 0 12 12",children:e("path",{d:"M3 4.5l3 3 3-3",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]}),a&&e(x,{fallback:null,children:e(I,{id:s,triggerId:r,onClose:t,holds:g,inside:true,className:"clover-pager-menu",children:e("div",{className:"clover-collection clover-pager-list",children:p(()=>t(true))})})})]})}export{q as C};
@@ -0,0 +1 @@
1
+ import{u as e,am as o}from"./shared-Cqxks7jF.mjs";import{j as i}from"./classnames-DukgfdpI.mjs";import"./styles-C9QeBpjd.mjs";function s({start:m,className:r}){return e("span",{className:i("clover-cue-time",r),children:o(m)})}export{s as C};