@internetarchive/bookreader 5.0.0-12-fixsorting-8 → 5.0.0-120

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 (420) hide show
  1. package/BookReader/474.js +2 -0
  2. package/BookReader/474.js.map +1 -0
  3. package/BookReader/BookReader.css +670 -1190
  4. package/BookReader/bergamot-translator-worker.js +2966 -0
  5. package/BookReader/bergamot-translator-worker.wasm +0 -0
  6. package/BookReader/hypothesis/LICENSE +50 -0
  7. package/BookReader/hypothesis/README.md +55 -0
  8. package/BookReader/hypothesis/build/boot-template.js +1 -0
  9. package/BookReader/hypothesis/build/boot.js +1 -0
  10. package/BookReader/hypothesis/build/manifest.json +20 -0
  11. package/BookReader/hypothesis/build/scripts/annotator.bundle.js +199 -0
  12. package/BookReader/hypothesis/build/scripts/annotator.bundle.js.map +1 -0
  13. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js +811 -0
  14. package/BookReader/hypothesis/build/scripts/sidebar.bundle.js.map +1 -0
  15. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js +437 -0
  16. package/BookReader/hypothesis/build/scripts/ui-playground.bundle.js.map +1 -0
  17. package/BookReader/hypothesis/build/styles/annotator.css +4 -0
  18. package/BookReader/hypothesis/build/styles/annotator.css.map +1 -0
  19. package/BookReader/hypothesis/build/styles/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  20. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  21. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  22. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  23. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  24. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Bold.woff2 +0 -0
  25. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  26. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Italic.woff2 +0 -0
  27. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Main-Regular.woff2 +0 -0
  28. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  29. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Math-Italic.woff2 +0 -0
  30. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  31. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  32. package/BookReader/hypothesis/build/styles/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  33. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Script-Regular.woff2 +0 -0
  34. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  35. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  36. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  37. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  38. package/BookReader/hypothesis/build/styles/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  39. package/BookReader/hypothesis/build/styles/highlights.css +2 -0
  40. package/BookReader/hypothesis/build/styles/highlights.css.map +1 -0
  41. package/BookReader/hypothesis/build/styles/katex.min.css +3 -0
  42. package/BookReader/hypothesis/build/styles/katex.min.css.map +1 -0
  43. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css +14 -0
  44. package/BookReader/hypothesis/build/styles/pdfjs-overrides.css.map +1 -0
  45. package/BookReader/hypothesis/build/styles/sidebar.css +4 -0
  46. package/BookReader/hypothesis/build/styles/sidebar.css.map +1 -0
  47. package/BookReader/hypothesis/build/styles/ui-playground.css +4 -0
  48. package/BookReader/hypothesis/build/styles/ui-playground.css.map +1 -0
  49. package/BookReader/hypothesis/package.json +126 -0
  50. package/BookReader/ia-bookreader.js +1886 -0
  51. package/BookReader/{BookReader.js.LICENSE.txt → ia-bookreader.js.LICENSE.txt} +26 -20
  52. package/BookReader/ia-bookreader.js.map +1 -0
  53. package/BookReader/icons/1up.svg +1 -12
  54. package/BookReader/icons/2up.svg +1 -15
  55. package/BookReader/icons/advance.svg +3 -26
  56. package/BookReader/icons/chevron-right.svg +1 -1
  57. package/BookReader/icons/close-circle-dark.svg +1 -1
  58. package/BookReader/icons/close-circle.svg +1 -1
  59. package/BookReader/icons/fullscreen.svg +1 -17
  60. package/BookReader/icons/fullscreen_exit.svg +1 -17
  61. package/BookReader/icons/hamburger.svg +1 -15
  62. package/BookReader/icons/left-arrow.svg +1 -12
  63. package/BookReader/icons/magnify-minus.svg +1 -16
  64. package/BookReader/icons/magnify-plus.svg +1 -17
  65. package/BookReader/icons/magnify.svg +1 -15
  66. package/BookReader/icons/pause.svg +1 -23
  67. package/BookReader/icons/play.svg +1 -22
  68. package/BookReader/icons/playback-speed.svg +1 -34
  69. package/BookReader/icons/read-aloud.svg +1 -22
  70. package/BookReader/icons/review.svg +3 -22
  71. package/BookReader/icons/slider-toggle.svg +1 -0
  72. package/BookReader/icons/thumbnails.svg +1 -17
  73. package/BookReader/icons/voice.svg +1 -0
  74. package/BookReader/icons/volume-full.svg +1 -22
  75. package/BookReader/images/BRicons.svg +5 -94
  76. package/BookReader/images/books_graphic.svg +1 -177
  77. package/BookReader/images/hypothesis.ico +0 -0
  78. package/BookReader/images/icon_book.svg +1 -12
  79. package/BookReader/images/icon_bookmark.svg +1 -12
  80. package/BookReader/images/icon_experiment.svg +1 -0
  81. package/BookReader/images/icon_gear.svg +1 -14
  82. package/BookReader/images/icon_hamburger.svg +1 -20
  83. package/BookReader/images/icon_home.svg +1 -21
  84. package/BookReader/images/icon_info.svg +1 -11
  85. package/BookReader/images/icon_one_page.svg +1 -8
  86. package/BookReader/images/icon_pause.svg +1 -1
  87. package/BookReader/images/icon_play.svg +1 -1
  88. package/BookReader/images/icon_playback-rate.svg +1 -15
  89. package/BookReader/images/icon_search_button.svg +1 -8
  90. package/BookReader/images/icon_share.svg +1 -9
  91. package/BookReader/images/icon_skip-ahead.svg +1 -6
  92. package/BookReader/images/icon_skip-back.svg +2 -13
  93. package/BookReader/images/icon_speaker.svg +1 -18
  94. package/BookReader/images/icon_speaker_open.svg +1 -10
  95. package/BookReader/images/icon_thumbnails.svg +1 -12
  96. package/BookReader/images/icon_toc.svg +1 -5
  97. package/BookReader/images/icon_two_pages.svg +1 -9
  98. package/BookReader/images/marker_chap-off.svg +1 -11
  99. package/BookReader/images/marker_chap-on.svg +1 -11
  100. package/BookReader/images/marker_srch-on.svg +1 -11
  101. package/BookReader/images/translate.svg +1 -0
  102. package/BookReader/images/unviewable_page.png +0 -0
  103. package/BookReader/jquery-3.js +2 -0
  104. package/BookReader/jquery-3.js.LICENSE.txt +24 -0
  105. package/BookReader/plugins/plugin.archive_analytics.js +1 -172
  106. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
  107. package/BookReader/plugins/plugin.autoplay.js +1 -165
  108. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  109. package/BookReader/plugins/plugin.chapters.js +19 -301
  110. package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
  111. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  112. package/BookReader/plugins/plugin.experiments.js +3 -0
  113. package/BookReader/plugins/plugin.experiments.js.LICENSE.txt +1 -0
  114. package/BookReader/plugins/plugin.experiments.js.map +1 -0
  115. package/BookReader/plugins/plugin.iframe.js +1 -74
  116. package/BookReader/plugins/plugin.iframe.js.map +1 -1
  117. package/BookReader/plugins/plugin.iiif.js +2 -0
  118. package/BookReader/plugins/plugin.iiif.js.map +1 -0
  119. package/BookReader/plugins/plugin.resume.js +1 -368
  120. package/BookReader/plugins/plugin.resume.js.map +1 -1
  121. package/BookReader/plugins/plugin.search.js +2 -1385
  122. package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
  123. package/BookReader/plugins/plugin.search.js.map +1 -1
  124. package/BookReader/plugins/plugin.text_selection.js +2 -1080
  125. package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
  126. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  127. package/BookReader/plugins/plugin.translate.js +3 -0
  128. package/BookReader/plugins/plugin.translate.js.LICENSE.txt +1 -0
  129. package/BookReader/plugins/plugin.translate.js.map +1 -0
  130. package/BookReader/plugins/plugin.tts.js +2 -9193
  131. package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
  132. package/BookReader/plugins/plugin.tts.js.map +1 -1
  133. package/BookReader/plugins/plugin.url.js +1 -269
  134. package/BookReader/plugins/plugin.url.js.map +1 -1
  135. package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -379
  136. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
  137. package/BookReader/plugins/translator-worker.js +2 -0
  138. package/BookReader/plugins/translator-worker.js.map +1 -0
  139. package/BookReader/silence.mp3 +0 -0
  140. package/BookReader/translator-worker.js +475 -0
  141. package/BookReader/webcomponents-bundle.js +3 -0
  142. package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
  143. package/BookReader/webcomponents-bundle.js.map +1 -0
  144. package/README.md +17 -4
  145. package/dist/esm/ia-bookreader.js +3 -0
  146. package/dist/esm/ia-bookreader.js.LICENSE.txt +17 -0
  147. package/dist/esm/ia-bookreader.js.map +1 -0
  148. package/dist/esm/plugins/plugin.archive_analytics.js +2 -0
  149. package/dist/esm/plugins/plugin.archive_analytics.js.map +1 -0
  150. package/dist/esm/plugins/plugin.autoplay.js +2 -0
  151. package/dist/esm/plugins/plugin.autoplay.js.map +1 -0
  152. package/dist/esm/plugins/plugin.chapters.js +2 -0
  153. package/dist/esm/plugins/plugin.chapters.js.map +1 -0
  154. package/dist/esm/plugins/plugin.experiments.js +2 -0
  155. package/dist/esm/plugins/plugin.experiments.js.map +1 -0
  156. package/dist/esm/plugins/plugin.iframe.js +2 -0
  157. package/dist/esm/plugins/plugin.iframe.js.map +1 -0
  158. package/dist/esm/plugins/plugin.iiif.js +2 -0
  159. package/dist/esm/plugins/plugin.iiif.js.map +1 -0
  160. package/dist/esm/plugins/plugin.resume.js +2 -0
  161. package/dist/esm/plugins/plugin.resume.js.map +1 -0
  162. package/dist/esm/plugins/plugin.search.js +2 -0
  163. package/dist/esm/plugins/plugin.search.js.map +1 -0
  164. package/dist/esm/plugins/plugin.text_selection.js +2 -0
  165. package/dist/esm/plugins/plugin.text_selection.js.map +1 -0
  166. package/dist/esm/plugins/plugin.translate.js +2 -0
  167. package/dist/esm/plugins/plugin.translate.js.map +1 -0
  168. package/dist/esm/plugins/plugin.tts.js +2 -0
  169. package/dist/esm/plugins/plugin.tts.js.map +1 -0
  170. package/dist/esm/plugins/plugin.url.js +2 -0
  171. package/dist/esm/plugins/plugin.url.js.map +1 -0
  172. package/dist/esm/plugins/plugin.vendor-fullscreen.js +2 -0
  173. package/dist/esm/plugins/plugin.vendor-fullscreen.js.map +1 -0
  174. package/jsconfig.json +18 -0
  175. package/package.json +113 -71
  176. package/src/BookReader/BookModel.js +92 -46
  177. package/src/BookReader/DragScrollable.js +233 -0
  178. package/src/BookReader/ImageCache.js +49 -16
  179. package/src/BookReader/Mode1Up.js +66 -365
  180. package/src/BookReader/Mode1UpLit.js +392 -0
  181. package/src/BookReader/Mode2Up.js +87 -1315
  182. package/src/BookReader/Mode2UpLit.js +786 -0
  183. package/src/BookReader/ModeAbstract.js +43 -0
  184. package/src/BookReader/ModeCoordinateSpace.js +29 -0
  185. package/src/BookReader/ModeSmoothZoom.js +312 -0
  186. package/src/BookReader/ModeThumb.js +29 -15
  187. package/src/BookReader/Navbar/Navbar.js +204 -84
  188. package/src/BookReader/PageContainer.js +120 -23
  189. package/src/BookReader/ReduceSet.js +2 -2
  190. package/src/BookReader/Toolbar/Toolbar.js +18 -40
  191. package/src/BookReader/events.js +3 -3
  192. package/src/BookReader/options.js +105 -18
  193. package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
  194. package/src/BookReader/utils/ScrollClassAdder.js +31 -0
  195. package/src/BookReader/utils/SelectionObserver.js +72 -0
  196. package/src/BookReader/utils/classes.js +1 -1
  197. package/src/BookReader/utils.js +136 -12
  198. package/src/BookReader.js +732 -1231
  199. package/src/BookReaderPlugin.js +52 -0
  200. package/src/assets/icons/magnify-minus.svg +3 -7
  201. package/src/assets/icons/magnify-plus.svg +3 -7
  202. package/src/assets/icons/slider-toggle.svg +1 -0
  203. package/src/assets/icons/voice.svg +1 -0
  204. package/src/assets/images/hypothesis.ico +0 -0
  205. package/src/assets/images/icon_experiment.svg +1 -0
  206. package/src/assets/images/translate.svg +1 -0
  207. package/src/assets/images/unviewable_page.png +0 -0
  208. package/src/assets/silence.mp3 +0 -0
  209. package/src/css/BookReader.scss +1 -5
  210. package/src/css/_BRBookmarks.scss +1 -1
  211. package/src/css/_BRComponent.scss +1 -1
  212. package/src/css/_BRicon.scss +8 -2
  213. package/src/css/_BRmain.scss +16 -3
  214. package/src/css/_BRnav.scss +74 -70
  215. package/src/css/_BRpages.scss +174 -42
  216. package/src/css/_BRsearch.scss +69 -30
  217. package/src/css/_BRtoolbar.scss +5 -5
  218. package/src/css/_TextSelection.scss +249 -25
  219. package/src/css/_colorbox.scss +2 -2
  220. package/src/css/_controls.scss +24 -7
  221. package/src/css/_icons.scss +8 -1
  222. package/src/{BookNavigator/assets → css}/button-base.js +2 -2
  223. package/src/css/icon_checkmark.js +9 -0
  224. package/src/css/sharedStyles.js +15 -0
  225. package/src/ia-bookreader/downloads/downloads-provider.js +81 -0
  226. package/src/{BookNavigator → ia-bookreader}/downloads/downloads.js +25 -5
  227. package/src/ia-bookreader/ia-bookreader.js +686 -0
  228. package/src/ia-bookreader/sharing.js +27 -0
  229. package/src/ia-bookreader/viewable-files.js +98 -0
  230. package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments-provider.js +17 -17
  231. package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments.js +75 -67
  232. package/src/{BookNavigator → plugins}/bookmarks/bookmark-button.js +4 -3
  233. package/src/{BookNavigator/assets → plugins/bookmarks}/bookmark-colors.js +1 -1
  234. package/src/{BookNavigator → plugins}/bookmarks/bookmark-edit.js +43 -31
  235. package/src/{BookNavigator → plugins}/bookmarks/bookmarks-list.js +48 -49
  236. package/src/{BookNavigator → plugins}/bookmarks/bookmarks-loginCTA.js +3 -3
  237. package/src/plugins/bookmarks/bookmarks-provider.js +63 -0
  238. package/src/{BookNavigator → plugins/bookmarks}/delete-modal-actions.js +1 -1
  239. package/src/{BookNavigator → plugins}/bookmarks/ia-bookmarks.js +117 -68
  240. package/src/plugins/plugin.archive_analytics.js +84 -78
  241. package/src/plugins/plugin.autoplay.js +99 -104
  242. package/src/plugins/plugin.chapters.js +323 -205
  243. package/src/plugins/plugin.experiments.js +375 -0
  244. package/src/plugins/plugin.iframe.js +36 -37
  245. package/src/plugins/plugin.iiif.js +147 -0
  246. package/src/plugins/plugin.resume.js +54 -51
  247. package/src/plugins/plugin.text_selection.js +464 -219
  248. package/src/plugins/plugin.vendor-fullscreen.js +5 -5
  249. package/src/plugins/search/plugin.search.js +347 -397
  250. package/src/{BookNavigator → plugins}/search/search-provider.js +59 -27
  251. package/src/{BookNavigator → plugins}/search/search-results.js +105 -76
  252. package/src/plugins/search/utils.js +50 -0
  253. package/src/plugins/search/view.js +51 -69
  254. package/src/plugins/translate/TranslationManager.js +164 -0
  255. package/src/plugins/translate/plugin.translate.js +559 -0
  256. package/src/plugins/tts/AbstractTTSEngine.js +78 -49
  257. package/src/plugins/tts/FestivalTTSEngine.js +20 -30
  258. package/src/plugins/tts/PageChunk.js +117 -23
  259. package/src/plugins/tts/PageChunkIterator.js +11 -17
  260. package/src/plugins/tts/WebTTSEngine.js +132 -92
  261. package/src/plugins/tts/plugin.tts.js +341 -351
  262. package/src/plugins/tts/utils.js +76 -67
  263. package/src/plugins/url/UrlPlugin.js +213 -0
  264. package/src/plugins/{plugin.url.js → url/plugin.url.js} +54 -18
  265. package/src/util/TextSelectionManager.js +1464 -0
  266. package/src/util/browserSniffing.js +42 -1
  267. package/src/util/cache.js +20 -0
  268. package/src/util/docCookies.js +21 -2
  269. package/src/util/dom.js +88 -0
  270. package/src/util/generators.js +89 -0
  271. package/src/util/lit.js +15 -0
  272. package/src/util/strings.js +11 -0
  273. package/.babelrc +0 -12
  274. package/.dependabot/config.yml +0 -6
  275. package/.eslintrc.js +0 -50
  276. package/.gitattributes +0 -2
  277. package/.github/ISSUE_TEMPLATE/bug.md +0 -32
  278. package/.github/ISSUE_TEMPLATE/feature-request.md +0 -30
  279. package/.github/PULL_REQUEST_TEMPLATE/pull_request_template.md +0 -15
  280. package/.github/workflows/node.js.yml +0 -37
  281. package/.github/workflows/npm-publish.yml +0 -47
  282. package/.testcaferc.json +0 -5
  283. package/BookReader/BookReader.js +0 -21613
  284. package/BookReader/BookReader.js.map +0 -1
  285. package/BookReader/bookreader-component-bundle.js +0 -14497
  286. package/BookReader/bookreader-component-bundle.js.LICENSE.txt +0 -38
  287. package/BookReader/bookreader-component-bundle.js.map +0 -1
  288. package/BookReader/jquery-1.10.1.js +0 -108
  289. package/BookReader/jquery-1.10.1.js.LICENSE.txt +0 -24
  290. package/BookReader/plugins/plugin.menu_toggle.js +0 -369
  291. package/BookReader/plugins/plugin.menu_toggle.js.map +0 -1
  292. package/BookReader/plugins/plugin.mobile_nav.js +0 -335
  293. package/BookReader/plugins/plugin.mobile_nav.js.map +0 -1
  294. package/BookReaderDemo/BookReaderDemo.css +0 -41
  295. package/BookReaderDemo/BookReaderJSAdvanced.js +0 -115
  296. package/BookReaderDemo/BookReaderJSAutoplay.js +0 -56
  297. package/BookReaderDemo/BookReaderJSSimple.js +0 -55
  298. package/BookReaderDemo/IIIFBookReader.js +0 -207
  299. package/BookReaderDemo/assets/v5/Bookreader-logo-cool-grad.svg +0 -1
  300. package/BookReaderDemo/assets/v5/Bookreader-logo-flat.svg +0 -1
  301. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-cool-grad.png +0 -0
  302. package/BookReaderDemo/assets/v5/Bookreader-logo-hex-flat.png +0 -0
  303. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.png +0 -0
  304. package/BookReaderDemo/assets/v5/Bookreader-logo-lines.svg +0 -1
  305. package/BookReaderDemo/assets/v5/Bookreader-logo-warm.svg +0 -1
  306. package/BookReaderDemo/assets/v5/bookreader-logo-renders@1x.png +0 -0
  307. package/BookReaderDemo/assets/v5/bookreader-logo-renders@2x.png +0 -0
  308. package/BookReaderDemo/assets/v5/bookreader-v5-screenshot.png +0 -0
  309. package/BookReaderDemo/bookreader-template-bundle.js +0 -7178
  310. package/BookReaderDemo/demo-advanced.html +0 -33
  311. package/BookReaderDemo/demo-autoplay.html +0 -38
  312. package/BookReaderDemo/demo-embed-iframe-src.html +0 -84
  313. package/BookReaderDemo/demo-embed.html +0 -26
  314. package/BookReaderDemo/demo-fullscreen-mobile.html +0 -36
  315. package/BookReaderDemo/demo-fullscreen.html +0 -33
  316. package/BookReaderDemo/demo-iiif.html +0 -34
  317. package/BookReaderDemo/demo-iiif.js +0 -26
  318. package/BookReaderDemo/demo-internetarchive.html +0 -74
  319. package/BookReaderDemo/demo-multiple.html +0 -43
  320. package/BookReaderDemo/demo-plugin-menu-toggle.html +0 -34
  321. package/BookReaderDemo/demo-preview-pages.html +0 -1092
  322. package/BookReaderDemo/demo-simple.html +0 -34
  323. package/BookReaderDemo/demo-vendor-fullscreen.html +0 -36
  324. package/BookReaderDemo/immersion-1up.html +0 -64
  325. package/BookReaderDemo/immersion-mode.html +0 -35
  326. package/BookReaderDemo/toggle_controls.html +0 -53
  327. package/BookReaderDemo/view_mode.html +0 -39
  328. package/BookReaderDemo/viewmode-cycle.html +0 -41
  329. package/CHANGELOG.md +0 -499
  330. package/CONTRIBUTING.md +0 -7
  331. package/codecov.yml +0 -17
  332. package/index.html +0 -31
  333. package/karma.conf.js +0 -23
  334. package/screenshot.png +0 -0
  335. package/scripts/postversion.js +0 -10
  336. package/scripts/preversion.js +0 -14
  337. package/scripts/version.js +0 -26
  338. package/src/BookNavigator/BookModel.js +0 -14
  339. package/src/BookNavigator/BookNavigator.js +0 -459
  340. package/src/BookNavigator/assets/book-loader.js +0 -27
  341. package/src/BookNavigator/assets/icon_checkmark.js +0 -6
  342. package/src/BookNavigator/assets/icon_close.js +0 -3
  343. package/src/BookNavigator/assets/icon_sort_ascending.js +0 -5
  344. package/src/BookNavigator/assets/icon_sort_descending.js +0 -5
  345. package/src/BookNavigator/assets/icon_sort_neutral.js +0 -5
  346. package/src/BookNavigator/assets/icon_volumes.js +0 -11
  347. package/src/BookNavigator/bookmarks/bookmarks-provider.js +0 -53
  348. package/src/BookNavigator/br-fullscreen-mgr.js +0 -83
  349. package/src/BookNavigator/downloads/downloads-provider.js +0 -66
  350. package/src/BookNavigator/search/a-search-result.js +0 -55
  351. package/src/BookNavigator/volumes/volumes-provider.js +0 -83
  352. package/src/BookNavigator/volumes/volumes.js +0 -178
  353. package/src/BookReader/DebugConsole.js +0 -54
  354. package/src/BookReaderComponent/BookReaderComponent.js +0 -112
  355. package/src/ItemNavigator/ItemNavigator.js +0 -376
  356. package/src/ItemNavigator/providers/sharing.js +0 -33
  357. package/src/css/_MobileNav.scss +0 -194
  358. package/src/dragscrollable-br.js +0 -261
  359. package/src/plugins/menu_toggle/plugin.menu_toggle.js +0 -324
  360. package/src/plugins/plugin.mobile_nav.js +0 -287
  361. package/tests/BookReader/BookModel.test.js +0 -312
  362. package/tests/BookReader/BookReaderPublicFunctions.test.js +0 -171
  363. package/tests/BookReader/DebugConsole.test.js +0 -25
  364. package/tests/BookReader/ImageCache.test.js +0 -150
  365. package/tests/BookReader/Mode1Up.test.js +0 -164
  366. package/tests/BookReader/Mode2Up.test.js +0 -247
  367. package/tests/BookReader/Navbar/Navbar.test.js +0 -169
  368. package/tests/BookReader/PageContainer.test.js +0 -115
  369. package/tests/BookReader/ReduceSet.test.js +0 -38
  370. package/tests/BookReader/Toolbar/Toolbar.test.js +0 -26
  371. package/tests/BookReader/utils/classes.test.js +0 -88
  372. package/tests/BookReader/utils.test.js +0 -109
  373. package/tests/BookReader.options.test.js +0 -39
  374. package/tests/BookReader.test.js +0 -301
  375. package/tests/e2e/README.md +0 -75
  376. package/tests/e2e/autoplay.test.js +0 -13
  377. package/tests/e2e/base.test.js +0 -35
  378. package/tests/e2e/helpers/base.js +0 -263
  379. package/tests/e2e/helpers/debug.js +0 -13
  380. package/tests/e2e/helpers/desktopSearch.js +0 -72
  381. package/tests/e2e/helpers/mobileSearch.js +0 -85
  382. package/tests/e2e/helpers/mockSearch.js +0 -93
  383. package/tests/e2e/helpers/rightToLeft.js +0 -29
  384. package/tests/e2e/ia-production/ia-prod-base.js +0 -17
  385. package/tests/e2e/models/BookReader.js +0 -11
  386. package/tests/e2e/models/Navigation.js +0 -56
  387. package/tests/e2e/rightToLeft.test.js +0 -20
  388. package/tests/e2e/viewmode.test.js +0 -37
  389. package/tests/karma/BookNavigator/book-navigator.test.js +0 -139
  390. package/tests/karma/BookNavigator/bookmarks/bookmark-edit.test.js +0 -133
  391. package/tests/karma/BookNavigator/bookmarks/bookmarks-list.test.js +0 -222
  392. package/tests/karma/BookNavigator/search/search-provider.test.js +0 -23
  393. package/tests/karma/BookNavigator/search/search-results.test.js +0 -240
  394. package/tests/karma/BookNavigator/sharing/sharing-provider.test.js +0 -40
  395. package/tests/karma/BookNavigator/visual-adjustments.test.js +0 -201
  396. package/tests/karma/BookNavigator/volumes/volumes-provider.test.js +0 -141
  397. package/tests/karma/BookNavigator/volumes/volumes.test.js +0 -98
  398. package/tests/plugins/menu_toggle/plugin.menu_toggle.test.js +0 -68
  399. package/tests/plugins/plugin.archive_analytics.test.js +0 -23
  400. package/tests/plugins/plugin.autoplay.test.js +0 -52
  401. package/tests/plugins/plugin.chapters.test.js +0 -130
  402. package/tests/plugins/plugin.iframe.test.js +0 -42
  403. package/tests/plugins/plugin.mobile_nav.test.js +0 -66
  404. package/tests/plugins/plugin.resume.test.js +0 -98
  405. package/tests/plugins/plugin.text_selection.test.js +0 -203
  406. package/tests/plugins/plugin.url.test.js +0 -129
  407. package/tests/plugins/plugin.vendor-fullscreen.test.js +0 -65
  408. package/tests/plugins/search/plugin.search.test.js +0 -173
  409. package/tests/plugins/search/plugin.search.view.test.js +0 -106
  410. package/tests/plugins/tts/AbstractTTSEngine.test.js +0 -153
  411. package/tests/plugins/tts/FestivalTTSEngine.test.js +0 -59
  412. package/tests/plugins/tts/PageChunk.test.js +0 -57
  413. package/tests/plugins/tts/PageChunkIterator.test.js +0 -179
  414. package/tests/plugins/tts/WebTTSEngine.test.js +0 -126
  415. package/tests/plugins/tts/utils.test.js +0 -133
  416. package/tests/util/browserSniffing.test.js +0 -56
  417. package/tests/util/docCookies.test.js +0 -15
  418. package/tests/util/strings.test.js +0 -63
  419. package/tests/utils.js +0 -42
  420. package/webpack.config.js +0 -86
