@internetarchive/bookreader 5.0.0-11 → 5.0.0-110

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 (380) hide show
  1. package/BookReader/474.js +2 -0
  2. package/BookReader/474.js.map +1 -0
  3. package/BookReader/BookReader.css +604 -1239
  4. package/BookReader/BookReader.js +1 -1
  5. package/BookReader/BookReader.js.LICENSE.txt +20 -20
  6. package/BookReader/BookReader.js.map +1 -1
  7. package/BookReader/bergamot-translator-worker.js +2966 -0
  8. package/BookReader/bergamot-translator-worker.wasm +0 -0
  9. package/BookReader/hypothesis/LICENSE +50 -0
  10. package/BookReader/hypothesis/README.md +55 -0
  11. package/BookReader/hypothesis/build/boot.js +1 -0
  12. package/BookReader/hypothesis/build/manifest.json +20 -0
  13. package/BookReader/hypothesis/build/scripts/annotator.bundle.js +184 -0
  14. package/BookReader/hypothesis/build/scripts/annotator.bundle.js.map +1 -0
  15. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js +798 -0
  16. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js.map +1 -0
  17. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js +711 -0
  18. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js.map +1 -0
  19. package/BookReader/hypothesis/build/styles/annotator.css +2235 -0
  20. package/BookReader/hypothesis/build/styles/annotator.css.map +1 -0
  21. package/BookReader/hypothesis/build/styles/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  22. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  23. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  24. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  25. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  26. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Bold.woff2 +0 -0
  27. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  28. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Italic.woff2 +0 -0
  29. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Regular.woff2 +0 -0
  30. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  31. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-Italic.woff2 +0 -0
  32. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  33. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  34. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  35. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Script-Regular.woff2 +0 -0
  36. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  37. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  38. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  39. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  40. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  41. package/BookReader/hypothesis/build/styles/highlights.css +2 -0
  42. package/BookReader/hypothesis/build/styles/highlights.css.map +1 -0
  43. package/BookReader/hypothesis/build/styles/katex.min.css +2 -0
  44. package/BookReader/hypothesis/build/styles/katex.min.css.map +1 -0
  45. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css +2 -0
  46. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css.map +1 -0
  47. package/BookReader/hypothesis/build/styles/sidebar.css +2731 -0
  48. package/BookReader/hypothesis/build/styles/sidebar.css.map +1 -0
  49. package/BookReader/hypothesis/build/styles/ui-playground.css +2659 -0
  50. package/BookReader/hypothesis/build/styles/ui-playground.css.map +1 -0
  51. package/BookReader/hypothesis/package.json +126 -0
  52. package/BookReader/ia-bookreader-bundle.js +1907 -0
  53. package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +19 -0
  54. package/BookReader/ia-bookreader-bundle.js.map +1 -0
  55. package/BookReader/icons/1up.svg +1 -1
  56. package/BookReader/icons/2up.svg +1 -1
  57. package/BookReader/icons/advance.svg +1 -1
  58. package/BookReader/icons/chevron-right.svg +1 -1
  59. package/BookReader/icons/close-circle-dark.svg +1 -1
  60. package/BookReader/icons/close-circle.svg +1 -1
  61. package/BookReader/icons/fullscreen.svg +1 -1
  62. package/BookReader/icons/fullscreen_exit.svg +1 -1
  63. package/BookReader/icons/hamburger.svg +1 -1
  64. package/BookReader/icons/left-arrow.svg +1 -1
  65. package/BookReader/icons/magnify-minus.svg +1 -1
  66. package/BookReader/icons/magnify-plus.svg +1 -1
  67. package/BookReader/icons/magnify.svg +1 -1
  68. package/BookReader/icons/pause.svg +1 -1
  69. package/BookReader/icons/play.svg +1 -1
  70. package/BookReader/icons/playback-speed.svg +1 -1
  71. package/BookReader/icons/read-aloud.svg +1 -1
  72. package/BookReader/icons/review.svg +1 -1
  73. package/BookReader/icons/slider-toggle.svg +1 -0
  74. package/BookReader/icons/thumbnails.svg +1 -1
  75. package/BookReader/icons/voice.svg +1 -0
  76. package/BookReader/icons/volume-full.svg +1 -1
  77. package/BookReader/images/BRicons.svg +3 -3
  78. package/BookReader/images/books_graphic.svg +1 -1
  79. package/BookReader/images/hypothesis.ico +0 -0
  80. package/BookReader/images/icon_book.svg +1 -1
  81. package/BookReader/images/icon_bookmark.svg +1 -1
  82. package/BookReader/images/icon_experiment.svg +1 -0
  83. package/BookReader/images/icon_gear.svg +1 -1
  84. package/BookReader/images/icon_hamburger.svg +1 -1
  85. package/BookReader/images/icon_home.svg +1 -1
  86. package/BookReader/images/icon_info.svg +1 -1
  87. package/BookReader/images/icon_one_page.svg +1 -1
  88. package/BookReader/images/icon_pause.svg +1 -1
  89. package/BookReader/images/icon_play.svg +1 -1
  90. package/BookReader/images/icon_playback-rate.svg +1 -1
  91. package/BookReader/images/icon_search_button.svg +1 -1
  92. package/BookReader/images/icon_share.svg +1 -1
  93. package/BookReader/images/icon_skip-ahead.svg +1 -1
  94. package/BookReader/images/icon_skip-back.svg +1 -1
  95. package/BookReader/images/icon_speaker.svg +1 -1
  96. package/BookReader/images/icon_speaker_open.svg +1 -1
  97. package/BookReader/images/icon_thumbnails.svg +1 -1
  98. package/BookReader/images/icon_toc.svg +1 -1
  99. package/BookReader/images/icon_two_pages.svg +1 -1
  100. package/BookReader/images/marker_chap-off.svg +1 -1
  101. package/BookReader/images/marker_chap-on.svg +1 -1
  102. package/BookReader/images/marker_srch-on.svg +1 -1
  103. package/BookReader/images/translate.svg +1 -0
  104. package/BookReader/images/unviewable_page.png +0 -0
  105. package/BookReader/jquery-3.js +2 -0
  106. package/BookReader/jquery-3.js.LICENSE.txt +24 -0
  107. package/BookReader/plugins/plugin.archive_analytics.js +1 -1
  108. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  109. package/BookReader/plugins/plugin.autoplay.js +1 -1
  110. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  111. package/BookReader/plugins/plugin.chapters.js +22 -1
  112. package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
  113. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  114. package/BookReader/plugins/plugin.experiments.js +3 -0
  115. package/BookReader/plugins/plugin.experiments.js.LICENSE.txt +1 -0
  116. package/BookReader/plugins/plugin.experiments.js.map +1 -0
  117. package/BookReader/plugins/plugin.iframe.js +1 -1
  118. package/BookReader/plugins/plugin.iframe.js.map +1 -1
  119. package/BookReader/plugins/plugin.iiif.js +2 -0
  120. package/BookReader/plugins/plugin.iiif.js.map +1 -0
  121. package/BookReader/plugins/plugin.resume.js +1 -1
  122. package/BookReader/plugins/plugin.resume.js.map +1 -1
  123. package/BookReader/plugins/plugin.search.js +2 -1
  124. package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
  125. package/BookReader/plugins/plugin.search.js.map +1 -1
  126. package/BookReader/plugins/plugin.text_selection.js +2 -1
  127. package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
  128. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  129. package/BookReader/plugins/plugin.translate.js +137 -0
  130. package/BookReader/plugins/plugin.translate.js.LICENSE.txt +1 -0
  131. package/BookReader/plugins/plugin.translate.js.map +1 -0
  132. package/BookReader/plugins/plugin.tts.js +1 -1
  133. package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
  134. package/BookReader/plugins/plugin.tts.js.map +1 -1
  135. package/BookReader/plugins/plugin.url.js +1 -1
  136. package/BookReader/plugins/plugin.url.js.map +1 -1
  137. package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -1
  138. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  139. package/BookReader/plugins/translator-worker.js +2 -0
  140. package/BookReader/plugins/translator-worker.js.map +1 -0
  141. package/BookReader/silence.mp3 +0 -0
  142. package/BookReader/translator-worker.js +475 -0
  143. package/BookReader/webcomponents-bundle.js +3 -0
  144. package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
  145. package/BookReader/webcomponents-bundle.js.map +1 -0
  146. package/README.md +14 -3
  147. package/jsconfig.json +19 -0
  148. package/package.json +92 -70
  149. package/src/BookReader/BookModel.js +92 -46
  150. package/src/BookReader/DragScrollable.js +233 -0
  151. package/src/BookReader/ImageCache.js +49 -16
  152. package/src/BookReader/Mode1Up.js +66 -365
  153. package/src/BookReader/Mode1UpLit.js +392 -0
  154. package/src/BookReader/Mode2Up.js +87 -1315
  155. package/src/BookReader/Mode2UpLit.js +788 -0
  156. package/src/BookReader/ModeAbstract.js +43 -0
  157. package/src/BookReader/ModeCoordinateSpace.js +29 -0
  158. package/src/BookReader/ModeSmoothZoom.js +312 -0
  159. package/src/BookReader/ModeThumb.js +29 -15
  160. package/src/BookReader/Navbar/Navbar.js +201 -76
  161. package/src/BookReader/PageContainer.js +120 -23
  162. package/src/BookReader/ReduceSet.js +2 -2
  163. package/src/BookReader/Toolbar/Toolbar.js +18 -40
  164. package/src/BookReader/events.js +3 -3
  165. package/src/BookReader/options.js +94 -17
  166. package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
  167. package/src/BookReader/utils/ScrollClassAdder.js +31 -0
  168. package/src/BookReader/utils/SelectionObserver.js +45 -0
  169. package/src/BookReader/utils/classes.js +1 -1
  170. package/src/BookReader/utils.js +136 -12
  171. package/src/BookReader.js +678 -1226
  172. package/src/BookReaderPlugin.js +52 -0
  173. package/src/assets/icons/magnify-minus.svg +3 -7
  174. package/src/assets/icons/magnify-plus.svg +3 -7
  175. package/src/assets/icons/slider-toggle.svg +1 -0
  176. package/src/assets/icons/voice.svg +1 -0
  177. package/src/assets/images/hypothesis.ico +0 -0
  178. package/src/assets/images/icon_experiment.svg +1 -0
  179. package/src/assets/images/translate.svg +1 -0
  180. package/src/assets/images/unviewable_page.png +0 -0
  181. package/src/assets/silence.mp3 +0 -0
  182. package/src/css/BookReader.scss +1 -5
  183. package/src/css/_BRBookmarks.scss +1 -1
  184. package/src/css/_BRComponent.scss +1 -1
  185. package/src/css/_BRicon.scss +8 -2
  186. package/src/css/_BRmain.scss +16 -3
  187. package/src/css/_BRnav.scss +74 -70
  188. package/src/css/_BRpages.scss +171 -42
  189. package/src/css/_BRsearch.scss +69 -30
  190. package/src/css/_BRtoolbar.scss +5 -5
  191. package/src/css/_TextSelection.scss +129 -24
  192. package/src/css/_colorbox.scss +2 -2
  193. package/src/css/_controls.scss +24 -7
  194. package/src/css/_icons.scss +8 -1
  195. package/src/{BookNavigator/assets → css}/button-base.js +2 -2
  196. package/src/css/icon_checkmark.js +9 -0
  197. package/src/css/sharedStyles.js +15 -0
  198. package/src/ia-bookreader/downloads/downloads-provider.js +81 -0
  199. package/src/{BookNavigator → ia-bookreader}/downloads/downloads.js +25 -5
  200. package/src/ia-bookreader/ia-bookreader.js +666 -0
  201. package/src/ia-bookreader/sharing.js +27 -0
  202. package/src/ia-bookreader/viewable-files.js +98 -0
  203. package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments-provider.js +17 -17
  204. package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments.js +75 -67
  205. package/src/{BookNavigator → plugins}/bookmarks/bookmark-button.js +4 -3
  206. package/src/{BookNavigator/assets → plugins/bookmarks}/bookmark-colors.js +1 -1
  207. package/src/{BookNavigator → plugins}/bookmarks/bookmark-edit.js +43 -31
  208. package/src/{BookNavigator → plugins}/bookmarks/bookmarks-list.js +48 -49
  209. package/src/{BookNavigator → plugins}/bookmarks/bookmarks-loginCTA.js +3 -3
  210. package/src/plugins/bookmarks/bookmarks-provider.js +63 -0
  211. package/src/{BookNavigator → plugins/bookmarks}/delete-modal-actions.js +1 -1
  212. package/src/{BookNavigator → plugins}/bookmarks/ia-bookmarks.js +117 -68
  213. package/src/plugins/plugin.archive_analytics.js +84 -78
  214. package/src/plugins/plugin.autoplay.js +99 -104
  215. package/src/plugins/plugin.chapters.js +314 -205
  216. package/src/plugins/plugin.experiments.js +321 -0
  217. package/src/plugins/plugin.iframe.js +1 -1
  218. package/src/plugins/plugin.iiif.js +141 -0
  219. package/src/plugins/plugin.resume.js +54 -51
  220. package/src/plugins/plugin.text_selection.js +522 -219
  221. package/src/plugins/plugin.vendor-fullscreen.js +5 -5
  222. package/src/plugins/search/plugin.search.js +374 -392
  223. package/src/{BookNavigator → plugins}/search/search-provider.js +59 -27
  224. package/src/{BookNavigator → plugins}/search/search-results.js +105 -76
  225. package/src/plugins/search/utils.js +50 -0
  226. package/src/plugins/search/view.js +50 -68
  227. package/src/plugins/translate/TranslationManager.js +164 -0
  228. package/src/plugins/translate/plugin.translate.js +512 -0
  229. package/src/plugins/tts/AbstractTTSEngine.js +78 -49
  230. package/src/plugins/tts/FestivalTTSEngine.js +20 -30
  231. package/src/plugins/tts/PageChunk.js +33 -21
  232. package/src/plugins/tts/PageChunkIterator.js +11 -17
  233. package/src/plugins/tts/WebTTSEngine.js +131 -91
  234. package/src/plugins/tts/plugin.tts.js +345 -350
  235. package/src/plugins/tts/utils.js +77 -49
  236. package/src/plugins/url/UrlPlugin.js +191 -0
  237. package/src/plugins/{plugin.url.js → url/plugin.url.js} +44 -15
  238. package/src/util/TextSelectionManager.js +282 -0
  239. package/src/util/browserSniffing.js +33 -1
  240. package/src/util/cache.js +20 -0
  241. package/src/util/docCookies.js +21 -2
  242. package/src/util/lit.js +15 -0
  243. package/src/util/strings.js +1 -0
  244. package/.babelrc +0 -12
  245. package/.dependabot/config.yml +0 -6
  246. package/.eslintrc.js +0 -50
  247. package/.gitattributes +0 -2
  248. package/.github/ISSUE_TEMPLATE/bug.md +0 -32
  249. package/.github/ISSUE_TEMPLATE/feature-request.md +0 -30
  250. package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -15
  251. package/.github/workflows/node.js.yml +0 -37
  252. package/.github/workflows/npm-publish.yml +0 -47
  253. package/.testcaferc.json +0 -5
  254. package/BookReader/bookreader-component-bundle.js +0 -1450
  255. package/BookReader/bookreader-component-bundle.js.LICENSE.txt +0 -38
  256. package/BookReader/bookreader-component-bundle.js.map +0 -1
  257. package/BookReader/jquery-1.10.1.js +0 -2
  258. package/BookReader/jquery-1.10.1.js.LICENSE.txt +0 -24
  259. package/BookReader/plugins/plugin.menu_toggle.js +0 -2
  260. package/BookReader/plugins/plugin.menu_toggle.js.map +0 -1
  261. package/BookReader/plugins/plugin.mobile_nav.js +0 -2
  262. package/BookReader/plugins/plugin.mobile_nav.js.map +0 -1
  263. package/BookReaderDemo/BookReaderDemo.css +0 -41
  264. package/BookReaderDemo/BookReaderJSAdvanced.js +0 -115
  265. package/BookReaderDemo/BookReaderJSAutoplay.js +0 -56
  266. package/BookReaderDemo/BookReaderJSSimple.js +0 -55
  267. package/BookReaderDemo/IIIFBookReader.js +0 -207
  268. package/BookReaderDemo/assets/v5/Bookreader-logo-cool-grad.svg +0 -1
  269. package/BookReaderDemo/assets/v5/Bookreader-logo-flat.svg +0 -1
  270. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-cool-grad.png +0 -0
  271. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-flat.png +0 -0
  272. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.png +0 -0
  273. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.svg +0 -1
  274. package/BookReaderDemo/assets/v5/Bookreader-logo-warm.svg +0 -1
  275. package/BookReaderDemo/assets/v5/bookreader-logo-renders@1x.png +0 -0
  276. package/BookReaderDemo/assets/v5/bookreader-logo-renders@2x.png +0 -0
  277. package/BookReaderDemo/assets/v5/bookreader-v5-screenshot.png +0 -0
  278. package/BookReaderDemo/bookreader-template-bundle.js +0 -7178
  279. package/BookReaderDemo/demo-advanced.html +0 -33
  280. package/BookReaderDemo/demo-autoplay.html +0 -38
  281. package/BookReaderDemo/demo-embed-iframe-src.html +0 -84
  282. package/BookReaderDemo/demo-embed.html +0 -26
  283. package/BookReaderDemo/demo-fullscreen-mobile.html +0 -36
  284. package/BookReaderDemo/demo-fullscreen.html +0 -33
  285. package/BookReaderDemo/demo-iiif.html +0 -34
  286. package/BookReaderDemo/demo-iiif.js +0 -26
  287. package/BookReaderDemo/demo-internetarchive.html +0 -74
  288. package/BookReaderDemo/demo-multiple.html +0 -43
  289. package/BookReaderDemo/demo-plugin-menu-toggle.html +0 -34
  290. package/BookReaderDemo/demo-preview-pages.html +0 -1092
  291. package/BookReaderDemo/demo-simple.html +0 -34
  292. package/BookReaderDemo/demo-vendor-fullscreen.html +0 -36
  293. package/BookReaderDemo/immersion-1up.html +0 -64
  294. package/BookReaderDemo/immersion-mode.html +0 -35
  295. package/BookReaderDemo/toggle_controls.html +0 -53
  296. package/BookReaderDemo/view_mode.html +0 -39
  297. package/BookReaderDemo/viewmode-cycle.html +0 -41
  298. package/CHANGELOG.md +0 -495
  299. package/CONTRIBUTING.md +0 -7
  300. package/codecov.yml +0 -17
  301. package/index.html +0 -31
  302. package/karma.conf.js +0 -23
  303. package/screenshot.png +0 -0
  304. package/scripts/postversion.js +0 -10
  305. package/scripts/preversion.js +0 -14
  306. package/scripts/version.js +0 -26
  307. package/src/BookNavigator/BookModel.js +0 -14
  308. package/src/BookNavigator/BookNavigator.js +0 -446
  309. package/src/BookNavigator/assets/book-loader.js +0 -27
  310. package/src/BookNavigator/assets/icon_checkmark.js +0 -6
  311. package/src/BookNavigator/assets/icon_close.js +0 -3
  312. package/src/BookNavigator/bookmarks/bookmarks-provider.js +0 -53
  313. package/src/BookNavigator/br-fullscreen-mgr.js +0 -83
  314. package/src/BookNavigator/downloads/downloads-provider.js +0 -66
  315. package/src/BookNavigator/search/a-search-result.js +0 -55
  316. package/src/BookReader/DebugConsole.js +0 -54
  317. package/src/BookReaderComponent/BookReaderComponent.js +0 -112
  318. package/src/ItemNavigator/ItemNavigator.js +0 -376
  319. package/src/ItemNavigator/providers/sharing.js +0 -29
  320. package/src/css/_MobileNav.scss +0 -194
  321. package/src/dragscrollable-br.js +0 -261
  322. package/src/plugins/menu_toggle/plugin.menu_toggle.js +0 -324
  323. package/src/plugins/plugin.mobile_nav.js +0 -287
  324. package/tests/BookReader/BookModel.test.js +0 -312
  325. package/tests/BookReader/BookReaderPublicFunctions.test.js +0 -171
  326. package/tests/BookReader/DebugConsole.test.js +0 -25
  327. package/tests/BookReader/ImageCache.test.js +0 -150
  328. package/tests/BookReader/Mode1Up.test.js +0 -164
  329. package/tests/BookReader/Mode2Up.test.js +0 -247
  330. package/tests/BookReader/Navbar/Navbar.test.js +0 -169
  331. package/tests/BookReader/PageContainer.test.js +0 -115
  332. package/tests/BookReader/ReduceSet.test.js +0 -38
  333. package/tests/BookReader/Toolbar/Toolbar.test.js +0 -26
  334. package/tests/BookReader/utils/classes.test.js +0 -88
  335. package/tests/BookReader/utils.test.js +0 -109
  336. package/tests/BookReader.options.test.js +0 -39
  337. package/tests/BookReader.test.js +0 -301
  338. package/tests/e2e/README.md +0 -75
  339. package/tests/e2e/autoplay.test.js +0 -13
  340. package/tests/e2e/base.test.js +0 -35
  341. package/tests/e2e/helpers/base.js +0 -263
  342. package/tests/e2e/helpers/debug.js +0 -13
  343. package/tests/e2e/helpers/desktopSearch.js +0 -72
  344. package/tests/e2e/helpers/mobileSearch.js +0 -85
  345. package/tests/e2e/helpers/mockSearch.js +0 -93
  346. package/tests/e2e/helpers/rightToLeft.js +0 -29
  347. package/tests/e2e/ia-production/ia-prod-base.js +0 -17
  348. package/tests/e2e/models/BookReader.js +0 -11
  349. package/tests/e2e/models/Navigation.js +0 -56
  350. package/tests/e2e/rightToLeft.test.js +0 -20
  351. package/tests/e2e/viewmode.test.js +0 -37
  352. package/tests/karma/BookNavigator/book-navigator.test.js +0 -132
  353. package/tests/karma/BookNavigator/bookmarks/bookmark-edit.test.js +0 -133
  354. package/tests/karma/BookNavigator/bookmarks/bookmarks-list.test.js +0 -222
  355. package/tests/karma/BookNavigator/search/search-provider.test.js +0 -23
  356. package/tests/karma/BookNavigator/search/search-results.test.js +0 -240
  357. package/tests/karma/BookNavigator/visual-adjustments.test.js +0 -201
  358. package/tests/plugins/menu_toggle/plugin.menu_toggle.test.js +0 -68
  359. package/tests/plugins/plugin.archive_analytics.test.js +0 -23
  360. package/tests/plugins/plugin.autoplay.test.js +0 -52
  361. package/tests/plugins/plugin.chapters.test.js +0 -130
  362. package/tests/plugins/plugin.iframe.test.js +0 -42
  363. package/tests/plugins/plugin.mobile_nav.test.js +0 -66
  364. package/tests/plugins/plugin.resume.test.js +0 -98
  365. package/tests/plugins/plugin.text_selection.test.js +0 -203
  366. package/tests/plugins/plugin.url.test.js +0 -129
  367. package/tests/plugins/plugin.vendor-fullscreen.test.js +0 -65
  368. package/tests/plugins/search/plugin.search.test.js +0 -173
  369. package/tests/plugins/search/plugin.search.view.test.js +0 -106
  370. package/tests/plugins/tts/AbstractTTSEngine.test.js +0 -153
  371. package/tests/plugins/tts/FestivalTTSEngine.test.js +0 -59
  372. package/tests/plugins/tts/PageChunk.test.js +0 -57
  373. package/tests/plugins/tts/PageChunkIterator.test.js +0 -179
  374. package/tests/plugins/tts/WebTTSEngine.test.js +0 -126
  375. package/tests/plugins/tts/utils.test.js +0 -133
  376. package/tests/util/browserSniffing.test.js +0 -56
  377. package/tests/util/docCookies.test.js +0 -15
  378. package/tests/util/strings.test.js +0 -63
  379. package/tests/utils.js +0 -42
  380. package/webpack.config.js +0 -86
