@internetarchive/bookreader 5.0.0-110 → 5.0.0-112

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 (32) hide show
  1. package/BookReader/BookReader.css +59 -0
  2. package/BookReader/BookReader.js +1 -1
  3. package/BookReader/BookReader.js.map +1 -1
  4. package/BookReader/ia-bookreader-bundle.js +74 -77
  5. package/BookReader/ia-bookreader-bundle.js.map +1 -1
  6. package/BookReader/plugins/plugin.chapters.js +1 -1
  7. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  8. package/BookReader/plugins/plugin.experiments.js +1 -1
  9. package/BookReader/plugins/plugin.experiments.js.map +1 -1
  10. package/BookReader/plugins/plugin.search.js.map +1 -1
  11. package/BookReader/plugins/plugin.text_selection.js +23 -1
  12. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  13. package/BookReader/plugins/plugin.translate.js +25 -3
  14. package/BookReader/plugins/plugin.translate.js.map +1 -1
  15. package/BookReader/plugins/plugin.tts.js.map +1 -1
  16. package/BookReader/plugins/plugin.url.js +2 -1
  17. package/BookReader/plugins/plugin.url.js.LICENSE.txt +1 -0
  18. package/BookReader/plugins/plugin.url.js.map +1 -1
  19. package/package.json +2 -1
  20. package/src/BookReader/Mode2UpLit.js +1 -3
  21. package/src/BookReader/Navbar/Navbar.js +9 -10
  22. package/src/BookReader/utils/SelectionObserver.js +9 -1
  23. package/src/BookReader.js +17 -2
  24. package/src/css/_TextSelection.scss +59 -0
  25. package/src/plugins/plugin.chapters.js +8 -3
  26. package/src/plugins/plugin.experiments.js +21 -3
  27. package/src/plugins/plugin.text_selection.js +17 -0
  28. package/src/plugins/translate/plugin.translate.js +68 -22
  29. package/src/plugins/tts/utils.js +1 -1
  30. package/src/plugins/url/UrlPlugin.js +23 -3
  31. package/src/plugins/url/plugin.url.js +63 -7
  32. package/src/util/TextSelectionManager.js +252 -2
@@ -1,3 +1,25 @@
1
1
  /*! For license information please see plugin.text_selection.js.LICENSE.txt */
