@internetarchive/bookreader 5.0.0-118-alpha2 → 5.0.0-119

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 (232) hide show
  1. package/BookReader/474.js +2 -0
  2. package/BookReader/474.js.map +1 -0
  3. package/BookReader/BookReader.css +2451 -0
  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/ia-bookreader.js.LICENSE.txt +78 -0
  52. package/BookReader/ia-bookreader.js.map +1 -0
  53. package/BookReader/icons/1up.svg +1 -0
  54. package/BookReader/icons/2up.svg +1 -0
  55. package/BookReader/icons/advance.svg +3 -0
  56. package/BookReader/icons/chevron-right.svg +1 -0
  57. package/BookReader/icons/close-circle-dark.svg +1 -0
  58. package/BookReader/icons/close-circle.svg +1 -0
  59. package/BookReader/icons/fullscreen.svg +1 -0
  60. package/BookReader/icons/fullscreen_exit.svg +1 -0
  61. package/BookReader/icons/hamburger.svg +1 -0
  62. package/BookReader/icons/left-arrow.svg +1 -0
  63. package/BookReader/icons/magnify-minus.svg +1 -0
  64. package/BookReader/icons/magnify-plus.svg +1 -0
  65. package/BookReader/icons/magnify.svg +1 -0
  66. package/BookReader/icons/pause.svg +1 -0
  67. package/BookReader/icons/play.svg +1 -0
  68. package/BookReader/icons/playback-speed.svg +1 -0
  69. package/BookReader/icons/read-aloud.svg +1 -0
  70. package/BookReader/icons/review.svg +3 -0
  71. package/BookReader/icons/slider-toggle.svg +1 -0
  72. package/BookReader/icons/thumbnails.svg +1 -0
  73. package/BookReader/icons/voice.svg +1 -0
  74. package/BookReader/icons/volume-full.svg +1 -0
  75. package/BookReader/images/BRicons.png +0 -0
  76. package/BookReader/images/BRicons.svg +5 -0
  77. package/BookReader/images/BRicons_ia.png +0 -0
  78. package/BookReader/images/back_pages.png +0 -0
  79. package/BookReader/images/book_bottom_icon.png +0 -0
  80. package/BookReader/images/book_down_icon.png +0 -0
  81. package/BookReader/images/book_left_icon.png +0 -0
  82. package/BookReader/images/book_leftmost_icon.png +0 -0
  83. package/BookReader/images/book_right_icon.png +0 -0
  84. package/BookReader/images/book_rightmost_icon.png +0 -0
  85. package/BookReader/images/book_top_icon.png +0 -0
  86. package/BookReader/images/book_up_icon.png +0 -0
  87. package/BookReader/images/books_graphic.svg +1 -0
  88. package/BookReader/images/booksplit.png +0 -0
  89. package/BookReader/images/control_pause_icon.png +0 -0
  90. package/BookReader/images/control_play_icon.png +0 -0
  91. package/BookReader/images/embed_icon.png +0 -0
  92. package/BookReader/images/hypothesis.ico +0 -0
  93. package/BookReader/images/icon-home-ia.png +0 -0
  94. package/BookReader/images/icon_OL-logo-xs.png +0 -0
  95. package/BookReader/images/icon_alert-xs.png +0 -0
  96. package/BookReader/images/icon_book.svg +1 -0
  97. package/BookReader/images/icon_bookmark.svg +1 -0
  98. package/BookReader/images/icon_close-pop.png +0 -0
  99. package/BookReader/images/icon_download.png +0 -0
  100. package/BookReader/images/icon_experiment.svg +1 -0
  101. package/BookReader/images/icon_gear.svg +1 -0
  102. package/BookReader/images/icon_hamburger.svg +1 -0
  103. package/BookReader/images/icon_home.png +0 -0
  104. package/BookReader/images/icon_home.svg +1 -0
  105. package/BookReader/images/icon_home_ia.png +0 -0
  106. package/BookReader/images/icon_indicator.png +0 -0
  107. package/BookReader/images/icon_info.svg +1 -0
  108. package/BookReader/images/icon_one_page.svg +1 -0
  109. package/BookReader/images/icon_pause.svg +1 -0
  110. package/BookReader/images/icon_play.svg +1 -0
  111. package/BookReader/images/icon_playback-rate.svg +1 -0
  112. package/BookReader/images/icon_return.png +0 -0
  113. package/BookReader/images/icon_search_button.svg +1 -0
  114. package/BookReader/images/icon_share.svg +1 -0
  115. package/BookReader/images/icon_skip-ahead.svg +1 -0
  116. package/BookReader/images/icon_skip-back.svg +2 -0
  117. package/BookReader/images/icon_speaker.svg +1 -0
  118. package/BookReader/images/icon_speaker_open.svg +1 -0
  119. package/BookReader/images/icon_thumbnails.svg +1 -0
  120. package/BookReader/images/icon_toc.svg +1 -0
  121. package/BookReader/images/icon_two_pages.svg +1 -0
  122. package/BookReader/images/icon_zoomer.png +0 -0
  123. package/BookReader/images/loading.gif +0 -0
  124. package/BookReader/images/logo_icon.png +0 -0
  125. package/BookReader/images/marker_chap-off.png +0 -0
  126. package/BookReader/images/marker_chap-off.svg +1 -0
  127. package/BookReader/images/marker_chap-off_ia.png +0 -0
  128. package/BookReader/images/marker_chap-on.png +0 -0
  129. package/BookReader/images/marker_chap-on.svg +1 -0
  130. package/BookReader/images/marker_srch-on.svg +1 -0
  131. package/BookReader/images/marker_srchchap-off.png +0 -0
  132. package/BookReader/images/marker_srchchap-on.png +0 -0
  133. package/BookReader/images/nav_control-dn.png +0 -0
  134. package/BookReader/images/nav_control-dn_ia.png +0 -0
  135. package/BookReader/images/nav_control-up.png +0 -0
  136. package/BookReader/images/nav_control-up_ia.png +0 -0
  137. package/BookReader/images/nav_control.png +0 -0
  138. package/BookReader/images/one_page_mode_icon.png +0 -0
  139. package/BookReader/images/paper-badge.png +0 -0
  140. package/BookReader/images/print_icon.png +0 -0
  141. package/BookReader/images/progressbar.gif +0 -0
  142. package/BookReader/images/right_edges.png +0 -0
  143. package/BookReader/images/slider.png +0 -0
  144. package/BookReader/images/slider_ia.png +0 -0
  145. package/BookReader/images/thumbnail_mode_icon.png +0 -0
  146. package/BookReader/images/translate.svg +1 -0
  147. package/BookReader/images/transparent.png +0 -0
  148. package/BookReader/images/two_page_mode_icon.png +0 -0
  149. package/BookReader/images/unviewable_page.png +0 -0
  150. package/BookReader/images/zoom_in_icon.png +0 -0
  151. package/BookReader/images/zoom_out_icon.png +0 -0
  152. package/BookReader/jquery-3.js +2 -0
  153. package/BookReader/jquery-3.js.LICENSE.txt +24 -0
  154. package/BookReader/plugins/plugin.archive_analytics.js +2 -0
  155. package/BookReader/plugins/plugin.archive_analytics.js.map +1 -0
  156. package/BookReader/plugins/plugin.autoplay.js +2 -0
  157. package/BookReader/plugins/plugin.autoplay.js.map +1 -0
  158. package/BookReader/plugins/plugin.chapters.js +23 -0
  159. package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
  160. package/BookReader/plugins/plugin.chapters.js.map +1 -0
  161. package/BookReader/plugins/plugin.experiments.js +3 -0
  162. package/BookReader/plugins/plugin.experiments.js.LICENSE.txt +1 -0
  163. package/BookReader/plugins/plugin.experiments.js.map +1 -0
  164. package/BookReader/plugins/plugin.iframe.js +2 -0
  165. package/BookReader/plugins/plugin.iframe.js.map +1 -0
  166. package/BookReader/plugins/plugin.iiif.js +2 -0
  167. package/BookReader/plugins/plugin.iiif.js.map +1 -0
  168. package/BookReader/plugins/plugin.resume.js +2 -0
  169. package/BookReader/plugins/plugin.resume.js.map +1 -0
  170. package/BookReader/plugins/plugin.search.js +3 -0
  171. package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
  172. package/BookReader/plugins/plugin.search.js.map +1 -0
  173. package/BookReader/plugins/plugin.text_selection.js +3 -0
  174. package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
  175. package/BookReader/plugins/plugin.text_selection.js.map +1 -0
  176. package/BookReader/plugins/plugin.translate.js +3 -0
  177. package/BookReader/plugins/plugin.translate.js.LICENSE.txt +1 -0
  178. package/BookReader/plugins/plugin.translate.js.map +1 -0
  179. package/BookReader/plugins/plugin.tts.js +3 -0
  180. package/BookReader/plugins/plugin.tts.js.LICENSE.txt +29 -0
  181. package/BookReader/plugins/plugin.tts.js.map +1 -0
  182. package/BookReader/plugins/plugin.url.js +2 -0
  183. package/BookReader/plugins/plugin.url.js.map +1 -0
  184. package/BookReader/plugins/plugin.vendor-fullscreen.js +2 -0
  185. package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -0
  186. package/BookReader/plugins/translator-worker.js +2 -0
  187. package/BookReader/plugins/translator-worker.js.map +1 -0
  188. package/BookReader/silence.mp3 +0 -0
  189. package/BookReader/translator-worker.js +475 -0
  190. package/BookReader/webcomponents-bundle.js +3 -0
  191. package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
  192. package/BookReader/webcomponents-bundle.js.map +1 -0
  193. package/dist/esm/ia-bookreader.js +3 -0
  194. package/dist/esm/ia-bookreader.js.LICENSE.txt +17 -0
  195. package/dist/esm/ia-bookreader.js.map +1 -0
  196. package/dist/esm/plugins/plugin.archive_analytics.js +2 -0
  197. package/dist/esm/plugins/plugin.archive_analytics.js.map +1 -0
  198. package/dist/esm/plugins/plugin.autoplay.js +2 -0
  199. package/dist/esm/plugins/plugin.autoplay.js.map +1 -0
  200. package/dist/esm/plugins/plugin.chapters.js +2 -0
  201. package/dist/esm/plugins/plugin.chapters.js.map +1 -0
  202. package/dist/esm/plugins/plugin.experiments.js +2 -0
  203. package/dist/esm/plugins/plugin.experiments.js.map +1 -0
  204. package/dist/esm/plugins/plugin.iframe.js +2 -0
  205. package/dist/esm/plugins/plugin.iframe.js.map +1 -0
  206. package/dist/esm/plugins/plugin.iiif.js +2 -0
  207. package/dist/esm/plugins/plugin.iiif.js.map +1 -0
  208. package/dist/esm/plugins/plugin.resume.js +2 -0
  209. package/dist/esm/plugins/plugin.resume.js.map +1 -0
  210. package/dist/esm/plugins/plugin.search.js +2 -0
  211. package/dist/esm/plugins/plugin.search.js.map +1 -0
  212. package/dist/esm/plugins/plugin.text_selection.js +2 -0
  213. package/dist/esm/plugins/plugin.text_selection.js.map +1 -0
  214. package/dist/esm/plugins/plugin.translate.js +2 -0
  215. package/dist/esm/plugins/plugin.translate.js.map +1 -0
  216. package/dist/esm/plugins/plugin.tts.js +2 -0
  217. package/dist/esm/plugins/plugin.tts.js.map +1 -0
  218. package/dist/esm/plugins/plugin.url.js +2 -0
  219. package/dist/esm/plugins/plugin.url.js.map +1 -0
  220. package/dist/esm/plugins/plugin.vendor-fullscreen.js +2 -0
  221. package/dist/esm/plugins/plugin.vendor-fullscreen.js.map +1 -0
  222. package/package.json +19 -13
  223. package/src/BookReader/Navbar/Navbar.js +8 -12
  224. package/src/BookReader/options.js +1 -1
  225. package/src/BookReader/utils/SelectionObserver.js +19 -2
  226. package/src/ia-bookreader/ia-bookreader.js +12 -3
  227. package/src/plugins/search/view.js +1 -1
  228. package/src/plugins/translate/plugin.translate.js +3 -2
  229. package/src/plugins/tts/PageChunk.js +92 -10
  230. package/src/plugins/tts/plugin.tts.js +0 -24
  231. package/src/plugins/url/UrlPlugin.js +4 -1
  232. package/src/plugins/url/plugin.url.js +4 -1
