@internetarchive/bookreader 5.0.0-116 → 5.0.0-117

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 (36) hide show
  1. package/BookReader/BookReader.css +44 -18
  2. package/BookReader/BookReader.js +1 -1
  3. package/BookReader/BookReader.js.map +1 -1
  4. package/BookReader/ia-bookreader-bundle.js +74 -74
  5. package/BookReader/ia-bookreader-bundle.js.map +1 -1
  6. package/BookReader/plugins/plugin.archive_analytics.js +1 -1
  7. package/BookReader/plugins/plugin.autoplay.js +1 -1
  8. package/BookReader/plugins/plugin.autoplay.js.map +1 -1
  9. package/BookReader/plugins/plugin.chapters.js +2 -2
  10. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  11. package/BookReader/plugins/plugin.experiments.js +1 -1
  12. package/BookReader/plugins/plugin.experiments.js.map +1 -1
  13. package/BookReader/plugins/plugin.iframe.js +1 -1
  14. package/BookReader/plugins/plugin.iframe.js.map +1 -1
  15. package/BookReader/plugins/plugin.iiif.js +1 -1
  16. package/BookReader/plugins/plugin.resume.js +1 -1
  17. package/BookReader/plugins/plugin.search.js +1 -1
  18. package/BookReader/plugins/plugin.search.js.map +1 -1
  19. package/BookReader/plugins/plugin.text_selection.js +22 -2
  20. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  21. package/BookReader/plugins/plugin.translate.js +23 -3
  22. package/BookReader/plugins/plugin.translate.js.map +1 -1
  23. package/BookReader/plugins/plugin.tts.js +1 -1
  24. package/BookReader/plugins/plugin.tts.js.map +1 -1
  25. package/BookReader/plugins/plugin.url.js +1 -1
  26. package/README.md +3 -1
  27. package/package.json +33 -29
  28. package/src/BookReader.js +16 -0
  29. package/src/css/_TextSelection.scss +51 -18
  30. package/src/plugins/plugin.chapters.js +8 -4
  31. package/src/plugins/plugin.iframe.js +36 -37
  32. package/src/plugins/plugin.text_selection.js +36 -11
  33. package/src/plugins/search/plugin.search.js +2 -8
  34. package/src/plugins/tts/plugin.tts.js +3 -8
  35. package/src/util/TextSelectionManager.js +53 -8
  36. package/src/util/dom.js +88 -0
@@ -19,7 +19,27 @@
19
19
  .stroke-color {
20
20
  stroke: var(--iconStrokeColor);
21
21
  }
22
- `}render(){return o}}customElements.define("ia-icon-edit-pencil",i)},90:function(e,t,n){var r=n(420),o=r.qy`
22
+ `}render(){return o}}customElements.define("ia-icon-edit-pencil",i)},6090:function(e,t,n){var r=n(420),o=r.qy`
23
+ <svg
24
+ viewBox="0 0 40 40"
25
+ xmlns="http://www.w3.org/2000/svg"
26
+ >
27
+ <path class="fill-color" d="m10.5 17.5c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5c-1.38071187 0-2.5-1.1192881-2.5-2.5s1.11928813-2.5 2.5-2.5zm9.5 0c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5-2.5-1.1192881-2.5-2.5 1.1192881-2.5 2.5-2.5zm9.5 0c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5-2.5-1.1192881-2.5-2.5 1.1192881-2.5 2.5-2.5z" fill-rule="evenodd"/>
28
+ </svg>
29
+ `;class i extends r.WF{static get styles(){return r.AH`
30
+ :host {
31
+ width: var(--iconWidth, 'auto');
32
+ height: var(--iconHeight, 'auto');
33
+ }
34
+
35
+ .fill-color {
36
+ fill: var(--iconFillColor);
37
+ }
38
+
39
+ .stroke-color {
40
+ stroke: var(--iconStrokeColor);
41
+ }
42
+ `}render(){return o}}customElements.define("ia-icon-ellipses",i)},90:function(e,t,n){var r=n(420),o=r.qy`
23
43
  <svg
24
44
  viewBox="0 0 100 100"
25
45
  xmlns="http://www.w3.org/2000/svg"
@@ -41,5 +61,5 @@
41
61
  .stroke-color {
42
62
  stroke: var(--iconStrokeColor);
43
63
  }
44
- `}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})}},9479:function(e,t,n){var r=n(3724),o=n(2106),i=n(5213),a=n(7979);r&&!i.correct&&(o(RegExp.prototype,"flags",{configurable:!0,get:a}),i.correct=!0)},8543:function(e,t,n){var r=n(6518),o=n(9565),i=n(7476),a=n(3994),l=n(2529),s=n(7750),u=n(8014),c=n(655),f=n(8551),d=n(34),h=n(2195),p=n(788),m=n(1034),g=n(5966),v=n(6840),y=n(9039),b=n(8227),k=n(2293),w=n(7829),S=n(6682),x=n(1181),E=n(6395),C=b("matchAll"),T="RegExp String",j=T+" Iterator",O=x.set,R=x.getterFor(j),A=RegExp.prototype,P=TypeError,L=i("".indexOf),I=i("".matchAll),_=!!I&&!y(function(){I("a",/./)}),N=a(function(e,t,n,r){O(this,{type:j,regexp:e,string:t,global:n,unicode:r,done:!1})},T,function(){var e=R(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?(""===c(r[0])&&(t.lastIndex=w(n,u(t.lastIndex),e.unicode)),l(r,!1)):(e.done=!0,l(r,!1))}),B=function(e){var t,n,r,o=f(this),i=c(e),a=k(o,RegExp),l=c(m(o));return t=new a(a===RegExp?o.source:o,l),n=!!~L(l,"g"),r=!!~L(l,"u")||!!~L(l,"v"),t.lastIndex=u(o.lastIndex),new N(t,i,n,r)};r({target:"String",proto:!0,forced:_},{matchAll:function(e){var t,n,r,i,a=s(this);if(d(e)){if(p(e)&&(t=c(s(m(e))),!~L(t,"g")))throw new P("`.matchAll` does not allow non-global regexes");if(_)return I(a,e);if(void 0===(r=g(e,C))&&E&&"RegExp"===h(e)&&(r=B),r)return o(r,e,a)}else if(_)return I(a,e);return n=c(a),i=new RegExp(e,"g"),E?o(B,i,n):i[C](n)}}),E||C in A||v(A,C,B)},5906:function(e,t,n){var r=n(6518),o=n(9504),i=n(5397),a=n(8981),l=n(655),s=n(6198),u=o([].push),c=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(u(o,l(t[f++])),f===n)return c(o,"");f<r&&u(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)},4535:function(e,t,n){n.d(t,{J:function(){return o}});var r=n(6681),o=function(e){return null!=e?e:r.s6}},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(5746),n(2762),n(2953),n(8408);var r=n(4907),o=n(1041),i=n(9073),a=n(4565),l=n(4160),s=n(593),u=n(1989),c=n(1669);function f(e){return f="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},f(e)}function d(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 h(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,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 p(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,u=!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){u=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}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 v(){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,u=Object.create(s.prototype);return y(u,"_invoke",function(n,r,o){var i,l,s,u=0,c=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&&u&&!o&&t<c.length;t++){var o,i=c[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,c,p){if(u>1)throw TypeError("Generator is already running");for(f&&1===c&&h(c,p),l=c,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(u=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{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function l(){}function s(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(y(t={},r,function(){return this}),t),f=u.prototype=l.prototype=Object.create(c);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,y(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=u,y(f,"constructor",u),y(u,"constructor",s),s.displayName="GeneratorFunction",y(u,o,"GeneratorFunction"),y(f),y(f,o,"Generator"),y(f,r,function(){return this}),y(f,"toString",function(){return"[object Generator]"}),(v=function(){return{w:i,m:d}})()}function y(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}y=function(e,t,n,r){function i(t,n){y(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))},y(e,t,n,r)}function b(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 k(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){b(i,r,o,a,l,"next",e)}function l(e){b(i,r,o,a,l,"throw",e)}a(void 0)})}}function w(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function S(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 x(e,t,n){return t&&S(e.prototype,t),n&&S(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}function C(e){return C=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},C(e)}function T(e,t){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},T(e,t)}function j(e,t,n){return(t=O(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function O(e){var t=function(e){if("object"!=f(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==f(t)?t:t+""}var R=window.BookReader,A=function(e){function t(e){var n,r,o,i;return w(this,t),j((r=this,i=[e],o=C(o=t),n=function(e,t){if(t&&("object"==f(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,E()?Reflect.construct(o,i||[],C(r).constructor):o.apply(r,i))),"options",{enabled:!0,fullDjvuXmlUrl:null,singlePageDjvuXmlUrl:null,jsonp:!1,maxProtectedWords:200}),j(n,"djvuPagesPromise",null),j(n,"pageTextCache",new a.l),j(n,"maxWordRendered",2500),j(n,"_jumpedToHighlight",!1),n.rtl="rl"===n.br.pageProgression,n.textSelectionManager=new s.bg(".BRtextLayer",n.br,{selectionElement:[".BRwordElement",".BRspace","mark"]},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&&T(e,t)}(t,e),x(t,[{key:"init",value:function(){var e=this;if(this.options.enabled){this.br.on("pageVisible",function(t,n){var r=n.pageContainerEl,o=r.querySelector(".BRtextLayer");o&&e.br.trigger("textLayerVisible",{pageContainerEl:r,textLayer:o})}),this.loadData(),this.textSelectionManager.init();var t=new URLSearchParams(location.search).get("text");if(t){this.targetTextFragment=s.yc.fromString(t,this.br.book,this.br.firstIndex);var n=this.targetTextFragment;this.br.on("textLayerVisible",function(){var t=k(v().m(function t(r,o){var i,a,l;return v().w(function(t){for(;;)switch(t.n){case 0:i=o.pageContainerEl,a=o.textLayer,n.pageIndex===parseFloat(i.getAttribute("data-index"))&&(l=(0,s.lB)(a,n,"BRhighlight--target-text"),e._jumpedToHighlight||(l[0].scrollIntoView({behavior:"smooth",block:"center"}),e._jumpedToHighlight=!0));case 1:return t.a(2)}},t)}));return function(e,n){return t.apply(this,arguments)}}())}}}},{key:"_configurePageContainer",value:function(e){var t;return this.br.mode!==this.br.constModeThumb&&null!==(t=e.page)&&void 0!==t&&t.isViewable&&this.createTextLayer(e),e}},{key:"loadData",value:function(){this.options.singlePageDjvuXmlUrl||(this.djvuPagesPromise=c.ajax({type:"GET",url:(0,i.gT)(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=k(v().m(function e(t){var n,r,o,a,l;return v().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.gT)(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=k(v().m(function e(t){var n,o,i,a,s,f,d,m,g,y,b,k,w,S,x,E,C,T,j,O,R,A,L,_,N,B=this;return v().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=p(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(),I(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:f=parseFloat(t.$container[0].style.width)/t.page.width,d=parseFloat(t.$container[0].style.height)/t.page.height,s.style.transform="scale(".concat(f,", ").concat(d,")"),(m=(0,l.YH)(this.br.options.bookLanguage))&&s.setAttribute("lang",m),s.setAttribute("dir",this.rtl?"rtl":"ltr"),g=c(i).find("PARAGRAPH[coords]").toArray(),y=g.map(function(e){var t=B.renderParagraph(e);return s.appendChild(t),t}),b=P(s,".BRparagraphElement"),k=0,w=h((0,u.yU)(g,y));try{for(w.s();!(S=w.n()).done;)x=p(S.value,2),E=x[0],C=x[1],T=c(E).attr("coords").split(",").map(parseFloat),j=b.get(C),O=p(T,4),R=O[0],A=O[2],L=O[3],_=this.rtl?j.right-A:R-j.left,N=L-(j.top+k),C.style[this.rtl?"marginRight":"marginLeft"]="".concat(_,"px"),C.style.marginTop="".concat(N,"px"),k+=N,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],textLayer:s});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=p(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 f,m=h((0,u.pp)((0,u.Px)(s,L)));try{for(m.s();!(f=m.n()).done;){var g=p(f.value,3),v=g[0],y=g[1],b=g[2],k=y.ocrElement==s[s.length-1],w=document.createElement("span");w.classList.add("BRlineElement");var S,x=h(y.words.entries());try{for(x.s();!(S=x.n()).done;){var E=p(S.value,2),C=E[0],T=E[1],j=p(c(T).attr("coords").split(",").map(parseFloat),4),O=j[1],R=j[2],A=j[3],I=O-A;if(l.push(I),0==C&&null!=v&&v.lastWord.textContent.trim().endsWith("-")){var _=p(c((b||v).firstWord).attr("coords").split(",").map(parseFloat),3)[0];c(T).attr("coords","".concat(_,",").concat(O,",").concat(R,",").concat(A))}var N=document.createElement("span");if(N.setAttribute("class","BRwordElement"),N.textContent=T.textContent.trim(),C>0){var B=document.createElement("span");B.classList.add("BRspace"),B.textContent=" ",B.setAttribute("aria-label"," "),w.append(B),w.appendChild(document.createTextNode(" "))}w.appendChild(N)}}catch(e){x.e(e)}finally{x.f()}var F=y.lastWord.textContent.trim().endsWith("-"),M=w.children[w.children.length-1];F&&!k&&(M.textContent=M.textContent.trim().slice(0,-1),M.classList.add("BRwordElement--hyphen")),t.appendChild(w),k||F||t.appendChild(document.createTextNode(" "))}}catch(e){m.e(e)}finally{m.f()}l.sort(function(e,t){return e-t});var z=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(z,"px");var D,q=P(t,".BRwordElement"),H=c(e).find("WORD").toArray(),U=t.querySelectorAll(".BRwordElement"),W=h((0,u.yU)(H,U));try{for(W.s();!(D=W.n()).done;){var G=p(D.value,2),K=G[0],X=G[1],V=q.get(X),$=p(c(K).attr("coords").split(",").map(parseFloat),3),J=$[0],Z=$[2]-J;K.textContent.endsWith(" ")&&(Z=Z*(K.textContent.length-1)/K.textContent.length);var Y=Z-V.width;X.style.letterSpacing="".concat(Y/(K.textContent.length-1),"px")}}catch(e){W.e(e)}finally{W.f()}q=P(t,".BRwordElement");var Q,ee=P(t,".BRspace"),te=c(e).find("LINE[coords]").toArray(),ne=Array.from(t.querySelectorAll(".BRlineElement")),re=a,oe=h((0,u.yU)(te,ne));try{for(oe.s();!(Q=oe.n()).done;){var ie,ae=p(Q.value,2),le=ae[0],se=ae[1],ue=c(le).find("WORD").toArray(),ce=this.rtl?i:r,fe=h((0,u.yU)(ue,se.querySelectorAll(".BRwordElement")));try{for(fe.s();!(ie=fe.n()).done;){var de=p(ie.value,2),he=de[0],pe=de[1],me=q.get(pe),ge=p(c(he).attr("coords").split(",").map(parseFloat),3),ve=ge[0],ye=ge[2],be=this.rtl?-(ye-ce):ve-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+me.width:ce+=be+me.width}}catch(e){fe.e(e)}finally{fe.f()}var we=Math.min.apply(Math,d(ue.map(function(e){return parseFloat(c(e).attr("coords").split(",")[3])})))-re;se.previousElementSibling&&(se.previousElementSibling.style.lineHeight="".concat(we,"px"),re+=we)}}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 P(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 _(t.left+window.scrollX,t.top+window.scrollY,t.width,t.height)]}));return document.body.removeChild(e),Object.assign(e.style,n),r}function L(e){var t=c(e).find("WORD").toArray();return{ocrElement:e,words:t,firstWord:t[0],lastWord:t[t.length-1]}}function I(e){if(!c(e).attr("coords")&&e.children){var t=c(e).children().toArray();if(0!==t.length){var n,r=h(t);try{for(r.s();!(n=r.n()).done;)I(n.value)}catch(e){r.e(e)}finally{r.f()}var o,i=[],a=h(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=h(e);try{for(a.s();!(t=a.n()).done;){var l=p(t.value,4),s=l[0],u=l[1],c=l[2],f=l[3];n=Math.min(n,s),r=Math.max(r,u),o=Math.max(o,c),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",A);var _=function(){return x(function e(t,n,r,o){w(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 m},ND:function(){return p},YH:function(){return f},_4:function(){return d}}),n(2675),n(9463),n(2259),n(3418),n(4423),n(3792),n(4782),n(2010),n(875),n(6099),n(3362),n(7495),n(8781),n(1699),n(7764),n(2953);var r=[],o={},i={},a={};[["Serbian","српски језик","sr","srp","srp"],["Romanian, Moldavian, Moldovan","Română","ro","ron","rum"],["Sichuan Yi, Nuosu","ꆈꌠ꒿ Nuosuhxop","ii","iii","iii"],["Tahitian","Reo Tahiti","ty","tah","tah"],["Tagalog","Wikang Tagalog","tl","tgl","tgl"],["Yiddish","ייִדיש","yi","yid","yid"],["Akan","Akan","ak","aka","aka"],["Malay","Bahasa Melayu, بهاس ملايو","ms","msa","may"],["Arabic","العربية","ar","ara","ara"],["Norwegian","Norsk","no","nor","nor"],["Ojibwa","ᐊᓂᔑᓈᐯᒧᐎᓐ","oj","oji","oji"],["Fulah","Fulfulde, Pulaar, Pular","ff","ful","ful"],["Persian","فارسی","fa","fas","per"],["Albanian","Shqip","sq","sqi","alb"],["Aymara","aymar aru","ay","aym","aym"],["Azerbaijani","azərbaycan dili","az","aze","aze"],["Chinese","中文 (Zhōngwén), 汉语, 漢語","zh","zho","chi"],["Cree","ᓀᐦᐃᔭᐍᐏᐣ","cr","cre","cre"],["Estonian","eesti, eesti keel","et","est","est"],["Guaraní","Avañe'ẽ","gn","grn","grn"],["Inupiaq","Iñupiaq, Iñupiatun","ik","ipk","ipk"],["Inuktitut","ᐃᓄᒃᑎᑐᑦ","iu","iku","iku"],["Kanuri","Kanuri","kr","kau","kau"],["Komi","коми кыв","kv","kom","kom"],["Kongo","Kikongo","kg","kon","kon"],["Kurdish","Kurdî, أۇزبېك","ku","kur","kur"],["Latvian","latviešu valoda","lv","lav","lav"],["Malagasy","fiteny malagasy","mg","mlg","mlg"],["Mongolian","Монгол хэл","mn","mon","mon"],["Oromo","Afaan Oromoo","om","orm","orm"],["Pashto, Pushto","پښتو","ps","pus","pus"],["Quechua","Runa Simi, Kichwa","qu","que","que"],["Sardinian","sardu","sc","srd","srd"],["Swahili","Kiswahili","sw","swa","swa"],["Uzbek","Oʻzbek, Ўзбек, ","uz","uzb","uzb"],["Zhuang, Chuang","Saɯ cueŋƅ, Saw cuengh","za","zha","zha"],["Bislama","Bislama","bi","bis","bis"],["Norwegian Bokmål","Norsk Bokmål","nb","nob","nob"],["Norwegian Nynorsk","Norsk Nynorsk","nn","nno","nno"],["Indonesian","Bahasa Indonesia","id","ind","ind"],["Twi","Twi","tw","twi","twi"],["Esperanto","Esperanto","eo","epo","epo"],["Interlingua","Interlingua","ia","ina","ina"],["Interlingue","Originally called Occidental; then Interlingue after WWII","ie","ile","ile"],["Ido","Ido","io","ido","ido"],["Volapük","Volapük","vo","vol","vol"],["Bihari languages","भोजपुरी","bh","bih","bih"],["Hebrew (modern)","עברית","he","heb","heb"],["Sanskrit","संस्कृतम्","sa","san","san"],["Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian","ѩзыкъ словѣньскъ","cu","chu","chu"],["Pali","पाऴि","pi","pli","pli"],["Avestan","avesta","ae","ave","ave"],["Latin","latine, lingua latina","la","lat","lat"],["Armenian","Հայերեն","hy","hye","arm"],["Swati","SiSwati","ss","ssw","ssw"],["Tibetan","བོད་ཡིག","bo","bod","tib"],["South Ndebele","isiNdebele","nr","nbl","nbl"],["Slovene","Slovenski Jezik, Slovenščina","sl","slv","slv"],["Oriya","ଓଡ଼ିଆ","or","ori","ori"],["North Ndebele","isiNdebele","nd","nde","nde"],["Nauru","Dorerin Naoero","na","nau","nau"],["Maori","te reo Māori","mi","mri","mao"],["Marathi","मराठी","mr","mar","mar"],["Luba-Katanga","Kiluba","lu","lub","lub"],["Rundi","Ikirundi","rn","run","run"],["Central Khmer","ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ","km","khm","khm"],["Western Frisian","Frysk","fy","fry","fry"],["Bengali","বাংলা","bn","ben","ben"],["Avaric","авар мацӀ, магӀарул мацӀ","av","ava","ava"],["Abkhazian","аҧсуа бызшәа, аҧсшәа","ab","abk","abk"],["Afar","Afaraf","aa","aar","aar"],["Afrikaans","Afrikaans","af","afr","afr"],["Amharic","አማርኛ","am","amh","amh"],["Aragonese","aragonés","an","arg","arg"],["Assamese","অসমীয়া","as","asm","asm"],["Bambara","bamanankan","bm","bam","bam"],["Bashkir","башҡорт теле","ba","bak","bak"],["Basque","euskara, euskera","eu","eus","baq"],["Belarusian","беларуская мова","be","bel","bel"],["Bosnian","bosanski jezik","bs","bos","bos"],["Breton","brezhoneg","br","bre","bre"],["Bulgarian","български език","bg","bul","bul"],["Burmese","ဗမာစာ","my","mya","bur"],["Catalan, Valencian","català, valencià","ca","cat","cat"],["Chamorro","Chamoru","ch","cha","cha"],["Chechen","нохчийн мотт","ce","che","che"],["Chichewa, Chewa, Nyanja","chiCheŵa, chinyanja","ny","nya","nya"],["Chuvash","чӑваш чӗлхи","cv","chv","chv"],["Cornish","Kernewek","kw","cor","cor"],["Corsican","corsu, lingua corsa","co","cos","cos"],["Croatian","hrvatski jezik","hr","hrv","hrv"],["Czech","čeština, český jazyk","cs","ces","cze"],["Danish","dansk","da","dan","dan"],["Divehi, Dhivehi, Maldivian","ދިވެހި","dv","div","div"],["Dutch, Flemish","Nederlands, Vlaams","nl","nld","dut"],["Dzongkha","རྫོང་ཁ","dz","dzo","dzo"],["English","English","en","eng","eng"],["Ewe","Eʋegbe","ee","ewe","ewe"],["Faroese","føroyskt","fo","fao","fao"],["Fijian","vosa Vakaviti","fj","fij","fij"],["Finnish","suomi, suomen kieli","fi","fin","fin"],["French","français, langue française","fr","fra","fre"],["Galician","Galego","gl","glg","glg"],["Georgian","ქართული","ka","kat","geo"],["German","Deutsch","de","deu","ger"],["Greek (modern)","ελληνικά","el","ell","gre"],["Gujarati","ગુજરાતી","gu","guj","guj"],["Haitian, Haitian Creole","Kreyòl ayisyen","ht","hat","hat"],["Hausa","(Hausa) هَوُسَ","ha","hau","hau"],["Herero","Otjiherero","hz","her","her"],["Hindi","हिन्दी, हिंदी","hi","hin","hin"],["Hiri Motu","Hiri Motu","ho","hmo","hmo"],["Hungarian","magyar","hu","hun","hun"],["Irish","Gaeilge","ga","gle","gle"],["Igbo","Asụsụ Igbo","ig","ibo","ibo"],["Icelandic","Íslenska","is","isl","ice"],["Italian","Italiano","it","ita","ita"],["Japanese","日本語 (にほんご)","ja","jpn","jpn"],["Javanese","ꦧꦱꦗꦮ, Basa Jawa","jv","jav","jav"],["Kalaallisut, Greenlandic","kalaallisut, kalaallit oqaasii","kl","kal","kal"],["Kannada","ಕನ್ನಡ","kn","kan","kan"],["Kashmiri","कश्मीरी, كشميري","ks","kas","kas"],["Kazakh","қазақ тілі","kk","kaz","kaz"],["Kikuyu, Gikuyu","Gĩkũyũ","ki","kik","kik"],["Kinyarwanda","Ikinyarwanda","rw","kin","kin"],["Kirghiz, Kyrgyz","Кыргызча, Кыргыз тили","ky","kir","kir"],["Korean","한국어","ko","kor","kor"],["Kuanyama, Kwanyama","Kuanyama","kj","kua","kua"],["Luxembourgish, Letzeburgesch","Lëtzebuergesch","lb","ltz","ltz"],["Ganda","Luganda","lg","lug","lug"],["Limburgan, Limburger, Limburgish","Limburgs","li","lim","lim"],["Lingala","Lingála","ln","lin","lin"],["Lao","ພາສາລາວ","lo","lao","lao"],["Lithuanian","lietuvių kalba","lt","lit","lit"],["Manx","Gaelg, Gailck","gv","glv","glv"],["Macedonian","македонски јазик","mk","mkd","mac"],["Malayalam","മലയാളം","ml","mal","mal"],["Maltese","Malti","mt","mlt","mlt"],["Marshallese","Kajin M̧ajeļ","mh","mah","mah"],["Navajo, Navaho","Diné bizaad","nv","nav","nav"],["Nepali","नेपाली","ne","nep","nep"],["Ndonga","Owambo","ng","ndo","ndo"],["Occitan","occitan, lenga d'òc","oc","oci","oci"],["Ossetian, Ossetic","ирон æвзаг","os","oss","oss"],["Panjabi, Punjabi","ਪੰਜਾਬੀ","pa","pan","pan"],["Polish","język polski, polszczyzna","pl","pol","pol"],["Portuguese","Português","pt","por","por"],["Romansh","Rumantsch Grischun","rm","roh","roh"],["Russian","русский","ru","rus","rus"],["Sindhi","सिन्धी, سنڌي، سندھی","sd","snd","snd"],["Northern Sami","Davvisámegiella","se","sme","sme"],["Samoan","gagana fa'a Samoa","sm","smo","smo"],["Sango","yângâ tî sängö","sg","sag","sag"],["Gaelic, Scottish Gaelic","Gàidhlig","gd","gla","gla"],["Shona","chiShona","sn","sna","sna"],["Sinhala, Sinhalese","සිංහල","si","sin","sin"],["Slovak","Slovenčina, Slovenský Jazyk","sk","slk","slo"],["Somali","Soomaaliga, af Soomaali","so","som","som"],["Southern Sotho","Sesotho","st","sot","sot"],["Spanish, Castilian","Español","es","spa","spa"],["Sundanese","Basa Sunda","su","sun","sun"],["Swedish","Svenska","sv","swe","swe"],["Tamil","தமிழ்","ta","tam","tam"],["Telugu","తెలుగు","te","tel","tel"],["Tajik","тоҷикӣ, toçikī, تاجیکی","tg","tgk","tgk"],["Thai","ไทย","th","tha","tha"],["Tigrinya","ትግርኛ","ti","tir","tir"],["Turkmen","Türkmen, Түркмен","tk","tuk","tuk"],["Tswana","Setswana","tn","tsn","tsn"],["Tongan (Tonga Islands)","Faka Tonga","to","ton","ton"],["Turkish","Türkçe","tr","tur","tur"],["Tsonga","Xitsonga","ts","tso","tso"],["Tatar","татар теле, tatar tele","tt","tat","tat"],["Uighur, Uyghur","ئۇيغۇرچە, Uyghurche","ug","uig","uig"],["Ukrainian","Українська","uk","ukr","ukr"],["Urdu","اردو","ur","urd","urd"],["Venda","Tshivenḓa","ve","ven","ven"],["Vietnamese","Tiếng Việt","vi","vie","vie"],["Walloon","Walon","wa","wln","wln"],["Welsh","Cymraeg","cy","cym","wel"],["Wolof","Wollof","wo","wol","wol"],["Xhosa","isiXhosa","xh","xho","xho"],["Yoruba","Yorùbá","yo","yor","yor"],["Zulu","isiZulu","zu","zul","zul"]].forEach(e=>{var t={name:e[0],nativeName:e[1],iso639_1:e[2],iso639_2T:e[3],iso639_2B:e[4]};o[e[2]]=i[e[3]]=a[e[4]]=t,r.push(t)});var 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 u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,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 u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var c={"zh-hans":"中文 (Zhōngwén)"};function f(e){if(!e)return null;if(e=e.toLocaleLowerCase(),c[e])return e;var t=h(e,["iso639_1"])||h(e,["iso639_2T"])||h(e,["iso639_2B","name","nativeName"]);return t?t.iso639_1:null}function d(e){if(!e)return null;if(e=e.toLocaleLowerCase(),c[e])return c[e];var t=h(e,["iso639_1"])||h(e,["iso639_2T"])||h(e,["iso639_2B","name","nativeName"]);return null!=t&&t.nativeName?t.nativeName.split(", ")[0]:null}function h(e,t){if(!e)return null;e=e.toLowerCase();var n,r=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 u;if(null!==(u=i[o.value])&&void 0!==u&&u.toLowerCase().split(", ").includes(e))return i}}catch(e){a.e(e)}finally{a.f()}}}catch(e){r.e(e)}finally{r.f()}return null}function p(){try{return!!window.localStorage}catch(e){return!1}}var m=-1!=location.toString().indexOf("_debugReadAloud=true")},593:function(e,t,n){n.d(t,{yc:function(){return ke},bg:function(){return ae},lB:function(){return ve}}),n(2675),n(9463),n(2259),n(5700),n(8125),n(8706),n(2008),n(113),n(3418),n(4423),n(3792),n(8598),n(2062),n(4782),n(4554),n(739),n(9572),n(2010),n(4731),n(479),n(8130),n(9085),n(2811),n(3851),n(875),n(9432),n(6099),n(8459),n(3362),n(825),n(888),n(4864),n(7495),n(9479),n(8781),n(1699),n(7764),n(1761),n(5906),n(5440),n(2762),n(8344),n(3500),n(2953),n(8408);var r=n(9073),o=n(1669);function i(e){return i="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},i(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,s(r.key),r)}}function l(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}var u,c,f,d,h,p,m,g,v,y,b,k,w,S=function(){return e=function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,"selecting",!1),l(this,"startedInSelector",!1),l(this,"target",null),l(this,"lastKnownFocusNode",null),l(this,"_onSelectionChange",function(){var e=window.getSelection();if(e){if(!r.selecting&&e.toString()){var t=o(e.anchorNode).closest(r.selector)[0];if(!t)return;r.target=t,r.selecting=!0,r.lastKnownFocusNode=e.focusNode,r.handler("started",r.target)}r.selecting&&r.lastKnownFocusNode!=e.focusNode&&e.toString()&&!e.isCollapsed&&(r.lastKnownFocusNode=e.focusNode,r.handler("changed",r.target)),!r.selecting||!e.isCollapsed&&e.toString()&&o(e.anchorNode).closest(r.selector)[0]||(r.selecting=!1,r.lastKnownFocusNode=null,r.handler("cleared",r.target))}}),this.selector=t,this.handler=n},(t=[{key:"attach",value:function(){document.addEventListener("selectionchange",this._onSelectionChange)}},{key:"detach",value:function(){document.removeEventListener("selectionchange",this._onSelectionChange)}}])&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),x=n(8004),E=n(420),C=n(9696),T=n(4535),j=(n(90),n(8918),n(7583)),O=n(1989),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 P(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=K(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,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 I(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){L(i,r,o,a,l,"next",e)}function l(e){L(i,r,o,a,l,"throw",e)}a(void 0)})}}function _(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function N(e,t,n){return t=J(t),function(e,t){if(t&&("object"==A(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,B()?Reflect.construct(t,n||[],J(e).constructor):t.apply(e,n))}function B(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(B=function(){return!!e})()}function F(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&&M(e,t)}function M(e,t){return M=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},M(e,t)}function z(e,t,n,r){var o=D();if(r)for(var i=0;i<r.length;i++)o=r[i](o);var a=t(function(e){o.initializeInstanceElements(e,l.elements)},n),l=o.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if(W(i.descriptor)||W(o.descriptor)){if(U(i)||U(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(U(i)){if(U(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}H(i,o)}else t.push(i)}return t}(a.d.map(q)),e);return o.initializeClassElements(a.F,l.elements),o.runClassFinishers(a.F,l.finishers)}function D(){D=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(!U(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 u=s.extras;if(u){for(var c=0;c<u.length;c++)this.addElementPlacement(u[c],t);n.push.apply(n,u)}}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)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||K(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=oe(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:G(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=G(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 q(e){var t,n=oe(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 H(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function U(e){return e.decorators&&e.decorators.length}function W(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function G(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 K(e,t){if(e){if("string"==typeof e)return X(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)?X(e,t):void 0}}function X(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 V(e,t,n,r){var o=$(J(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function $(){return $="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=J(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},$.apply(null,arguments)}function J(e){return J=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},J(e)}function Z(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(A(e)+" is not iterable")}function Y(){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,u=Object.create(s.prototype);return Q(u,"_invoke",function(n,r,o){var i,l,s,u=0,c=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&&u&&!o&&t<c.length;t++){var o,i=c[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,c,p){if(u>1)throw TypeError("Generator is already running");for(f&&1===c&&h(c,p),l=c,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(u=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{u=1}}return{value:t,done:f}}}(n,o,i),!0),u}var a={};function l(){}function s(){}function u(){}t=Object.getPrototypeOf;var c=[][r]?t(t([][r]())):(Q(t={},r,function(){return this}),t),f=u.prototype=l.prototype=Object.create(c);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Q(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return s.prototype=u,Q(f,"constructor",u),Q(u,"constructor",s),s.displayName="GeneratorFunction",Q(u,o,"GeneratorFunction"),Q(f),Q(f,o,"Generator"),Q(f,r,function(){return this}),Q(f,"toString",function(){return"[object Generator]"}),(Y=function(){return{w:i,m:d}})()}function Q(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Q=function(e,t,n,r){function i(t,n){Q(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))},Q(e,t,n,r)}function ee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oe(r.key),r)}}function ne(e,t,n){return t&&te(e.prototype,t),n&&te(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function re(e,t,n){return(t=oe(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oe(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 ie="BRhighlightStorage",ae=function(){return ne(function e(t,n,r,o){var i=this,a=r.selectionElement;ee(this,e),re(this,"options",{maxProtectedWords:200}),re(this,"selectMenu",void 0),re(this,"_onSelectionChange",function(e,t){if("started"===e)i.textSelectingMode(t);else if("cleared"===e)i.defaultMode(t);else if("changed"!==e)throw new Error("Unknown type ".concat(e))}),re(this,"_limitSelection",function(){var e=window.getSelection();if(e.rangeCount){var t=e.getRangeAt(0),n=!!t.startContainer.parentElement.closest(".BRcontainer"),r=!!t.endContainer.parentElement.closest(".BRcontainer");if(n||r)if(n&&r){var o=(0,O.eU)((0,O.nC)(le(t,"element"),function(e){return e.classList.contains(i.selectionElement[0].replace(".",""))}),i.options.maxProtectedWords-1);if(o&&t.endContainer.parentNode!=o){var a=document.createRange();a.setStart(t.startContainer,t.startOffset),a.setEnd(o.firstChild,o.textContent.length),e.removeAllRanges(),e.addRange(a)}}else e.removeAllRanges()}}),this.layer=t,this.br=n,this.selectionElement=a,this.selectionObserver=new S(this.layer,this._onSelectionChange),this.options.maxProtectedWords=o||200,this.selectMenu=new se(n),this.selectMenu.className="br-select-menu__root"},[{key:"selectMenuEnabled",get:function(){var e,t;return(null===(e=this.br.plugins.experiments)||void 0===e?void 0:e.isEnabled("copyLinkToHighlight"))||(null===(t=this.br.plugins.experiments)||void 0===t?void 0:t.isEnabled("annotateHighlight"))}},{key:"init",value:function(){var e=this;this.attach(),new S(this.layer,function(t){var n,r;"started"==t&&(null===(n=e.br.plugins.archiveAnalytics)||void 0===n||n.sendEvent("BookReader","SelectStart"),e.br.refs.$br.find(".BRpagecontainer--hasSelection").removeClass("BRpagecontainer--hasSelection"),R(window.getSelection().anchorNode).closest(".BRpagecontainer").addClass("BRpagecontainer--hasSelection"),e.mouseIsDown||e.showSelectMenu()),"changed"==t&&!e.mouseIsDown&&null!==(r=window.getSelection())&&void 0!==r&&r.toString()&&e.showSelectMenu(),"cleared"==t&&e.hideSelectMenu()}).attach()}},{key:"attach",value:function(){var e=this;this.selectionObserver.attach(),this.br.protected&&(document.addEventListener("selectionchange",this._limitSelection),R(document.body).on("contextmenu dragstart copy",function(t){var n=document.getSelection();if(null!=n&&n.toString()&&R(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=R(e).closest(".BRpagecontainer");e.style.pointerEvents="none",n.find("img").css("pointer-events","auto"),R(e).off(".textSelectPluginHandler");var r=this.mouseIsDown,o=this.mouseIsDown;r&&(e.style.pointerEvents="auto"),R(e).on("mousedown.textSelectPluginHandler",function(e){t.mouseIsDown=!0,R(e.target).is(t.selectionElement.join(", "))&&e.stopPropagation()}),R(e).on("mouseup.textSelectPluginHandler",function(n){t.mouseIsDown=!1,e.style.pointerEvents="none",o&&(o=!1,n.stopPropagation())})}},{key:"textSelectingMode",value:function(e){var t=this,n=R(e).closest(".BRpagecontainer");e.style.pointerEvents="all",n.find("img").css("pointer-events","none"),R(e).off(".textSelectPluginHandler"),R(e).on("mousedown.textSelectPluginHandler",function(e){1==e.which&&(t.mouseIsDown=!0,e.stopPropagation())}),R(e).on("mouseup.textSelectPluginHandler",function(e){t.mouseIsDown=!1,1==e.which&&(e.stopPropagation(),t.showSelectMenu())})}},{key:"showSelectMenu",value:function(){this.selectMenuEnabled&&(this.selectMenu.copyLinkToHighlightEnabled=this.br.plugins.experiments.isEnabled("copyLinkToHighlight"),this.selectMenu.highlightAnnotationEnabled=this.br.plugins.experiments.isEnabled("annotateHighlight"),this.selectMenu.isConnected||document.body.append(this.selectMenu),this.selectMenu.open?this.selectMenu.repositionToSelection():this.selectMenu.show())}},{key:"hideSelectMenu",value:function(){this.selectMenu.hide()}}])}();function le(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text+element";return Y().m(function n(){var r,o,i,a,l;return Y().w(function(n){for(;;)switch(n.n){case 0:return l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.children,r=void 0===n||n,s=t.parents,u=void 0===s||s,c=t.siblings,f=void 0===c||c;return Y().m(function t(){var n;return Y().w(function(t){for(;;)switch(t.n){case 0:if(e!==o){t.n=2;break}if(i=!0,!a(e)){t.n=1;break}return t.n=1,e;case 1:return t.a(2);case 2:if(!a(e)){t.n=3;break}return t.n=3,e;case 3:if(!r||!e.firstChild){t.n=5;break}return t.d(Z(l(e.firstChild,{children:!0,parents:!1,siblings:!0})),4);case 4:if(!i){t.n=5;break}return t.a(2);case 5:if(!f){t.n=9;break}n=e.nextSibling;case 6:if(!n){t.n=9;break}return t.d(Z(l(n,{children:!0,parents:!1,siblings:!1})),7);case 7:if(!i){t.n=8;break}return t.a(2);case 8:n=n.nextSibling,t.n=6;break;case 9:if(!u||!e.parentNode){t.n=11;break}return t.d(Z(l(e.parentNode,{children:!1,parents:!0,siblings:!0})),10);case 10:if(!i){t.n=11;break}return t.a(2);case 11:return t.a(2)}},t)})()},r=e.startContainer,o=e.endContainer,i=!1,a=function(e){return"text"===t&&e.nodeType===Node.TEXT_NODE||"element"===t&&e.nodeType===Node.ELEMENT_NODE||"text+element"===t},n.d(Z(l(r)),1);case 1:return n.a(2)}},n)})()}z([(0,C.EM)("br-menu-option")],function(e,t){var n=function(t){function n(){var t;ee(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return t=N(this,n,[].concat(o)),e(t),t}return F(n,t),ne(n)}(t);return{F:n,d:[{kind:"field",decorators:[(0,C.MZ)({type:String})],key:"icon",value:function(){return""}},{kind:"field",decorators:[(0,C.MZ)({type:String})],key:"label",value:function(){return""}},{kind:"field",key:"temporaryText",value:function(){return null}},{kind:"field",decorators:[(0,C.MZ)({type:Number,attribute:"temporary-text-duration"})],key:"temporaryTextDuration",value:function(){return 1200}},{kind:"field",decorators:[(0,C.MZ)({type:String,attribute:"aria-label"})],key:"ariaLabel",value:function(){return""}},{kind:"field",decorators:[(0,C.MZ)({type:Boolean,attribute:"live-label"})],key:"liveLabel",value:function(){return!1}},{kind:"field",decorators:[(0,C.MZ)({type:Boolean})],key:"temporaryTextVisible",value:function(){return!1}},{kind:"field",key:"temporaryTextTimeoutId",value:function(){return null}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"disconnectedCallback",value:function(){null!=this.temporaryTextTimeoutId&&(window.clearTimeout(this.temporaryTextTimeoutId),this.temporaryTextTimeoutId=null),V(n,"disconnectedCallback",this,3)([])}},{kind:"method",key:"showTemporaryText",value:function(e){var t=this;null!=e&&e.trim()&&(this.temporaryText=e,this.temporaryTextVisible=!0,null!=this.temporaryTextTimeoutId&&window.clearTimeout(this.temporaryTextTimeoutId),this.temporaryTextTimeoutId=window.setTimeout(function(){t.temporaryTextVisible=!1,t.temporaryText=null,t.temporaryTextTimeoutId=null},this.temporaryTextDuration))}},{kind:"method",key:"renderIcon",value:function(){return"share"===this.icon?(0,E.qy)(u||(u=_(['<ia-icon-share class="br-select-menu__icon" aria-hidden="true"></ia-icon-share>']))):"edit-pencil"===this.icon?(0,E.qy)(c||(c=_(['<ia-icon-edit-pencil class="br-select-menu__icon" aria-hidden="true"></ia-icon-edit-pencil>']))):""}},{kind:"method",key:"render",value:function(){var e,t,n=null!==(e=this.label)&&void 0!==e?e:"",r=!!this.temporaryText,o=r?this.temporaryText:n,i=r&&this.temporaryTextVisible,a=i?o:n,l=null===(t=this.ariaLabel)||void 0===t?void 0:t.trim(),s=l&&l!==a.trim()?l:void 0,u=n.length>=o.length?n:o;return(0,E.qy)(f||(f=_(['\n <button\n type="button"\n class="br-select-menu__option"\n role="menuitem"\n aria-label=',"\n >\n ","\n ","\n </button>\n "])),(0,T.J)(s),this.renderIcon(),r?(0,E.qy)(d||(d=_(['\n <span class="br-select-menu__label-wrap" style="display: inline-flex; position: relative; align-items: center;">\n <span\n class="br-select-menu__label"\n style="visibility: hidden;"\n aria-hidden="true"\n >','</span>\n <span\n class="br-select-menu__label"\n style="position: absolute; inset: 0; display: inline-flex; align-items: center;"\n aria-live=',"\n >","</span>\n </span>\n "])),u,this.liveLabel?"polite":"off",i?o:n):(0,E.qy)(h||(h=_(['\n <span class="br-select-menu__label" aria-live=',">","</span>\n "])),this.liveLabel?"polite":"off",n))}}]}},E.WF);var se=z([(0,C.EM)("br-select-menu")],function(e,t){var n,r,o=function(t){function n(t){var r;return ee(this,n),r=N(this,n),e(r),r.br=t,r}return F(n,t),ne(n)}(t);return{F:o,d:[{kind:"field",key:"br",value:void 0},{kind:"field",decorators:[(0,C.P)("#copy-link-option")],key:"copyLinkOption",value:void 0},{kind:"field",decorators:[(0,C.MZ)({type:Boolean,reflect:!0})],key:"open",value:function(){return!1}},{kind:"field",decorators:[(0,C.MZ)({type:Boolean})],key:"copyLinkToHighlightEnabled",value:function(){return!0}},{kind:"field",decorators:[(0,C.MZ)({type:Boolean})],key:"highlightAnnotationEnabled",value:function(){return!0}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"field",key:"_scrollTimeoutId",value:function(){return null}},{kind:"field",key:"_onScroll",value:function(){var e=this;return function(){e.classList.add("br-select-menu__root--scrolling"),null!=e._scrollTimeoutId&&clearTimeout(e._scrollTimeoutId),e._scrollTimeoutId=window.setTimeout(function(){e._scrollTimeoutId=null,e.repositionToSelection(),e.classList.remove("br-select-menu__root--scrolling")},150)}}},{kind:"method",key:"connectedCallback",value:function(){V(o,"connectedCallback",this,3)([]),this.setAttribute("role","menu"),this.setAttribute("aria-label","Text selection actions"),this.setAttribute("aria-orientation","vertical")}},{kind:"method",key:"disconnectedCallback",value:function(){V(o,"disconnectedCallback",this,3)([]),window.removeEventListener("scroll",this._onScroll,{capture:!0}),null!=this._scrollTimeoutId&&(clearTimeout(this._scrollTimeoutId),this._scrollTimeoutId=null)}},{kind:"method",key:"renderCopyLinkToHighlightOption",value:function(){return(0,E.qy)(p||(p=_(['\n <br-menu-option\n id="copy-link-option"\n @mousedown=',"\n @click=",'\n icon="share"\n label="Copy Link to Highlight"\n live-label\n ></br-menu-option>\n '])),function(e){return e.preventDefault()},this.handleCopyLinkToHighlight)}},{kind:"method",key:"renderRemoveOption",value:function(){return(0,E.qy)(m||(m=_(["\n <br-menu-option\n @click=",'\n icon="share"\n label="Delete Highlight and Annotation"\n ></br-menu-option>\n '])),this.handleDeleteHighlight)}},{kind:"method",key:"renderAddAnnotationOption",value:function(){return(0,E.qy)(g||(g=_(["\n <br-menu-option\n @click=",'\n icon="edit-pencil"\n label="Annotate"\n ></br-menu-option>\n '])),this.handleAddAnnotation)}},{kind:"method",key:"renderHighlightOption",value:function(){return(0,E.qy)(v||(v=_(["\n <br-menu-option\n @click=",'\n icon="edit-pencil"\n label="Highlight Selection"\n ></br-menu-option>\n '])),this.handleHighlightSave)}},{kind:"method",key:"renderLocalStorageOptions",value:function(){return(0,E.qy)(y||(y=_(["\n <br-menu-option\n @click=",'\n icon="share"\n label="Load Highlights"\n ></br-menu-option>\n <br-menu-option\n @click=','\n icon="share"\n label="Remove Stored Highlights"\n ></br-menu-option>'])),this.renderSavedHighlights,function(){window.localStorage.removeItem(ie)})}},{kind:"method",key:"render",value:function(){return(0,E.qy)(b||(b=_(["\n ","\n ","\n ","\n ","\n "])),this.copyLinkToHighlightEnabled?this.renderCopyLinkToHighlightOption():"",this.highlightAnnotationEnabled&&!this.nodesForRemoval?this.renderHighlightOption():"",this.highlightAnnotationEnabled?this.renderLocalStorageOptions():"",this.nodesForRemoval?this.renderRemoveOption():"")}},{kind:"method",key:"handleCopyLinkToHighlight",value:(r=I(Y().m(function e(t){var n,r,o,i,a,l,s,u,c,f,d,h;return Y().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),r=window.getSelection(),o=r.getRangeAt(0),i=this.getNodeTextLayer(o.startContainer)){e.n=1;break}return console.warn("No text layer found for selection"),e.a(2);case 1:return a=ke.fromSelection(r,[i]),(l=new URLSearchParams(this.br.readQueryString())).has("text")&&l.delete("text"),s=l.toString(),s+=(s?"&":"")+"text=".concat(a.toUrlString()),u=window.location,c=a.pageNumber||"n".concat(a.pageIndex),f=u.pathname.replace(/((?:^|[#/])page)\/[^/]+/,"$1/".concat(c)),d=u.hash?u.hash.replace(/((?:^|[#/])page)\/[^/]+/,"$1/".concat(c)):"",h="".concat(u.origin).concat(f,"?").concat(s).concat(d),e.n=2,navigator.clipboard.writeText(h);case 2:null===(n=this.copyLinkOption)||void 0===n||n.showTemporaryText("Copied!");case 3:return e.a(2)}},e,this)})),function(e){return r.apply(this,arguments)})},{kind:"method",key:"getNodeTextLayer",value:function(e){var t;if(!e)return null;var n=e instanceof Element?e:e.parentElement;return null!==(t=null==n?void 0:n.closest(".BRtextLayer"))&&void 0!==t?t:null}},{kind:"method",key:"handleHighlightSave",value:function(){var e=window.getSelection(),t="backward"===e.direction?e.focusNode.parentElement:e.anchorNode.parentElement,n=this.getNodeTextLayer(t),r=ke.fromSelection(e,[n.parentElement]);r.uuid="id-".concat(crypto.randomUUID().split("-")[4]);var o=this.loadHighlightsFromLocalStorage();o.push(r),this.saveToLocalStorage(o),this.renderSavedHighlights()}},{kind:"method",key:"handleAddAnnotation",value:function(e){}},{kind:"method",key:"handleDeleteHighlight",value:function(){if(this.nodesForRemoval){var e,t=be(this.nodesForRemoval[0]),n=P(this.nodesForRemoval);try{for(n.s();!(e=n.n()).done;){var r=e.value,o=r.textContent,i=r.parentElement;i.classList.contains("BRwordElement")||i.classList.contains("BRspace")?(r.remove(),i.textContent=o):console.log("This element did not match removal criteria:",i,r)}}catch(e){n.e(e)}finally{n.f()}this.deleteHighlight(t),this.clearNodesForRemoval()}else console.log("there is nothing to remove")}},{kind:"method",key:"deleteHighlight",value:function(e){for(var t=this.loadHighlightsFromLocalStorage(),n=0;n<t.length;n++)if(t[n].uuid===e)return t.splice(n,1),void this.saveToLocalStorage(t)}},{kind:"method",key:"saveToLocalStorage",value:function(e){window.localStorage.setItem(ie,JSON.stringify(e.map(function(e){return e.toJSON()})))}},{kind:"method",key:"loadHighlightsFromLocalStorage",value:function(){return JSON.parse(window.localStorage.getItem(ie)||"[]").map(function(e){return ke.fromJSON(e)})}},{kind:"method",key:"renderSavedHighlights",value:function(){var e,t=this,n=P(this.loadHighlightsFromLocalStorage());try{for(n.s();!(e=n.n()).done;){var r=e.value,o=this.br.$(".pagediv".concat(r.pageIndex," .BRtextLayer"))[0];o&&(ve(o,r),R(o).off("mouseup.BRHighlightClick").on("mouseup.BRHighlightClick",function(e){e.target.classList.contains("BRhighlight")&&(e.stopPropagation(),t.handleHighlightClick(e.target))}))}}catch(e){n.e(e)}finally{n.f()}}},{kind:"method",key:"handleHighlightClick",value:function(e){var t=this.getNodeTextLayer(e),n=be(e),r=t.querySelectorAll(".".concat(n)),o=r[0],i=r[r.length-1],a=document.createRange();a.setStart(o,0),a.setEnd(i,1);var l=window.getSelection();l.removeAllRanges(),l.addRange(a),this.show()}},{kind:"method",key:"repositionToSelection",value:function(){var e=window.getSelection().getRangeAt(0).getBoundingClientRect(),t=(0,j.un)()||(0,j.m0)(),n=(0,j.m0)()?25:(0,j.un)()?15:10,r=t?60:0,o=(e.top<r?e.bottom+r:e.bottom)+n,i=Math.max(10,o)+window.scrollY,a=this.getBoundingClientRect().width,l=document.documentElement.clientWidth,s=a>e.width?e.left+e.width/2-a/2:e.left,u=(0,x.clamp)(s,10,l-a-10)+window.scrollX;this.style.top="".concat(i,"px"),this.style.left="".concat(u,"px")}},{kind:"method",key:"show",value:(n=I(Y().m(function e(){var t;return Y().w(function(e){for(;;)switch(e.n){case 0:if(null===(t=this.br.plugins.translate)||void 0===t||!t.userToggleTranslate){e.n=1;break}return e.a(2);case 1:return this.style.zIndex="1",this.style.position="absolute",this.style.display="block",this.open=!0,this.classList.remove("br-select-menu__root--scrolling"),window.removeEventListener("scroll",this._onScroll,{capture:!0}),window.addEventListener("scroll",this._onScroll,{capture:!0,passive:!0}),e.n=2,this.updateComplete;case 2:this.repositionToSelection(),this.clearNodesForRemoval();case 3:return e.a(2)}},e,this)})),function(){return n.apply(this,arguments)})},{kind:"method",key:"hide",value:function(){this.open&&(this.style.display="none",this.open=!1,window.removeEventListener("scroll",this._onScroll,{capture:!0}),this.clearNodesForRemoval())}},{kind:"field",key:"clearNodesForRemoval",value:function(){var e=this;return function(){e.nodesForRemoval=null,e.requestUpdate()}}}]}},E.WF);function ue(e,t){t=t.trim();var n=new RegExp(String.raw(k||(k=_(["^(S+(s+|$)){1,","}"],["^(\\S+(\\s+|$)){1,","}"])),e)),r=t.match(n);return r?r[0].trim():""}function ce(e,t){t=t.trim();var n=new RegExp(String.raw(w||(w=_(["((^|s+)S+){1,","}s*?$"],["((^|\\s+)\\S+){1,","}\\s*?$"])),e)),r=t.match(n);return r?r[0].trim():""}function fe(e){for(;e.firstChild;)e=e.firstChild;return e}function de(e){for(;e.lastChild;)e=e.lastChild;return e}function he(e){return e.replace(/(:|-,|,-|,|\n)/g,function(e){return 1===e.length?" ":" "})}function pe(e,t,n){var r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).normalize,o=void 0===r?function(e){return e}:r;if(n.length){var i=n[0]===t.startContainer?t.startOffset:0,a=o(ge(t)),l=o(n[0].textContent.slice(0,i)).length,s=new RegExp(e.source,e.flags.includes("g")?e.flags:"".concat(e.flags,"g")),u=Array.from(a.matchAll(s)).map(function(e){var t=me(l+e.index,n,!1,{normalize:o}),r=me(l+e.index+e[0].length,n,!0,{normalize:o});if(t&&r){var i=new Range;return i.setStart(t.node,t.offset),i.setEnd(r.node,r.offset),i}console.warn("Could not find boundary points for regex match, skipping this match",{match:e,start:t,end:r})}).filter(function(e){return!!e});if(null!=u&&u.length)return u}}function me(e,t,n){var r,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).normalize,i=void 0===o?function(e){return e}:o,a=e,l=0,s=P(t);try{for(s.s();!(r=s.n()).done;){var u=r.value,c=u.textContent||"",f=i(c),d=l;if(d+f.length+(n?1:0)>a)for(var h=a-d,p=Math.min(h,c.length),m=n?f.substring(0,h):f.substring(h),g=i(n?c.substring(0,h):c.substring(h)),v=(n?-1:1)*(m.length>g.length?-1:1);p>=0&&p<=c.length;){if(g.length===m.length)return{node:u,offset:p};p+=v,g=i(n?c.substring(0,p):c.substring(p))}l+=f.length}}catch(e){s.e(e)}finally{s.f()}}function ge(e){var t=Array.from((0,O.nC)(le(e,"text"),ye)),n=t.map(function(e){return e.textContent}).join(""),r=t[0],o=t[t.length-1];return e.startContainer===r&&(n=n.substring(e.startOffset)),e.endContainer===o&&(n=n.substring(0,n.length-(o.textContent.length-e.endOffset))),n}function ve(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=fe(e),o=de(e),i=new Range;i.setStart(r,0),i.setEnd(o,o.textContent.length);var a=Array.from((0,O.nC)(le(i,"text"),ye)),l=pe(t.toRegExp({context:!0}),i,a,{normalize:he});if(l){var s=Array.from((0,O.nC)(le(l[0],"text"),ye)),u=pe(t.toRegExp({context:!1}),l[0],s,{normalize:he});if(!u)throw new Error("Could not find quote in page");var c=fe(u[0].startContainer),f=fe(u[0].endContainer),d=new Range;if(d.setStart(c,0),d.setEnd(f,f.textContent.length),!c.parentElement.classList.contains("BRhighlight")&&!f.parentElement.classList.contains("BRhighlight"))return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return document.createElement("mark")};if(e.startContainer.nodeType!=Node.TEXT_NODE||e.endContainer.nodeType!=Node.TEXT_NODE)return[];if(e.startContainer===e.endContainer){var n=t();return e.surroundContents(n),[n]}var r=e.startContainer,o=e.cloneRange();o.setEndAfter(r);var i=e.endContainer,a=e.cloneRange();a.setStartBefore(i);var l=[];e.setStartAfter(r),e.setEndBefore(i);for(var s=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:function(t){return e.intersectsNode(t)?t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP:NodeFilter.FILTER_REJECT}}),u=s.nextNode();u;){if(u.nodeType===Node.TEXT_NODE){var c=t();u.parentNode.insertBefore(c,u),c.appendChild(u),l.push(c)}u=s.nextNode()}var f=t();o.surroundContents(f);var d=t();return a.surroundContents(d),[f].concat(l,[d])}(d,function(){var e=document.createElement("mark");return e.classList.add("BRhighlight"),n&&e.classList.add(n),t.uuid&&e.classList.add(t.uuid),e})}else console.warn("Could not find quote with context in page")}function ye(e){var t;return!(null!==(t=e.previousElementSibling)&&void 0!==t&&t.classList.contains("BRspace"))}function be(e){if(!e)return null;var t=Array.from(null==e?void 0:e.classList).filter(function(e){if(e.slice(0,2).includes("id"))return e});return t.length?t[0]:null}var ke=function(){function e(t){var n=t.prefix,r=t.quote,o=t.quoteStart,i=t.quoteEnd,a=t.suffix,l=t.pageNumber,s=t.pageIndex,u=t.uuid;ee(this,e),this.prefix=n,this.quote=null!=r?r:null,this.quoteStart=null!=o?o:null,this.quoteEnd=null!=i?i:null,this.suffix=a,this.pageNumber=l,this.pageIndex=s,this.uuid=null!=u?u:null}return ne(e,[{key:"toUrlString",value:function(){var e=function(e){return function(e){return e.replace(/\s+/g," ").trim()}(he(e).trim())},t=this.pageNumber?this.pageNumber:"n".concat(this.pageIndex);t+=":",this.prefix&&(t+=e(this.prefix),t+="-,");var n=this.quote?e(this.quote):null,r=null;if(n&&n.length>80&&(n.match(/\S+/g)||[]).length>=6){var o=ue(3,n),i=ce(3,n);o&&i&&(r={quoteStart:o,quoteEnd:i})}if(n&&!r)t+=n;else if(r)t+="".concat(r.quoteStart,",").concat(r.quoteEnd);else{if(!this.quoteStart||!this.quoteEnd)throw new Error("Text fragment requires either a quote or quoteStart/quoteEnd");t+="".concat(this.quoteStart,",").concat(this.quoteEnd)}return this.suffix&&(t+=",-",t+=e(this.suffix)),encodeURIComponent(t).replace(/%2C/g,",").replace(/%3A/g,":")}},{key:"toRegExp",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).context,t=void 0!==e&&e,n=this.quote?[this.quote]:[this.quoteStart,this.quoteEnd];t&&(this.prefix&&(n[0]=this.prefix+" "+n[0]),this.suffix&&(n[n.length-1]=n[n.length-1]+" "+this.suffix));var r=function(e){return RegExp.escape(he(e)).replace(/(\\x20)+/g,"\\s+")};return 1===n.length?new RegExp(r(n[0]),"gi"):new RegExp(r(n[0])+"[\\s\\S]*?"+r(n[1]),"gi")}},{key:"toJSON",value:function(){return{prefix:this.prefix,quote:this.quote,quoteStart:this.quoteStart,quoteEnd:this.quoteEnd,suffix:this.suffix,pageNumber:this.pageNumber,pageIndex:this.pageIndex,uuid:this.uuid}}}],[{key:"fromString",value:function(t,n,r){var o=t.match(/^(?:(.*?):)?(?:(.*?)-,)?(.*?)(?:,-(.*))?$/);if(!o)throw new Error("Invalid text fragment format: ".concat(t));var i=o[1]?decodeURIComponent(o[1]):null,a=o[2]?decodeURIComponent(o[2]):null,l=(o[3]||"").split(","),s=null,u=null,c=null;if(1===l.length)s=decodeURIComponent(l[0]);else{if(2!==l.length)throw new Error("Invalid text fragment quote format: ".concat(t));u=decodeURIComponent(l[0]),c=decodeURIComponent(l[1])}var f=o[4]?decodeURIComponent(o[4]):null,d=i?n.getPageIndex(i):r;if("number"!=typeof d)throw new Error("Could not determine page index for text fragment with page number ".concat(i));if(!(s||u&&c))throw new Error("Invalid text fragment quote format: ".concat(t));return new e({prefix:a,quote:s,quoteStart:u,quoteEnd:c,suffix:f,pageNumber:i,pageIndex:d})}},{key:"fromJSON",value:function(t){return new e(t)}},{key:"fromSelection",value:function(t,n){var o,i,a=t.getRangeAt(0),l=new Range,s=de(a.startContainer),u=fe(a.endContainer);l.setStart(s,0),l.setEnd(u,0==a.endOffset?0:null!==(o=null===(i=u.textContent)||void 0===i?void 0:i.length)&&void 0!==o?o:0);var c=document.createRange();c.setStart(fe(n[0]),0),c.setEnd(s,0);var f=document.createRange();f.setStart(u,l.endOffset);var d=de(n[n.length-1]);f.setEnd(d,Math.max(0,d.textContent.length-1));var h=ge(c),p=ce(3,h),m=(0,r.rj)(p),g=ge(f),v=ue(3,g),y=(0,r.rj)(v);m<3&&(v=ue(6-m,g),y=(0,r.rj)(v)),y<3&&(p=ce(6-y,h),m=(0,r.rj)(p));var b=ge(l),k=s.parentElement.closest(".BRpagecontainer");return new e({quote:b,prefix:p,suffix:v,pageNumber:k.getAttribute("data-page-num"),pageIndex:parseFloat(k.getAttribute("data-index"))})}}])}()},4565:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}n.d(t,{l:function(){return a}}),n(2675),n(9463),n(2259),n(5700),n(3792),n(9572),n(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}()},1989:function(e,t,n){function r(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function l(n,r,i,a){var l=r&&r.prototype instanceof u?r:u,c=Object.create(l.prototype);return o(c,"_invoke",function(n,r,o){var i,a,l,u=0,c=o||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,n){return i=t,a=0,l=e,d.n=n,s}};function h(n,r){for(a=n,l=r,t=0;!f&&u&&!o&&t<c.length;t++){var o,i=c[t],h=d.p,p=i[2];n>3?(o=p===r)&&(l=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=h&&((o=n<2&&h<i[1])?(a=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,a=0))}if(o||n>1)return s;throw f=!0,r}return function(o,c,p){if(u>1)throw TypeError("Generator is already running");for(f&&1===c&&h(c,p),a=c,l=p;(t=a<2?e:l)||!f;){i||(a?a<3?(a>1&&(d.n=-1),h(a,l)):d.n=l:d.v=l);try{if(u=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(f=d.n<0)?l:n.call(r,d))!==s)break}catch(t){i=e,a=1,l=t}finally{u=1}}return{value:t,done:f}}}(n,i,a),!0),c}var s={};function u(){}function c(){}function f(){}t=Object.getPrototypeOf;var d=[][i]?t(t([][i]())):(o(t={},i,function(){return this}),t),h=f.prototype=u.prototype=Object.create(d);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,o(e,a,"GeneratorFunction")),e.prototype=Object.create(h),e}return c.prototype=f,o(h,"constructor",f),o(f,"constructor",c),c.displayName="GeneratorFunction",o(f,a,"GeneratorFunction"),o(h),o(h,a,"Generator"),o(h,i,function(){return this}),o(h,"toString",function(){return"[object Generator]"}),(r=function(){return{w:l,m:p}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,n,r){function a(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},o(e,t,n,r)}n.d(t,{Px:function(){return h},eU:function(){return f},nC:function(){return d},pp:function(){return p},yU:function(){return m}}),n(2675),n(9463),n(2259),n(3418),n(3792),n(4782),n(2010),n(875),n(6099),n(7495),n(8781),n(7764),n(2953);var i=r().m(d),a=r().m(h),l=r().m(p),s=r().m(m);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 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 f(e,t){var n,r=0,o=u(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(r==t)return i;r++}}catch(e){o.e(e)}finally{o.f()}}function d(e,t){var n,o,a,l;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:n=u(e),r.p=1,n.s();case 2:if((o=n.n()).done){r.n=4;break}if(a=o.value,!t(a)){r.n=3;break}return r.n=3,a;case 3:r.n=2;break;case 4:r.n=6;break;case 5:r.p=5,l=r.v,n.e(l);case 6:return r.p=6,n.f(),r.f(6);case 7:return r.a(2)}},i,null,[[1,5,6,7]])}function h(e,t){var n,o,i,l;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:n=u(e),r.p=1,n.s();case 2:if((o=n.n()).done){r.n=4;break}return i=o.value,r.n=3,t(i);case 3:r.n=2;break;case 4:r.n=6;break;case 5:r.p=5,l=r.v,n.e(l);case 6:return r.p=6,n.f(),r.f(6);case 7:return r.a(2)}},a,null,[[1,5,6,7]])}function p(e){var t,n,o,i,a,s,c;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:t=void 0,n=void 0,o=void 0,i=u(e),r.p=1,i.s();case 2:if((a=i.n()).done){r.n=5;break}if(s=a.value,void 0===n){r.n=3;break}return o=s,r.n=3,[t,n,o];case 3:t=n,n=s,o=void 0;case 4:r.n=2;break;case 5:r.n=7;break;case 6:r.p=6,c=r.v,i.e(c);case 7:return r.p=7,i.f(),r.f(7);case 8:if(void 0===n){r.n=9;break}return r.n=9,[t,n,o];case 9:return r.a(2)}},l,null,[[1,6,7,8]])}function m(e,t){var n,o,i,a;return r().w(function(r){for(;;)switch(r.n){case 0:n=e[Symbol.iterator](),o=t[Symbol.iterator]();case 1:if(i=n.next(),a=o.next(),!i.done||!a.done){r.n=2;break}return r.a(2);case 2:if(!i.done&&!a.done){r.n=3;break}throw new Error("zip: one of the iterators is done");case 3:return r.n=4,[i.value,a.value];case 4:r.n=1;break;case 5:return r.a(2)}},s)}},9073:function(e,t,n){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e){var t=e.match(/\S+/g);return t?t.length:0}function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a;return null==e?void 0:e.replace(/\{\{([^}]*?)\}\}/g,function(e,i){if(!i)return e;var a,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],u=r(l).slice(1);if(!(s in n)&&!(s in t))return e;var c=s in n?n[s]:s in t?t[s]:null;return u.map(function(e){return o[e]}).reduce(function(e,t){return t(e)},c&&c.toString())})}n.d(t,{gT:function(){return i},rj:function(){return o}}),n(2675),n(9463),n(2259),n(3418),n(3792),n(2062),n(2712),n(4782),n(2010),n(6099),n(7495),n(8781),n(7764),n(1761),n(5440),n(2762),n(2953);var a={urlencode:encodeURIComponent}}},function(e){e(e.s=296)}]);
64
+ `}render(){return o}}customElements.define("ia-icon-share",i)},5703:function(e,t,n){var r=n(1354),o=n.n(r),i=n(6314),a=n.n(i)()(o());a.push([e.id,'.BRtextLayer,.BRtranslateLayer{z-index:2;position:absolute;top:0;left:0;color:rgba(0,0,0,0);transform-origin:0 0;pointer-events:none;cursor:text}.BRtextLayer{mix-blend-mode:multiply}.BRtranslateLayer{hyphens:auto}.BRparagraphElement{margin:0;cursor:text;font-family:Georgia,serif;line-height:0}.BRlineElement{pointer-events:all;white-space:nowrap;display:inline-block}.BRtextLayer[dir=ltr] .BRlineElement{margin-right:100%}.BRtextLayer[dir=rtl] .BRlineElement{margin-left:100%}.BRwordElement::selection,.BRspace::selection,.BRparagraphElement::selection,.BRparagraphElement br::selection{background:hsla(210,74%,62%,.4)}.BRwordElement::-moz-selection,.BRspace::-moz-selection,.BRparagraphElement::-moz-selection,.BRparagraphElement br::-moz-selection{background:hsla(210,74%,62%,.4);color:rgba(0,0,0,0)}.BRtranslateLayer ::selection{background:hsla(210,74%,62%,.4)}.BRtranslateLayer ::-moz-selection{background:hsla(210,74%,62%,.4)}.BRparagraphElement br{visibility:hidden}.BRwordElement--hyphen::after{content:"-"}.BRsmooth-zooming .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer,.BRscrolling-active .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer{display:none}.BRmode1up .BRpagecontainer:not(.BRpage-visible) .BRtextLayer{display:none}.BRpagecontainer img{-webkit-user-select:none;-moz-user-select:none;user-select:none}.BRtextLayer:has([_istranslated="1"],msreadoutspan){mix-blend-mode:normal}.BRwordElement[_istranslated="1"],.BRwordElement[_msttexthash],.BRspace[_istranslated="1"],.BRspace[_msttexthash]{color:#000;letter-spacing:unset !important}.BRlineElement:has([_istranslated="1"],[_msttexthash]){background:rgba(248,237,192,.8);backdrop-filter:blur(8px);color:#000;text-align:justify;width:inherit}.BRlineElement:has([_istranslated="1"],[_msttexthash]):not(:nth-last-child(2)){text-align-last:justify}.BRlineElement[_msttexthash]{word-spacing:unset !important}.BRtranslateLayer .BRparagraphElement{pointer-events:auto;overflow-y:auto;background:rgba(248,237,192,.8);backdrop-filter:blur(8px);color:#000;line-height:1em;text-align:justify}.BRtranslateLayer .BRparagraphElement .BRlineElement{white-space:break-spaces;display:inline-block}.BRtextLayer.showingTranslation{display:none}.BRtranslateLayer .BRparagraphElement.BRtranslateHidden{display:none}.br-select-menu__root{display:none;color:#fff;color-scheme:dark;padding:2px;overflow:hidden;opacity:1;transition:opacity .2s;gap:5px}.br-select-menu__root[open]{display:flex}.br-select-menu__root[showextended]{display:block;gap:0px;background-color:#333;border-radius:10px}@starting-style{.br-select-menu__root{opacity:0}}.br-select-menu__root--scrolling{opacity:0;pointer-events:none}.br-select-menu__option{--iconWidth: 15px;--iconHeight: 15px;--iconFillColor: currentColor;background:rgba(0,0,0,0);display:flex;align-items:center;border-radius:25px;font-family:inherit;color:inherit;border:0;cursor:pointer;text-wrap:nowrap;background-color:#333;position:relative}@media(pointer: coarse)and (hover: none){.br-select-menu__option{padding:4px 8px}#br-select-more .br-select-menu__option{padding:4px}}.br-select-menu__option:hover:after{position:absolute;left:2px;right:2px;top:2px;bottom:2px;content:"";pointer-events:none;background-color:rgba(255,255,255,.1);border-radius:23px}.br-select-menu__root[showextended] .br-select-menu__option{width:100%}.br-select-menu__root[showextended] .br-select-menu__option:hover:after{border-radius:8px}.br-select-menu__icon{display:block;flex-shrink:0;width:17px;height:17px;padding:2px}.br-select-menu__label{margin-left:4px;font-size:12px;margin-right:4px}@media(hover: hover){.br-select-menu__option{padding:4px}.br-select-menu__label{width:0px;margin:0;opacity:0;interpolate-size:allow-keywords;transition:width .2s}.br-select-menu__root:hover .br-select-menu__label{width:auto;margin:0 4px;opacity:1}}.BRtextLayer .BRhighlight{background-color:#ff0;pointer-events:all;color:rgba(0,0,0,0)}@keyframes highlightTargetFlash{to{background-color:hsl(45,80%,66%)}}.BRtextLayer .BRhighlight--target-text,.BRtextLayer ::target-text{background-color:hsla(45,80%,66%,.6);color:rgba(0,0,0,0);animation:highlightTargetFlash 600ms 1 reverse}',"",{version:3,sources:["webpack://./src/css/_TextSelection.scss"],names:[],mappings:"AAAA,+BACI,SAAA,CACA,iBAAA,CACA,KAAA,CACA,MAAA,CACA,mBAAA,CACA,oBAAA,CAEA,mBAAA,CACA,WAAA,CAGJ,aACI,uBAAA,CAGJ,kBACI,YAAA,CAGJ,oBACI,QAAA,CACA,WAAA,CACA,yBAAA,CACA,aAAA,CAGJ,eACI,kBAAA,CACA,kBAAA,CACA,oBAAA,CASA,qCAAA,iBAAA,CACA,qCAAA,gBAAA,CAMA,+GACI,+BAAA,CAGJ,mIACI,+BAAA,CACA,mBAAA,CAIR,8BACI,+BAAA,CAGJ,mCACI,+BAAA,CAGJ,uBACI,iBAAA,CAKJ,8BACI,WAAA,CAMA,0RACI,YAAA,CAKR,8DACI,YAAA,CAIJ,qBACI,wBAAA,CACA,qBAAA,CACA,gBAAA,CAOJ,oDACI,qBAAA,CAIA,kHACI,UAAA,CACA,+BAAA,CAIR,uDACI,+BAAA,CACA,yBAAA,CACA,UAAA,CACA,kBAAA,CACA,aAAA,CACA,+EACI,uBAAA,CAIR,6BACI,6BAAA,CAGJ,sCACI,mBAAA,CACA,eAAA,CACA,+BAAA,CACA,yBAAA,CACA,UAAA,CACA,eAAA,CACA,kBAAA,CAGJ,qDACI,wBAAA,CACA,oBAAA,CAGJ,gCACI,YAAA,CAGJ,wDACI,YAAA,CAMJ,sBACE,YAAA,CACA,UAAA,CACA,iBAAA,CACA,WAAA,CACA,eAAA,CACA,SAAA,CACA,sBAAA,CACA,OAAA,CAEA,4BACE,YAAA,CAGF,oCACE,aAAA,CACA,OAAA,CACA,qBAAA,CACA,kBAnB0B,CAsB5B,gBArBF,sBAsBI,SAAA,CAAA,CAGJ,iCACE,SAAA,CACA,mBAAA,CAGF,wBACE,iBAAA,CACA,kBAAA,CACA,6BAAA,CACA,wBAAA,CACA,YAAA,CACA,kBAAA,CACA,kBAvCmB,CAwCnB,mBAAA,CACA,aAAA,CACA,QAAA,CACA,cAAA,CACA,gBAAA,CACA,qBAAA,CACA,iBAAA,CAEA,yCAhBF,wBAiBI,eAAA,CACA,wCACI,WAAA,CAAA,CAIN,oCACE,iBAAA,CACA,QAAA,CACA,SAAA,CACA,OAAA,CACA,UAAA,CACA,UAAA,CACA,mBAAA,CACA,qCAAA,CACA,kBAAA,CAGF,4DACI,UAAA,CACA,wEACE,iBAAA,CAKR,sBACE,aAAA,CACA,aAAA,CACA,UAAA,CACA,WAAA,CACA,WAAA,CAGF,uBACE,eAAA,CACA,cAAA,CACA,gBAAA,CAGF,qBACI,wBACI,WAAA,CAEJ,uBACI,SAAA,CACA,QAAA,CACA,SAAA,CACA,+BAAA,CACA,oBAAA,CAEJ,mDACI,UAAA,CACA,YAAA,CACA,SAAA,CAAA,CAIR,0BACI,qBAAA,CACA,kBAAA,CACA,mBAAA,CAGJ,gCACE,GAAA,gCAAA,CAAA,CAIF,kEAEI,oCAAA,CACA,mBAAA,CACA,8CAAA",sourcesContent:['.BRtextLayer, .BRtranslateLayer {\n z-index: 2;\n position: absolute;\n top: 0;\n left: 0;\n color: transparent;\n transform-origin: 0 0;\n // Make it so right-clicking on "blank" part of text layer sends events to the image (for saving)\n pointer-events: none;\n cursor: text;\n}\n\n.BRtextLayer {\n mix-blend-mode: multiply;\n}\n\n.BRtranslateLayer {\n hyphens: auto;\n}\n\n.BRparagraphElement {\n margin: 0;\n cursor: text;\n font-family: Georgia, serif;\n line-height: 0;\n}\n\n.BRlineElement {\n pointer-events: all;\n white-space: nowrap;\n display: inline-block;\n\n // We use display: inline-block, otherwise this causes every line\n // to have newlines at the end in safari. BUT, since they\'re inline,\n // if the OCR has to short line in the same paragraph, they can wrap\n // and one can go onto the other. This adds an arbitrary margin to\n // the right of each line, forcing things to wrap.\n // See eg https://www-drini.archive.org/details/countofmontecris00duma_7/page/261/mode/2up\n // Page 261, second last line on the page.\n .BRtextLayer[dir=ltr] & { margin-right: 100%; }\n .BRtextLayer[dir=rtl] & { margin-left: 100%; }\n}\n\n// Highlight colors for text selection layer\n.BRwordElement, .BRspace, .BRparagraphElement, .BRparagraphElement br {\n // these 2 properties do not work if joined\n &::selection {\n background: hsla(210, 74%, 62%, 0.4);\n }\n\n &::-moz-selection {\n background: hsla(210, 74%, 62%, 0.4);\n color:transparent;\n }\n}\n\n.BRtranslateLayer ::selection {\n background: hsla(210, 74%, 62%, 0.4);\n}\n\n.BRtranslateLayer ::-moz-selection {\n background: hsla(210, 74%, 62%, 0.4);\n}\n\n.BRparagraphElement br {\n visibility: hidden;\n}\n\n// Use CSS pseudo-elements to render the hyphens. This makes them\n// not selectable, so copy/pasting text doesn\'t include them.\n.BRwordElement--hyphen::after {\n content: "-";\n}\n\n// Hide text layer for performance during zooming & scrolling\n.BRsmooth-zooming, .BRscrolling-active {\n // If the text layer has an annotation, don\'t hide it\n .BRpagecontainer:not(.BRpagecontainer--hasSelection):not(:has(hypothesis-highlight)):not(:has(.BRhighlight)) .BRtextLayer {\n display: none;\n }\n}\n\n// Hide text selection layers of off-screen pages\n.BRmode1up .BRpagecontainer:not(.BRpage-visible) .BRtextLayer {\n display: none;\n}\n\n// Makes page image unselectable\n.BRpagecontainer img {\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n}\n\n\n// These are Microsoft Edge specific fixed to make some of the\n// browsers features work well. These are for the in-place\n// translation.\n.BRtextLayer:has([_istranslated="1"], msreadoutspan) {\n mix-blend-mode: normal;\n}\n\n.BRwordElement, .BRspace {\n &[_istranslated="1"], &[_msttexthash] {\n color: black;\n letter-spacing: unset !important;\n }\n}\n\n.BRlineElement:has([_istranslated="1"], [_msttexthash]) {\n background: rgba(248, 237, 192, 0.8);\n backdrop-filter: blur(8px);\n color: black;\n text-align: justify;\n width: inherit;\n &:not(:nth-last-child(2)) {\n text-align-last: justify;\n }\n}\n\n.BRlineElement[_msttexthash] {\n word-spacing: unset !important;\n}\n\n.BRtranslateLayer .BRparagraphElement {\n pointer-events: auto;\n overflow-y: auto;\n background: rgba(248, 237, 192, 0.8);\n backdrop-filter: blur(8px);\n color:black;\n line-height: 1em;\n text-align: justify;\n}\n\n.BRtranslateLayer .BRparagraphElement .BRlineElement {\n white-space: break-spaces;\n display: inline-block;\n}\n\n.BRtextLayer.showingTranslation {\n display: none;\n}\n\n.BRtranslateLayer .BRparagraphElement.BRtranslateHidden {\n display: none;\n}\n\n\n$select-menu-radius: 25px;\n$select-menu-extended-radius: 10px;\n.br-select-menu__root {\n display: none;\n color: white;\n color-scheme: dark;\n padding: 2px;\n overflow: hidden;\n opacity: 1;\n transition: opacity 0.2s;\n gap: 5px;\n\n &[open] {\n display: flex;\n }\n\n &[showextended] {\n display: block;\n gap: 0px;\n background-color: #333;\n border-radius: $select-menu-extended-radius;\n }\n\n @starting-style {\n opacity: 0;\n }\n}\n.br-select-menu__root--scrolling {\n opacity: 0;\n pointer-events: none;\n}\n\n.br-select-menu__option {\n --iconWidth: 15px;\n --iconHeight: 15px;\n --iconFillColor: currentColor;\n background: transparent;\n display: flex;\n align-items: center;\n border-radius: $select-menu-radius;\n font-family: inherit;\n color: inherit;\n border: 0;\n cursor: pointer;\n text-wrap: nowrap;\n background-color: #333;\n position: relative;\n\n @media (pointer: coarse) and (hover: none) {\n padding: 4px 8px;\n #br-select-more & {\n padding: 4px;\n }\n }\n\n &:hover:after {\n position: absolute;\n left: 2px;\n right: 2px;\n top: 2px;\n bottom: 2px;\n content: "";\n pointer-events: none;\n background-color: rgba(255, 255, 255, 0.1);\n border-radius: calc($select-menu-radius - 2px);\n }\n\n .br-select-menu__root[showextended] & {\n width:100%;\n &:hover:after {\n border-radius: calc($select-menu-extended-radius - 2px);\n }\n }\n}\n\n.br-select-menu__icon {\n display: block;\n flex-shrink: 0;\n width: 17px;\n height: 17px;\n padding: 2px;\n}\n\n.br-select-menu__label {\n margin-left: 4px;\n font-size: 12px;\n margin-right: 4px;\n}\n\n@media (hover: hover) {\n .br-select-menu__option {\n padding: 4px;\n }\n .br-select-menu__label {\n width: 0px;\n margin: 0;\n opacity: 0;\n interpolate-size: allow-keywords;\n transition: width 0.2s;\n }\n .br-select-menu__root:hover .br-select-menu__label {\n width: auto;\n margin: 0 4px;\n opacity: 1;\n }\n}\n\n.BRtextLayer .BRhighlight {\n background-color: yellow;\n pointer-events: all;\n color: transparent;\n}\n\n@keyframes highlightTargetFlash {\n to { background-color: hsla(45, 80%, 66%, 1); }\n}\n\n// Style URI TextFragments, eg ?text=example\n.BRtextLayer .BRhighlight--target-text, .BRtextLayer ::target-text {\n // Similar colour to the default one used in Safari, Firefox. Note Chrome uses a purple colour\n background-color: hsla(45, 80%, 66%, 0.6);\n color: transparent;\n animation: highlightTargetFlash 600ms 1 reverse;\n}\n'],sourceRoot:""}]),t.A=a.toString()},6314:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,o,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(r)for(var l=0;l<this.length;l++){var s=this[l][0];null!=s&&(a[s]=!0)}for(var c=0;c<e.length;c++){var u=[].concat(e[c]);r&&a[u[0]]||(void 0!==i&&(void 0===u[5]||(u[1]="@layer".concat(u[5].length>0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=i),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),o&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=o):u[4]="".concat(o)),t.push(u))}},t}},1354:function(e){e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),o="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),i="/*# ".concat(o," */");return[t].concat([i]).join("\n")}return[t].join("\n")}},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})}},9479:function(e,t,n){var r=n(3724),o=n(2106),i=n(5213),a=n(7979);r&&!i.correct&&(o(RegExp.prototype,"flags",{configurable:!0,get:a}),i.correct=!0)},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),d=n(8551),h=n(34),f=n(2195),p=n(788),m=n(1034),g=n(5966),y=n(6840),v=n(9039),b=n(8227),A=n(2293),k=n(7829),w=n(6682),C=n(1181),x=n(6395),S=b("matchAll"),E="RegExp String",B=E+" Iterator",R=C.set,T=C.getterFor(B),_=RegExp.prototype,L=TypeError,j=i("".indexOf),O=i("".matchAll),I=!!O&&!v(function(){O("a",/./)}),P=a(function(e,t,n,r){R(this,{type:B,regexp:e,string:t,global:n,unicode:r,done:!1})},E,function(){var e=T(this);if(e.done)return l(void 0,!0);var t=e.regexp,n=e.string,r=w(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))}),N=function(e){var t,n,r,o=d(this),i=u(e),a=A(o,RegExp),l=u(m(o));return t=new a(a===RegExp?o.source:o,l),n=!!~j(l,"g"),r=!!~j(l,"u")||!!~j(l,"v"),t.lastIndex=c(o.lastIndex),new P(t,i,n,r)};r({target:"String",proto:!0,forced:I},{matchAll:function(e){var t,n,r,i,a=s(this);if(h(e)){if(p(e)&&(t=u(s(m(e))),!~j(t,"g")))throw new L("`.matchAll` does not allow non-global regexes");if(I)return O(a,e);if(void 0===(r=g(e,S))&&x&&"RegExp"===f(e)&&(r=N),r)return o(r,e,a)}else if(I)return O(a,e);return n=u(a),i=new RegExp(e,"g"),x?o(N,i,n):i[S](n)}}),x||S in _||y(_,S,N)},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=[],d=0;;){if(c(o,l(t[d++])),d===n)return u(o,"");d<r&&c(o,l(arguments[d]))}}})},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)},4535:function(e,t,n){n.d(t,{J:function(){return o}});var r=n(6681),o=function(e){return null!=e?e:r.s6}},1041:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}n.d(t,{S:function(){return a}}),n(2675),n(9463),n(2259),n(5700),n(3792),n(9572),n(2892),n(9085),n(6099),n(7764),n(2953);var a=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.br=t,this.options},(t=[{key:"setup",value:function(e){this.options=Object.assign({},this.options,e)}},{key:"init",value:function(){}},{key:"_configurePageContainer",value:function(e){}},{key:"_configureToolbar",value:function(e){}},{key:"_bindNavigationHandlers",value:function(){}},{key:"extendNavBar",value:function(e){}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()},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(2892),n(9085),n(875),n(6099),n(8459),n(3362),n(825),n(7495),n(8781),n(9449),n(7764),n(5746),n(2762),n(2953),n(8408);var r=n(4907),o=n(1041),i=n(9073),a=n(4565),l=n(4160),s=n(593),c=n(1989),u=n(5703),d=n(1669);function h(e){return h="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},h(e)}function f(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||g(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function p(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=g(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,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 m(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)||g(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 g(e,t){if(e){if("string"==typeof e)return y(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)?y(e,t):void 0}}function y(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 v(){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 b(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,h.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=h.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]<=f&&((o=n<2&&f<i[1])?(l=0,h.v=r,h.n=i[1]):f<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,p),l=u,s=p;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(h.n=-1),f(l,s)):h.n=s:h.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=(d=h.n<0)?s:n.call(r,h))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(b(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,b(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,b(d,"constructor",c),b(c,"constructor",s),s.displayName="GeneratorFunction",b(c,o,"GeneratorFunction"),b(d),b(d,o,"Generator"),b(d,r,function(){return this}),b(d,"toString",function(){return"[object Generator]"}),(v=function(){return{w:i,m:h}})()}function b(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}b=function(e,t,n,r){function i(t,n){b(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))},b(e,t,n,r)}function A(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 k(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){A(i,r,o,a,l,"next",e)}function l(e){A(i,r,o,a,l,"throw",e)}a(void 0)})}}function w(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 x(e,t,n){return t&&C(e.prototype,t),n&&C(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function S(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(S=function(){return!!e})()}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function B(e,t){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},B(e,t)}function R(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"!=h(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=h(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==h(t)?t:t+""}var _=window.BookReader,L=function(e){function t(e){var n,r,o,i;return w(this,t),R((r=this,i=[e],o=E(o=t),n=function(e,t){if(t&&("object"==h(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,S()?Reflect.construct(o,i||[],E(r).constructor):o.apply(r,i))),"options",{enabled:!0,fullDjvuXmlUrl:null,singlePageDjvuXmlUrl:null,jsonp:!1,maxProtectedWords:200}),R(n,"djvuPagesPromise",null),R(n,"pageTextCache",new a.l),R(n,"maxWordRendered",2500),R(n,"_jumpedToHighlight",!1),R(n,"_measurementDocument",void 0),n.rtl="rl"===n.br.pageProgression,n.textSelectionManager=new s.bg(".BRtextLayer",n.br,{selectionElement:[".BRwordElement",".BRspace","mark"]},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&&B(e,t)}(t,e),x(t,[{key:"init",value:function(){var e=this;if(this.options.enabled){var t=document.createElement("iframe");t.setAttribute("aria-hidden","true"),t.tabIndex=-1,t.style.cssText="position:fixed; top:-99999px; left:-99999px; width:2000px; height:4000px; border:0; visibility:hidden;",document.body.appendChild(t),this._measurementDocument=t.contentDocument;var n=this._measurementDocument.createElement("style");n.textContent=u.A,this._measurementDocument.head.appendChild(n),this.br.on("pageVisible",function(t,n){var r=n.pageContainerEl,o=r.querySelector(".BRtextLayer");o&&e.br.trigger("textLayerVisible",{pageContainerEl:r,textLayer:o})}),this.loadData(),this.textSelectionManager.init();var r=new URLSearchParams(location.search).get("text");if(r){this.targetTextFragment=s.yc.fromString(r,this.br.book,this.br.firstIndex);var o=this.targetTextFragment;this.br.on("textLayerVisible",function(){var t=k(v().m(function t(n,r){var i,a,l;return v().w(function(t){for(;;)switch(t.n){case 0:i=r.pageContainerEl,a=r.textLayer,o.pageIndex===parseFloat(i.getAttribute("data-index"))&&(l=(0,s.lB)(a,o,"BRhighlight--target-text"),e._jumpedToHighlight||(e.br.scrollIntoView(l[0],{behavior:"smooth",block:"center"}),e._jumpedToHighlight=!0));case 1:return t.a(2)}},t)}));return function(e,n){return t.apply(this,arguments)}}())}}}},{key:"_configurePageContainer",value:function(e){var t;return this.options.enabled&&this.br.mode!==this.br.constModeThumb&&null!==(t=e.page)&&void 0!==t&&t.isViewable&&this.createTextLayer(e),e}},{key:"loadData",value:function(){this.options.singlePageDjvuXmlUrl||(this.djvuPagesPromise=d.ajax({type:"GET",url:(0,i.gT)(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=d.parseXML(e);return t&&d(t).find("OBJECT")}catch(e){return}}))}},{key:"getPageText",value:(o=k(v().m(function e(t){var n,r,o,a,l;return v().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,d.ajax({type:"GET",url:(0,i.gT)(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=d.parseXML(r),a=o&&d(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=k(v().m(function e(t){var n,o,i,a,s,u,h,f,g,y,b,A,k,w,C,x,S,E,B,R,T,_,L,O,P,N=this;return v().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(d(i).find("WORD").filter(function(e,t){var n=m(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(),I(i),!((a=d(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,h=parseFloat(t.$container[0].style.height)/t.page.height,s.style.transform="scale(".concat(u,", ").concat(h,")"),(f=(0,l.YH)(this.br.options.bookLanguage))&&s.setAttribute("lang",f),s.setAttribute("dir",this.rtl?"rtl":"ltr"),g=d(i).find("PARAGRAPH[coords]").toArray(),y=g.map(function(e){var t=N.renderParagraph(e);return s.appendChild(t),t}),b=j(s,".BRparagraphElement",this._measurementDocument),A=0,k=p((0,c.yU)(g,y));try{for(k.s();!(w=k.n()).done;)C=m(w.value,2),x=C[0],S=C[1],E=d(x).attr("coords").split(",").map(parseFloat),B=b.get(S),R=m(E,4),T=R[0],_=R[2],L=R[3],O=this.rtl?B.right-_:T-B.left,P=L-(B.top+A),S.style[this.rtl?"marginRight":"marginLeft"]="".concat(O,"px"),S.style.marginTop="".concat(P,"px"),A+=P,s.appendChild(S),s.appendChild(document.createTextNode("\n"))}catch(e){k.e(e)}finally{k.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],textLayer:s});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=m(d(e).attr("coords").split(",").map(parseFloat),4),r=n[0],o=n[1],i=n[2],a=n[3],l=[],s=d(e).find("LINE[coords]").toArray();if(!s.length)return t;var u,h=p((0,c.pp)((0,c.Px)(s,O)));try{for(h.s();!(u=h.n()).done;){var g=m(u.value,3),y=g[0],v=g[1],b=g[2],A=v.ocrElement==s[s.length-1],k=document.createElement("span");k.classList.add("BRlineElement");var w,C=p(v.words.entries());try{for(C.s();!(w=C.n()).done;){var x=m(w.value,2),S=x[0],E=x[1],B=m(d(E).attr("coords").split(",").map(parseFloat),4),R=B[1],T=B[2],_=B[3],L=R-_;if(l.push(L),0==S&&null!=y&&y.lastWord.textContent.trim().endsWith("-")){var I=m(d((b||y).firstWord).attr("coords").split(",").map(parseFloat),3)[0];d(E).attr("coords","".concat(I,",").concat(R,",").concat(T,",").concat(_))}var P=document.createElement("span");if(P.setAttribute("class","BRwordElement"),P.textContent=E.textContent.trim(),S>0){var N=document.createElement("span");N.classList.add("BRspace"),N.textContent=" ",N.setAttribute("aria-label"," "),k.append(N),k.appendChild(document.createTextNode(" "))}k.appendChild(P)}}catch(e){C.e(e)}finally{C.f()}var F=v.lastWord.textContent.trim().endsWith("-"),z=k.children[k.children.length-1];F&&!A&&(z.textContent=z.textContent.trim().slice(0,-1),z.classList.add("BRwordElement--hyphen")),t.appendChild(k),A||F||t.appendChild(document.createTextNode(" "))}}catch(e){h.e(e)}finally{h.f()}l.sort(function(e,t){return e-t});var M=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(M,"px");var D,q=j(t,".BRwordElement",this._measurementDocument),H=d(e).find("WORD").toArray(),G=t.querySelectorAll(".BRwordElement"),U=p((0,c.yU)(H,G));try{for(U.s();!(D=U.n()).done;){var W=m(D.value,2),K=W[0],J=W[1],$=q.get(J),V=m(d(K).attr("coords").split(",").map(parseFloat),3),X=V[0],Y=V[2]-X;K.textContent.endsWith(" ")&&(Y=Y*(K.textContent.length-1)/K.textContent.length);var Z=Y-$.width;J.style.letterSpacing="".concat(Z/(K.textContent.length-1),"px")}}catch(e){U.e(e)}finally{U.f()}q=j(t,".BRwordElement",this._measurementDocument);var Q,ee=j(t,".BRspace",this._measurementDocument),te=d(e).find("LINE[coords]").toArray(),ne=Array.from(t.querySelectorAll(".BRlineElement")),re=a,oe=p((0,c.yU)(te,ne));try{for(oe.s();!(Q=oe.n()).done;){var ie,ae=m(Q.value,2),le=ae[0],se=ae[1],ce=d(le).find("WORD").toArray(),ue=this.rtl?i:r,de=p((0,c.yU)(ce,se.querySelectorAll(".BRwordElement")));try{for(de.s();!(ie=de.n()).done;){var he=m(ie.value,2),fe=he[0],pe=he[1],me=q.get(pe),ge=m(d(fe).attr("coords").split(",").map(parseFloat),3),ye=ge[0],ve=ge[2],be=this.rtl?-(ve-ue):ye-ue;if(pe.previousElementSibling){var Ae=pe.previousElementSibling;Ae.style.letterSpacing="".concat(be-ee.get(Ae).width,"px")}else pe.style[this.rtl?"paddingRight":"paddingLeft"]="".concat(be,"px");this.rtl?ue-=be+me.width:ue+=be+me.width}}catch(e){de.e(e)}finally{de.f()}var ke=Math.min.apply(Math,f(ce.map(function(e){return parseFloat(d(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 j(e,t,n){var r={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",n.body.appendChild(e);var o=new Map(Array.from(e.querySelectorAll(t)).map(function(e){var t=e.getBoundingClientRect();return[e,new P(t.left+n.defaultView.scrollX,t.top+n.defaultView.scrollY,t.width,t.height)]}));return n.body.removeChild(e),Object.assign(e.style,r),document.adoptNode(e),o}function O(e){var t=d(e).find("WORD").toArray();return{ocrElement:e,words:t,firstWord:t[0],lastWord:t[t.length-1]}}function I(e){if(!d(e).attr("coords")&&e.children){var t=d(e).children().toArray();if(0!==t.length){var n,r=p(t);try{for(r.s();!(n=r.n()).done;)I(n.value)}catch(e){r.e(e)}finally{r.f()}var o,i=[],a=p(t);try{for(a.s();!(o=a.n()).done;){var l=o.value;d(l).attr("coords")&&i.push(d(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=p(e);try{for(a.s();!(t=a.n()).done;){var l=m(t.value,4),s=l[0],c=l[1],u=l[2],d=l[3];n=Math.min(n,s),r=Math.max(r,c),o=Math.max(o,u),i=Math.min(i,d)}}catch(e){a.e(e)}finally{a.f()}return[n,r,o,i]}(i);Math.abs(s[0])!=1/0&&d(e).attr("coords",s.join(","))}}}null==_||_.registerPlugin("textSelection",L);var P=function(){return x(function e(t,n,r,o){w(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 m},ND:function(){return p},YH:function(){return d},_4:function(){return h}}),n(2675),n(9463),n(2259),n(3418),n(4423),n(3792),n(4782),n(2010),n(875),n(6099),n(3362),n(7495),n(8781),n(1699),n(7764),n(2953);var r=[],o={},i={},a={};[["Serbian","српски језик","sr","srp","srp"],["Romanian, Moldavian, Moldovan","Română","ro","ron","rum"],["Sichuan Yi, Nuosu","ꆈꌠ꒿ Nuosuhxop","ii","iii","iii"],["Tahitian","Reo Tahiti","ty","tah","tah"],["Tagalog","Wikang Tagalog","tl","tgl","tgl"],["Yiddish","ייִדיש","yi","yid","yid"],["Akan","Akan","ak","aka","aka"],["Malay","Bahasa Melayu, بهاس ملايو","ms","msa","may"],["Arabic","العربية","ar","ara","ara"],["Norwegian","Norsk","no","nor","nor"],["Ojibwa","ᐊᓂᔑᓈᐯᒧᐎᓐ","oj","oji","oji"],["Fulah","Fulfulde, Pulaar, Pular","ff","ful","ful"],["Persian","فارسی","fa","fas","per"],["Albanian","Shqip","sq","sqi","alb"],["Aymara","aymar aru","ay","aym","aym"],["Azerbaijani","azərbaycan dili","az","aze","aze"],["Chinese","中文 (Zhōngwén), 汉语, 漢語","zh","zho","chi"],["Cree","ᓀᐦᐃᔭᐍᐏᐣ","cr","cre","cre"],["Estonian","eesti, eesti keel","et","est","est"],["Guaraní","Avañe'ẽ","gn","grn","grn"],["Inupiaq","Iñupiaq, Iñupiatun","ik","ipk","ipk"],["Inuktitut","ᐃᓄᒃᑎᑐᑦ","iu","iku","iku"],["Kanuri","Kanuri","kr","kau","kau"],["Komi","коми кыв","kv","kom","kom"],["Kongo","Kikongo","kg","kon","kon"],["Kurdish","Kurdî, أۇزبېك","ku","kur","kur"],["Latvian","latviešu valoda","lv","lav","lav"],["Malagasy","fiteny malagasy","mg","mlg","mlg"],["Mongolian","Монгол хэл","mn","mon","mon"],["Oromo","Afaan Oromoo","om","orm","orm"],["Pashto, Pushto","پښتو","ps","pus","pus"],["Quechua","Runa Simi, Kichwa","qu","que","que"],["Sardinian","sardu","sc","srd","srd"],["Swahili","Kiswahili","sw","swa","swa"],["Uzbek","Oʻzbek, Ўзбек, ","uz","uzb","uzb"],["Zhuang, Chuang","Saɯ cueŋƅ, Saw cuengh","za","zha","zha"],["Bislama","Bislama","bi","bis","bis"],["Norwegian Bokmål","Norsk Bokmål","nb","nob","nob"],["Norwegian Nynorsk","Norsk Nynorsk","nn","nno","nno"],["Indonesian","Bahasa Indonesia","id","ind","ind"],["Twi","Twi","tw","twi","twi"],["Esperanto","Esperanto","eo","epo","epo"],["Interlingua","Interlingua","ia","ina","ina"],["Interlingue","Originally called Occidental; then Interlingue after WWII","ie","ile","ile"],["Ido","Ido","io","ido","ido"],["Volapük","Volapük","vo","vol","vol"],["Bihari languages","भोजपुरी","bh","bih","bih"],["Hebrew (modern)","עברית","he","heb","heb"],["Sanskrit","संस्कृतम्","sa","san","san"],["Church Slavic, Church Slavonic, Old Church Slavonic, Old Slavonic, Old Bulgarian","ѩзыкъ словѣньскъ","cu","chu","chu"],["Pali","पाऴि","pi","pli","pli"],["Avestan","avesta","ae","ave","ave"],["Latin","latine, lingua latina","la","lat","lat"],["Armenian","Հայերեն","hy","hye","arm"],["Swati","SiSwati","ss","ssw","ssw"],["Tibetan","བོད་ཡིག","bo","bod","tib"],["South Ndebele","isiNdebele","nr","nbl","nbl"],["Slovene","Slovenski Jezik, Slovenščina","sl","slv","slv"],["Oriya","ଓଡ଼ିଆ","or","ori","ori"],["North Ndebele","isiNdebele","nd","nde","nde"],["Nauru","Dorerin Naoero","na","nau","nau"],["Maori","te reo Māori","mi","mri","mao"],["Marathi","मराठी","mr","mar","mar"],["Luba-Katanga","Kiluba","lu","lub","lub"],["Rundi","Ikirundi","rn","run","run"],["Central Khmer","ខ្មែរ, ខេមរភាសា, ភាសាខ្មែរ","km","khm","khm"],["Western Frisian","Frysk","fy","fry","fry"],["Bengali","বাংলা","bn","ben","ben"],["Avaric","авар мацӀ, магӀарул мацӀ","av","ava","ava"],["Abkhazian","аҧсуа бызшәа, аҧсшәа","ab","abk","abk"],["Afar","Afaraf","aa","aar","aar"],["Afrikaans","Afrikaans","af","afr","afr"],["Amharic","አማርኛ","am","amh","amh"],["Aragonese","aragonés","an","arg","arg"],["Assamese","অসমীয়া","as","asm","asm"],["Bambara","bamanankan","bm","bam","bam"],["Bashkir","башҡорт теле","ba","bak","bak"],["Basque","euskara, euskera","eu","eus","baq"],["Belarusian","беларуская мова","be","bel","bel"],["Bosnian","bosanski jezik","bs","bos","bos"],["Breton","brezhoneg","br","bre","bre"],["Bulgarian","български език","bg","bul","bul"],["Burmese","ဗမာစာ","my","mya","bur"],["Catalan, Valencian","català, valencià","ca","cat","cat"],["Chamorro","Chamoru","ch","cha","cha"],["Chechen","нохчийн мотт","ce","che","che"],["Chichewa, Chewa, Nyanja","chiCheŵa, chinyanja","ny","nya","nya"],["Chuvash","чӑваш чӗлхи","cv","chv","chv"],["Cornish","Kernewek","kw","cor","cor"],["Corsican","corsu, lingua corsa","co","cos","cos"],["Croatian","hrvatski jezik","hr","hrv","hrv"],["Czech","čeština, český jazyk","cs","ces","cze"],["Danish","dansk","da","dan","dan"],["Divehi, Dhivehi, Maldivian","ދިވެހި","dv","div","div"],["Dutch, Flemish","Nederlands, Vlaams","nl","nld","dut"],["Dzongkha","རྫོང་ཁ","dz","dzo","dzo"],["English","English","en","eng","eng"],["Ewe","Eʋegbe","ee","ewe","ewe"],["Faroese","føroyskt","fo","fao","fao"],["Fijian","vosa Vakaviti","fj","fij","fij"],["Finnish","suomi, suomen kieli","fi","fin","fin"],["French","français, langue française","fr","fra","fre"],["Galician","Galego","gl","glg","glg"],["Georgian","ქართული","ka","kat","geo"],["German","Deutsch","de","deu","ger"],["Greek (modern)","ελληνικά","el","ell","gre"],["Gujarati","ગુજરાતી","gu","guj","guj"],["Haitian, Haitian Creole","Kreyòl ayisyen","ht","hat","hat"],["Hausa","(Hausa) هَوُسَ","ha","hau","hau"],["Herero","Otjiherero","hz","her","her"],["Hindi","हिन्दी, हिंदी","hi","hin","hin"],["Hiri Motu","Hiri Motu","ho","hmo","hmo"],["Hungarian","magyar","hu","hun","hun"],["Irish","Gaeilge","ga","gle","gle"],["Igbo","Asụsụ Igbo","ig","ibo","ibo"],["Icelandic","Íslenska","is","isl","ice"],["Italian","Italiano","it","ita","ita"],["Japanese","日本語 (にほんご)","ja","jpn","jpn"],["Javanese","ꦧꦱꦗꦮ, Basa Jawa","jv","jav","jav"],["Kalaallisut, Greenlandic","kalaallisut, kalaallit oqaasii","kl","kal","kal"],["Kannada","ಕನ್ನಡ","kn","kan","kan"],["Kashmiri","कश्मीरी, كشميري","ks","kas","kas"],["Kazakh","қазақ тілі","kk","kaz","kaz"],["Kikuyu, Gikuyu","Gĩkũyũ","ki","kik","kik"],["Kinyarwanda","Ikinyarwanda","rw","kin","kin"],["Kirghiz, Kyrgyz","Кыргызча, Кыргыз тили","ky","kir","kir"],["Korean","한국어","ko","kor","kor"],["Kuanyama, Kwanyama","Kuanyama","kj","kua","kua"],["Luxembourgish, Letzeburgesch","Lëtzebuergesch","lb","ltz","ltz"],["Ganda","Luganda","lg","lug","lug"],["Limburgan, Limburger, Limburgish","Limburgs","li","lim","lim"],["Lingala","Lingála","ln","lin","lin"],["Lao","ພາສາລາວ","lo","lao","lao"],["Lithuanian","lietuvių kalba","lt","lit","lit"],["Manx","Gaelg, Gailck","gv","glv","glv"],["Macedonian","македонски јазик","mk","mkd","mac"],["Malayalam","മലയാളം","ml","mal","mal"],["Maltese","Malti","mt","mlt","mlt"],["Marshallese","Kajin M̧ajeļ","mh","mah","mah"],["Navajo, Navaho","Diné bizaad","nv","nav","nav"],["Nepali","नेपाली","ne","nep","nep"],["Ndonga","Owambo","ng","ndo","ndo"],["Occitan","occitan, lenga d'òc","oc","oci","oci"],["Ossetian, Ossetic","ирон æвзаг","os","oss","oss"],["Panjabi, Punjabi","ਪੰਜਾਬੀ","pa","pan","pan"],["Polish","język polski, polszczyzna","pl","pol","pol"],["Portuguese","Português","pt","por","por"],["Romansh","Rumantsch Grischun","rm","roh","roh"],["Russian","русский","ru","rus","rus"],["Sindhi","सिन्धी, سنڌي، سندھی","sd","snd","snd"],["Northern Sami","Davvisámegiella","se","sme","sme"],["Samoan","gagana fa'a Samoa","sm","smo","smo"],["Sango","yângâ tî sängö","sg","sag","sag"],["Gaelic, Scottish Gaelic","Gàidhlig","gd","gla","gla"],["Shona","chiShona","sn","sna","sna"],["Sinhala, Sinhalese","සිංහල","si","sin","sin"],["Slovak","Slovenčina, Slovenský Jazyk","sk","slk","slo"],["Somali","Soomaaliga, af Soomaali","so","som","som"],["Southern Sotho","Sesotho","st","sot","sot"],["Spanish, Castilian","Español","es","spa","spa"],["Sundanese","Basa Sunda","su","sun","sun"],["Swedish","Svenska","sv","swe","swe"],["Tamil","தமிழ்","ta","tam","tam"],["Telugu","తెలుగు","te","tel","tel"],["Tajik","тоҷикӣ, toçikī, تاجیکی","tg","tgk","tgk"],["Thai","ไทย","th","tha","tha"],["Tigrinya","ትግርኛ","ti","tir","tir"],["Turkmen","Türkmen, Түркмен","tk","tuk","tuk"],["Tswana","Setswana","tn","tsn","tsn"],["Tongan (Tonga Islands)","Faka Tonga","to","ton","ton"],["Turkish","Türkçe","tr","tur","tur"],["Tsonga","Xitsonga","ts","tso","tso"],["Tatar","татар теле, tatar tele","tt","tat","tat"],["Uighur, Uyghur","ئۇيغۇرچە, Uyghurche","ug","uig","uig"],["Ukrainian","Українська","uk","ukr","ukr"],["Urdu","اردو","ur","urd","urd"],["Venda","Tshivenḓa","ve","ven","ven"],["Vietnamese","Tiếng Việt","vi","vie","vie"],["Walloon","Walon","wa","wln","wln"],["Welsh","Cymraeg","cy","cym","wel"],["Wolof","Wollof","wo","wol","wol"],["Xhosa","isiXhosa","xh","xho","xho"],["Yoruba","Yorùbá","yo","yor","yor"],["Zulu","isiZulu","zu","zul","zul"]].forEach(e=>{var t={name:e[0],nativeName:e[1],iso639_1:e[2],iso639_2T:e[3],iso639_2B:e[4]};o[e[2]]=i[e[3]]=a[e[4]]=t,r.push(t)});var 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}var u={"zh-hans":"中文 (Zhōngwén)"};function d(e){if(!e)return null;if(e=e.toLocaleLowerCase(),u[e])return e;var t=f(e,["iso639_1"])||f(e,["iso639_2T"])||f(e,["iso639_2B","name","nativeName"]);return t?t.iso639_1:null}function h(e){if(!e)return null;if(e=e.toLocaleLowerCase(),u[e])return u[e];var t=f(e,["iso639_1"])||f(e,["iso639_2T"])||f(e,["iso639_2B","name","nativeName"]);return null!=t&&t.nativeName?t.nativeName.split(", ")[0]:null}function f(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 p(){try{return!!window.localStorage}catch(e){return!1}}var m=-1!=location.toString().indexOf("_debugReadAloud=true")},593:function(e,t,n){n.d(t,{yc:function(){return xe},bg:function(){return ue},lB:function(){return ke}}),n(2675),n(9463),n(2259),n(5700),n(8125),n(8706),n(2008),n(113),n(3418),n(4423),n(3792),n(8598),n(2062),n(4782),n(4554),n(739),n(9572),n(2010),n(4731),n(479),n(2892),n(9085),n(2811),n(3851),n(875),n(9432),n(6099),n(8459),n(3362),n(825),n(888),n(4864),n(7495),n(9479),n(8781),n(1699),n(7764),n(1761),n(5906),n(5440),n(2762),n(8344),n(3500),n(2953),n(8408);var r=n(9073),o=n(1669);function i(e){return i="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},i(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,s(r.key),r)}}function l(e,t,n){return(t=s(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){var t=function(e){if("object"!=i(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=i(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==i(t)?t:t+""}var c,u,d,h,f,p,m,g,y,v,b,A,k,w,C,x,S,E=function(){return e=function e(t,n){var r=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,"selecting",!1),l(this,"startedInSelector",!1),l(this,"target",null),l(this,"lastKnownFocusNode",null),l(this,"_onSelectionChange",function(){var e=window.getSelection();if(e){if(!r.selecting&&e.toString()){var t=o(e.anchorNode).closest(r.selector)[0];if(!t)return;r.target=t,r.selecting=!0,r.lastKnownFocusNode=e.focusNode,r.handler("started",r.target)}r.selecting&&r.lastKnownFocusNode!=e.focusNode&&e.toString()&&!e.isCollapsed&&(r.lastKnownFocusNode=e.focusNode,r.handler("changed",r.target)),!r.selecting||!e.isCollapsed&&e.toString()&&o(e.anchorNode).closest(r.selector)[0]||(r.selecting=!1,r.lastKnownFocusNode=null,r.handler("cleared",r.target))}}),this.selector=t,this.handler=n},(t=[{key:"attach",value:function(){document.addEventListener("selectionchange",this._onSelectionChange)}},{key:"detach",value:function(){document.removeEventListener("selectionchange",this._onSelectionChange)}}])&&a(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}(),B=n(8004),R=n(420),T=n(9696),_=n(4535),L=(n(90),n(8918),n(6090),n(7583)),j=n(1989),O=n(1669);function I(e){return I="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},I(e)}function P(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=X(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 N(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 F(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){N(i,r,o,a,l,"next",e)}function l(e){N(i,r,o,a,l,"throw",e)}a(void 0)})}}function z(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function M(e,t,n){return t=ee(t),function(e,t){if(t&&("object"==I(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,D()?Reflect.construct(t,n||[],ee(e).constructor):t.apply(e,n))}function D(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(D=function(){return!!e})()}function q(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&&H(e,t)}function H(e,t){return H=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},H(e,t)}function G(e,t,n,r){var o=U();if(r)for(var i=0;i<r.length;i++)o=r[i](o);var a=t(function(e){o.initializeInstanceElements(e,l.elements)},n),l=o.decorateClass(function(e){for(var t=[],n=function(e){return"method"===e.kind&&e.key===i.key&&e.placement===i.placement},r=0;r<e.length;r++){var o,i=e[r];if("method"===i.kind&&(o=t.find(n)))if($(i.descriptor)||$(o.descriptor)){if(J(i)||J(o))throw new ReferenceError("Duplicated methods ("+i.key+") can't be decorated.");o.descriptor=i.descriptor}else{if(J(i)){if(J(o))throw new ReferenceError("Decorators can't be placed on different accessors with for the same property ("+i.key+").");o.decorators=i.decorators}K(i,o)}else t.push(i)}return t}(a.d.map(W)),e);return o.initializeClassElements(a.F,l.elements),o.runClassFinishers(a.F,l.finishers)}function U(){U=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(!J(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)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||X(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=se(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:V(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=V(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 W(e){var t,n=se(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 K(e,t){void 0!==e.descriptor.get?t.descriptor.get=e.descriptor.get:t.descriptor.set=e.descriptor.set}function J(e){return e.decorators&&e.decorators.length}function $(e){return void 0!==e&&!(void 0===e.value&&void 0===e.writable)}function V(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 X(e,t){if(e){if("string"==typeof e)return Y(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)?Y(e,t):void 0}}function Y(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 Z(e,t,n,r){var o=Q(ee(1&r?e.prototype:e),t,n);return 2&r&&"function"==typeof o?function(e){return o.apply(n,e)}:o}function Q(){return Q="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ee(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Q.apply(null,arguments)}function ee(e){return ee=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ee(e)}function te(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(I(e)+" is not iterable")}function ne(){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 re(c,"_invoke",function(n,r,o){var i,l,s,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,l=0,s=e,h.n=n,a}};function f(n,r){for(l=n,s=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=h.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]<=f&&((o=n<2&&f<i[1])?(l=0,h.v=r,h.n=i[1]):f<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,l=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,p),l=u,s=p;(t=l<2?e:s)||!d;){i||(l?l<3?(l>1&&(h.n=-1),f(l,s)):h.n=s:h.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=(d=h.n<0)?s:n.call(r,h))!==a)break}catch(t){i=e,l=1,s=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function l(){}function s(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(re(t={},r,function(){return this}),t),d=c.prototype=l.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,re(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return s.prototype=c,re(d,"constructor",c),re(c,"constructor",s),s.displayName="GeneratorFunction",re(c,o,"GeneratorFunction"),re(d),re(d,o,"Generator"),re(d,r,function(){return this}),re(d,"toString",function(){return"[object Generator]"}),(ne=function(){return{w:i,m:h}})()}function re(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}re=function(e,t,n,r){function i(t,n){re(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))},re(e,t,n,r)}function oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ie(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,se(r.key),r)}}function ae(e,t,n){return t&&ie(e.prototype,t),n&&ie(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function le(e,t,n){return(t=se(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function se(e){var t=function(e){if("object"!=I(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=I(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==I(t)?t:t+""}var ce="BRhighlightStorage",ue=function(){return ae(function e(t,n,r,o){var i=this,a=r.selectionElement;oe(this,e),le(this,"options",{maxProtectedWords:200}),le(this,"selectMenu",void 0),le(this,"_onSelectionChange",function(e,t){if("started"===e)i.textSelectingMode(t);else if("cleared"===e)i.defaultMode(t);else if("changed"!==e)throw new Error("Unknown type ".concat(e))}),le(this,"_limitSelection",function(){var e=window.getSelection();if(e.rangeCount){var t=e.getRangeAt(0),n=!!t.startContainer.parentElement.closest(".BRcontainer"),r=!!t.endContainer.parentElement.closest(".BRcontainer");if(n||r)if(n&&r){var o=(0,j.eU)((0,j.nC)(de(t,"element"),function(e){return e.classList.contains(i.selectionElement[0].replace(".",""))}),i.options.maxProtectedWords-1);if(o&&t.endContainer.parentNode!=o){var a=document.createRange();a.setStart(t.startContainer,t.startOffset),a.setEnd(o.firstChild,o.textContent.length),e.removeAllRanges(),e.addRange(a)}}else e.removeAllRanges()}}),this.layer=t,this.br=n,this.selectionElement=a,this.selectionObserver=new E(this.layer,this._onSelectionChange),this.options.maxProtectedWords=o||200,this.selectMenu=new he(n),this.selectMenu.className="br-select-menu__root"},[{key:"selectMenuEnabled",get:function(){var e,t;return(null===(e=this.br.plugins.experiments)||void 0===e?void 0:e.isEnabled("copyLinkToHighlight"))||(null===(t=this.br.plugins.experiments)||void 0===t?void 0:t.isEnabled("annotateHighlight"))}},{key:"init",value:function(){var e=this;this.attach(),new E(this.layer,function(t){var n,r;"started"==t&&(null===(n=e.br.plugins.archiveAnalytics)||void 0===n||n.sendEvent("BookReader","SelectStart"),e.br.refs.$br.find(".BRpagecontainer--hasSelection").removeClass("BRpagecontainer--hasSelection"),O(window.getSelection().anchorNode).closest(".BRpagecontainer").addClass("BRpagecontainer--hasSelection"),e.mouseIsDown||e.showSelectMenu()),"changed"==t&&!e.mouseIsDown&&null!==(r=window.getSelection())&&void 0!==r&&r.toString()&&e.showSelectMenu(),"cleared"==t&&e.hideSelectMenu()}).attach()}},{key:"attach",value:function(){var e=this;this.selectionObserver.attach(),this.br.protected&&(document.addEventListener("selectionchange",this._limitSelection),O(document.body).on("contextmenu dragstart copy",function(t){var n=document.getSelection();if(null!=n&&n.toString()&&O(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=O(e).closest(".BRpagecontainer");e.style.pointerEvents="none",n.find("img").css("pointer-events","auto"),O(e).off(".textSelectPluginHandler");var r=this.mouseIsDown,o=this.mouseIsDown;r&&(e.style.pointerEvents="auto"),O(e).on("mousedown.textSelectPluginHandler",function(e){t.mouseIsDown=!0,O(e.target).is(t.selectionElement.join(", "))&&e.stopPropagation()}),O(e).on("mouseup.textSelectPluginHandler",function(n){t.mouseIsDown=!1,e.style.pointerEvents="none",o&&(o=!1,n.stopPropagation())})}},{key:"textSelectingMode",value:function(e){var t=this,n=O(e).closest(".BRpagecontainer");e.style.pointerEvents="all",n.find("img").css("pointer-events","none"),O(e).off(".textSelectPluginHandler"),O(e).on("mousedown.textSelectPluginHandler",function(e){1==e.which&&(t.mouseIsDown=!0,e.stopPropagation())}),O(e).on("mouseup.textSelectPluginHandler",function(e){t.mouseIsDown=!1,1==e.which&&(e.stopPropagation(),t.showSelectMenu())})}},{key:"showSelectMenu",value:function(){this.selectMenuEnabled&&(this.selectMenu.copyLinkToHighlightEnabled=this.br.plugins.experiments.isEnabled("copyLinkToHighlight"),this.selectMenu.highlightAnnotationEnabled=this.br.plugins.experiments.isEnabled("annotateHighlight"),this.selectMenu.isConnected||document.body.append(this.selectMenu),this.selectMenu.open?this.selectMenu.repositionToSelection():this.selectMenu.show())}},{key:"hideSelectMenu",value:function(){this.selectMenu.hide()}}])}();function de(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"text+element";return ne().m(function n(){var r,o,i,a,l;return ne().w(function(n){for(;;)switch(n.n){case 0:return l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.children,r=void 0===n||n,s=t.parents,c=void 0===s||s,u=t.siblings,d=void 0===u||u;return ne().m(function t(){var n;return ne().w(function(t){for(;;)switch(t.n){case 0:if(e!==o){t.n=2;break}if(i=!0,!a(e)){t.n=1;break}return t.n=1,e;case 1:return t.a(2);case 2:if(!a(e)){t.n=3;break}return t.n=3,e;case 3:if(!r||!e.firstChild){t.n=5;break}return t.d(te(l(e.firstChild,{children:!0,parents:!1,siblings:!0})),4);case 4:if(!i){t.n=5;break}return t.a(2);case 5:if(!d){t.n=9;break}n=e.nextSibling;case 6:if(!n){t.n=9;break}return t.d(te(l(n,{children:!0,parents:!1,siblings:!1})),7);case 7:if(!i){t.n=8;break}return t.a(2);case 8:n=n.nextSibling,t.n=6;break;case 9:if(!c||!e.parentNode){t.n=11;break}return t.d(te(l(e.parentNode,{children:!1,parents:!0,siblings:!0})),10);case 10:if(!i){t.n=11;break}return t.a(2);case 11:return t.a(2)}},t)})()},r=e.startContainer,o=e.endContainer,i=!1,a=function(e){return"text"===t&&e.nodeType===Node.TEXT_NODE||"element"===t&&e.nodeType===Node.ELEMENT_NODE||"text+element"===t},n.d(te(l(r)),1);case 1:return n.a(2)}},n)})()}G([(0,T.EM)("br-menu-option")],function(e,t){var n=function(t){function n(){var t;oe(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return t=M(this,n,[].concat(o)),e(t),t}return q(n,t),ae(n)}(t);return{F:n,d:[{kind:"field",decorators:[(0,T.MZ)({type:String})],key:"icon",value:function(){return""}},{kind:"field",decorators:[(0,T.MZ)({type:String})],key:"label",value:function(){return""}},{kind:"field",key:"temporaryText",value:function(){return null}},{kind:"field",decorators:[(0,T.MZ)({type:Number,attribute:"temporary-text-duration"})],key:"temporaryTextDuration",value:function(){return 1200}},{kind:"field",decorators:[(0,T.MZ)({type:String,attribute:"aria-label"})],key:"ariaLabel",value:function(){return""}},{kind:"field",decorators:[(0,T.MZ)({type:Boolean,attribute:"live-label"})],key:"liveLabel",value:function(){return!1}},{kind:"field",decorators:[(0,T.MZ)({type:Boolean})],key:"temporaryTextVisible",value:function(){return!1}},{kind:"field",key:"temporaryTextTimeoutId",value:function(){return null}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"disconnectedCallback",value:function(){null!=this.temporaryTextTimeoutId&&(window.clearTimeout(this.temporaryTextTimeoutId),this.temporaryTextTimeoutId=null),Z(n,"disconnectedCallback",this,3)([])}},{kind:"method",key:"showTemporaryText",value:function(e){var t=this;null!=e&&e.trim()&&(this.temporaryText=e,this.temporaryTextVisible=!0,null!=this.temporaryTextTimeoutId&&window.clearTimeout(this.temporaryTextTimeoutId),this.temporaryTextTimeoutId=window.setTimeout(function(){t.temporaryTextVisible=!1,t.temporaryText=null,t.temporaryTextTimeoutId=null},this.temporaryTextDuration))}},{kind:"method",key:"renderIcon",value:function(){return"share"===this.icon?(0,R.qy)(c||(c=z(['<ia-icon-share class="br-select-menu__icon" aria-hidden="true"></ia-icon-share>']))):"edit-pencil"===this.icon?(0,R.qy)(u||(u=z(['<ia-icon-edit-pencil class="br-select-menu__icon" aria-hidden="true"></ia-icon-edit-pencil>']))):"ellipses"===this.icon?(0,R.qy)(d||(d=z(['<ia-icon-ellipses class="br-select-menu__icon" aria-hidden="true"></ia-icon-ellipses>']))):""}},{kind:"method",key:"render",value:function(){var e,t,n=null!==(e=this.label)&&void 0!==e?e:"",r=!!this.temporaryText,o=r?this.temporaryText:n,i=r&&this.temporaryTextVisible,a=i?o:n,l=null===(t=this.ariaLabel)||void 0===t?void 0:t.trim(),s=l&&l!==a.trim()?l:void 0,c=n.length>=o.length?n:o;return(0,R.qy)(h||(h=z(['\n <button\n type="button"\n class="br-select-menu__option"\n role="menuitem"\n aria-label=',"\n >\n ","\n ","\n </button>\n "])),(0,_.J)(s),this.renderIcon(),r||n?r?(0,R.qy)(f||(f=z(['\n <span class="br-select-menu__label-wrap" style="display: inline-flex; position: relative; align-items: center;">\n <span\n class="br-select-menu__label"\n style="visibility: hidden;"\n aria-hidden="true"\n >','</span>\n <span\n class="br-select-menu__label"\n style="position: absolute; inset: 0; display: inline-flex; align-items: center;"\n aria-live=',"\n >","</span>\n </span>\n "])),c,this.liveLabel?"polite":"off",i?o:n):(0,R.qy)(p||(p=z(['\n <span class="br-select-menu__label" aria-live=',">","</span>\n "])),this.liveLabel?"polite":"off",n):"")}}]}},R.WF);var he=G([(0,T.EM)("br-select-menu")],function(e,t){var n,r,o=function(t){function n(t){var r;return oe(this,n),r=M(this,n),e(r),r.br=t,r}return q(n,t),ae(n)}(t);return{F:o,d:[{kind:"field",key:"br",value:void 0},{kind:"field",decorators:[(0,T.MZ)({type:Boolean,reflect:!0})],key:"showExtended",value:function(){return!1}},{kind:"field",decorators:[(0,T.P)("#br-select-copy-link-option")],key:"copyLinkOption",value:void 0},{kind:"field",decorators:[(0,T.MZ)({type:Boolean,reflect:!0})],key:"open",value:function(){return!1}},{kind:"field",decorators:[(0,T.MZ)({type:Boolean})],key:"copyLinkToHighlightEnabled",value:function(){return!0}},{kind:"field",decorators:[(0,T.MZ)({type:Boolean})],key:"highlightAnnotationEnabled",value:function(){return!0}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"field",key:"_scrollTimeoutId",value:function(){return null}},{kind:"field",key:"_onScroll",value:function(){var e=this;return function(){e.classList.add("br-select-menu__root--scrolling"),null!=e._scrollTimeoutId&&clearTimeout(e._scrollTimeoutId),e._scrollTimeoutId=window.setTimeout(function(){e._scrollTimeoutId=null,e.repositionToSelection(),e.classList.remove("br-select-menu__root--scrolling")},150)}}},{kind:"method",key:"connectedCallback",value:function(){Z(o,"connectedCallback",this,3)([]),this.setAttribute("role","menu"),this.setAttribute("aria-label","Text selection actions"),this.setAttribute("aria-orientation","vertical")}},{kind:"method",key:"disconnectedCallback",value:function(){Z(o,"disconnectedCallback",this,3)([]),window.removeEventListener("scroll",this._onScroll,{capture:!0}),null!=this._scrollTimeoutId&&(clearTimeout(this._scrollTimeoutId),this._scrollTimeoutId=null)}},{kind:"method",key:"renderCopyLinkToHighlightOption",value:function(){return(0,R.qy)(m||(m=z(['\n <br-menu-option\n id="br-select-copy-link-option"\n @mousedown=',"\n @click=",'\n icon="share"\n label="Copy Link to Highlight"\n live-label\n ></br-menu-option>\n '])),function(e){return e.preventDefault()},this.handleCopyLinkToHighlight)}},{kind:"method",key:"renderRemoveOption",value:function(){return(0,R.qy)(g||(g=z(["\n <br-menu-option\n @click=",'\n icon="share"\n label="Delete Highlight and Annotation"\n ></br-menu-option>\n '])),this.handleDeleteHighlight)}},{kind:"method",key:"renderAddAnnotationOption",value:function(){return(0,R.qy)(y||(y=z(["\n <br-menu-option\n @click=",'\n icon="edit-pencil"\n label="Annotate"\n ></br-menu-option>\n '])),this.handleAddAnnotation)}},{kind:"method",key:"renderHighlightOption",value:function(){return(0,R.qy)(v||(v=z(["\n <br-menu-option\n @click=",'\n icon="edit-pencil"\n label="Highlight Selection"\n ></br-menu-option>\n '])),this.handleHighlightSave)}},{kind:"method",key:"renderShowMoreOption",value:function(){return(0,R.qy)(b||(b=z(['\n <br-menu-option\n id="br-select-more"\n @mousedown=',"\n @click=",'\n icon="ellipses"\n aria-label="Show more options"\n ></br-menu-option>\n '])),function(e){return e.preventDefault()},this.toggleExtendedMenu)}},{kind:"method",key:"renderLocalStorageOptions",value:function(){return(0,R.qy)(A||(A=z(["\n <br-menu-option\n @click=",'\n icon="share"\n label="Load Highlights"\n ></br-menu-option>\n <br-menu-option\n @click=','\n icon="share"\n label="Remove Stored Highlights"\n ></br-menu-option>'])),this.renderSavedHighlights,function(){window.localStorage.removeItem(ce)})}},{kind:"method",key:"renderDefaultOptions",value:function(){return(0,R.qy)(k||(k=z(["\n ","\n ","\n ","\n "])),this.copyLinkToHighlightEnabled?this.renderCopyLinkToHighlightOption():"",this.highlightAnnotationEnabled&&!this.nodesForRemoval?this.renderHighlightOption():"",this.nodesForRemoval?this.renderRemoveOption():"")}},{kind:"method",key:"renderExtendedOptions",value:function(){return(0,R.qy)(w||(w=z(["\n ","\n ","\n "])),this.renderDefaultOptions(),this.renderLocalStorageOptions())}},{kind:"method",key:"render",value:function(){var e,t=null===(e=this.br.plugins.experiments)||void 0===e?void 0:e.isEnabled("annotateHighlight");return(0,R.qy)(C||(C=z(["\n ","\n ","\n "])),this.showExtended?this.renderExtendedOptions():this.renderDefaultOptions(),!this.showExtended&&t?this.renderShowMoreOption():"")}},{kind:"method",key:"handleCopyLinkToHighlight",value:(r=F(ne().m(function e(t){var n,r,o,i,a,l,s,c,u,d,h,f;return ne().w(function(e){for(;;)switch(e.n){case 0:if(t.preventDefault(),r=window.getSelection(),o=r.getRangeAt(0),i=this.getNodeTextLayer(o.startContainer)){e.n=1;break}return console.warn("No text layer found for selection"),e.a(2);case 1:return a=xe.fromSelection(r,[i]),(l=new URLSearchParams(this.br.readQueryString())).has("text")&&l.delete("text"),s=l.toString(),s+=(s?"&":"")+"text=".concat(a.toUrlString()),c=window.location,u=a.pageNumber||"n".concat(a.pageIndex),d=c.pathname.replace(/((?:^|[#/])page)\/[^/]+/,"$1/".concat(u)),h=c.hash?c.hash.replace(/((?:^|[#/])page)\/[^/]+/,"$1/".concat(u)):"",f="".concat(c.origin).concat(d,"?").concat(s).concat(h),e.n=2,navigator.clipboard.writeText(f);case 2:null===(n=this.copyLinkOption)||void 0===n||n.showTemporaryText("Copied!");case 3:return e.a(2)}},e,this)})),function(e){return r.apply(this,arguments)})},{kind:"method",key:"toggleExtendedMenu",value:function(e){e.preventDefault(),this.showExtended=!this.showExtended}},{kind:"method",key:"getNodeTextLayer",value:function(e){var t;if(!e)return null;var n=e instanceof Element?e:e.parentElement;return null!==(t=null==n?void 0:n.closest(".BRtextLayer"))&&void 0!==t?t:null}},{kind:"method",key:"handleHighlightSave",value:function(){var e=window.getSelection(),t="backward"===e.direction?e.focusNode.parentElement:e.anchorNode.parentElement,n=this.getNodeTextLayer(t),r=xe.fromSelection(e,[n.parentElement]);r.uuid="id-".concat(crypto.randomUUID().split("-")[4]);var o=this.loadHighlightsFromLocalStorage();o.push(r),this.saveToLocalStorage(o),this.renderSavedHighlights()}},{kind:"method",key:"handleAddAnnotation",value:function(e){}},{kind:"method",key:"handleDeleteHighlight",value:function(){if(this.nodesForRemoval){var e,t=Ce(this.nodesForRemoval[0]),n=P(this.nodesForRemoval);try{for(n.s();!(e=n.n()).done;){var r=e.value,o=r.textContent,i=r.parentElement;i.classList.contains("BRwordElement")||i.classList.contains("BRspace")?(r.remove(),i.textContent=o):console.log("This element did not match removal criteria:",i,r)}}catch(e){n.e(e)}finally{n.f()}this.deleteHighlight(t),this.clearNodesForRemoval()}else console.log("there is nothing to remove")}},{kind:"method",key:"deleteHighlight",value:function(e){for(var t=this.loadHighlightsFromLocalStorage(),n=0;n<t.length;n++)if(t[n].uuid===e)return t.splice(n,1),void this.saveToLocalStorage(t)}},{kind:"method",key:"saveToLocalStorage",value:function(e){window.localStorage.setItem(ce,JSON.stringify(e.map(function(e){return e.toJSON()})))}},{kind:"method",key:"loadHighlightsFromLocalStorage",value:function(){return JSON.parse(window.localStorage.getItem(ce)||"[]").map(function(e){return xe.fromJSON(e)})}},{kind:"method",key:"renderSavedHighlights",value:function(){var e,t=this,n=P(this.loadHighlightsFromLocalStorage());try{for(n.s();!(e=n.n()).done;){var r=e.value,o=this.br.$(".pagediv".concat(r.pageIndex," .BRtextLayer"))[0];o&&(ke(o,r),O(o).off("mouseup.BRHighlightClick").on("mouseup.BRHighlightClick",function(e){e.target.classList.contains("BRhighlight")&&(e.stopPropagation(),t.handleHighlightClick(e.target))}))}}catch(e){n.e(e)}finally{n.f()}}},{kind:"method",key:"handleHighlightClick",value:function(e){var t=this.getNodeTextLayer(e),n=Ce(e),r=t.querySelectorAll(".".concat(n)),o=r[0],i=r[r.length-1],a=document.createRange();a.setStart(o,0),a.setEnd(i,1);var l=window.getSelection();l.removeAllRanges(),l.addRange(a),this.show()}},{kind:"method",key:"repositionToSelection",value:function(){var e=window.getSelection().getRangeAt(0).getBoundingClientRect(),t=(0,L.un)()||(0,L.m0)(),n=(0,L.m0)()?25:(0,L.un)()?15:10,r=t?60:0,o=(e.top<r?e.bottom+r:e.bottom)+n,i=Math.max(10,o)+window.scrollY,a=this.getBoundingClientRect().width,l=document.documentElement.clientWidth,s=a>e.width?e.left+e.width/2-a/2:e.left,c=(0,B.qE)(s,10,l-a-10)+window.scrollX;this.style.top="".concat(i,"px"),this.style.left="".concat(c,"px")}},{kind:"method",key:"show",value:(n=F(ne().m(function e(){var t;return ne().w(function(e){for(;;)switch(e.n){case 0:if(null===(t=this.br.plugins.translate)||void 0===t||!t.userToggleTranslate){e.n=1;break}return e.a(2);case 1:return this.style.zIndex="1",this.style.position="absolute",this.open=!0,this.classList.remove("br-select-menu__root--scrolling"),window.removeEventListener("scroll",this._onScroll,{capture:!0}),window.addEventListener("scroll",this._onScroll,{capture:!0,passive:!0}),e.n=2,this.updateComplete;case 2:this.repositionToSelection(),this.clearNodesForRemoval();case 3:return e.a(2)}},e,this)})),function(){return n.apply(this,arguments)})},{kind:"method",key:"hide",value:function(){this.open&&(this.showExtended=!1,this.open=!1,window.removeEventListener("scroll",this._onScroll,{capture:!0}),this.clearNodesForRemoval())}},{kind:"field",key:"clearNodesForRemoval",value:function(){var e=this;return function(){e.nodesForRemoval=null,e.requestUpdate()}}}]}},R.WF);function fe(e,t){t=t.trim();var n=new RegExp(String.raw(x||(x=z(["^(S+(s+|$)){1,","}"],["^(\\S+(\\s+|$)){1,","}"])),e)),r=t.match(n);return r?r[0].trim():""}function pe(e,t){t=t.trim();var n=new RegExp(String.raw(S||(S=z(["((^|s+)S+){1,","}s*?$"],["((^|\\s+)\\S+){1,","}\\s*?$"])),e)),r=t.match(n);return r?r[0].trim():""}function me(e){for(;e.firstChild;)e=e.firstChild;return e}function ge(e){for(;e.lastChild;)e=e.lastChild;return e}function ye(e){return e.replace(/(:|-,|,-|,|\n)/g,function(e){return 1===e.length?" ":" "})}function ve(e,t,n){var r=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).normalize,o=void 0===r?function(e){return e}:r;if(n.length){var i=n[0]===t.startContainer?t.startOffset:0,a=o(Ae(t)),l=o(n[0].textContent.slice(0,i)).length,s=new RegExp(e.source,e.flags.includes("g")?e.flags:"".concat(e.flags,"g")),c=Array.from(a.matchAll(s)).map(function(e){var t=be(l+e.index,n,!1,{normalize:o}),r=be(l+e.index+e[0].length,n,!0,{normalize:o});if(t&&r){var i=new Range;return i.setStart(t.node,t.offset),i.setEnd(r.node,r.offset),i}console.warn("Could not find boundary points for regex match, skipping this match",{match:e,start:t,end:r})}).filter(function(e){return!!e});if(null!=c&&c.length)return c}}function be(e,t,n){var r,o=(arguments.length>3&&void 0!==arguments[3]?arguments[3]:{}).normalize,i=void 0===o?function(e){return e}:o,a=e,l=0,s=P(t);try{for(s.s();!(r=s.n()).done;){var c=r.value,u=c.textContent||"",d=i(u),h=l;if(h+d.length+(n?1:0)>a)for(var f=a-h,p=Math.min(f,u.length),m=n?d.substring(0,f):d.substring(f),g=i(n?u.substring(0,f):u.substring(f)),y=(n?-1:1)*(m.length>g.length?-1:1);p>=0&&p<=u.length;){if(g.length===m.length)return{node:c,offset:p};p+=y,g=i(n?u.substring(0,p):u.substring(p))}l+=d.length}}catch(e){s.e(e)}finally{s.f()}}function Ae(e){var t=Array.from((0,j.nC)(de(e,"text"),we)),n=t.map(function(e){return e.textContent}).join(""),r=t[0],o=t[t.length-1];return e.startContainer===r&&(n=n.substring(e.startOffset)),e.endContainer===o&&(n=n.substring(0,n.length-(o.textContent.length-e.endOffset))),n}function ke(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=me(e),o=ge(e),i=new Range;i.setStart(r,0),i.setEnd(o,o.textContent.length);var a=Array.from((0,j.nC)(de(i,"text"),we)),l=ve(t.toRegExp({context:!0}),i,a,{normalize:ye});if(l){var s=Array.from((0,j.nC)(de(l[0],"text"),we)),c=ve(t.toRegExp({context:!1}),l[0],s,{normalize:ye});if(!c)throw new Error("Could not find quote in page");var u=me(c[0].startContainer),d=me(c[0].endContainer),h=new Range;if(h.setStart(u,0),h.setEnd(d,d.textContent.length),!u.parentElement.classList.contains("BRhighlight")&&!d.parentElement.classList.contains("BRhighlight"))return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return document.createElement("mark")};if(e.startContainer.nodeType!=Node.TEXT_NODE||e.endContainer.nodeType!=Node.TEXT_NODE)return[];if(e.startContainer===e.endContainer){var n=t();return e.surroundContents(n),[n]}var r=e.startContainer,o=e.cloneRange();o.setEndAfter(r);var i=e.endContainer,a=e.cloneRange();a.setStartBefore(i);var l=[];e.setStartAfter(r),e.setEndBefore(i);for(var s=document.createTreeWalker(e.commonAncestorContainer,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,{acceptNode:function(t){return e.intersectsNode(t)?t.nodeType===Node.TEXT_NODE?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP:NodeFilter.FILTER_REJECT}}),c=s.nextNode();c;){if(c.nodeType===Node.TEXT_NODE){var u=t();c.parentNode.insertBefore(u,c),u.appendChild(c),l.push(u)}c=s.nextNode()}var d=t();o.surroundContents(d);var h=t();return a.surroundContents(h),[d].concat(l,[h])}(h,function(){var e=document.createElement("mark");return e.classList.add("BRhighlight"),n&&e.classList.add(n),t.uuid&&e.classList.add(t.uuid),e})}else console.warn("Could not find quote with context in page")}function we(e){var t;return!(null!==(t=e.previousElementSibling)&&void 0!==t&&t.classList.contains("BRspace"))}function Ce(e){if(!e)return null;var t=Array.from(null==e?void 0:e.classList).filter(function(e){if(e.slice(0,2).includes("id"))return e});return t.length?t[0]:null}var xe=function(){function e(t){var n=t.prefix,r=t.quote,o=t.quoteStart,i=t.quoteEnd,a=t.suffix,l=t.pageNumber,s=t.pageIndex,c=t.uuid;oe(this,e),this.prefix=n,this.quote=null!=r?r:null,this.quoteStart=null!=o?o:null,this.quoteEnd=null!=i?i:null,this.suffix=a,this.pageNumber=l,this.pageIndex=s,this.uuid=null!=c?c:null}return ae(e,[{key:"toUrlString",value:function(){var e=function(e){return function(e){return e.replace(/\s+/g," ").trim()}(ye(e).trim())},t=this.pageNumber?this.pageNumber:"n".concat(this.pageIndex);t+=":",this.prefix&&(t+=e(this.prefix),t+="-,");var n=this.quote?e(this.quote):null,r=null;if(n&&n.length>80&&(n.match(/\S+/g)||[]).length>=6){var o=fe(3,n),i=pe(3,n);o&&i&&(r={quoteStart:o,quoteEnd:i})}if(n&&!r)t+=n;else if(r)t+="".concat(r.quoteStart,",").concat(r.quoteEnd);else{if(!this.quoteStart||!this.quoteEnd)throw new Error("Text fragment requires either a quote or quoteStart/quoteEnd");t+="".concat(this.quoteStart,",").concat(this.quoteEnd)}return this.suffix&&(t+=",-",t+=e(this.suffix)),encodeURIComponent(t).replace(/%2C/g,",").replace(/%3A/g,":")}},{key:"toRegExp",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).context,t=void 0!==e&&e,n=this.quote?[this.quote]:[this.quoteStart,this.quoteEnd];t&&(this.prefix&&(n[0]=this.prefix+" "+n[0]),this.suffix&&(n[n.length-1]=n[n.length-1]+" "+this.suffix));var r=function(e){return RegExp.escape(ye(e)).replace(/(\\x20)+/g,"\\s+")};return 1===n.length?new RegExp(r(n[0]),"gi"):new RegExp(r(n[0])+"[\\s\\S]*?"+r(n[1]),"gi")}},{key:"toJSON",value:function(){return{prefix:this.prefix,quote:this.quote,quoteStart:this.quoteStart,quoteEnd:this.quoteEnd,suffix:this.suffix,pageNumber:this.pageNumber,pageIndex:this.pageIndex,uuid:this.uuid}}}],[{key:"fromString",value:function(t,n,r){var o=t.match(/^(?:(.*?):)?(?:(.*?)-,)?(.*?)(?:,-(.*))?$/);if(!o)throw new Error("Invalid text fragment format: ".concat(t));var i=o[1]?decodeURIComponent(o[1]):null,a=o[2]?decodeURIComponent(o[2]):null,l=(o[3]||"").split(","),s=null,c=null,u=null;if(1===l.length)s=decodeURIComponent(l[0]);else{if(2!==l.length)throw new Error("Invalid text fragment quote format: ".concat(t));c=decodeURIComponent(l[0]),u=decodeURIComponent(l[1])}var d=o[4]?decodeURIComponent(o[4]):null,h=i?n.getPageIndex(i):r;if("number"!=typeof h)throw new Error("Could not determine page index for text fragment with page number ".concat(i));if(!(s||c&&u))throw new Error("Invalid text fragment quote format: ".concat(t));return new e({prefix:a,quote:s,quoteStart:c,quoteEnd:u,suffix:d,pageNumber:i,pageIndex:h})}},{key:"fromJSON",value:function(t){return new e(t)}},{key:"fromSelection",value:function(t,n){var o,i,a=t.getRangeAt(0),l=new Range,s=ge(a.startContainer),c=me(a.endContainer);l.setStart(s,0),l.setEnd(c,0==a.endOffset?0:null!==(o=null===(i=c.textContent)||void 0===i?void 0:i.length)&&void 0!==o?o:0);var u=document.createRange();u.setStart(me(n[0]),0),u.setEnd(s,0);var d=document.createRange();d.setStart(c,l.endOffset);var h=ge(n[n.length-1]);d.setEnd(h,Math.max(0,h.textContent.length-1));var f=Ae(u),p=pe(3,f),m=(0,r.rj)(p),g=Ae(d),y=fe(3,g),v=(0,r.rj)(y);m<3&&(y=fe(6-m,g),v=(0,r.rj)(y)),v<3&&(p=pe(6-v,f),m=(0,r.rj)(p));var b=Ae(l),A=s.parentElement.closest(".BRpagecontainer");return new e({quote:b,prefix:p,suffix:y,pageNumber:A.getAttribute("data-page-num"),pageIndex:parseFloat(A.getAttribute("data-index"))})}}])}()},4565:function(e,t,n){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,i(r.key),r)}}function i(e){var t=function(e){if("object"!=r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==r(t)?t:t+""}n.d(t,{l:function(){return a}}),n(2675),n(9463),n(2259),n(5700),n(3792),n(9572),n(2892),n(6099),n(7764),n(2953);var a=function(){return e=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.maxSize=t,this.entries=[]},(t=[{key:"add",value:function(e){this.entries.length>=this.maxSize&&this.entries.shift(),this.entries.push(e)}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()},1989:function(e,t,n){function r(){var e,t,n="function"==typeof Symbol?Symbol:{},i=n.iterator||"@@iterator",a=n.toStringTag||"@@toStringTag";function l(n,r,i,a){var l=r&&r.prototype instanceof c?r:c,u=Object.create(l.prototype);return o(u,"_invoke",function(n,r,o){var i,a,l,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:f,f:f.bind(e,4),d:function(t,n){return i=t,a=0,l=e,h.n=n,s}};function f(n,r){for(a=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],f=h.p,p=i[2];n>3?(o=p===r)&&(l=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=e):i[0]<=f&&((o=n<2&&f<i[1])?(a=0,h.v=r,h.n=i[1]):f<p&&(o=n<3||i[0]>r||r>p)&&(i[4]=n,i[5]=r,h.n=p,a=0))}if(o||n>1)return s;throw d=!0,r}return function(o,u,p){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&f(u,p),a=u,l=p;(t=a<2?e:l)||!d;){i||(a?a<3?(a>1&&(h.n=-1),f(a,l)):h.n=l:h.v=l);try{if(c=2,i){if(a||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,a<2&&(a=0)}else 1===a&&(t=i.return)&&t.call(i),a<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=e}else if((t=(d=h.n<0)?l:n.call(r,h))!==s)break}catch(t){i=e,a=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,i,a),!0),u}var s={};function c(){}function u(){}function d(){}t=Object.getPrototypeOf;var h=[][i]?t(t([][i]())):(o(t={},i,function(){return this}),t),f=d.prototype=c.prototype=Object.create(h);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,o(e,a,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=d,o(f,"constructor",d),o(d,"constructor",u),u.displayName="GeneratorFunction",o(d,a,"GeneratorFunction"),o(f),o(f,a,"Generator"),o(f,i,function(){return this}),o(f,"toString",function(){return"[object Generator]"}),(r=function(){return{w:l,m:p}})()}function o(e,t,n,r){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}o=function(e,t,n,r){function a(t,n){o(e,t,function(e){return this._invoke(t,n,e)})}t?i?i(e,t,{value:n,enumerable:!r,configurable:!r,writable:!r}):e[t]=n:(a("next",0),a("throw",1),a("return",2))},o(e,t,n,r)}n.d(t,{Px:function(){return f},eU:function(){return d},nC:function(){return h},pp:function(){return p},yU:function(){return m}}),n(2675),n(9463),n(2259),n(3418),n(3792),n(4782),n(2010),n(875),n(6099),n(7495),n(8781),n(7764),n(2953);var i=r().m(h),a=r().m(f),l=r().m(p),s=r().m(m);function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return u(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,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 u(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n,r=0,o=c(e);try{for(o.s();!(n=o.n()).done;){var i=n.value;if(r==t)return i;r++}}catch(e){o.e(e)}finally{o.f()}}function h(e,t){var n,o,a,l;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:n=c(e),r.p=1,n.s();case 2:if((o=n.n()).done){r.n=4;break}if(a=o.value,!t(a)){r.n=3;break}return r.n=3,a;case 3:r.n=2;break;case 4:r.n=6;break;case 5:r.p=5,l=r.v,n.e(l);case 6:return r.p=6,n.f(),r.f(6);case 7:return r.a(2)}},i,null,[[1,5,6,7]])}function f(e,t){var n,o,i,l;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:n=c(e),r.p=1,n.s();case 2:if((o=n.n()).done){r.n=4;break}return i=o.value,r.n=3,t(i);case 3:r.n=2;break;case 4:r.n=6;break;case 5:r.p=5,l=r.v,n.e(l);case 6:return r.p=6,n.f(),r.f(6);case 7:return r.a(2)}},a,null,[[1,5,6,7]])}function p(e){var t,n,o,i,a,s,u;return r().w(function(r){for(;;)switch(r.p=r.n){case 0:t=void 0,n=void 0,o=void 0,i=c(e),r.p=1,i.s();case 2:if((a=i.n()).done){r.n=5;break}if(s=a.value,void 0===n){r.n=3;break}return o=s,r.n=3,[t,n,o];case 3:t=n,n=s,o=void 0;case 4:r.n=2;break;case 5:r.n=7;break;case 6:r.p=6,u=r.v,i.e(u);case 7:return r.p=7,i.f(),r.f(7);case 8:if(void 0===n){r.n=9;break}return r.n=9,[t,n,o];case 9:return r.a(2)}},l,null,[[1,6,7,8]])}function m(e,t){var n,o,i,a;return r().w(function(r){for(;;)switch(r.n){case 0:n=e[Symbol.iterator](),o=t[Symbol.iterator]();case 1:if(i=n.next(),a=o.next(),!i.done||!a.done){r.n=2;break}return r.a(2);case 2:if(!i.done&&!a.done){r.n=3;break}throw new Error("zip: one of the iterators is done");case 3:return r.n=4,[i.value,a.value];case 4:r.n=1;break;case 5:return r.a(2)}},s)}},9073:function(e,t,n){function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function o(e){var t=e.match(/\S+/g);return t?t.length:0}function i(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:a;return null==e?void 0:e.replace(/\{\{([^}]*?)\}\}/g,function(e,i){if(!i)return e;var a,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,{gT:function(){return i},rj:function(){return o}}),n(2675),n(9463),n(2259),n(3418),n(3792),n(2062),n(2712),n(4782),n(2010),n(6099),n(7495),n(8781),n(7764),n(1761),n(5440),n(2762),n(2953);var a={urlencode:encodeURIComponent}}},function(e){e(e.s=296)}]);
45
65
  //# sourceMappingURL=plugin.text_selection.js.map