2
- "use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[326],{706:function(e,t,n){var r=n(350).PROPER,a=n(9039),o=n(7452);e.exports=function(e){return a(function(){return!!o[e]()||"​…᠎"!=="​…᠎"[e]()||r&&o[e].name!==e})}},2762:function(e,t,n){var r=n(6518),a=n(3802).trim;r({target:"String",proto:!0,forced:n(706)("trim")},{trim:function(){return a(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 a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function o(e){var t=function(e){if("object"!=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 i}}),n(2675),n(9463),n(2259),n(5700),n(3792),n(9572),n(8130),n(9085),n(6099),n(7764),n(2953);var i=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){}}])&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()},296:function(e,t,n){n(2675),n(9463),n(2259),n(5700),n(8706),n(2008),n(113),n(3418),n(3792),n(8598),n(2062),n(4782),n(6910),n(9572),n(2010),n(6033),n(8130),n(9085),n(875),n(6099),n(8459),n(3362),n(825),n(7495),n(8781),n(9449),n(7764),n(2762),n(2953);var r=n(4907),a=n(1041),o=n(9073),i=n(4565),l=n(4160),u=n(593),s=n(1669);function c(e){return c="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},c(e)}var f=b().m(N),h=b().m(_),d=b().m(L);function p(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(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 y(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=m(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,l=[],u=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(l.push(r.value),l.length!==t);u=!0);}catch(e){s=!0,a=e}finally{try{if(!u&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(s)throw a}}return l}}(e,t)||m(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}function g(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 b(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var u=r&&r.prototype instanceof l?r:l,s=Object.create(u.prototype);return k(s,"_invoke",function(n,r,a){var o,l,u,s=0,c=a||[],f=!1,h={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return o=t,l=0,u=e,h.n=n,i}};function d(n,r){for(l=n,u=r,t=0;!f&&s&&!a&&t<c.length;t++){var a,o=c[t],d=h.p,p=o[2];n>3?(a=p===r)&&(u=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=d&&((a=n<2&&d<o[1])?(l=0,h.v=r,h.n=o[1]):d<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,h.n=p,l=0))}if(a||n>1)return i;throw f=!0,r}return function(a,c,p){if(s>1)throw TypeError("Generator is already running");for(f&&1===c&&d(c,p),l=c,u=p;(t=l<2?e:u)||!f;){o||(l?l<3?(l>1&&(h.n=-1),d(l,u)):h.n=u:h.v=u);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(u=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(f=h.n<0)?u:n.call(r,h))!==i)break}catch(t){o=e,l=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,a,o),!0),s}var i={};function l(){}function u(){}function s(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(k(t={},r,function(){return this}),t),f=s.prototype=l.prototype=Object.create(c);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,k(e,a,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=s,k(f,"constructor",s),k(s,"constructor",u),u.displayName="GeneratorFunction",k(s,a,"GeneratorFunction"),k(f),k(f,a,"Generator"),k(f,r,function(){return this}),k(f,"toString",function(){return"[object Generator]"}),(b=function(){return{w:o,m:h}})()}function k(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}k=function(e,t,n,r){function o(t,n){k(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},k(e,t,n,r)}function w(e,t,n,r,a,o,i){try{var l=e[o](i),u=l.value}catch(e){return void n(e)}l.done?t(u):Promise.resolve(u).then(r,a)}function S(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var o=e.apply(t,n);function i(e){w(o,r,a,i,l,"next",e)}function l(e){w(o,r,a,i,l,"throw",e)}i(void 0)})}}function j(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,T(r.key),r)}}function P(e,t,n){return t&&x(e.prototype,t),n&&x(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(C=function(){return!!e})()}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function O(e,t){return O=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},O(e,t)}function A(e,t,n){return(t=T(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var R=window.BookReader,B=function(e){function t(e){var n,r,a,o;return j(this,t),A((r=this,o=[e],a=E(a=t),n=function(e,t){if(t&&("object"==c(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)}(r,C()?Reflect.construct(a,o||[],E(r).constructor):a.apply(r,o))),"options",{enabled:!0,fullDjvuXmlUrl:null,singlePageDjvuXmlUrl:null,jsonp:!1,maxProtectedWords:200}),A(n,"djvuPagesPromise",null),A(n,"pageTextCache",new i.l),A(n,"maxWordRendered",2500),n.rtl="rl"===n.br.pageProgression,n.textSelectionManager=new u.bg(".BRtextLayer",n.br,{selectionElement:[".BRwordElement",".BRspace"]},n.options.maxProtectedWords),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&O(e,t)}(t,e),P(t,[{key:"init",value:function(){this.options.enabled&&(this.loadData(),this.textSelectionManager.init())}},{key:"_configurePageContainer",value:function(e){return this.br.mode!==this.br.constModeThumb&&e.page&&this.createTextLayer(e),e}},{key:"loadData",value:function(){this.options.singlePageDjvuXmlUrl||(this.djvuPagesPromise=s.ajax({type:"GET",url:(0,o.g)(this.options.fullDjvuXmlUrl,this.br.options.vars),dataType:this.options.jsonp?"jsonp":"html",cache:!0,xhrFields:{withCredentials:this.br.protected},error:function(e){}}).then(function(e){try{var t=s.parseXML(e);return t&&s(t).find("OBJECT")}catch(e){return}}))}},{key:"getPageText",value:(a=S(b().m(function e(t){var n,r,a,i,l;return b().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this.options.singlePageDjvuXmlUrl){e.n=5;break}if(!(n=this.pageTextCache.entries.find(function(e){return e.index==t}))){e.n=1;break}return e.a(2,n.response);case 1:return e.n=2,s.ajax({type:"GET",url:(0,o.g)(this.options.singlePageDjvuXmlUrl,this.br.options.vars,{pageIndex:t}),dataType:this.options.jsonp?"jsonp":"html",cache:!0,xhrFields:{withCredentials:this.br.protected},error:function(e){}});case 2:return r=e.v,e.p=3,a=s.parseXML(r),i=a&&s(a).find("OBJECT")[0],this.pageTextCache.add({index:t,response:i}),e.a(2,i);case 4:return e.p=4,e.v,e.a(2,void 0);case 5:return e.n=6,this.djvuPagesPromise;case 6:if(!(l=e.v)){e.n=7;break}return e.a(2,l[t]);case 7:return e.a(2)}},e,this,[[3,4]])})),function(e){return a.apply(this,arguments)})},{key:"createTextLayer",value:(n=S(b().m(function e(t){var n,a,o,i,u,c,f,h,d,p,m,g,k,w,S,j,x,P,C,E,O,A,T,R,B,I=this;return b().w(function(e){for(;;)switch(e.n){case 0:if(n=t.page.index,!(a=t.$container).find(".BRtextLayer").length){e.n=1;break}return e.a(2);case 1:return e.n=2,this.getPageText(n);case 2:if(o=e.v){e.n=3;break}return e.a(2);case 3:if(s(o).find("WORD").filter(function(e,t){var n=v(t.getAttribute("coords").split(",").map(parseFloat),4),r=n[0],a=n[3];if(0==r&&0==a)return console.error("Found invalid ocr word coordinates"),!0}).remove(),M(o),!((i=s(o).find("WORD").length)>this.maxWordRendered)){e.n=4;break}return console.log("Page ".concat(n," has too many words (").concat(i," > ").concat(this.maxWordRendered,"). Not rendering text layer.")),e.a(2);case 4:return u=(0,r.Ql)(t.page,"BRtextLayer"),e.n=5,Promise.resolve();case 5:c=parseFloat(t.$container[0].style.width)/t.page.width,f=parseFloat(t.$container[0].style.height)/t.page.height,u.style.transform="scale(".concat(c,", ").concat(f,")"),(h=(0,l.YH)(this.br.options.bookLanguage))&&u.setAttribute("lang",h),u.setAttribute("dir",this.rtl?"rtl":"ltr"),d=s(o).find("PARAGRAPH[coords]").toArray(),p=d.map(function(e){var t=I.renderParagraph(e);return u.appendChild(t),t}),m=z(u,".BRparagraphElement"),g=0,k=y(L(d,p));try{for(k.s();!(w=k.n()).done;)S=v(w.value,2),j=S[0],x=S[1],P=s(j).attr("coords").split(",").map(parseFloat),C=m.get(x),E=v(P,4),O=E[0],A=E[2],T=E[3],R=this.rtl?C.right-A:O-C.left,B=T-(C.top+g),x.style[this.rtl?"marginRight":"marginLeft"]="".concat(R,"px"),x.style.marginTop="".concat(B,"px"),g+=B,u.appendChild(x)}catch(e){k.e(e)}finally{k.f()}a.append(u),this.textSelectionManager.stopPageFlip(a),this.br.trigger("textLayerRendered",{pageIndex:n,pageContainer:t});case 6:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"renderParagraph",value:function(e){var t=document.createElement("p");t.classList.add("BRparagraphElement"),e.getAttribute("x-role")&&(t.classList.add("ocr-role-header-footer"),t.ariaHidden="true");var n=v(s(e).attr("coords").split(",").map(parseFloat),4),r=n[0],a=n[1],o=n[2],i=n[3],l=[],u=s(e).find("LINE[coords]").toArray();if(!u.length)return t;var c,f=y(_(N(u,I)));try{for(f.s();!(c=f.n()).done;){var h=v(c.value,3),d=h[0],m=h[1],g=h[2],b=m.ocrElement==u[u.length-1],k=document.createElement("span");k.classList.add("BRlineElement");var w,S=y(m.words.entries());try{for(S.s();!(w=S.n()).done;){var j=v(w.value,2),x=j[0],P=j[1],C=v(s(P).attr("coords").split(",").map(parseFloat),4),E=C[1],O=C[2],A=C[3],T=E-A;if(l.push(T),0==x&&null!=d&&d.lastWord.textContent.trim().endsWith("-")){var R=v(s((g||d).firstWord).attr("coords").split(",").map(parseFloat),3)[0];s(P).attr("coords","".concat(R,",").concat(E,",").concat(O,",").concat(A))}var B=document.createElement("span");if(B.setAttribute("class","BRwordElement"),B.textContent=P.textContent.trim(),x>0){var M=document.createElement("span");M.classList.add("BRspace"),M.textContent=" ",M.setAttribute("aria-label"," "),k.append(M),k.appendChild(document.createTextNode(" "))}k.appendChild(B)}}catch(e){S.e(e)}finally{S.f()}var D=m.lastWord.textContent.trim().endsWith("-"),F=k.children[k.children.length-1];D&&!b&&(F.textContent=F.textContent.trim().slice(0,-1),F.classList.add("BRwordElement--hyphen")),t.appendChild(k),b||D||t.appendChild(document.createTextNode(" "))}}catch(e){f.e(e)}finally{f.f()}l.sort(function(e,t){return e-t});var G=l[Math.floor(.85*l.length)]+4;t.style.left="".concat(r,"px"),t.style.top="".concat(i,"px"),t.style.width="".concat(o-r,"px"),t.style.height="".concat(a-i,"px"),t.style.fontSize="".concat(G,"px");var W,K=z(t,".BRwordElement"),H=y(L(s(e).find("WORD").toArray(),t.querySelectorAll(".BRwordElement")));try{for(H.s();!(W=H.n()).done;){var U=v(W.value,2),q=U[0],X=U[1],$=K.get(X),V=v(s(q).attr("coords").split(",").map(parseFloat),3),J=V[0],Y=V[2]-J;q.textContent.endsWith(" ")&&(Y=Y*(q.textContent.length-1)/q.textContent.length);var Z=Y-$.width;X.style.letterSpacing="".concat(Z/(q.textContent.length-1),"px")}}catch(e){H.e(e)}finally{H.f()}K=z(t,".BRwordElement");var Q,ee=z(t,".BRspace"),te=s(e).find("LINE[coords]").toArray(),ne=Array.from(t.querySelectorAll(".BRlineElement")),re=i,ae=y(L(te,ne));try{for(ae.s();!(Q=ae.n()).done;){var oe,ie=v(Q.value,2),le=ie[0],ue=ie[1],se=s(le).find("WORD").toArray(),ce=this.rtl?o:r,fe=y(L(se,ue.querySelectorAll(".BRwordElement")));try{for(fe.s();!(oe=fe.n()).done;){var he=v(oe.value,2),de=he[0],pe=he[1],ye=K.get(pe),ve=v(s(de).attr("coords").split(",").map(parseFloat),3),me=ve[0],ge=ve[2],be=this.rtl?-(ge-ce):me-ce;if(pe.previousElementSibling){var ke=pe.previousElementSibling;ke.style.letterSpacing="".concat(be-ee.get(ke).width,"px")}else pe.style[this.rtl?"paddingRight":"paddingLeft"]="".concat(be,"px");this.rtl?ce-=be+ye.width:ce+=be+ye.width}}catch(e){fe.e(e)}finally{fe.f()}var we=Math.min.apply(Math,p(se.map(function(e){return parseFloat(s(e).attr("coords").split(",")[3])})))-re;ue.previousElementSibling&&(ue.previousElementSibling.style.lineHeight="".concat(we,"px"),re+=we)}}catch(e){ae.e(e)}finally{ae.f()}return ne[ne.length-1].style.lineHeight="".concat(a-re,"px"),t.appendChild(document.createElement("br")),t}}]);var n,a}(a.S);function z(e,t){var n={position:e.style.position,visibility:e.style.visibility,top:e.style.top,left:e.style.left,transform:e.style.transform};e.style.position="absolute",e.style.visibility="hidden",e.style.top="0",e.style.left="0",e.style.transform="none",document.body.appendChild(e);var r=new Map(Array.from(e.querySelectorAll(t)).map(function(e){var t=e.getBoundingClientRect();return[e,new D(t.left+window.scrollX,t.top+window.scrollY,t.width,t.height)]}));return document.body.removeChild(e),Object.assign(e.style,n),r}function I(e){var t=s(e).find("WORD").toArray();return{ocrElement:e,words:t,firstWord:t[0],lastWord:t[t.length-1]}}function N(e,t){var n,r,a,o;return b().w(function(i){for(;;)switch(i.p=i.n){case 0:n=y(e),i.p=1,n.s();case 2:if((r=n.n()).done){i.n=4;break}return a=r.value,i.n=3,t(a);case 3:i.n=2;break;case 4:i.n=6;break;case 5:i.p=5,o=i.v,n.e(o);case 6:return i.p=6,n.f(),i.f(6);case 7:return i.a(2)}},f,null,[[1,5,6,7]])}function _(e){var t,n,r,a,o,i,l;return b().w(function(u){for(;;)switch(u.p=u.n){case 0:t=void 0,n=void 0,r=void 0,a=y(e),u.p=1,a.s();case 2:if((o=a.n()).done){u.n=5;break}if(i=o.value,void 0===n){u.n=3;break}return r=i,u.n=3,[t,n,r];case 3:t=n,n=i,r=void 0;case 4:u.n=2;break;case 5:u.n=7;break;case 6:u.p=6,l=u.v,a.e(l);case 7:return u.p=7,a.f(),u.f(7);case 8:if(void 0===n){u.n=9;break}return u.n=9,[t,n,r];case 9:return u.a(2)}},h,null,[[1,6,7,8]])}function L(e,t){var n,r,a,o;return b().w(function(i){for(;;)switch(i.n){case 0:n=e[Symbol.iterator](),r=t[Symbol.iterator]();case 1:if(a=n.next(),o=r.next(),!a.done||!o.done){i.n=2;break}return i.a(2);case 2:if(!a.done&&!o.done){i.n=3;break}throw new Error("zip: one of the iterators is done");case 3:return i.n=4,[a.value,o.value];case 4:i.n=1;break;case 5:return i.a(2)}},d)}function M(e){if(!s(e).attr("coords")&&e.children){var t=s(e).children().toArray();if(0!==t.length){var n,r=y(t);try{for(r.s();!(n=r.n()).done;)M(n.value)}catch(e){r.e(e)}finally{r.f()}var a,o=[],i=y(t);try{for(i.s();!(a=i.n()).done;){var l=a.value;s(l).attr("coords")&&o.push(s(l).attr("coords").split(",").map(parseFloat))}}catch(e){i.e(e)}finally{i.f()}var u=function(e){var t,n=1/0,r=-1/0,a=-1/0,o=1/0,i=y(e);try{for(i.s();!(t=i.n()).done;){var l=v(t.value,4),u=l[0],s=l[1],c=l[2],f=l[3];n=Math.min(n,u),r=Math.max(r,s),a=Math.max(a,c),o=Math.min(o,f)}}catch(e){i.e(e)}finally{i.f()}return[n,r,a,o]}(o);Math.abs(u[0])!=1/0&&s(e).attr("coords",u.join(","))}}}null==R||R.registerPlugin("textSelection",B);var D=function(){return P(function e(t,n,r,a){j(this,e),this.x=t,this.y=n,this.width=r,this.height=a},[{key:"right",get:function(){return this.x+this.width}},{key:"bottom",get:function(){return this.y+this.height}},{key:"top",get:function(){return this.y}},{key:"left",get:function(){return this.x}}])}()},4160:function(e,t,n){n.d(t,{$x:function(){return m},EF:function(){return c},ND:function(){return v},m0:function(){return f},YH:function(){return d},_4:function(){return p}}),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(1761),n(2953);var r=[],a={},o={},i={};[["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]};a[e[2]]=o[e[3]]=i[e[4]]=t,r.push(t)});var l=r;function u(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 s(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)?s(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function s(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 c(e){var t=e.match(/\S+/g);return t?t.length:0}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator.userAgent;return/android/i.test(e)}var h={"zh-hans":"中文 (Zhōngwén)"};function d(e){if(!e)return null;if(e=e.toLocaleLowerCase(),h[e])return e;var t=y(e,["iso639_1"])||y(e,["iso639_2T"])||y(e,["iso639_2B","name","nativeName"]);return t?t.iso639_1:null}function p(e){if(!e)return null;if(e=e.toLocaleLowerCase(),h[e])return h[e];var t=y(e,["iso639_1"])||y(e,["iso639_2T"])||y(e,["iso639_2B","name","nativeName"]);return null!=t&&t.nativeName?t.nativeName.split(", ")[0]:null}function y(e,t){if(!e)return null;e=e.toLowerCase();var n,r=u(l);try{for(r.s();!(n=r.n()).done;){var a,o=n.value,i=u(t);try{for(i.s();!(a=i.n()).done;){var s;if(null!==(s=o[a.value])&&void 0!==s&&s.toLowerCase().split(", ").includes(e))return o}}catch(e){i.e(e)}finally{i.f()}}}catch(e){r.e(e)}finally{r.f()}return null}function v(){try{return!!window.localStorage}catch(e){return!1}}var m=-1!=location.toString().indexOf("_debugReadAloud=true")},593:function(e,t,n){n.d(t,{bg:function(){return w}}),n(2675),n(9463),n(2259),n(5700),n(113),n(3418),n(3792),n(8598),n(4782),n(9572),n(2010),n(8130),n(875),n(6099),n(3362),n(7495),n(8781),n(7764),n(5440),n(2953);var r=n(1669);function a(e){return a="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},a(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,l(r.key),r)}}function i(e,t,n){return(t=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){var t=function(e){if("object"!=a(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=a(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==a(t)?t:t+""}var u=function(){return e=function e(t,n){var a=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i(this,"selecting",!1),i(this,"startedInSelector",!1),i(this,"target",null),i(this,"_onSelectionChange",function(){var e=window.getSelection();if(!a.selecting&&e.toString()){var t=r(e.anchorNode).closest(a.selector)[0];if(!t)return;a.target=t,a.selecting=!0,a.handler("started",a.target)}!a.selecting||!e.isCollapsed&&e.toString()&&r(e.anchorNode).closest(a.selector)[0]||(a.selecting=!1,a.handler("cleared",a.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)}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),s=n(1669);function c(e){return c="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},c(e)}function f(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(c(e)+" is not iterable")}function h(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function o(n,r,a,o){var u=r&&r.prototype instanceof l?r:l,s=Object.create(u.prototype);return d(s,"_invoke",function(n,r,a){var o,l,u,s=0,c=a||[],f=!1,h={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,n){return o=t,l=0,u=e,h.n=n,i}};function d(n,r){for(l=n,u=r,t=0;!f&&s&&!a&&t<c.length;t++){var a,o=c[t],d=h.p,p=o[2];n>3?(a=p===r)&&(u=o[(l=o[4])?5:(l=3,3)],o[4]=o[5]=e):o[0]<=d&&((a=n<2&&d<o[1])?(l=0,h.v=r,h.n=o[1]):d<p&&(a=n<3||o[0]>r||r>p)&&(o[4]=n,o[5]=r,h.n=p,l=0))}if(a||n>1)return i;throw f=!0,r}return function(a,c,p){if(s>1)throw TypeError("Generator is already running");for(f&&1===c&&d(c,p),l=c,u=p;(t=l<2?e:u)||!f;){o||(l?l<3?(l>1&&(h.n=-1),d(l,u)):h.n=u:h.v=u);try{if(s=2,o){if(l||(a="next"),t=o[a]){if(!(t=t.call(o,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,l<2&&(l=0)}else 1===l&&(t=o.return)&&t.call(o),l<2&&(u=TypeError("The iterator does not provide a '"+a+"' method"),l=1);o=e}else if((t=(f=h.n<0)?u:n.call(r,h))!==i)break}catch(t){o=e,l=1,u=t}finally{s=1}}return{value:t,done:f}}}(n,a,o),!0),s}var i={};function l(){}function u(){}function s(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(d(t={},r,function(){return this}),t),f=s.prototype=l.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,s):(e.__proto__=s,d(e,a,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=s,d(f,"constructor",s),d(s,"constructor",u),u.displayName="GeneratorFunction",d(s,a,"GeneratorFunction"),d(f),d(f,a,"Generator"),d(f,r,function(){return this}),d(f,"toString",function(){return"[object Generator]"}),(h=function(){return{w:o,m:p}})()}function d(e,t,n,r){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}d=function(e,t,n,r){function o(t,n){d(e,t,function(e){return this._invoke(t,n,e)})}t?a?a(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},d(e,t,n,r)}var p=h().m(S),y=h().m(j);function v(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 m(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)?m(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,o=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw o}}}}function m(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 g(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,k(r.key),r)}}function b(e,t,n){return(t=k(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(e){var t=function(e){if("object"!=c(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=c(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==c(t)?t:t+""}var w=function(){return e=function e(t,n,r,a){var o=this,i=r.selectionElement;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),b(this,"options",{maxProtectedWords:200}),b(this,"_onSelectionChange",function(e,t){if("started"===e)o.textSelectingMode(t);else{if("cleared"!==e)throw new Error("Unknown type ".concat(e));o.defaultMode(t)}}),b(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 a=function(e,t){var n,r=0,a=v(e);try{for(a.s();!(n=a.n()).done;){var o=n.value;if(r==t)return o;r++}}catch(e){a.e(e)}finally{a.f()}}(S(j(t.startContainer,t.endContainer),function(e){var t;return null===(t=e.classList)||void 0===t?void 0:t.contains(o.selectionElement[0].replace(".",""))}),o.options.maxProtectedWords-1);if(a&&t.endContainer.parentNode!=a){var i=document.createRange();i.setStart(t.startContainer,t.startOffset),i.setEnd(a.firstChild,a.textContent.length),e.removeAllRanges(),e.addRange(i)}}else e.removeAllRanges()}}),this.layer=t,this.br=n,this.selectionElement=i,this.selectionObserver=new u(this.layer,this._onSelectionChange),this.options.maxProtectedWords=a||200},t=[{key:"init",value:function(){var e=this;this.attach(),new u(this.layer,function(t){var n;"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"),s(window.getSelection().anchorNode).closest(".BRpagecontainer").addClass("BRpagecontainer--hasSelection"))}).attach()}},{key:"attach",value:function(){var e=this;this.selectionObserver.attach(),this.br.protected&&(document.addEventListener("selectionchange",this._limitSelection),s(document.body).on("contextmenu dragstart copy",function(t){var n=document.getSelection();if(null!=n&&n.toString()&&s(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=s(e).closest(".BRpagecontainer");e.style.pointerEvents="none",n.find("img").css("pointer-events","auto"),s(e).off(".textSelectPluginHandler");var r=this.mouseIsDown,a=this.mouseIsDown;r&&(e.style.pointerEvents="auto"),s(e).on("mousedown.textSelectPluginHandler",function(e){t.mouseIsDown=!0,s(e.target).is(t.selectionElement.join(", "))&&e.stopPropagation()}),s(e).on("mouseup.textSelectPluginHandler",function(n){t.mouseIsDown=!1,e.style.pointerEvents="none",a&&(a=!1,n.stopPropagation())})}},{key:"textSelectingMode",value:function(e){var t=this,n=s(e).closest(".BRpagecontainer");e.style.pointerEvents="all",n.find("img").css("pointer-events","none"),s(e).off(".textSelectPluginHandler"),s(e).on("mousedown.textSelectPluginHandler",function(e){t.mouseIsDown=!0,e.stopPropagation()}),s(e).on("mouseup.textSelectPluginHandler",function(e){t.mouseIsDown=!1,e.stopPropagation()})}}],t&&g(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function S(e,t){var n,r,a,o;return h().w(function(i){for(;;)switch(i.p=i.n){case 0:n=v(e),i.p=1,n.s();case 2:if((r=n.n()).done){i.n=4;break}if(a=r.value,!t(a)){i.n=3;break}return i.n=3,a;case 3:i.n=2;break;case 4:i.n=6;break;case 5:i.p=5,o=i.v,n.e(o);case 6:return i.p=6,n.f(),i.f(6);case 7:return i.a(2)}},p,null,[[1,5,6,7]])}function j(e,t){var n,r;return h().w(function(a){for(;;)switch(a.n){case 0:return r=function(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.children,i=void 0===o||o,l=a.parents,u=void 0===l||l,s=a.siblings,c=void 0===s||s;return h().m(function a(){var o;return h().w(function(a){for(;;)switch(a.n){case 0:if(e!==t){a.n=2;break}return n=!0,a.n=1,e;case 1:return a.a(2);case 2:return a.n=3,e;case 3:if(!i||!e.firstChild){a.n=5;break}return a.d(f(r(e.firstChild,{children:!0,parents:!1,siblings:!0})),4);case 4:if(!n){a.n=5;break}return a.a(2);case 5:if(!c){a.n=9;break}o=e.nextSibling;case 6:if(!o){a.n=9;break}return a.d(f(r(o,{children:!0,parents:!1,siblings:!1})),7);case 7:if(!n){a.n=8;break}return a.a(2);case 8:o=o.nextSibling,a.n=6;break;case 9:if(!u||!e.parentNode){a.n=11;break}return a.d(f(r(e.parentNode,{children:!1,parents:!0,siblings:!0})),10);case 10:if(!n){a.n=11;break}return a.a(2);case 11:return a.a(2)}},a)})()},n=!1,a.d(f(r(e)),1);case 1:return a.a(2)}},y)}},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 a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,o(r.key),r)}}function o(e){var t=function(e){if("object"!=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 i}}),n(2675),n(9463),n(2259),n(5700),n(3792),n(9572),n(8130),n(6099),n(7764),n(2953);var i=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)}}])&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()},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 a(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:o;return null==e?void 0:e.replace(/\{\{([^}]*?)\}\}/g,function(e,o){if(!o)return e;var i,l=function(e){if(Array.isArray(e))return e}(i=o.split("|").map(function(e){return e.trim()}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||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}}(i)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=l[0],s=r(l).slice(1);if(!(u in n)&&!(u in t))return e;var c=u in n?n[u]:u in t?t[u]:null;return s.map(function(e){return a[e]}).reduce(function(e,t){return t(e)},c&&c.toString())})}n.d(t,{g:function(){return a}}),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(5440),n(2762),n(2953);var o={urlencode:encodeURIComponent}}},function(e){e(e.s=296)}]);
2
+ "use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[326],{90:function(e,t,n){var r=n(420),o=r.qy`
3
+ <svg
4
+ viewBox="0 0 100 100"
5
+ xmlns="http://www.w3.org/2000/svg"
6
+ >
7
+ <g class="fill-color">
8
+ <path d="M70.6784759,10 L70.6784759,21.3240186 C64.5020053,21.66334 58.9104278,22.5826126 53.9037433,24.0818363 C48.8970588,25.5810601 44.8495989,27.4085163 41.7613636,29.5642049 C38.6731283,31.7198935 35.9982175,34.0552229 33.736631,36.5701929 C31.4750446,39.085163 29.8217469,41.5657574 28.776738,44.011976 C27.7317291,46.4581947 26.9173351,48.6848525 26.3335561,50.6919494 C25.7497772,52.6990464 25.4088681,54.3324462 25.3108289,55.592149 L25.2372995,57.4085163 C29.0296346,54.1661122 33.1751337,51.5524507 37.6737968,49.5675316 C42.1724599,47.5826126 46.2934492,46.3118208 50.0367647,45.7551564 C53.7800802,45.1984919 57.2571301,44.8713684 60.4679144,44.7737858 C63.6786988,44.6762031 66.1831551,44.7726769 67.9812834,45.0632069 L70.6784759,45.499002 L70.6784759,57.4051896 L100,33.3765802 L70.6784759,10 Z M76.4438503,62.4883566 L82.8609626,57.1157685 C82.9099822,57.0669772 82.9946524,57.0303837 83.1149733,57.005988 C83.2352941,56.9815924 83.4536542,56.9571967 83.7700535,56.9328011 C84.0864528,56.9084054 84.3905971,56.9449989 84.6824866,57.0425815 C84.9743761,57.1401641 85.217246,57.2854291 85.4110963,57.4783766 C85.6049465,57.671324 85.7263815,57.8409847 85.7754011,57.9873586 L85.8489305,58.2035928 L85.8489305,90 L0,90 L0,17.910845 L43.1784759,17.910845 C43.2765152,17.9596363 43.410205,18.0317143 43.5795455,18.1270792 C43.7488859,18.222444 43.9438503,18.4519849 44.1644385,18.8157019 C44.3850267,19.1794189 44.469697,19.5542249 44.4184492,19.9401198 C44.4184492,20.2794411 44.3092692,20.582169 44.0909091,20.8483034 C43.872549,21.1144378 43.6664439,21.3206919 43.4725936,21.4670659 L43.1818182,21.6134398 C40.557041,23.06609 38.2954545,24.396762 36.3970588,25.6054558 L30.7820856,29.8170326 L11.5274064,29.8170326 L11.5274064,78.1669993 L74.1811497,78.1669993 L74.1811497,65.5355955 C74.1811497,65.1009093 74.3995098,64.6407186 74.8362299,64.1550233 L76.4438503,62.4883566 Z" id="Shape"></path>
9
+ </g>
10
+ </svg>
11
+ `;class i extends r.WF{static get styles(){return r.AH`
12
+ :host {
13
+ width: var(--iconWidth, 'auto');
14
+ height: var(--iconHeight, 'auto');
15
+ }
16
+
17
+ .fill-color {
18
+ fill: var(--iconFillColor);
19
+ }
20
+
21
+ .stroke-color {
22
+ stroke: var(--iconStrokeColor);
23
+ }
24
+ `}render(){return o}}customElements.define("ia-icon-share",i)},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})}},8543:function(e,t,n){var r=n(6518),o=n(9565),i=n(7476),a=n(3994),l=n(2529),s=n(7750),c=n(8014),u=n(655),f=n(8551),d=n(34),h=n(2195),p=n(788),m=n(1034),y=n(5966),v=n(6840),g=n(9039),b=n(8227),w=n(2293),k=n(7829),S=n(6682),x=n(1181),C=n(6395),E=b("matchAll"),j="RegExp String",P=j+" Iterator",A=x.set,O=x.getterFor(P),T=RegExp.prototype,R=TypeError,M=i("".indexOf),L=i("".matchAll),I=!!L&&!g(function(){L("a",/./)}),z=a(function(e,t,n,r){A(this,{type:P,regexp:e,string:t,global:n,unicode:r,done:!1})},j,function(){var e=O(this);if(e.done)return l(void 0,!0);var t=e.regexp,n=e.string,r=S(t,n);return null===r?(e.done=!0,l(void 0,!0)):e.global?(""===u(r[0])&&(t.lastIndex=k(n,c(t.lastIndex),e.unicode)),l(r,!1)):(e.done=!0,l(r,!1))}),_=function(e){var t,n,r,o=f(this),i=u(e),a=w(o,RegExp),l=u(m(o));return t=new a(a===RegExp?o.source:o,l),n=!!~M(l,"g"),r=!!~M(l,"u")||!!~M(l,"v"),t.lastIndex=c(o.lastIndex),new z(t,i,n,r)};r({target:"String",proto:!0,forced:I},{matchAll:function(e){var t,n,r,i,a=s(this);if(d(e)){if(p(e)&&(t=u(s(m(e))),!~M(t,"g")))throw new R("`.matchAll` does not allow non-global regexes");if(I)return L(a,e);if(void 0===(r=y(e,E))&&C&&"RegExp"===h(e)&&(r=_),r)return o(r,e,a)}else if(I)return L(a,e);return n=u(a),i=new RegExp(e,"g"),C?o(_,i,n):i[E](n)}}),C||E in T||v(T,E,_)},5906:function(e,t,n){var r=n(6518),o=n(9504),i=n(5397),a=n(8981),l=n(655),s=n(6198),c=o([].push),u=o([].join);r({target:"String",stat:!0},{raw:function(e){var t=i(a(e).raw),n=s(t);if(!n)return"";for(var r=arguments.length,o=[],f=0;;){if(c(o,l(t[f++])),f===n)return u(o,"");f<r&&c(o,l(arguments[f]))}}})},2762:function(e,t,n){var r=n(6518),o=n(3802).trim;r({target:"String",proto:!0,forced:n(706)("trim")},{trim:function(){return o(this)}})},8344:function(e,t,n){n(8543)},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(8130),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}()},296:function(e,t,n){n(2675),n(9463),n(2259),n(5700),n(8706),n(2008),n(113),n(3418),n(3792),n(8598),n(2062),n(4782),n(6910),n(9572),n(2010),n(6033),n(8130),n(9085),n(875),n(6099),n(8459),n(3362),n(825),n(7495),n(8781),n(9449),n(7764),n(2762),n(2953);var r=n(4907),o=n(1041),i=n(9073),a=n(4565),l=n(4160),s=n(593),c=n(1669);function u(e){return u="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},u(e)}var f=b().m(z),d=b().m(_),h=b().m(B);function p(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(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(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=v(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,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function y(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||v(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e,t){if(e){if("string"==typeof e)return g(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)?g(e,t):void 0}}function g(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 b(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return w(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,l=0,s=e,d.n=n,a}};function h(n,r){for(l=n,s=r,t=0;!f&&c&&!o&&t<u.length;t++){var o,i=u[t],h=d.p,p=i[2];n>3?(o=p===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(l=0,d.v=r,d.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,d.n=p,l=0))}if(o||n>1)return a;throw f=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),l=u,s=p;(t=l<2?e:s)||!f;){i||(l?l<3?(l>1&&(d.n=-1),h(l,s)):d.n=s:d.v=s);try{if(c=2,i){if(l||(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,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(f=d.n<0)?s:n.call(r,d))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(w(t={},r,function(){return this}),t),f=c.prototype=l.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,w(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=c,w(f,"constructor",c),w(c,"constructor",s),s.displayName="GeneratorFunction",w(c,o,"GeneratorFunction"),w(f),w(f,o,"Generator"),w(f,r,function(){return this}),w(f,"toString",function(){return"[object Generator]"}),(b=function(){return{w:i,m:d}})()}function w(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}w=function(e,t,n,r){function i(t,n){w(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))},w(e,t,n,r)}function k(e,t,n,r,o,i,a){try{var l=e[i](a),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function S(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){k(i,r,o,a,l,"next",e)}function l(e){k(i,r,o,a,l,"throw",e)}a(void 0)})}}function x(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function C(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,T(r.key),r)}}function E(e,t,n){return t&&C(e.prototype,t),n&&C(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function P(e){return P=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},P(e)}function A(e,t){return A=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},A(e,t)}function O(e,t,n){return(t=T(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function T(e){var t=function(e){if("object"!=u(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=u(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}var R=window.BookReader,M=function(e){function t(e){var n,r,o,i;return x(this,t),O((r=this,i=[e],o=P(o=t),n=function(e,t){if(t&&("object"==u(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)}(r,j()?Reflect.construct(o,i||[],P(r).constructor):o.apply(r,i))),"options",{enabled:!0,fullDjvuXmlUrl:null,singlePageDjvuXmlUrl:null,jsonp:!1,maxProtectedWords:200}),O(n,"djvuPagesPromise",null),O(n,"pageTextCache",new a.l),O(n,"maxWordRendered",2500),n.rtl="rl"===n.br.pageProgression,n.textSelectionManager=new s.bg(".BRtextLayer",n.br,{selectionElement:[".BRwordElement",".BRspace"]},n.options.maxProtectedWords),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&A(e,t)}(t,e),E(t,[{key:"init",value:function(){var e=this;this.options.enabled&&(this.br.on("pageVisible",function(t,n){var r=n.pageContainerEl;r.querySelector(".BRtextLayer")&&e.br.trigger("textLayerVisible",{pageContainerEl:r})}),this.loadData(),this.textSelectionManager.init())}},{key:"enableSelectionMenu",value:function(){this.textSelectionManager.selectionMenuEnabled=!0,this.textSelectionManager.renderSelectionMenu()}},{key:"_configurePageContainer",value:function(e){return this.br.mode!==this.br.constModeThumb&&e.page&&this.createTextLayer(e),e}},{key:"loadData",value:function(){this.options.singlePageDjvuXmlUrl||(this.djvuPagesPromise=c.ajax({type:"GET",url:(0,i.g)(this.options.fullDjvuXmlUrl,this.br.options.vars),dataType:this.options.jsonp?"jsonp":"html",cache:!0,xhrFields:{withCredentials:this.br.protected},error:function(e){}}).then(function(e){try{var t=c.parseXML(e);return t&&c(t).find("OBJECT")}catch(e){return}}))}},{key:"getPageText",value:(o=S(b().m(function e(t){var n,r,o,a,l;return b().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!this.options.singlePageDjvuXmlUrl){e.n=5;break}if(!(n=this.pageTextCache.entries.find(function(e){return e.index==t}))){e.n=1;break}return e.a(2,n.response);case 1:return e.n=2,c.ajax({type:"GET",url:(0,i.g)(this.options.singlePageDjvuXmlUrl,this.br.options.vars,{pageIndex:t}),dataType:this.options.jsonp?"jsonp":"html",cache:!0,xhrFields:{withCredentials:this.br.protected},error:function(e){}});case 2:return r=e.v,e.p=3,o=c.parseXML(r),a=o&&c(o).find("OBJECT")[0],this.pageTextCache.add({index:t,response:a}),e.a(2,a);case 4:return e.p=4,e.v,e.a(2,void 0);case 5:return e.n=6,this.djvuPagesPromise;case 6:if(!(l=e.v)){e.n=7;break}return e.a(2,l[t]);case 7:return e.a(2)}},e,this,[[3,4]])})),function(e){return o.apply(this,arguments)})},{key:"createTextLayer",value:(n=S(b().m(function e(t){var n,o,i,a,s,u,f,d,h,p,v,g,w,k,S,x,C,E,j,P,A,O,T,R,M,I=this;return b().w(function(e){for(;;)switch(e.n){case 0:if(n=t.page.index,!(o=t.$container).find(".BRtextLayer").length){e.n=1;break}return e.a(2);case 1:return e.n=2,this.getPageText(n);case 2:if(i=e.v){e.n=3;break}return e.a(2);case 3:if(c(i).find("WORD").filter(function(e,t){var n=y(t.getAttribute("coords").split(",").map(parseFloat),4),r=n[0],o=n[3];if(0==r&&0==o)return console.error("Found invalid ocr word coordinates"),!0}).remove(),N(i),!((a=c(i).find("WORD").length)>this.maxWordRendered)){e.n=4;break}return console.log("Page ".concat(n," has too many words (").concat(a," > ").concat(this.maxWordRendered,"). Not rendering text layer.")),e.a(2);case 4:return s=(0,r.Ql)(t.page,"BRtextLayer"),e.n=5,Promise.resolve();case 5:u=parseFloat(t.$container[0].style.width)/t.page.width,f=parseFloat(t.$container[0].style.height)/t.page.height,s.style.transform="scale(".concat(u,", ").concat(f,")"),(d=(0,l.YH)(this.br.options.bookLanguage))&&s.setAttribute("lang",d),s.setAttribute("dir",this.rtl?"rtl":"ltr"),h=c(i).find("PARAGRAPH[coords]").toArray(),p=h.map(function(e){var t=I.renderParagraph(e);return s.appendChild(t),t}),v=L(s,".BRparagraphElement"),g=0,w=m(B(h,p));try{for(w.s();!(k=w.n()).done;)S=y(k.value,2),x=S[0],C=S[1],E=c(x).attr("coords").split(",").map(parseFloat),j=v.get(C),P=y(E,4),A=P[0],O=P[2],T=P[3],R=this.rtl?j.right-O:A-j.left,M=T-(j.top+g),C.style[this.rtl?"marginRight":"marginLeft"]="".concat(R,"px"),C.style.marginTop="".concat(M,"px"),g+=M,s.appendChild(C),s.appendChild(document.createTextNode("\n"))}catch(e){w.e(e)}finally{w.f()}o.append(s),this.textSelectionManager.stopPageFlip(o),this.br.trigger("textLayerRendered",{pageIndex:n,pageContainer:t}),o.hasClass("BRpage-visible")&&this.br.trigger("textLayerVisible",{pageContainerEl:o[0]});case 6:return e.a(2)}},e,this)})),function(e){return n.apply(this,arguments)})},{key:"renderParagraph",value:function(e){var t=document.createElement("p");t.classList.add("BRparagraphElement"),e.getAttribute("x-role")&&(t.classList.add("ocr-role-header-footer"),t.ariaHidden="true");var n=y(c(e).attr("coords").split(",").map(parseFloat),4),r=n[0],o=n[1],i=n[2],a=n[3],l=[],s=c(e).find("LINE[coords]").toArray();if(!s.length)return t;var u,f=m(_(z(s,I)));try{for(f.s();!(u=f.n()).done;){var d=y(u.value,3),h=d[0],v=d[1],g=d[2],b=v.ocrElement==s[s.length-1],w=document.createElement("span");w.classList.add("BRlineElement");var k,S=m(v.words.entries());try{for(S.s();!(k=S.n()).done;){var x=y(k.value,2),C=x[0],E=x[1],j=y(c(E).attr("coords").split(",").map(parseFloat),4),P=j[1],A=j[2],O=j[3],T=P-O;if(l.push(T),0==C&&null!=h&&h.lastWord.textContent.trim().endsWith("-")){var R=y(c((g||h).firstWord).attr("coords").split(",").map(parseFloat),3)[0];c(E).attr("coords","".concat(R,",").concat(P,",").concat(A,",").concat(O))}var M=document.createElement("span");if(M.setAttribute("class","BRwordElement"),M.textContent=E.textContent.trim(),C>0){var N=document.createElement("span");N.classList.add("BRspace"),N.textContent=" ",N.setAttribute("aria-label"," "),w.append(N),w.appendChild(document.createTextNode(" "))}w.appendChild(M)}}catch(e){S.e(e)}finally{S.f()}var D=v.lastWord.textContent.trim().endsWith("-"),F=w.children[w.children.length-1];D&&!b&&(F.textContent=F.textContent.trim().slice(0,-1),F.classList.add("BRwordElement--hyphen")),t.appendChild(w),b||D||t.appendChild(document.createTextNode(" "))}}catch(e){f.e(e)}finally{f.f()}l.sort(function(e,t){return e-t});var W=l[Math.floor(.85*l.length)]+4;t.style.left="".concat(r,"px"),t.style.top="".concat(a,"px"),t.style.width="".concat(i-r,"px"),t.style.height="".concat(o-a,"px"),t.style.fontSize="".concat(W,"px");var G,K=L(t,".BRwordElement"),H=m(B(c(e).find("WORD").toArray(),t.querySelectorAll(".BRwordElement")));try{for(H.s();!(G=H.n()).done;){var U=y(G.value,2),q=U[0],$=U[1],X=K.get($),V=y(c(q).attr("coords").split(",").map(parseFloat),3),J=V[0],Y=V[2]-J;q.textContent.endsWith(" ")&&(Y=Y*(q.textContent.length-1)/q.textContent.length);var Z=Y-X.width;$.style.letterSpacing="".concat(Z/(q.textContent.length-1),"px")}}catch(e){H.e(e)}finally{H.f()}K=L(t,".BRwordElement");var Q,ee=L(t,".BRspace"),te=c(e).find("LINE[coords]").toArray(),ne=Array.from(t.querySelectorAll(".BRlineElement")),re=a,oe=m(B(te,ne));try{for(oe.s();!(Q=oe.n()).done;){var ie,ae=y(Q.value,2),le=ae[0],se=ae[1],ce=c(le).find("WORD").toArray(),ue=this.rtl?i:r,fe=m(B(ce,se.querySelectorAll(".BRwordElement")));try{for(fe.s();!(ie=fe.n()).done;){var de=y(ie.value,2),he=de[0],pe=de[1],me=K.get(pe),ye=y(c(he).attr("coords").split(",").map(parseFloat),3),ve=ye[0],ge=ye[2],be=this.rtl?-(ge-ue):ve-ue;if(pe.previousElementSibling){var we=pe.previousElementSibling;we.style.letterSpacing="".concat(be-ee.get(we).width,"px")}else pe.style[this.rtl?"paddingRight":"paddingLeft"]="".concat(be,"px");this.rtl?ue-=be+me.width:ue+=be+me.width}}catch(e){fe.e(e)}finally{fe.f()}var ke=Math.min.apply(Math,p(ce.map(function(e){return parseFloat(c(e).attr("coords").split(",")[3])})))-re;se.previousElementSibling&&(se.previousElementSibling.style.lineHeight="".concat(ke,"px"),re+=ke)}}catch(e){oe.e(e)}finally{oe.f()}return ne[ne.length-1].style.lineHeight="".concat(o-re,"px"),t.appendChild(document.createElement("br")),t}}]);var n,o}(o.S);function L(e,t){var n={position:e.style.position,visibility:e.style.visibility,top:e.style.top,left:e.style.left,transform:e.style.transform};e.style.position="absolute",e.style.visibility="hidden",e.style.top="0",e.style.left="0",e.style.transform="none",document.body.appendChild(e);var r=new Map(Array.from(e.querySelectorAll(t)).map(function(e){var t=e.getBoundingClientRect();return[e,new D(t.left+window.scrollX,t.top+window.scrollY,t.width,t.height)]}));return document.body.removeChild(e),Object.assign(e.style,n),r}function I(e){var t=c(e).find("WORD").toArray();return{ocrElement:e,words:t,firstWord:t[0],lastWord:t[t.length-1]}}function z(e,t){var n,r,o,i;return b().w(function(a){for(;;)switch(a.p=a.n){case 0:n=m(e),a.p=1,n.s();case 2:if((r=n.n()).done){a.n=4;break}return o=r.value,a.n=3,t(o);case 3:a.n=2;break;case 4:a.n=6;break;case 5:a.p=5,i=a.v,n.e(i);case 6:return a.p=6,n.f(),a.f(6);case 7:return a.a(2)}},f,null,[[1,5,6,7]])}function _(e){var t,n,r,o,i,a,l;return b().w(function(s){for(;;)switch(s.p=s.n){case 0:t=void 0,n=void 0,r=void 0,o=m(e),s.p=1,o.s();case 2:if((i=o.n()).done){s.n=5;break}if(a=i.value,void 0===n){s.n=3;break}return r=a,s.n=3,[t,n,r];case 3:t=n,n=a,r=void 0;case 4:s.n=2;break;case 5:s.n=7;break;case 6:s.p=6,l=s.v,o.e(l);case 7:return s.p=7,o.f(),s.f(7);case 8:if(void 0===n){s.n=9;break}return s.n=9,[t,n,r];case 9:return s.a(2)}},d,null,[[1,6,7,8]])}function B(e,t){var n,r,o,i;return b().w(function(a){for(;;)switch(a.n){case 0:n=e[Symbol.iterator](),r=t[Symbol.iterator]();case 1:if(o=n.next(),i=r.next(),!o.done||!i.done){a.n=2;break}return a.a(2);case 2:if(!o.done&&!i.done){a.n=3;break}throw new Error("zip: one of the iterators is done");case 3:return a.n=4,[o.value,i.value];case 4:a.n=1;break;case 5:return a.a(2)}},h)}function N(e){if(!c(e).attr("coords")&&e.children){var t=c(e).children().toArray();if(0!==t.length){var n,r=m(t);try{for(r.s();!(n=r.n()).done;)N(n.value)}catch(e){r.e(e)}finally{r.f()}var o,i=[],a=m(t);try{for(a.s();!(o=a.n()).done;){var l=o.value;c(l).attr("coords")&&i.push(c(l).attr("coords").split(",").map(parseFloat))}}catch(e){a.e(e)}finally{a.f()}var s=function(e){var t,n=1/0,r=-1/0,o=-1/0,i=1/0,a=m(e);try{for(a.s();!(t=a.n()).done;){var l=y(t.value,4),s=l[0],c=l[1],u=l[2],f=l[3];n=Math.min(n,s),r=Math.max(r,c),o=Math.max(o,u),i=Math.min(i,f)}}catch(e){a.e(e)}finally{a.f()}return[n,r,o,i]}(i);Math.abs(s[0])!=1/0&&c(e).attr("coords",s.join(","))}}}null==R||R.registerPlugin("textSelection",M);var D=function(){return E(function e(t,n,r,o){x(this,e),this.x=t,this.y=n,this.width=r,this.height=o},[{key:"right",get:function(){return this.x+this.width}},{key:"bottom",get:function(){return this.y+this.height}},{key:"top",get:function(){return this.y}},{key:"left",get:function(){return this.x}}])}()},4160:function(e,t,n){n.d(t,{$x:function(){return v},EF:function(){return u},ND:function(){return y},m0:function(){return f},YH:function(){return h},_4:function(){return p}}),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(1761),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 l=r;function s(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,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)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}function u(e){var t=e.match(/\S+/g);return t?t.length:0}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:navigator.userAgent;return/android/i.test(e)}var d={"zh-hans":"中文 (Zhōngwén)"};function h(e){if(!e)return null;if(e=e.toLocaleLowerCase(),d[e])return e;var t=m(e,["iso639_1"])||m(e,["iso639_2T"])||m(e,["iso639_2B","name","nativeName"]);return t?t.iso639_1:null}function p(e){if(!e)return null;if(e=e.toLocaleLowerCase(),d[e])return d[e];var t=m(e,["iso639_1"])||m(e,["iso639_2T"])||m(e,["iso639_2B","name","nativeName"]);return null!=t&&t.nativeName?t.nativeName.split(", ")[0]:null}function m(e,t){if(!e)return null;e=e.toLowerCase();var n,r=s(l);try{for(r.s();!(n=r.n()).done;){var o,i=n.value,a=s(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 y(){try{return!!window.localStorage}catch(e){return!1}}var v=-1!=location.toString().indexOf("_debugReadAloud=true")},593:function(e,t,n){n.d(t,{bg:function(){return G}}),n(5700),n(2675),n(9463),n(2259),n(8125),n(8706),n(113),n(3418),n(4423),n(3792),n(8598),n(2062),n(4782),n(4554),n(9572),n(4731),n(479),n(8130),n(2010),n(9085),n(2811),n(875),n(6099),n(3362),n(825),n(4864),n(7495),n(8781),n(1699),n(7764),n(1761),n(5906),n(5440),n(744),n(2762),n(8344),n(3500),n(2953);var r=n(1669);function o(e){return o="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},o(e)}function i(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,l(r.key),r)}}function a(e,t,n){return(t=l(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e){var t=function(e){if("object"!=o(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==o(t)?t:t+""}var s,c,u,f,d,h=function(){return e=function e(t,n){var o=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),a(this,"selecting",!1),a(this,"startedInSelector",!1),a(this,"target",null),a(this,"lastKnownFocusNode",null),a(this,"_onSelectionChange",function(){var e=window.getSelection();if(!o.selecting&&e.toString()){var t=r(e.anchorNode).closest(o.selector)[0];if(!t)return;o.target=t,o.selecting=!0,o.lastKnownFocusNode=e.focusNode,o.handler("started",o.target)}o.selecting&&(o.lastKnownFocusNode!=e.focusNode||e.toString()&&!e.isCollapsed)&&(o.lastKnownFocusNode=e.focusNode,o.handler("focusChanged",o.target)),!o.selecting||!e.isCollapsed&&e.toString()&&r(e.anchorNode).closest(o.selector)[0]||(o.selecting=!1,o.handler("cleared",o.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)}}])&&i(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),p=n(420),m=n(9696),y=(n(90),n(1669));function v(e){return v="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},v(e)}function g(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(g=function(){return!!e})()}function b(e){return b=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},b(e)}function w(e,t){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},w(e,t)}function k(){k=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(!C(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 l=this.fromElementDescriptor(e),s=this.toElementFinisherExtras((0,o[i])(l)||l);e=s.element,this.addElementPlacement(e,t),s.finisher&&r.push(s.finisher);var c=s.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 l=a+1;l<e.length;l++)if(e[a].key===e[l].key&&e[a].placement===e[l].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)||I(t)||L(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=W(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:j(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=j(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 S(e){var t,n=W(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 x(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function C(e){return e.decorators&&e.decorators.length}function E(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function j(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 P(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(v(e)+" is not iterable")}function A(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var s=r&&r.prototype instanceof l?r:l,c=Object.create(s.prototype);return O(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,l=0,s=e,d.n=n,a}};function h(n,r){for(l=n,s=r,t=0;!f&&c&&!o&&t<u.length;t++){var o,i=u[t],h=d.p,p=i[2];n>3?(o=p===r)&&(s=i[(l=i[4])?5:(l=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(l=0,d.v=r,d.n=i[1]):h<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,d.n=p,l=0))}if(o||n>1)return a;throw f=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(f&&1===u&&h(u,p),l=u,s=p;(t=l<2?e:s)||!f;){i||(l?l<3?(l>1&&(d.n=-1),h(l,s)):d.n=s:d.v=s);try{if(c=2,i){if(l||(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,l<2&&(l=0)}else 1===l&&(t=i.return)&&t.call(i),l<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),l=1);i=e}else if((t=(f=d.n<0)?s:n.call(r,d))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:f}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(O(t={},r,function(){return this}),t),f=c.prototype=l.prototype=Object.create(u);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,O(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=c,O(f,"constructor",c),O(c,"constructor",s),s.displayName="GeneratorFunction",O(c,o,"GeneratorFunction"),O(f),O(f,o,"Generator"),O(f,r,function(){return this}),O(f,"toString",function(){return"[object Generator]"}),(A=function(){return{w:i,m:d}})()}function O(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}O=function(e,t,n,r){function i(t,n){O(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))},O(e,t,n,r)}var T=A().m(H),R=A().m(U);function M(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=L(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,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){l=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(l)throw i}}}}function L(e,t){if(e){if("string"==typeof e)return z(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)?z(e,t):void 0}}function I(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function z(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 _(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function N(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,W(r.key),r)}}function D(e,t,n){return t&&N(e.prototype,t),n&&N(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function F(e,t,n){return(t=W(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W(e){var t=function(e){if("object"!=v(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=v(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==v(t)?t:t+""}var G=function(){return D(function e(t,n,r,o){var i=this,a=r.selectionElement;B(this,e),F(this,"options",{maxProtectedWords:200}),F(this,"selectMenu",void 0),F(this,"selectionMenuEnabled",!1),F(this,"_onSelectionChange",function(e,t){if("started"===e)i.textSelectingMode(t);else if("cleared"===e)i.defaultMode(t);else if("focusChanged"!==e)throw new Error("Unknown type ".concat(e))}),F(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=function(e,t){var n,r=0,o=M(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()}}(H(U(t.startContainer,t.endContainer),function(e){var t;return null===(t=e.classList)||void 0===t?void 0:t.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 h(this.layer,this._onSelectionChange),this.options.maxProtectedWords=o||200,this.selectMenu=new Z(n),this.selectMenu.className="br-select-menu__root"},[{key:"init",value:function(){var e=this;this.attach(),new h(this.layer,function(t){var n;"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"),y(window.getSelection().anchorNode).closest(".BRpagecontainer").addClass("BRpagecontainer--hasSelection"),e.selectMenu.showMenu()),"focusChanged"==t&&(e.mouseIsDown?e.selectMenu.hideMenu():window.getSelection().toString()&&e.selectMenu.showMenu()),"cleared"==t&&e.selectMenu.hideMenu()}).attach()}},{key:"attach",value:function(){var e=this;this.selectionObserver.attach(),this.selectionMenuEnabled&&this.renderSelectionMenu(),this.br.protected&&(document.addEventListener("selectionchange",this._limitSelection),y(document.body).on("contextmenu dragstart copy",function(t){var n=document.getSelection();if(null!=n&&n.toString()&&y(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:"renderSelectionMenu",value:function(){document.querySelector(".br-select-menu__option")||document.body.append(this.selectMenu)}},{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=y(e).closest(".BRpagecontainer");e.style.pointerEvents="none",n.find("img").css("pointer-events","auto"),y(e).off(".textSelectPluginHandler");var r=this.mouseIsDown,o=this.mouseIsDown;r&&(e.style.pointerEvents="auto"),y(e).on("mousedown.textSelectPluginHandler",function(e){t.mouseIsDown=!0,t.selectMenu.hideMenu(),y(e.target).is(t.selectionElement.join(", "))&&e.stopPropagation()}),y(e).on("mouseup.textSelectPluginHandler",function(n){t.mouseIsDown=!1,t.selectMenu.hideMenu(),e.style.pointerEvents="none",o&&(o=!1,n.stopPropagation())})}},{key:"textSelectingMode",value:function(e){var t=this,n=y(e).closest(".BRpagecontainer");e.style.pointerEvents="all",n.find("img").css("pointer-events","none"),y(e).off(".textSelectPluginHandler"),y(e).on("mousedown.textSelectPluginHandler",function(e){1==e.which&&(t.mouseIsDown=!0,e.stopPropagation(),t.selectMenu.hideMenu())}),y(e).on("mouseup.textSelectPluginHandler",function(e){t.mouseIsDown=!1,1==e.which&&(e.stopPropagation(),t.selectMenu.showMenu())})}}])}();function K(e,t){var n=e.toString().replace(/[\s]+/g," ").trim().split(" "),r=e.direction,o="backward"==r?e.focusNode:e.anchorNode,i="backward"==r?e.anchorNode:e.focusNode,a=o.textContent.replace(/[\s]+/g,"")?o.textContent:n[0],l=i.textContent.replace(/[\s]+/g,"")?i.textContent:n[n.length-1],u=RegExp.escape(a),h=RegExp.escape(l),p=new RegExp(String.raw(s||(s=_(["(?<=(",").*?)(",")"])),u,h),"gis"),m=new RegExp(String.raw(c||(c=_(["(",")(?=.*?(","))"])),u,h),"gis"),y=t.map(function(e){return e.textContent}).join(" ").replace(/\s+/g," "),v=y.matchAll(p).toArray(),g=y.matchAll(m).toArray();if(1==v.length&&1==g.length)return"text=".concat(encodeURIComponent(a),",").concat(encodeURIComponent(l));var b=document.createRange();b.setStart(t[0].firstElementChild,0),b.setEnd(o,0);var w=document.createRange();w.setStart(i,i.textContent.length);var k=function(e){for(;e.lastElementChild;)e=e.lastElementChild;return e}(t[t.length-1]);w.setEnd(k,Math.max(0,k.textContent.length-1));var S=function(e,t){t=t.trim();var n=new RegExp(String.raw(d||(d=_(["((^|s+)S+){1,","}s*?$"],["((^|\\s+)\\S+){1,","}\\s*?$"])),3)),r=t.match(n);return r?r[0].trim():""}(0,b.toString()).replace(/[ ]+/g," ").trim().replace(/^[^\n]*\n/gm,""),x=function(e,t){t=t.trim();var n=new RegExp(String.raw(f||(f=_(["^(S+(s+|$)){1,","}"],["^(\\S+(\\s+|$)){1,","}"])),3)),r=t.match(n);return r?r[0].trim():""}(0,w.toString()).replace(/[ ]+/g," ").trim().replace(/\n[^\n]*$/gm,""),C=e.toString().replace(/\s+/g," ").trim().split(/\s/g);0!=o.textContent.trim().length&&(o.textContent.includes(C[0])?C[0]=o.textContent:C.unshift(o.textContent)),0!=i.textContent.trim().length&&(i.textContent.includes(C[C.length-1])||C.push(i.textContent),C[C.length-1]=i.textContent);var E=[C.join(" ")];C.length>6&&(E=[C.slice(0,3).join(" "),C.slice(-3).join(" ")]);var j,P=[];return S&&P.push("".concat(S,"-")),P.push.apply(P,function(e){if(Array.isArray(e))return z(e)}(j=E)||I(j)||L(j)||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.")}()),x&&P.push("-".concat(x)),"text=".concat(P.map(encodeURIComponent).join(","))}function H(e,t){var n,r,o,i;return A().w(function(a){for(;;)switch(a.p=a.n){case 0:n=M(e),a.p=1,n.s();case 2:if((r=n.n()).done){a.n=4;break}if(o=r.value,!t(o)){a.n=3;break}return a.n=3,o;case 3:a.n=2;break;case 4:a.n=6;break;case 5:a.p=5,i=a.v,n.e(i);case 6:return a.p=6,n.f(),a.f(6);case 7:return a.a(2)}},T,null,[[1,5,6,7]])}function U(e,t){var n,r;return A().w(function(o){for(;;)switch(o.n){case 0:return r=function(e){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.children,a=void 0===i||i,l=o.parents,s=void 0===l||l,c=o.siblings,u=void 0===c||c;return A().m(function o(){var i;return A().w(function(o){for(;;)switch(o.n){case 0:if(e!==t){o.n=2;break}return n=!0,o.n=1,e;case 1:return o.a(2);case 2:return o.n=3,e;case 3:if(!a||!e.firstChild){o.n=5;break}return o.d(P(r(e.firstChild,{children:!0,parents:!1,siblings:!0})),4);case 4:if(!n){o.n=5;break}return o.a(2);case 5:if(!u){o.n=9;break}i=e.nextSibling;case 6:if(!i){o.n=9;break}return o.d(P(r(i,{children:!0,parents:!1,siblings:!1})),7);case 7:if(!n){o.n=8;break}return o.a(2);case 8:i=i.nextSibling,o.n=6;break;case 9:if(!s||!e.parentNode){o.n=11;break}return o.d(P(r(e.parentNode,{children:!1,parents:!0,siblings:!0})),10);case 10:if(!n){o.n=11;break}return o.a(2);case 11:return o.a(2)}},o)})()},n=!1,o.d(P(r(e)),1);case 1:return o.a(2)}},R)}var q,$,X,V,J,Y,Z=(q=[(0,m.EM)("br-select-menu")],$=p.WF,V=k(),X=function(e){V.initializeInstanceElements(e,Y.elements)},J={F:function(e){function t(e){var n;return B(this,t),n=function(e,t,n){return t=b(t),function(e,t){if(t&&("object"==v(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,g()?Reflect.construct(t,n||[],b(e).constructor):t.apply(e,n))}(this,t),X(n),n.br=e,n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&w(e,t)}(t,e),D(t)}($),d:[{kind:"field",key:"br",value:void 0},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"render",value:function(){return(0,p.qy)(u||(u=_(["\n <button @click=",' class="br-select-menu__option">\n <ia-icon-share class="br-select-menu__icon" aria-hidden="true"></ia-icon-share>\n <span class="br-select-menu__label">Copy Link to Highlight</span>\n </button>\n '])),this.handleCopyLinkToHighlight)}},{kind:"method",key:"handleCopyLinkToHighlight",value:function(e){e.preventDefault();var t=this.br.readQueryString(),n=window.getSelection(),r=n.anchorNode.parentElement.closest(".BRtextLayer"),o=K(n,Array.from(document.querySelectorAll(".BRpage-visible"))),i=t;t.includes("text=")?i=t.replace(/(text=)[\w\W\d%]+/,o):i+="".concat(i?"&":"?").concat(o);var a=window.location,l=a.pathname.toString().replace(/(?<=\/page\/)\d+(?=\/)/,r.parentElement.getAttribute("data-page-num")),s="".concat(a.origin).concat(l).concat(i).concat((null==a?void 0:a.hash)||"");navigator.clipboard.writeText(s)}},{kind:"method",key:"showMenu",value:function(){var e;if(null===(e=this.br.plugins.translate)||void 0===e||!e.userToggleTranslate){var t=window.getSelection(),n=t.anchorNode.parentElement,r=t.focusNode.parentElement,o=n.getBoundingClientRect(),i=r.getBoundingClientRect(),a=o.top-30,l=o.left-60;"backward"==t.direction&&(a=i.top-30,l=i.left-60),this.style.top="".concat(a,"px"),this.style.left="".concat(l,"px"),this.style.zIndex="1",this.style.position="absolute",this.style.display="block"}}},{kind:"field",key:"hideMenu",value:function(){var e=this;return function(){e.style.display="none"}}}]},Y=V.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(E(i.descriptor)||E(o.descriptor)){if(C(i)||C(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(C(i)){if(C(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}x(i,o)}else t.push(i)}return t}(J.d.map(S)),q),V.initializeClassElements(J.F,Y.elements),V.runClassFinishers(J.F,Y.finishers))},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(8130),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}()},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,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i;return null==e?void 0:e.replace(/\{\{([^}]*?)\}\}/g,function(e,i){if(!i)return e;var a,l=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.")}(),s=l[0],c=r(l).slice(1);if(!(s in n)&&!(s in t))return e;var u=s in n?n[s]:s in t?t[s]:null;return c.map(function(e){return o[e]}).reduce(function(e,t){return t(e)},u&&u.toString())})}n.d(t,{g: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(5440),n(2762),n(2953);var i={urlencode:encodeURIComponent}}},function(e){e(e.s=296)}]);
3
25
  //# sourceMappingURL=plugin.text_selection.js.map