@@ -1,270 +1,2 @@
1
- (self["webpackChunk_internetarchive_bookreader"] = self["webpackChunk_internetarchive_bookreader"] || []).push([["plugins/plugin.url.js"],{
2
-
3
- /***/ "./src/plugins/plugin.url.js":
4
- /*!***********************************!*\
5
- !*** ./src/plugins/plugin.url.js ***!
6
- \***********************************/
7
- /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
8
-
9
- "use strict";
10
- __webpack_require__.r(__webpack_exports__);
11
- /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.reduce.js */ "./node_modules/core-js/modules/es.array.reduce.js");
12
- /* harmony import */ var core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_reduce_js__WEBPACK_IMPORTED_MODULE_0__);
13
- /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.regexp.exec.js */ "./node_modules/core-js/modules/es.regexp.exec.js");
14
- /* harmony import */ var core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_regexp_exec_js__WEBPACK_IMPORTED_MODULE_1__);
15
- /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.string.replace.js */ "./node_modules/core-js/modules/es.string.replace.js");
16
- /* harmony import */ var core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_replace_js__WEBPACK_IMPORTED_MODULE_2__);
17
- /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.array.concat.js */ "./node_modules/core-js/modules/es.array.concat.js");
18
- /* harmony import */ var core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_concat_js__WEBPACK_IMPORTED_MODULE_3__);
19
- /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! core-js/modules/es.array.iterator.js */ "./node_modules/core-js/modules/es.array.iterator.js");
20
- /* harmony import */ var core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_iterator_js__WEBPACK_IMPORTED_MODULE_4__);
21
- /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! core-js/modules/es.object.to-string.js */ "./node_modules/core-js/modules/es.object.to-string.js");
22
- /* harmony import */ var core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_object_to_string_js__WEBPACK_IMPORTED_MODULE_5__);
23
- /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! core-js/modules/es.string.iterator.js */ "./node_modules/core-js/modules/es.string.iterator.js");
24
- /* harmony import */ var core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_string_iterator_js__WEBPACK_IMPORTED_MODULE_6__);
25
- /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core-js/modules/web.dom-collections.iterator.js */ "./node_modules/core-js/modules/web.dom-collections.iterator.js");
26
- /* harmony import */ var core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_collections_iterator_js__WEBPACK_IMPORTED_MODULE_7__);
27
- /* harmony import */ var core_js_modules_web_url_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! core-js/modules/web.url.js */ "./node_modules/core-js/modules/web.url.js");
28
- /* harmony import */ var core_js_modules_web_url_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_url_js__WEBPACK_IMPORTED_MODULE_8__);
29
- /* provided dependency */ var jQuery = __webpack_require__(/*! jquery */ "jquery");
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
- /* global BookReader */
41
-
42
- /**
43
- * Plugin for URL management in BookReader
44
- * Note read more about the url "fragment" here:
45
- * https://openlibrary.org/dev/docs/bookurls
46
- */
47
- jQuery.extend(BookReader.defaultOptions, {
48
- enableUrlPlugin: true,
49
- bookId: '',
50
-
51
- /** @type {string} Defaults can be a urlFragment string */
52
- defaults: null,
53
- updateWindowTitle: false,
54
-
55
- /** @type {'history' | 'hash'} */
56
- urlMode: 'hash',
57
-
58
- /**
59
- * When using 'history' mode, this part of the URL is kept constant
60
- * @example /details/plato/
61
- */
62
- urlHistoryBasePath: '/',
63
-
64
- /** Only these params will be reflected onto the URL */
65
- urlTrackedParams: ['page', 'search', 'mode', 'region', 'highlight'],
66
-
67
- /** If true, don't update the URL when `page == n0 (eg "/page/n0")` */
68
- urlTrackIndex0: false
69
- });
70
- /** @override */
71
-
72
- BookReader.prototype.setup = function (super_) {
73
- return function (options) {
74
- super_.call(this, options);
75
- this.bookId = options.bookId;
76
- this.defaults = options.defaults;
77
- this.locationPollId = null;
78
- this.oldLocationHash = null;
79
- this.oldUserHash = null;
80
- };
81
- }(BookReader.prototype.setup);
82
- /** @override */
83
-
84
-
85
- BookReader.prototype.init = function (super_) {
86
- return function () {
87
- var _this = this;
88
-
89
- if (this.options.enableUrlPlugin) {
90
- this.bind(BookReader.eventNames.PostInit, function () {
91
- var _this$options = _this.options,
92
- updateWindowTitle = _this$options.updateWindowTitle,
93
- urlMode = _this$options.urlMode;
94
-
95
- if (updateWindowTitle) {
96
- document.title = _this.shortTitle(50);
97
- }
98
-
99
- if (urlMode === 'hash') {
100
- _this.urlStartLocationPolling();
101
- }
102
- });
103
- this.bind(BookReader.eventNames.fragmentChange, this.urlUpdateFragment.bind(this));
104
- }
105
-
106
- super_.call(this);
107
- };
108
- }(BookReader.prototype.init);
109
- /**
110
- * Returns a shortened version of the title with the maximum number of characters
111
- * @param {number} maximumCharacters
112
- * @return {string}
113
- */
114
-
115
-
116
- BookReader.prototype.shortTitle = function (maximumCharacters) {
117
- if (this.bookTitle.length < maximumCharacters) {
118
- return this.bookTitle;
119
- }
120
-
121
- var title = "".concat(this.bookTitle.substr(0, maximumCharacters - 3), "...");
122
- return title;
123
- };
124
- /**
125
- * Starts polling of window.location to see hash fragment changes
126
- */
127
-
128
-
129
- BookReader.prototype.urlStartLocationPolling = function () {
130
- var _this2 = this;
131
-
132
- this.oldLocationHash = this.urlReadFragment();
133
-
134
- if (this.locationPollId) {
135
- clearInterval(this.locationPollID);
136
- this.locationPollId = null;
137
- }
138
-
139
- var updateHash = function updateHash() {
140
- var newFragment = _this2.urlReadFragment();
141
-
142
- var hasFragmentChange = newFragment != _this2.oldLocationHash && newFragment != _this2.oldUserHash;
143
-
144
- if (!hasFragmentChange) {
145
- return;
146
- }
147
-
148
- var params = _this2.paramsFromFragment(newFragment);
149
-
150
- var updateParams = function updateParams() {
151
- return _this2.updateFromParams(params);
152
- };
153
-
154
- _this2.trigger(BookReader.eventNames.stop);
155
-
156
- if (_this2.animating) {
157
- // Queue change if animating
158
- if (_this2.autoStop) _this2.autoStop();
159
- _this2.animationFinishedCallback = updateParams;
160
- } else {
161
- // update immediately
162
- updateParams();
163
- }
164
-
165
- _this2.oldUserHash = newFragment;
166
- };
167
-
168
- this.locationPollId = setInterval(updateHash, 500);
169
- };
170
- /**
171
- * Update URL from the current parameters.
172
- * Call this instead of manually using window.location.replace
173
- */
174
-
175
-
176
- BookReader.prototype.urlUpdateFragment = function () {
177
- var allParams = this.paramsFromCurrent();
178
- var _this$options2 = this.options,
179
- urlMode = _this$options2.urlMode,
180
- urlTrackIndex0 = _this$options2.urlTrackIndex0,
181
- urlTrackedParams = _this$options2.urlTrackedParams;
182
-
183
- if (!urlTrackIndex0 && typeof allParams.index !== 'undefined' && allParams.index === 0) {
184
- delete allParams.index;
185
- delete allParams.page;
186
- }
187
-
188
- var params = urlTrackedParams.reduce(function (validParams, paramName) {
189
- if (paramName in allParams) {
190
- validParams[paramName] = allParams[paramName];
191
- }
192
-
193
- return validParams;
194
- }, {});
195
- var newFragment = this.fragmentFromParams(params, urlMode);
196
- var currFragment = this.urlReadFragment();
197
- var currQueryString = this.getLocationSearch();
198
- var newQueryString = this.queryStringFromParams(params, currQueryString, urlMode);
199
-
200
- if (currFragment === newFragment && currQueryString === newQueryString) {
201
- return;
202
- }
203
-
204
- if (urlMode === 'history') {
205
- if (window.history && window.history.replaceState) {
206
- var baseWithoutSlash = this.options.urlHistoryBasePath.replace(/\/+$/, '');
207
- var newFragmentWithSlash = newFragment === '' ? '' : "/".concat(newFragment);
208
- var newUrlPath = "".concat(baseWithoutSlash).concat(newFragmentWithSlash).concat(newQueryString);
209
- window.history.replaceState({}, null, newUrlPath);
210
- this.oldLocationHash = newFragment + newQueryString;
211
- }
212
- } else {
213
- var newQueryStringSearch = this.urlParamsFiltersOnlySearch(this.readQueryString());
214
- window.location.replace('#' + newFragment + newQueryStringSearch);
215
- this.oldLocationHash = newFragment + newQueryStringSearch;
216
- }
217
- };
218
- /**
219
- * @private
220
- * Filtering query parameters to select only book search param (?q=foo)
221
- This needs to be updated/URL system modified if future query params are to be added
222
- * @param {string} url
223
- * @return {string}
224
- * */
225
-
226
-
227
- BookReader.prototype.urlParamsFiltersOnlySearch = function (url) {
228
- var params = new URLSearchParams(url);
229
- return params.has('q') ? "?".concat(new URLSearchParams({
230
- q: params.get('q')
231
- })) : '';
232
- };
233
- /**
234
- * Will read either the hash or URL and return the bookreader fragment
235
- * @return {string}
236
- */
237
-
238
-
239
- BookReader.prototype.urlReadFragment = function () {
240
- var _this$options3 = this.options,
241
- urlMode = _this$options3.urlMode,
242
- urlHistoryBasePath = _this$options3.urlHistoryBasePath;
243
-
244
- if (urlMode === 'history') {
245
- return window.location.pathname.substr(urlHistoryBasePath.length);
246
- } else {
247
- return window.location.hash.substr(1);
248
- }
249
- };
250
- /**
251
- * Will read the hash return the bookreader fragment
252
- * @return {string}
253
- */
254
-
255
-
256
- BookReader.prototype.urlReadHashFragment = function () {
257
- return window.location.hash.substr(1);
258
- };
259
-
260
- /***/ })
261
-
262
- },
263
- /******/ function(__webpack_require__) { // webpackRuntimeModules
264
- /******/ "use strict";
265
- /******/
266
- /******/ var __webpack_exec__ = function(moduleId) { return __webpack_require__(__webpack_require__.s = moduleId); }
267
- /******/ var __webpack_exports__ = (__webpack_exec__("./src/plugins/plugin.url.js"));
268
- /******/ }
269
- ]);
1
+ "use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[479],{1743:function(t,e,r){var n=r(4576);t.exports=function(t,e){var r=n[t],o=r&&r.prototype;return o&&o[e]}},6098:function(t,e,r){var n=r(9504),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",u=RangeError,l=n(a.exec),c=Math.floor,h=String.fromCharCode,f=n("".charCodeAt),p=n([].join),d=n([].push),m=n("".replace),g=n("".split),y=n("".toLowerCase),v=function(t){return t+22+75*(t<26)},b=function(t,e,r){var n=0;for(t=r?c(t/700):t>>1,t+=c(t/e);t>455;)t=c(t/35),n+=36;return c(n+36*t/(t+38))},w=function(t){var e=[];t=function(t){for(var e=[],r=0,n=t.length;r<n;){var o=f(t,r++);if(o>=55296&&o<=56319&&r<n){var i=f(t,r++);56320==(64512&i)?d(e,((1023&o)<<10)+(1023&i)+65536):(d(e,o),r--)}else d(e,o)}return e}(t);var r,n,i=t.length,a=128,l=0,m=72;for(r=0;r<t.length;r++)(n=t[r])<128&&d(e,h(n));var g=e.length,y=g;for(g&&d(e,"-");y<i;){var w=o;for(r=0;r<t.length;r++)(n=t[r])>=a&&n<w&&(w=n);var P=y+1;if(w-a>c((o-l)/P))throw new u(s);for(l+=(w-a)*P,a=w,r=0;r<t.length;r++){if((n=t[r])<a&&++l>o)throw new u(s);if(n===a){for(var S=l,k=36;;){var R=k<=m?1:k>=m+26?26:k-m;if(S<R)break;var U=S-R,B=36-R;d(e,h(v(R+U%B))),S=c(U/B),k+=36}d(e,h(v(S))),m=b(l,P,y===g),l=0,y++}}l++,a++}return p(e,"")};t.exports=function(t){var e,r,n=[],o=g(m(y(t),a,"."),".");for(e=0;e<o.length;e++)r=o[e],d(n,l(i,r)?"xn--"+w(r):r);return p(n,".")}},706:function(t,e,r){var n=r(350).PROPER,o=r(9039),i=r(7452);t.exports=function(t){return o(function(){return!!i[t]()||"​…᠎"!=="​…᠎"[t]()||n&&i[t].name!==t})}},3921:function(t,e,r){var n=r(6518),o=r(2652),i=r(4659);n({target:"Object",stat:!0},{fromEntries:function(t){var e={};return o(t,function(t,r){i(e,t,r)},{AS_ENTRIES:!0}),e}})},2762:function(t,e,r){var n=r(6518),o=r(3802).Bq;n({target:"String",proto:!0,forced:r(706)("trim")},{trim:function(){return o(this)}})},9912:function(t,e,r){var n=function(){return r(6518)},o=function(){return r(7764)},i=r.cw(function(t,e){o();var i,a=n(),s=r(3724),u=r(7416),l=r(4576),c=r(6080),h=r(9504),f=r(6840),p=r(2106),d=r(679),m=r(9297),g=r(4213),y=r(7916),v=r(7680),b=r(8183).L,w=r(6098),P=r(918),S=r(655),k=r(687),R=r(2812),U=r(8406),B=r(1181),H=B.set,O=B.getterFor("URL"),L=U.URLSearchParams,j=U.getState,I=P.decode,q=P.encode,A=l.URL,T=l.TypeError,F=l.parseInt,C=Math.floor,_=Math.pow,E=String.fromCharCode,M=h("".charAt),x=h(/./.exec),$=h([].join),z=h(1.1.toString),N=h([].pop),D=h([].push),J=h("".replace),W=h([].shift),Q=h("".split),G=h("".indexOf),K=h("".slice),V=h("".toLowerCase),X=h([].unshift),Y="Invalid scheme",Z="Invalid host",tt="Invalid port",et=/[a-z]/i,rt=/[\d+\-.a-z]/i,nt=/\d/,ot=/^0x/i,it=/^[0-7]+$/,at=/^\d+$/,st=/^[\da-f]+$/i,ut=/[\u0000-\u0020#%/:<>?@[\\\]^|\u007F]/,lt=/[\0\t\n\r #/:<>?@[\\\]^|]/,ct=/^[\u0000-\u0020]+/,ht=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ft=/[\t\n\r]/g,pt=/[^\u0000-\u007F]/,dt=function(t){return 173===t||847===t||8203===t||12644===t||65279===t||65440===t||t>=4447&&t<=4448||t>=6068&&t<=6069||t>=6155&&t<=6159||t>=8288&&t<=8292||t>=8298&&t<=8303||t>=65024&&t<=65039||t>=917760&&t<=917999},mt=function(t){return 65533===t||t>=55296&&t<=57343||t>=128&&t<=159||t>=8206&&t<=8207||t>=8232&&t<=8233||t>=8234&&t<=8238||t>=8293&&t<=8297||t>=64976&&t<=65007||!(65534&~t)||t>=57344&&t<=63743||t>=983040&&t<=1114109},gt=function(t){return t>=65281&&t<=65374?t-65248:160===t||5760===t||8239===t||8287===t||12288===t||t>=8192&&t<=8202||t<=65535&&G("¨¯´¸˘˙˚˛˜˝ͺ΄΅᾽᾿῀῁῍῎῏῝῞῟῭΅´῾‗‾⁇⁈⁉℀℁℅℆⩴゛゜ﱞﱟﱠﱡﱢﱣﷺﷻ︓︖﹇﹈﹉﹊﹋﹌﹕﹖﹟﹤﹥﹨﹪﹫ﹰﹲﹴﹶﹸﹺﹼﹾ ̄",E(t))>-1?32:t},yt=function(t){var e,r,n,o;if("number"==typeof t){for(e=[],r=0;r<4;r++)X(e,t%256),t=C(t/256);return $(e,".")}if("object"==typeof t){for(e="",n=function(t){for(var e=null,r=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>r&&(e=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r?n:e}(t),r=0;r<8;r++)o&&0===t[r]||(o&&(o=!1),n===r?(e+=r?":":"::",o=!0):(e+=z(t[r],16),r<7&&(e+=":")));return"["+e+"]"}return t},vt={},bt=g({},vt,{" ":1,'"':1,"#":1,"<":1,">":1}),wt=g({},bt,{"'":1}),Pt=g({},vt,{" ":1,'"':1,"<":1,">":1,"`":1}),St=g({},Pt,{"#":1,"?":1,"{":1,"}":1,"^":1}),kt=g({},St,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Rt=function(t,e){var r=b(t,0);return r>=32&&r<127&&!m(e,t)?t:"'"===t&&m(e,t)?"%27":q(t)},Ut={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Bt=function(t,e){var r;return 2===t.length&&x(et,M(t,0))&&(":"===(r=M(t,1))||!e&&"|"===r)},Ht=function(t){var e;return t.length>1&&Bt(K(t,0,2))&&(2===t.length||"/"===(e=M(t,2))||"\\"===e||"?"===e||"#"===e)},Ot=function(t){return"."===t||"%2e"===V(t)},Lt=function(t){return".."===(t=V(t))||"%2e."===t||".%2e"===t||"%2e%2e"===t},jt={},It={},qt={},At={},Tt={},Ft={},Ct={},_t={},Et={},Mt={},xt={},$t={},zt={},Nt={},Dt={},Jt={},Wt={},Qt={},Gt={},Kt={},Vt={},Xt=function(t,e,r){var n,o,i,a=S(t);if(e){if(o=this.parse(a))throw new T(o);this.searchParams=null}else{if(void 0!==r&&(n=new Xt(r,!0)),o=this.parse(a,null,n))throw new T(o);(i=j(new L)).bindURL(this),this.searchParams=i}};Xt.prototype={type:"URL",parse:function(t,e,r){var n,o,a,s,u=this,l=e||jt,c=0,h="",f=!1,p=!1,d=!1;for(t=S(t),e||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,t=J(t,ct,""),t=J(t,ht,"$1")),t=J(t,ft,""),n=y(t);c<=n.length;){switch(o=n[c],l){case jt:if(!o||!x(et,o)){if(e)return Y;l=qt;continue}h+=V(o),l=It;break;case It:if(o&&x(rt,o))h+=V(o);else{if(":"!==o){if(e)return Y;h="",l=qt,c=0;continue}if(e&&(u.isSpecial()!==m(Ut,h)||"file"===h&&(u.includesCredentials()||null!==u.port)||"file"===u.scheme&&""===u.host))return;if(u.scheme=h,e)return void(u.isSpecial()&&Ut[u.scheme]===u.port&&(u.port=null));h="","file"===u.scheme?l=Nt:u.isSpecial()&&r&&r.scheme===u.scheme?l=At:u.isSpecial()?l=_t:"/"===n[c+1]?(l=Tt,c++):(u.cannotBeABaseURL=!0,D(u.path,""),l=Gt)}break;case qt:if(!r||r.cannotBeABaseURL&&"#"!==o)return Y;if(r.cannotBeABaseURL&&"#"===o){u.scheme=r.scheme,u.path=v(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,l=Vt;break}l="file"===r.scheme?Nt:Ft;continue;case At:if("/"!==o||"/"!==n[c+1]){l=Ft;continue}l=Et,c++;break;case Tt:if("/"===o){l=Mt;break}l=Qt;continue;case Ft:if(u.scheme=r.scheme,o===i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query=r.query;else if("/"===o||"\\"===o&&u.isSpecial())l=Ct;else if("?"===o)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query="",l=Kt;else{if("#"!==o){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.path.length&&u.path.length--,l=Qt;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query=r.query,u.fragment="",l=Vt}break;case Ct:if(!u.isSpecial()||"/"!==o&&"\\"!==o){if("/"!==o){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,l=Qt;continue}l=Mt}else l=Et;break;case _t:if(l=Et,"/"!==o||"/"!==n[c+1])continue;c++;break;case Et:if("/"!==o&&"\\"!==o){l=Mt;continue}break;case Mt:if("@"===o){f&&(h="%40"+h),f=!0,a=y(h);for(var g=0;g<a.length;g++){var b=a[g];if(":"!==b||d){var w=Rt(b,kt);d?u.password+=w:u.username+=w}else d=!0}h=""}else if(o===i||"/"===o||"?"===o||"#"===o||"\\"===o&&u.isSpecial()){if(f&&""===h)return"Invalid authority";c-=y(h).length+1,h="",l=xt}else h+=o;break;case xt:case $t:if(e&&"file"===u.scheme){l=Jt;continue}if(":"!==o||p){if(o===i||"/"===o||"?"===o||"#"===o||"\\"===o&&u.isSpecial()){if(u.isSpecial()&&""===h)return Z;if(e&&""===h&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(h))return s;if(h="",l=Wt,e)return;continue}"["===o?p=!0:"]"===o&&(p=!1),h+=o}else{if(""===h)return Z;if(e===$t)return;if(s=u.parseHost(h))return s;h="",l=zt}break;case zt:if(!x(nt,o)){if(o===i||"/"===o||"?"===o||"#"===o||"\\"===o&&u.isSpecial()||e){if(""!==h){var P=F(h,10);if(P>65535)return tt;u.port=u.isSpecial()&&P===Ut[u.scheme]?null:P,h=""}if(e)return;l=Wt;continue}return tt}h+=o;break;case Nt:if(u.scheme="file",u.host="","/"===o||"\\"===o)l=Dt;else{if(!r||"file"!==r.scheme){l=Qt;continue}switch(o){case i:u.host=r.host,u.path=v(r.path),u.query=r.query;break;case"?":u.host=r.host,u.path=v(r.path),u.query="",l=Kt;break;case"#":u.host=r.host,u.path=v(r.path),u.query=r.query,u.fragment="",l=Vt;break;default:u.host=r.host,Ht($(v(n,c),""))||(u.path=v(r.path),u.shortenPath()),l=Qt;continue}}break;case Dt:if("/"===o||"\\"===o){l=Jt;break}r&&"file"===r.scheme&&(u.host=r.host,!Ht($(v(n,c),""))&&Bt(r.path[0],!0)&&D(u.path,r.path[0])),l=Qt;continue;case Jt:if(o===i||"/"===o||"\\"===o||"?"===o||"#"===o){if(!e&&Bt(h))l=Qt;else if(""===h){if(u.host="",e)return;l=Wt}else{if(s=u.parseHost(h))return s;if("localhost"===u.host&&(u.host=""),e)return;h="",l=Wt}continue}h+=o;break;case Wt:if(u.isSpecial()){if(l=Qt,"/"!==o&&"\\"!==o)continue}else if(e||"?"!==o)if(e||"#"!==o){if(o!==i&&(l=Qt,"/"!==o))continue}else u.fragment="",l=Vt;else u.query="",l=Kt;break;case Qt:if(o===i||"/"===o||"\\"===o&&u.isSpecial()||!e&&("?"===o||"#"===o)){if(Lt(h)?(u.shortenPath(),"/"===o||"\\"===o&&u.isSpecial()||D(u.path,"")):Ot(h)?"/"===o||"\\"===o&&u.isSpecial()||D(u.path,""):("file"===u.scheme&&!u.path.length&&Bt(h)&&(null!==u.host&&""!==u.host&&(u.host=""),h=M(h,0)+":"),D(u.path,h)),h="","file"===u.scheme&&(o===i||"?"===o||"#"===o))for(;u.path.length>1&&""===u.path[0];)W(u.path);"?"===o?(u.query="",l=Kt):"#"===o&&(u.fragment="",l=Vt)}else h+=Rt(o,St);break;case Gt:"?"===o?(u.query="",l=Kt):"#"===o?(u.fragment="",l=Vt):o!==i&&(u.path[0]+=" "===o?"?"===n[c+1]||"#"===n[c+1]?"%20":" ":Rt(o,vt));break;case Kt:e||"#"!==o?o!==i&&(u.query+=Rt(o,u.isSpecial()?wt:bt)):(u.fragment="",l=Vt);break;case Vt:o!==i&&(u.fragment+=Rt(o,Pt))}c++}},parseHost:function(t){var e,r,n;if("["===M(t,0)){if("]"!==M(t,t.length-1))return Z;if(e=function(t){var e,r,n,o,i,a,s,u=[0,0,0,0,0,0,0,0],l=0,c=null,h=0,f=function(){return M(t,h)};if(":"===f()){if(":"!==M(t,1))return;h+=2,c=++l}for(;f();){if(8===l)return;if(":"!==f()){for(e=r=0;r<4&&x(st,f());)e=16*e+F(f(),16),h++,r++;if("."===f()){if(0===r)return;if(h-=r,l>6)return;for(n=0;f();){if(o=null,n>0){if(!("."===f()&&n<4))return;h++}if(!x(nt,f()))return;for(;x(nt,f());){if(i=F(f(),10),null===o)o=i;else{if(0===o)return;o=10*o+i}if(o>255)return;h++}u[l]=256*u[l]+o,2!==++n&&4!==n||l++}if(4!==n)return;break}if(":"===f()){if(h++,!f())return}else if(f())return;u[l++]=e}else{if(null!==c)return;h++,c=++l}}if(null!==c)for(a=l-c,l=7;0!==l&&a>0;)s=u[l],u[l--]=u[c+a-1],u[c+--a]=s;else if(8!==l)return;return u}(K(t,1,-1)),!e)return Z;this.host=e}else if(this.isSpecial()){if(t=function(t){if(!x(pt,t))return""===t?null:w(t);var e,r,n,o=y(t),i="";for(e=0;e<o.length;e++){if(r=b(o[e],0),mt(r))return null;dt(r)||(i+=(n=gt(r))===r?o[e]:E(n))}return""===i?null:w(i)}(I(t)),null===t||x(ut,t))return Z;if(function(t){var e,r,n=Q(t,".");if(""===n[n.length-1]){if(1===n.length)return!1;n.length--}return e=n[n.length-1],!!x(at,e)||!!x(ot,e)&&(""===(r=K(e,2))||!!x(st,r))}(t)){if(e=function(t){var e,r,n,o,i,a,s,u=Q(t,".");if(u.length&&""===u[u.length-1]&&u.length--,(e=u.length)>4)return null;for(r=[],n=0;n<e;n++){if(""===(o=u[n]))return null;if(i=10,o.length>1&&"0"===M(o,0)&&(i=x(ot,o)?16:8,o=K(o,8===i?1:2)),""===o)a=0;else{if(!x(10===i?at:8===i?it:st,o))return null;a=F(o,i)}D(r,a)}for(n=0;n<e;n++)if(a=r[n],n===e-1){if(a>=_(256,5-e))return null}else if(a>255)return null;for(s=N(r),n=0;n<r.length;n++)s+=r[n]*_(256,3-n);return s}(t),null===e)return Z;this.host=e}else this.host=t}else{if(x(lt,t))return Z;for(e="",r=y(t),n=0;n<r.length;n++)e+=Rt(r[n],vt);this.host=e}},cannotHaveUsernamePasswordPort:function(){return null===this.host||""===this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return m(Ut,this.scheme)},shortenPath:function(){var t=this.path,e=t.length;!e||"file"===this.scheme&&1===e&&Bt(t[0],!0)||t.length--},serialize:function(){var t=this,e=t.scheme,r=t.username,n=t.password,o=t.host,i=t.port,a=t.path,s=t.query,u=t.fragment,l=e+":";return null!==o?(l+="//",t.includesCredentials()&&(l+=r+(n?":"+n:"")+"@"),l+=yt(o),null!==i&&(l+=":"+i)):"file"===e&&(l+="//"),null===o&&!t.cannotBeABaseURL&&a.length>1&&""===a[0]&&(l+="/."),l+=t.cannotBeABaseURL?a[0]:a.length?"/"+$(a,"/"):"",null!==s&&(l+="?"+s),null!==u&&(l+="#"+u),l},setHref:function(t){var e=this.parse(t);if(e)throw new T(e);this.searchParams.update()},getOrigin:function(){var t=this.scheme,e=this.port;if("blob"===t)try{return new Yt(this.path[0]).origin}catch(t){return"null"}return"file"!==t&&this.isSpecial()?t+"://"+yt(this.host)+(null!==e?":"+e:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(S(t)+":",jt)},getUsername:function(){return this.username},setUsername:function(t){var e=y(S(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<e.length;r++)this.username+=Rt(e[r],kt)}},getPassword:function(){return this.password},setPassword:function(t){var e=y(S(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<e.length;r++)this.password+=Rt(e[r],kt)}},getHost:function(){var t=this.host,e=this.port;return null===t?"":null===e?yt(t):yt(t)+":"+e},setHost:function(t){this.cannotBeABaseURL||this.parse(t,xt)},getHostname:function(){var t=this.host;return null===t?"":yt(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,$t)},getPort:function(){var t=this.port;return null===t?"":S(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""===(t=S(t))?this.port=null:this.parse(t,zt))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+$(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,Wt))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""===(t=S(t))?this.query=null:("?"===M(t,0)&&(t=K(t,1)),this.query="",this.parse(t,Kt)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!==(t=S(t))?("#"===M(t,0)&&(t=K(t,1)),this.fragment="",this.parse(t,Vt)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Yt=function(t){var e=d(this,Zt),r=R(arguments.length,1)>1?arguments[1]:void 0,n=H(e,new Xt(t,!1,r));s||(e.href=n.serialize(),e.origin=n.getOrigin(),e.protocol=n.getProtocol(),e.username=n.getUsername(),e.password=n.getPassword(),e.host=n.getHost(),e.hostname=n.getHostname(),e.port=n.getPort(),e.pathname=n.getPathname(),e.search=n.getSearch(),e.searchParams=n.getSearchParams(),e.hash=n.getHash())},Zt=Yt.prototype,te=function(t,e){return{get:function(){return O(this)[t]()},set:e&&function(t){return O(this)[e](t)},configurable:!0,enumerable:!0}};if(s&&(p(Zt,"href",te("serialize","setHref")),p(Zt,"origin",te("getOrigin")),p(Zt,"protocol",te("getProtocol","setProtocol")),p(Zt,"username",te("getUsername","setUsername")),p(Zt,"password",te("getPassword","setPassword")),p(Zt,"host",te("getHost","setHost")),p(Zt,"hostname",te("getHostname","setHostname")),p(Zt,"port",te("getPort","setPort")),p(Zt,"pathname",te("getPathname","setPathname")),p(Zt,"search",te("getSearch","setSearch")),p(Zt,"searchParams",te("getSearchParams")),p(Zt,"hash",te("getHash","setHash"))),f(Zt,"toJSON",function(){return O(this).serialize()},{enumerable:!0}),f(Zt,"toString",function(){return O(this).serialize()},{enumerable:!0}),A){var ee=A.createObjectURL,re=A.revokeObjectURL;ee&&f(Yt,"createObjectURL",c(ee,A)),re&&f(Yt,"revokeObjectURL",c(re,A))}k(Yt,"URL"),a({global:!0,constructor:!0,forced:!u,sham:!s},{URL:Yt})}),a=r.cw(function(t,e){i()}),s=r.cw(function(t,e){var o=n(),i=r(9565),a=r(1743)("URL","toString");o({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return i(a,this)}})});function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function l(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return c(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(t,e):void 0}}(t,e)||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 c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,f(n.key),n)}}function f(t){var e=function(t){if("object"!=u(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==u(e)?e:e+""}r(2675),r(9463),r(2259),r(5700),r(8706),r(3418),r(3792),r(2712),r(4782),r(9572),r(2010),r(2892),r(3851),r(875),r(6099),r(825),r(888),r(7495),r(8781),o(),r(5440),r(2953),r(8408),r(2008),r(113),r(8598),r(2062),r(5506),r(3921),r(9432),r(1761),r(5746),r(2762),r(3500),a(),s();var p,d=function(){return t=function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.bookReaderOptions=e,this.urlSchema=[{name:"page",position:"path",default:"n0"},{name:"mode",position:"path",default:"2up"},{name:"search",position:"path",deprecated_for:"q"},{name:"q",position:"query_param"},{name:"sort",position:"query_param"},{name:"view",position:"query_param"},{name:"admin",position:"query_param"},{name:"focus",position:"query_param",readOnly:!0}],this.urlState={},this.urlMode=this.bookReaderOptions.urlMode||"hash",this.urlHistoryBasePath=this.bookReaderOptions.urlHistoryBasePath||"/",this.urlLocationPollId=null,this.oldLocationHash=null,this.oldUserHash=null},e=[{key:"urlStateToUrlString",value:function(t){var e=this,r=new URLSearchParams,n={};Object.keys(t).forEach(function(o){var i,a,s,u,l,c=e.urlSchema.find(function(t){return t.name===o});null!==(i=c)&&void 0!==i&&i.deprecated_for&&(c=e.urlSchema.find(function(t){return t.name===c.deprecated_for})),null!==(a=c)&&void 0!==a&&a.readOnly||("path"==(null===(s=c)||void 0===s?void 0:s.position)?n[null===(u=c)||void 0===u?void 0:u.name]=t[o]:r.append((null===(l=c)||void 0===l?void 0:l.name)||o,t[o]))});var o=this.urlSchema.filter(function(t){return"path"==t.position}).map(function(t){return n[t.name]?"".concat(t.name,"/").concat(encodeURIComponent(n[t.name])):""}).join("/"),i="".concat(o.replace(/\/+/g,"/").replace(/\/+$/,"")),a="".concat(i,"?").concat(r.toString());return r.toString()?a:"".concat(i)}},{key:"urlStringToUrlState",value:function(t){var e={},r=new URL(t,"http://example.com"),n=Object.fromEntries(r.searchParams.entries()),o=r.pathname.match(/[^\\/]+\/[^\\/]+/g),i=o?Object.fromEntries(o.map(function(t){return t.split("/")})):{},a=function(t,e){return Object.keys(t).some(function(t){return t==e})};return this.urlSchema.filter(function(t){return"path"==t.position}).forEach(function(t){var r=a(i,t.name),n=a(t,"deprecated_for")&&r;if(r||n){var o=n?t.deprecated_for:t.name;e[o]=decodeURIComponent(i[t.name])}}),Object.entries(n).forEach(function(t){var r=l(t,2),n=r[0],o=r[1];e[n]=o}),e}},{key:"setUrlParam",value:function(t,e){this.urlState[t]=e,this.pushToAddressBar()}},{key:"removeUrlParam",value:function(t){delete this.urlState[t],this.pushToAddressBar()}},{key:"getUrlParam",value:function(t){return this.urlState[t]}},{key:"pushToAddressBar",value:function(){var t=this.urlStateToUrlString(this.urlState),e="/"!==t?t:"";if("history"==this.urlMode)if(window.history&&window.history.replaceState){var r="".concat(this.urlHistoryBasePath).concat(e).trim().replace(/(\/+)/g,"/");try{window.history.replaceState({},null,r)}catch(t){this.urlMode="hash"}}else this.options.urlMode="hash";if("hash"==this.urlMode){var n=l(window.location.href.split("#"),1)[0];window.location.replace("".concat(n,"#").concat(e))}this.oldLocationHash=t}},{key:"listenForHashChanges",value:function(){var t=this;this.oldLocationHash=this.getHash(),this.urlLocationPollId&&(clearInterval(this.urlLocationPollId),this.urlLocationPollId=null),this.urlLocationPollId=setInterval(function(){var e=t.getHash();e!=t.oldLocationHash&&(t.urlState=t.urlStringToUrlState(e))},500)}},{key:"pullFromAddressBar",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location,e="history"===this.urlMode?t.pathname.substr(this.urlHistoryBasePath.length)+t.search:t.hash.substr(1);this.urlState=this.urlStringToUrlState(e)}},{key:"getHash",value:function(){return window.location.hash.slice(1)}}],e&&h(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function m(t){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},m(t)}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,y(n.key),n)}}function y(t){var e=function(t){if("object"!=m(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==m(e)?e:e+""}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(v=function(){return!!t})()}function b(){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=w(t)););return t}(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},b.apply(null,arguments)}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function P(t,e){return P=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},P(t,e)}function S(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}r(1669).extend(BookReader.defaultOptions,{enableUrlPlugin:!0,bookId:"",defaults:null,updateWindowTitle:!1,urlMode:"hash",urlHistoryBasePath:"/",urlTrackedParams:["page","search","mode","region","highlight","view","text"],urlTrackIndex0:!1}),BookReader.prototype.setup=(p=BookReader.prototype.setup,function(t){p.call(this,t),this.bookId=t.bookId,this.defaults=t.defaults,this.locationPollId=null,this.oldLocationHash=null,this.oldUserHash=null}),BookReader.prototype.init=function(t){return function(){var e=this;this.options.enableUrlPlugin&&(this.bind(BookReader.eventNames.PostInit,function(){var t=e.options,r=t.updateWindowTitle,n=t.urlMode;r&&(document.title=e.shortTitle(e.bookTitle,50)),"hash"===n&&e.urlStartLocationPolling()}),this.bind(BookReader.eventNames.fragmentChange,this.urlUpdateFragment.bind(this))),t.call(this)}}(BookReader.prototype.init),BookReader.prototype.shortTitle=function(t){return this.bookTitle.length<t?this.bookTitle:"".concat(this.bookTitle.substr(0,t-3),"...")},BookReader.prototype.urlStartLocationPolling=function(){var t=this;this.oldLocationHash=this.urlReadFragment(),this.locationPollId&&(clearInterval(this.locationPollId),this.locationPollId=null),this.locationPollId=setInterval(function(){var e=t.urlReadFragment();if(e!=t.oldLocationHash&&e!=t.oldUserHash){var r,n=t.paramsFromFragment(e),o=function(){return t.updateFromParams(n)};t.trigger(BookReader.eventNames.stop),t.animating?(null===(r=t.plugins.autoplay)||void 0===r||r.stop(),t.animationFinishedCallback=o):o(),t.oldUserHash=e}},500)},BookReader.prototype.urlUpdateFragment=function(){var t=this.paramsFromCurrent(),e=this.options,r=e.urlTrackIndex0,n=e.urlTrackedParams;r||void 0===t.index||0!==t.index||(delete t.index,delete t.page);var o,i,a=n.reduce(function(e,r){return r in t&&(e[r]=t[r]),e},{}),s=this.fragmentFromParams(a,this.options.urlMode),u=""===s?"":"/".concat(s),l=this.urlReadFragment(),c=this.getLocationSearch(),h=this.queryStringFromParams(a,c,this.options.urlMode);if(l!==s||c!==h){if("history"===this.options.urlMode)if(window.history&&window.history.replaceState){var f=this.options.urlHistoryBasePath.replace(/\/+$/,""),p="".concat(f).concat(u).concat(h);try{window.history.replaceState({},null,p),this.oldLocationHash=s+h}catch(i){this.options.urlMode="hash"}}else this.options.urlMode="hash";if("hash"===this.options.urlMode){var d=this.urlParamsFiltersOnlySearch(this.readQueryString()),m=(o=window.location.href.split("#"),i=1,function(t){if(Array.isArray(t))return t}(o)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,s=[],u=!0,l=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=i.call(r)).done)&&(s.push(n.value),s.length!==e);u=!0);}catch(t){l=!0,o=t}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw o}}return s}}(o,i)||function(t,e){if(t){if("string"==typeof t)return S(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(t,e):void 0}}(o,i)||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.")}())[0];window.location.replace("".concat(m,"#").concat(s).concat(d)),this.oldLocationHash=s+d}}},BookReader.prototype.urlParamsFiltersOnlySearch=function(t){var e=new URLSearchParams(t);return e.has("q")?"?".concat(new URLSearchParams({q:e.get("q")})):""},BookReader.prototype.urlReadFragment=function(){var t=this.options,e=t.urlMode,r=t.urlHistoryBasePath;return"history"===e?window.location.pathname.substr(r.length):this.urlPlugin.getHash()},BookReader.prototype.urlReadHashFragment=function(){return window.location.hash.substr(1)};var k=function(){function t(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),function(t,e,r){return e=w(e),function(t,e){if(e&&("object"==m(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,v()?Reflect.construct(e,r||[],w(t).constructor):e.apply(t,r))}(this,t,arguments)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&P(t,e)}(t,BookReader),e=t,r=[{key:"init",value:function(){var e,r,n,o=this;this.options.enableUrlPlugin&&(this.urlPlugin=new d(this.options),this.on(BookReader.eventNames.PostInit,function(){"hash"===o.options.urlMode&&o.urlPlugin.listenForHashChanges()})),(e=t,r=this,"function"==typeof(n=b(w(1&3?e.prototype:e),"init",r))?function(t){return n.apply(r,t)}:n)([])}}],r&&g(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r}();window.BookReader=k}},function(t){t(9912)}]);
270
2
  //# sourceMappingURL=plugin.url.js.map