@@ -0,0 +1,1907 @@
1
+ /*! For license information please see ia-bookreader-bundle.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[68],{8248:function(e,t,n){var r,o=n(5215),i=n(420),a=n(9696);!function(e){e.processing="processing",e.complete="complete"}(r||(r={}));let s=class extends i.WF{constructor(){super(...arguments),this.mode="processing"}render(){return i.qy`
3
+ <div class="${this.mode}">
4
+ <svg
5
+ viewBox="0 0 120 120"
6
+ preserveAspectRatio="none"
7
+ version="1.1"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ xmlns:xlink="http://www.w3.org/1999/xlink"
10
+ aria-labelledby="indicatorTitle indicatorDescription"
11
+ >
12
+ <title id="indicatorTitle">Activity Indicator</title>
13
+ <desc id="indicatorDescription">
14
+ A rotating activity indicator with three dots in the middle.
15
+ </desc>
16
+ <g
17
+ id="icons/check-ring---squared"
18
+ stroke="none"
19
+ stroke-width="1"
20
+ fill="none"
21
+ fill-rule="evenodd"
22
+ >
23
+ <path
24
+ id="completed-ring"
25
+ class="loaded-indicator"
26
+ d="M60,10 C70.5816709,10 80.3955961,13.2871104 88.4763646,18.8959201 L78.3502633,29.0214223 C72.9767592,25.8315427 66.7022695,24 60,24 C40.117749,24 24,40.117749 24,60 C24,79.882251 40.117749,96 60,96 C79.882251,96 96,79.882251 96,60 L95.995,59.46 L108.327675,47.128668 C109.350926,50.9806166 109.925886,55.015198 109.993301,59.1731586 L110,60 C110,87.6142375 87.6142375,110 60,110 C32.3857625,110 10,87.6142375 10,60 C10,32.3857625 32.3857625,10 60,10 Z"
27
+ ></path>
28
+ <polygon
29
+ id="check"
30
+ class="loaded-indicator"
31
+ transform="translate(75.000000, 41.500000) rotate(44.000000) translate(-75.000000, -41.500000) "
32
+ points="96 85 54 85 54 65 76 64.999 76 -2 96 -2"
33
+ ></polygon>
34
+ <path
35
+ id="activity-ring"
36
+ class="activity-indicator"
37
+ d="M60,10 C69.8019971,10 78.9452178,12.8205573 86.6623125,17.6943223 L76.4086287,27.9484118 C71.4880919,25.4243078 65.9103784,24 60,24 C40.117749,24 24,40.117749 24,60 C24,79.882251 40.117749,96 60,96 C79.882251,96 96,79.882251 96,60 C96,53.3014663 94.1704984,47.0302355 90.9839104,41.6587228 L101.110332,31.5326452 C106.715332,39.6116982 110,49.4222615 110,60 C110,87.6142375 87.6142375,110 60,110 C32.3857625,110 10,87.6142375 10,60 C10,32.3857625 32.3857625,10 60,10 Z"
38
+ ></path>
39
+ <g
40
+ id="activity-dots"
41
+ class="activity-indicator"
42
+ transform="translate(40.000000, 55.000000)"
43
+ >
44
+ <circle id="left-dot" cx="5" cy="5" r="5"></circle>
45
+ <circle id="middle-dot" cx="20" cy="5" r="5"></circle>
46
+ <circle id="right-dot" cx="35" cy="5" r="5"></circle>
47
+ </g>
48
+ </g>
49
+ </svg>
50
+ </div>
51
+ `}static get styles(){const e=i.AH`var(--activityIndicatorCheckmarkColor, #31A481)`,t=i.AH`var(--activityIndicatorCompletedRingColor, #31A481)`,n=i.AH`var(--activityIndicatorLoadingRingColor, #333333)`,r=i.AH`var(--activityIndicatorLoadingDotColor, #333333)`;return i.AH`
52
+ #completed-ring {
53
+ fill: ${t};
54
+ }
55
+
56
+ #check {
57
+ fill: ${e};
58
+ }
59
+
60
+ #activity-ring {
61
+ fill: ${n};
62
+ }
63
+
64
+ #activity-dots {
65
+ fill: ${r};
66
+ }
67
+
68
+ .activity-indicator {
69
+ opacity: 0;
70
+ transition: opacity 0.25s ease-out;
71
+ }
72
+
73
+ .processing .activity-indicator {
74
+ opacity: 1;
75
+ }
76
+
77
+ .loaded-indicator {
78
+ opacity: 1;
79
+ transition: opacity 0.25s ease-out;
80
+ }
81
+
82
+ .processing .loaded-indicator {
83
+ opacity: 0;
84
+ }
85
+
86
+ .image {
87
+ border: 1px solid red;
88
+ display: inline-block;
89
+ }
90
+
91
+ .processing #activity-ring {
92
+ animation: rotate 1.3s infinite linear;
93
+ transform-origin: 50px 50px;
94
+ transform-box: fill-box;
95
+ }
96
+
97
+ .processing #left-dot {
98
+ opacity: 0;
99
+ animation: dot 1.3s infinite;
100
+ animation-delay: 0.2s;
101
+ }
102
+
103
+ .processing #middle-dot {
104
+ opacity: 0;
105
+ animation: dot 1.3s infinite;
106
+ animation-delay: 0.4s;
107
+ }
108
+
109
+ .processing #right-dot {
110
+ opacity: 0;
111
+ animation: dot 1.3s infinite;
112
+ animation-delay: 0.6s;
113
+ }
114
+
115
+ @keyframes rotate {
116
+ 0% {
117
+ transform: rotate(-360deg);
118
+ }
119
+ 100% {
120
+ /* This frame is supposed to be inferred, but Safari doesn't rotate it unless we're explicit */
121
+ transform: rotate(0deg);
122
+ }
123
+ }
124
+
125
+ @keyframes dot {
126
+ 0% {
127
+ opacity: 0;
128
+ }
129
+ 25% {
130
+ opacity: 1;
131
+ }
132
+ 100% {
133
+ opacity: 0;
134
+ }
135
+ }
136
+ `}};(0,o.Cg)([(0,a.MZ)({type:String})],s.prototype,"mode",void 0),s=(0,o.Cg)([(0,a.EM)("ia-activity-indicator")],s)},5215:function(e,t,n){function r(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}n.d(t,{Cg:function(){return r}}),Object.create,Object.create},4535:function(e,t,n){n.d(t,{J:function(){return o}});var r=n(6681),o=function(e){return null!=e?e:r.s6}},5758:function(e,t,n){n(2675),n(9463),n(2259),n(5700),n(3418),n(3792),n(4782),n(9572),n(2010),n(8130),n(2811),n(3851),n(1278),n(875),n(825),n(888),n(8781),n(7764),n(3500),n(2953),n(8706),n(2008),n(113),n(2062),n(9085),n(5506),n(9432),n(6099),n(7495),n(1761),n(5746);var r=n(420),o=n(5215),i=n(9696),a=(n(8598),n(1415),n(744),n(6681)),s=n(1091);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function d(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var m=(0,s.u$)(function(e){function t(e){var n,r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t,n){return t=p(t),function(e,t){if(t&&("object"==l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}(this,t,[e]),e.type!==s.OA.ATTRIBUTE||"class"!==e.name||(null===(r=e.strings)||void 0===r?void 0:r.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");return n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),function(e,t){return t&&u(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(e){return" "+Object.keys(e).filter(function(t){return e[t]}).join(" ")+" "}},{key:"update",value:function(e,t){var n,r,o=this,i=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,1)[0];if(void 0===this.it){for(var s in this.it=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(function(e){return""!==e}))),i)i[s]&&!(null===(n=this.nt)||void 0===n?void 0:n.has(s))&&this.it.add(s);return this.render(i)}var l=e.element.classList;for(var u in this.it.forEach(function(e){e in i||(l.remove(e),o.it.delete(e))}),i){var d=!!i[u];d===this.it.has(u)||(null===(r=this.nt)||void 0===r?void 0:r.has(u))||(d?(l.add(u),this.it.add(u)):(l.remove(u),this.it.delete(u)))}return a.c0}}])}(s.WL));function v(e){let t,n,r;return"object"==typeof e?(t=e.hashFunction,n=e.expiring,r=e.tags):t=e,(e,o,i)=>{if(null!=i.value)i.value=y(i.value,t,n,r);else{if(null==i.get)throw"Only put a Memoize() decorator on a method or get accessor.";i.get=y(i.get,t,n,r)}}}const b=new Map;function y(e,t,n=0,r){const o=Symbol("__memoized_map__");return function(...i){let a;this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let s=this[o];if(Array.isArray(r))for(const e of r)b.has(e)?b.get(e).push(s):b.set(e,[s]);if(t||i.length>0||n>0){let r;r=!0===t?i.map(e=>e.toString()).join("!"):t?t.apply(this,i):i[0];const o=`${r}__timestamp`;let l=!1;if(n>0)if(s.has(o)){let e=s.get(o);l=Date.now()-e>n}else l=!0;s.has(r)&&!l?a=s.get(r):(a=e.apply(this,i),s.set(r,a),n>0&&s.set(o,Date.now()))}else{const t=this;s.has(t)?a=s.get(t):(a=e.apply(this,i),s.set(t,a))}return a}}class g{parseValue(e){return("string"!=typeof e||"false"!==e&&"0"!==e)&&Boolean(e)}}g.shared=new g;class k{parseValue(e){if("number"==typeof e)return e;if("boolean"==typeof e)return;const t=parseFloat(e);return Number.isNaN(t)?void 0:t}}k.shared=new k;class w{parseValue(e){return k.shared.parseValue(e)}}w.shared=new w;class C{parseValue(e){return this.parseJSDate(e)||this.parseBracketDate(e)}parseBracketDate(e){if("string"!=typeof e)return;const t=e.match(/\[([0-9]{4})\]/);return!t||t.length<2?void 0:this.parseJSDate(t[1])}parseJSDate(e){if("string"!=typeof e)return;let t=e;t.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}\s{1}[0-9]{2}:[0-9]{2}:[0-9]{2}$/)&&(t=t.replace(" ","T"));const n=Date.parse(t);if(Number.isNaN(n))return;let r=new Date(t);return(t.match(/^[0-9]{4}$/)||t.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/))&&(r=new Date(r.getTime()+1e3*r.getTimezoneOffset()*60)),r}}C.shared=new C;class x{parseValue(e){if("number"==typeof e)return e;if("boolean"==typeof e)return;const t=e.split(":");let n;return n=1===t.length?this.parseNumberFormat(t[0]):this.parseColonSeparatedFormat(t),n}parseNumberFormat(e){let t=parseFloat(e);return Number.isNaN(t)&&(t=void 0),t}parseColonSeparatedFormat(e){let t=!1;const n=e.map((n,r)=>{const o=parseFloat(n);if(Number.isNaN(o))return t=!0,0;const i=60**(e.length-1-r);return o*Math.floor(i)}).reduce((e,t)=>e+t,0);return t?void 0:n}}x.shared=new x;class S{parseValue(e){if("string"==typeof e)return e}}S.shared=new S;class O{constructor(e,t){this.separators=[";",","],this.parser=e,t&&t.separators&&(this.separators=t.separators)}parseValue(e){const t=String(e);let n=[];for(const e of this.separators)if(n=t.split(e),n.length>1)break;return this.parseListValues(n)}parseListValues(e){const t=e.map(e=>e.trim()),n=t.map(e=>this.parser.parseValue(e)),r=[];return n.forEach(e=>{void 0!==e&&r.push(e)}),r}}class M{parseValue(e){if("string"==typeof e)return e}}M.shared=new M;class B{parseValue(e){return String(e)}}B.shared=new B;class j{get name(){return this.rawValue.name}get source(){return this.rawValue.source}get btih(){return this.rawValue.btih}get md5(){return this.rawValue.md5}get format(){return this.rawValue.format}get mtime(){if(null==this.rawValue.mtime)return;const e=k.shared.parseValue(this.rawValue.mtime);return e?new Date(1e3*e):void 0}get crc32(){return this.rawValue.crc32}get sha1(){return this.rawValue.sha1}get original(){return this.rawValue.original}get size(){return null!=this.rawValue.size?w.shared.parseValue(this.rawValue.size):void 0}get title(){return this.rawValue.title}get length(){return null!=this.rawValue.length?x.shared.parseValue(this.rawValue.length):void 0}get height(){return null!=this.rawValue.height?k.shared.parseValue(this.rawValue.height):void 0}get width(){return null!=this.rawValue.width?k.shared.parseValue(this.rawValue.width):void 0}get track(){return null!=this.rawValue.track?k.shared.parseValue(this.rawValue.track):void 0}get external_identifier(){return this.rawValue.external_identifier}get creator(){return this.rawValue.creator}get album(){return this.rawValue.album}constructor(e={}){this.rawValue=e}}(0,o.Cg)([v()],j.prototype,"mtime",null),(0,o.Cg)([v()],j.prototype,"size",null),(0,o.Cg)([v()],j.prototype,"length",null),(0,o.Cg)([v()],j.prototype,"height",null),(0,o.Cg)([v()],j.prototype,"width",null),(0,o.Cg)([v()],j.prototype,"track",null);class P{get values(){return this.parseRawValue()}get value(){return this.values[0]}constructor(e,t){this.parser=e,this.rawValue=t}parseRawValue(){const e=Array.isArray(this.rawValue)?this.rawValue:[this.rawValue],t=[];return e.forEach(e=>{const n=this.parser.parseValue(e);Array.isArray(n)?t.push(...n):void 0!==n&&t.push(n)}),t}}(0,o.Cg)([v()],P.prototype,"values",null),(0,o.Cg)([v()],P.prototype,"value",null);class E extends P{constructor(e){super(g.shared,e)}}class L extends P{constructor(e){super(C.shared,e)}}class A extends P{constructor(e){super(x.shared,e)}}class _ extends P{constructor(e){super(k.shared,e)}}class T extends P{constructor(e){super(B.shared,e)}}class z extends P{constructor(e){super(M.shared,e)}}class I extends P{constructor(e){super(w.shared,e)}}class $ extends P{constructor(e){super(S.shared,e)}}class H extends P{constructor(e,t){super(t,e)}}class D extends H{constructor(e){super(e,new O(B.shared))}}class q{get identifier(){return this.rawMetadata.identifier}get addeddate(){return null!=this.rawMetadata.addeddate?new L(this.rawMetadata.addeddate):void 0}get audio_codec(){return null!=this.rawMetadata.audio_codec?new T(this.rawMetadata.audio_codec):void 0}get audio_sample_rate(){return null!=this.rawMetadata.audio_sample_rate?new _(this.rawMetadata.audio_sample_rate):void 0}get avg_rating(){return null!=this.rawMetadata.avg_rating?new _(this.rawMetadata.avg_rating):void 0}get collection(){return null!=this.rawMetadata.collection?new T(this.rawMetadata.collection):void 0}get collections_raw(){return null!=this.rawMetadata.collections_raw?new T(this.rawMetadata.collections_raw):void 0}get collection_size(){return null!=this.rawMetadata.collection_size?new I(this.rawMetadata.collection_size):void 0}get contact(){return null!=this.rawMetadata.contact?new T(this.rawMetadata.contact):void 0}get contributor(){return null!=this.rawMetadata.contributor?new T(this.rawMetadata.contributor):void 0}get coverage(){return null!=this.rawMetadata.coverage?new T(this.rawMetadata.coverage):void 0}get creator(){return null!=this.rawMetadata.creator?new T(this.rawMetadata.creator):void 0}get creator_alt_script(){return null!=this.rawMetadata["creator-alt-script"]?new T(this.rawMetadata["creator-alt-script"]):void 0}get credits(){return null!=this.rawMetadata.credits?new T(this.rawMetadata.credits):void 0}get collection_layout(){return null!=this.rawMetadata.collection_layout?new T(this.rawMetadata.collection_layout):void 0}get date(){return null!=this.rawMetadata.date?new L(this.rawMetadata.date):void 0}get description(){return null!=this.rawMetadata.description?new T(this.rawMetadata.description):void 0}get downloads(){return null!=this.rawMetadata.downloads?new _(this.rawMetadata.downloads):void 0}get duration(){return null!=this.rawMetadata.duration?new A(this.rawMetadata.duration):void 0}get external_identifier(){return null!=this.rawMetadata["external-identifier"]?new T(this.rawMetadata["external-identifier"]):void 0}get external_link(){return null!=this.rawMetadata["external-link"]?new T(this.rawMetadata["external-link"]):void 0}get files_count(){return null!=this.rawMetadata.files_count?new _(this.rawMetadata.files_count):void 0}get indexdate(){return null!=this.rawMetadata.indexdate?new L(this.rawMetadata.indexdate):void 0}get isbn(){return null!=this.rawMetadata.isbn?new T(this.rawMetadata.isbn):void 0}get issue(){return null!=this.rawMetadata.issue?new T(this.rawMetadata.issue):void 0}get item_count(){return null!=this.rawMetadata.item_count?new _(this.rawMetadata.item_count):void 0}get item_size(){return null!=this.rawMetadata.item_size?new I(this.rawMetadata.item_size):void 0}get language(){return null!=this.rawMetadata.language?new T(this.rawMetadata.language):void 0}get length(){return null!=this.rawMetadata.length?new A(this.rawMetadata.length):void 0}get licenseurl(){return null!=this.rawMetadata.licenseurl?new T(this.rawMetadata.licenseurl):void 0}get lineage(){return null!=this.rawMetadata.lineage?new T(this.rawMetadata.lineage):void 0}get month(){return null!=this.rawMetadata.month?new _(this.rawMetadata.month):void 0}get mediatype(){return null!=this.rawMetadata.mediatype?new $(this.rawMetadata.mediatype):void 0}get noindex(){return null!=this.rawMetadata.noindex?new E(this.rawMetadata.noindex):void 0}get notes(){return null!=this.rawMetadata.notes?new T(this.rawMetadata.notes):void 0}get num_favorites(){return null!=this.rawMetadata.num_favorites?new _(this.rawMetadata.num_favorites):void 0}get num_reviews(){return null!=this.rawMetadata.num_reviews?new _(this.rawMetadata.num_reviews):void 0}get openlibrary_edition(){return null!=this.rawMetadata.openlibrary_edition?new T(this.rawMetadata.openlibrary_edition):void 0}get openlibrary_work(){return null!=this.rawMetadata.openlibrary_work?new T(this.rawMetadata.openlibrary_work):void 0}get page_progression(){return null!=this.rawMetadata.page_progression?new z(this.rawMetadata.page_progression):void 0}get paginated(){return null!=this.rawMetadata.paginated?new E(this.rawMetadata.paginated):void 0}get partner(){return null!=this.rawMetadata.partner?new T(this.rawMetadata.partner):void 0}get post_text(){return null!=this.rawMetadata.post_text?new T(this.rawMetadata.post_text):void 0}get ppi(){return null!=this.rawMetadata.ppi?new _(this.rawMetadata.ppi):void 0}get publicdate(){return null!=this.rawMetadata.publicdate?new L(this.rawMetadata.publicdate):void 0}get publisher(){return null!=this.rawMetadata.publisher?new T(this.rawMetadata.publisher):void 0}get reviewdate(){return null!=this.rawMetadata.reviewdate?new L(this.rawMetadata.reviewdate):void 0}get rights(){return null!=this.rawMetadata.rights?new T(this.rawMetadata.rights):void 0}get rights_holder(){var e;const t=null!==(e=this.rawMetadata["rights-holder"])&&void 0!==e?e:this.rawMetadata.rights_holder;return null!=t?new T(t):void 0}get runtime(){return null!=this.rawMetadata.runtime?new A(this.rawMetadata.runtime):void 0}get scanner(){return null!=this.rawMetadata.scanner?new T(this.rawMetadata.scanner):void 0}get segments(){return null!=this.rawMetadata.segments?new T(this.rawMetadata.segments):void 0}get shotlist(){return null!=this.rawMetadata.shotlist?new T(this.rawMetadata.shotlist):void 0}get source(){return null!=this.rawMetadata.source?new T(this.rawMetadata.source):void 0}get sponsor(){return null!=this.rawMetadata.sponsor?new T(this.rawMetadata.sponsor):void 0}get start_localtime(){return null!=this.rawMetadata.start_localtime?new L(this.rawMetadata.start_localtime):void 0}get start_time(){return null!=this.rawMetadata.start_time?new L(this.rawMetadata.start_time):void 0}get stop_time(){return null!=this.rawMetadata.stop_time?new L(this.rawMetadata.stop_time):void 0}get subject(){return null!=this.rawMetadata.subject?new D(this.rawMetadata.subject):void 0}get taper(){return null!=this.rawMetadata.taper?new T(this.rawMetadata.taper):void 0}get title(){return null!=this.rawMetadata.title?new T(this.rawMetadata.title):void 0}get title_alt_script(){return null!=this.rawMetadata["title-alt-script"]?new T(this.rawMetadata["title-alt-script"]):void 0}get transferer(){return null!=this.rawMetadata.transferer?new T(this.rawMetadata.transferer):void 0}get track(){return null!=this.rawMetadata.track?new _(this.rawMetadata.track):void 0}get type(){return null!=this.rawMetadata.type?new T(this.rawMetadata.type):void 0}get uploader(){return null!=this.rawMetadata.uploader?new T(this.rawMetadata.uploader):void 0}get utc_offset(){return null!=this.rawMetadata.utc_offset?new _(this.rawMetadata.utc_offset):void 0}get venue(){return null!=this.rawMetadata.venue?new T(this.rawMetadata.venue):void 0}get volume(){return null!=this.rawMetadata.volume?new T(this.rawMetadata.volume):void 0}get week(){return null!=this.rawMetadata.week?new _(this.rawMetadata.week):void 0}get year(){return null!=this.rawMetadata.year?new _(this.rawMetadata.year):void 0}constructor(e={}){this.rawMetadata=e}}(0,o.Cg)([v()],q.prototype,"addeddate",null),(0,o.Cg)([v()],q.prototype,"audio_codec",null),(0,o.Cg)([v()],q.prototype,"audio_sample_rate",null),(0,o.Cg)([v()],q.prototype,"avg_rating",null),(0,o.Cg)([v()],q.prototype,"collection",null),(0,o.Cg)([v()],q.prototype,"collections_raw",null),(0,o.Cg)([v()],q.prototype,"collection_size",null),(0,o.Cg)([v()],q.prototype,"contact",null),(0,o.Cg)([v()],q.prototype,"contributor",null),(0,o.Cg)([v()],q.prototype,"coverage",null),(0,o.Cg)([v()],q.prototype,"creator",null),(0,o.Cg)([v()],q.prototype,"creator_alt_script",null),(0,o.Cg)([v()],q.prototype,"credits",null),(0,o.Cg)([v()],q.prototype,"collection_layout",null),(0,o.Cg)([v()],q.prototype,"date",null),(0,o.Cg)([v()],q.prototype,"description",null),(0,o.Cg)([v()],q.prototype,"downloads",null),(0,o.Cg)([v()],q.prototype,"duration",null),(0,o.Cg)([v()],q.prototype,"external_identifier",null),(0,o.Cg)([v()],q.prototype,"external_link",null),(0,o.Cg)([v()],q.prototype,"files_count",null),(0,o.Cg)([v()],q.prototype,"indexdate",null),(0,o.Cg)([v()],q.prototype,"isbn",null),(0,o.Cg)([v()],q.prototype,"issue",null),(0,o.Cg)([v()],q.prototype,"item_count",null),(0,o.Cg)([v()],q.prototype,"item_size",null),(0,o.Cg)([v()],q.prototype,"language",null),(0,o.Cg)([v()],q.prototype,"length",null),(0,o.Cg)([v()],q.prototype,"licenseurl",null),(0,o.Cg)([v()],q.prototype,"lineage",null),(0,o.Cg)([v()],q.prototype,"month",null),(0,o.Cg)([v()],q.prototype,"mediatype",null),(0,o.Cg)([v()],q.prototype,"noindex",null),(0,o.Cg)([v()],q.prototype,"notes",null),(0,o.Cg)([v()],q.prototype,"num_favorites",null),(0,o.Cg)([v()],q.prototype,"num_reviews",null),(0,o.Cg)([v()],q.prototype,"openlibrary_edition",null),(0,o.Cg)([v()],q.prototype,"openlibrary_work",null),(0,o.Cg)([v()],q.prototype,"page_progression",null),(0,o.Cg)([v()],q.prototype,"paginated",null),(0,o.Cg)([v()],q.prototype,"partner",null),(0,o.Cg)([v()],q.prototype,"post_text",null),(0,o.Cg)([v()],q.prototype,"ppi",null),(0,o.Cg)([v()],q.prototype,"publicdate",null),(0,o.Cg)([v()],q.prototype,"publisher",null),(0,o.Cg)([v()],q.prototype,"reviewdate",null),(0,o.Cg)([v()],q.prototype,"rights",null),(0,o.Cg)([v()],q.prototype,"rights_holder",null),(0,o.Cg)([v()],q.prototype,"runtime",null),(0,o.Cg)([v()],q.prototype,"scanner",null),(0,o.Cg)([v()],q.prototype,"segments",null),(0,o.Cg)([v()],q.prototype,"shotlist",null),(0,o.Cg)([v()],q.prototype,"source",null),(0,o.Cg)([v()],q.prototype,"sponsor",null),(0,o.Cg)([v()],q.prototype,"start_localtime",null),(0,o.Cg)([v()],q.prototype,"start_time",null),(0,o.Cg)([v()],q.prototype,"stop_time",null),(0,o.Cg)([v()],q.prototype,"subject",null),(0,o.Cg)([v()],q.prototype,"taper",null),(0,o.Cg)([v()],q.prototype,"title",null),(0,o.Cg)([v()],q.prototype,"title_alt_script",null),(0,o.Cg)([v()],q.prototype,"transferer",null),(0,o.Cg)([v()],q.prototype,"track",null),(0,o.Cg)([v()],q.prototype,"type",null),(0,o.Cg)([v()],q.prototype,"uploader",null),(0,o.Cg)([v()],q.prototype,"utc_offset",null),(0,o.Cg)([v()],q.prototype,"venue",null),(0,o.Cg)([v()],q.prototype,"volume",null),(0,o.Cg)([v()],q.prototype,"week",null),(0,o.Cg)([v()],q.prototype,"year",null);class R{get reviewbody(){return this.rawValue.reviewbody}get reviewtitle(){return this.rawValue.reviewtitle}get reviewer(){return this.rawValue.reviewer}get reviewer_itemname(){return this.rawValue.reviewer_itemname}get reviewdate(){return null!=this.rawValue.reviewdate?C.shared.parseValue(this.rawValue.reviewdate):void 0}get createdate(){return null!=this.rawValue.createdate?C.shared.parseValue(this.rawValue.createdate):void 0}get stars(){return null!=this.rawValue.stars?k.shared.parseValue(this.rawValue.stars):void 0}constructor(e={}){this.rawValue=e}}(0,o.Cg)([v()],R.prototype,"reviewdate",null),(0,o.Cg)([v()],R.prototype,"createdate",null),(0,o.Cg)([v()],R.prototype,"stars",null);class F{constructor(e){var t,n;this.rawResponse=e,this.created=e.created,this.d1=e.d1,this.d2=e.d2,this.dir=e.dir,this.files=null===(t=e.files)||void 0===t?void 0:t.map(e=>new j(e)),this.files_count=e.files_count,this.item_last_updated=e.item_last_updated,this.item_size=e.item_size,this.metadata=new q(e.metadata),this.server=e.server,this.uniq=e.uniq,this.workable_servers=e.workable_servers,this.speech_vs_music_asr=e.speech_vs_music_asr,this.reviews=null===(n=e.reviews)||void 0===n?void 0:n.map(e=>new R(e))}}var W;!function(e){e.networkError="MetadataService.NetworkError",e.itemNotFound="MetadataService.ItemNotFound",e.decodingError="MetadataService.DecodingError",e.searchEngineError="MetadataService.SearchEngineError"}(W||(W={}));class V extends Error{constructor(e,t,n){super(t),this.name=e,this.type=e,this.details=n}}class N{constructor(e){this.backend=e}async fetchMetadata(e){var t;const n=await this.backend.fetchMetadata(e);return n.error?n:void 0===(null===(t=n.success)||void 0===t?void 0:t.metadata)?{error:new V(W.itemNotFound)}:{success:new F(n.success)}}async fetchMetadataValue(e,t){var n;const r=await this.backend.fetchMetadata(e,t);return r.error?r:void 0===(null===(n=r.success)||void 0===n?void 0:n.result)?{error:new V(W.itemNotFound)}:{success:r.success.result}}}N.default=new N(new class{constructor(e){var t;if(this.baseUrl=null!==(t=null==e?void 0:e.baseUrl)&&void 0!==t?t:"archive.org",void 0!==(null==e?void 0:e.includeCredentials)?this.includeCredentials=e.includeCredentials:this.includeCredentials=null!==window.location.href.match(/^https?:\/\/.*archive\.org(:[0-9]+)?/),void 0!==(null==e?void 0:e.scope))this.requestScope=e.scope;else{const e=new URL(window.location.href).searchParams.get("scope");e&&(this.requestScope=e)}}async fetchMetadata(e,t){const n=t?`/${t}`:"",r=`https://${this.baseUrl}/metadata/${e}${n}`;return this.fetchUrl(r,{requestOptions:{credentials:"omit"}})}async fetchUrl(e,t){var n;const r=new URL(e);let o;this.requestScope&&r.searchParams.set("scope",this.requestScope);try{const e=null!==(n=null==t?void 0:t.requestOptions)&&void 0!==n?n:{credentials:this.includeCredentials?"include":"same-origin"};o=await fetch(r.href,e)}catch(e){const t=e instanceof Error?e.message:"string"==typeof e?e:"Unknown error";return this.getErrorResult(W.networkError,t)}try{const e=await o.json(),t=e.error;if(t){const n=e.forensics;return this.getErrorResult(W.searchEngineError,t,n)}return{success:e}}catch(e){const t=e instanceof Error?e.message:"string"==typeof e?e:"Unknown error";return this.getErrorResult(W.decodingError,t)}}getErrorResult(e,t,n){return{error:new V(e,t,n)}}});var Z=r.qy`
137
+ <svg
138
+ viewBox="0 0 40 40"
139
+ xmlns="http://www.w3.org/2000/svg"
140
+ aria-labelledby="ellipsesTitleID ellipsesDescID"
141
+ >
142
+ <title id="ellipsesTitleID">Ellipses icon</title>
143
+ <desc id="ellipsesDescID">An illustration of text ellipses.</desc>
144
+ <path class="fill-color" d="m10.5 17.5c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5c-1.38071187 0-2.5-1.1192881-2.5-2.5s1.11928813-2.5 2.5-2.5zm9.5 0c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5-2.5-1.1192881-2.5-2.5 1.1192881-2.5 2.5-2.5zm9.5 0c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5-2.5-1.1192881-2.5-2.5 1.1192881-2.5 2.5-2.5z" fill-rule="evenodd"/>
145
+ </svg>
146
+ `;class U extends r.WF{static get styles(){return r.AH`
147
+ :host {
148
+ width: var(--iconWidth, 'auto');
149
+ height: var(--iconHeight, 'auto');
150
+ }
151
+
152
+ .fill-color {
153
+ fill: var(--iconFillColor);
154
+ }
155
+
156
+ .stroke-color {
157
+ stroke: var(--iconStrokeColor);
158
+ }
159
+ `}render(){return Z}}customElements.define("ia-icon-ellipses",U);const G=r.AH`42px`,J=r.AH`var(--menuWidth, 320px)`,X=r.AH`var(--animationTiming, 200ms)`;var K=r.AH`
160
+ .main {
161
+ overflow: hidden;
162
+ width: 100%;
163
+ height: 100%;
164
+ }
165
+
166
+ .animate {
167
+ transition: transform ${X} ease-out;
168
+ }
169
+
170
+ .menu {
171
+ position: absolute;
172
+ top: 0;
173
+ left: 0;
174
+ bottom: 0;
175
+ width: ${J};
176
+ padding: 0.5rem 0.5rem 0 0;
177
+ box-sizing: border-box;
178
+ font-size: 1.4rem;
179
+ color: var(--primaryTextColor);
180
+ background: var(--menuSliderBg);
181
+ transform: translateX(calc(${J} * -1));
182
+ }
183
+
184
+ button {
185
+ cursor: pointer;
186
+ }
187
+
188
+ header {
189
+ margin: 0 0 0.5rem 0;
190
+ }
191
+
192
+ header * {
193
+ margin: 0;
194
+ display: inline-block;
195
+ }
196
+ header button {
197
+ cursor: pointer;
198
+ }
199
+
200
+ header.with-secondary-action .details {
201
+ width: 80%;
202
+ }
203
+
204
+ header .details {
205
+ font-weight: bold;
206
+ width: 88%;
207
+ }
208
+
209
+ header .custom-action > *,
210
+ button.close {
211
+ padding: 0;
212
+ background-color: transparent;
213
+ border: 0;
214
+ --iconWidth: var(--menuSliderHeaderIconWidth);
215
+ --iconHeight: var(--menuSliderHeaderIconHeight);
216
+ }
217
+
218
+ header .custom-action,
219
+ button.close {
220
+ position: absolute;
221
+ }
222
+ button.close {
223
+ min-width: 38px;
224
+ min-height: 38px;
225
+ display: flex;
226
+ justify-content: center;
227
+ align-items: center;
228
+ right: 0;
229
+ top: 0;
230
+ }
231
+
232
+ .content {
233
+ position: absolute;
234
+ top: 0;
235
+ right: 0;
236
+ bottom: 0;
237
+ left: ${G};
238
+ z-index: 1;
239
+ transform: translateX(calc(${J} * -1));
240
+ transition: transform ${X} ease-out;
241
+ background: var(--activeButtonBg);
242
+ border-right: 0.2rem solid;
243
+ border-color: var(--subpanelRightBorderColor);
244
+ padding: 0.5rem 0 0 0.5rem;
245
+ display: flex;
246
+ flex-direction: column;
247
+ }
248
+
249
+ .open {
250
+ transform: translateX(0);
251
+ }
252
+
253
+ .menu-list {
254
+ padding: 0;
255
+ margin: 0;
256
+ list-style: none;
257
+ background: var(--menuSliderBg);
258
+ }
259
+ .menu-list li {
260
+ margin-bottom: 0.2rem;
261
+ }
262
+
263
+ .content > section {
264
+ overflow: auto;
265
+ overscroll-behavior: contain;
266
+ }
267
+ `,Q=r.qy`
268
+ <svg
269
+ viewBox="0 0 18 18"
270
+ xmlns="http://www.w3.org/2000/svg"
271
+ aria-labelledby="collapseSidebarTitleID collapseSidebarDescID"
272
+ >
273
+ <title id="collapseSidebarTitleID">Collapse sidebar</title>
274
+ <desc id="collapseSidebarDescID">A circle with a left pointing chevron</desc>
275
+ <path d="m9 0c4.9705627 0 9 4.02943725 9 9 0 4.9705627-4.0294373 9-9 9-4.97056275 0-9-4.0294373-9-9 0-4.97056275 4.02943725-9 9-9zm1.6976167 5.28352881c-.365258-.3556459-.9328083-.37581056-1.32099801-.06558269l-.09308988.0844372-3 3.08108108-.08194436.09533317c-.27484337.36339327-.26799482.87009349.01656959 1.22592581l.084491.09308363 3 2.91891889.09533796.0818904c.3633964.2746544.8699472.2677153 1.2256839-.0167901l.093059-.0844712.0818904-.095338c.2746544-.3633964.2677153-.8699472-.0167901-1.2256839l-.0844712-.093059-2.283355-2.2222741 2.3024712-2.36338332.0819252-.09530804c.2997677-.39632298.2644782-.96313393-.1007797-1.31877983z" fill-rule="evenodd" class="fill-color" />
276
+ </svg>
277
+ `;class Y extends r.WF{static get styles(){return r.AH`
278
+ :host {
279
+ width: var(--iconWidth, 'auto');
280
+ height: var(--iconHeight, 'auto');
281
+ }
282
+
283
+ .fill-color {
284
+ fill: var(--iconFillColor);
285
+ }
286
+
287
+ .stroke-color {
288
+ stroke: var(--iconStrokeColor);
289
+ }
290
+ `}render(){return Q}}customElements.define("ia-icon-collapse-sidebar",Y);var ee=r.AH`
291
+ a {
292
+ display: inline-block;
293
+ text-decoration: none;
294
+ }
295
+
296
+ button.menu-item {
297
+ -webkit-appearance: none;
298
+ appearance: none;
299
+ }
300
+
301
+ .menu-item {
302
+ display: inline-flex;
303
+ width: 100%;
304
+ padding: 0;
305
+ font-size: 1.6rem;
306
+ text-align: left;
307
+ background: transparent;
308
+ -webkit-box-align: center;
309
+ -ms-flex-align: center;
310
+ align-items: center;
311
+ border: none;
312
+ cursor: pointer;
313
+ transition: background-color 0.2s;
314
+ border-radius: 6px;
315
+ }
316
+
317
+ .menu-item:hover {
318
+ background-color: rgba(255, 255, 255, 0.1);
319
+ }
320
+
321
+ .label {
322
+ display: var(--menuButtonLabelDisplay, none);
323
+ padding: 0;
324
+ font-weight: 400;
325
+ color: var(--primaryTextColor);
326
+ text-align: left;
327
+ vertical-align: middle;
328
+ margin-left: 1rem;
329
+ }
330
+
331
+ .menu-details {
332
+ color: var(--primaryTextColor);
333
+ display: inline-block;
334
+ margin-left: 0.5rem;
335
+ font-style: italic;
336
+ font-size: 1.5rem;
337
+ }
338
+
339
+ .menu-item > .icon {
340
+ position: relative;
341
+ display: inline-flex;
342
+ z-index: 2;
343
+ min-width: 4.2rem;
344
+ max-width: 4.2rem;
345
+ height: 4.2rem;
346
+ vertical-align: middle;
347
+ -webkit-box-align: center;
348
+ -ms-flex-align: center;
349
+ align-items: center;
350
+ -webkit-box-pack: center;
351
+ -ms-flex-pack: center;
352
+ justify-content: center;
353
+ }
354
+
355
+ .menu-item > .icon > * {
356
+ /* Prevent tooltip containing icon literal description */
357
+ pointer-events: none;
358
+ }
359
+
360
+ .menu-item[aria-expanded='true'] .icon {
361
+ background-color: var(--activeButtonBg);
362
+ border-radius: 1rem 0 0 1rem;
363
+ }
364
+
365
+ .icon .fill-color {
366
+ fill: #999;
367
+ }
368
+
369
+ .icon.active .fill-color {
370
+ fill: #fff;
371
+ }
372
+ `;let te=class extends r.WF{constructor(){super(...arguments),this.icon="",this.href="",this.label="",this.menuDetails="",this.buttonId="",this.selected=!1,this.followable=!1}static get styles(){return ee}onClick(e){e.preventDefault(),this.dispatchMenuTypeSelectedEvent()}dispatchMenuTypeSelectedEvent(){this.dispatchEvent(new CustomEvent("menuTypeSelected",{bubbles:!0,composed:!0,detail:{id:this.buttonId}}))}get iconClass(){return this.selected?"active":""}get menuItem(){return r.qy`
373
+ <span
374
+ class="icon ${this.iconClass}"
375
+ aria-hidden="true"
376
+ title="${this.label}"
377
+ >${this.icon}</span
378
+ >
379
+ <span class="label">${this.label}</span>
380
+ <span class="menu-details">${this.menuDetails}</span>
381
+ `}get linkButton(){return r.qy`
382
+ <a
383
+ href="${this.href}"
384
+ class="menu-item"
385
+ aria-expanded="${this.selected}"
386
+ @click=${this.followable?void 0:this.onClick}
387
+ >${this.menuItem}</a
388
+ >
389
+ `}get clickButton(){return r.qy`
390
+ <button
391
+ class="menu-item"
392
+ aria-expanded="${this.selected}"
393
+ @click=${this.onClick}
394
+ >
395
+ ${this.menuItem}
396
+ </button>
397
+ `}render(){return this.href?this.linkButton:this.clickButton}};te.shadowRootOptions={...r.WF.shadowRootOptions,delegatesFocus:!0},(0,o.Cg)([(0,i.MZ)({type:Object})],te.prototype,"icon",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],te.prototype,"href",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],te.prototype,"label",void 0),(0,o.Cg)([(0,i.MZ)({type:Object})],te.prototype,"menuDetails",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],te.prototype,"buttonId",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],te.prototype,"selected",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],te.prototype,"followable",void 0),te=(0,o.Cg)([(0,i.EM)("menu-button")],te);const ne={closeDrawer:"menuSliderClosed"};let re=class extends r.WF{constructor(){super(...arguments),this.menus=[],this.open=!1,this.manuallyHandleClose=!1,this.selectedMenu="",this.selectedMenuAction=r.s6,this.animateMenuOpen=!1}static get styles(){return K}updated(){var e;const t=(null===(e=this.selectedMenuDetails)||void 0===e?void 0:e.actionButton)||r.s6;t!==this.selectedMenuAction&&(this.selectedMenuAction=t)}setSelectedMenu({detail:e}){var t;const{id:n}=e;this.selectedMenu=this.selectedMenu===n?"":n,this.selectedMenuAction=(null===(t=this.selectedMenuDetails)||void 0===t?void 0:t.actionButton)||r.s6,this.updateComplete.then(()=>{var e;null===(e=this.contentCloseButton)||void 0===e||e.focus()})}closeMenu(){this.manuallyHandleClose||(this.open=!1);const{closeDrawer:e}=ne,t=new CustomEvent(e,{detail:this.selectedMenuDetails});this.dispatchEvent(t)}closePanel(){const e=this.selectedMenu;this.selectedMenu="",this.selectedMenuAction=r.s6,e&&this.updateComplete.then(()=>{const t=this.menus.findIndex(t=>t.id===e);if(-1!==t){const e=this.menuList.querySelector(`li:nth-child(${t+1}) menu-button`);null==e||e.focus()}})}handleKeyDown(e){"Escape"===e.key&&(e.preventDefault(),this.selectedMenu?this.closePanel():this.closeMenu())}get selectedMenuDetails(){return this.menus.find(e=>e.id===this.selectedMenu)}get sliderDetailsClass(){return`${this.animateMenuOpen?"animate":""} ${this.open?"open":""}`}get selectedMenuClass(){return this.selectedMenu?"open":""}get menuItems(){return this.menus.map(e=>r.qy`
398
+ <li>
399
+ <menu-button
400
+ @menuTypeSelected=${this.setSelectedMenu}
401
+ .icon=${e.icon}
402
+ .label=${e.label}
403
+ .menuDetails=${e.menuDetails||""}
404
+ .buttonId=${e.id}
405
+ .selected=${e.id===this.selectedMenu}
406
+ .followable=${e.followable||!1}
407
+ .href=${e.href||""}
408
+ ></menu-button>
409
+ </li>
410
+ `)}get renderMenuHeader(){const{label:e="",menuDetails:t=""}=this.selectedMenuDetails||{},n=this.selectedMenuAction?"with-secondary-action":"",o=this.selectedMenuAction?r.qy`<span class="custom-action">${this.selectedMenuAction}</span>`:r.s6;return r.qy`
411
+ <header class="${n}">
412
+ <div class="details">
413
+ <h3>${e}</h3>
414
+ <span class="extra-details">${t}</span>
415
+ </div>
416
+ ${o}
417
+ <button
418
+ class="close"
419
+ aria-label="Close this menu"
420
+ title="Close this menu"
421
+ @click=${this.closePanel}
422
+ >
423
+ <ia-icon-collapse-sidebar></ia-icon-collapse-sidebar>
424
+ </button>
425
+ </header>
426
+ `}get closeButton(){return r.qy`
427
+ <button
428
+ class="close"
429
+ aria-label="Close this menu"
430
+ title="Close this menu"
431
+ @click=${this.closeMenu}
432
+ >
433
+ <ia-icon-collapse-sidebar></ia-icon-collapse-sidebar>
434
+ </button>
435
+ `}render(){var e;return r.qy`
436
+ <div class="main" @keydown=${this.handleKeyDown}>
437
+ <div class="menu ${this.sliderDetailsClass}">
438
+ ${this.closeButton}
439
+ <ul class="menu-list">
440
+ ${this.menuItems}
441
+ </ul>
442
+ <div
443
+ class="content ${this.selectedMenuClass}"
444
+ @menuTypeSelected=${this.setSelectedMenu}
445
+ >
446
+ ${this.renderMenuHeader}
447
+ <section>
448
+ <div class="selected-menu">
449
+ ${(null===(e=this.selectedMenuDetails)||void 0===e?void 0:e.component)||r.s6}
450
+ </div>
451
+ </section>
452
+ </div>
453
+ </div>
454
+ </div>
455
+ `}};(0,o.Cg)([(0,i.MZ)({type:Array})],re.prototype,"menus",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],re.prototype,"open",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],re.prototype,"manuallyHandleClose",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],re.prototype,"selectedMenu",void 0),(0,o.Cg)([(0,i.MZ)({type:Object})],re.prototype,"selectedMenuAction",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],re.prototype,"animateMenuOpen",void 0),(0,o.Cg)([(0,i.P)(".content.open button.close")],re.prototype,"contentCloseButton",void 0),(0,o.Cg)([(0,i.P)(".menu-list")],re.prototype,"menuList",void 0),re=(0,o.Cg)([(0,i.EM)("ia-menu-slider")],re);let oe=class extends r.WF{constructor(){super(...arguments),this.loaderMessage=""}get bookIconSvg(){return r.JW`
456
+ <g class="bookIcon" transform="matrix(1 0 0 -1 28 67.362264)">
457
+ <path d="m44.71698 31.6981124v-29.99320678s-18.0956599.30735848-18.6322637-.7171698c-.0633962-.12226414-1.890566-.59207545-2.9745282-.59207545-1.3228302 0-3.5122641 0-4.1286791.74547168-.9707547 1.17452827-18.82811278.71660375-18.82811278.71660375v30.040754l1.83849052.7867924.29094339-28.48188608s15.94981097.15339622 17.09094297-1.10716978c.8145283-.90056602 4.997547-.91641507 5.3450942-.3526415.9611321 1.55716977 14.7101883 1.31716978 17.6077354 1.45981128l.3266038 28.22830118z"/>
458
+ <path d="m40.1129424 33.5957539h-12.8337733c-1.8690565 0-3.1098112-.7545283-3.9299999-1.6279245v-26.70452764l1.2362264-.00792453c.4584906.72962262 3.0922641 1.39415091 3.0922641 1.39415091h10.1298111s1.0381131.01754717 1.5141509.47377357c.5643396.54056602.7913207 1.36981129.7913207 1.36981129z"/>
459
+ <path d="m17.3354713 33.5957539h-12.8337733v-25.37660316s0-.75283017.49358489-1.14113205c.52867924-.41433961 1.3415094-.42849055 1.3415094-.42849055h10.59905631s2.2075471-.52698112 3.0928301-1.39415091l1.2.00792453v26.74245214c-.8201886.8581132-2.0530188 1.59-3.8932074 1.59"/>
460
+ </g>
461
+ `}get icon(){return this.bookIconSvg}get loader(){return r.JW`
462
+ <svg
463
+ height="100"
464
+ viewBox="0 0 100 100"
465
+ width="100"
466
+ xmlns="http://www.w3.org/2000/svg"
467
+ aria-labelledby="item-loading"
468
+ >
469
+ <title id="item-loading">Currently loading viewer.</title>
470
+ <desc>Please wait while we load theater.</desc>
471
+ <g fill="#333" fill-rule="evenodd" class="book-icon">
472
+ ${this.icon}
473
+ <path
474
+ class="ring"
475
+ d="m17.8618849 11.6970233c18.5864635-15.59603144 45.6875867-15.59603102 64.2740497.000001 1.9271446 1.6170806 2.1785128 4.4902567.5614466 6.4174186-1.6170661 1.9271618-4.4902166 2.1785323-6.4173612.5614517-15.1996922-12.75416882-37.3625282-12.75416916-52.5622206-.000001-15.19969387 12.7541707-19.04823077 34.5805019-9.1273354 51.7641499 9.9208955 17.183646 30.7471499 24.7638499 49.3923323 17.9774983 18.6451823-6.7863521 29.7266014-25.9801026 26.2811129-45.5206248-.436848-2.4775114 1.2174186-4.8400696 3.6949079-5.2769215 2.4774893-.4368518 4.8400264 1.2174296 5.2768744 3.694941 4.2132065 23.8945096-9.3373563 47.3649806-32.137028 55.6634567-22.799672 8.2984758-48.2663986-.9707372-60.39785211-21.9832155-12.1314534-21.012481-7.42539173-47.7021198 11.16107351-63.2981544z"
476
+ fill-rule="nonzero"
477
+ />
478
+ </g>
479
+ </svg>
480
+ `}render(){const e=this.loaderMessage?r.qy`<h2>${this.loaderMessage}</h2>`:r.s6;return r.qy`
481
+ <div class="place-holder">
482
+ ${e} ${this.loader}
483
+ <h3>Loading viewer</h3>
484
+ </div>
485
+ `}static get styles(){return r.AH`
486
+ .place-holder {
487
+ width: 30%;
488
+ margin: auto;
489
+ text-align: center;
490
+ color: var(--primaryTextColor);
491
+ }
492
+
493
+ .place-holder {
494
+ position: relative;
495
+ }
496
+
497
+ .place-holder svg {
498
+ display: block;
499
+ width: 60%;
500
+ max-width: 100px;
501
+ height: auto;
502
+ margin: auto;
503
+ }
504
+
505
+ svg * {
506
+ fill: var(--primaryTextColor);
507
+ }
508
+
509
+ svg .ring {
510
+ animation: rotate 1.3s infinite linear;
511
+ transform-origin: 50px 50px;
512
+ transform-box: fill-box;
513
+ display: block; // transform won't work on inline style
514
+ }
515
+
516
+ @keyframes rotate {
517
+ 0% {
518
+ -moz-transform: rotate(-360deg);
519
+ -webkit-transform: rotate(-360deg);
520
+ transform: rotate(-360deg);
521
+ }
522
+ }
523
+ `}};(0,o.Cg)([(0,i.MZ)({type:String})],oe.prototype,"loaderMessage",void 0),oe=(0,o.Cg)([(0,i.EM)("ia-itemnav-loader")],oe);let ie=class extends r.WF{constructor(){super(...arguments),this.identifier=""}emitLoaded(){this.dispatchEvent(new CustomEvent("loadingStateUpdated",{detail:{loaded:!0}}))}updated(e){e.has("identifier")&&this.emitLoaded()}get downloadUrl(){return`/download/${this.identifier}`}render(){return r.qy`
524
+ <section>
525
+ <h2>THERE IS NO PREVIEW AVAILABLE FOR THIS ITEM</h2>
526
+ <p>
527
+ This item does not appear to have any files that can be experienced on
528
+ Archive.org. <br />
529
+ Please download files in this item to interact with them on your
530
+ computer.
531
+ </p>
532
+ <a href=${this.downloadUrl}>Show all files</a>
533
+ </section>
534
+ `}static get styles(){return r.AH`
535
+ :host {
536
+ color: var(--primaryTextColor, #fff);
537
+ text-align: center;
538
+ }
539
+ section {
540
+ width: 100%;
541
+ margin: 5%;
542
+ padding: 0 5%;
543
+ }
544
+ p {
545
+ font-size: 1.4rem;
546
+ }
547
+ a {
548
+ color: var(--primaryTextColor, #fff);
549
+ background-color: rgb(25, 72, 128);
550
+ min-height: 35px;
551
+ cursor: pointer;
552
+ line-height: normal;
553
+ border-radius: 0.4rem;
554
+ text-align: center;
555
+ vertical-align: middle;
556
+ font-size: 1.4rem;
557
+ font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
558
+ display: inline-block;
559
+ padding: 0.85rem 1.2rem;
560
+ border: 1px solid rgb(197, 209, 223);
561
+ white-space: nowrap;
562
+ appearance: auto;
563
+ box-sizing: border-box;
564
+ user-select: none;
565
+ text-decoration: none;
566
+ }
567
+ `}};(0,o.Cg)([(0,i.MZ)({type:String})],ie.prototype,"identifier",void 0),ie=(0,o.Cg)([(0,i.EM)("ia-no-theater-available")],ie);let ae=class extends r.WF{constructor(){super(...arguments),this.viewAvailable=!0,this.baseHost="archive.org",this.signedIn=!1,this.menuContents=[],this.menuShortcuts=[],this.viewportInFullscreen=null,this.menuOpened=!1,this.loaded=!1,this.openMenuState="shift"}disconnectedCallback(){super.disconnectedCallback(),this.removeResizeObserver()}updated(e){if(e.has("sharedObserver")){const t=e.get("sharedObserver");null==t||t.removeObserver(this.resizeObserverConfig),this.setResizeObserver()}}handleResize(e){const{width:t}=e.contentRect;this.openMenuState=t<=600?"overlay":"shift"}setResizeObserver(){var e,t;null===(e=this.sharedObserver)||void 0===e||e.addObserver(this.resizeObserverConfig),null===(t=this.sharedObserver)||void 0===t||t.addObserver({target:this.headerSlot,handler:{handleResize:({contentRect:e})=>{e.height&&this.requestUpdate()}}})}removeResizeObserver(){var e;null===(e=this.sharedObserver)||void 0===e||e.removeObserver(this.resizeObserverConfig)}get resizeObserverConfig(){return{handler:this,target:this.frame}}get loaderTitle(){return this.viewportInFullscreen?"Internet Archive":""}get loadingArea(){return r.qy`
568
+ <div class="loading-area">
569
+ <div class="loading-view">
570
+ <ia-itemnav-loader
571
+ .loaderMessage=${this.loaderTitle}
572
+ ></ia-itemnav-loader>
573
+ </div>
574
+ </div>
575
+ `}slotChange(e,t){var n;const r=null===(n=e.target.assignedNodes())||void 0===n?void 0:n[0];this.dispatchEvent(new CustomEvent("slotChange",{detail:{slot:r,type:t}})),this.requestUpdate()}render(){var e,t;const n=this.loaded?"":"hidden",o=(null===(t=null===(e=this.headerSlot)||void 0===e?void 0:e.assignedNodes()[0])||void 0===t?void 0:t.offsetHeight)||0;return r.qy`
576
+ <div id="frame" class=${this.menuClass}>
577
+ <slot
578
+ name="header"
579
+ style=${`height: ${o}px`}
580
+ @slotchange=${e=>this.slotChange(e,"header")}
581
+ ></slot>
582
+ <div class="menu-and-reader">
583
+ ${this.shouldRenderMenu?this.renderSideMenu:r.s6}
584
+ <div id="reader" class=${n}>
585
+ ${this.renderViewport}
586
+ </div>
587
+ ${this.loaded?r.s6:this.loadingArea}
588
+ </div>
589
+ </div>
590
+ `}get noTheaterView(){var e,t;return r.qy`<ia-no-theater-available
591
+ .identifier=${null===(t=null===(e=this.item)||void 0===e?void 0:e.metadata)||void 0===t?void 0:t.identifier}
592
+ @loadingStateUpdated=${this.loadingStateUpdated}
593
+ ></ia-no-theater-available>`}get renderViewport(){if(!this.viewAvailable)return this.noTheaterView;const e=this.loaded?"opacity: 1;":"opacity: 0;";return r.qy`
594
+ <div slot="main" style=${e}>
595
+ <slot
596
+ name="main"
597
+ @slotchange=${e=>this.slotChange(e,"main")}
598
+ ></slot>
599
+ </div>
600
+ `}loadingStateUpdated(e){const{loaded:t}=e.detail;this.loaded=null!=t&&t}manageViewportFullscreen(e){const t=!!e.detail.isFullScreen;this.viewportInFullscreen=t||null;const n=new CustomEvent("fullscreenToggled",{detail:e.detail});this.dispatchEvent(n)}get shouldRenderMenu(){var e;return!!(null===(e=this.menuContents)||void 0===e?void 0:e.length)}toggleMenu(e=void 0){this.menuOpened=void 0!==e?e:!this.menuOpened,this.menuOpened?this.updateComplete.then(()=>{var e,t;const n=null===(t=null===(e=this.menuSlider)||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("button.close");null==n||n.focus()}):this.updateComplete.then(()=>{var e;null===(e=this.toggleMenuButton)||void 0===e||e.focus()})}closeMenu(){this.toggleMenu(!1)}setOpenMenu(e){const{id:t}=e.detail;this.openMenu=t!==this.openMenu?t:void 0}setMenuContents(e){const t=[...e.detail];this.menuContents=t}setMenuShortcuts(e){this.menuShortcuts=[...e.detail]}manageSideMenuEvents(e){const{menuId:t,action:n}=e.detail;t&&("open"===n?this.openShortcut(t):"toggle"===n&&(this.openMenu=t,this.toggleMenu()))}get menuToggleButton(){return r.qy`
601
+ <button
602
+ class="toggle-menu"
603
+ @click=${this.toggleMenu}
604
+ title="Open side panel"
605
+ aria-label="Open side panel"
606
+ aria-expanded="false"
607
+ >
608
+ <ia-icon-ellipses aria-hidden="true"></ia-icon-ellipses>
609
+ </button>
610
+ `}get selectedMenuId(){return this.openMenu||""}get renderSideMenu(){return r.qy`
611
+ <nav>
612
+ <div class="minimized ${m({hidden:this.menuOpened})}">
613
+ ${this.shortcuts} ${this.menuToggleButton}
614
+ </div>
615
+ <div id="menu" class=${m({hidden:!this.menuOpened})}>
616
+ <ia-menu-slider
617
+ .menus=${this.menuContents}
618
+ .selectedMenu=${this.selectedMenuId}
619
+ @menuTypeSelected=${this.setOpenMenu}
620
+ @menuSliderClosed=${this.closeMenu}
621
+ manuallyHandleClose
622
+ open
623
+ ></ia-menu-slider>
624
+ </div>
625
+ </nav>
626
+ `}openShortcut(e=""){this.openMenu=e,this.menuOpened=!0}get shortcuts(){const e=this.menuShortcuts.map(({icon:e,id:t,label:n})=>"fullscreen"===t?r.qy`${e}`:r.qy`
627
+ <button
628
+ class="shortcut ${t}"
629
+ @click="${()=>this.openShortcut(t)}"
630
+ title=${n}
631
+ aria-label=${n}
632
+ aria-expanded="false"
633
+ >
634
+ ${e}
635
+ </button>
636
+ `);return r.qy`<div class="shortcuts">${e}</div>`}get menuClass(){var e,t;const n=(null===(e=this.menuContents)||void 0===e?void 0:e.length)||(null===(t=this.menuShortcuts)||void 0===t?void 0:t.length);return`${this.menuOpened&&n?"open":""} ${this.viewportInFullscreen?"fullscreen":""} ${this.openMenuState}`}static get styles(){const e=r.AH`var(--menuWidth, 320px)`,t=r.AH`var(--animationTiming, 200ms)`,n=r.AH`transform ${t} ease-out`,o=r.AH`var(--theaterMenuMargin, 42px)`,i=r.AH`var(--theaterBgColor, #000)`;return r.AH`
637
+ :host,
638
+ #frame,
639
+ .menu-and-reader {
640
+ position: relative;
641
+ overflow: hidden;
642
+ display: block;
643
+ }
644
+
645
+ :host,
646
+ #frame,
647
+ .loading-area,
648
+ .loading-view {
649
+ min-height: inherit;
650
+ height: inherit;
651
+ }
652
+
653
+ slot {
654
+ display: block;
655
+ width: 100%;
656
+ }
657
+
658
+ slot * {
659
+ display: block;
660
+ height: inherit;
661
+ }
662
+
663
+ #frame {
664
+ background-color: ${i};
665
+ color-scheme: dark;
666
+ display: flex;
667
+ flex-direction: column;
668
+ }
669
+
670
+ #frame.fullscreen {
671
+ position: fixed;
672
+ top: 0;
673
+ bottom: 0;
674
+ left: 0;
675
+ right: 0;
676
+ z-index: 9;
677
+ }
678
+
679
+ .loading-view {
680
+ height: 100%;
681
+ display: flex;
682
+ align-items: center;
683
+ justify-content: center;
684
+ }
685
+
686
+ .loading-area {
687
+ width: 100%;
688
+ }
689
+
690
+ ia-itemnav-loader {
691
+ display: block;
692
+ width: 100%;
693
+ }
694
+
695
+ .hidden {
696
+ display: none !important;
697
+ }
698
+
699
+ button {
700
+ cursor: pointer;
701
+ padding: 0;
702
+ border: 0;
703
+ }
704
+
705
+ .menu-and-reader {
706
+ position: relative;
707
+ display: flex;
708
+ flex: 1;
709
+ }
710
+
711
+ nav button {
712
+ background: none;
713
+ }
714
+
715
+ nav .minimized {
716
+ background: rgba(0, 0, 0, 0.7);
717
+ padding-top: 6px;
718
+ position: absolute;
719
+ width: ${o};
720
+ z-index: 2;
721
+ left: 0;
722
+ border-bottom-right-radius: 5%;
723
+ }
724
+
725
+ nav .minimized button {
726
+ width: var(--iconWidth);
727
+ height: var(--iconHeight);
728
+ margin-bottom: 0.2rem;
729
+ margin: auto;
730
+ display: inline-flex;
731
+ vertical-align: middle;
732
+ -webkit-box-align: center;
733
+ align-items: center;
734
+ -webkit-box-pack: center;
735
+ justify-content: center;
736
+ width: ${o};
737
+ height: ${o};
738
+ }
739
+
740
+ nav .minimized button > * {
741
+ /** Prevent the icon's SVG description from stealing tooltip message */
742
+ pointer-events: none;
743
+ }
744
+
745
+ nav .minimized button.toggle-menu > * {
746
+ border: 2px solid var(--iconStrokeColor);
747
+ border-radius: var(--iconWidth);
748
+ width: var(--iconWidth);
749
+ height: var(--iconHeight);
750
+ margin: auto;
751
+ }
752
+
753
+ ia-icon-ellipses {
754
+ width: var(--iconWidth);
755
+ height: var(--iconHeight);
756
+ }
757
+
758
+ #menu {
759
+ position: absolute;
760
+ top: 0;
761
+ bottom: 0;
762
+ left: 0;
763
+ z-index: 3;
764
+ overflow: hidden;
765
+ transform: translateX(-${e});
766
+ width: ${e};
767
+ transform: translateX(calc(${e} * -1));
768
+ transition: ${n};
769
+ }
770
+
771
+ #reader {
772
+ position: relative;
773
+ z-index: 1;
774
+ transform: translateX(0);
775
+ width: 100%;
776
+ display: flex;
777
+ }
778
+
779
+ #reader > * {
780
+ width: 100%;
781
+ display: flex;
782
+ flex: 1;
783
+ }
784
+
785
+ .open.overlay #reader {
786
+ transition: none;
787
+ }
788
+
789
+ .open #menu {
790
+ width: ${e};
791
+ transform: translateX(0);
792
+ transition: ${n};
793
+ }
794
+
795
+ .open.shift #reader {
796
+ width: calc(100% - ${e});
797
+ margin-left: ${e};
798
+ transition: ${n};
799
+ }
800
+ `}};(0,o.Cg)([(0,i.MZ)({type:Object,converter:e=>e&&"string"==typeof e?new F(JSON.parse(atob(e))):e})],ae.prototype,"item",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],ae.prototype,"viewAvailable",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],ae.prototype,"baseHost",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],ae.prototype,"signedIn",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],ae.prototype,"menuContents",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],ae.prototype,"menuShortcuts",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0,attribute:!0})],ae.prototype,"viewportInFullscreen",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],ae.prototype,"menuOpened",void 0),(0,o.Cg)([(0,i.MZ)({type:String,reflect:!0})],ae.prototype,"openMenu",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],ae.prototype,"modal",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],ae.prototype,"sharedObserver",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0,attribute:!0})],ae.prototype,"loaded",void 0),(0,o.Cg)([(0,i.wk)()],ae.prototype,"openMenuState",void 0),(0,o.Cg)([(0,i.P)("#frame")],ae.prototype,"frame",void 0),(0,o.Cg)([(0,i.P)('slot[name="header"]')],ae.prototype,"headerSlot",void 0),(0,o.Cg)([(0,i.P)('slot[name="main"]')],ae.prototype,"mainSlot",void 0),(0,o.Cg)([(0,i.P)("ia-menu-slider")],ae.prototype,"menuSlider",void 0),(0,o.Cg)([(0,i.P)("button.toggle-menu")],ae.prototype,"toggleMenuButton",void 0),ae=(0,o.Cg)([(0,i.EM)("iaux-item-navigator")],ae);var se=r.qy`
801
+ <svg
802
+ viewBox="0 0 100 100"
803
+ xmlns="http://www.w3.org/2000/svg"
804
+ aria-labelledby="shareTitleID shareDescID"
805
+ >
806
+ <title id="shareTitleID">Share icon</title>
807
+ <desc id="shareDescID">A square with an arrow arcing out from the center of the square</desc>
808
+ <g class="fill-color">
809
+ <path d="M70.6784759,10 L70.6784759,21.3240186 C64.5020053,21.66334 58.9104278,22.5826126 53.9037433,24.0818363 C48.8970588,25.5810601 44.8495989,27.4085163 41.7613636,29.5642049 C38.6731283,31.7198935 35.9982175,34.0552229 33.736631,36.5701929 C31.4750446,39.085163 29.8217469,41.5657574 28.776738,44.011976 C27.7317291,46.4581947 26.9173351,48.6848525 26.3335561,50.6919494 C25.7497772,52.6990464 25.4088681,54.3324462 25.3108289,55.592149 L25.2372995,57.4085163 C29.0296346,54.1661122 33.1751337,51.5524507 37.6737968,49.5675316 C42.1724599,47.5826126 46.2934492,46.3118208 50.0367647,45.7551564 C53.7800802,45.1984919 57.2571301,44.8713684 60.4679144,44.7737858 C63.6786988,44.6762031 66.1831551,44.7726769 67.9812834,45.0632069 L70.6784759,45.499002 L70.6784759,57.4051896 L100,33.3765802 L70.6784759,10 Z M76.4438503,62.4883566 L82.8609626,57.1157685 C82.9099822,57.0669772 82.9946524,57.0303837 83.1149733,57.005988 C83.2352941,56.9815924 83.4536542,56.9571967 83.7700535,56.9328011 C84.0864528,56.9084054 84.3905971,56.9449989 84.6824866,57.0425815 C84.9743761,57.1401641 85.217246,57.2854291 85.4110963,57.4783766 C85.6049465,57.671324 85.7263815,57.8409847 85.7754011,57.9873586 L85.8489305,58.2035928 L85.8489305,90 L0,90 L0,17.910845 L43.1784759,17.910845 C43.2765152,17.9596363 43.410205,18.0317143 43.5795455,18.1270792 C43.7488859,18.222444 43.9438503,18.4519849 44.1644385,18.8157019 C44.3850267,19.1794189 44.469697,19.5542249 44.4184492,19.9401198 C44.4184492,20.2794411 44.3092692,20.582169 44.0909091,20.8483034 C43.872549,21.1144378 43.6664439,21.3206919 43.4725936,21.4670659 L43.1818182,21.6134398 C40.557041,23.06609 38.2954545,24.396762 36.3970588,25.6054558 L30.7820856,29.8170326 L11.5274064,29.8170326 L11.5274064,78.1669993 L74.1811497,78.1669993 L74.1811497,65.5355955 C74.1811497,65.1009093 74.3995098,64.6407186 74.8362299,64.1550233 L76.4438503,62.4883566 Z" id="Shape"></path>
810
+ </g>
811
+ </svg>
812
+ `;class le extends r.WF{static get styles(){return r.AH`
813
+ :host {
814
+ width: var(--iconWidth, 'auto');
815
+ height: var(--iconHeight, 'auto');
816
+ }
817
+
818
+ .fill-color {
819
+ fill: var(--iconFillColor);
820
+ }
821
+
822
+ .stroke-color {
823
+ stroke: var(--iconStrokeColor);
824
+ }
825
+ `}render(){return se}}customElements.define("ia-icon-share",le);var ce=r.qy`
826
+ <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="twitterTitleID twitterDescID">
827
+ <title id="twitterTitleID">Twitter icon</title>
828
+ <desc id="twitterDescID">The Twitter logo, a cartoon bird</desc>
829
+ <path d="m31.5297453 8.76273313c-.3135031.40766104-.7447036.83083673-1.2936015 1.26952707-.5488979.4386904-.9169698.7837578-1.1042157 1.0352022.1562166 2.319709-.1417719 4.5297454-.8939653 6.6301092-.7521935 2.1003638-1.8023754 3.9182538-3.1505457 5.45367-1.3481704 1.5354162-2.9627648 2.8284828-4.8437835 3.8791996-1.8810186 1.0507169-3.8321207 1.7483416-5.8533062 2.092874s-4.1215493.2894286-6.30109136-.1653114c-2.17954205-.45474-4.2092874-1.3401455-6.08923604-2.6562165 2.72737.4697196 5.67408517-.2514445 8.8401455-2.1634924-3.0719024-.7521935-4.88979241-2.2881447-5.45367-4.6078537 1.12882516.0631287 1.86550396.0631287 2.21003638 0-2.91568586-1.2850417-4.38904344-3.3693558-4.42007276-6.2529424.21934517.0310293.53284828.1487267.94050931.3530922s.78375775.3060133 1.12829017.3049433c-.81532206-.7211641-1.41076396-1.9045581-1.7863257-3.5501819-.37556173-1.64562376-.17173122-3.17355015.61149155-4.58377912 1.81789001 1.88101862 3.6908838 3.36989086 5.61898138 4.46661672 1.92809757 1.0967259 4.22426707 1.7547614 6.88850847 1.9741066-.2503745-1.1908838-.1722662-2.32719882.2343248-3.40894502.4065911-1.0817462 1.0416221-1.93612241 1.9050931-2.56312861.863471-.62700621 1.8114702-1.0817462 2.8439975-1.36421999 1.0325272-.28247378 2.0827091-.27444896 3.1505456.02407447s1.9767815.87042585 2.726835 1.71570726c1.3791997-.37663172 2.6802911-.87845068 3.9032742-1.50545688-.0310293.37663171-.1407019.74470361-.3290178 1.1042157-.1883158.35951209-.3530922.62593623-.4943291.79927242s-.3841216.4317355-.728654.77519795c-.3445324.34346244-.5638776.57832227-.6580355.70457949.2193452-.09415792.6895998-.23539482 1.410764-.42371067.7211641-.18831586 1.2069334-.39214638 1.4573079-.61149155 0 .44350524-.1567516.86668093-.4702547 1.27434196z" class="fill-color" />
830
+ </svg>
831
+ `;class ue extends r.WF{static get styles(){return r.AH`
832
+ :host {
833
+ width: var(--iconWidth, 'auto');
834
+ height: var(--iconHeight, 'auto');
835
+ }
836
+
837
+ .fill-color {
838
+ fill: var(--iconFillColor);
839
+ }
840
+
841
+ .stroke-color {
842
+ stroke: var(--iconStrokeColor);
843
+ }
844
+ `}render(){return ce}}customElements.define("ia-icon-twitter",ue);var de=r.qy`
845
+ <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="facebookTitleID facebookDescID">
846
+ <title id="facebookTitleID">Facebook icon</title>
847
+ <desc id="facebookDescID">A lowercase f</desc>
848
+ <path d="m30.91057 19.2442068.2670004-5.3339402h-5.7329237c-.0890001-3.4962895.25183-5.42243459 1.0224903-5.77843514.3560005-.17800028.8004955-.28925046 1.333485-.33375053s1.0442346-.0520853 1.5337353-.02275571c.4895008.02932959 1.045246.01466479 1.6672356-.04399439.0890001-1.59997977.1335002-3.24445961.1335002-4.93343953-2.1633102-.20732987-3.6742898-.28115953-4.5329389-.22148898-2.8146294.17800028-4.7847688 1.25965538-5.9104183 3.2449653-.1780003.3256596-.3261653.68873971-.444495 1.08924034-.1183298.40050062-.2144095.76358074-.2882391 1.08924034-.0738297.32565959-.125915.7848194-.1562559 1.37747942-.030341.59266002-.052591 1.04474028-.0667501 1.35624078-.0141592.3115005-.0217444.8449956-.0227558 1.6004854v1.5777298h-3.8229605v5.3339401h3.8669549v14.622824h5.8224296c0-.3560006-.0146648-1.6819003-.0439944-3.9776994-.0293296-2.295799-.0515796-4.2957737-.0667501-5.9999241s-.0075853-3.2525506.0227557-4.6452005h5.4219289z" class="fill-color" />
849
+ </svg>
850
+ `;class he extends r.WF{static get styles(){return r.AH`
851
+ :host {
852
+ width: var(--iconWidth, 'auto');
853
+ height: var(--iconHeight, 'auto');
854
+ }
855
+
856
+ .fill-color {
857
+ fill: var(--iconFillColor);
858
+ }
859
+
860
+ .stroke-color {
861
+ stroke: var(--iconStrokeColor);
862
+ }
863
+ `}render(){return de}}customElements.define("ia-icon-facebook",he);var pe=r.qy`
864
+ <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="tumblrTitleID tumblrDescID">
865
+ <title id="tumblrTitleID">Tumblr icon</title>
866
+ <desc id="tumblrDescID">A lowercase letter t</desc>
867
+ <path d="m8.50321407 8.54544475v5.32088575c.15641786.0310693.6819176.0310693 1.57649923 0 .8945816-.0310693 1.3574071.0160703 1.3884764.1414189.0942792 1.5695354.1333837 3.2253149.1173133 4.9673385-.0160703 1.7420236-.0316049 3.3426283-.0466039 4.8018141s.2046288 2.824628.6588835 4.0963267c.4542546 1.2716986 1.1999178 2.2209194 2.2369897 2.8476622 1.2556283.784232 2.9896167 1.207953 5.2019653 1.271163 2.2123485.0632099 4.1659648-.2506972 5.8608487-.9417213-.0310693-.3449764-.0230341-1.4045467.0241055-3.1787109.0471397-1.7741643-.0080351-2.75499-.1655244-2.9424772-3.5472571 1.0360005-5.697467.6904885-6.4506298-1.0365361-.7220934-1.6638147-.8635123-4.9909084-.4242566-9.981281v-.046604h6.7318605v-5.32088568h-6.7318605v-6.54383772h-4.0497228c-.2828378 1.28669763-.6122795 2.35376743-.9883252 3.20120941-.3760457.84744199-.98029 1.60060471-1.812733 2.25948817-.832443.65888347-1.87594303 1.01993018-3.1305 1.08314014z" class="fill-color" />
868
+ </svg>
869
+ `;class fe extends r.WF{static get styles(){return r.AH`
870
+ :host {
871
+ width: var(--iconWidth, 'auto');
872
+ height: var(--iconHeight, 'auto');
873
+ }
874
+
875
+ .fill-color {
876
+ fill: var(--iconFillColor);
877
+ }
878
+
879
+ .stroke-color {
880
+ stroke: var(--iconStrokeColor);
881
+ }
882
+ `}render(){return pe}}customElements.define("ia-icon-tumblr",fe);var me=r.qy`
883
+ <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="pinterestTitleID pinterestDescID">
884
+ <title id="pinterestTitleID">Pinterest icon</title>
885
+ <desc id="pinterestDescID">A stylized letter p</desc>
886
+ <path d="m11.9051049 30.5873434.653491-1.0742755.4207845-.839975c.2805229-.591861.5371377-1.2533214.7698443-1.9843813.2327065-.7310599.4659444-1.6029125.6997135-2.6155579.2337692-1.0126455.4128151-1.752206.5371377-2.2186817.0308151.030815.0775689.0855382.1402615.1641697.0626927.0786314.1094465.1333547.1402615.1641697.1243227.1870153.2178304.311338.280523.372968 1.1210293.964829 2.3817888 1.4631823 3.7822785 1.4950599 1.4939973 0 2.8790795-.3426843 4.1552465-1.0280529 2.1166733-1.1826593 3.6733633-3.1128487 4.6700699-5.7905679.4048457-1.1518444.6848374-2.5996192.8399751-4.3433245.1243226-1.587505-.0781002-3.0974411-.6072685-4.5298084-.903199-2.36638128-2.5528653-4.20306294-4.948999-5.51004497-1.276167-.65349101-2.5990879-1.05833667-3.9687625-1.21453696-1.525875-.21783034-3.1293188-.17107651-4.8103315.14026149-2.7701643.52916833-5.02709913 1.743174-6.77080442 3.64201699-1.99235065 2.14748836-2.98852598 4.62225355-2.98852598 7.42429545 0 2.9571797.9494215 5.0584455 2.84826449 6.3037975l.83997504.4207845c.12432268 0 .22526845.0154075.3028373.0462225s.1551377.0074381.23270656-.0701308c.07756885-.0775688.13229208-.1243226.16416969-.1402614s.07066204-.0860696.11635328-.2103923c.04569124-.1243226.07703756-.2098609.09403895-.2566147.01700139-.0467539.04834771-.1476996.09403895-.3028373s.06906816-.2486454.07013074-.280523l.14026149-.5132295c.06269263-.311338.09403895-.5291684.09403895-.653491-.03081502-.1243227-.12432268-.2799917-.28052297-.467007-.15620029-.1870154-.23376915-.2959305-.23270656-.3267455-.62267599-.8096914-.9494215-1.7904592-.98023652-2.9423035-.03081502-1.55669.28052297-2.9731185.93401399-4.24928547 1.18265932-2.45882635 3.17501002-3.93741618 5.97705192-4.43576949 1.6183201-.311338 3.1356943-.25661476 4.5521228.16416969 1.4164285.42078446 2.5135496 1.09765239 3.2913633 2.03060379.8405063 1.02752164 1.3229208 2.28828114 1.4472435 3.78227848.1243227 1.4004897-.0313463 2.9725872-.467007 4.7162925-.3740306 1.3696746-.9186065 2.5528653-1.6337275 3.5495719-.9967066 1.245352-2.0863896 1.8834355-3.269049 1.9142505-1.7118277.0626926-2.7547568-.6375522-3.1287874-2.1007345-.0935077-.4664757 0-1.2134744.2805229-2.240996.7469987-2.5842117 1.1359055-3.9384788 1.1667206-4.0628015.1870153-1.0275216.2024228-1.7904591.0462225-2.2888124-.1870153-.65349104-.5759222-1.15928246-1.1667205-1.51737429-.5907984-.35809182-1.2756357-.39687625-2.054512-.11635327-1.1826594.43566067-1.9610044 1.40048968-2.335035 2.89448706-.311338 1.306982-.2491767 2.6299028.186484 3.9687625 0 .0626926.0313463.1402615.094039.2327065.0626926.0924451.0940389.1700139.0940389.2327066 0 .0935076-.0313463.2491766-.0940389.467007-.0626927.2178303-.094039.3580918-.094039.4207844-.0935076.4356607-.3038999 1.3308903-.6311767 2.6856887-.3272768 1.3547985-.5838915 2.3897582-.7698443 3.1048793-.7778136 3.2068876-1.12049796 5.5881451-1.02805289 7.1437725l.37296809 2.7558194c.653491-.591861 1.2294131-1.2299445 1.7277664-1.9142505z" class="fill-color" />
887
+ </svg>
888
+ `;class ve extends r.WF{static get styles(){return r.AH`
889
+ :host {
890
+ width: var(--iconWidth, 'auto');
891
+ height: var(--iconHeight, 'auto');
892
+ }
893
+
894
+ .fill-color {
895
+ fill: var(--iconFillColor);
896
+ }
897
+
898
+ .stroke-color {
899
+ stroke: var(--iconStrokeColor);
900
+ }
901
+ `}render(){return me}}customElements.define("ia-icon-pinterest",ve);var be=r.qy`
902
+ <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="emailTitleID emailDescID">
903
+ <title id="emailTitleID">Email icon</title>
904
+ <desc id="emailDescID">An illustration of an envelope</desc>
905
+ <path d="m32 7.04156803v19.91686397c0 .5752421-.4763773 1.041568-1.0640184 1.041568h-27.87196316c-.58764116 0-1.06401844-.4663259-1.06401844-1.041568v-19.91686397c0-.57524214.47637728-1.04156803 1.06401844-1.04156803h27.87196316c.5876411 0 1.0640184.46632589 1.0640184 1.04156803zm-26.25039901 1.19676167 10.04327011 10.1323738c.5135662.4194048.8817166.6291071 1.1044511.6291071.1198794 0 .2695514-.0503424.4490158-.1510273.1794644-.100685.3291364-.2013699.4490158-.3020548l.1798191-.1510273 10.1198794-10.15841306zm16.77212271 9.7303286 6.8831353 6.7889404v-13.5778809zm-17.92871075-6.6379131v13.350819l6.78098955-6.6629107zm22.09008685 14.2059464-5.9074304-5.8588202-.9757049.9551179-.3594018.3295984c-.0342324.0304241-.0665646.0587822-.0969964.0850743l-.1597867.1329606c-.0684912.0540844-.1198794.0895749-.1541644.1064714-.6674943.3687151-1.3523675.5530727-2.0546196.5530727-.65047 0-1.3782586-.218035-2.1833659-.6541048l-.6682036-.4520405-1.0278418-1.0311524-5.95850326 5.832781z" class="fill-color" />
906
+ </svg>
907
+ `;class ye extends r.WF{static get styles(){return r.AH`
908
+ :host {
909
+ width: var(--iconWidth, 'auto');
910
+ height: var(--iconHeight, 'auto');
911
+ }
912
+
913
+ .fill-color {
914
+ fill: var(--iconFillColor);
915
+ }
916
+
917
+ .stroke-color {
918
+ stroke: var(--iconStrokeColor);
919
+ }
920
+ `}render(){return be}}customElements.define("ia-icon-email",ye);var ge=r.qy`
921
+ <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="linkTitleID linkDescID">
922
+ <title id="linkTitleID">Link icon</title>
923
+ <desc id="linkDescID">Two chain links linked together</desc>
924
+ <path d="m7.80511706 12.3659763c1.2669254-2.2579539 4.09819784-2.9949938 6.41200864-1.7733458l.2295791.12871 1.6067188.9559859 3.5467013-6.31849361c1.2682451-2.26030597 4.104098-2.99652769 6.4192376-1.76952182l.2223501.12488594 3.2168204 1.91103915c2.2770002 1.3527136 3.1866331 4.21502324 2.0564431 6.51290984l-.1198433.2278304-5.2002499 9.2680474c-1.2669254 2.2579539-4.0981978 2.9949938-6.4120086 1.7733458l-.2295791-.12871-1.6096554-.9558482-3.5437647 6.3183559c-1.2682451 2.260306-4.104098 2.9965277-6.41923761 1.7695218l-.22235013-.1248859-3.21682032-1.9110392c-2.27700024-1.3527136-3.18663314-4.2150232-2.05644312-6.5129098l.11984332-.2278304zm13.93955474-5.73311741-3.563271 6.35055051c1.889633 1.4530595 2.5776248 4.0429866 1.5410255 6.156875l-.1223014.2328355-.4183304.7430134 1.6096554.9558483c1.1431442.6791157 2.5155496.3977368 3.1667361-.5628389l.0921501-.1491451 5.2002498-9.2680474c.5752467-1.0252226.2110342-2.4011579-.8559335-3.14755806l-.1742742-.11247814-3.2168203-1.91103915c-1.1402863-.67741793-2.5086889-.39913772-3.1618387.55564729zm-11.79500786 7.00714351-5.20024982 9.2680474c-.57524673 1.0252226-.21103426 2.4011579.85593348 3.1475581l.17427416.1124781 3.21682032 1.9110392c1.14028632.6774179 2.50868892.3991377 3.16183872-.5556473l.0970474-.1563368 3.5622708-6.3513198c-1.8888875-1.4532134-2.5764504-4.042623-1.5400057-6.1561456l.1222818-.2327956.4153938-.7428758-1.6067188-.9559859c-1.1431442-.6791157-2.5155496-.3977368-3.1667361.5628389zm6.97653866 1.5796652-.3817806.6812386c-.5117123.9119895-.2800268 2.1014993.528439 2.8785267l.382717-.6803391c.5119098-.9123415.2798478-2.1024176-.5293754-2.8794262z" class="fill-color" />
925
+ </svg>
926
+ `;class ke extends r.WF{static get styles(){return r.AH`
927
+ :host {
928
+ width: var(--iconWidth, 'auto');
929
+ height: var(--iconHeight, 'auto');
930
+ }
931
+
932
+ .fill-color {
933
+ fill: var(--iconFillColor);
934
+ }
935
+
936
+ .stroke-color {
937
+ stroke: var(--iconStrokeColor);
938
+ }
939
+ `}render(){return ge}}customElements.define("ia-icon-link",ke);const we=e=>{const t=e.currentTarget,n=t.querySelector("textarea"),r=t.querySelector("small");n.select(),document.execCommand("copy"),n.blur(),r.classList.add("visible"),clearTimeout(r.timeout),r.timeout=setTimeout(()=>r.classList.remove("visible"),4e3)},Ce=r.qy`<ia-icon-share
940
+ style="width: var(--iconWidth); height: var(--iconHeight);"
941
+ ></ia-icon-share>`;let xe=class extends r.WF{constructor(){super(...arguments),this.baseHost="archive.org",this.creator="",this.description="",this.embedOptionsVisible=!1,this.identifier="",this.sharingOptions=[],this.type="",this.renderHeader=!1,this.fileSubPrefix=""}updated(e){e.has("sharingOptions")&&!this.sharingOptions.length&&this.loadProviders()}loadProviders(){let e=`https://${this.baseHost}/details/${this.identifier}`;this.fileSubPrefix&&(e+=`/${this.fileSubPrefix}`);const t=[this.description,this.creator,"Free Download, Borrow, and Streaming","Internet Archive"].filter(Boolean).join(" : ");this.sharingOptions=[{name:"Twitter",icon:r.qy`<ia-icon-twitter aria-hidden="true"></ia-icon-twitter>`,url:`https://twitter.com/intent/tweet?${new URLSearchParams({url:e,text:t,via:"internetarchive"})}`},{name:"Facebook",icon:r.qy`<ia-icon-facebook aria-hidden="true"></ia-icon-facebook>`,url:`https://www.facebook.com/sharer/sharer.php?${new URLSearchParams({u:e})}`},{name:"Tumblr",icon:r.qy`<ia-icon-tumblr aria-hidden="true"></ia-icon-tumblr>`,url:`https://www.tumblr.com/widgets/share/tool/preview?${new URLSearchParams({posttype:"link",canonicalUrl:e,title:t})}`},{name:"Pinterest",icon:r.qy`<ia-icon-pinterest aria-hidden="true"></ia-icon-pinterest>`,url:`http://www.pinterest.com/pin/create/button/?${new URLSearchParams({url:e,description:t})}`},{name:"Email",icon:r.qy`<ia-icon-email aria-hidden="true"></ia-icon-email>`,url:`mailto:?${new URLSearchParams({subject:t,body:e})}`}]}get iframeEmbed(){return`<iframe\n src="https://${this.baseHost}/embed/${this.identifier}"\n width="560" height="384" frameborder="0"\n webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen\n ></iframe>`}get bbcodeEmbed(){return`[archiveorg ${this.identifier} width=560 height=384 frameborder=0 webkitallowfullscreen=true mozallowfullscreen=true]`}get helpURL(){return`https://${this.baseHost}/help/audio.php?identifier=${this.identifier}`}get header(){const e=r.qy`<header><h3>Share this ${this.type}</h3></header>`;return this.renderHeader?e:r.s6}render(){return r.qy`
942
+ ${this.header}
943
+ <div>
944
+ ${this.sharingOptions.map(e=>r.qy` <a class="share-option" href="${e.url}" target="_blank">
945
+ ${e.icon} ${e.name}
946
+ </a>`)}
947
+ <details>
948
+ <summary class="share-option">
949
+ <ia-icon-link aria-hidden="true"></ia-icon-link>
950
+ Get an embeddable link
951
+ </summary>
952
+ <div class="embed">
953
+ <h4>Embed</h4>
954
+ <div class="code" @click=${we}>
955
+ <textarea readonly>${this.iframeEmbed}</textarea>
956
+ <small>Copied to clipboard</small>
957
+ </div>
958
+ <h4>
959
+ Embed for wordpress.com hosted blogs and archive.org item
960
+ &lt;description&gt; tags
961
+ </h4>
962
+ <div class="code" @click=${we}>
963
+ <textarea readonly>${this.bbcodeEmbed}</textarea>
964
+ <small>Copied to clipboard</small>
965
+ </div>
966
+ <p>
967
+ Want more?
968
+ <a href=${this.helpURL}
969
+ >Advanced embedding details, examples, and help</a
970
+ >!
971
+ </p>
972
+ </div>
973
+ </details>
974
+ </div>
975
+ `}get providerIcon(){return r.qy`<ia-icon-share
976
+ style="width: var(--iconWidth); height: var(--iconHeight);"
977
+ ></ia-icon-share>`}static get styles(){return r.AH`
978
+ :host {
979
+ display: block;
980
+ height: 100%;
981
+ overflow-y: auto;
982
+ font-size: 1.4rem;
983
+ box-sizing: border-box;
984
+ }
985
+
986
+ header {
987
+ display: flex;
988
+ align-items: baseline;
989
+ }
990
+
991
+ h3 {
992
+ padding: 0;
993
+ margin: 0 1rem 0 0;
994
+ font-size: 1.6rem;
995
+ }
996
+
997
+ h4 {
998
+ font-size: 1.4rem;
999
+ }
1000
+
1001
+ :host > div {
1002
+ padding: 1rem 0;
1003
+ }
1004
+
1005
+ .share-option {
1006
+ display: block;
1007
+ padding: 0.5rem 0;
1008
+ font-size: 1.6rem;
1009
+ text-decoration: none;
1010
+ color: var(--shareLinkColor);
1011
+ cursor: pointer;
1012
+ transition: background-color 0.2s;
1013
+ border-radius: 6px;
1014
+ }
1015
+
1016
+ .share-option:hover {
1017
+ background-color: rgba(255, 255, 255, 0.05);
1018
+ }
1019
+
1020
+ .share-option > * {
1021
+ display: inline-block;
1022
+ padding: 0.2rem;
1023
+ margin-right: 1rem;
1024
+ vertical-align: middle;
1025
+ border: 1px solid var(--shareIconBorder);
1026
+ border-radius: 7px;
1027
+ background: var(--shareIconBg);
1028
+ }
1029
+
1030
+ /* Hide the triangle that appears on details tags */
1031
+ summary::marker {
1032
+ content: '';
1033
+ }
1034
+
1035
+ summary::-webkit-details-marker {
1036
+ display: none;
1037
+ }
1038
+
1039
+ .embed {
1040
+ padding-right: 5px;
1041
+ }
1042
+
1043
+ .embed a {
1044
+ color: var(--shareLinkColor);
1045
+ }
1046
+
1047
+ .code {
1048
+ position: relative;
1049
+ }
1050
+
1051
+ textarea {
1052
+ display: block;
1053
+ width: 100%;
1054
+ height: 120px;
1055
+ padding: 0.8rem 1rem;
1056
+ box-sizing: border-box;
1057
+ resize: none;
1058
+ cursor: pointer;
1059
+ font:
1060
+ normal 1.4rem 'Helvetica Neue',
1061
+ Helvetica,
1062
+ Arial,
1063
+ sans-serif;
1064
+ color: var(--textareaColor, #fff);
1065
+ background: var(--textareaBg, #151515);
1066
+ }
1067
+
1068
+ small {
1069
+ position: absolute;
1070
+ bottom: 0;
1071
+ left: 0;
1072
+ height: 3rem;
1073
+ padding: 0.5rem 1rem;
1074
+ box-sizing: border-box;
1075
+ font:
1076
+ normal 1.2rem/2rem 'Helvetica Neue',
1077
+ Helvetica,
1078
+ Arial,
1079
+ sans-serif;
1080
+ color: var(--textareaBg, #151515);
1081
+ background: var(--textareaColor, #fff);
1082
+ opacity: 0;
1083
+ transition: opacity 300ms linear;
1084
+ }
1085
+ small.visible {
1086
+ opacity: 1;
1087
+ }
1088
+ `}};(0,o.Cg)([(0,i.MZ)({type:String})],xe.prototype,"baseHost",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],xe.prototype,"creator",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],xe.prototype,"description",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],xe.prototype,"embedOptionsVisible",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],xe.prototype,"identifier",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],xe.prototype,"sharingOptions",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],xe.prototype,"type",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],xe.prototype,"renderHeader",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],xe.prototype,"fileSubPrefix",void 0),xe=(0,o.Cg)([(0,i.EM)("iaux-in-share-panel")],xe),n(6033);var Se=a.ge.I,Oe=function(){return document.createComment("")},Me=function(e,t,n){var r,o=e._$AA.parentNode,i=void 0===t?e._$AB:t._$AA;if(void 0===n){var a=o.insertBefore(Oe(),i),s=o.insertBefore(Oe(),i);n=new Se(a,s,e,e.options)}else{var l,c=n._$AB.nextSibling,u=n._$AM,d=u!==e;if(d&&(null===(r=n._$AQ)||void 0===r||r.call(n,e),n._$AM=e,void 0!==n._$AP&&(l=e._$AU)!==u._$AU&&n._$AP(l)),c!==i||d)for(var h=n._$AA;h!==c;){var p=h.nextSibling;o.insertBefore(h,i),h=p}}return n},Be=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return e._$AI(t,n),e},je={},Pe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:je;return e._$AH=t},Ee=function(e){var t;null===(t=e._$AP)||void 0===t||t.call(e,!1,!0);for(var n=e._$AA,r=e._$AB.nextSibling;n!==r;){var o=n.nextSibling;n.remove(),n=o}};function Le(e){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Le(e)}function Ae(e,t){if(e){if("string"==typeof e)return _e(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_e(e,t):void 0}}function _e(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ze(r.key),r)}}function ze(e){var t=function(e){if("object"!=Le(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Le(t)?t:t+""}function Ie(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ie=function(){return!!e})()}function $e(e){return $e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$e(e)}function He(e,t){return He=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},He(e,t)}var De=function(e,t,n){for(var r=new Map,o=t;o<=n;o++)r.set(e[o],o);return r},qe=(0,s.u$)(function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t,n){return t=$e(t),function(e,t){if(t&&("object"==Le(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ie()?Reflect.construct(t,n||[],$e(e).constructor):t.apply(e,n))}(this,t,[e]),e.type!==s.OA.CHILD)throw Error("repeat() can only be used in text expressions");return n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&He(e,t)}(t,e),function(e,t){return t&&Te(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"ct",value:function(e,t,n){var r;void 0===n?n=t:void 0!==t&&(r=t);var o,i=[],a=[],s=0,l=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ae(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw o}}}}(e);try{for(l.s();!(o=l.n()).done;){var c=o.value;i[s]=r?r(c,s):s,a[s]=n(c,s),s++}}catch(e){l.e(e)}finally{l.f()}return{values:a,keys:i}}},{key:"render",value:function(e,t,n){return this.ct(e,t,n).values}},{key:"update",value:function(e,t){var n,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||Ae(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,3),o=r[0],i=r[1],s=r[2],l=function(e){return e._$AH}(e),c=this.ct(o,i,s),u=c.values,d=c.keys;if(!Array.isArray(l))return this.ut=d,u;for(var h,p,f=null!==(n=this.ut)&&void 0!==n?n:this.ut=[],m=[],v=0,b=l.length-1,y=0,g=u.length-1;v<=b&&y<=g;)if(null===l[v])v++;else if(null===l[b])b--;else if(f[v]===d[y])m[y]=Be(l[v],u[y]),v++,y++;else if(f[b]===d[g])m[g]=Be(l[b],u[g]),b--,g--;else if(f[v]===d[g])m[g]=Be(l[v],u[g]),Me(e,m[g+1],l[v]),v++,g--;else if(f[b]===d[y])m[y]=Be(l[b],u[y]),Me(e,l[v],l[b]),b--,y++;else if(void 0===h&&(h=De(d,y,g),p=De(f,v,b)),h.has(f[v]))if(h.has(f[b])){var k=p.get(d[y]),w=void 0!==k?l[k]:null;if(null===w){var C=Me(e,l[v]);Be(C,u[y]),m[y]=C}else m[y]=Be(w,u[y]),Me(e,l[v],w),l[k]=null;y++}else Ee(l[b]),b--;else Ee(l[v]),v++;for(;y<=g;){var x=Me(e,m[g+1]);Be(x,u[y]),m[y++]=x}for(;v<=b;){var S=l[v++];null!==S&&Ee(S)}return this.ut=d,Pe(e,m),a.c0}}])}(s.WL));const Re=r.qy`
1089
+ <svg
1090
+ name="sort-asc"
1091
+ height="18"
1092
+ viewBox="0 0 18 18"
1093
+ width="18"
1094
+ xmlns="http://www.w3.org/2000/svg"
1095
+ >
1096
+ <g fill="none" fill-rule="evenodd">
1097
+ <path
1098
+ d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z"
1099
+ fill="#fff"
1100
+ fill-rule="nonzero"
1101
+ />
1102
+ <path
1103
+ d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z"
1104
+ fill="#fff"
1105
+ fill-rule="nonzero"
1106
+ />
1107
+ <path
1108
+ d="m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612"
1109
+ stroke="#fff"
1110
+ stroke-linecap="round"
1111
+ stroke-linejoin="round"
1112
+ stroke-width="1.661538"
1113
+ transform="matrix(1 0 0 -1 0 18.692308)"
1114
+ />
1115
+ </g>
1116
+ </svg>
1117
+ `,Fe=r.qy`
1118
+ <svg
1119
+ name="sort-desc"
1120
+ height="18"
1121
+ viewBox="0 0 18 18"
1122
+ width="18"
1123
+ xmlns="http://www.w3.org/2000/svg"
1124
+ >
1125
+ <g fill="none" fill-rule="evenodd">
1126
+ <path
1127
+ d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z"
1128
+ fill="#fff"
1129
+ fill-rule="nonzero"
1130
+ />
1131
+ <path
1132
+ d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z"
1133
+ fill="#fff"
1134
+ fill-rule="nonzero"
1135
+ />
1136
+ <path
1137
+ d="m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612"
1138
+ stroke="#fff"
1139
+ stroke-linecap="round"
1140
+ stroke-linejoin="round"
1141
+ stroke-width="1.661538"
1142
+ />
1143
+ </g>
1144
+ </svg>
1145
+ `,We=r.qy`
1146
+ <svg
1147
+ name="sort-neutral"
1148
+ height="18"
1149
+ viewBox="0 0 18 18"
1150
+ width="18"
1151
+ xmlns="http://www.w3.org/2000/svg"
1152
+ >
1153
+ <g fill="#fff" fill-rule="evenodd">
1154
+ <path
1155
+ d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z"
1156
+ fill-rule="nonzero"
1157
+ />
1158
+ <path
1159
+ d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z"
1160
+ fill-rule="nonzero"
1161
+ />
1162
+ <circle cx="13" cy="9" r="2" />
1163
+ </g>
1164
+ </svg>
1165
+ `,Ve=r.qy`
1166
+ <svg
1167
+ height="24"
1168
+ viewBox="0 0 24 24"
1169
+ width="24"
1170
+ xmlns="http://www.w3.org/2000/svg"
1171
+ aria-labelledby="volumesTitleID volumesDescID"
1172
+ >
1173
+ <title id="volumesTitleID">Viewable Files</title>
1174
+ <g fill="#ffffff">
1175
+ <path
1176
+ fill="#ffffff"
1177
+ d="m9.83536396 0h10.07241114c.1725502.47117517.3378411.76385809.4958725.87804878.1295523.11419069.3199719.1998337.5712586.25692905.2512868.05709534.4704647.08564301.6575337.08564301h.2806036v15.24362526h-4.3355343v3.8106985h-4.44275v3.7250554h-12.01318261c-.27306495 0-.50313194-.085643-.69020098-.256929-.18706903-.1712861-.30936193-.3425721-.36687867-.5138581l-.06449694-.2785477v-14.2159091c0-.32815965.08627512-.5922949.25882537-.79240577.17255024-.20011086.34510049-.32150776.51765073-.36419068l.25882537-.0640244h3.36472977v-2.54767184c0-.31374722.08627513-.57067627.25882537-.77078714.17255025-.20011086.34510049-.32150776.51765074-.36419068l.25882536-.06402439h3.36472978v-2.56929047c0-.32815964.08627512-.5922949.25882537-.79240576.17255024-.20011087.34510049-.31430156.51765073-.34257207zm10.78355264 15.6294346v-13.53076498c-.2730649-.08536585-.4456152-.16380266-.5176507-.23531042-.1725502-.1424612-.2730649-.27078714-.3015441-.38497783v13.36031043h-9.87808272c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144124-.08962561.006929-.13988296.0640244-.05025735.0570953-.07538603.1427383-.07538603.256929s.02149898.210643.06449694.289357c.04299795.078714.08599591.1322062.12899387.1604767l.06449693.0216187h10.71905571zm-10.2449613-2.4412417h7.98003v-11.60421286h-7.98003zm1.6827837-9.41990022h4.6153002c.1725502 0 .3199718.05349224.4422647.16047672s.1834393.23891353.1834393.39578714c0 .15687362-.0611464.28519956-.1834393.38497783s-.2697145.1496674-.4422647.1496674h-4.6153002c-.1725503 0-.3199719-.04988913-.4422647-.1496674-.1222929-.09977827-.1834394-.22810421-.1834394-.38497783 0-.15687361.0611465-.28880266.1834394-.39578714.1222928-.10698448.2697144-.16047672.4422647-.16047672zm-6.08197737 13.50997782h7.72120467v-.8131929h-3.79610541c-.27306495 0-.49950224-.085643-.67931188-.256929-.17980964-.1712861-.29847284-.3425721-.35598958-.5138581l-.06449694-.2785477v-10.02023282h-2.82530086zm6.77217827-11.36890243h3.2139578c.1295522 0 .240956.05709534.3342113.17128603.0932554.11419069.139883.24972284.139883.40659645 0 .15687362-.0466276.28880267-.139883.39578714-.0932553.10698448-.2046591.16047672-.3342113.16047672h-3.2139578c-.1295523 0-.2373264-.05349224-.3233223-.16047672-.0859959-.10698447-.1289938-.23891352-.1289938-.39578714 0-.15687361.0429979-.29240576.1289938-.40659645s.19377-.17128603.3233223-.17128603zm-11.15043132 15.11557653h7.69942646v-.7491685h-3.79610539c-.25854616 0-.48135376-.0892462-.66842279-.2677384-.18706904-.1784922-.30936193-.3605876-.36687868-.546286l-.06449694-.2569291v-10.04101994h-2.80352266zm14.62237682-4.5606985h-.8191949v2.1410754h-9.89986085s-.04299796.0285477-.12899387.085643c-.08599592.0570954-.12201369.1427384-.10805331.2569291 0 .1141907.01786928.210643.05360784.289357.03573856.0787139.07538603.125.1189424.138858l.06449694.0432373h10.71905575v-2.9542683zm-4.3991936 3.8106985h-.8191949v2.077051h-9.8563045c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144125-.08962561.0105321-.13988296.0748337-.05025735.0643015-.07538603.1607538-.07538603.289357 0 .1141906.02149898.2070399.06449694.2785476.04299795.0715078.08599591.1141907.12899387.1280488l.06449693.0216186h10.69811519v-2.8686252z"
1178
+ />
1179
+ </g>
1180
+ </svg>
1181
+ `;let Ne=class extends r.WF{constructor(){super(...arguments),this.fileListRaw=[],this.fileListSorted=[],this.sortOrderBy="default"}render(){return r.qy`<div class="sort-multi-file-list">${this.sortButton}</div>`}get sortButton(){return{default:r.qy`
1182
+ <button
1183
+ class="sort-by neutral-icon"
1184
+ aria-label="Sort volumes in initial order"
1185
+ @click=${()=>this.sortVolumes("title_asc")}
1186
+ >
1187
+ ${We}
1188
+ </button>
1189
+ `,title_asc:r.qy`
1190
+ <button
1191
+ class="sort-by asc-icon"
1192
+ aria-label="Sort volumes in ascending order"
1193
+ @click=${()=>this.sortVolumes("title_desc")}
1194
+ >
1195
+ ${Re}
1196
+ </button>
1197
+ `,title_desc:r.qy`
1198
+ <button
1199
+ class="sort-by desc-icon"
1200
+ aria-label="Sort volumes in descending order"
1201
+ @click=${()=>this.sortVolumes("default")}
1202
+ >
1203
+ ${Fe}
1204
+ </button>
1205
+ `}[this.sortOrderBy]}sortVolumes(e){this.sortOrderBy=e;let t=[];t=this.fileListRaw.sort((t,n)=>"title_asc"===e?t.title.localeCompare(n.title):"title_desc"===e?n.title.localeCompare(t.title):t.orig_sort-n.orig_sort),this.dispatchEvent(new CustomEvent("fileListSorted",{detail:{sortType:e,sortedFiles:t},bubbles:!0,composed:!0})),this.fileListSorted=t}static get styles(){return r.AH`
1206
+ button.sort-by {
1207
+ padding: 0px;
1208
+ background-color: transparent;
1209
+ border: 0px;
1210
+ --iconWidth: var(--menuSliderHeaderIconWidth);
1211
+ --iconHeight: var(--menuSliderHeaderIconHeight);
1212
+ }
1213
+ `}};(0,o.Cg)([(0,i.MZ)({type:Array})],Ne.prototype,"fileListRaw",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],Ne.prototype,"fileListSorted",void 0),(0,o.Cg)([(0,i.MZ)({type:String,reflect:!0})],Ne.prototype,"sortOrderBy",void 0),Ne=(0,o.Cg)([(0,i.EM)("iaux-in-sort-files-button")],Ne);let Ze=class extends r.WF{constructor(){super(...arguments),this.baseHost="archive.org",this.sortOrderBy="default",this.subPrefix="",this.fileList=[],this.addSortToUrl=!1}firstUpdated(){const e=this.shadowRoot.querySelector(".content.active");setTimeout(()=>{(null==e?void 0:e.scrollIntoViewIfNeeded)?null==e||e.scrollIntoViewIfNeeded(!0):null==e||e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},350)}volumeItemWithImageTitle(e){const t=this.fileUrl(e);return r.qy`
1214
+ <li class="content active">
1215
+ <div class="separator"></div>
1216
+ <a class="container" href="${t}">
1217
+ <div class="image">
1218
+ <img src="${e.image}" alt="preview" />
1219
+ </div>
1220
+ <div class="text">
1221
+ <p class="item-title">${e.title}</p>
1222
+ <small>by: ${e.author}</small>
1223
+ </div>
1224
+ </a>
1225
+ </li>
1226
+ `}fileUrl(e){const t=`//${this.baseHost}${e.url_path}`;let n=t;return this.addSortToUrl&&(n="default"===this.sortOrderBy?`${t}`:`${t}?sort=${this.sortOrderBy}`),n}get pdfLabel(){return r.qy`<span class="pdf-label"
1227
+ ><span class="sr-only">view this</span> PDF</span
1228
+ >`}fileLi(e){var t;const n=this.subPrefix===e.file_subprefix?" active":"",o=this.fileUrl(e),i=(null!==(t=e.file_source)&&void 0!==t?t:"").match(/^[^+]+\.pdf$/i);return r.qy`
1229
+ <li>
1230
+ <div class="separator"></div>
1231
+ <div class="content${n}">
1232
+ <a href=${o}>
1233
+ <p class="item-title">
1234
+ ${e.title}${i?this.pdfLabel:r.s6}
1235
+ </p>
1236
+ </a>
1237
+ </div>
1238
+ </li>
1239
+ `}get fileListTemplate(){const e=qe(this.fileList,e=>null==e?void 0:e.file_prefix,this.fileLi.bind(this));return r.qy`
1240
+ <ul>
1241
+ ${e}
1242
+ <div class="separator"></div>
1243
+ </ul>
1244
+ `}render(){return r.qy` ${this.fileList.length?this.fileListTemplate:r.s6} `}static get styles(){return r.AH`
1245
+ :host {
1246
+ display: block;
1247
+ overflow-y: auto;
1248
+ box-sizing: border-box;
1249
+ color: var(--primaryTextColor);
1250
+ margin-top: 14px;
1251
+ margin-bottom: 2rem;
1252
+ --activeBorderWidth: 2px;
1253
+ }
1254
+
1255
+ a {
1256
+ color: #ffffff;
1257
+ text-decoration: none;
1258
+ }
1259
+
1260
+ img {
1261
+ width: 35px;
1262
+ height: 45px;
1263
+ }
1264
+
1265
+ ul {
1266
+ padding: 0;
1267
+ list-style: none;
1268
+ margin: var(--activeBorderWidth) 0.5rem 1rem 0;
1269
+ }
1270
+
1271
+ ul > li:first-child .separator {
1272
+ display: none;
1273
+ }
1274
+
1275
+ li {
1276
+ cursor: pointer;
1277
+ position: relative;
1278
+ }
1279
+
1280
+ li .content {
1281
+ padding: 2px 0 4px 2px;
1282
+ border: var(--activeBorderWidth) solid transparent;
1283
+ padding: 0.2rem 0 0.4rem 0.2rem;
1284
+ }
1285
+
1286
+ li .content.active {
1287
+ border: var(--activeBorderWidth) solid #538bc5;
1288
+ }
1289
+
1290
+ li.content a {
1291
+ display: flex;
1292
+ }
1293
+
1294
+ small {
1295
+ font-style: italic;
1296
+ white-space: initial;
1297
+ }
1298
+
1299
+ .container {
1300
+ display: flex;
1301
+ align-items: center;
1302
+ justify-content: center;
1303
+ }
1304
+
1305
+ .item-title {
1306
+ margin-block-start: 0em;
1307
+ margin-block-end: 0em;
1308
+ font-size: 14px;
1309
+ font-weight: bold;
1310
+ word-wrap: break-word;
1311
+ padding-left: 5px;
1312
+ }
1313
+
1314
+ .separator {
1315
+ background-color: var(--secondaryBGColor);
1316
+ width: 98%;
1317
+ margin: 1px auto;
1318
+ height: 1px;
1319
+ }
1320
+
1321
+ .text {
1322
+ padding-left: 10px;
1323
+ }
1324
+
1325
+ .icon {
1326
+ display: inline-block;
1327
+ width: 14px;
1328
+ height: 14px;
1329
+ margin-left: 0.7rem;
1330
+ border: 1px solid var(--primaryTextColor);
1331
+ border-radius: 2px;
1332
+ background: var(--activeButtonBg) 50% 50% no-repeat;
1333
+ }
1334
+
1335
+ .pdf-label {
1336
+ border: 1px solid;
1337
+ padding: 2px 5px;
1338
+ border-radius: 20px;
1339
+ display: inline-block;
1340
+ margin-left: 5px;
1341
+ font-size: 0.9rem;
1342
+ }
1343
+
1344
+ .pdf-label .sr-only {
1345
+ position: absolute;
1346
+ clip: rect(1px, 1px, 1px, 1px);
1347
+ padding: 0;
1348
+ border: 0;
1349
+ height: 1px;
1350
+ width: 1px;
1351
+ overflow: hidden;
1352
+ }
1353
+ `}};(0,o.Cg)([(0,i.MZ)({type:String})],Ze.prototype,"baseHost",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],Ze.prototype,"sortOrderBy",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],Ze.prototype,"subPrefix",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],Ze.prototype,"fileList",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],Ze.prototype,"addSortToUrl",void 0),Ze=(0,o.Cg)([(0,i.EM)("iaux-in-viewable-files-panel")],Ze);class Ue{constructor(e){this.title=e?.title,this.subtitle=e?.subtitle,this.headline=e?.headline,this.message=e?.message,this.headerColor=e?.headerColor??"#55A183",this.bodyColor=e?.bodyColor??"#fbfbfd",this.showProcessingIndicator=e?.showProcessingIndicator??!1,this.processingImageMode=e?.processingImageMode??"complete",this.showCloseButton=e?.showCloseButton??!0,this.showLeftNavButton=e?.showLeftNavButton??!1,this.leftNavButtonText=e?.leftNavButtonText??"",this.showHeaderLogo=e?.showHeaderLogo??!0,this.closeOnBackdropClick=e?.closeOnBackdropClick??!0}}function*Ge(e=document.activeElement){null!=e&&(yield e,"shadowRoot"in e&&e.shadowRoot&&"closed"!==e.shadowRoot.mode&&(yield*Ge(e.shadowRoot.activeElement)))}function Je(){return[...Ge()].pop()}const Xe=new WeakMap;function Ke(e){let t=Xe.get(e);return t||(t=window.getComputedStyle(e,null),Xe.set(e,t)),t}function Qe(e){const t=new WeakMap,n=[];return function r(o){if(o instanceof Element){if(o.hasAttribute("inert")||o.closest("[inert]"))return;if(t.has(o))return;t.set(o,!0),!n.includes(o)&&function(e){const t=e.tagName.toLowerCase(),n=Number(e.getAttribute("tabindex"));return(!e.hasAttribute("tabindex")||!(isNaN(n)||n<=-1))&&!e.hasAttribute("disabled")&&!e.closest("[inert]")&&!("input"===t&&"radio"===e.getAttribute("type")&&!e.hasAttribute("checked"))&&!!function(e){if("checkVisibility"in e&&"function"==typeof e.checkVisibility)return e.checkVisibility({checkOpacity:!1,checkVisibilityCSS:!0});const t=Ke(e);return"hidden"!==t.visibility&&"none"!==t.display}(e)&&(!("audio"!==t&&"video"!==t||!e.hasAttribute("controls"))||!!e.hasAttribute("tabindex")||!(!e.hasAttribute("contenteditable")||"false"===e.getAttribute("contenteditable"))||!!["button","input","select","textarea","a","audio","video","summary","iframe"].includes(t)||function(e){const t=Ke(e),{overflowY:n,overflowX:r}=t;return"scroll"===n||"scroll"===r||"auto"===n&&"auto"===r&&(e.scrollHeight>e.clientHeight&&"auto"===n||!(!(e.scrollWidth>e.clientWidth)||"auto"!==r))}(e))}(o)&&n.push(o),o instanceof HTMLSlotElement&&function(e,t){return e.getRootNode({composed:!0})?.host!==t}(o,e)&&o.assignedElements({flatten:!0}).forEach(e=>{r(e)}),null!==o.shadowRoot&&"open"===o.shadowRoot.mode&&r(o.shadowRoot)}for(const e of Array.from(o.children))r(e)}(e),n.sort((e,t)=>{const n=Number(e.getAttribute("tabindex"))||0;return(Number(t.getAttribute("tabindex"))||0)-n})}let Ye=[];class et{constructor(e){this.isExternalActivated=!1,this.tabDirection="forward",this.currentFocus=null,this.previousFocus=null,this.handleFocusIn=()=>{this.isActive()&&this.checkFocus()},this.handleKeyDown=e=>{if("Tab"!==e.key||this.isExternalActivated)return;if(!this.isActive())return;const t=Je();if(this.previousFocus=t,this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;e.shiftKey?this.tabDirection="backward":this.tabDirection="forward";const n=Qe(this.element);let r=n.findIndex(e=>e===t);this.previousFocus=this.currentFocus;const o="forward"===this.tabDirection?1:-1;for(;;){r+o>=n.length?r=0:r+o<0?r=n.length-1:r+=o,this.previousFocus=this.currentFocus;const t=n[r];if("backward"===this.tabDirection&&this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;if(t&&this.possiblyHasTabbableChildren(t))return;e.preventDefault(),this.currentFocus=t,this.currentFocus?.focus({preventScroll:!1});const i=[...Ge()];if(i.includes(this.currentFocus)||!i.includes(this.previousFocus))break}setTimeout(()=>this.checkFocus())},this.handleKeyUp=()=>{this.tabDirection="forward"},this.element=e,this.elementsWithTabbableControls=["iframe"]}activate(){Ye.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){Ye=Ye.filter(e=>e!==this.element),this.currentFocus=null,document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return Ye[Ye.length-1]===this.element}activateExternal(){this.isExternalActivated=!0}deactivateExternal(){this.isExternalActivated=!1}checkFocus(){if(this.isActive()&&!this.isExternalActivated){const e=Qe(this.element);if(!this.element.matches(":focus-within")){const t=e[0],n=e[e.length-1],r="forward"===this.tabDirection?t:n;"function"==typeof r?.focus&&(this.currentFocus=r,r.focus({preventScroll:!1}))}}}possiblyHasTabbableChildren(e){return this.elementsWithTabbableControls.includes(e.tagName.toLowerCase())||e.hasAttribute("controls")}}n(8248);var tt=r.qy`
1354
+ <svg
1355
+ viewBox="0 0 40 40"
1356
+ version="1.1"
1357
+ xmlns="http://www.w3.org/2000/svg"
1358
+ >
1359
+ <path d="m29.1923882 10.8076118c.5857864.5857865.5857864 1.535534 0 2.1213204l-7.0711162 7.0703398 7.0711162 7.0717958c.5857864.5857864.5857864 1.5355339 0 2.1213204-.5857865.5857864-1.535534.5857864-2.1213204 0l-7.0717958-7.0711162-7.0703398 7.0711162c-.5857864.5857864-1.5355339.5857864-2.1213204 0-.5857864-.5857865-.5857864-1.535534 0-2.1213204l7.0706602-7.0717958-7.0706602-7.0703398c-.5857864-.5857864-.5857864-1.5355339 0-2.1213204.5857865-.5857864 1.535534-.5857864 2.1213204 0l7.0703398 7.0706602 7.0717958-7.0706602c.5857864-.5857864 1.5355339-.5857864 2.1213204 0z" class="fill-color" fill-rule="evenodd"/>
1360
+ </svg>
1361
+ `;class nt extends r.WF{static get styles(){return r.AH`
1362
+ :host {
1363
+ width: var(--iconWidth, 'auto');
1364
+ height: var(--iconHeight, 'auto');
1365
+ }
1366
+
1367
+ .fill-color {
1368
+ fill: var(--iconFillColor);
1369
+ }
1370
+
1371
+ .stroke-color {
1372
+ stroke: var(--iconStrokeColor);
1373
+ }
1374
+ `}render(){return tt}}customElements.define("ia-icon-close",nt);var rt=r.qy`
1375
+ <svg
1376
+ class="ia-logo"
1377
+ viewBox="0 0 27 30"
1378
+ xmlns="http://www.w3.org/2000/svg"
1379
+ aria-labelledby="logoTitleID logoDescID"
1380
+ >
1381
+ <title id="logoTitleID">Internet Archive logo</title>
1382
+ <desc id="logoDescID">
1383
+ A line drawing of the Internet Archive headquarters building façade.
1384
+ </desc>
1385
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
1386
+ <mask id="mask-2" class="fill-color">
1387
+ <path
1388
+ d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z"
1389
+ id="path-1"
1390
+ ></path>
1391
+ </mask>
1392
+ <use class="fill-color" xlink:href="#path-1"></use>
1393
+ <g mask="url(#mask-2)" class="fill-color">
1394
+ <path
1395
+ d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z"
1396
+ id="swatch"
1397
+ ></path>
1398
+ </g>
1399
+ </g>
1400
+ </svg>
1401
+ `,ot=r.qy`
1402
+ <svg
1403
+ viewBox="0 0 100 100"
1404
+ xmlns="http://www.w3.org/2000/svg"
1405
+ fill="#fff"
1406
+ title="Left arrow icon"
1407
+ alt="Left arrow icon"
1408
+ >
1409
+ <path
1410
+ d="m20.1116715 50.0035012-.1116715-.1085359 43.1159942-46.61088155c2.401537-2.18938917 4.6902018-3.28408375 6.8659943-3.28408375s4.1642651.63837733 5.9654178 1.91513199c1.8011528 1.27675467 3.1520173 2.97248092 4.0525937 5.08717877l-39.4020173 42.99768924 39.4020173 42.9976892c-.9005764 2.1146979-2.2514409 3.8104241-4.0525937 5.0871788-1.8011527 1.2767547-3.7896253 1.915132-5.9654178 1.915132-2.1013449 0-4.3900096-1.0573489-6.8659943-3.1720468l-43.1159942-46.7194174z"
1411
+ />
1412
+ </svg>
1413
+ `;let it=class extends r.WF{constructor(){super(...arguments),this.config=new Ue}render(){return r.qy`
1414
+ <div class="modal-wrapper">
1415
+ <div class="modal-container">
1416
+ <header style="background-color: ${this.config.headerColor}">
1417
+ ${this.config.showLeftNavButton?this.leftNavButtonTemplate:r.s6}
1418
+ ${this.config.showCloseButton?this.closeButtonTemplate:""}
1419
+ ${this.config.showHeaderLogo?r.qy`<div class="logo-icon">${rt}</div>`:r.s6}
1420
+ ${this.config.title?r.qy`<h1 class="title">${this.config.title}</h1>`:""}
1421
+ ${this.config.subtitle?r.qy`<h2 class="subtitle">${this.config.subtitle}</h2>`:""}
1422
+ </header>
1423
+ <section
1424
+ class="modal-body"
1425
+ style="background-color: ${this.config.bodyColor}"
1426
+ >
1427
+ <div class="content">
1428
+ <div
1429
+ class="processing-logo ${this.config.showProcessingIndicator?"":"hidden"}"
1430
+ >
1431
+ <ia-activity-indicator
1432
+ .mode=${this.config.processingImageMode}
1433
+ ></ia-activity-indicator>
1434
+ </div>
1435
+ ${this.config.headline?r.qy` <h1 class="headline">${this.config.headline}</h1> `:""}
1436
+ ${this.config.message?r.qy` <p class="message">${this.config.message}</p> `:""}
1437
+
1438
+ <div class="slot-container">
1439
+ <slot> </slot>
1440
+ </div>
1441
+ </div>
1442
+ </section>
1443
+ </div>
1444
+ </div>
1445
+ `}handleCloseButton(e){if(e.preventDefault(),"keydown"===e.type&&" "!==e.key&&"Enter"!==e.key)return;const t=new Event("closeButtonPressed");this.dispatchEvent(t)}handleLeftNavButtonPressed(e){if(e.preventDefault(),"keydown"===e.type&&" "!==e.key&&"Enter"!==e.key)return;const t=new Event("leftNavButtonPressed");this.dispatchEvent(t)}get closeButtonTemplate(){return r.qy`
1446
+ <button
1447
+ type="button"
1448
+ class="close-button"
1449
+ @click=${this.handleCloseButton}
1450
+ @keydown=${this.handleCloseButton}
1451
+ >
1452
+ <ia-icon-close></ia-icon-close>
1453
+ </button>
1454
+ `}get leftNavButtonTemplate(){return r.qy`<button
1455
+ type="button"
1456
+ class="back-button"
1457
+ @click=${this.handleLeftNavButtonPressed}
1458
+ @keydown=${this.handleLeftNavButtonPressed}
1459
+ >
1460
+ ${ot} ${this.config.leftNavButtonText??""}
1461
+ </button> `}static get styles(){const e=r.AH`var(--modalLogoSize, 6.5rem)`,t=r.AH`var(--processingImageSize, 7.5rem)`,n=r.AH`var(--modalCornerRadius, 1rem)`,o=r.AH`var(--modalBorder, 2px solid black)`,i=r.AH`var(--modalBottomMargin, 2.5rem)`,a=r.AH`var(--modalTopMargin, 5rem)`,s=r.AH`var(--modalHeaderBottomPadding, 0.5em)`,l=r.AH`var(--modalBottomPadding, 2rem)`,c=r.AH`var(--modalScrollOffset, 5px)`,u=r.AH`var(--modalTitleFontSize, 1.8rem)`,d=r.AH`var(--modalSubtitleFontSize, 1.4rem)`,h=r.AH`var(--modalHeadlineFontSize, 1.6rem)`,p=r.AH`var(--modalMessageFontSize, 1.4rem)`,f=r.AH`var(--modalTitleLineHeight, normal)`,m=r.AH`var(--modalSubtitleLineHeight, normal)`,v=r.AH`var(--modalHeadlineLineHeight, normal)`,b=r.AH`var(--modalMessageLineHeight, normal)`;return r.AH`
1462
+ .processing-logo {
1463
+ margin: auto;
1464
+ width: ${t};
1465
+ height: ${t};
1466
+ }
1467
+
1468
+ .processing-logo.hidden {
1469
+ height: 1rem;
1470
+ }
1471
+
1472
+ .processing-logo.hidden ia-activity-indicator {
1473
+ display: none;
1474
+ }
1475
+
1476
+ .modal-wrapper {
1477
+ outline: none;
1478
+ }
1479
+
1480
+ .modal-container {
1481
+ border-radius: ${n};
1482
+ width: 100%;
1483
+ margin-top: ${a};
1484
+ }
1485
+
1486
+ header {
1487
+ position: relative;
1488
+ background-color: #36a483;
1489
+ color: white;
1490
+ border-radius: calc(${n}) calc(${n}) 0 0;
1491
+ border: ${o};
1492
+ border-bottom: 0;
1493
+ text-align: center;
1494
+ padding-bottom: ${s};
1495
+ }
1496
+
1497
+ .title {
1498
+ margin: 0;
1499
+ padding: 0;
1500
+ font-size: ${u};
1501
+ font-weight: bold;
1502
+ line-height: ${f};
1503
+ }
1504
+
1505
+ .subtitle {
1506
+ margin: 0;
1507
+ padding: 0;
1508
+ font-weight: normal;
1509
+ padding-top: 0;
1510
+ font-size: ${d};
1511
+ line-height: ${m};
1512
+ }
1513
+
1514
+ .modal-body {
1515
+ background-color: #fbfbfd;
1516
+ border-radius: 0 0 calc(${n}) calc(${n});
1517
+ border: ${o};
1518
+ border-top: 0;
1519
+ padding: 0 1rem calc(${l} - ${c}) 1rem;
1520
+ color: #333;
1521
+ margin-bottom: 2.5rem;
1522
+ min-height: 5rem;
1523
+ }
1524
+
1525
+ .content {
1526
+ overflow-y: auto;
1527
+ max-height: calc(100vh - (16.5rem + ${i}));
1528
+ min-height: 5rem;
1529
+ padding: 0 0 calc(${c}) 0;
1530
+ }
1531
+
1532
+ .headline {
1533
+ font-size: ${h};
1534
+ font-weight: bold;
1535
+ text-align: center;
1536
+ line-height: ${v};
1537
+ margin: 0;
1538
+ padding: 0;
1539
+ }
1540
+
1541
+ .message {
1542
+ margin: 1rem 0 0 0;
1543
+ text-align: center;
1544
+ font-size: ${p};
1545
+ line-height: ${b};
1546
+ }
1547
+
1548
+ .logo-icon {
1549
+ border-radius: 100%;
1550
+ border: 3px solid #fff;
1551
+ box-shadow:
1552
+ 0 0 0 1px rgba(0, 0, 0, 0.18),
1553
+ 0 2px 2px 0 rgba(0, 0, 0, 0.08);
1554
+ width: ${e};
1555
+ height: ${e};
1556
+ margin: -2.9rem auto 0.5rem auto;
1557
+ background-color: black;
1558
+ display: flex;
1559
+ justify-content: center;
1560
+ align-items: center;
1561
+ }
1562
+
1563
+ .logo-icon svg {
1564
+ width: calc(${e} * 0.65);
1565
+ height: calc(${e} * 0.65);
1566
+ }
1567
+
1568
+ .logo-icon svg .fill-color {
1569
+ fill: white;
1570
+ }
1571
+
1572
+ .logo-icon svg .stroke-color {
1573
+ stroke: red;
1574
+ }
1575
+
1576
+ .close-button {
1577
+ position: absolute;
1578
+ right: 1.2rem;
1579
+ top: 1.2rem;
1580
+ width: 2rem;
1581
+ height: 2rem;
1582
+ border-radius: 100%;
1583
+ border: 0;
1584
+ padding: 0;
1585
+ cursor: pointer;
1586
+ background-color: white;
1587
+ box-shadow:
1588
+ 0 0 0 1px rgba(0, 0, 0, 0.18),
1589
+ 0 4px 4px 0 rgba(0, 0, 0, 0.08);
1590
+ }
1591
+
1592
+ .back-button {
1593
+ position: absolute;
1594
+ left: 1.2rem;
1595
+ top: 1.2rem;
1596
+ height: 2rem;
1597
+ background-color: transparent;
1598
+ outline: none;
1599
+ border: none;
1600
+ padding: 0;
1601
+ cursor: pointer;
1602
+ color: white;
1603
+ font-family: inherit;
1604
+ display: flex;
1605
+ flex-direction: row;
1606
+ align-items: center;
1607
+ gap: 0.5rem;
1608
+ }
1609
+
1610
+ .back-button svg {
1611
+ height: 1.5rem;
1612
+ }
1613
+
1614
+ .sr-only {
1615
+ position: absolute;
1616
+ width: 1px;
1617
+ height: 1px;
1618
+ padding: 0;
1619
+ margin: -1px;
1620
+ overflow: hidden;
1621
+ clip: rect(0, 0, 0, 0);
1622
+ border: 0;
1623
+ }
1624
+
1625
+ slot::slotted(.sr-only) {
1626
+ position: absolute;
1627
+ width: 1px;
1628
+ height: 1px;
1629
+ padding: 0;
1630
+ margin: -1px;
1631
+ overflow: hidden;
1632
+ clip: rect(0, 0, 0, 0);
1633
+ border: 0;
1634
+ }
1635
+ `}};var at;(0,o.Cg)([(0,i.MZ)({type:Object})],it.prototype,"config",void 0),it=(0,o.Cg)([(0,i.EM)("modal-template")],it),function(e){e.Open="open",e.Closed="closed"}(at||(at={}));class st{constructor(e){this.windowResizeThrottler=function(e,t,n){var r,o=n||{},i=o.noTrailing,a=void 0!==i&&i,s=o.noLeading,l=void 0!==s&&s,c=o.debounceMode,u=void 0===c?void 0:c,d=!1,h=0;function p(){r&&clearTimeout(r)}function f(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var s=this,c=Date.now()-h;function f(){h=Date.now(),t.apply(s,o)}function m(){r=void 0}d||(l||!u||r||f(),p(),void 0===u&&c>e?l?(h=Date.now(),a||(r=setTimeout(u?m:f,e))):f():!0!==a&&(r=setTimeout(u?m:f,void 0===u?e-c:e)))}return f.cancel=function(e){var t=(e||{}).upcomingOnly,n=void 0!==t&&t;p(),d=!n},f}(100,this.updateModalContainerHeight,{noLeading:!1,noTrailing:!1}).bind(this),this.modalManager=e}handleModeChange(e){switch(e){case at.Open:this.startResizeListener(),this.stopDocumentScroll();break;case at.Closed:this.stopResizeListener(),this.resumeDocumentScroll()}}updateModalContainerHeight(){this.modalManager.style.setProperty("--containerHeight",`${window.innerHeight}px`)}stopDocumentScroll(){document.body.classList.add("modal-manager-open")}resumeDocumentScroll(){document.body.classList.remove("modal-manager-open")}startResizeListener(){window.addEventListener("resize",this.windowResizeThrottler)}stopResizeListener(){window.removeEventListener("resize",this.windowResizeThrottler)}}let lt=class extends r.WF{constructor(){super(...arguments),this.mode=at.Closed,this.hostBridge=new st(this),this.modal=new et(this),this.closeOnBackdropClick=!0}async firstUpdated(){await new Promise(e=>setTimeout(e,0)),this.closeOnBackdropClick&&this.addEventListener("keydown",e=>{"Escape"===e.key&&this.backdropClicked()})}disconnectedCallback(){super.disconnectedCallback(),this.modal.deactivate()}render(){return r.qy`
1636
+ <div class="container">
1637
+ <div class="backdrop" @click=${this.backdropClicked}></div>
1638
+ <modal-template
1639
+ @closeButtonPressed=${this.closeButtonPressed}
1640
+ @leftNavButtonPressed=${this.callUserPressedLeftNavButtonCallback}
1641
+ tabindex="-1"
1642
+ >
1643
+ ${this.customModalContent}
1644
+ </modal-template>
1645
+ </div>
1646
+ `}getMode(){return this.mode}closeModal(){this.mode=at.Closed,this.customModalContent=void 0,this.modalTemplate&&(this.modalTemplate.config=new Ue),this.modal.deactivate(),this.triggeringElement?.focus?.(),this.triggeringElement=void 0}callUserClosedModalCallback(){const e=this.userClosedModalCallback;this.userClosedModalCallback=void 0,e&&e()}callUserPressedLeftNavButtonCallback(){const e=this.userPressedLeftNavButtonCallback;this.userPressedLeftNavButtonCallback=void 0,e&&e()}async showModal(e){this.mode===at.Closed&&this.captureFocusedElement(),this.closeOnBackdropClick=e.config.closeOnBackdropClick,this.userClosedModalCallback=e.userClosedModalCallback,this.userPressedLeftNavButtonCallback=e.userPressedLeftNavButtonCallback,this.customModalContent=e.customModalContent,this.mode=at.Open,this.modalTemplate&&(this.modalTemplate.config=e.config,await this.modalTemplate.updateComplete,this.modalTemplate.focus()),this.modal.activate()}captureFocusedElement(){this.triggeringElement=Je()}updated(e){e.has("mode")&&this.handleModeChange()}backdropClicked(){this.closeOnBackdropClick&&(this.closeModal(),this.callUserClosedModalCallback())}handleModeChange(){this.hostBridge.handleModeChange(this.mode),this.emitModeChangeEvent()}emitModeChangeEvent(){const e=new CustomEvent("modeChanged",{detail:{mode:this.mode}});this.dispatchEvent(e)}closeButtonPressed(){this.closeModal(),this.callUserClosedModalCallback()}static get styles(){const e=r.AH`var(--modalBackdropColor, rgba(10, 10, 10, 0.9))`,t=r.AH`var(--modalBackdropZindex, 1000)`,n=r.AH`var(--modalWidth, 32rem)`,o=r.AH`var(--modalMaxWidth, 95%)`,i=r.AH`var(--modalZindex, 2000)`;return r.AH`
1647
+ .container {
1648
+ width: 100%;
1649
+ height: 100%;
1650
+ }
1651
+
1652
+ .backdrop {
1653
+ position: fixed;
1654
+ top: 0;
1655
+ left: 0;
1656
+ background-color: ${e};
1657
+ width: 100%;
1658
+ height: 100%;
1659
+ z-index: ${t};
1660
+ }
1661
+
1662
+ modal-template {
1663
+ outline: 0;
1664
+ position: fixed;
1665
+ top: 0;
1666
+ left: 50%;
1667
+ transform: translate(-50%, 0);
1668
+ z-index: ${i};
1669
+ width: ${n};
1670
+ max-width: ${o};
1671
+ }
1672
+ `}};(0,o.Cg)([(0,i.MZ)({type:String,reflect:!0})],lt.prototype,"mode",void 0),(0,o.Cg)([(0,i.MZ)({type:Object})],lt.prototype,"customModalContent",void 0),(0,o.Cg)([(0,i.MZ)({type:Object})],lt.prototype,"hostBridge",void 0),(0,o.Cg)([(0,i.P)("modal-template")],lt.prototype,"modalTemplate",void 0),lt=(0,o.Cg)([(0,i.EM)("modal-manager")],lt);class ct{constructor(){this.resizeObserver=new ResizeObserver(e=>{window.requestAnimationFrame(()=>{for(const t of e){const e=this.resizeHandlers.get(t.target);null==e||e.forEach(e=>{e.handleResize(t)})}})}),this.resizeHandlers=new Map}shutdown(){this.resizeHandlers.forEach((e,t)=>{this.resizeObserver.unobserve(t)}),this.resizeHandlers.clear()}addObserver(e){var t;const n=null!==(t=this.resizeHandlers.get(e.target))&&void 0!==t?t:new Set;n.add(e.handler),this.resizeHandlers.set(e.target,n),this.resizeObserver.observe(e.target,e.options)}removeObserver(e){const t=this.resizeHandlers.get(e.target);t&&(t.delete(e.handler),0===t.size&&(this.resizeObserver.unobserve(e.target),this.resizeHandlers.delete(e.target)))}}var ut=r.qy`
1673
+ <svg
1674
+ class="ia-logo"
1675
+ viewBox="0 0 27 30"
1676
+ xmlns="http://www.w3.org/2000/svg"
1677
+ >
1678
+ <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
1679
+ <mask id="mask-2" class="fill-color">
1680
+ <path d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z" id="path-1"></path>
1681
+ </mask>
1682
+ <use class="fill-color" xlink:href="#path-1"></use>
1683
+ <g mask="url(#mask-2)" class="fill-color">
1684
+ <path d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z" id="swatch"></path>
1685
+ </g>
1686
+ </g>
1687
+ </svg>
1688
+ `;class dt extends r.WF{static get styles(){return r.AH`
1689
+ :host {
1690
+ width: var(--iconWidth, 'auto');
1691
+ height: var(--iconHeight, 'auto');
1692
+ }
1693
+
1694
+ .fill-color {
1695
+ fill: var(--iconFillColor);
1696
+ }
1697
+
1698
+ .stroke-color {
1699
+ stroke: var(--iconStrokeColor);
1700
+ }
1701
+ `}render(){return ut}}customElements.define("ia-icon-ia-logo",dt);var ht=r.qy`
1702
+ <svg
1703
+ viewBox="0 0 100 100"
1704
+ xmlns="http://www.w3.org/2000/svg"
1705
+ >
1706
+ <path
1707
+ class="fill-color"
1708
+ fill="none"
1709
+ d="m17.0555551 41.3194459c0-12.7430552 10.3541664-23.1027772 23.0847216-23.1027772 12.7166664 0 23.0777773 10.359722 23.0777773 23.1027772 0 12.7361108-10.3611109 23.0986106-23.0777773 23.0986106-12.7305552 0-23.0847216-10.3624998-23.0847216-23.0986106zm-17.24305512 0c0 22.2916661 18.04583292 40.3472213 40.32777672 40.3472213 8.9208332 0 17.145833-2.9319449 23.8194439-7.8527776l24.1513883 24.0777771c1.2125 1.1402778 2.8430555 1.8430556 4.6374999 1.8430556 3.7444443 0 6.7805554-3.0361111 6.7805554-6.7791665 0-2.0652778-.9222222-3.9069444-2.3736111-5.1499999l-23.718055-23.7458328c4.4152777-6.4791665 7.0152776-14.3055552 7.0152776-22.7402772 0-22.2791661-18.0458328-40.34861006-40.312499-40.34861006-22.2819438 0-40.32777672 18.06944396-40.32777672 40.34861006z" />
1710
+ </svg>
1711
+ `;class pt extends r.WF{static get styles(){return r.AH`
1712
+ :host {
1713
+ width: var(--iconWidth, 'auto');
1714
+ height: var(--iconHeight, 'auto');
1715
+ }
1716
+
1717
+ .fill-color {
1718
+ fill: var(--iconFillColor);
1719
+ }
1720
+
1721
+ .stroke-color {
1722
+ stroke: var(--iconStrokeColor);
1723
+ }
1724
+ `}render(){return ht}}function ft(e){return ft="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ft(e)}function mt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,vt(r.key),r)}}function vt(e){var t=function(e){if("object"!=ft(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ft(t)?t:t+""}function bt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(bt=function(){return!!e})()}function yt(e){return yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yt(e)}function gt(e,t){return gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gt(e,t)}customElements.define("ia-icon-search",pt);var kt=function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=yt(t),function(e,t){if(t&&("object"==ft(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,bt()?Reflect.construct(t,n||[],yt(e).constructor):t.apply(e,n))}(this,t,[e])).et=a.s6,e.type!==s.OA.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gt(e,t)}(t,e),function(e,t){return t&&mt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(e){if(e===a.s6||null==e)return this.ft=void 0,this.et=e;if(e===a.c0)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;var t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}])}(s.WL);kt.directiveName="unsafeHTML",kt.resultType=1;var wt,Ct,xt,St,Ot,Mt,Bt,jt,Pt,Et,Lt,At,_t,Tt,zt,It,$t,Ht,Dt=(0,s.u$)(kt),qt=(0,r.qy)(wt||(xt=['\n<svg height="10" viewBox="0 0 13 10" width="13" xmlns="http://www.w3.org/2000/svg">\n <path\n d="m4.33333333 10-4.33333333-4.16666667 1.73333333-1.66666666 2.6 2.5 6.93333337-6.66666667 1.7333333 1.66666667z"\n fill="#fff" fill-rule="evenodd" />\n</svg>\n'],St||(St=xt.slice(0)),wt=Object.freeze(Object.defineProperties(xt,{raw:{value:Object.freeze(St)}})))),Rt=(0,r.AH)(Ct||(Ct=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n .ia-button {\n min-height: 3rem;\n border: none;\n cursor: pointer;\n color: var(--primaryTextColor);\n line-height: normal;\n border-radius: .4rem;\n text-align: center;\n vertical-align: middle;\n font-size: 1.4rem;\n font-family: inherit;\n display: inline-block;\n padding: .6rem 1.2rem;\n border: 1px solid transparent;\n\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n }\n\n .ia-button.link,\n .ia-button.external {\n min-height: unset;\n text-decoration: none;\n }\n\n .ia-button:disabled,\n .ia-button.disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .ia-button.transparent {\n background-color: transparent;\n }\n \n .ia-button.slim {\n padding: 0;\n }\n\n .ia-button.primary {\n background-color: var(--primaryCTAFill);\n border-color: var(--primaryCTABorder);\n }\n\n .ia-button.cancel {\n background-color: var(--primaryErrorCTAFill);\n border-color: var(--primaryErrorCTABorder);\n }\n\n .ia-button.external {\n background: var(--secondaryCTAFill);\n border-color: var(--secondaryCTABorder);\n }\n"]))),Ft=n(4535),Wt=(0,r.AH)(Ot||(Ot=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0 0 0 0) !important;\n white-space: nowrap !important;\n border: 0 !important;\n }\n"])));function Vt(e){e.prototype&&(e=e.prototype.render());var t=e.strings[0];return(0,r.AH)(["data:image/svg+xml;base64,".concat(btoa(t.replace(/\n/g," ")))])}function Nt(e){return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nt(e)}function Zt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ut(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gt(r.key),r)}}function Gt(e){var t=function(e){if("object"!=Nt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Nt(t)?t:t+""}function Jt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Jt=function(){return!!e})()}function Xt(e){return Xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xt(e)}function Kt(e,t){return Kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kt(e,t)}n(5440);var Qt,Yt,en,tn,nn=Vt(qt),rn=Vt(tt),on=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Xt(t),function(e,t){if(t&&("object"==Nt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Jt()?Reflect.construct(t,n||[],Xt(e).constructor):t.apply(e,n))}(this,t)).results=[],e.query="",e.queryInProgress=!1,e.renderHeader=!1,e.renderSearchAllFiles=!1,e.errorMessage="",e.bindBookReaderListeners(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kt(e,t)}(t,e),function(e,t,n){return t&&Ut(e.prototype,t),n&&Ut(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"updated",value:function(){this.focusOnInputIfNecessary()}},{key:"bindBookReaderListeners",value:function(){document.addEventListener("BookReader:SearchCallback",this.setResults.bind(this))}},{key:"focusOnInputIfNecessary",value:function(){this.results.length||this.shadowRoot.querySelector("input[type='search']").focus()}},{key:"setResults",value:function(e){var t=e.detail;this.results=t.results}},{key:"setQuery",value:function(e){this.query=e.currentTarget.value,this.query||this.cancelSearch()}},{key:"performSearch",value:function(e){e.preventDefault();var t=e.currentTarget.querySelector('input[type="search"]');t&&t.value&&this.dispatchEvent(new CustomEvent("bookSearchInitiated",{bubbles:!0,composed:!0,detail:{query:this.query}}))}},{key:"selectResult",value:function(e){this.dispatchEvent(new CustomEvent("resultSelected",{bubbles:!0,composed:!0,detail:{match:e}})),this.dispatchEvent(new CustomEvent("closeMenu",{bubbles:!0,composed:!0}))}},{key:"cancelSearch",value:function(){this.queryInProgress=!1,this.dispatchSearchCanceled()}},{key:"dispatchSearchCanceled",value:function(){this.dispatchEvent(new Event("bookSearchCanceled"))}},{key:"resultsCount",get:function(){var e=this.results.length;return e?"".concat(e," result").concat(e>1?"s":""):r.s6}},{key:"headerSection",get:function(){var e=(0,r.qy)(Mt||(Mt=Zt(["<header>\n <h3>Search inside</h3>\n ","\n </header>"])),this.resultsCount?(0,r.qy)(Bt||(Bt=Zt(["(",")"])),this.resultsCount):r.s6);return this.renderHeader?e:r.s6}},{key:"searchMultipleControls",get:function(){var e=(0,r.qy)(jt||(jt=Zt(['\n <input name="all_files" id="all_files" type="checkbox" />\n <label class="checkbox" for="all_files">Search all files</label>\n '])));return this.renderSearchAllFiles?e:r.s6}},{key:"loadingIndicator",get:function(){return(0,r.qy)(Pt||(Pt=Zt(['\n <div class="loading">\n <ia-activity-indicator mode="processing" aria-hidden="true" role="presentation"></ia-activity-indicator>\n <p>Searching</p>\n <button class="ia-button external cancel-search" @click=',">Cancel</button>\n </div>\n "])),this.cancelSearch)}},{key:"resultsSet",get:function(){var e=this;return(0,r.qy)(Et||(Et=Zt(['\n <nav aria-label="Search results">\n <div>\n ','\n <a\n href="#"\n class="skip-link"\n @click=','\n >Skip to last result</a>\n </div>\n <ul class="results">\n ','\n </ul>\n <a\n href="#"\n class="skip-link"\n @click=',"\n >Skip to first result</a>\n </nav>\n "])),this.resultsCount,function(t){t.preventDefault(),e.shadowRoot.querySelector(".results li:last-child .result-item").focus()},this.results.map(function(t){return(0,r.qy)(Lt||(Lt=Zt(['\n <li>\n <button class="result-item" @click=','>\n <span class="page-num">Page ',"</span> — <span lang=",">","</span>\n </button>\n </li>\n "])),e.selectResult.bind(e,t),t.displayPageNumber,(0,Ft.J)(t.lang),Dt(t.html))}),function(t){t.preventDefault(),e.shadowRoot.querySelector(".results li:first-child .result-item").focus()})}},{key:"setErrorMessage",get:function(){return(0,r.qy)(At||(At=Zt(['\n <p class="error-message">',"</p>\n "])),this.errorMessage)}},{key:"render",value:function(){var e=!(this.queryInProgress||this.errorMessage||this.queryInProgress||this.results.length);return(0,r.qy)(_t||(_t=Zt(["\n ",'\n <form action="" method="get" @submit=',">\n ",'\n <input\n type="search"\n name="query"\n id="br-search-input"\n @keyup=',"\n @search=","\n .value=",'\n />\n <label class="search-cta ','" for="br-search-input">\n Please enter text to search for\n </label>\n </form>\n <div class="results-container" aria-live="polite">\n ',"\n ","\n ","\n </div>\n "])),this.headerSection,this.performSearch,this.searchMultipleControls,this.setQuery,this.setQuery,this.query,e?"":"sr-only",this.queryInProgress?this.loadingIndicator:r.s6,this.errorMessage?this.setErrorMessage:r.s6,this.results.length?this.resultsSet:r.s6)}}],[{key:"properties",get:function(){return{results:{type:Array},query:{type:String},queryInProgress:{type:Boolean},renderHeader:{type:Boolean},renderSearchAllFiles:{type:Boolean},errorMessage:{type:String}}}},{key:"styles",get:function(){var e=(0,r.AH)(Tt||(Tt=Zt(["var(--searchResultText, #adaedc)"]))),t=(0,r.AH)(zt||(zt=Zt(["var(--searchResultBg, #272958)"]))),n=(0,r.AH)(It||(It=Zt(["var(--searchResultBorder, #adaedc)"]))),o=(0,r.AH)($t||($t=Zt(["(--tertiaryBGColor, #333)"]))),i=(0,r.AH)(Ht||(Ht=Zt(["\n :host {\n display: block;\n height: 100%;\n padding: 1.5rem 1rem 2rem 0;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\n }\n\n .skip-link {\n position: absolute;\n left: -9999px;\n }\n .skip-link:focus {\n position: static;\n left: auto;\n }\n\n mark {\n padding: 0 .2rem;\n color: ",";\n background: ",";\n border: 1px solid ",';\n border-radius: 2px;\n }\n\n h3 {\n padding: 0;\n margin: 0 1rem 0 0;\n font-size: 2rem;\n }\n\n header {\n display: flex;\n align-items: center;\n padding: 0 2rem 0 0;\n }\n header p {\n padding: 0;\n margin: 0;\n font-size: 1.2rem;\n font-weight: bold;\n font-style: italic;\n }\n\n form {\n padding: 0 0 1rem 0;\n }\n\n [type="checkbox"] {\n display: none;\n }\n\n label {\n display: block;\n text-align: center;\n }\n\n label.checkbox {\n padding-bottom: .5rem;\n font-size: 1.6rem;\n line-height: 150%;\n vertical-align: middle;\n }\n\n label.checkbox:after {\n display: inline-block;\n width: 14px;\n height: 14px;\n margin-left: .7rem;\n content: "";\n border-radius: 2px;\n }\n :checked + label.checkbox:after {\n background-image: url(\'','\');\n }\n\n label.checkbox[for="all_files"]:after {\n background: ',' 50% 50% no-repeat;\n border: 1px solid var(--primaryTextColor);\n }\n\n [type="search"] {\n color: var(--primaryTextColor);\n border: 1px solid var(--primaryTextColor);\n -webkit-appearance: textfield;\n width: 100%;\n height: 3rem;\n padding: 0 10px;\n box-sizing: border-box;\n font: normal 1.6rem "Helvetica qNeue", Helvetica, Arial, sans-serif;\n border-radius: 1.5rem;\n background: transparent;\n }\n [type="search"]:focus {\n outline: none;\n }\n [type="search"]::-webkit-search-cancel-button {\n width: 18px;\n height: 18px;\n margin-right: -5px;\n -webkit-appearance: none;\n appearance: none;\n -webkit-mask: url(\'',"') 0 0 no-repeat;\n mask: url('","') 0 0 no-repeat;\n -webkit-mask-size: 100%;\n mask-size: 100%;\n background: #fff;\n }\n\n .page-num {\n font-weight: bold;\n padding-bottom: 0;\n }\n\n .search-cta {\n padding: 10px 0;\n text-align: center;\n font-style: italic;\n }\n\n .results-container {\n padding-bottom: 2rem;\n }\n\n ul {\n padding: 0 0 2rem 0;\n margin: 0;\n list-style: none;\n }\n\n .result-item {\n cursor: pointer;\n margin-top: 8px;\n font-size: 12px;\n padding: 5px;\n border-radius: 4px;\n display: block;\n width: 100%;\n /* Reset button styles */\n background: none;\n border: none;\n text-align: left;\n font-family: inherit;\n transition: background-color 0.2s;\n }\n\n .result-item:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n .loading {\n text-align: center;\n }\n\n .loading p {\n padding: 0 0 1rem 0;\n margin: 0;\n font-size: 1.2rem;\n }\n\n ia-activity-indicator {\n display: block;\n width: 40px;\n height: 40px;\n margin: 0 auto;\n }\n "])),e,t,n,nn,o,rn,rn);return[Wt,Rt,i]}}])}(r.WF);function an(e){return an="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},an(e)}function sn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ln(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,cn(r.key),r)}}function cn(e){var t=function(e){if("object"!=an(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=an(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==an(t)?t:t+""}customElements.define("ia-book-search-results",on);var un,dn,hn,pn,fn,mn,vn,bn,yn,gn,kn,wn={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},Cn=function(){return function(e,t){return t&&ln(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=t.onProviderChange,o=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onBookSearchInitiated=this.onBookSearchInitiated.bind(this),this.onSearchStarted=this.onSearchStarted.bind(this),this.onSearchRequestError=this.onSearchRequestError.bind(this),this.onSearchResultsClicked=this.onSearchResultsClicked.bind(this),this.onSearchResultsChange=this.onSearchResultsChange.bind(this),this.onSearchResultsCleared=this.onSearchResultsCleared.bind(this),this.searchCanceledInMenu=this.searchCanceledInMenu.bind(this),this.bindEventListeners=this.bindEventListeners.bind(this),this.getMenuDetails=this.getMenuDetails.bind(this),this.getComponent=this.getComponent.bind(this),this.updateMenu=this.updateMenu.bind(this),this.onProviderChange=n,this.bookreader=o,this.icon=(0,r.qy)(Qt||(Qt=sn(['\n <ia-icon-search\n aria-hidden="true" role="presentation"\n style="width: var(--iconWidth); height: var(--iconHeight);"\n ></ia-icon-search>']))),this.label="Search inside",this.menuDetails=this.getMenuDetails(),this.id="search",this.component=this.getComponent(),this.bindEventListeners()},[{key:"getMenuDetails",value:function(){var e=wn,t=e.resultsCount,n=e.query;if(e.queryInProgress||!n)return r.s6;var o=1===t?"result":"results";return(0,r.qy)(Yt||(Yt=sn(["("," ",")"])),t,o)}},{key:"bindEventListeners",value:function(){var e=this;window.addEventListener("BookReader:SearchStarted",this.onSearchStarted),window.addEventListener("BookReader:SearchCallback",this.onSearchResultsChange),window.addEventListener("BookReader:SearchCallbackEmpty",function(t){e.onSearchRequestError(t,"noResults")}),window.addEventListener("BookReader:SearchCallbackNotIndexed",function(t){e.onSearchRequestError(t,"notIndexed")}),window.addEventListener("BookReader:SearchCallbackError",function(t){e.onSearchRequestError(t)}),window.addEventListener("BookReader:SearchResultsCleared",function(){e.onSearchResultsCleared()}),window.addEventListener("BookReader:SearchCanceled",function(t){e.onSearchCanceled(t)})}},{key:"onSearchCanceled",value:function(){wn={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},this.updateMenu({searchCanceled:!0}),this.bookreader.urlPlugin&&this.updateSearchInUrl()}},{key:"onSearchStarted",value:function(e){var t=e.detail.props,n=t.term,r=void 0===n?"":n,o=t.instance;o&&(this.bookreader=o),wn.query=r,wn.results=[],wn.resultsCount=0,wn.queryInProgress=!0,wn.errorMessage="",this.updateMenu()}},{key:"onBookSearchInitiated",value:function(e){var t=e.detail;wn.query=t.query,this.bookreader.search(wn.query)}},{key:"onSearchRequestError",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",o=e.detail.props,i=o.instance,a=o.results;i&&(this.bookreader=i);var s={noResults:"0 results",notIndexed:"This book hasn't been indexed for searching yet. We've just started indexing it,\n so search should be available soon. Please try again later. Thanks!",default:"Sorry, there was an error with your search. Please try again."},l=null!==(t=s[n])&&void 0!==t?t:s.default;wn.query=(null==a?void 0:a.q)||"",wn.results=[],wn.resultsCount=0,wn.queryInProgress=!1,wn.errorMessage=(0,r.qy)(en||(en=sn(['<p class="error">',"</p>"])),l),this.updateMenu()}},{key:"onSearchResultsChange",value:function(e){var t=e.detail.props,n=void 0===t?{}:t,r=n.instance,o=void 0===r?null:r,i=n.results,a=void 0===i?[]:i;o&&(this.bookreader=o);var s=a.matches||[],l=s.length,c=a.q;wn={results:s,resultsCount:l,query:c,queryInProgress:!1,errorMessage:""},this.updateMenu()}},{key:"searchCanceledInMenu",value:function(){this.bookreader.plugins.search.cancelSearchRequest()}},{key:"onSearchResultsCleared",value:function(){wn={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},this.updateMenu({openMenu:!1}),this.bookreader.plugins.search.searchView.clearSearchFieldAndResults(!1),this.bookreader.urlPlugin&&this.updateSearchInUrl()}},{key:"updateSearchInUrl",value:function(){this.bookreader.urlPlugin&&(this.bookreader.urlPlugin.pullFromAddressBar(),wn.query?this.bookreader.urlPlugin.setUrlParam("q",wn.query):this.bookreader.urlPlugin.removeUrlParam("q"))}},{key:"updateMenu",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.menuDetails=this.getMenuDetails(),this.component=this.getComponent(),this.onProviderChange(this.bookreader,e)}},{key:"getComponent",value:function(){var e=wn,t=e.query,n=e.results,o=e.queryInProgress,i=e.errorMessage;return(0,r.qy)(tn||(tn=sn(["\n <ia-book-search-results\n .query=","\n .results=","\n .errorMessage=","\n ?queryInProgress=","\n ?renderSearchAllFiles=","\n @resultSelected=","\n @bookSearchInitiated=","\n @bookSearchResultsCleared=","\n @bookSearchCanceled=","\n ></ia-book-search-results>\n "])),t,n,i,o,!1,this.onSearchResultsClicked,this.onBookSearchInitiated,this.onSearchResultsCleared,this.searchCanceledInMenu)}},{key:"onSearchResultsClicked",value:function(e){var t=e.detail;this.bookreader.plugins.search.jumpToMatch(t.match.matchIndex)}}])}(),xn=(n(2712),r.qy`
1725
+ <svg
1726
+ viewBox="0 0 100 100"
1727
+ xmlns="http://www.w3.org/2000/svg"
1728
+ >
1729
+ <g class="fill-color">
1730
+
1731
+ <path d="m50 80 33.3333333-43.3333333h-20v-36.6666667h-26.6666666v36.6666667h-20zm50 20v-13.3333333h-100v13.3333333z"/>
1732
+ </g>
1733
+ </svg>
1734
+ `);class Sn extends r.WF{static get styles(){return r.AH`
1735
+ :host {
1736
+ width: var(--iconWidth, 'auto');
1737
+ height: var(--iconHeight, 'auto');
1738
+ }
1739
+
1740
+ .fill-color {
1741
+ fill: var(--iconFillColor);
1742
+ }
1743
+
1744
+ .stroke-color {
1745
+ stroke: var(--iconStrokeColor);
1746
+ }
1747
+ `}render(){return xn}}function On(e){return On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},On(e)}function Mn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Bn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,jn(r.key),r)}}function jn(e){var t=function(e){if("object"!=On(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=On(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==On(t)?t:t+""}function Pn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Pn=function(){return!!e})()}function En(e){return En=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},En(e)}function Ln(e,t){return Ln=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ln(e,t)}customElements.define("ia-icon-dl",Sn);var An,_n,Tn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=En(t),function(e,t){if(t&&("object"==On(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Pn()?Reflect.construct(t,n||[],En(e).constructor):t.apply(e,n))}(this,t)).downloads=[],e.expiration=0,e.renderHeader=!1,e.isBookProtected=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ln(e,t)}(t,e),function(e,t,n){return t&&Bn(e.prototype,t),n&&Bn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"formatsCount",get:function(){var e=this.downloads.length;return e?(0,r.qy)(un||(un=Mn(["<p>"," format","</p>"])),e,e>1?"s":""):(0,r.qy)(dn||(dn=Mn([""])))}},{key:"loanExpiryMessage",get:function(){return this.expiration?(0,r.qy)(hn||(hn=Mn(["<h2>These files will expire in "," days.</h2>"])),this.expiration):(0,r.qy)(pn||(pn=Mn([""])))}},{key:"renderDownloadOptions",value:function(){return this.downloads.map(function(e){return(0,r.qy)(fn||(fn=Mn(['\n <li>\n <a class="ia-button link primary" href="','">Get ',"</a>\n ","\n </li>\n "])),e.url,e.type,e.note?(0,r.qy)(mn||(mn=Mn(["<p>","</p>"])),e.note):(0,r.qy)(vn||(vn=Mn([""]))))})}},{key:"hasLCPOption",get:function(){var e=/^(LCP)/g;return this.downloads.some(function(t){var n;return null===(n=t.type)||void 0===n?void 0:n.match(e)})}},{key:"header",get:function(){return this.renderHeader?(0,r.qy)(bn||(bn=Mn(["\n <header>\n <h3>Downloadable files</h3>\n ","\n </header>\n "])),this.formatsCount):r.s6}},{key:"installLCPSoftwareMsg",get:function(){return(0,r.qy)(yn||(yn=Mn(['\n <p>For LCP downloads, make sure you have LCP software such as <a href="https://thorium.edrlab.org/" rel="noopener noreferrer nofollow" target="_blank">Thorium (desktop)</a>, <a href="https://apps.apple.com/us/app/cantook-by-aldiko/id1476410111" rel="noopener noreferrer nofollow" target="_blank">Cantook (iOS)</a> or <a href="https://play.google.com/store/apps/details?id=com.aldiko.android" rel="noopener noreferrer nofollow" target="_blank">Cantook (Android)</a> installed on your device.</p>\n '])))}},{key:"render",value:function(){return(0,r.qy)(gn||(gn=Mn(["\n ","\n ","\n <ul>","</ul>\n ","\n "])),this.header,this.loanExpiryMessage,this.renderDownloadOptions(),this.hasLCPOption?this.installLCPSoftwareMsg:r.s6)}}],[{key:"properties",get:function(){return{downloads:{type:Array},expiration:{type:Number},renderHeader:{type:Boolean},isBookProtected:{type:Boolean}}}},{key:"styles",get:function(){var e=(0,r.AH)(kn||(kn=Mn(["\n :host {\n display: block;\n height: 100%;\n padding: 1.5rem 0;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\n }\n\n a.close ia-icon {\n --iconWidth: 18px;\n --iconHeight: 18px;\n }\n a.close {\n justify-self: end;\n }\n\n header {\n display: flex;\n align-items: center;\n padding: 0 2rem;\n }\n header p {\n padding: 0;\n margin: 0;\n font-size: 1.2rem;\n font-weight: bold;\n font-style: italic;\n }\n header div {\n display: flex;\n align-items: baseline;\n } \n\n h2 {\n font-size: 1.6rem;\n }\n\n h3 {\n padding: 0;\n margin: 0 1rem 0 0;\n font-size: 1.4rem;\n }\n\n ul {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n p {\n margin: .3rem 0 0 0;\n }\n\n li,\n ul + p {\n padding-bottom: 1.2rem;\n font-size: 1.2rem;\n line-height: 140%;\n }\n "])));return[Rt,e]}}])}(r.WF);function zn(e){return zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zn(e)}function In(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function $n(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Hn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Dn(r.key),r)}}function Dn(e){var t=function(e){if("object"!=zn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=zn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zn(t)?t:t+""}customElements.define("ia-book-downloads",Tn);var qn={pdf:{type:"Encrypted Adobe PDF",url:"#",note:"PDF files contain high quality images of pages."},lcppdf:{type:"Get LCP PDF",url:"#",note:"PDF files contain high quality images of pages."},lcpepub:{type:"Get LCP ePub",url:"#",note:"ePub files are smaller in size, but may contain errors."},epub:{type:"Encrypted Adobe ePub",url:"#",note:"ePub files are smaller in size, but may contain errors."}},Rn={pdf:"PDF",epub:"ePub",lcppdf:"LCP PDF",lcpepub:"LCP ePub"},Fn=function(){return function(e,t){return t&&Hn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n,o=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.icon=(0,r.qy)(An||(An=$n(['<ia-icon-dl aria-hidden="true" role="presentation" style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-dl>']))),this.label="Downloadable files",this.menuDetails="",this.downloads=[],this.id="downloads",this.component="",this.isBookProtected=(null==o||null===(n=o.options)||void 0===n?void 0:n.isProtected)||!1},[{key:"update",value:function(e){this.computeAvailableTypes(e),this.component=this.menu,this.component.isBookProtected=this.isBookProtected;var t=1===this.downloads.length?"":"s";this.menuDetails="(".concat(this.downloads.length," format").concat(t,")")}},{key:"computeAvailableTypes",value:function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(function(t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return In(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?In(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),r=n[0],o=void 0===r?"":r,i=n[1],a=void 0===i?"":i,s=o.toLowerCase(),l=qn[s]||null;if(l){var c=e.isBookProtected?qn[s].type:Rn[s],u=Object.assign({},l,{url:a,type:c});t.push(u)}return t},[]);this.downloads=t}},{key:"menu",get:function(){return(0,r.qy)(_n||(_n=$n(["<ia-book-downloads .downloads=","></ia-book-downloads>"])),this.downloads)}}])}(),Wn=r.qy`
1748
+ <svg
1749
+ viewBox="0 0 24 24"
1750
+ xmlns="http://www.w3.org/2000/svg"
1751
+ >
1752
+ <path class="fill-color" d="m12 0c6.627417 0 12 5.372583 12 12s-5.372583 12-12 12-12-5.372583-12-12 5.372583-12 12-12zm0 2v20l.2664041-.0034797c5.399703-.1412166 9.7335959-4.562751 9.7335959-9.9965203 0-5.5228475-4.4771525-10-10-10z" fill-rule="evenodd" />
1753
+ </svg>
1754
+ `;class Vn extends r.WF{static get styles(){return r.AH`
1755
+ :host {
1756
+ width: var(--iconWidth, 'auto');
1757
+ height: var(--iconHeight, 'auto');
1758
+ }
1759
+
1760
+ .fill-color {
1761
+ fill: var(--iconFillColor);
1762
+ }
1763
+
1764
+ .stroke-color {
1765
+ stroke: var(--iconStrokeColor);
1766
+ }
1767
+ `}render(){return Wn}}customElements.define("ia-icon-visual-adjustment",Vn);var Nn=r.qy`
1768
+ <svg
1769
+ viewBox="0 0 100 100"
1770
+ xmlns="http://www.w3.org/2000/svg"
1771
+ >
1772
+ <g
1773
+ class="fill-color"
1774
+ fill="none"
1775
+ fill-rule="nonzero"
1776
+ >
1777
+ <path d="m2.3239824 87.3815869 25.8938394-23.8143095c-4.5929593-6.6937643-6.889439-14.1059452-6.889439-22.2365428 0-7.1360431 1.7567382-13.7186647 5.2702146-19.7478649 3.5134763-6.0292002 8.2852035-10.8003118 14.3151815-14.31333499 6.029978-3.51302314 12.6134488-5.26953471 19.7504125-5.26953471s13.7204346 1.75651157 19.7504126 5.26953471c6.029978 3.51302319 10.8017051 8.28413479 14.3151815 14.31333499 3.5134763 6.0292002 5.2702145 12.6118218 5.2702145 19.7478649s-1.7567382 13.7324143-5.2702145 19.7891137c-3.5134764 6.0566994-8.2852035 10.8415607-14.3151815 14.3545838-6.029978 3.5130232-12.6134489 5.2695347-19.7504126 5.2695347-8.5762743 0-16.3217363-2.5723212-23.2363861-7.7169637l-26.3063807 24.2302349c-1.27200216 1.1618413-2.76631826 1.742762-4.48294825 1.742762-1.826641 0-3.38971397-.6496687-4.68921892-1.949006s-1.94925743-2.8622087-1.94925743-4.688614c0-1.9364022.7746608-3.5955208 2.3239824-4.9773557zm58.3436469-19.9162976c7.1919692 0 13.3331041-2.5585716 18.4234048-7.6757149s7.635451-11.2712357 7.635451-18.4622772-2.5451503-13.3313843-7.635451-18.4210284-11.2314356-7.6344661-18.4234048-7.6344661-13.3331042 2.544822-18.4234049 7.6344661-7.635451 11.2299869-7.635451 18.4210284 2.5451503 13.3451339 7.635451 18.4622772 11.2314357 7.6757149 18.4234049 7.6757149zm-14.9374313-21.3256316h31.2878163v-9.5422233h-31.2878163z"/>
1778
+ </g>
1779
+ </svg>
1780
+ `;class Zn extends r.WF{static get styles(){return r.AH`
1781
+ :host {
1782
+ width: var(--iconWidth, 'auto');
1783
+ height: var(--iconHeight, 'auto');
1784
+ }
1785
+
1786
+ .fill-color {
1787
+ fill: var(--iconFillColor);
1788
+ }
1789
+
1790
+ .stroke-color {
1791
+ stroke: var(--iconStrokeColor);
1792
+ }
1793
+ `}render(){return Nn}}customElements.define("ia-icon-magnify-minus",Zn);var Un,Gn,Jn,Xn,Kn,Qn,Yn,er=r.qy`
1794
+ <svg
1795
+ viewBox="0 0 100 100"
1796
+ xmlns="http://www.w3.org/2000/svg"
1797
+ >
1798
+ <g
1799
+ class="fill-color"
1800
+ fill="none"
1801
+ fill-rule="nonzero"
1802
+ >
1803
+ <path d="m2.40305276 87.4017263 25.81133064-23.7730295c-4.5356618-6.5723551-6.8034928-14.000283-6.8034928-22.2837838 0-7.1236734 1.7429868-13.6948847 5.2289603-19.7136338 3.4859736-6.0187491 8.2577006-10.7953163 14.3151813-14.32970144 6.0574806-3.53438517 12.6547027-5.30157776 19.7916662-5.30157776 10.8429591 0 20.0964884 3.85236545 27.760588 11.5570964 7.6640996 7.7047309 11.4950036 16.9684802 11.4927136 27.791248 0 10.8799585-3.8309059 20.1574336-11.4927136 27.8324254-7.6618077 7.6749917-16.915337 11.5124876-27.760588 11.5124876-8.6312796 0-16.431747-2.5678624-23.4014021-7.7035871l-26.1413636 24.188234c-1.21699671 1.2147305-2.73881553 1.8220957-4.56545649 1.8220957s-3.3897139-.6485425-4.68921882-1.9456276c-1.29950493-1.297085-1.94925739-2.8572473-1.94925739-4.6804867 0-1.8781426.80216353-3.5343852 2.4064906-4.9687279zm58.34020784-19.878343c7.1369635 0 13.264347-2.5678623 18.3821503-7.7035871 5.1178034-5.1357247 7.676705-11.2928753 7.676705-18.4714518s-2.5589016-13.3082755-7.676705-18.3890972c-5.1178033-5.0808217-11.2451868-7.6212325-18.3821503-7.6212325-7.2469746 0-13.4156121 2.5404108-18.5059127 7.6212325s-7.6354509 11.2105207-7.6354509 18.3890972 2.5589016 13.3357271 7.676705 18.4714518c5.1178033 5.1357248 11.2726895 7.7035871 18.4646586 7.7035871zm-13.3594607-21.8685793h10.206958v10.1879511h7.2194718v-10.1879511h10.206958v-7.206028h-10.206958v-10.187951h-7.2194718v10.187951h-10.206958z"/>
1804
+ </g>
1805
+ </svg>
1806
+ `;class tr extends r.WF{static get styles(){return r.AH`
1807
+ :host {
1808
+ width: var(--iconWidth, 'auto');
1809
+ height: var(--iconHeight, 'auto');
1810
+ }
1811
+
1812
+ .fill-color {
1813
+ fill: var(--iconFillColor);
1814
+ }
1815
+
1816
+ .stroke-color {
1817
+ stroke: var(--iconStrokeColor);
1818
+ }
1819
+ `}render(){return er}}function nr(e){return nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nr(e)}function rr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function or(e){return function(e){if(Array.isArray(e))return ir(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ir(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ir(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ir(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ar(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,sr(r.key),r)}}function sr(e){var t=function(e){if("object"!=nr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=nr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nr(t)?t:t+""}function lr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(lr=function(){return!!e})()}function cr(e){return cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cr(e)}function ur(e,t){return ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ur(e,t)}customElements.define("ia-icon-magnify-plus",tr);var dr,hr,pr=function(e){return"visualAdjustment".concat(e)},fr={optionChange:pr("OptionChanged"),zoomIn:pr("ZoomIn"),zoomOut:pr("ZoomOut")},mr=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=cr(t),function(e,t){if(t&&("object"==nr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,lr()?Reflect.construct(t,n||[],cr(e).constructor):t.apply(e,n))}(this,t)).activeCount=0,e.options=[],e.renderHeader=!1,e.showZoomControls=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ur(e,t)}(t,e),function(e,t,n){return t&&ar(e.prototype,t),n&&ar(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"firstUpdated",value:function(){this.activeCount=this.activeOptions.length,this.emitOptionChangedEvent()}},{key:"activeOptions",get:function(){return this.options.reduce(function(e,t){return t.active?[].concat(or(e),[t.id]):e},[])}},{key:"prepareEventDetails",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{options:this.options,activeCount:this.activeCount,changedOptionId:e}}},{key:"emitOptionChangedEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.prepareEventDetails(e);this.dispatchEvent(new CustomEvent(fr.optionChange,{bubbles:!0,composed:!0,detail:t}))}},{key:"emitZoomIn",value:function(){this.dispatchEvent(new CustomEvent(fr.zoomIn))}},{key:"emitZoomOut",value:function(){this.dispatchEvent(new CustomEvent(fr.zoomOut))}},{key:"changeActiveStateFor",value:function(e){var t=or(this.options),n=t.find(function(t){return t.id===e});if(n.active=!n.active,this.options=t,this.activeCount=this.activeOptions.length,this.emitOptionChangedEvent(n.id),n.active&&void 0!==n.value){var r=this.shadowRoot.querySelector('input[name="'.concat(n.id,'_range"]'));requestAnimationFrame(function(){null==r||r.focus()})}}},{key:"setRangeValue",value:function(e,t){var n=or(this.options);n.find(function(t){return t.id===e}).value=t,this.options=or(n)}},{key:"rangeSlider",value:function(e){var t=this;return(0,r.qy)(Un||(Un=rr(["\n <label class=",'>\n <span class="sr-only">','</span>\n <input\n type="range"\n name="','_range"\n min=',"\n max=","\n step=","\n .value=","\n aria-valuetext=","\n @input=","\n @change=",'\n />\n <span aria-hidden="true">',"%</span>\n </label>\n "])),"range".concat(e.active?" visible":""),e.name,e.id,e.min||0,e.max||100,e.step||1,e.value,"".concat(e.value,"%"),function(n){return t.setRangeValue(e.id,n.target.value)},function(){return t.emitOptionChangedEvent()},e.value)}},{key:"adjustmentCheckbox",value:function(e){var t=this;return(0,r.qy)(Gn||(Gn=rr(['\n <div\n class="adjustment-option ','">\n <label class="checkbox-label">\n ','\n <input\n type="checkbox"\n @change=',"\n ?checked=","\n />\n </label>\n ","\n </div>\n "])),m({active:e.active,"has-range":void 0!==e.value}),e.name,function(){return t.changeActiveStateFor(e.id)},e.active,void 0!==e.value?this.rangeSlider(e):r.s6)}},{key:"headerSection",get:function(){var e=this.activeCount?(0,r.qy)(Jn||(Jn=rr(["<p>("," active)</p>"])),this.activeCount):r.s6,t=(0,r.qy)(Xn||(Xn=rr(["<header>\n <h3>Visual adjustments</h3>\n ","\n </header>"])),e);return this.renderHeader?t:r.s6}},{key:"zoomControls",get:function(){return(0,r.qy)(Kn||(Kn=rr(['\n <h4>Adjust zoom</h4>\n <button class="zoom_out" @click=',' title="Zoom out" aria-label="Zoom out">\n <ia-icon-magnify-minus aria-hidden="true" role="presentation"></ia-icon-magnify-minus>\n </button>\n <button class="zoom_in" @click=',' title="Zoom in" aria-label="Zoom in">\n <ia-icon-magnify-plus aria-hidden="true" role="presentation"></ia-icon-magnify-plus>\n </button>\n '])),this.emitZoomOut,this.emitZoomIn)}},{key:"render",value:function(){return(0,r.qy)(Qn||(Qn=rr(["\n ","\n ","\n ","\n "])),this.headerSection,qe(this.options,function(e){return e.id},this.adjustmentCheckbox.bind(this)),this.showZoomControls?this.zoomControls:r.s6)}}],[{key:"properties",get:function(){return{activeCount:{type:Number},options:{type:Array},renderHeader:{type:Boolean},showZoomControls:{type:Boolean}}}},{key:"styles",get:function(){var e=(0,r.AH)(Yn||(Yn=rr(['\n :host {\n display: block;\n height: 100%;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\n padding: 10px 10px 0 0;\n }\n\n header {\n display: flex;\n align-items: baseline;\n }\n\n h3 {\n padding: 0;\n margin: 0 1rem 0 0;\n font-size: 1.6rem;\n }\n\n header p {\n padding: 0;\n margin: 0;\n font-size: 1.2rem;\n font-weight: bold;\n font-style: italic;\n }\n\n .adjustment-option {\n border: 2px solid transparent;\n border-radius: 4px;\n margin-bottom: 4px;\n }\n .adjustment-option.has-range.active {\n border: 2px solid rgba(255, 255, 255, 0.2);\n }\n\n .checkbox-label {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 1.4rem;\n font-weight: bold;\n cursor: pointer;\n padding: 6px 8px;\n transition: background-color 0.2s;\n border-radius: inherit;\n }\n .checkbox-label:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n .adjustment-option.has-range.active > .checkbox-label {\n border-radius: 4px 4px 0 0;\n }\n\n [type="checkbox"] {\n transform: scale(1.5);\n }\n\n .range {\n display: none;\n padding: 10px;\n align-items: center;\n gap: 10px;\n }\n .range.visible {\n display: flex;\n }\n .range input[type="range"] {\n flex: 1;\n }\n\n h4 {\n padding: 1rem 0;\n margin: 0;\n font-size: 1.4rem;\n }\n\n button {\n -webkit-appearance: none;\n appearance: none;\n border: none;\n background: transparent;\n cursor: pointer;\n --iconFillColor: var(--primaryTextColor);\n --iconStrokeColor: var(--primaryTextColor);\n height: 4rem;\n width: 4rem;\n transition: background-color 0.2s;\n border-radius: 4px;\n }\n\n button:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n '])));return[Wt,e]}}])}(r.WF);function vr(e){return vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vr(e)}function br(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function yr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function gr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kr(r.key),r)}}function kr(e){var t=function(e){if("object"!=vr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vr(t)?t:t+""}customElements.define("ia-book-visual-adjustments",mr);var wr,Cr,xr=[{id:"brightness",name:"Adjust brightness",active:!1,min:0,max:200,step:1,value:120},{id:"contrast",name:"Adjust contrast",active:!1,min:0,max:200,step:1,value:120},{id:"invert",name:"Invert colors (dark mode)",active:!1},{id:"grayscale",name:"Convert to grayscale",active:!1}],Sr=function(){return function(e,t){return t&&gr(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=t.onProviderChange,o=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onProviderChange=n,this.bookContainer=o.refs.$brContainer,this.bookreader=o,this.onAdjustmentChange=this.onAdjustmentChange.bind(this),this.optionUpdateComplete=this.optionUpdateComplete.bind(this),this.updateOptionsCount=this.updateOptionsCount.bind(this),this.onZoomIn=this.onZoomIn.bind(this),this.onZoomOut=this.onZoomOut.bind(this),this.activeCount=0,this.icon=(0,r.qy)(dr||(dr=yr(['<ia-icon-visual-adjustment aria-hidden="true" role="presentation" style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-visual-adjustment>']))),this.label="Visual Adjustments",this.menuDetails=this.updateOptionsCount(),this.id="visualAdjustments",this.component=(0,r.qy)(hr||(hr=yr(["\n <ia-book-visual-adjustments\n .options=","\n @visualAdjustmentOptionChanged=","\n @visualAdjustmentZoomIn=","\n @visualAdjustmentZoomOut=","\n ></ia-book-visual-adjustments>\n "])),xr,this.onAdjustmentChange,this.onZoomIn,this.onZoomOut)},[{key:"onZoomIn",value:function(){this.bookreader.zoom(1)}},{key:"onZoomOut",value:function(){this.bookreader.zoom(-1)}},{key:"onAdjustmentChange",value:function(e){var t=e.detail,n={brightness:function(e){return"brightness(".concat(e,"%)")},contrast:function(e){return"contrast(".concat(e,"%)")},grayscale:function(){return"grayscale(100%)"},invert:function(){return"invert(100%)"}},r=t.options.reduce(function(e,t){var r="".concat(t.active?n[t.id](t.value):"");return r?[].concat(function(e){return function(e){if(Array.isArray(e))return br(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return br(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?br(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e),[r]):e},[]).join(" ");this.bookContainer.css("filter",r),this.optionUpdateComplete(e)}},{key:"optionUpdateComplete",value:function(e){this.activeCount=e.detail.activeCount,this.updateOptionsCount(e),this.onProviderChange()}},{key:"updateOptionsCount",value:function(){this.menuDetails="(".concat(this.activeCount," active)")}}])}();function Or(e){return Or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Or(e)}function Mr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Br(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,jr(r.key),r)}}function jr(e){var t=function(e){if("object"!=Or(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Or(t)?t:t+""}function Pr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Pr=function(){return!!e})()}function Er(e){return Er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Er(e)}function Lr(e,t){return Lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lr(e,t)}var Ar,_r,Tr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Er(t),function(e,t){if(t&&("object"==Or(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Pr()?Reflect.construct(t,n||[],Er(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Lr(e,t)}(t,e),function(e,t,n){return t&&Br(e.prototype,t),n&&Br(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(){var e=this;return(0,r.qy)(wr||(wr=Mr(['\n <div>\n <button class="delete" @click=',">Delete</button>\n <button @click=",">Cancel</button>\n </div>\n "])),function(){return e.deleteAction({detail:{id:"".concat(e.pageID)}})},function(){return e.cancelAction()})}}],[{key:"styles",get:function(){return(0,r.AH)(Cr||(Cr=Mr(['\n div {\n display: flex;\n justify-content: center;\n padding-top: 2rem;\n }\n\n button {\n appearance: none;\n padding: 0.5rem 1rem;\n margin: 0 .5rem;\n box-sizing: border-box;\n font: 1.3rem "Helvetica Neue", Helvetica, Arial, sans-serif;\n color: var(--primaryTextColor);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n background: var(--primaryCTAFill);\n }\n\n .delete {\n background: var(--primaryErrorCTAFill);\n }\n '])))}},{key:"properties",get:function(){return{cancelAction:{type:Function},deleteAction:{type:Function},pageID:{type:String}}}}])}(r.WF);function zr(e){return zr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zr(e)}function Ir(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function $r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Hr(r.key),r)}}function Hr(e){var t=function(e){if("object"!=zr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=zr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zr(t)?t:t+""}function Dr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Dr=function(){return!!e})()}function qr(e){return qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qr(e)}function Rr(e,t){return Rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Rr(e,t)}customElements.define("delete-modal-actions",Tr);var Fr,Wr=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=qr(t),function(e,t){if(t&&("object"==zr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Dr()?Reflect.construct(t,n||[],qr(e).constructor):t.apply(e,n))}(this,t)).state="hollow",e.side=void 0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Rr(e,t)}(t,e),function(e,t,n){return t&&$r(e.prototype,t),n&&$r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"handleClick",value:function(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("bookmarkButtonClicked"))}},{key:"title",get:function(){return"".concat("hollow"===this.state?"Add":"Remove"," bookmark")}},{key:"render",value:function(){var e=this.side||"right";return(0,r.qy)(Ar||(Ar=Ir(["\n <button title="," @click="," class=",">\n <icon-bookmark state=",' aria-hidden="true"></icon-bookmark>\n </button>\n '])),this.title,this.handleClick,e,this.state)}}],[{key:"styles",get:function(){return(0,r.AH)(_r||(_r=Ir(["\n button {\n -webkit-appearance: none;\n appearance: none;\n outline: 0;\n border: none;\n padding: 0;\n height: 4rem;\n width: 4rem;\n background: transparent;\n cursor: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 0 16 24' width='16'%3E%3Cg fill='%23333' fill-rule='evenodd'%3E%3Cpath d='m15 0c.5522847 0 1 .44771525 1 1v23l-8-5.4545455-8 5.4545455v-23c0-.55228475.44771525-1 1-1zm-2 2h-10c-.51283584 0-.93550716.38604019-.99327227.88337887l-.00672773.11662113v18l6-4.3181818 6 4.3181818v-18c0-.51283584-.3860402-.93550716-.8833789-.99327227z'/%3E%3Cpath d='m8.75 6v2.25h2.25v1.5h-2.25v2.25h-1.5v-2.25h-2.25v-1.5h2.25v-2.25z' fill-rule='nonzero'/%3E%3C/g%3E%3C/svg%3E\"), pointer;\n position: relative;\n }\n button > * {\n display: block;\n position: absolute;\n top: 0.2rem;\n }\n button.left > * {\n left: 0.2rem;\n }\n\n button.right > * {\n right: 0.2rem;\n }\n "])))}},{key:"properties",get:function(){return{side:{type:String},state:{type:String}}}}])}(r.WF);function Vr(e){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vr(e)}function Nr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Zr(r.key),r)}}function Zr(e){var t=function(e){if("object"!=Vr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vr(t)?t:t+""}function Ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ur=function(){return!!e})()}function Gr(e){return Gr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gr(e)}function Jr(e,t){return Jr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jr(e,t)}customElements.define("bookmark-button",Wr),n(4423),n(739),n(8940),n(3362),n(1699);var Xr,Kr,Qr,Yr,eo,to,no,ro,oo,io=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Gr(t),function(e,t){if(t&&("object"==Vr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ur()?Reflect.construct(t,n||[],Gr(e).constructor):t.apply(e,n))}(this,t)).url="https://archive.org/account/login",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jr(e,t)}(t,e),function(e,t,n){return t&&Nr(e.prototype,t),n&&Nr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(){return(0,r.qy)(Fr||(Fr=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <p>A free account is required to save and access bookmarks.</p>\n <a class="ia-button link primary" href="','">Log in</a>\n '])),this.url)}}],[{key:"properties",get:function(){return{url:{type:String}}}},{key:"styles",get:function(){return Rt}}])}(r.WF);function ao(e){return ao="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ao(e)}function so(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function lo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function co(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lo(Object(n),!0).forEach(function(t){uo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uo(e,t,n){return(t=bo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ho(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return po(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,s=0,l=e,h.n=n,a}};function p(n,r){for(s=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],p=h.p,f=i[2];n>3?(o=f===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(s=0,h.v=r,h.n=i[1]):p<f&&(o=n<3||i[0]>r||r>f)&&(i[4]=n,i[5]=r,h.n=f,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,f),s=u,l=f;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=h.n<0)?l:n.call(r,h))!==a)break}catch(t){i=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(po(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,po(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,po(d,"constructor",c),po(c,"constructor",l),l.displayName="GeneratorFunction",po(c,o,"GeneratorFunction"),po(d),po(d,o,"Generator"),po(d,r,function(){return this}),po(d,"toString",function(){return"[object Generator]"}),(ho=function(){return{w:i,m:h}})()}function po(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}po=function(e,t,n,r){function i(t,n){po(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},po(e,t,n,r)}function fo(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function mo(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){fo(i,r,o,a,s,"next",e)}function s(e){fo(i,r,o,a,s,"throw",e)}a(void 0)})}}function vo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bo(r.key),r)}}function bo(e){var t=function(e){if("object"!=ao(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ao(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ao(t)?t:t+""}function yo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(yo=function(){return!!e})()}function go(e){return go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},go(e)}function ko(e,t){return ko=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ko(e,t)}customElements.define("bookmarks-login",io);var wo,Co={endpoint:"/services/bookmarks.php",headers:{"Content-Type":"application/json"},delete:function(e){return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier,"&page_num=").concat(e),{credentials:"same-origin",method:"DELETE",headers:this.headers})},get:function(e){return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier,"&page_num=").concat(e),{credentials:"same-origin",method:"GET",headers:this.headers})},getAll:function(){return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier),{credentials:"same-origin",method:"GET",headers:this.headers})},post:function(e){return this.sendBookmarkData(e,"POST")},put:function(e){return this.sendBookmarkData(e,"POST")},sendBookmarkData:function(e,t){var n={note:e.note,color:e.color};return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier,"&page_num=").concat(e.id),{credentials:"same-origin",method:t,headers:this.headers,body:JSON.stringify({notes:n})})}},xo=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=go(t),function(e,t){if(t&&("object"==ao(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,yo()?Reflect.construct(t,n||[],go(e).constructor):t.apply(e,n))}(this,t)).bookmarks=[],e.bookreader={},e.editedBookmark={},e.modal=void 0,e.loginOptions={loginClicked:function(){},loginUrl:""},e.displayMode="bookmarks",e.bookmarkColors=[{id:0,className:"red"},{id:1,className:"blue"},{id:2,className:"green"}],e.defaultColor=e.bookmarkColors[0],e.api=Co,e.deleteModalConfig=new Ue({title:"Delete Bookmark",headline:"This bookmark contains a note. Deleting it will permanently delete the note. Are you sure?",headerColor:"#194880"}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ko(e,t)}(t,e),function(e,t,n){return t&&vo(e.prototype,t),n&&vo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"updated",value:function(e){e.has("displayMode")&&this.updateDisplay(),this.emitBookmarksChanged()}},{key:"setup",value:function(){this.api.identifier=this.getIdentifier(),"login"!==this.displayMode&&(this.fetchUserBookmarks(),this.setBREventListeners())}},{key:"getIdentifier",value:function(){return this.bookreader.bookId!==this.bookreader.subPrefix?"".concat(this.bookreader.bookId,"/").concat(this.bookreader.subPrefix):this.bookreader.bookId}},{key:"updateDisplay",value:function(){"bookmarks"===this.displayMode&&this.fetchUserBookmarks()}},{key:"fetchUserBookmarks",value:(o=mo(ho().m(function e(){return ho().w(function(e){for(;;)switch(e.n){case 0:if(this.api.identifier){e.n=1;break}return e.a(2);case 1:return e.n=2,this.fetchBookmarks();case 2:this.initializeBookmarks();case 3:return e.a(2)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"setBREventListeners",value:function(){var e=this;["3PageViewSelected"].forEach(function(t){window.addEventListener("BookReader:".concat(t),function(t){setTimeout(function(){e.renderBookmarkButtons()},100)})}),["pageChanged","1PageViewSelected","2PageViewSelected"].forEach(function(t){window.addEventListener("BookReader:".concat(t),function(t){setTimeout(function(){e.renderBookmarkButtons(),e.markActiveBookmark()},100)})}),["zoomOut","zoomIn","resize"].forEach(function(t){window.addEventListener("BookReader:".concat(t),function(){e.renderBookmarkButtons()})})}},{key:"initializeBookmarks",value:function(){this.renderBookmarkButtons(),this.markActiveBookmark(!0),this.emitBookmarksChanged()}},{key:"formatBookmark",value:function(e){var n=e.leafNum,r=void 0===n?"":n,o=e.notes,i=void 0===o?{}:o,a=i.note,s=void 0===a?"":a,l=i.color,c={note:s,color:this.getBookmarkColor(l)?l:this.defaultColor.id},u=t.formatPage(this.bookreader.book.getPageNum(r)),d=this.bookreader.book.getPageURI("".concat(r).replace(/\D/g,""),32);return co(co({},c),{},{id:r,leafNum:r,page:u,thumbnail:d})}},{key:"fetchBookmarks",value:(n=mo(ho().m(function e(){var t,n,r,o,i,a,s,l,c,u,d=this;return ho().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.api.getAll().then(function(e){return e.text()});case 1:t=e.v;try{n=JSON.parse(t)}catch(e){n={error:e.message}}return o=(r=n).success,i=r.error,a=void 0===i?"Something happened while fetching bookmarks.":i,s=r.value,l=void 0===s?[]:s,o||null===(c=console)||void 0===c||c.warn("Error fetching bookmarks",a),u={},Object.keys(l).forEach(function(e){var t=l[e],n=parseInt(e,10),r=d.formatBookmark(co(co({},t),{},{leafNum:n}));u[e]=r}),this.bookmarks=u,e.a(2,u)}},e,this)})),function(){return n.apply(this,arguments)})},{key:"emitBookmarksChanged",value:function(){this.dispatchEvent(new CustomEvent("bookmarksChanged",{bubbles:!0,composed:!0,detail:{bookmarks:this.bookmarks}}))}},{key:"emitBookmarkButtonClicked",value:function(){this.dispatchEvent(new CustomEvent("bookmarkButtonClicked",{bubbles:!0,composed:!0,detail:{editedBookmark:this.editedBookmark}}))}},{key:"bookmarkButtonClicked",value:function(e){this.getBookmark(e)?this.confirmDeletion(e):this.createBookmark(e)}},{key:"renderBookmarkButtons",value:function(){var e=this;this.bookreader.$(".BRpagecontainer").not(".BRemptypage").get().forEach(function(t){var n=t.querySelector(".bookmark-button");n&&n.remove();var o=+t.classList.value.match(/pagediv\d+/)[0].replace(/\D/g,""),i=e.getBookmark(o),a=i?"filled":"hollow";if(e.bookreader.book.getPage(o).isViewable){var s=document.createElement("div");["mousedown","mouseup"].forEach(function(e){s.addEventListener(e,function(e){return e.stopPropagation()})}),s.classList.add("bookmark-button",a),i&&s.classList.add(e.getBookmarkColor(i.color));var l="L"===t.getAttribute("data-side")&&e.bookreader.mode===e.bookreader.constMode2up?"left":"right";(0,r.XX)((0,r.qy)(Xr||(Xr=so(["\n <bookmark-button\n @bookmarkButtonClicked=","\n state=","\n side=","\n ></bookmark-button>"])),function(){return e.bookmarkButtonClicked(o)},a,l),s),t.appendChild(s)}})}},{key:"markActiveBookmark",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.bookreader,n=t.mode,r=t.constMode2up,o=t.constModeThumb,i=this.bookreader.currentIndex();if(n!==o){if(n===r&&this.bookreader.displayedIndices.includes(+this.activeBookmarkID))return;this.bookmarks[i]?this.activeBookmarkID=i:this.activeBookmarkID=""}else{var a=this.bookmarks[i];e&&a&&(this.activeBookmarkID=i)}}},{key:"bookmarkEdited",value:function(e){var t=e.detail,n=t.bookmark.id===this.editedBookmark.id;this.editedBookmark=n?{}:t.bookmark}},{key:"getBookmark",value:function(e){return this.bookmarks[e]}},{key:"getBookmarkColor",value:function(e){var t;return null===(t=this.bookmarkColors.find(function(t){return t.id===e}))||void 0===t?void 0:t.className}},{key:"addBookmark",value:function(){var e=this.bookreader.currentIndex();if(this.bookreader.mode===this.bookreader.constMode2up){var t=this.bookreader.displayedIndices;e=t[t.length-1]}this.createBookmark(e)}},{key:"createBookmark",value:function(e){var t=this.getBookmark(e);if(t)return this.bookmarkEdited({detail:{bookmark:t}}),void this.emitBookmarkButtonClicked();this.editedBookmark=this.formatBookmark({leafNum:e}),this.api.post(this.editedBookmark),this.bookmarks[e]=this.editedBookmark,this.activeBookmarkID=e,this.disableAddBookmarkButton=!0,this.renderBookmarkButtons(),this.emitBookmarkButtonClicked()}},{key:"bookmarkSelected",value:function(e){var t=e.detail.bookmark.leafNum;this.bookreader.jumpToPage("".concat(this.bookreader.book.getPageNum("".concat(t).replace(/\D/g,"")))),this.activeBookmarkID=t}},{key:"saveBookmark",value:function(e){var t=e.detail,n=this.bookmarks[t.bookmark.id];Object.assign(n,t.bookmark),this.api.put(n),this.editedBookmark={},this.renderBookmarkButtons()}},{key:"confirmDeletion",value:function(e){this.getBookmark(e).note?this.displayDeletionModal(e):this.deleteBookmark({detail:{id:"".concat(e)}})}},{key:"displayDeletionModal",value:function(e){var t=this,n=(0,r.qy)(Kr||(Kr=so(["\n <delete-modal-actions\n .deleteAction=","\n .cancelAction=","\n .pageID=","\n ></delete-modal-actions>\n "])),function(){return t.deleteBookmark({detail:{id:"".concat(e)}})},function(){return t.modal.closeModal()},e);this.modal.showModal({config:this.deleteModalConfig,customModalContent:n})}},{key:"deleteBookmark",value:function(e){var t=e.detail,n=t.id,r=this.bookmarks;delete r[n],this.bookmarks=co({},r),this.api.delete(t.id),this.editedBookmark={},this.modal.closeModal(),this.renderBookmarkButtons()}},{key:"shouldEnableAddBookmarkButton",get:function(){var e=this.bookreader.mode===this.bookreader.constMode2up?this.bookreader.displayedIndices[this.bookreader.displayedIndices.length-1]:this.bookreader.currentIndex();return!!this.getBookmark(e)}},{key:"allowAddingBookmark",get:function(){return this.bookreader.mode!==this.bookreader.constModeThumb}},{key:"addBookmarkButton",get:function(){return(0,r.qy)(Qr||(Qr=so(['\n <button\n class="ia-button primary"\n ?disabled=',"\n @click=",">\n Add bookmark\n </button>\n "])),this.shouldEnableAddBookmarkButton,this.addBookmark)}},{key:"bookmarksList",get:function(){return(0,r.qy)(Yr||(Yr=so(["\n <ia-bookmarks-list\n @bookmarkEdited=","\n @bookmarkSelected=","\n @saveBookmark=","\n @deleteBookmark=","\n .editedBookmark=","\n .bookmarks=","\n .activeBookmarkID=","\n .bookmarkColors=","\n .defaultBookmarkColor=",">\n </ia-bookmarks-list>\n "])),this.bookmarkEdited,this.bookmarkSelected,this.saveBookmark,this.deleteBookmark,this.editedBookmark,co({},this.bookmarks),this.activeBookmarkID,this.bookmarkColors,this.defaultColor)}},{key:"bookmarkHelperMessage",get:function(){return(0,r.qy)(eo||(eo=so(["<p>Please use 1up or 2up view modes to add bookmark.</p>"])))}},{key:"render",value:function(){var e=this,t=(0,r.qy)(to||(to=so(["\n ","\n ","\n "])),this.bookmarksList,this.allowAddingBookmark?this.addBookmarkButton:this.bookmarkHelperMessage);return(0,r.qy)(no||(no=so(['\n <section class="bookmarks">\n ',"\n </section>\n "])),"login"===this.displayMode?(0,r.qy)(ro||(ro=so(["<bookmarks-login\n @click=","\n .url=","></bookmarks-login>"])),function(){return e.loginOptions.loginClicked()},this.loginOptions.loginUrl):t)}}],[{key:"properties",get:function(){return{activeBookmarkID:{type:String},bookmarks:{type:Array},bookreader:{type:Object},displayMode:{type:String},editedBookmark:{type:Object},deleteModalConfig:{type:Object},modal:{attribute:!1},loginOptions:{type:Object,attribute:!1}}}},{key:"styles",get:function(){var e=(0,r.AH)(oo||(oo=so(["\n .bookmarks {\n height: 100%;\n overflow: hidden;\n padding-bottom: 20px;\n }\n\n .list ia-bookmark-edit {\n display: none;\n }\n\n .edit ia-bookmarks-list {\n display: none;\n }\n "])));return[Rt,e]}},{key:"formatPage",value:function(e){return isNaN(+e)?"(".concat(e.replace(/\D/g,""),")"):e}}]);var n,o}(r.WF);customElements.define("ia-bookmarks",xo);var So,Oo,Mo,Bo,jo,Po=(0,r.AH)(wo||(wo=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n .blue {\n --iconFillColor: var(--blueBookmarkColor, #0023f5);\n }\n\n .red {\n --iconFillColor: var(--redBookmarkColor, #eb3223);\n }\n\n .green {\n --iconFillColor: var(--greenBookmarkColor, #75ef4c);\n }\n"])));function Eo(e){return Eo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Eo(e)}function Lo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ao(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_o(r.key),r)}}function _o(e){var t=function(e){if("object"!=Eo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Eo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Eo(t)?t:t+""}function To(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(To=function(){return!!e})()}function zo(e){return zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zo(e)}function Io(e,t){return Io=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Io(e,t)}var $o=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=zo(t),function(e,t){if(t&&("object"==Eo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,To()?Reflect.construct(t,n||[],zo(e).constructor):t.apply(e,n))}(this,t)).bookmark={},e.bookmarkColors=[],e.renderHeader=!1,e.showBookmark=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Io(e,t)}(t,e),function(e,t,n){return t&&Ao(e.prototype,t),n&&Ao(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"emitSaveEvent",value:function(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("saveBookmark",{detail:{bookmark:this.bookmark}}))}},{key:"emitDeleteEvent",value:function(){this.dispatchEvent(new CustomEvent("deleteBookmark",{detail:{id:this.bookmark.id}}))}},{key:"emitColorChangedEvent",value:function(e){this.dispatchEvent(new CustomEvent("bookmarkColorChanged",{detail:{bookmarkId:this.bookmark.id,colorId:e}}))}},{key:"changeColorTo",value:function(e){this.bookmark.color=e,this.emitColorChangedEvent(e)}},{key:"updateNote",value:function(e){this.bookmark.note=e.currentTarget.value}},{key:"bookmarkColor",value:function(e){var t=this;return(0,r.qy)(So||(So=Lo(['\n <div class="color-option">\n <input type="radio" name="color" id="color_','" .value='," @change="," ?checked=",'>\n <label for="color_','" title=',">\n <icon-bookmark class=",' aria-hidden="true"></icon-bookmark>\n </label>\n </div>\n '])),e.id,e.id,function(){return t.changeColorTo(e.id)},this.bookmark.color===e.id,e.id,e.className,e.className)}},{key:"bookmarkTemplate",get:function(){return(0,r.qy)(Oo||(Oo=Lo(['\n <div class="bookmark">\n <img src='," />\n <h4>Page ","</h4>\n </div>\n "])),this.bookmark.thumbnail,this.bookmark.page)}},{key:"render",value:function(){return(0,r.qy)(Mo||(Mo=Lo(["\n ","\n ",'\n <form action="" method="put" @submit=','>\n <label for="note">Note <small>(optional)</small></label>\n <textarea rows="4" cols="80" name="note" id="note" @change=',">",'</textarea>\n <fieldset>\n <legend>Bookmark color</legend>\n <div class="color-options">\n ','\n </div>\n </fieldset>\n <div class="actions">\n <button type="button" class="ia-button cancel" @click=','>Delete</button>\n <input class="ia-button" type="submit" value="Save">\n </div>\n </form>\n '])),this.renderHeader?t.headerSection:r.s6,this.showBookmark?this.bookmarkTemplate:r.s6,this.emitSaveEvent,this.updateNote,this.bookmark.note,qe(this.bookmarkColors,function(e){return e.id},this.bookmarkColor.bind(this)),this.emitDeleteEvent)}}],[{key:"properties",get:function(){return{bookmark:{type:Object},bookmarkColors:{type:Array},renderHeader:{type:Boolean},showBookmark:{type:Boolean}}}},{key:"headerSection",get:function(){return(0,r.qy)(Bo||(Bo=Lo(["<header>\n <h3>Edit Bookmark</h3>\n </header>"])))}},{key:"styles",get:function(){var e=(0,r.AH)(jo||(jo=Lo(['\n :host {\n display: block;\n padding: 0 1rem 2rem 1rem;\n color: var(--primaryTextColor);\n }\n\n small {\n font-style: italic;\n }\n\n .bookmark {\n display: grid;\n grid-template-columns: 37px 1fr;\n grid-gap: 0 1rem;\n align-items: center;\n }\n\n h4 {\n margin: 0;\n font-size: 1.4rem;\n }\n\n fieldset {\n padding: 0;\n border: none;\n }\n\n label, legend {\n display: block;\n font-weight: bold;\n }\n\n p {\n padding: 0;\n margin: .5rem 0;\n font-size: 1.2rem;\n line-height: 120%;\n }\n\n textarea {\n width: 100%;\n margin-bottom: 2rem;\n box-sizing: border-box;\n font: normal 1.4rem "Helvetica Neue", Helvetica, Arial, sans-serif;\n resize: vertical;\n }\n\n .color-options {\n display: flex;\n gap: 10px;\n }\n\n .color-option {\n position: relative;\n }\n\n .color-option input {\n position: absolute;\n opacity: 0;\n width: 0;\n height: 0;\n pointer-events: none;\n }\n\n .color-option label {\n display: block;\n min-width: 50px;\n padding-top: .4rem;\n text-align: center;\n border: 1px solid transparent;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .color-option input:checked + label {\n border-color: var(--primaryTextColor);\n }\n\n .color-option input:focus + label {\n outline: 2px solid currentColor;\n outline-offset: 2px;\n }\n\n .color-option input:focus:not(:focus-visible) + label {\n outline: none;\n }\n\n input[type="submit"] {\n background: var(--primaryCTAFill);\n border-color: var(--primaryCTABorder);\n }\n\n button {\n background: var(--primaryErrorCTAFill);\n border-color: var(--primaryErrorCTABorder);\n }\n\n .button {\n -webkit-appearance: none;\n appearance: none;\n padding: .5rem 1rem;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .actions {\n margin-top: 20px;\n display: grid;\n grid-template-columns: auto auto;\n grid-gap: 0 1rem;\n justify-items: stretch;\n }\n '])));return[Rt,Po,e]}}])}(r.WF);customElements.define("ia-bookmark-edit",$o),n(6910);var Ho,Do,qo,Ro,Fo,Wo,Vo,No,Zo=r.qy`
1820
+ <svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg">
1821
+ <path
1822
+ class="fill-color"
1823
+ d="m15.6111048 9.3708338-9.52237183 9.5222966-5.14363353 1.0897111c-.42296707.0896082-.83849202-.1806298-.92810097-.6035935-.02266463-.1069795-.02266463-.2175207 0-.3245001l1.08971974-5.1435929 9.52237189-9.52229656zm-10.89310224 5.9110366-2.78094924-.5403869-.67567462 3.166657.83033407.8303275 3.16668096-.6756703zm14.82724244-12.05935921c.6114418.61143705.6055516 1.6086709-.0131615 2.22737904l-2.2405581 2.24054036-4.9820147-4.98197536 2.2405581-2.24054036c.618713-.61870814 1.6159506-.62460252 2.2273925-.01316547z"
1824
+ fill-rule="evenodd" />
1825
+ </svg>
1826
+ `;class Uo extends r.WF{static get styles(){return r.AH`
1827
+ :host {
1828
+ width: var(--iconWidth, 'auto');
1829
+ height: var(--iconHeight, 'auto');
1830
+ }
1831
+
1832
+ .fill-color {
1833
+ fill: var(--iconFillColor);
1834
+ }
1835
+
1836
+ .stroke-color {
1837
+ stroke: var(--iconStrokeColor);
1838
+ }
1839
+ `}render(){return Zo}}function Go(e){return Go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Go(e)}function Jo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Xo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ko(r.key),r)}}function Ko(e){var t=function(e){if("object"!=Go(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Go(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Go(t)?t:t+""}function Qo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Qo=function(){return!!e})()}function Yo(e){return Yo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yo(e)}function ei(e,t){return ei=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ei(e,t)}customElements.define("ia-icon-edit-pencil",Uo);var ti,ni=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Yo(t),function(e,t){if(t&&("object"==Go(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Qo()?Reflect.construct(t,n||[],Yo(e).constructor):t.apply(e,n))}(this,t)).activeBookmarkID=void 0,e.bookmarkColors=[],e.defaultBookmarkColor={},e.bookmarks={},e.editedBookmark={},e.renderHeader=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ei(e,t)}(t,e),function(e,t,n){return t&&Xo(e.prototype,t),n&&Xo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"emitEditEvent",value:function(e,t){this.dispatchEvent(new CustomEvent("bookmarkEdited",{detail:{bookmark:t}}))}},{key:"emitSelectedEvent",value:function(e){this.activeBookmarkID=e.id,this.dispatchEvent(new CustomEvent("bookmarkSelected",{detail:{bookmark:e}}))}},{key:"emitSaveBookmark",value:function(e){this.dispatchEvent(new CustomEvent("saveBookmark",{detail:{bookmark:e}}))}},{key:"emitDeleteBookmark",value:function(e){this.dispatchEvent(new CustomEvent("deleteBookmark",{detail:{id:e}}))}},{key:"emitBookmarkColorChanged",value:function(e){var t=e.detail,n=t.bookmarkId,r=t.colorId;this.dispatchEvent(new CustomEvent("bookmarkColorChanged",{detail:{bookmarkId:n,colorId:r}}))}},{key:"emitAddBookmark",value:function(){this.dispatchEvent(new CustomEvent("addBookmark"))}},{key:"editBookmark",value:function(e,t){this.emitEditEvent(e,t),this.editedBookmark=this.editedBookmark===t?{}:t}},{key:"saveBookmark",value:function(e){var t=e.detail.bookmark;this.editedBookmark={},this.emitSaveBookmark(t)}},{key:"deleteBookmark",value:function(e){var t=e.detail.id;this.editedBookmark={},this.emitDeleteBookmark(t)}},{key:"bookmarkColorInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.bookmarkColors.find(function(t){return(null==t?void 0:t.id)===e})}},{key:"bookmarkItem",value:function(e){var t=this,n=this.editedBookmark.id===e.id,o=this.bookmarkColorInfo(e.color).className,i=e.id===this.activeBookmarkID?"active":"";return(0,r.qy)(Ho||(Ho=Jo(["\n <li data-pageIndex=",'>\n <div class="separator"></div>\n <div class="bookmark-card ','">\n <div class="bookmark-header" @click=',">\n <button>\n <icon-bookmark class=",' aria-label="',' bookmark"></icon-bookmark>\n <span> Page ','</span>\n </button>\n <button\n class="edit"\n @click=','\n title="Edit this bookmark"\n aria-expanded=','\n >\n <ia-icon-edit-pencil aria-hidden="true"></ia-icon-edit-pencil>\n </button>\n </div>\n ',"\n ","\n </div>\n </li>\n "])),e.id,i,function(){return t.emitSelectedEvent(e)},o,o,e.page,function(n){return t.editBookmark(n,e)},n?"true":"false",!n&&e.note?(0,r.qy)(Do||(Do=Jo(["<p>","</p>"])),e.note):r.s6,n?this.editBookmarkComponent:r.s6)}},{key:"editBookmarkComponent",get:function(){return(0,r.qy)(qo||(qo=Jo(["\n <ia-bookmark-edit\n .bookmark=","\n .bookmarkColors=","\n .defaultBookmarkColor=","\n .showBookmark=","\n @saveBookmark=","\n @deleteBookmark=","\n @bookmarkColorChanged=","\n ></ia-bookmark-edit>\n "])),this.editedBookmark,this.bookmarkColors,this.defaultBookmarkColor,!1,this.saveBookmark,this.deleteBookmark,this.emitBookmarkColorChanged)}},{key:"sortBookmarks",value:function(){var e=this;return Object.keys(this.bookmarks).sort(function(e,t){return+e>+t?1:+e<+t?-1:0}).map(function(t){return e.bookmarks[t]})}},{key:"bookmarksCount",get:function(){var e=this.bookmarks.length;return(0,r.qy)(Ro||(Ro=Jo(["<small>(",")</small>"])),e)}},{key:"headerSection",get:function(){return(0,r.qy)(Fo||(Fo=Jo(["<header>\n <h3>\n Bookmarks\n ","\n </h3>\n </header>"])),this.bookmarks.length?this.bookmarksCount:r.s6)}},{key:"bookmarkslist",get:function(){var e=this.sortBookmarks(),t=qe(e,function(e){return null==e?void 0:e.id},this.bookmarkItem.bind(this));return(0,r.qy)(Wo||(Wo=Jo(["\n <ul>\n ",'\n <div class="separator"></div>\n </ul>\n '])),t)}},{key:"render",value:function(){return(0,r.qy)(Vo||(Vo=Jo(["\n ","\n ","\n "])),this.renderHeader?this.headerSection:r.s6,Object.keys(this.bookmarks).length?this.bookmarkslist:r.s6)}}],[{key:"properties",get:function(){return{activeBookmarkID:{type:Number},bookmarkColors:{type:Array},defaultBookmarkColor:{type:Object},bookmarks:{type:Object},editedBookmark:{type:Object},renderHeader:{type:Boolean}}}},{key:"styles",get:function(){return[(0,r.AH)(No||(No=Jo(["\n :host {\n display: block;\n overflow-y: auto;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n margin-bottom: 2rem;\n --activeBorderWidth: 2px;\n }\n\n icon-bookmark {\n width: 16px;\n height: 24px;\n }\n\n .separator {\n background-color: var(--secondaryBGColor);\n width: 98%;\n margin: 1px auto;\n height: 1px;\n }\n\n small {\n font-style: italic;\n }\n\n .bookmark-header {\n display: flex;\n align-items: center;\n margin: 0;\n font-size: 1.4rem;\n font-weight: bold;\n }\n\n .bookmark-header > button:first-child {\n flex: 1;\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 4px;\n }\n\n ia-icon-edit-pencil {\n pointer-events: none;\n }\n\n p {\n padding: 0;\n margin: 5px 0 0 0;\n width: 98%;\n overflow-wrap: break-word;\n }\n\n ia-bookmark-edit {\n margin: 5px 5px 3px 6px;\n }\n\n ul {\n padding: 0;\n list-style: none;\n margin: var(--activeBorderWidth) 0.5rem 1rem 0;\n }\n ul > li:first-child .separator {\n display: none;\n }\n li {\n position: relative;\n }\n\n li .bookmark-card {\n border: var(--activeBorderWidth) solid transparent;\n border-radius: 4px;\n }\n\n li .bookmark-card.active {\n border: var(--activeBorderWidth) solid #538bc5;\n }\n\n .bookmark-header button {\n background: transparent;\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n box-sizing: border-box;\n border: none;\n padding: 0;\n text-align: left;\n }\n\n li button.edit {\n height: 34px;\n width: 34px;\n flex-shrink: 0;\n text-align: center;\n }\n "]))),Po]}}])}(r.WF);customElements.define("ia-bookmarks-list",ni);class ri extends r.WF{static get styles(){return r.AH`
1840
+ :host {
1841
+ width: var(--iconWidth, 'auto');
1842
+ height: var(--iconHeight, 'auto');
1843
+ }
1844
+
1845
+ #hollow,
1846
+ #plus,
1847
+ #minus {
1848
+ display: none;
1849
+ }
1850
+
1851
+ .hollow #filled,
1852
+ .plus #filled,
1853
+ .minus #filled {
1854
+ display: none;
1855
+ }
1856
+
1857
+ .hollow #hollow,
1858
+ .plus #hollow,
1859
+ .minus #hollow {
1860
+ display: block;
1861
+ }
1862
+
1863
+ .plus #plus {
1864
+ display: block;
1865
+ }
1866
+
1867
+ .minus #minus {
1868
+ display: block;
1869
+ }
1870
+
1871
+ .fill-color {
1872
+ fill: var(--iconFillColor);
1873
+ }
1874
+
1875
+ .stroke-color {
1876
+ stroke: var(--iconStrokeColor);
1877
+ }
1878
+ `}static get properties(){return{state:{type:String}}}render(){return r.qy`
1879
+ <div class=${this.state}>
1880
+ <svg
1881
+ height="24"
1882
+ viewBox="0 0 16 24"
1883
+ width="16"
1884
+ xmlns="http://www.w3.org/2000/svg"
1885
+ >
1886
+ <path
1887
+ id="filled"
1888
+ d="m1 0h14c.5522847 0 1 .44771525 1 1v23l-8-5.4545455-8 5.4545455v-23c0-.55228475.44771525-1 1-1z"
1889
+ class="fill-color"
1890
+ fill-rule="evenodd"
1891
+ />
1892
+ <g class="fill-color" fill-rule="evenodd">
1893
+ <path
1894
+ id="hollow"
1895
+ d="m15 0c.5522847 0 1 .44771525 1 1v23l-8-5.4545455-8 5.4545455v-23c0-.55228475.44771525-1 1-1zm-2 2h-10c-.51283584 0-.93550716.38604019-.99327227.88337887l-.00672773.11662113v18l6-4.3181818 6 4.3181818v-18c0-.51283584-.3860402-.93550716-.8833789-.99327227z"
1896
+ />
1897
+ <path
1898
+ id="plus"
1899
+ d="m8.75 6v2.25h2.25v1.5h-2.25v2.25h-1.5v-2.25h-2.25v-1.5h2.25v-2.25z"
1900
+ fill-rule="nonzero"
1901
+ />
1902
+ <path id="minus" d="m11 8.25v1.5h-6v-1.5z" fill-rule="nonzero" />
1903
+ </g>
1904
+ </svg>
1905
+ </div>
1906
+ `}}function oi(e){return oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oi(e)}function ii(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ai(r.key),r)}}function ai(e){var t=function(e){if("object"!=oi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=oi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oi(t)?t:t+""}window.customElements.define("icon-bookmark",ri);var si,li,ci=function(){return function(e,t){return t&&ii(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.baseHost,o=t.signedIn,i=t.bookreader,a=t.modal,s=t.onProviderChange,l="referer=".concat(encodeURIComponent(location.href)),c="https://".concat(n,"/account/login?").concat(l);this.component=document.createElement("ia-bookmarks"),this.component.bookreader=i,this.component.displayMode=o?"bookmarks":"login",this.component.modal=a,this.component.loginOptions={loginClicked:this.bookmarksLoginClicked,loginUrl:c},this.bindEvents(),this.icon=(0,r.qy)(ti||(ti=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['<icon-bookmark aria-hidden="true" role="presentation" state="hollow" style="--iconWidth: 16px; --iconHeight: 24px;"></icon-bookmark>']))),this.label="Bookmarks",this.id="bookmarks",this.onProviderChange=s,this.component.setup(),this.updateMenu(this.component.bookmarks.length)},[{key:"updateMenu",value:function(e){this.menuDetails="(".concat(e,")")}},{key:"bindEvents",value:function(){this.component.addEventListener("bookmarksChanged",this.bookmarksChanged.bind(this))}},{key:"bookmarksChanged",value:function(e){var t=e.detail,n=Object.keys(t.bookmarks).length;this.updateMenu(n),this.onProviderChange(t.bookmarks,t.showSidePanel)}},{key:"bookmarksLoginClicked",value:function(){var e;null===(e=window.archive_analytics)||void 0===e||e.send_event_no_sampling("BookReader","BookmarksLogin",window.location.path)}}])}();function ui(e){return ui="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ui(e)}function di(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function hi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,fi(r.key),r)}}function pi(e,t,n){return t&&hi(e.prototype,t),n&&hi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fi(e){var t=function(e){if("object"!=ui(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ui(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ui(t)?t:t+""}var mi,vi=pi(function e(t){var n=t.item,o=t.baseHost,i=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var a=null==n?void 0:n.metadata,s=a.identifier,l=a.creator,c=a.title,u=Array.isArray(l)?l[0]:l,d=i.subPrefix||"";this.icon=(0,r.qy)(si||(si=di(["",""])),Ce),this.label="Share this book",this.id="share",this.component=(0,r.qy)(li||(li=di(["<iaux-in-share-panel\n .identifier=","\n .type=","\n .creator=","\n .description=","\n .baseHost=","\n .fileSubPrefix=","\n ></iaux-in-share-panel>"])),s,"book",u,c,o,d)});function bi(e){return bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bi(e)}function yi(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return gi(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,s=0,l=e,h.n=n,a}};function p(n,r){for(s=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],p=h.p,f=i[2];n>3?(o=f===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(s=0,h.v=r,h.n=i[1]):p<f&&(o=n<3||i[0]>r||r>f)&&(i[4]=n,i[5]=r,h.n=f,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,f),s=u,l=f;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=h.n<0)?l:n.call(r,h))!==a)break}catch(t){i=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(gi(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,gi(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,gi(d,"constructor",c),gi(c,"constructor",l),l.displayName="GeneratorFunction",gi(c,o,"GeneratorFunction"),gi(d),gi(d,o,"Generator"),gi(d,r,function(){return this}),gi(d,"toString",function(){return"[object Generator]"}),(yi=function(){return{w:i,m:h}})()}function gi(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}gi=function(e,t,n,r){function i(t,n){gi(e,t,function(e){return this._invoke(t,n,e)})}t?o?o(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},gi(e,t,n,r)}function ki(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function wi(e){return function(e){if(Array.isArray(e))return Ci(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ci(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ci(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ci(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function xi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Si(r.key),r)}}function Si(e){var t=function(e){if("object"!=bi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bi(t)?t:t+""}var Oi,Mi,Bi,ji,Pi,Ei,Li,Ai="default",_i=function(){return function(e,t){return t&&xi(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=this,o=t.baseHost,i=t.bookreader,a=t.onProviderChange;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bookreader=i,this.onProviderChange=a,this.baseHost=o;var s=i.options.multipleBooksList.by_subprefix;if(this.viewableFiles=Object.keys(s).map(function(e){return s[e]}),this.volumeCount=Object.keys(s).length,this.id="volumes",this.label="Viewable files (".concat(this.volumeCount,")"),this.icon=(0,r.qy)(mi||(mi=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["",""])),Ve),this.sortOrderBy=Ai,this.component=document.createElement("iaux-in-viewable-files-panel"),this.component.addSortToUrl=!0,this.component.subPrefix=i.options.subPrefix||"",this.component.baseHost=o,this.component.fileList=wi(this.viewableFiles),this.sortFilesComponent=document.createElement("iaux-in-sort-files-button"),this.sortFilesComponent.fileListRaw=this.viewableFiles,this.sortFilesComponent.addEventListener("fileListSorted",function(e){return n.handleFileListSorted(e)}),this.actionButton=this.sortFilesComponent,this.bookreader.urlPlugin){this.bookreader.urlPlugin.pullFromAddressBar();var l=this.bookreader.urlPlugin.getUrlParam("sort");"title_asc"!==l&&"title_desc"!==l||(this.sortOrderBy=l)}this.sortFilesComponent.sortVolumes(this.sortOrderBy),this.onProviderChange(this.bookreader)},[{key:"handleFileListSorted",value:(e=yi().m(function e(t){var n,r,o;return yi().w(function(e){for(;;)switch(e.n){case 0:return n=t.detail,r=n.sortType,o=n.sortedFiles,this.viewableFiles=o,this.sortOrderBy=r,this.component.fileList=wi(this.viewableFiles),e.n=1,this.component.updateComplete;case 1:this.bookreader.urlPlugin&&(this.bookreader.urlPlugin.pullFromAddressBar(),this.sortOrderBy!==Ai?this.bookreader.urlPlugin.setUrlParam("sort",this.sortOrderBy):this.bookreader.urlPlugin.removeUrlParam("sort")),this.onProviderChange(this.bookreader),this.multipleFilesClicked(this.sortOrderBy);case 2:return e.a(2)}},e,this)}),t=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ki(i,r,o,a,s,"next",e)}function s(e){ki(i,r,o,a,s,"throw",e)}a(void 0)})},function(e){return t.apply(this,arguments)})},{key:"multipleFilesClicked",value:function(e){var t;null===(t=window.archive_analytics)||void 0===t||t.send_event("BookReader","VolumesSort|".concat(e),window.location.path)}}]);var e,t}(),Ti=n(8004);function zi(e){return zi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zi(e)}function Ii(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return $i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function $i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Hi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Di(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hi(Object(n),!0).forEach(function(t){qi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qi(e,t,n){return(t=Wi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ri(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Fi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Wi(r.key),r)}}function Wi(e){var t=function(e){if("object"!=zi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=zi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zi(t)?t:t+""}function Vi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Vi=function(){return!!e})()}function Ni(){return Ni="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Zi(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Ni.apply(null,arguments)}function Zi(e){return Zi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zi(e)}function Ui(e,t){return Ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ui(e,t)}var Gi=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Zi(t),function(e,t){if(t&&("object"==zi(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Vi()?Reflect.construct(t,n||[],Zi(e).constructor):t.apply(e,n))}(this,t)).item=void 0,e.bookreader=void 0,e.baseHost="archive.org",e.fullscreen=!1,e.signedIn=!1,e.modal=void 0,e.sharedObserver=void 0,e.loaded=!1,e.menuShortcuts=[],e.menuContents=[],e.openMenuName="",e.bookReaderCannotLoad=!1,e.bookReaderLoaded=!1,e.bookIsRestricted=!1,e.downloadableTypes=[],e.isAdmin=!1,e.lendingInitialized=!1,e.lendingStatus={},e.menuProviders={bookmarks:null,search:null,downloads:null,visualAdjustments:null,share:null,volumes:null},e.signedIn=!1,e.fullscreenBranding=(0,r.qy)(Oi||(Oi=Ri(['<ia-icon-ia-logo aria-hidden="true"></ia-icon-ia-logo>']))),e._sharedObserverHandler={handleResize:e.handleResize.bind(e)},e._brWidth=0,e._brHeight=0,e.shortcutOrder=["fullscreen","volumes","chapters","search","translate","bookmarks","downloads","visualAdjustments","share","experiments"],e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ui(e,t)}(t,e),function(e,t,n){return t&&Fi(e.prototype,t),n&&Fi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"itemNav",get:function(){return this.shadowRoot.querySelector("iaux-item-navigator")}},{key:"disconnectedCallback",value:function(){!function(e,t,n){var r=Ni(Zi(e.prototype),"disconnectedCallback",n);return"function"==typeof r?function(e){return r.apply(n,e)}:r}(t,0,this)([]),this.unloadSharedObserver()}},{key:"firstUpdated",value:function(){this.modal||this.setModalManager(),this.sharedObserver||(this.sharedObserver=new ct),this._bindEventListeners(),this.loaded=!0}},{key:"updated",value:function(e){this.bookreader&&this.item&&this.bookReaderLoaded&&((e.has("loaded")&&this.loaded||e.has("item")||e.has("bookreader")||e.has("signedIn")||e.has("isAdmin")||e.has("modal"))&&this.initializeBookSubmenus(),e.has("sharedObserver")&&this.bookreader&&(this.loadSharedObserver(),this.initializeBookSubmenus()),e.has("downloadableTypes")&&this.initializeBookSubmenus())}},{key:"loadSharedObserver",value:function(){var e;this.unloadSharedObserver(),null===(e=this.sharedObserver)||void 0===e||e.addObserver({target:this.mainBRContainer,handler:this._sharedObserverHandler})}},{key:"unloadSharedObserver",value:function(){var e;null===(e=this.sharedObserver)||void 0===e||e.removeObserver({target:this.mainBRContainer,handler:this._sharedObserverHandler})}},{key:"handleResize",value:function(e){var t=e.contentRect,n=e.target,r=this._brWidth,o=this._brHeight,i=this.bookreader.animating;n===this.mainBRContainer&&(this._brWidth=t.width,this._brHeight=t.height),!r&&this._brWidth&&this.initializeBookSubmenus();var a,s=r!==this._brWidth,l=o!==this._brHeight;i||!s&&!l||null===(a=this.bookreader)||void 0===a||a.resize()}},{key:"manageFullScreenBehavior",value:function(){this.bookreader.options.enableFSLogoShortcut&&(this.fullscreen=this.bookreader.isFullscreen(),this.dispatchEvent(new CustomEvent("fullscreenStateUpdated",{detail:{fullscreen:this.fullscreen}})),this.fullscreen?this.addFullscreenShortcut():this.deleteFullscreenShortcut())}},{key:"setModalManager",value:function(){var e=document.querySelector("modal-manager");e||(e=document.createElement("modal-manager"),document.body.appendChild(e)),this.modal=e}},{key:"initializeBookSubmenus",value:function(){var e,t=this,n={visualAdjustments:new Sr(Di(Di({},this.baseProviderConfig),{},{onProviderChange:function(){t.updateMenuContents()}}))};this.baseProviderConfig.item&&(n.share=new vi(this.baseProviderConfig)),this.shouldShowDownloadsMenu()&&(n.downloads=new Fn(this.baseProviderConfig)),null!==(e=this.bookreader.options.plugins)&&void 0!==e&&null!==(e=e.search)&&void 0!==e&&e.enabled&&(n.search=new Cn(Di(Di({},this.baseProviderConfig),{},{onProviderChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e&&(t.bookreader=e),t.updateMenuContents(),!1!==n.openMenu&&(!t.isWideEnoughToOpenMenu||null!=n&&n.searchCanceled||setTimeout(function(){t.updateSideMenu("search","open")},0))}}))),this.bookreader.options.enableBookmarks&&(n.bookmarks=new ci(Di(Di({},this.baseProviderConfig),{},{onProviderChange:function(e){var n=Object.keys(e).length?"add":"remove";t["".concat(n,"MenuShortcut")]("bookmarks"),t.updateMenuContents()}}))),this.bookreader.options.enableMultipleBooks&&(n.volumes=new _i(Di(Di({},this.baseProviderConfig),{},{onProviderChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&(t.bookreader=e),t.updateMenuContents(),t.isWideEnoughToOpenMenu&&setTimeout(function(){t.updateSideMenu("volumes","open")})}}))),Object.assign(this.menuProviders,n),this.addMenuShortcut("search"),this.addMenuShortcut("volumes"),this.updateMenuContents()}},{key:"mainBRContainer",get:function(){var e;return document.querySelector(null===(e=this.bookreader)||void 0===e?void 0:e.el)}},{key:"baseProviderConfig",get:function(){return{baseHost:this.baseHost,modal:this.modal,sharedObserver:this.sharedObserver,bookreader:this.bookreader,item:this.item,signedIn:this.signedIn,isAdmin:this.isAdmin,onProviderChange:function(){}}}},{key:"isWideEnoughToOpenMenu",get:function(){return this._brWidth>=640}},{key:"updateSideMenu",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"open";if(t)if(this.openMenuName=t,"open"===n)null===(e=this.itemNav)||void 0===e||e.openShortcut(t);else if("toggle"===n){var r;null===(r=this.itemNav)||void 0===r||r.toggleMenu()}}},{key:"addFullscreenShortcut",value:function(){this.menuShortcuts.push({icon:this.fullscreenShortcut,id:"fullscreen"}),this._sortMenuShortcuts()}},{key:"deleteFullscreenShortcut",value:function(){this.menuShortcuts=this.menuShortcuts.filter(function(e){return"fullscreen"!==e.id}),this._sortMenuShortcuts()}},{key:"fullscreenShortcut",get:function(){var e=this;return(0,r.qy)(Mi||(Mi=Ri(["\n <button\n @click=",'\n title="Exit fullscreen view"\n >',"</button>\n "])),function(){return e.bookreader.exitFullScreen()},this.fullscreenBranding)}},{key:"updateMenuContents",value:function(){var e,t=this,n=(0,Ti.sortBy)(Object.entries(this.menuProviders).filter(function(e){var t=Ii(e,2);return t[0],!!t[1]}).filter(function(e){var n=Ii(e,2),r=n[0];return n[1],"downloads"!==r||t.shouldShowDownloadsMenu()}),function(e){var n=Ii(e,2),r=n[0],o=(n[1],t.shortcutOrder.indexOf(r));return-1===o?t.shortcutOrder.length:o}).map(function(e){var t=Ii(e,2);return t[0],t[1]});this.shouldShowDownloadsMenu()&&(null===(e=this.menuProviders.downloads)||void 0===e||e.update(this.downloadableTypes)),this.menuContents=n}},{key:"shouldShowDownloadsMenu",value:function(){if(!this.downloadableTypes.length)return!1;if(!1===this.bookIsRestricted)return!0;if(this.isAdmin)return!0;var e=this.lendingStatus.user_loan_record,t=void 0===e?{}:e;return!Array.isArray(t)&&t.type&&"SESSION_LOAN"!==t.type}},{key:"addMenuShortcut",value:function(e){this.menuShortcuts.find(function(t){return t.id===e})||this.menuProviders[e]&&(this.menuShortcuts.push(this.menuProviders[e]),this._sortMenuShortcuts())}},{key:"_sortMenuShortcuts",value:function(){var e=this;this.menuShortcuts=(0,Ti.sortBy)(this.menuShortcuts,function(t){var n=e.shortcutOrder.indexOf(t.id);return-1===n?e.shortcutOrder.length:n})}},{key:"_bindEventListeners",value:function(){var e=this;window.addEventListener("BookReader:PostInit",function(t){e.bookreader=t.detail.props,e.bookreader.shell=e,e.bookReaderLoaded=!0,e.bookReaderCannotLoad=!1,e.loaded=!0,e.loadSharedObserver(),setTimeout(function(){return e.bookreader.resize()},0)}),window.addEventListener("BookReader:fullscreenToggled",function(t){var n=t.detail.props;n&&(e.bookreader=n),e.manageFullScreenBehavior()},{passive:!0}),window.addEventListener("BookReader:ToggleSearchMenu",function(t){e.updateSideMenu("search","toggle")}),window.addEventListener("LendingFlow:PostInit",function(t){var n=t.detail,r=n.downloadTypesAvailable,o=n.lendingStatus,i=n.isAdmin,a=n.previewType;e.lendingInitialized=!0,e.downloadableTypes=r,e.lendingStatus=o,e.isAdmin=i,e.bookReaderCannotLoad="singlePagePreview"===a,e.loaded=!0}),window.addEventListener("BRJSIA:PostInit",function(t){var n=t.detail,r=n.isRestricted,o=n.downloadURLs;e.bookReaderLoaded=!0,e.downloadableTypes=o,e.bookIsRestricted=r}),window.addEventListener("contextmenu",function(t){return e._manageContextMenuVisibility(t)},{capture:!0})}},{key:"_manageContextMenuVisibility",value:function(e){var t,n,r=e.target;if(null===(t=window.archive_analytics)||void 0===t||t.send_event("BookReader","contextmenu-".concat(this.bookIsRestricted?"restricted":"unrestricted"),null==r||null===(n=r.classList)||void 0===n?void 0:n.value),this.bookIsRestricted&&r.classList.value.match(/BRscreen|BRpageimage/g))return e.preventDefault(),!1}},{key:"itemImage",get:function(){var e,t=null===(e=this.item)||void 0===e?void 0:e.metadata.identifier,n="https://".concat(this.baseHost,"/services/img/").concat(t);return(0,r.qy)(Bi||(Bi=Ri(['<img class="cover-img" src=',' alt="cover image for ','">'])),n,t)}},{key:"placeholder",get:function(){return(0,r.qy)(ji||(ji=Ri(['<div class="placeholder">',"</div>"])),this.itemImage)}},{key:"render",value:function(){return(0,r.qy)(Pi||(Pi=Ri(["\n <iaux-item-navigator\n ?viewportInFullscreen=","\n .basehost=","\n .item=","\n .modal=","\n .loaded=","\n .sharedObserver=","\n ?signedIn=","\n .menuShortcuts=","\n .menuContents=","\n .openMenu=",'\n >\n <div slot="header">\n <slot name="header"></slot>\n </div>\n <div slot="main">\n ',"\n </div>\n </iaux-item-navigator>\n "])),this.fullscreen,this.baseHost,this.item,this.modal,this.loaded,this.sharedObserver,this.signedIn,this.menuShortcuts,this.menuContents,this.openMenuName,this.bookReaderCannotLoad?this.placeholder:(0,r.qy)(Ei||(Ei=Ri(['<slot name="main"></slot>']))))}}],[{key:"properties",get:function(){return{item:{type:Object},baseHost:{type:String},signedIn:{type:Boolean},fullscreen:{type:Boolean,reflect:!0,attribute:!0},sharedObserver:{type:Object,attribute:!1},modal:{type:Object,attribute:!1},loaded:{type:Boolean},menuShortcuts:{type:Array},menuContents:{type:Array},bookReaderLoaded:{type:Boolean},bookreader:{type:Object},bookIsRestricted:{type:Boolean},downloadableTypes:{type:Array},isAdmin:{type:Boolean},lendingInitialized:{type:Boolean},lendingStatus:{type:Object},menuProviders:{type:Object},fullscreenBranding:{type:Object}}}},{key:"styles",get:function(){return(0,r.AH)(Li||(Li=Ri(['\n :host {\n display: block;\n --primaryBGColor: var(--black, #000);\n --secondaryBGColor: #222;\n --tertiaryBGColor: #333;\n --primaryTextColor: var(--white, #fff);\n --primaryCTAFill: #194880;\n --primaryCTABorder: #c5d1df;\n --secondaryCTAFill: #333;\n --secondaryCTABorder: #999;\n --primaryErrorCTAFill: #e51c26;\n --primaryErrorCTABorder: #f8c6c8;\n background-color: var(--primaryBGColor);\n position: relative;\n }\n\n :host([fullscreen]),\n iaux-item-navigator[viewportinfullscreen] {\n position: fixed;\n inset: 0;\n height: 100%;\n min-height: unset;\n }\n\n div[slot="header"],\n div[slot="main"] {\n display: flex;\n width: 100%;\n }\n\n slot {\n display: block;\n flex: 1;\n }\n\n slot,\n slot > * {\n display: block;\n height: inherit;\n width: inherit;\n }\n .placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin: 5%;\n }\n .cover-img {\n max-height: 300px;\n }\n\n iaux-item-navigator {\n display: block;\n width: 100%;\n min-height: var(--br-height, inherit);\n height: var(--br-height, 100%);\n color: var(--primaryTextColor);\n --menuButtonLabelDisplay: block;\n --menuWidth: 320px;\n --menuSliderBg: var(--secondaryBGColor);\n --activeButtonBg: var(--tertiaryBGColor);\n --subpanelRightBorderColor: var(--secondaryCTABorder);\n --animationTiming: 100ms;\n --iconFillColor: var(--primaryTextColor);\n --iconStrokeColor: var(--primaryTextColor);\n --menuSliderHeaderIconHeight: 2rem;\n --menuSliderHeaderIconWidth: 2rem;\n --iconWidth: 2.4rem;\n --iconHeight: 2.4rem;\n --shareLinkColor: var(--primaryTextColor);\n --shareIconBorder: var(--primaryTextColor);\n --shareIconBg: var(--secondaryBGColor);\n --activityIndicatorLoadingDotColor: var(--primaryTextColor);\n --activityIndicatorLoadingRingColor: var(--primaryTextColor);\n }\n '])))}}])}(r.WF);window.customElements.define("ia-bookreader",Gi)}},function(e){e(e.s=5758)}]);
1907
+ //# sourceMappingURL=ia-bookreader-bundle.js.map