@@ -0,0 +1,3 @@
1
+ /*! For license information please see plugin.translate.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[444],{706:function(e,t,n){var r=n(350).PROPER,o=n(9039),i=n(7452);e.exports=function(e){return o(function(){return!!i[e]()||"​…᠎"!=="​…᠎"[e]()||r&&i[e].name!==e})}},2762:function(e,t,n){var r=n(6518),o=n(3802).Bq;r({target:"String",proto:!0,forced:n(706)("trim")},{trim:function(){return o(this)}})},1041:function(e,t,n){function r(e){return r="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},r(e)}function o(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,i(r.key),r)}}function i(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}n.d(t,{S:function(){return a}}),n(2675),n(9463),n(2259),n(5700),n(3792),n(9572),n(2892),n(9085),n(6099),n(7764),n(2953);var a=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.br=t,this.options},(t=[{key:"setup",value:function(e){this.options=Object.assign({},this.options,e)}},{key:"init",value:function(){}},{key:"_configurePageContainer",value:function(e){}},{key:"_configureToolbar",value:function(e){}},{key:"_bindNavigationHandlers",value:function(){}},{key:"extendNavBar",value:function(e){}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()},6735:function(e,t,n){n(2675),n(9463),n(2259),n(8125),n(4782),n(4554),n(4731),n(479),n(9085),n(2811),n(3851),n(875),n(825),n(888),n(8781),n(5700),n(8706),n(2008),n(113),n(3418),n(3792),n(2062),n(9572),n(2010),n(2892),n(6099),n(8459),n(8940),n(3362),n(7495),n(7764),n(5440),n(3500),n(2953);var r=n(6205),o=n(1041),i=n(9696),a=(n(739),n(6034),n(4565));"undefined"!=typeof window&&window.Worker||(globalThis.Worker=class{#e;constructor(e){this.#e=new Promise(async t=>{const{Worker:n}=await(import("node:worker_threads"));t(new n(e))})}addEventListener(e,t){this.#e.then(n=>n.on(e,e=>t({data:e})))}postMessage(e){this.#e.then(t=>t.postMessage(e))}terminate(){this.#e.then(e=>e.terminate())}});class s extends Error{}class l{constructor(e){this.options=e||{},this.registryUrl=this.options.registryUrl||"https://bergamot.s3.amazonaws.com/models/index.json",this.downloadTimeout="downloadTimeout"in this.options?parseInt(this.options.downloadTimeout):6e4,this.registry=this.loadModelRegistery(),this.buffers=new Map,this.pivotLanguage="pivotLanguage"in this.options?e.pivotLanguage:"en",this.models=new Map,this.onerror=this.options.onerror||(e=>console.error("WASM Translation Worker error:",e))}async loadWorker(){const e=this.options.workerUrl?new Worker(this.options.workerUrl):new Worker(new URL(n.p+n.u(474),n.b));let t=0;const r=new Map,o=(n,...o)=>new Promise((i,a)=>{const s=++t;r.set(s,{accept:i,reject:a,callsite:{message:`${n}(${o.map(e=>String(e)).join(", ")})`,stack:(new Error).stack}}),e.postMessage({id:s,name:n,args:o})});return e.addEventListener("message",function({data:{id:e,result:t,error:n}}){if(!r.has(e))throw console.debug("Received message with unknown id:",arguments[0]),new Error(`BergamotTranslator received response from worker to unknown call '${e}'`);const{accept:o,reject:i,callsite:a}=r.get(e);r.delete(e),void 0!==n?i(Object.assign(new Error,n,{message:n.message+` (response to ${a.message})`,stack:n.stack?`${n.stack}\n${a.stack}`:a.stack})):o(t)}),e.addEventListener("error",this.onerror.bind(this)),await o("initialize",this.options),{worker:e,exports:new Proxy({},{get(e,t,n){if("then"!==t)return(...e)=>o(t,...e)}})}}async loadModelRegistery(){const e=await fetch(this.registryUrl,{credentials:"omit"}),t=await e.json();return Array.from(Object.entries(t),([e,t])=>{const n=e.match(/^([a-z]{2}(-[a-z]+)?)([a-z]{2}(-[a-z]+)?)/i);return{from:n[1],to:n[3],files:t}})}getTranslationModel({from:e,to:t},n){const r=JSON.stringify({from:e,to:t});if(!this.buffers.has(r)){const o=this.loadTranslationModel({from:e,to:t},n);this.buffers.set(r,o),o.catch(e=>this.buffers.delete(r))}return this.buffers.get(r)}async loadTranslationModel({from:e,to:t},n){performance.mark(`loadTranslationModule.${JSON.stringify({from:e,to:t})}`);const r=(await this.registry).filter(n=>n.from==e&&n.to==t);if(!r)throw new Error(`No model for '${e}' -> '${t}'`);const o=r[0].files,i=()=>reject(new s("abort signal")),a=new Promise((e,t)=>{n?.signal&&n.signal.addEventListener("abort",i)}),l=Object.fromEntries(await Promise.race([Promise.all(Object.entries(o).map(async([r,o])=>{if(void 0===o||void 0===o.name)return[r,null];try{return[r,await this.fetch(o.name,o.expectedSha256Hash,n)]}catch(n){throw new Error(`Could not fetch ${o.name} for ${e}->${t} model`,{cause:n})}})),a]));n?.signal&&n.signal.removeEventListener("abort",i),performance.measure("loadTranslationModel",`loadTranslationModule.${JSON.stringify({from:e,to:t})}`);let c=[];if(l.vocab)c=[l.vocab];else{if(!l.trgvocab||!l.srcvocab)throw new Error(`Could not identify vocab files for ${e}->${t} model among: ${Array.from(Object.keys(o)).join(" ")}`);c=[l.srcvocab,l.trgvocab]}let u={};return o.model.name.endsWith("intgemm8.bin")&&(u["gemm-precision"]="int8shiftAll"),o.qualityModel&&(u["skip-cost"]=!1),o.config&&Object.assign(u,o.config),{model:l.model,shortlist:l.lex,vocabs:c,qualityModel:l.qualityModel,config:u}}async fetch(e,t,n){const r=new AbortController,o=()=>r.abort(),i=this.downloadTimeout?setTimeout(o,this.downloadTimeout):null;try{n?.signal&&n.signal.addEventListener("abort",o);const i={credentials:"omit",signal:r.signal};t&&(i.integrity=`sha256-${this.hexToBase64(t)}`),"undefined"==typeof window&&delete i.integrity;const a=await fetch(e,i);return await a.arrayBuffer()}finally{i&&clearTimeout(i),n?.signal&&n.signal.removeEventListener("abort",o)}}hexToBase64(e){return btoa(e.match(/\w{2}/g).map(function(e){return String.fromCharCode(parseInt(e,16))}).join(""))}getModels({from:e,to:t}){const n=JSON.stringify({from:e,to:t});return this.models.has(n)||this.models.set(n,this.findModels(e,t)),this.models.get(n)}async findModels(e,t){const n=await this.registry;let r=[],o=[],i=[];if(n.forEach(n=>{n.from===e&&n.to===t?r.push(n):n.from===e&&n.to===this.pivotLanguage?o.push(n):n.to===t&&n.from===this.pivotLanguage&&i.push(n)}),r.length)return[r[0]];if(o.length&&i.length)return[o[0],i[0]];throw new Error(`No model available to translate from '${e}' to '${t}'`)}}class c{constructor(e,t){t||(t=new l(e)),this.backing=t,this.workers=[],this.workerLimit=Math.max(e?.workers||0,1),this.queue=[],this.batchSerial=0,this.batchSize=Math.max(e?.batchSize||8,1),this.onerror=e?.onerror||(e=>console.error("WASM Translation Worker error:",e))}async delete(){this.remove(()=>!0),this.workers.forEach(({worker:e})=>e.terminate())}notify(){setTimeout(async()=>{if(!this.queue.length)return;let e=this.workers.find(e=>e.idle);if(!e&&this.workers.length<this.workerLimit)try{const t={idle:!1};this.workers.push(t),Object.assign(t,await this.backing.loadWorker()),e=t}catch(e){this.onerror(new Error(`Could not initialise translation worker: ${e.message}`))}if(!e)return;const t=this.queue.shift();e.idle=!1;try{await this.consumeBatch(t,e.exports)}catch(e){t.requests.forEach(({reject:t})=>t(e))}e.idle=!0,this.queue.length&&this.notify()})}translate(e){const{from:t,to:n,priority:r}=e;return new Promise(async(o,i)=>{try{const a=JSON.stringify({from:t,to:n}),s=await this.backing.getModels(e);this.enqueue({key:a,models:s,request:e,resolve:o,reject:i,priority:r}),this.notify()}catch(e){i(e)}})}remove(e){const t=this.queue;this.queue=[],t.forEach(t=>{t.requests.forEach(({request:n,resolve:r,reject:o})=>{e(n)?o(Object.assign(new s("removed by filter"),{request:n})):this.enqueue({key:t.key,priority:t.priority,models:t.models,request:n,resolve:r,reject:o})})})}enqueue({key:e,models:t,request:n,resolve:r,reject:o,priority:i}){void 0===i&&(i=0);let a=this.queue.find(t=>t.key===e&&t.priority===i&&t.requests.length<this.batchSize);a||(a={id:++this.batchSerial,key:e,priority:i,models:t,requests:[]},this.queue.push(a),this.queue.sort((e,t)=>e.priority-t.priority)),a.requests.push({request:n,resolve:r,reject:o})}async consumeBatch(e,t){performance.mark("BergamotBatchTranslator.start"),await Promise.all(e.models.map(async({from:e,to:n})=>{if(!await t.hasTranslationModel({from:e,to:n})){const r=await this.backing.getTranslationModel({from:e,to:n});await t.loadTranslationModel({from:e,to:n},r)}}));const n=await t.translate({models:e.models.map(({from:e,to:t})=>({from:e,to:t})),texts:e.requests.map(({request:{text:e,html:t,qualityScores:n}})=>({text:e.toString(),html:!!t,qualityScores:!!n}))});e.requests.forEach(({request:e,resolve:t,reject:r},o)=>{t({request:e,...n[o]})}),performance.measure("BergamotBatchTranslator","BergamotBatchTranslator.start")}}var u=n(4160);function d(e){return d="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},d(e)}function f(){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 h(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,s=0,l=e,f.n=n,a}};function h(n,r){for(s=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],h=f.p,p=i[2];n>3?(o=p===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(s=0,f.v=r,f.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,f.n=p,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.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=f.n<0)?l:n.call(r,f))!==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]())):(h(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,h(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,h(d,"constructor",c),h(c,"constructor",l),l.displayName="GeneratorFunction",h(c,o,"GeneratorFunction"),h(d),h(d,o,"Generator"),h(d,r,function(){return this}),h(d,"toString",function(){return"[object Generator]"}),(f=function(){return{w:i,m:p}})()}function h(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}h=function(e,t,n,r){function i(t,n){h(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))},h(e,t,n,r)}function p(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 g(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){p(i,r,o,a,s,"next",e)}function s(e){p(i,r,o,a,s,"throw",e)}a(void 0)})}}function m(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,y(r.key),r)}}function v(e,t,n){return(t=y(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(e){var t=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}var b,w,k,S,T,E,x,C,L,O=function(){return e=function e(){var t=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),v(this,"alreadyTranslated",new a.l(100)),v(this,"modelRegistry",{}),v(this,"currentlyTranslating",{}),v(this,"fromLanguages",[]),v(this,"toLanguages",[]),v(this,"active",!1),v(this,"publicPath",""),v(this,"getTranslation",function(){var e=g(f().m(function e(n,r,o,i,a,s){var l,c,u,d,h;return f().w(function(e){for(;;)switch(e.n){case 0:if(t.active=!0,n!=r&&n&&r){e.n=1;break}return e.a(2);case 1:if(l="".concat(n).concat(r,"-").concat(o,":").concat(i),!(c=t.alreadyTranslated.entries.find(function(e){return e.index==l}))){e.n=2;break}return e.a(2,c.response);case 2:if(!(l in t.currentlyTranslating)){e.n=3;break}return e.a(2,t.currentlyTranslating[l].promise);case 3:if(u=null,d=null,h=new Promise(function(e,t){u=e,d=t}),t.currentlyTranslating[l]={promise:h,resolve:u,reject:d},a){e.n=4;break}return t.currentlyTranslating[l].reject("No text was provided"),e.a(2,h);case 4:return t.translator.translate({to:r,from:n,text:a,html:!1,priority:s}).then(function(e){var n=e;t.currentlyTranslating[l].resolve(n.target.text),t.alreadyTranslated.add({index:l,response:n.target.text}),delete t.currentlyTranslating[l]}),e.a(2,h)}},e)}));return function(t,n,r,o,i,a){return e.apply(this,arguments)}}()),v(this,"getTranslationModel",function(){var e=g(f().m(function e(n,r){return f().w(function(e){for(;;)if(0===e.n)return e.a(2,t.translator.backing.getTranslationModel({from:n,to:r}).catch(function(e){console.error("An error occurred while trying to retreive the ".concat(n,"-").concat(r," model"))}))},e)}));return function(t,n){return e.apply(this,arguments)}}());var n={code:"en",name:"English (en)",type:"prod"};this.fromLanguages.push(n),this.toLanguages.push(n)},t=[{key:"initWorker",value:(n=g(f().m(function e(){var t,n,r,o,i,a,s,l,d,h,p,g,m,v,y,b,w,k,S=this;return f().w(function(e){for(;;)switch(e.n){case 0:if(!this.initPromise){e.n=1;break}return e.a(2,this.initPromise);case 1:return this.initPromise=new Promise(function(e,t){S._initResolve=e,S._initReject=t}),t="https://cors.archive.org/cors/mozilla-translate-models/firefox_models/",e.n=2,fetch(t+"registry.json").then(function(e){return e.json()});case 2:for(n=e.v,r=0,o=Object.values(n);r<o.length;r++)for(i=o[r],a=0,s=Object.values(i);a<s.length;a++)(l=s[a]).name=t+l.name;return this.translator=new c({registryUrl:"data:application/json,".concat(encodeURIComponent(JSON.stringify(n))),workers:2,batchSize:4,workerUrl:this.publicPath+"/translator-worker.js"}),e.n=3,this.translator.backing.registry;case 3:for(d=e.v,h={},p=0,g=Object.values(d);p<g.length;p++)m=g[p],v=m.from,y=m.to,b=m.files,h["".concat(v).concat(y)]=b,"en"!==v&&(w="".concat((0,u._4)(v)," (").concat((0,u.YH)(v),")"),this.fromLanguages.push({code:v,name:w,type:"prod"})),"en"!==y&&(k="".concat((0,u._4)(y)," (").concat((0,u.YH)(y),")"),this.toLanguages.push({code:y,name:k,type:"prod"}));return this._initResolve([this.modelRegistry]),e.a(2,this.initPromise)}},e,this)})),function(){return n.apply(this,arguments)})}],t&&m(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),j=n(8004),P=n(7279),A=(n(8248),n(1669));function _(e){return _="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},_(e)}function R(e){return function(e){if(Array.isArray(e))return $(e)}(e)||B(e)||G(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 M(){M=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach(function(n){t.forEach(function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)},this)},this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach(function(r){t.forEach(function(t){var o=t.placement;if(t.kind===r&&("static"===o||"prototype"===o)){var i="static"===o?e:n;this.defineClassElement(i,t)}},this)},this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],o={static:[],prototype:[],own:[]};if(e.forEach(function(e){this.addElementPlacement(e,o)},this),e.forEach(function(e){if(!q(e))return n.push(e);var t=this.decorateElement(e,o);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)},this),!t)return{elements:n,finishers:r};var i=this.decorateConstructor(n,t);return r.push.apply(r,i.finishers),i.finishers=r,i},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],o=e.decorators,i=o.length-1;i>=0;i--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,o[i])(s)||s);e=l.element,this.addElementPlacement(e,t),l.finisher&&r.push(l.finisher);var c=l.extras;if(c){for(var u=0;u<c.length;u++)this.addElementPlacement(c[u],t);n.push.apply(n,c)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[r])(o)||o);if(void 0!==i.finisher&&n.push(i.finisher),void 0!==i.elements){e=i.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||B(t)||G(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.")}()).map(function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t},this);var t},toElementDescriptor:function(e){var t=e.kind+"";if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=ie(e.key),r=e.placement+"";if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:n,placement:r,descriptor:Object.assign({},o)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:F(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=e.kind+"";if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=F(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function I(e){var t,n=ie(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function N(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function q(e){return e.decorators&&e.decorators.length}function z(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function F(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function B(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function D(){return D="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=te(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}},D.apply(null,arguments)}function H(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function U(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=G(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function G(e,t){if(e){if("string"==typeof e)return $(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,t):void 0}}function $(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 W(){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 K(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,s=0,l=e,f.n=n,a}};function h(n,r){for(s=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],h=f.p,p=i[2];n>3?(o=p===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(s=0,f.v=r,f.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,f.n=p,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.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=f.n<0)?l:n.call(r,f))!==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]())):(K(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,K(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,K(d,"constructor",c),K(c,"constructor",l),l.displayName="GeneratorFunction",K(c,o,"GeneratorFunction"),K(d),K(d,o,"Generator"),K(d,r,function(){return this}),K(d,"toString",function(){return"[object Generator]"}),(W=function(){return{w:i,m:f}})()}function K(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}K=function(e,t,n,r){function i(t,n){K(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))},K(e,t,n,r)}function Z(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 J(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){Z(i,r,o,a,s,"next",e)}function s(e){Z(i,r,o,a,s,"throw",e)}a(void 0)})}}function V(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function X(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,ie(r.key),r)}}function Y(e,t,n){return t&&X(e.prototype,t),n&&X(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Q(e,t,n){return t=te(t),function(e,t){if(t&&("object"==_(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,ee()?Reflect.construct(t,n||[],te(e).constructor):t.apply(e,n))}function ee(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ee=function(){return!!e})()}function te(e){return te=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},te(e)}function ne(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&&re(e,t)}function re(e,t){return re=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},re(e,t)}function oe(e,t,n){return(t=ie(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ie(e){var t=function(e){if("object"!=_(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_(t)?t:t+""}var ae,se,le,ce,ue,de,fe,he=window.BookReader,pe=function(e){function t(){var e;V(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return oe(e=Q(this,t,[].concat(r)),"options",{enabled:!0,panelDisclaimerText:"Translations are in alpha"}),oe(e,"translationManager",new O),oe(e,"worker",void 0),oe(e,"toLanguages",[]),oe(e,"langFromCode",void 0),oe(e,"langToCode",void 0),oe(e,"_panel",void 0),oe(e,"userToggleTranslate",void 0),oe(e,"loadingModel",!0),oe(e,"textSelectionManager",new P.bg(".BRtranslateLayer",e.br,{selectionElement:[".BRlineElement"]},1)),oe(e,"getParagraphsOnPage",function(e){return e?Array.from(e.querySelectorAll(".BRtextLayer > .BRparagraphElement")):[]}),oe(e,"handleFromLangChange",function(){var t=J(W().m(function t(n){var r;return W().w(function(t){for(;;)switch(t.n){case 0:e.clearAllTranslations(),r=n.detail.value,e.langFromCode=r,e._panel.requestUpdate(),e.translationManager.toLanguages.some(function(e){return e.code===r})||e.translationManager.toLanguages.push({code:r,name:e.translationManager.fromLanguages.find(function(e){return e.code==r}).name}),e._panel.toLanguages=e.translationManager.toLanguages,console.log(e.langFromCode,e.langToCode),e._render(),e.langFromCode!==e.langToCode&&e.translateActivePageContainerElements();case 1:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()),oe(e,"handleToLangChange",function(){var t=J(W().m(function t(n){return W().w(function(t){for(;;)switch(t.n){case 0:e.clearAllTranslations(),e.langToCode=n.detail.value,e._render(),e.translateActivePageContainerElements();case 1:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()),oe(e,"handleToggleTranslation",J(W().m(function t(){return W().w(function(t){for(;;)switch(t.n){case 0:if(e.userToggleTranslate||e.isSourceLanguageSupported()){t.n=1;break}return e.userToggleTranslate=!1,e.translationManager.active=!1,e._render(),t.a(2);case 1:e.userToggleTranslate=!e.userToggleTranslate,e.translationManager.active=e.userToggleTranslate,e._render(),e.userToggleTranslate?(e.br.trigger("translationEnabled",{}),e.translateActivePageContainerElements(),e.textSelectionManager.attach()):(e.clearAllTranslations(),e.br.trigger("translationDisabled",{}),e.textSelectionManager.detach());case 2:return t.a(2)}},t)}))),e}return ne(t,e),Y(t,[{key:"init",value:(i=J(W().m(function e(){var t,n,r=this;return W().w(function(e){for(;;)switch(e.n){case 0:if(this.options.enabled){e.n=1;break}return e.a(2);case 1:return t=this.br.options.bookLanguage||"",n=(0,u.YH)(t),this.langFromCode=null!=n?n:"en",this.textSelectionManager.init(),this.translationManager.publicPath=this.br.options.imagesBaseURL.replace(/\/+$/,"")+"/..",this.br.on("textLayerRendered",function(){var e=J(W().m(function e(t,n){var o,i;return W().w(function(e){for(;;)switch(e.n){case 0:if(n.pageIndex,o=n.pageContainer,r.translationManager){e.n=1;break}return e.a(2);case 1:r.translationManager.active&&(i=o.$container[0],r.translateRenderedLayer(i));case 2:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}()),this.br.on("pageVisible",function(e,t){var n=t.pageContainerEl;if(r.translationManager.active){var o,i=U(n.querySelectorAll(".BRtranslateLayer > .BRparagraphElement"));try{for(i.s();!(o=i.n()).done;){var a=o.value;a.textContent&&r.fitVisiblePage(a)}}catch(e){i.e(e)}finally{i.f()}}}),e.n=2,this.translationManager.initWorker();case 2:this.langToCode=this.translationManager.toLanguages[0].code,this._render();case 3:return e.a(2)}},e,this)})),function(){return i.apply(this,arguments)})},{key:"translateActivePageContainerElements",value:function(){var e,t=this.br.getActivePageContainerElements(),n=t.filter(function(e){return e.classList.contains("BRpage-visible")}),r=t.filter(function(e){return!e.classList.contains("BRpage-visible")}),o=U(n);try{for(o.s();!(e=o.n()).done;){var i=e.value;this.translateRenderedLayer(i,0)}}catch(e){o.e(e)}finally{o.f()}var a,s=U(r);try{for(s.s();!(a=s.n()).done;){var l=a.value;this.translateRenderedLayer(l,1e3)}}catch(e){s.e(e)}finally{s.f()}}},{key:"translateRenderedLayer",value:(o=J(W().m(function e(t,n){var r,o,i,a,s,l,c=this;return W().w(function(e){for(;;)switch(e.n){case 0:if(this.br.mode!=this.br.constModeThumb&&this.userToggleTranslate&&this.langFromCode!=this.langToCode){e.n=1;break}return e.a(2);case 1:return o=t.dataset.index,t.querySelector(".BRPageLayer.BRtranslateLayer")?i=t.querySelector(".BRPageLayer.BRtranslateLayer"):((i=document.createElement("div")).classList.add("BRPageLayer","BRtranslateLayer","BRtranslateLayerLoading"),i.setAttribute("lang","".concat(this.langToCode)),t.prepend(i)),a=t.querySelector(".BRtextLayer"),A(i).css({width:a.style.width,height:a.style.height,transform:a.style.transform,"pointer-events":a.style.pointerEvents,"z-index":3}),a.classList.add("showingTranslation"),s=this.getParagraphsOnPage(t),l=s.map(function(){var e=J(W().m(function e(r,a){var l,u,d,f,h,p,g,m,v;return W().w(function(e){for(;;)switch(e.n){case 0:if((l=t.querySelector("[data-translate-index='".concat(o,"-").concat(a,"']")))||((l=document.createElement("p")).setAttribute("data-translate-index","".concat(o,"-").concat(a)),l.className="BRparagraphElement",u=s[a],r.classList.contains("ocr-role-header-footer")&&(l.ariaHidden="true",l.classList.add("ocr-role-header-footer")),d="".concat(parseInt(A(u).css("font-size")),"px"),A(l).css({"margin-left":A(u).css("margin-left"),"margin-top":A(u).css("margin-top"),top:A(u).css("top"),height:A(u).css("height"),width:A(u).css("width"),"font-size":d}),i.append(l)),0===r.textContent.length){e.n=2;break}return p=parseFloat(o)+n+a,c.translationManager.getTranslationModel(c.langFromCode,c.langToCode).then(function(){c._panel.loadingModel=!1,c.loadingModel=!1}),e.n=1,c.translationManager.getTranslation(c.langFromCode,c.langToCode,o,a,r.textContent,p);case 1:g=e.v,null===(f=l.firstElementChild)||void 0===f||f.remove(),m=null===(h=s[a])||void 0===h||null===(h=h.firstChild)||void 0===h?void 0:h.firstChild,(v=document.createElement("span")).className="BRlineElement",v.textContent=g,l.appendChild(v),A(v).css({"text-indent":A(m).css("padding-left")}),t.classList.contains("BRpage-visible")&&c.fitVisiblePage(l);case 2:return e.a(2)}},e)}));return function(t,n){return e.apply(this,arguments)}}()),null===(r=this.textSelectionManager)||void 0===r||r.stopPageFlip(this.br.refs.$brContainer),e.n=2,Promise.all(l);case 2:this.br.trigger("translateLayerRendered",{leafIndex:o,translateLayer:i});case 3:return e.a(2)}},e,this)})),function(e,t){return o.apply(this,arguments)})},{key:"getTranslateLayers",value:(n=J(W().m(function e(t){var n,r,o=this;return W().w(function(e){for(;;)switch(e.n){case 0:if(n=this.br.getActivePageContainerElementsForIndex(t),!(r=A(n).filter("[data-index='".concat(t,"']")).find(".BRtranslateLayer")).length){e.n=1;break}return e.a(2,r.toArray());case 1:return e.a(2,new Promise(function(e,n){var r=function(){var n=J(W().m(function n(i,a){return W().w(function(n){for(;;)switch(n.n){case 0:a.leafIndex==t&&(o.br.off("translateLayerRendered",r),e([a.translateLayer]));case 1:return n.a(2)}},n)}));return function(e,t){return n.apply(this,arguments)}}();o.br.on("translateLayerRendered",r)}))}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"clearAllTranslations",value:function(){var e=this.br.refs.$br[0];e.querySelectorAll(".BRtranslateLayer").forEach(function(e){return e.remove()}),e.querySelectorAll(".showingTranslation").forEach(function(e){return e.classList.remove("showingTranslation")})}},{key:"fitVisiblePage",value:function(e){for(var t=parseInt(A(e).css("font-size"));e.clientHeight<e.scrollHeight&&t>0;)t--,A(e).css({"font-size":"".concat(t,"px")});var n=e.firstElementChild.clientHeight,r=e.scrollHeight;if(n<r){var o=r/(n/t);A(e).css({"line-height":"".concat(o,"px"),overflow:"visible"})}}},{key:"isSourceLanguageSupported",value:function(){var e=this;return this.translationManager.fromLanguages.some(function(t){return t.code==e.langFromCode})}},{key:"_render",value:function(){var e=this;this.br.shell.menuProviders.translate={id:"translate",icon:(0,r.qy)(b||(b=H(["<img src='",'/translate.svg\' width="26"/>'])),this.br.options.imagesBaseURL),label:"Translate",component:(0,r.qy)(w||(w=H(['<br-translate-panel\n @connected="','"\n @langFromChanged="','"\n @langToChanged="','"\n @toggleTranslation="','"\n .fromLanguages="','"\n .toLanguages="','"\n .disclaimerMessage="','"\n .userTranslationActive=',"\n .detectedFromLang=","\n .detectedToLang=","\n .loadingModel=","\n .sourceLanguageSupported=",'\n class="translate-panel"\n />'])),function(t){e._panel=t.target,e._panel.fromLanguages=e.translationManager.fromLanguages,e._panel.toLanguages=e.translationManager.toLanguages,e._panel.userTranslationActive=e.userToggleTranslate,e._panel.detectedToLang=e.langToCode,e._panel.detectedFromLang=e.langFromCode,e._panel.loadingModel=e.loadingModel,e._panel.sourceLanguageSupported=e.isSourceLanguageSupported()},this.handleFromLangChange,this.handleToLangChange,this.handleToggleTranslation,this.translationManager.fromLanguages,this.translationManager.toLanguages,this.options.panelDisclaimerText,this.userToggleTranslate,this.langFromCode,this.langToCode,this.loadingModel,this.isSourceLanguageSupported())},this.br.shell.updateMenuContents()}}]);var n,o,i}(o.S);null==he||he.registerPlugin("translate",pe),ae=[(0,i.EM)("br-translate-panel")],se=r.WF,ue=M(),le=function(e){ue.initializeInstanceElements(e,fe.elements)},ce=function(e){function t(){var e;V(this,t);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e=Q(this,t,[].concat(r)),le(e),e}return ne(t,e),Y(t)}(se),de={F:ce,d:[{kind:"field",decorators:[(0,i.MZ)({type:Array})],key:"fromLanguages",value:function(){return[]}},{kind:"field",decorators:[(0,i.MZ)({type:Array})],key:"toLanguages",value:function(){return[]}},{kind:"field",decorators:[(0,i.MZ)({type:String})],key:"prevSelectedLang",value:function(){return""}},{kind:"field",decorators:[(0,i.MZ)({type:String})],key:"disclaimerMessage",value:function(){return""}},{kind:"field",decorators:[(0,i.MZ)({type:Boolean})],key:"userTranslationActive",value:function(){return!1}},{kind:"field",decorators:[(0,i.MZ)({type:String})],key:"detectedFromLang",value:function(){return""}},{kind:"field",decorators:[(0,i.MZ)({type:String})],key:"detectedToLang",value:function(){return""}},{kind:"field",decorators:[(0,i.MZ)({type:Boolean})],key:"loadingModel",value:void 0},{kind:"field",decorators:[(0,i.MZ)({type:Boolean})],key:"sourceLanguageSupported",value:function(){return!0}},{kind:"field",decorators:[(0,i.P)("#lang-from")],key:"langFromDropdown",value:void 0},{kind:"field",decorators:[(0,i.P)("#lang-to")],key:"langToDropdown",value:void 0},{kind:"field",static:!0,key:"styles",value:function(){return(0,r.AH)(k||(k=H(["\n .disclaimer {\n padding: 10px;\n border-radius: 8px;\n font-size: 12px;\n margin: 0 0 10px;\n background-color: rgba(255, 255, 255, 0.1);\n color: rgba(255, 255, 255, 0.9);\n }\n\n .disclaimer--warning {\n margin: 10px 0;\n background-color: rgba(255, 186, 8, 0.18);\n color: #ffe7a3;\n }\n "])))}},{kind:"method",key:"connectedCallback",value:function(){var e,t,n,r,o;(e=ce,t="connectedCallback",n=this,o=D(te(1&(r=3)?e.prototype:e),t,n),2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o)([]),this.dispatchEvent(new CustomEvent("connected"))}},{kind:"method",key:"render",value:function(){var e=this,t=this._statusWarning();return(0,r.qy)(S||(S=H(['<div class="app" style="margin-top: 5%;padding-right: 5px;">\n <div\n class="disclaimer"\n id="disclaimerMessage"\n >','</div>\n\n <div class="panel panel--to" style="padding: 0 10px;">\n <label>\n <span style="font-size: 12px;color: #ccc;">Translate To</span>\n <select id="lang-to" name="to" class="lang-select" style="display:block; width:100%;" @change="','">\n ','\n </select>\n </label>\n </div>\n\n <div class="panel panel--start" style="text-align: right;padding: 0 10px;/*! font-size: 18px; */margin-top: 10px;">\n <button class="start-translation-brn" @click="','" ?disabled=',">\n ",'\n </button>\n </div>\n\n <div class="panel panel--from" style="font-size: 12px;color: #ccc;text-align: center;padding: 8px 10px;">\n <details style="display: contents">\n <summary style="text-decoration: underline white; cursor:pointer; display:inline-block"> \n <i>\n Source: '," ",' \n </i> Change \n </summary>\n <select id="lang-from" name="from" class="lang-select" value=',' @change="','" style="width:65%; margin-top: 3%; margin-bottom: 3%">\n ','\n </select>\n </details>\n </div>\n <div class="footer" id="status" style="margin-top:5%">\n ','\n </div>\n\n <div class="lang-models-loading"> \n ',"\n </div>\n </div>"])),this.disclaimerMessage,this._onLangToChange,(0,j.Ul)(this.toLanguages,function(e){return e.name.toLowerCase()}).map(function(t){return(0,r.qy)(T||(T=H(['<option value="','" \n ?selected=',"\n > "," </option>"])),t.code,t.code==e.detectedToLang,t.name?t.name:t.code)}),this._toggleTranslation,!this.sourceLanguageSupported,this.userTranslationActive?"Stop Translating":"Translate",this._getLangName(this.detectedFromLang),this.prevSelectedLang?"":"(detected)",this.detectedFromLang,this._onLangFromChange,(0,j.Ul)(this.fromLanguages,function(e){return e.name.toLowerCase()}).map(function(t){return(0,r.qy)(E||(E=H(['<option value="','"\n ?selected=',"\n >"," </option>"])),t.code,t.code==e.detectedFromLang,t.name?t.name:t.code)}),t?(0,r.qy)(x||(x=H(['\n <div class="disclaimer disclaimer--warning">',"</div>\n "])),t):"",this._languageModelStatus())}},{kind:"method",key:"_onLangFromChange",value:function(e){var t=new CustomEvent("langFromChanged",{detail:{value:e.target.value},bubbles:!0,composed:!0});this.dispatchEvent(t),this._getSelectedLang("to")!==this._getSelectedLang("from")&&(this.prevSelectedLang=this._getSelectedLang("from")),this.loadingModel=!0,this.detectedFromLang=e.target.value}},{kind:"method",key:"_onLangToChange",value:function(e){var t=new CustomEvent("langToChanged",{detail:{value:e.target.value},bubbles:!0,composed:!0});this.dispatchEvent(t),this._getSelectedLang("from")!==e.target.value&&(this.prevSelectedLang=this._getSelectedLang("from")),this.loadingModel=!0,this.detectedToLang=e.target.value}},{kind:"method",key:"_getSelectedLang",value:function(e){var t="from"===e?this.langFromDropdown:this.langToDropdown;return t?t.value:""}},{kind:"method",key:"_getLangName",value:function(e){var t=[].concat(R(this.fromLanguages),R(this.toLanguages)).find(function(t){return t.code===e});return(null==t?void 0:t.name)||(0,u._4)(e)||e}},{kind:"method",key:"_toggleTranslation",value:function(e){if(this.sourceLanguageSupported){var t=new CustomEvent("toggleTranslation",{detail:{value:e.target.value},bubbles:!0,composed:!0});this.userTranslationActive=!this.userTranslationActive,this.dispatchEvent(t)}}},{kind:"method",key:"_statusWarning",value:function(){return this.sourceLanguageSupported?this.detectedFromLang==this.detectedToLang?"Translate To language is the same as the Source language":"":"Translating from ".concat(this._getLangName(this.detectedFromLang)," is not supported")}},{kind:"method",key:"_languageModelStatus",value:function(){return this.userTranslationActive?this.loadingModel?(0,r.qy)(C||(C=H(['\n <ia-activity-indicator mode="processing" style="display:block; width: 40px; height: 40px; margin: 0 auto;"></ia-activity-indicator>\n <p>Downloading language model</p>\n ']))):(0,r.qy)(L||(L=H(["<p>Language model loaded</p>"]))):""}}]},fe=ue.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if(z(i.descriptor)||z(o.descriptor)){if(q(i)||q(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(q(i)){if(q(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}N(i,o)}else t.push(i)}return t}(de.d.map(I)),ae),ue.initializeClassElements(de.F,fe.elements),ue.runClassFinishers(de.F,fe.finishers)},4160:function(e,t,n){n.d(t,{$x:function(){return g},ND:function(){return p},YH:function(){return d},_4:function(){return f}}),n(2675),n(9463),n(2259),n(3418),n(4423),n(3792),n(4782),n(2010),n(875),n(6099),n(3362),n(7495),n(8781),n(1699),n(7764),n(2953);var r=[],o={},i={},a={};[["Serbian","српски језик","sr","srp","srp"],["Romanian, Moldavian, Moldovan","Română","ro","ron","rum"],["Sichuan Yi, Nuosu","ꆈꌠ꒿ Nuosuhxop","ii","iii","iii"],["Tahitian","Reo Tahiti","ty","tah","tah"],["Tagalog","Wikang Tagalog","tl","tgl","tgl"],["Yiddish","ייִדיש","yi","yid","yid"],["Akan","Akan","ak","aka","aka"],["Malay","Bahasa Melayu, بهاس ملايو","ms","msa","may"],["Arabic","العربية","ar","ara","ara"],["Norwegian","Norsk","no","nor","nor"],["Ojibwa","ᐊᓂᔑᓈᐯᒧᐎᓐ","oj","oji","oji"],["Fulah","Fulfulde, Pulaar, Pular","ff","ful","ful"],["Persian","فارسی","fa","fas","per"],["Albanian","Shqip","sq","sqi","alb"],["Aymara","aymar aru","ay","aym","aym"],["Azerbaijani","azərbaycan dili","az","aze","aze"],["Chinese","中文 (Zhōngwén), 汉语, 漢語","zh","zho","chi"],["Cree","ᓀᐦᐃᔭᐍᐏᐣ","cr","cre","cre"],["Estonian","eesti, eesti keel","et","est","est"],["Guaraní","Avañe'ẽ","gn","grn","grn"],["Inupiaq","Iñupiaq, Iñupiatun","ik","ipk","ipk"],["Inuktitut","ᐃᓄᒃᑎᑐᑦ","iu","iku","iku"],["Kanuri","Kanuri","kr","kau","kau"],["Komi","коми кыв","kv","kom","kom"],["Kongo","Kikongo","kg","kon","kon"],["Kurdish","Kurdî, أۇزبېك","ku","kur","kur"],["Latvian","latviešu valoda","lv","lav","lav"],["Malagasy","fiteny malagasy","mg","mlg","mlg"],["Mongolian","Монгол хэл","mn","mon","mon"],["Oromo","Afaan Oromoo","om","orm","orm"],["Pashto, Pushto","پښتو","ps","pus","pus"],["Quechua","Runa Simi, Kichwa","qu","que","que"],["Sardinian","sardu","sc","srd","srd"],["Swahili","Kiswahili","sw","swa","swa"],["Uzbek","Oʻzbek, Ўзбек, ","uz","uzb","uzb"],["Zhuang, Chuang","Saɯ cueŋƅ, Saw cuengh","za","zha","zha"],["Bislama","Bislama","bi","bis","bis"],["Norwegian Bokmål","Norsk Bokmål","nb","nob","nob"],["Norwegian Nynorsk","Norsk Nynorsk","nn","nno","nno"],["Indonesian","Bahasa Indonesia","id","ind","ind"],["Twi","Twi","tw","twi","twi"],["Esperanto","Esperanto","eo","epo","epo"],["Interlingua","Interlingua","ia","ina","ina"],["Interlingue","Originally called Occidental; then Interlingue after WWII","ie","ile","ile"],["Ido","Ido","io","ido","ido"],["Volapük","Volapük","vo","vol","vol"],["Bihari languages","भोजपुरी","bh","bih","bih"],["Hebrew (modern)","עברית","he","heb","heb"],["Sanskrit","संस्कृतम्","sa","san","san"],["Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian","ѩзыкъ словѣньскъ","cu","chu","chu"],["Pali","पाऴि","pi","pli","pli"],["Avestan","avesta","ae","ave","ave"],["Latin","latine, lingua latina","la","lat","lat"],["Armenian","Հայերեն","hy","hye","arm"],["Swati","SiSwati","ss","ssw","ssw"],["Tibetan","བོད་ཡིག","bo","bod","tib"],["South Ndebele","isiNdebele","nr","nbl","nbl"],["Slovene","Slovenski Jezik, Slovenščina","sl","slv","slv"],["Oriya","ଓଡ଼ିଆ","or","ori","ori"],["North Ndebele","isiNdebele","nd","nde","nde"],["Nauru","Dorerin Naoero","na","nau","nau"],["Maori","te reo Māori","mi","mri","mao"],["Marathi","मराठी","mr","mar","mar"],["Luba-Katanga","Kiluba","lu","lub","lub"],["Rundi","Ikirundi","rn","run","run"],["Central Khmer","ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ","km","khm","khm"],["Western Frisian","Frysk","fy","fry","fry"],["Bengali","বাংলা","bn","ben","ben"],["Avaric","авар мацӀ, магӀарул мацӀ","av","ava","ava"],["Abkhazian","аҧсуа бызшәа, аҧсшәа","ab","abk","abk"],["Afar","Afaraf","aa","aar","aar"],["Afrikaans","Afrikaans","af","afr","afr"],["Amharic","አማርኛ","am","amh","amh"],["Aragonese","aragonés","an","arg","arg"],["Assamese","অসমীয়া","as","asm","asm"],["Bambara","bamanankan","bm","bam","bam"],["Bashkir","башҡорт теле","ba","bak","bak"],["Basque","euskara, euskera","eu","eus","baq"],["Belarusian","беларуская мова","be","bel","bel"],["Bosnian","bosanski jezik","bs","bos","bos"],["Breton","brezhoneg","br","bre","bre"],["Bulgarian","български език","bg","bul","bul"],["Burmese","ဗမာစာ","my","mya","bur"],["Catalan, Valencian","català, valencià","ca","cat","cat"],["Chamorro","Chamoru","ch","cha","cha"],["Chechen","нохчийн мотт","ce","che","che"],["Chichewa, Chewa, Nyanja","chiCheŵa, chinyanja","ny","nya","nya"],["Chuvash","чӑваш чӗлхи","cv","chv","chv"],["Cornish","Kernewek","kw","cor","cor"],["Corsican","corsu, lingua corsa","co","cos","cos"],["Croatian","hrvatski jezik","hr","hrv","hrv"],["Czech","čeština, český jazyk","cs","ces","cze"],["Danish","dansk","da","dan","dan"],["Divehi, Dhivehi, Maldivian","ދިވެހި","dv","div","div"],["Dutch, Flemish","Nederlands, Vlaams","nl","nld","dut"],["Dzongkha","རྫོང་ཁ","dz","dzo","dzo"],["English","English","en","eng","eng"],["Ewe","Eʋegbe","ee","ewe","ewe"],["Faroese","føroyskt","fo","fao","fao"],["Fijian","vosa Vakaviti","fj","fij","fij"],["Finnish","suomi, suomen kieli","fi","fin","fin"],["French","français, langue française","fr","fra","fre"],["Galician","Galego","gl","glg","glg"],["Georgian","ქართული","ka","kat","geo"],["German","Deutsch","de","deu","ger"],["Greek (modern)","ελληνικά","el","ell","gre"],["Gujarati","ગુજરાતી","gu","guj","guj"],["Haitian, Haitian Creole","Kreyòl ayisyen","ht","hat","hat"],["Hausa","(Hausa) هَوُسَ","ha","hau","hau"],["Herero","Otjiherero","hz","her","her"],["Hindi","हिन्दी, हिंदी","hi","hin","hin"],["Hiri Motu","Hiri Motu","ho","hmo","hmo"],["Hungarian","magyar","hu","hun","hun"],["Irish","Gaeilge","ga","gle","gle"],["Igbo","Asụsụ Igbo","ig","ibo","ibo"],["Icelandic","Íslenska","is","isl","ice"],["Italian","Italiano","it","ita","ita"],["Japanese","日本語 (にほんご)","ja","jpn","jpn"],["Javanese","ꦧꦱꦗꦮ, Basa Jawa","jv","jav","jav"],["Kalaallisut, Greenlandic","kalaallisut, kalaallit oqaasii","kl","kal","kal"],["Kannada","ಕನ್ನಡ","kn","kan","kan"],["Kashmiri","कश्मीरी, كشميري","ks","kas","kas"],["Kazakh","қазақ тілі","kk","kaz","kaz"],["Kikuyu, Gikuyu","Gĩkũyũ","ki","kik","kik"],["Kinyarwanda","Ikinyarwanda","rw","kin","kin"],["Kirghiz, Kyrgyz","Кыргызча, Кыргыз тили","ky","kir","kir"],["Korean","한국어","ko","kor","kor"],["Kuanyama, Kwanyama","Kuanyama","kj","kua","kua"],["Luxembourgish, Letzeburgesch","Lëtzebuergesch","lb","ltz","ltz"],["Ganda","Luganda","lg","lug","lug"],["Limburgan, Limburger, Limburgish","Limburgs","li","lim","lim"],["Lingala","Lingála","ln","lin","lin"],["Lao","ພາສາລາວ","lo","lao","lao"],["Lithuanian","lietuvių kalba","lt","lit","lit"],["Manx","Gaelg, Gailck","gv","glv","glv"],["Macedonian","македонски јазик","mk","mkd","mac"],["Malayalam","മലയാളം","ml","mal","mal"],["Maltese","Malti","mt","mlt","mlt"],["Marshallese","Kajin M̧ajeļ","mh","mah","mah"],["Navajo, Navaho","Diné bizaad","nv","nav","nav"],["Nepali","नेपाली","ne","nep","nep"],["Ndonga","Owambo","ng","ndo","ndo"],["Occitan","occitan, lenga d'òc","oc","oci","oci"],["Ossetian, Ossetic","ирон æвзаг","os","oss","oss"],["Panjabi, Punjabi","ਪੰਜਾਬੀ","pa","pan","pan"],["Polish","język polski, polszczyzna","pl","pol","pol"],["Portuguese","Português","pt","por","por"],["Romansh","Rumantsch Grischun","rm","roh","roh"],["Russian","русский","ru","rus","rus"],["Sindhi","सिन्धी, سنڌي، سندھی","sd","snd","snd"],["Northern Sami","Davvisámegiella","se","sme","sme"],["Samoan","gagana fa'a Samoa","sm","smo","smo"],["Sango","yângâ tî sängö","sg","sag","sag"],["Gaelic, Scottish Gaelic","Gàidhlig","gd","gla","gla"],["Shona","chiShona","sn","sna","sna"],["Sinhala, Sinhalese","සිංහල","si","sin","sin"],["Slovak","Slovenčina, Slovenský Jazyk","sk","slk","slo"],["Somali","Soomaaliga, af Soomaali","so","som","som"],["Southern Sotho","Sesotho","st","sot","sot"],["Spanish, Castilian","Español","es","spa","spa"],["Sundanese","Basa Sunda","su","sun","sun"],["Swedish","Svenska","sv","swe","swe"],["Tamil","தமிழ்","ta","tam","tam"],["Telugu","తెలుగు","te","tel","tel"],["Tajik","тоҷикӣ, toçikī, تاجیکی","tg","tgk","tgk"],["Thai","ไทย","th","tha","tha"],["Tigrinya","ትግርኛ","ti","tir","tir"],["Turkmen","Türkmen, Түркмен","tk","tuk","tuk"],["Tswana","Setswana","tn","tsn","tsn"],["Tongan (Tonga Islands)","Faka Tonga","to","ton","ton"],["Turkish","Türkçe","tr","tur","tur"],["Tsonga","Xitsonga","ts","tso","tso"],["Tatar","татар теле, tatar tele","tt","tat","tat"],["Uighur, Uyghur","ئۇيغۇرچە, Uyghurche","ug","uig","uig"],["Ukrainian","Українська","uk","ukr","ukr"],["Urdu","اردو","ur","urd","urd"],["Venda","Tshivenḓa","ve","ven","ven"],["Vietnamese","Tiếng Việt","vi","vie","vie"],["Walloon","Walon","wa","wln","wln"],["Welsh","Cymraeg","cy","cym","wel"],["Wolof","Wollof","wo","wol","wol"],["Xhosa","isiXhosa","xh","xho","xho"],["Yoruba","Yorùbá","yo","yor","yor"],["Zulu","isiZulu","zu","zul","zul"]].forEach(e=>{var t={name:e[0],nativeName:e[1],iso639_1:e[2],iso639_2T:e[3],iso639_2B:e[4]};o[e[2]]=i[e[3]]=a[e[4]]=t,r.push(t)});var s=r;function l(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=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&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}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}var u={"zh-hans":"中文 (Zhōngwén)"};function d(e){if(!e)return null;if(e=e.toLocaleLowerCase(),u[e])return e;var t=h(e,["iso639_1"])||h(e,["iso639_2T"])||h(e,["iso639_2B","name","nativeName"]);return t?t.iso639_1:null}function f(e){if(!e)return null;if(e=e.toLocaleLowerCase(),u[e])return u[e];var t=h(e,["iso639_1"])||h(e,["iso639_2T"])||h(e,["iso639_2B","name","nativeName"]);return null!=t&&t.nativeName?t.nativeName.split(", ")[0]:null}function h(e,t){if(!e)return null;e=e.toLowerCase();var n,r=l(s);try{for(r.s();!(n=r.n()).done;){var o,i=n.value,a=l(t);try{for(a.s();!(o=a.n()).done;){var c;if(null!==(c=i[o.value])&&void 0!==c&&c.toLowerCase().split(", ").includes(e))return i}}catch(e){a.e(e)}finally{a.f()}}}catch(e){r.e(e)}finally{r.f()}return null}function p(){try{return!!window.localStorage}catch(e){return!1}}var g=-1!=location.toString().indexOf("_debugReadAloud=true")},7279:function(e,t,n){n.d(t,{yc:function(){return Pe},bg:function(){return me},lB:function(){return Le}});var r=function(){return n(6518)},o=function(){return n(655)},i=n.cw(function(e,t){var r=n(3724),o=n(2106),i=n(5213),a=n(7979);r&&!i.correct&&(o(RegExp.prototype,"flags",{configurable:!0,get:a}),i.correct=!0)}),a=n.cw(function(e,t){var i=r(),a=n(9565),s=n(7476),l=n(3994),c=n(2529),u=n(7750),d=n(8014),f=o(),h=n(8551),p=n(34),g=n(2195),m=n(788),v=n(1034),y=n(5966),b=n(6840),w=n(9039),k=n(8227),S=n(2293),T=n(7829),E=n(6682),x=n(1181),C=n(6395),L=k("matchAll"),O="RegExp String",j=O+" Iterator",P=x.set,A=x.getterFor(j),_=RegExp.prototype,R=TypeError,M=s("".indexOf),I=s("".matchAll),N=!!I&&!w(function(){I("a",/./)}),q=l(function(e,t,n,r){P(this,{type:j,regexp:e,string:t,global:n,unicode:r,done:!1})},O,function(){var e=A(this);if(e.done)return c(void 0,!0);var t=e.regexp,n=e.string,r=E(t,n);return null===r?(e.done=!0,c(void 0,!0)):e.global?(""===f(r[0])&&(t.lastIndex=T(n,d(t.lastIndex),e.unicode)),c(r,!1)):(e.done=!0,c(r,!1))}),z=function(e){var t,n,r,o=h(this),i=f(e),a=S(o,RegExp),s=f(v(o));return t=new a(a===RegExp?o.source:o,s),n=!!~M(s,"g"),r=!!~M(s,"u")||!!~M(s,"v"),t.lastIndex=d(o.lastIndex),new q(t,i,n,r)};i({target:"String",proto:!0,forced:N},{matchAll:function(e){var t,n,r,o,i=u(this);if(p(e)){if(m(e)&&(t=f(u(v(e))),!~M(t,"g")))throw new R("`.matchAll` does not allow non-global regexes");if(N)return I(i,e);if(void 0===(r=y(e,L))&&C&&"RegExp"===g(e)&&(r=z),r)return a(r,e,i)}else if(N)return I(i,e);return n=f(i),o=new RegExp(e,"g"),C?a(z,o,n):o[L](n)}}),C||L in _||b(_,L,z)}),s=n.cw(function(e,t){var i=r(),a=n(9504),s=n(5397),l=n(8981),c=o(),u=n(6198),d=a([].push),f=a([].join);i({target:"String",stat:!0},{raw:function(e){var t=s(l(e).raw),n=u(t);if(!n)return"";for(var r=arguments.length,o=[],i=0;;){if(d(o,c(t[i++])),i===n)return f(o,"");i<r&&d(o,c(arguments[i]))}}})}),l=n.cw(function(e,t){a()});n(2675),n(9463),n(2259),n(5700),n(8125),n(8706),n(2008),n(113),n(3418),n(4423),n(3792),n(8598),n(2062),n(4782),n(4554),n(739),n(9572),n(2010),n(4731),n(479),n(2892),n(9085),n(2811),n(3851),n(875),n(9432),n(6099),n(8459),n(3362),n(825),n(888),n(4864),n(7495),i(),n(8781),n(1699),n(7764),n(1761),s(),n(5440),n(2762),l(),n(3500),n(2953),n(8408);var c=n(9073),u=n(1669);function d(e){return d="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},d(e)}function f(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,p(r.key),r)}}function h(e,t,n){return(t=p(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){var t=function(e){if("object"!=d(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=d(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==d(t)?t:t+""}var g,m,v,y,b,w,k,S,T,E,x,C,L,O,j,P,A,_=function(){return e=function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),h(this,"selecting",!1),h(this,"startedInSelector",!1),h(this,"target",null),h(this,"lastKnownFocusNode",null),h(this,"_onSelectionChange",function(){var e=window.getSelection();if(e){var t=function(e){if(!e.isCollapsed)return!1;for(var t=0;t<e.rangeCount;t++)if(!e.getRangeAt(t).collapsed)return!1;return!0}(e);if(!r.selecting&&e.toString()){var n=u(e.anchorNode).closest(r.selector)[0];if(!n)return;r.target=n,r.selecting=!0,r.lastKnownFocusNode=e.focusNode,r.handler("started",r.target)}r.selecting&&r.lastKnownFocusNode!=e.focusNode&&e.toString()&&!t&&(r.lastKnownFocusNode=e.focusNode,r.handler("changed",r.target)),!r.selecting||!t&&e.toString()&&u(e.anchorNode).closest(r.selector)[0]||(r.selecting=!1,r.lastKnownFocusNode=null,r.handler("cleared",r.target))}}),this.selector=t,this.handler=n},(t=[{key:"attach",value:function(){document.addEventListener("selectionchange",this._onSelectionChange)}},{key:"detach",value:function(){document.removeEventListener("selectionchange",this._onSelectionChange)}}])&&f(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),R=n(8004),M=n(6205),I=n(9696),N=n(4535),q=(n(90),n(8918),n(6090),n(7583)),z=n(1989),F=n(1669);function B(e){return B="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},B(e)}function D(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ne(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function H(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 U(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){H(i,r,o,a,s,"next",e)}function s(e){H(i,r,o,a,s,"throw",e)}a(void 0)})}}function G(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function $(e,t,n){return t=ae(t),function(e,t){if(t&&("object"==B(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,W()?Reflect.construct(t,n||[],ae(e).constructor):t.apply(e,n))}function W(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(W=function(){return!!e})()}function K(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&&Z(e,t)}function Z(e,t){return Z=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Z(e,t)}function J(e,t,n,r){var o=V();if(r)for(var i=0;i<r.length;i++)o=r[i](o);var a=t(function(e){o.initializeInstanceElements(e,s.elements)},n),s=o.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if(ee(i.descriptor)||ee(o.descriptor)){if(Q(i)||Q(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(Q(i)){if(Q(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}Y(i,o)}else t.push(i)}return t}(a.d.map(X)),e);return o.initializeClassElements(a.F,s.elements),o.runClassFinishers(a.F,s.finishers)}function V(){V=function(){return e};var e={elementsDefinitionOrder:[["method"],["field"]],initializeInstanceElements:function(e,t){["method","field"].forEach(function(n){t.forEach(function(t){t.kind===n&&"own"===t.placement&&this.defineClassElement(e,t)},this)},this)},initializeClassElements:function(e,t){var n=e.prototype;["method","field"].forEach(function(r){t.forEach(function(t){var o=t.placement;if(t.kind===r&&("static"===o||"prototype"===o)){var i="static"===o?e:n;this.defineClassElement(i,t)}},this)},this)},defineClassElement:function(e,t){var n=t.descriptor;if("field"===t.kind){var r=t.initializer;n={enumerable:n.enumerable,writable:n.writable,configurable:n.configurable,value:void 0===r?void 0:r.call(e)}}Object.defineProperty(e,t.key,n)},decorateClass:function(e,t){var n=[],r=[],o={static:[],prototype:[],own:[]};if(e.forEach(function(e){this.addElementPlacement(e,o)},this),e.forEach(function(e){if(!Q(e))return n.push(e);var t=this.decorateElement(e,o);n.push(t.element),n.push.apply(n,t.extras),r.push.apply(r,t.finishers)},this),!t)return{elements:n,finishers:r};var i=this.decorateConstructor(n,t);return r.push.apply(r,i.finishers),i.finishers=r,i},addElementPlacement:function(e,t,n){var r=t[e.placement];if(!n&&-1!==r.indexOf(e.key))throw new TypeError("Duplicated element ("+e.key+")");r.push(e.key)},decorateElement:function(e,t){for(var n=[],r=[],o=e.decorators,i=o.length-1;i>=0;i--){var a=t[e.placement];a.splice(a.indexOf(e.key),1);var s=this.fromElementDescriptor(e),l=this.toElementFinisherExtras((0,o[i])(s)||s);e=l.element,this.addElementPlacement(e,t),l.finisher&&r.push(l.finisher);var c=l.extras;if(c){for(var u=0;u<c.length;u++)this.addElementPlacement(c[u],t);n.push.apply(n,c)}}return{element:e,finishers:r,extras:n}},decorateConstructor:function(e,t){for(var n=[],r=t.length-1;r>=0;r--){var o=this.fromClassDescriptor(e),i=this.toClassDescriptor((0,t[r])(o)||o);if(void 0!==i.finisher&&n.push(i.finisher),void 0!==i.elements){e=i.elements;for(var a=0;a<e.length-1;a++)for(var s=a+1;s<e.length;s++)if(e[a].key===e[s].key&&e[a].placement===e[s].placement)throw new TypeError("Duplicated element ("+e[a].key+")")}}return{elements:e,finishers:n}},fromElementDescriptor:function(e){var t={kind:e.kind,key:e.key,placement:e.placement,descriptor:e.descriptor};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),"field"===e.kind&&(t.initializer=e.initializer),t},toElementDescriptors:function(e){if(void 0!==e)return(t=e,function(e){if(Array.isArray(e))return e}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||ne(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.")}()).map(function(e){var t=this.toElementDescriptor(e);return this.disallowProperty(e,"finisher","An element descriptor"),this.disallowProperty(e,"extras","An element descriptor"),t},this);var t},toElementDescriptor:function(e){var t=e.kind+"";if("method"!==t&&"field"!==t)throw new TypeError('An element descriptor\'s .kind property must be either "method" or "field", but a decorator created an element descriptor with .kind "'+t+'"');var n=pe(e.key),r=e.placement+"";if("static"!==r&&"prototype"!==r&&"own"!==r)throw new TypeError('An element descriptor\'s .placement property must be one of "static", "prototype" or "own", but a decorator created an element descriptor with .placement "'+r+'"');var o=e.descriptor;this.disallowProperty(e,"elements","An element descriptor");var i={kind:t,key:n,placement:r,descriptor:Object.assign({},o)};return"field"!==t?this.disallowProperty(e,"initializer","A method descriptor"):(this.disallowProperty(o,"get","The property descriptor of a field descriptor"),this.disallowProperty(o,"set","The property descriptor of a field descriptor"),this.disallowProperty(o,"value","The property descriptor of a field descriptor"),i.initializer=e.initializer),i},toElementFinisherExtras:function(e){return{element:this.toElementDescriptor(e),finisher:te(e,"finisher"),extras:this.toElementDescriptors(e.extras)}},fromClassDescriptor:function(e){var t={kind:"class",elements:e.map(this.fromElementDescriptor,this)};return Object.defineProperty(t,Symbol.toStringTag,{value:"Descriptor",configurable:!0}),t},toClassDescriptor:function(e){var t=e.kind+"";if("class"!==t)throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator created a class descriptor with .kind "'+t+'"');this.disallowProperty(e,"key","A class descriptor"),this.disallowProperty(e,"placement","A class descriptor"),this.disallowProperty(e,"descriptor","A class descriptor"),this.disallowProperty(e,"initializer","A class descriptor"),this.disallowProperty(e,"extras","A class descriptor");var n=te(e,"finisher");return{elements:this.toElementDescriptors(e.elements),finisher:n}},runClassFinishers:function(e,t){for(var n=0;n<t.length;n++){var r=(0,t[n])(e);if(void 0!==r){if("function"!=typeof r)throw new TypeError("Finishers must return a constructor.");e=r}}return e},disallowProperty:function(e,t,n){if(void 0!==e[t])throw new TypeError(n+" can't have a ."+t+" property.")}};return e}function X(e){var t,n=pe(e.key);"method"===e.kind?t={value:e.value,writable:!0,configurable:!0,enumerable:!1}:"get"===e.kind?t={get:e.value,configurable:!0,enumerable:!1}:"set"===e.kind?t={set:e.value,configurable:!0,enumerable:!1}:"field"===e.kind&&(t={configurable:!0,writable:!0,enumerable:!0});var r={kind:"field"===e.kind?"field":"method",key:n,placement:e.static?"static":"field"===e.kind?"own":"prototype",descriptor:t};return e.decorators&&(r.decorators=e.decorators),"field"===e.kind&&(r.initializer=e.value),r}function Y(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function Q(e){return e.decorators&&e.decorators.length}function ee(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function te(e,t){var n=e[t];if(void 0!==n&&"function"!=typeof n)throw new TypeError("Expected '"+t+"' to be a function");return n}function ne(e,t){if(e){if("string"==typeof e)return re(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)?re(e,t):void 0}}function re(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 oe(e,t,n,r){var o=ie(ae(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function ie(){return ie="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ae(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}},ie.apply(null,arguments)}function ae(e){return ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ae(e)}function se(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(B(e)+" is not iterable")}function le(){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 ce(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,s=0,l=e,f.n=n,a}};function h(n,r){for(s=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],h=f.p,p=i[2];n>3?(o=p===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(s=0,f.v=r,f.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,f.n=p,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),s=u,l=p;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(f.n=-1),h(s,l)):f.n=l:f.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=f.n<0)?l:n.call(r,f))!==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]())):(ce(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ce(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,ce(d,"constructor",c),ce(c,"constructor",l),l.displayName="GeneratorFunction",ce(c,o,"GeneratorFunction"),ce(d),ce(d,o,"Generator"),ce(d,r,function(){return this}),ce(d,"toString",function(){return"[object Generator]"}),(le=function(){return{w:i,m:f}})()}function ce(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ce=function(e,t,n,r){function i(t,n){ce(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))},ce(e,t,n,r)}function ue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function de(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,pe(r.key),r)}}function fe(e,t,n){return t&&de(e.prototype,t),n&&de(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function he(e,t,n){return(t=pe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pe(e){var t=function(e){if("object"!=B(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=B(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==B(t)?t:t+""}var ge="BRhighlightStorage",me=function(){return fe(function e(t,n,r,o){var i=this,a=r.selectionElement;ue(this,e),he(this,"options",{maxProtectedWords:200}),he(this,"selectMenu",void 0),he(this,"_onSelectionChange",function(e,t){if("started"===e)i.textSelectingMode(t);else if("cleared"===e)i.defaultMode(t);else if("changed"!==e)throw new Error("Unknown type ".concat(e))}),he(this,"_limitSelection",function(){var e=window.getSelection();if(e.rangeCount){var t=e.getRangeAt(0),n=!!t.startContainer.parentElement.closest(".BRcontainer"),r=!!t.endContainer.parentElement.closest(".BRcontainer");if(n||r)if(n&&r){var o=(0,z.eU)((0,z.nC)(ve(t,"element"),function(e){return e.classList.contains(i.selectionElement[0].replace(".",""))}),i.options.maxProtectedWords-1);if(o&&t.endContainer.parentNode!=o){var a=document.createRange();a.setStart(t.startContainer,t.startOffset),a.setEnd(o.firstChild,o.textContent.length),e.removeAllRanges(),e.addRange(a)}}else e.removeAllRanges()}}),this.layer=t,this.br=n,this.selectionElement=a,this.selectionObserver=new _(this.layer,this._onSelectionChange),this.options.maxProtectedWords=o||200,this.selectMenu=new ye(n),this.selectMenu.className="br-select-menu__root"},[{key:"selectMenuEnabled",get:function(){var e,t;return(null===(e=this.br.plugins.experiments)||void 0===e?void 0:e.isEnabled("copyLinkToHighlight"))||(null===(t=this.br.plugins.experiments)||void 0===t?void 0:t.isEnabled("annotateHighlight"))}},{key:"init",value:function(){var e=this;this.attach(),new _(this.layer,function(t){var n,r;"started"==t&&(null===(n=e.br.plugins.archiveAnalytics)||void 0===n||n.sendEvent("BookReader","SelectStart"),e.br.refs.$br.find(".BRpagecontainer--hasSelection").removeClass("BRpagecontainer--hasSelection"),F(window.getSelection().anchorNode).closest(".BRpagecontainer").addClass("BRpagecontainer--hasSelection"),e.mouseIsDown||e.showSelectMenu()),"changed"==t&&!e.mouseIsDown&&null!==(r=window.getSelection())&&void 0!==r&&r.toString()&&e.showSelectMenu(),"cleared"==t&&e.hideSelectMenu()}).attach()}},{key:"attach",value:function(){var e=this;this.selectionObserver.attach(),this.br.protected&&(document.addEventListener("selectionchange",this._limitSelection),F(document.body).on("contextmenu dragstart copy",function(t){var n=document.getSelection();if(null!=n&&n.toString()&&F(e.layer).toArray().some(function(e){return n.containsNode(e,!0)}))return t.preventDefault(),!1}))}},{key:"detach",value:function(){this.selectionObserver.detach(),this.br.protected&&document.removeEventListener("selectionchange",this._limitSelection)}},{key:"interceptCopy",value:function(e){e[0].addEventListener("copy",function(e){var t=document.getSelection();e.clipboardData.setData("text/plain",t.toString()),e.preventDefault()})}},{key:"stopPageFlip",value:function(e){var t=this,n=e.find(this.layer);n.length&&(n.each(function(e,n){return t.defaultMode(n)}),this.br.protected||this.interceptCopy(e))}},{key:"defaultMode",value:function(e){var t=this,n=F(e).closest(".BRpagecontainer");e.style.pointerEvents="none",n.find("img").css("pointer-events","auto"),F(e).off(".textSelectPluginHandler");var r=this.mouseIsDown,o=this.mouseIsDown;r&&(e.style.pointerEvents="auto"),F(e).on("mousedown.textSelectPluginHandler",function(e){t.mouseIsDown=!0,F(e.target).is(t.selectionElement.join(", "))&&e.stopPropagation()}),F(e).on("mouseup.textSelectPluginHandler",function(n){t.mouseIsDown=!1,e.style.pointerEvents="none",o&&(o=!1,n.stopPropagation())})}},{key:"textSelectingMode",value:function(e){var t=this,n=F(e).closest(".BRpagecontainer");e.style.pointerEvents="all",n.find("img").css("pointer-events","none"),F(e).off(".textSelectPluginHandler"),F(e).on("mousedown.textSelectPluginHandler",function(e){1==e.which&&(t.mouseIsDown=!0,e.stopPropagation())}),F(e).on("mouseup.textSelectPluginHandler",function(e){t.mouseIsDown=!1,1==e.which&&(e.stopPropagation(),t.showSelectMenu())})}},{key:"showSelectMenu",value:function(){this.selectMenuEnabled&&(this.selectMenu.copyLinkToHighlightEnabled=this.br.plugins.experiments.isEnabled("copyLinkToHighlight"),this.selectMenu.highlightAnnotationEnabled=this.br.plugins.experiments.isEnabled("annotateHighlight"),this.selectMenu.isConnected||document.body.append(this.selectMenu),this.selectMenu.open?this.selectMenu.repositionToSelection():this.selectMenu.show())}},{key:"hideSelectMenu",value:function(){this.selectMenu.hide()}}])}();function ve(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text+element";return le().m(function n(){var r,o,i,a,s;return le().w(function(n){for(;;)switch(n.n){case 0:return s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.children,r=void 0===n||n,l=t.parents,c=void 0===l||l,u=t.siblings,d=void 0===u||u;return le().m(function t(){var n;return le().w(function(t){for(;;)switch(t.n){case 0:if(e!==o){t.n=2;break}if(i=!0,!a(e)){t.n=1;break}return t.n=1,e;case 1:return t.a(2);case 2:if(!a(e)){t.n=3;break}return t.n=3,e;case 3:if(!r||!e.firstChild){t.n=5;break}return t.d(se(s(e.firstChild,{children:!0,parents:!1,siblings:!0})),4);case 4:if(!i){t.n=5;break}return t.a(2);case 5:if(!d){t.n=9;break}n=e.nextSibling;case 6:if(!n){t.n=9;break}return t.d(se(s(n,{children:!0,parents:!1,siblings:!1})),7);case 7:if(!i){t.n=8;break}return t.a(2);case 8:n=n.nextSibling,t.n=6;break;case 9:if(!c||!e.parentNode){t.n=11;break}return t.d(se(s(e.parentNode,{children:!1,parents:!0,siblings:!0})),10);case 10:if(!i){t.n=11;break}return t.a(2);case 11:return t.a(2)}},t)})()},r=e.startContainer,o=e.endContainer,i=!1,a=function(e){return"text"===t&&e.nodeType===Node.TEXT_NODE||"element"===t&&e.nodeType===Node.ELEMENT_NODE||"text+element"===t},n.d(se(s(r)),1);case 1:return n.a(2)}},n)})()}J([(0,I.EM)("br-menu-option")],function(e,t){var n=function(t){function n(){var t;ue(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return t=$(this,n,[].concat(o)),e(t),t}return K(n,t),fe(n)}(t);return{F:n,d:[{kind:"field",decorators:[(0,I.MZ)({type:String})],key:"icon",value:function(){return""}},{kind:"field",decorators:[(0,I.MZ)({type:String})],key:"label",value:function(){return""}},{kind:"field",key:"temporaryText",value:function(){return null}},{kind:"field",decorators:[(0,I.MZ)({type:Number,attribute:"temporary-text-duration"})],key:"temporaryTextDuration",value:function(){return 1200}},{kind:"field",decorators:[(0,I.MZ)({type:String,attribute:"aria-label"})],key:"ariaLabel",value:function(){return""}},{kind:"field",decorators:[(0,I.MZ)({type:Boolean,attribute:"live-label"})],key:"liveLabel",value:function(){return!1}},{kind:"field",decorators:[(0,I.MZ)({type:Boolean})],key:"temporaryTextVisible",value:function(){return!1}},{kind:"field",key:"temporaryTextTimeoutId",value:function(){return null}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"disconnectedCallback",value:function(){null!=this.temporaryTextTimeoutId&&(window.clearTimeout(this.temporaryTextTimeoutId),this.temporaryTextTimeoutId=null),oe(n,"disconnectedCallback",this,3)([])}},{kind:"method",key:"showTemporaryText",value:function(e){var t=this;null!=e&&e.trim()&&(this.temporaryText=e,this.temporaryTextVisible=!0,null!=this.temporaryTextTimeoutId&&window.clearTimeout(this.temporaryTextTimeoutId),this.temporaryTextTimeoutId=window.setTimeout(function(){t.temporaryTextVisible=!1,t.temporaryText=null,t.temporaryTextTimeoutId=null},this.temporaryTextDuration))}},{kind:"method",key:"renderIcon",value:function(){return"share"===this.icon?(0,M.qy)(g||(g=G(['<ia-icon-share class="br-select-menu__icon" aria-hidden="true"></ia-icon-share>']))):"edit-pencil"===this.icon?(0,M.qy)(m||(m=G(['<ia-icon-edit-pencil class="br-select-menu__icon" aria-hidden="true"></ia-icon-edit-pencil>']))):"ellipses"===this.icon?(0,M.qy)(v||(v=G(['<ia-icon-ellipses class="br-select-menu__icon" aria-hidden="true"></ia-icon-ellipses>']))):""}},{kind:"method",key:"render",value:function(){var e,t,n=null!==(e=this.label)&&void 0!==e?e:"",r=!!this.temporaryText,o=r?this.temporaryText:n,i=r&&this.temporaryTextVisible,a=i?o:n,s=null===(t=this.ariaLabel)||void 0===t?void 0:t.trim(),l=s&&s!==a.trim()?s:void 0,c=n.length>=o.length?n:o;return(0,M.qy)(y||(y=G(['\n <button\n type="button"\n class="br-select-menu__option"\n role="menuitem"\n aria-label=',"\n >\n ","\n ","\n </button>\n "])),(0,N.J)(l),this.renderIcon(),r||n?r?(0,M.qy)(b||(b=G(['\n <span class="br-select-menu__label-wrap" style="display: inline-flex; position: relative; align-items: center;">\n <span\n class="br-select-menu__label"\n style="visibility: hidden;"\n aria-hidden="true"\n >','</span>\n <span\n class="br-select-menu__label"\n style="position: absolute; inset: 0; display: inline-flex; align-items: center;"\n aria-live=',"\n >","</span>\n </span>\n "])),c,this.liveLabel?"polite":"off",i?o:n):(0,M.qy)(w||(w=G(['\n <span class="br-select-menu__label" aria-live=',">","</span>\n "])),this.liveLabel?"polite":"off",n):"")}}]}},M.WF);var ye=J([(0,I.EM)("br-select-menu")],function(e,t){var n,r,o=function(t){function n(t){var r;return ue(this,n),r=$(this,n),e(r),r.br=t,r}return K(n,t),fe(n)}(t);return{F:o,d:[{kind:"field",key:"br",value:void 0},{kind:"field",decorators:[(0,I.MZ)({type:Boolean,reflect:!0})],key:"showExtended",value:function(){return!1}},{kind:"field",decorators:[(0,I.P)("#br-select-copy-link-option")],key:"copyLinkOption",value:void 0},{kind:"field",decorators:[(0,I.MZ)({type:Boolean,reflect:!0})],key:"open",value:function(){return!1}},{kind:"field",decorators:[(0,I.MZ)({type:Boolean})],key:"copyLinkToHighlightEnabled",value:function(){return!0}},{kind:"field",decorators:[(0,I.MZ)({type:Boolean})],key:"highlightAnnotationEnabled",value:function(){return!0}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"field",key:"_scrollTimeoutId",value:function(){return null}},{kind:"field",key:"_onScroll",value:function(){var e=this;return function(){e.classList.add("br-select-menu__root--scrolling"),null!=e._scrollTimeoutId&&clearTimeout(e._scrollTimeoutId),e._scrollTimeoutId=window.setTimeout(function(){e._scrollTimeoutId=null,e.repositionToSelection(),e.classList.remove("br-select-menu__root--scrolling")},150)}}},{kind:"method",key:"connectedCallback",value:function(){oe(o,"connectedCallback",this,3)([]),this.setAttribute("role","menu"),this.setAttribute("aria-label","Text selection actions"),this.setAttribute("aria-orientation","vertical")}},{kind:"method",key:"disconnectedCallback",value:function(){oe(o,"disconnectedCallback",this,3)([]),window.removeEventListener("scroll",this._onScroll,{capture:!0}),null!=this._scrollTimeoutId&&(clearTimeout(this._scrollTimeoutId),this._scrollTimeoutId=null)}},{kind:"method",key:"renderCopyLinkToHighlightOption",value:function(){return(0,M.qy)(k||(k=G(['\n <br-menu-option\n id="br-select-copy-link-option"\n @mousedown=',"\n @click=",'\n icon="share"\n label="Copy Link to Highlight"\n live-label\n ></br-menu-option>\n '])),function(e){return e.preventDefault()},this.handleCopyLinkToHighlight)}},{kind:"method",key:"renderRemoveOption",value:function(){return(0,M.qy)(S||(S=G(["\n <br-menu-option\n @click=",'\n icon="share"\n label="Delete Highlight and Annotation"\n ></br-menu-option>\n '])),this.handleDeleteHighlight)}},{kind:"method",key:"renderAddAnnotationOption",value:function(){return(0,M.qy)(T||(T=G(["\n <br-menu-option\n @click=",'\n icon="edit-pencil"\n label="Annotate"\n ></br-menu-option>\n '])),this.handleAddAnnotation)}},{kind:"method",key:"renderHighlightOption",value:function(){return(0,M.qy)(E||(E=G(["\n <br-menu-option\n @click=",'\n icon="edit-pencil"\n label="Highlight Selection"\n ></br-menu-option>\n '])),this.handleHighlightSave)}},{kind:"method",key:"renderShowMoreOption",value:function(){return(0,M.qy)(x||(x=G(['\n <br-menu-option\n id="br-select-more"\n @mousedown=',"\n @click=",'\n icon="ellipses"\n aria-label="Show more options"\n ></br-menu-option>\n '])),function(e){return e.preventDefault()},this.toggleExtendedMenu)}},{kind:"method",key:"renderLocalStorageOptions",value:function(){return(0,M.qy)(C||(C=G(["\n <br-menu-option\n @click=",'\n icon="share"\n label="Load Highlights"\n ></br-menu-option>\n <br-menu-option\n @click=','\n icon="share"\n label="Remove Stored Highlights"\n ></br-menu-option>'])),this.renderSavedHighlights,function(){window.localStorage.removeItem(ge)})}},{kind:"method",key:"renderDefaultOptions",value:function(){return(0,M.qy)(L||(L=G(["\n ","\n ","\n ","\n "])),this.copyLinkToHighlightEnabled?this.renderCopyLinkToHighlightOption():"",this.highlightAnnotationEnabled&&!this.nodesForRemoval?this.renderHighlightOption():"",this.nodesForRemoval?this.renderRemoveOption():"")}},{kind:"method",key:"renderExtendedOptions",value:function(){return(0,M.qy)(O||(O=G(["\n ","\n ","\n "])),this.renderDefaultOptions(),this.renderLocalStorageOptions())}},{kind:"method",key:"render",value:function(){var e,t=null===(e=this.br.plugins.experiments)||void 0===e?void 0:e.isEnabled("annotateHighlight");return(0,M.qy)(j||(j=G(["\n ","\n ","\n "])),this.showExtended?this.renderExtendedOptions():this.renderDefaultOptions(),!this.showExtended&&t?this.renderShowMoreOption():"")}},{kind:"method",key:"handleCopyLinkToHighlight",value:(r=U(le().m(function e(t){var n,r,o,i,a,s,l,c,u,d,f,h;return le().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),r=window.getSelection(),o=r.getRangeAt(0),i=this.getNodeTextLayer(o.startContainer)){e.n=1;break}return console.warn("No text layer found for selection"),e.a(2);case 1:return a=Pe.fromSelection(r,[i]),(s=new URLSearchParams(this.br.readQueryString())).has("text")&&s.delete("text"),l=s.toString(),l+=(l?"&":"")+"text=".concat(a.toUrlString()),c=window.location,u=a.pageNumber||"n".concat(a.pageIndex),d=c.pathname.replace(/((?:^|[#/])page)\/[^/]+/,"$1/".concat(u)),f=c.hash?c.hash.replace(/((?:^|[#/])page)\/[^/]+/,"$1/".concat(u)):"",h="".concat(c.origin).concat(d,"?").concat(l).concat(f),e.n=2,navigator.clipboard.writeText(h);case 2:null===(n=this.copyLinkOption)||void 0===n||n.showTemporaryText("Copied!");case 3:return e.a(2)}},e,this)})),function(e){return r.apply(this,arguments)})},{kind:"method",key:"toggleExtendedMenu",value:function(e){e.preventDefault(),this.showExtended=!this.showExtended}},{kind:"method",key:"getNodeTextLayer",value:function(e){var t;if(!e)return null;var n=e instanceof Element?e:e.parentElement;return null!==(t=null==n?void 0:n.closest(".BRtextLayer"))&&void 0!==t?t:null}},{kind:"method",key:"handleHighlightSave",value:function(){var e=window.getSelection(),t="backward"===e.direction?e.focusNode.parentElement:e.anchorNode.parentElement,n=this.getNodeTextLayer(t),r=Pe.fromSelection(e,[n.parentElement]);r.uuid="id-".concat(crypto.randomUUID().split("-")[4]);var o=this.loadHighlightsFromLocalStorage();o.push(r),this.saveToLocalStorage(o),this.renderSavedHighlights()}},{kind:"method",key:"handleAddAnnotation",value:function(e){}},{kind:"method",key:"handleDeleteHighlight",value:function(){if(this.nodesForRemoval){var e,t=je(this.nodesForRemoval[0]),n=D(this.nodesForRemoval);try{for(n.s();!(e=n.n()).done;){var r=e.value,o=r.textContent,i=r.parentElement;i.classList.contains("BRwordElement")||i.classList.contains("BRspace")?(r.remove(),i.textContent=o):console.log("This element did not match removal criteria:",i,r)}}catch(e){n.e(e)}finally{n.f()}this.deleteHighlight(t),this.clearNodesForRemoval()}else console.log("there is nothing to remove")}},{kind:"method",key:"deleteHighlight",value:function(e){for(var t=this.loadHighlightsFromLocalStorage(),n=0;n<t.length;n++)if(t[n].uuid===e)return t.splice(n,1),void this.saveToLocalStorage(t)}},{kind:"method",key:"saveToLocalStorage",value:function(e){window.localStorage.setItem(ge,JSON.stringify(e.map(function(e){return e.toJSON()})))}},{kind:"method",key:"loadHighlightsFromLocalStorage",value:function(){return JSON.parse(window.localStorage.getItem(ge)||"[]").map(function(e){return Pe.fromJSON(e)})}},{kind:"method",key:"renderSavedHighlights",value:function(){var e,t=this,n=D(this.loadHighlightsFromLocalStorage());try{for(n.s();!(e=n.n()).done;){var r=e.value,o=this.br.$(".pagediv".concat(r.pageIndex," .BRtextLayer"))[0];o&&(Le(o,r),F(o).off("mouseup.BRHighlightClick").on("mouseup.BRHighlightClick",function(e){e.target.classList.contains("BRhighlight")&&(e.stopPropagation(),t.handleHighlightClick(e.target))}))}}catch(e){n.e(e)}finally{n.f()}}},{kind:"method",key:"handleHighlightClick",value:function(e){var t=this.getNodeTextLayer(e),n=je(e),r=t.querySelectorAll(".".concat(n)),o=r[0],i=r[r.length-1],a=document.createRange();a.setStart(o,0),a.setEnd(i,1);var s=window.getSelection();s.removeAllRanges(),s.addRange(a),this.show()}},{kind:"method",key:"repositionToSelection",value:function(){var e=window.getSelection().getRangeAt(0).getBoundingClientRect(),t=(0,q.un)()||(0,q.m0)(),n=(0,q.m0)()?25:(0,q.un)()?15:10,r=t?60:0,o=(e.top<r?e.bottom+r:e.bottom)+n,i=Math.max(10,o)+window.scrollY,a=this.getBoundingClientRect().width,s=document.documentElement.clientWidth,l=a>e.width?e.left+e.width/2-a/2:e.left,c=(0,R.qE)(l,10,s-a-10)+window.scrollX;this.style.top="".concat(i,"px"),this.style.left="".concat(c,"px")}},{kind:"method",key:"show",value:(n=U(le().m(function e(){var t;return le().w(function(e){for(;;)switch(e.n){case 0:if(null===(t=this.br.plugins.translate)||void 0===t||!t.userToggleTranslate){e.n=1;break}return e.a(2);case 1:return this.style.zIndex="1",this.style.position="absolute",this.open=!0,this.classList.remove("br-select-menu__root--scrolling"),window.removeEventListener("scroll",this._onScroll,{capture:!0}),window.addEventListener("scroll",this._onScroll,{capture:!0,passive:!0}),e.n=2,this.updateComplete;case 2:this.repositionToSelection(),this.clearNodesForRemoval();case 3:return e.a(2)}},e,this)})),function(){return n.apply(this,arguments)})},{kind:"method",key:"hide",value:function(){this.open&&(this.showExtended=!1,this.open=!1,window.removeEventListener("scroll",this._onScroll,{capture:!0}),this.clearNodesForRemoval())}},{kind:"field",key:"clearNodesForRemoval",value:function(){var e=this;return function(){e.nodesForRemoval=null,e.requestUpdate()}}}]}},M.WF);function be(e,t){t=t.trim();var n=new RegExp(String.raw(P||(P=G(["^(S+(s+|$)){1,","}"],["^(\\S+(\\s+|$)){1,","}"])),e)),r=t.match(n);return r?r[0].trim():""}function we(e,t){t=t.trim();var n=new RegExp(String.raw(A||(A=G(["((^|s+)S+){1,","}s*?$"],["((^|\\s+)\\S+){1,","}\\s*?$"])),e)),r=t.match(n);return r?r[0].trim():""}function ke(e){for(;e.firstChild;)e=e.firstChild;return e}function Se(e){for(;e.lastChild;)e=e.lastChild;return e}function Te(e){return e.replace(/(:|-,|,-|,|\n)/g,function(e){return 1===e.length?" ":" "})}function Ee(e,t,n){var r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).normalize,o=void 0===r?function(e){return e}:r;if(n.length){var i=n[0]===t.startContainer?t.startOffset:0,a=o(Ce(t)),s=o(n[0].textContent.slice(0,i)).length,l=new RegExp(e.source,e.flags.includes("g")?e.flags:"".concat(e.flags,"g")),c=Array.from(a.matchAll(l)).map(function(e){var t=xe(s+e.index,n,!1,{normalize:o}),r=xe(s+e.index+e[0].length,n,!0,{normalize:o});if(t&&r){var i=new Range;return i.setStart(t.node,t.offset),i.setEnd(r.node,r.offset),i}console.warn("Could not find boundary points for regex match, skipping this match",{match:e,start:t,end:r})}).filter(function(e){return!!e});if(null!=c&&c.length)return c}}function xe(e,t,n){var r,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).normalize,i=void 0===o?function(e){return e}:o,a=e,s=0,l=D(t);try{for(l.s();!(r=l.n()).done;){var c=r.value,u=c.textContent||"",d=i(u),f=s;if(f+d.length+(n?1:0)>a)for(var h=a-f,p=Math.min(h,u.length),g=n?d.substring(0,h):d.substring(h),m=i(n?u.substring(0,h):u.substring(h)),v=(n?-1:1)*(g.length>m.length?-1:1);p>=0&&p<=u.length;){if(m.length===g.length)return{node:c,offset:p};p+=v,m=i(n?u.substring(0,p):u.substring(p))}s+=d.length}}catch(e){l.e(e)}finally{l.f()}}function Ce(e){var t=Array.from((0,z.nC)(ve(e,"text"),Oe)),n=t.map(function(e){return e.textContent}).join(""),r=t[0],o=t[t.length-1];return e.startContainer===r&&(n=n.substring(e.startOffset)),e.endContainer===o&&(n=n.substring(0,n.length-(o.textContent.length-e.endOffset))),n}function Le(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=ke(e),o=Se(e),i=new Range;i.setStart(r,0),i.setEnd(o,o.textContent.length);var a=Array.from((0,z.nC)(ve(i,"text"),Oe)),s=Ee(t.toRegExp({context:!0}),i,a,{normalize:Te});if(s){var l=Array.from((0,z.nC)(ve(s[0],"text"),Oe)),c=Ee(t.toRegExp({context:!1}),s[0],l,{normalize:Te});if(!c)throw new Error("Could not find quote in page");var u=ke(c[0].startContainer),d=ke(c[0].endContainer),f=new Range;if(f.setStart(u,0),f.setEnd(d,d.textContent.length),!u.parentElement.classList.contains("BRhighlight")&&!d.parentElement.classList.contains("BRhighlight"))return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return document.createElement("mark")};if(e.startContainer.nodeType!=Node.TEXT_NODE||e.endContainer.nodeType!=Node.TEXT_NODE)return[];if(e.startContainer===e.endContainer){var n=t();return e.surroundContents(n),[n]}var r=e.startContainer,o=e.cloneRange();o.setEndAfter(r);var i=e.endContainer,a=e.cloneRange();a.setStartBefore(i);var s=[];e.setStartAfter(r),e.setEndBefore(i);for(var l=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:function(t){return e.intersectsNode(t)?t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP:NodeFilter.FILTER_REJECT}}),c=l.nextNode();c;){if(c.nodeType===Node.TEXT_NODE){var u=t();c.parentNode.insertBefore(u,c),u.appendChild(c),s.push(u)}c=l.nextNode()}var d=t();o.surroundContents(d);var f=t();return a.surroundContents(f),[d].concat(s,[f])}(f,function(){var e=document.createElement("mark");return e.classList.add("BRhighlight"),n&&e.classList.add(n),t.uuid&&e.classList.add(t.uuid),e})}else console.warn("Could not find quote with context in page")}function Oe(e){var t;return!(null!==(t=e.previousElementSibling)&&void 0!==t&&t.classList.contains("BRspace"))}function je(e){if(!e)return null;var t=Array.from(null==e?void 0:e.classList).filter(function(e){if(e.slice(0,2).includes("id"))return e});return t.length?t[0]:null}var Pe=function(){function e(t){var n=t.prefix,r=t.quote,o=t.quoteStart,i=t.quoteEnd,a=t.suffix,s=t.pageNumber,l=t.pageIndex,c=t.uuid;ue(this,e),this.prefix=n,this.quote=null!=r?r:null,this.quoteStart=null!=o?o:null,this.quoteEnd=null!=i?i:null,this.suffix=a,this.pageNumber=s,this.pageIndex=l,this.uuid=null!=c?c:null}return fe(e,[{key:"toUrlString",value:function(){var e=function(e){return function(e){return e.replace(/\s+/g," ").trim()}(Te(e).trim())},t=this.pageNumber?this.pageNumber:"n".concat(this.pageIndex);t+=":",this.prefix&&(t+=e(this.prefix),t+="-,");var n=this.quote?e(this.quote):null,r=null;if(n&&n.length>80&&(n.match(/\S+/g)||[]).length>=6){var o=be(3,n),i=we(3,n);o&&i&&(r={quoteStart:o,quoteEnd:i})}if(n&&!r)t+=n;else if(r)t+="".concat(r.quoteStart,",").concat(r.quoteEnd);else{if(!this.quoteStart||!this.quoteEnd)throw new Error("Text fragment requires either a quote or quoteStart/quoteEnd");t+="".concat(this.quoteStart,",").concat(this.quoteEnd)}return this.suffix&&(t+=",-",t+=e(this.suffix)),encodeURIComponent(t).replace(/%2C/g,",").replace(/%3A/g,":")}},{key:"toRegExp",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).context,t=void 0!==e&&e,n=this.quote?[this.quote]:[this.quoteStart,this.quoteEnd];t&&(this.prefix&&(n[0]=this.prefix+" "+n[0]),this.suffix&&(n[n.length-1]=n[n.length-1]+" "+this.suffix));var r=function(e){return RegExp.escape(Te(e)).replace(/(\\x20)+/g,"\\s+")};return 1===n.length?new RegExp(r(n[0]),"gi"):new RegExp(r(n[0])+"[\\s\\S]*?"+r(n[1]),"gi")}},{key:"toJSON",value:function(){return{prefix:this.prefix,quote:this.quote,quoteStart:this.quoteStart,quoteEnd:this.quoteEnd,suffix:this.suffix,pageNumber:this.pageNumber,pageIndex:this.pageIndex,uuid:this.uuid}}}],[{key:"fromString",value:function(t,n,r){var o=t.match(/^(?:(.*?):)?(?:(.*?)-,)?(.*?)(?:,-(.*))?$/);if(!o)throw new Error("Invalid text fragment format: ".concat(t));var i=o[1]?decodeURIComponent(o[1]):null,a=o[2]?decodeURIComponent(o[2]):null,s=(o[3]||"").split(","),l=null,c=null,u=null;if(1===s.length)l=decodeURIComponent(s[0]);else{if(2!==s.length)throw new Error("Invalid text fragment quote format: ".concat(t));c=decodeURIComponent(s[0]),u=decodeURIComponent(s[1])}var d=o[4]?decodeURIComponent(o[4]):null,f=i?n.getPageIndex(i):r;if("number"!=typeof f)throw new Error("Could not determine page index for text fragment with page number ".concat(i));if(!(l||c&&u))throw new Error("Invalid text fragment quote format: ".concat(t));return new e({prefix:a,quote:l,quoteStart:c,quoteEnd:u,suffix:d,pageNumber:i,pageIndex:f})}},{key:"fromJSON",value:function(t){return new e(t)}},{key:"fromSelection",value:function(t,n){var r,o,i=t.getRangeAt(0),a=new Range,s=Se(i.startContainer),l=ke(i.endContainer);a.setStart(s,0),a.setEnd(l,0==i.endOffset?0:null!==(r=null===(o=l.textContent)||void 0===o?void 0:o.length)&&void 0!==r?r:0);var u=document.createRange();u.setStart(ke(n[0]),0),u.setEnd(s,0);var d=document.createRange();d.setStart(l,a.endOffset);var f=Se(n[n.length-1]);d.setEnd(f,Math.max(0,f.textContent.length-1));var h=Ce(u),p=we(3,h),g=(0,c.rj)(p),m=Ce(d),v=be(3,m),y=(0,c.rj)(v);g<3&&(v=be(6-g,m),y=(0,c.rj)(v)),y<3&&(p=we(6-y,h),g=(0,c.rj)(p));var b=Ce(a),w=s.parentElement.closest(".BRpagecontainer");return new e({quote:b,prefix:p,suffix:v,pageNumber:w.getAttribute("data-page-num"),pageIndex:parseFloat(w.getAttribute("data-index"))})}}])}()},4565:function(e,t,n){function r(e){return r="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},r(e)}function o(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,i(r.key),r)}}function i(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}n.d(t,{l:function(){return a}}),n(2675),n(9463),n(2259),n(5700),n(3792),n(9572),n(2892),n(6099),n(7764),n(2953);var a=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.maxSize=t,this.entries=[]},(t=[{key:"add",value:function(e){this.entries.length>=this.maxSize&&this.entries.shift(),this.entries.push(e)}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()},1989:function(e,t,n){function r(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function s(n,r,i,a){var s=r&&r.prototype instanceof c?r:c,u=Object.create(s.prototype);return o(u,"_invoke",function(n,r,o){var i,a,s,c=0,u=o||[],d=!1,f={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,s=e,f.n=n,l}};function h(n,r){for(a=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],h=f.p,p=i[2];n>3?(o=p===r)&&(s=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=0,f.v=r,f.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,f.n=p,a=0))}if(o||n>1)return l;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,p),a=u,s=p;(t=a<2?e:s)||!d;){i||(a?a<3?(a>1&&(f.n=-1),h(a,s)):f.n=s:f.v=s);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,s)))throw TypeError("iterator result is not an object");if(!t.done)return t;s=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(d=f.n<0)?s:n.call(r,f))!==l)break}catch(t){i=e,a=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,i,a),!0),u}var l={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var f=[][i]?t(t([][i]())):(o(t={},i,function(){return this}),t),h=d.prototype=c.prototype=Object.create(f);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return u.prototype=d,o(h,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,i,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(r=function(){return{w:s,m:p}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,n,r){function a(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},o(e,t,n,r)}n.d(t,{Px:function(){return h},eU:function(){return d},nC:function(){return f},pp:function(){return p},yU:function(){return g}}),n(2675),n(9463),n(2259),n(3418),n(3792),n(4782),n(2010),n(875),n(6099),n(7495),n(8781),n(7764),n(2953);var i=r().m(f),a=r().m(h),s=r().m(p),l=r().m(g);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(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)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}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 i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function u(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 d(e,t){var n,r=0,o=c(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(r==t)return i;r++}}catch(e){o.e(e)}finally{o.f()}}function f(e,t){var n,o,a,s;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:n=c(e),r.p=1,n.s();case 2:if((o=n.n()).done){r.n=4;break}if(a=o.value,!t(a)){r.n=3;break}return r.n=3,a;case 3:r.n=2;break;case 4:r.n=6;break;case 5:r.p=5,s=r.v,n.e(s);case 6:return r.p=6,n.f(),r.f(6);case 7:return r.a(2)}},i,null,[[1,5,6,7]])}function h(e,t){var n,o,i,s;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:n=c(e),r.p=1,n.s();case 2:if((o=n.n()).done){r.n=4;break}return i=o.value,r.n=3,t(i);case 3:r.n=2;break;case 4:r.n=6;break;case 5:r.p=5,s=r.v,n.e(s);case 6:return r.p=6,n.f(),r.f(6);case 7:return r.a(2)}},a,null,[[1,5,6,7]])}function p(e){var t,n,o,i,a,l,u;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:t=void 0,n=void 0,o=void 0,i=c(e),r.p=1,i.s();case 2:if((a=i.n()).done){r.n=5;break}if(l=a.value,void 0===n){r.n=3;break}return o=l,r.n=3,[t,n,o];case 3:t=n,n=l,o=void 0;case 4:r.n=2;break;case 5:r.n=7;break;case 6:r.p=6,u=r.v,i.e(u);case 7:return r.p=7,i.f(),r.f(7);case 8:if(void 0===n){r.n=9;break}return r.n=9,[t,n,o];case 9:return r.a(2)}},s,null,[[1,6,7,8]])}function g(e,t){var n,o,i,a;return r().w(function(r){for(;;)switch(r.n){case 0:n=e[Symbol.iterator](),o=t[Symbol.iterator]();case 1:if(i=n.next(),a=o.next(),!i.done||!a.done){r.n=2;break}return r.a(2);case 2:if(!i.done&&!a.done){r.n=3;break}throw new Error("zip: one of the iterators is done");case 3:return r.n=4,[i.value,a.value];case 4:r.n=1;break;case 5:return r.a(2)}},l)}},9073:function(e,t,n){function r(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 o(e){var t=e.match(/\S+/g);return t?t.length:0}function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a;return null==e?void 0:e.replace(/\{\{([^}]*?)\}\}/g,function(e,i){if(!i)return e;var a,s=function(e){if(Array.isArray(e))return e}(a=i.split("|").map(function(e){return e.trim()}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return r(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)?r(e,t):void 0}}(a)||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.")}(),l=s[0],c=r(s).slice(1);if(!(l in n)&&!(l in t))return e;var u=l in n?n[l]:l in t?t[l]:null;return c.map(function(e){return o[e]}).reduce(function(e,t){return t(e)},u&&u.toString())})}n.d(t,{gT:function(){return i},rj:function(){return o}}),n(2675),n(9463),n(2259),n(3418),n(3792),n(2062),n(2712),n(4782),n(2010),n(6099),n(7495),n(8781),n(7764),n(1761),n(5440),n(2762),n(2953);var a={urlencode:encodeURIComponent}}},function(e){e(6735)}]);
3
+ //# sourceMappingURL=plugin.translate.js.map
@@ -0,0 +1 @@
1
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */