@internetarchive/bookreader 5.0.0-102 → 5.0.0-103

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 (28) hide show
  1. package/BookReader/BookReader.js +1 -1
  2. package/BookReader/BookReader.js.map +1 -1
  3. package/BookReader/ia-bookreader-bundle.js +141 -102
  4. package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +6 -0
  5. package/BookReader/ia-bookreader-bundle.js.map +1 -1
  6. package/BookReader/plugins/plugin.chapters.js +1 -1
  7. package/BookReader/plugins/plugin.chapters.js.map +1 -1
  8. package/BookReader/plugins/plugin.experiments.js +1 -1
  9. package/BookReader/plugins/plugin.experiments.js.map +1 -1
  10. package/BookReader/plugins/plugin.search.js +1 -1
  11. package/BookReader/plugins/plugin.search.js.map +1 -1
  12. package/BookReader/plugins/plugin.text_selection.js +1 -1
  13. package/BookReader/plugins/plugin.text_selection.js.map +1 -1
  14. package/BookReader/plugins/plugin.translate.js +2 -2
  15. package/BookReader/plugins/plugin.translate.js.map +1 -1
  16. package/BookReader/plugins/plugin.tts.js +1 -1
  17. package/BookReader/plugins/plugin.tts.js.map +1 -1
  18. package/package.json +2 -2
  19. package/src/BookNavigator/assets/button-base.js +0 -1
  20. package/src/BookNavigator/bookmarks/bookmarks-provider.js +1 -1
  21. package/src/BookNavigator/downloads/downloads-provider.js +1 -1
  22. package/src/BookNavigator/search/search-provider.js +5 -1
  23. package/src/BookNavigator/visual-adjustments/visual-adjustments-provider.js +1 -1
  24. package/src/BookReader/Navbar/Navbar.js +10 -5
  25. package/src/plugins/plugin.chapters.js +1 -1
  26. package/src/plugins/plugin.experiments.js +1 -1
  27. package/src/plugins/translate/TranslationManager.js +6 -4
  28. package/src/plugins/tts/utils.js +43 -17
@@ -133,7 +133,7 @@
133
133
  opacity: 0;
134
134
  }
135
135
  }
136
- `}}window.customElements.define("ia-activity-indicator",i)},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}},4805:function(e,t,n){n(2675),n(9463),n(2259),n(5700),n(3418),n(3792),n(4782),n(9572),n(2010),n(8130),n(2811),n(875),n(6099),n(825),n(7495),n(8781),n(7764),n(2953);var r=n(420);function o(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}Object.create,Object.create;var i,a,s=n(9696);class l{parseValue(e){return("string"!=typeof e||"false"!==e&&"0"!==e)&&Boolean(e)}}l.shared=new l;class c{parseValue(e){if("number"==typeof e)return e;if("boolean"==typeof e)return;const t=parseFloat(e);return Number.isNaN(t)?void 0:t}}c.shared=new c;class u{parseValue(e){return c.shared.parseValue(e)}}u.shared=new u;class d{parseValue(e){return this.parseJSDate(e)||this.parseBracketDate(e)}parseBracketDate(e){if("string"!=typeof e)return;const t=e.match(/\[([0-9]{4})\]/);return!t||t.length<2?void 0:this.parseJSDate(t[1])}parseJSDate(e){if("string"!=typeof e)return;let t=e;t.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}\s{1}[0-9]{2}:[0-9]{2}:[0-9]{2}$/)&&(t=t.replace(" ","T"));const n=Date.parse(t);if(Number.isNaN(n))return;let r=new Date(t);return(t.indexOf("Z")>-1||t.indexOf("+")>-1||t.match(/^[0-9]{4}$/)||t.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)||t.match(/^.*?-[0-9]{2}:[0-9]{2}$/)||t.match(/^.*?-[0-9]{4}$/))&&(r=new Date(r.getTime()+1e3*r.getTimezoneOffset()*60)),r}}d.shared=new d;class h{parseValue(e){if("number"==typeof e)return e;if("boolean"==typeof e)return;const t=e.split(":");let n;return n=1===t.length?this.parseNumberFormat(t[0]):this.parseColonSeparatedFormat(t),n}parseNumberFormat(e){let t=parseFloat(e);return Number.isNaN(t)&&(t=void 0),t}parseColonSeparatedFormat(e){let t=!1;const n=e.map((n,r)=>{const o=parseFloat(n);if(Number.isNaN(o))return t=!0,0;const i=60**(e.length-1-r);return o*Math.floor(i)}).reduce((e,t)=>e+t,0);return t?void 0:n}}h.shared=new h;class p{parseValue(e){if("string"==typeof e)return e}}p.shared=new p;class f{parseValue(e){if("string"==typeof e)return e}}f.shared=new f;class m{parseValue(e){return String(e)}}m.shared=new m;class v{constructor(e,t){this.values=[],this.parser=e,this.rawValue=t,this.processRawValue()}get value(){return this.values.length>0?this.values[0]:void 0}processRawValue(){void 0!==this.rawValue&&(Array.isArray(this.rawValue)?this.rawValue.forEach(e=>{this.parseAndPersistValue(e)}):this.parseAndPersistValue(this.rawValue))}parseAndPersistValue(e){const t=this.parser.parseValue(e);void 0!==t&&this.values.push(t)}}class b extends v{constructor(e){super(l.shared,e)}}class y extends v{constructor(e){super(d.shared,e)}}class g extends v{constructor(e){super(h.shared,e)}}class k extends v{constructor(e){super(c.shared,e)}}class w extends v{constructor(e){super(m.shared,e)}}class S extends v{constructor(e){super(u.shared,e)}}class C extends v{constructor(e){super(p.shared,e)}}class O{constructor(e){this.rawMetadata=e,this.identifier=e.identifier,this.addeddate=e.addeddate?new y(e.addeddate):void 0,this.publicdate=e.publicdate?new y(e.publicdate):void 0,this.indexdate=e.indexdate?new y(e.indexdate):void 0,this.audio_codec=e.audio_codec?new w(e.audio_codec):void 0,this.audio_sample_rate=e.audio_sample_rate?new k(e.audio_sample_rate):void 0,this.collection=e.collection?new w(e.collection):void 0,this.collections_raw=e.collections_raw?new w(e.collections_raw):void 0,this.collection_size=e.collection_size?new S(e.collection_size):void 0,this.contributor=e.contributor?new w(e.contributor):void 0,this.coverage=e.coverage?new w(e.coverage):void 0,this.creator=e.creator?new w(e.creator):void 0,this.date=e.date?new y(e.date):void 0,this.description=e.description?new w(e.description):void 0,this.downloads=e.downloads?new k(e.downloads):void 0,this.duration=e.duration?new g(e.duration):void 0,this.files_count=e.files_count?new k(e.files_count):void 0,this.item_count=e.item_count?new k(e.item_count):void 0,this.item_size=e.item_size?new S(e.item_size):void 0,this.language=e.language?new w(e.language):void 0,this.length=e.length?new g(e.length):void 0,this.lineage=e.lineage?new w(e.lineage):void 0,this.mediatype=e.mediatype?new C(e.mediatype):void 0,this.month=e.month?new k(e.month):void 0,this.noindex=e.noindex?new b(e.noindex):void 0,this.notes=e.notes?new w(e.notes):void 0,this.num_favorites=e.num_favorites?new k(e.num_favorites):void 0,this.num_reviews=e.num_reviews?new k(e.num_reviews):void 0,this.runtime=e.runtime?new g(e.runtime):void 0,this.scanner=e.scanner?new w(e.scanner):void 0,this.source=e.source?new w(e.source):void 0,this.start_localtime=e.start_localtime?new y(e.start_localtime):void 0,this.start_time=e.start_time?new y(e.start_time):void 0,this.stop_time=e.stop_time?new y(e.stop_time):void 0,this.subject=e.subject?new w(e.subject):void 0,this.taper=e.taper?new w(e.taper):void 0,this.title=e.title?new w(e.title):void 0,this.track=e.track?new k(e.track):void 0,this.transferer=e.transferer?new w(e.transferer):void 0,this.type=e.type?new w(e.type):void 0,this.uploader=e.uploader?new w(e.uploader):void 0,this.utc_offset=e.utc_offset?new k(e.utc_offset):void 0,this.venue=e.venue?new w(e.venue):void 0,this.week=e.week?new k(e.week):void 0,this.year=e.year?new y(e.year):void 0}}class x{constructor(e){this.name=e.name,this.source=e.source,this.btih=e.btih,this.md5=e.md5,this.format=e.format,this.mtime=e.mtime,this.crc32=e.crc32,this.sha1=e.sha1,this.original=e.original,this.title=e.title,this.length=e.length?h.shared.parseValue(e.length):void 0,this.size=e.size?u.shared.parseValue(e.size):void 0,this.height=e.height?c.shared.parseValue(e.height):void 0,this.width=e.width?c.shared.parseValue(e.width):void 0,this.track=e.track?c.shared.parseValue(e.track):void 0,this.external_identifier=e["external-identifier"],this.creator=e.creator,this.album=e.album}}class j{constructor(e){this.reviewbody=e.reviewbody,this.reviewtitle=e.reviewtitle,this.reviewer=e.reviewer,this.reviewdate=d.shared.parseValue(e.reviewdate),this.createdate=d.shared.parseValue(e.createdate),this.stars=e.stars?parseFloat(e.stars):void 0}}class B{constructor(e){var t,n;this.rawResponse=e,this.created=e.created,this.d1=e.d1,this.d2=e.d2,this.dir=e.dir,this.files=null===(t=e.files)||void 0===t?void 0:t.map(e=>new x(e)),this.files_count=e.files_count,this.item_last_updated=e.item_last_updated,this.item_size=e.item_size,this.metadata=new O(e.metadata),this.server=e.server,this.uniq=e.uniq,this.workable_servers=e.workable_servers,this.speech_vs_music_asr=e.speech_vs_music_asr,this.reviews=null===(n=e.reviews)||void 0===n?void 0:n.map(e=>new j(e))}}class P{constructor(e){this.numFound=e.numFound,this.start=e.start,this.docs=e.docs.map(e=>new O(e)),this.aggregations=e.aggregations}}class M{constructor(e){this.rawResponse=e,this.responseHeader=e.responseHeader,this.response=new P(e.response)}}!function(e){e.networkError="SearchService.NetworkError",e.itemNotFound="SearchService.ItemNotFound",e.decodingError="SearchService.DecodingError",e.searchEngineError="SearchService.SearchEngineError"}(i||(i={}));class E extends Error{constructor(e,t,n){super(t),this.name=e,this.type=e,this.details=n}}class L{constructor(e){this.searchBackend=e}async search(e){const t=await this.searchBackend.performSearch(e);return t.error?t:{success:new M(t.success)}}async fetchMetadata(e){var t;const n=await this.searchBackend.fetchMetadata(e);return n.error?n:void 0===(null===(t=n.success)||void 0===t?void 0:t.metadata)?{error:new E(i.itemNotFound)}:{success:new B(n.success)}}}L.default=new L(new class{constructor(e="archive.org"){this.baseUrl=e}async performSearch(e){const t=e.asUrlSearchParams.toString(),n=`https://${this.baseUrl}/advancedsearch.php?${t}`;return this.fetchUrl(n)}async fetchMetadata(e){const t=`https://${this.baseUrl}/metadata/${e}`;return this.fetchUrl(t)}async fetchUrl(e){let t;try{t=await fetch(e)}catch(e){const t=e instanceof Error?e.message:e;return this.getErrorResult(i.networkError,t)}try{const e=await t.json(),n=e.error;if(n){const t=e.forensics;return this.getErrorResult(i.searchEngineError,n,t)}return{success:e}}catch(e){const t=e instanceof Error?e.message:e;return this.getErrorResult(i.decodingError,t)}}getErrorResult(e,t,n){return{error:new E(e,t,n)}}}),function(e){e.Asc="asc",e.Desc="desc"}(a||(a={}));var A=r.qy`
136
+ `}}window.customElements.define("ia-activity-indicator",i)},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}},8134:function(e,t,n){n(2675),n(9463),n(2259),n(5700),n(3418),n(3792),n(4782),n(9572),n(2010),n(8130),n(2811),n(875),n(6099),n(825),n(7495),n(8781),n(7764),n(2953);var r=n(420);function o(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}Object.create,Object.create;var i=n(9696),a=(n(2008),n(8598),n(9432),n(1415),n(744),n(3500),n(6681)),s=n(1091);function l(e){return l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l(e)}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function u(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,d(r.key),r)}}function d(e){var t=function(e){if("object"!=l(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=l(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==l(t)?t:t+""}function h(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(h=function(){return!!e})()}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}var m=(0,s.u$)(function(e){function t(e){var n,r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t,n){return t=p(t),function(e,t){if(t&&("object"==l(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,h()?Reflect.construct(t,n||[],p(e).constructor):t.apply(e,n))}(this,t,[e]),e.type!==s.OA.ATTRIBUTE||"class"!==e.name||(null===(r=e.strings)||void 0===r?void 0:r.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");return n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(t,e),function(e,t){return t&&u(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(e){return" "+Object.keys(e).filter(function(t){return e[t]}).join(" ")+" "}},{key:"update",value:function(e,t){var n,r,o=this,i=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,1)[0];if(void 0===this.it){for(var s in this.it=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(function(e){return""!==e}))),i)i[s]&&!(null===(n=this.nt)||void 0===n?void 0:n.has(s))&&this.it.add(s);return this.render(i)}var l=e.element.classList;for(var u in this.it.forEach(function(e){e in i||(l.remove(e),o.it.delete(e))}),i){var d=!!i[u];d===this.it.has(u)||(null===(r=this.nt)||void 0===r?void 0:r.has(u))||(d?(l.add(u),this.it.add(u)):(l.remove(u),this.it.delete(u)))}return a.c0}}])}(s.WL));function v(e){let t,n,r;return"object"==typeof e?(t=e.hashFunction,n=e.expiring,r=e.tags):t=e,(e,o,i)=>{if(null!=i.value)i.value=y(i.value,t,n,r);else{if(null==i.get)throw"Only put a Memoize() decorator on a method or get accessor.";i.get=y(i.get,t,n,r)}}}const b=new Map;function y(e,t,n=0,r){const o=Symbol("__memoized_map__");return function(...i){let a;this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let s=this[o];if(Array.isArray(r))for(const e of r)b.has(e)?b.get(e).push(s):b.set(e,[s]);if(t||i.length>0||n>0){let r;r=!0===t?i.map(e=>e.toString()).join("!"):t?t.apply(this,i):i[0];const o=`${r}__timestamp`;let l=!1;if(n>0)if(s.has(o)){let e=s.get(o);l=Date.now()-e>n}else l=!0;s.has(r)&&!l?a=s.get(r):(a=e.apply(this,i),s.set(r,a),n>0&&s.set(o,Date.now()))}else{const t=this;s.has(t)?a=s.get(t):(a=e.apply(this,i),s.set(t,a))}return a}}class g{parseValue(e){return("string"!=typeof e||"false"!==e&&"0"!==e)&&Boolean(e)}}g.shared=new g;class k{parseValue(e){if("number"==typeof e)return e;if("boolean"==typeof e)return;const t=parseFloat(e);return Number.isNaN(t)?void 0:t}}k.shared=new k;class w{parseValue(e){return k.shared.parseValue(e)}}w.shared=new w;class S{parseValue(e){return this.parseJSDate(e)||this.parseBracketDate(e)}parseBracketDate(e){if("string"!=typeof e)return;const t=e.match(/\[([0-9]{4})\]/);return!t||t.length<2?void 0:this.parseJSDate(t[1])}parseJSDate(e){if("string"!=typeof e)return;let t=e;t.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}\s{1}[0-9]{2}:[0-9]{2}:[0-9]{2}$/)&&(t=t.replace(" ","T"));const n=Date.parse(t);if(Number.isNaN(n))return;let r=new Date(t);return(t.match(/^[0-9]{4}$/)||t.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/))&&(r=new Date(r.getTime()+1e3*r.getTimezoneOffset()*60)),r}}S.shared=new S;class C{parseValue(e){if("number"==typeof e)return e;if("boolean"==typeof e)return;const t=e.split(":");let n;return n=1===t.length?this.parseNumberFormat(t[0]):this.parseColonSeparatedFormat(t),n}parseNumberFormat(e){let t=parseFloat(e);return Number.isNaN(t)&&(t=void 0),t}parseColonSeparatedFormat(e){let t=!1;const n=e.map((n,r)=>{const o=parseFloat(n);if(Number.isNaN(o))return t=!0,0;const i=60**(e.length-1-r);return o*Math.floor(i)}).reduce((e,t)=>e+t,0);return t?void 0:n}}C.shared=new C;class O{parseValue(e){if("string"==typeof e)return e}}O.shared=new O;class x{constructor(e,t){this.separators=[";",","],this.parser=e,t&&t.separators&&(this.separators=t.separators)}parseValue(e){const t=String(e);let n=[];for(const e of this.separators)if(n=t.split(e),n.length>1)break;return this.parseListValues(n)}parseListValues(e){const t=e.map(e=>e.trim()),n=t.map(e=>this.parser.parseValue(e)),r=[];return n.forEach(e=>{void 0!==e&&r.push(e)}),r}}class M{parseValue(e){if("string"==typeof e)return e}}M.shared=new M;class j{parseValue(e){return String(e)}}j.shared=new j;class B{get name(){return this.rawValue.name}get source(){return this.rawValue.source}get btih(){return this.rawValue.btih}get md5(){return this.rawValue.md5}get format(){return this.rawValue.format}get mtime(){if(null==this.rawValue.mtime)return;const e=k.shared.parseValue(this.rawValue.mtime);return e?new Date(1e3*e):void 0}get crc32(){return this.rawValue.crc32}get sha1(){return this.rawValue.sha1}get original(){return this.rawValue.original}get size(){return null!=this.rawValue.size?w.shared.parseValue(this.rawValue.size):void 0}get title(){return this.rawValue.title}get length(){return null!=this.rawValue.length?C.shared.parseValue(this.rawValue.length):void 0}get height(){return null!=this.rawValue.height?k.shared.parseValue(this.rawValue.height):void 0}get width(){return null!=this.rawValue.width?k.shared.parseValue(this.rawValue.width):void 0}get track(){return null!=this.rawValue.track?k.shared.parseValue(this.rawValue.track):void 0}get external_identifier(){return this.rawValue.external_identifier}get creator(){return this.rawValue.creator}get album(){return this.rawValue.album}constructor(e={}){this.rawValue=e}}o([v()],B.prototype,"mtime",null),o([v()],B.prototype,"size",null),o([v()],B.prototype,"length",null),o([v()],B.prototype,"height",null),o([v()],B.prototype,"width",null),o([v()],B.prototype,"track",null);class P{get values(){return this.parseRawValue()}get value(){return this.values[0]}constructor(e,t){this.parser=e,this.rawValue=t}parseRawValue(){const e=Array.isArray(this.rawValue)?this.rawValue:[this.rawValue],t=[];return e.forEach(e=>{const n=this.parser.parseValue(e);Array.isArray(n)?t.push(...n):void 0!==n&&t.push(n)}),t}}o([v()],P.prototype,"values",null),o([v()],P.prototype,"value",null);class E extends P{constructor(e){super(g.shared,e)}}class L extends P{constructor(e){super(S.shared,e)}}class A extends P{constructor(e){super(C.shared,e)}}class I extends P{constructor(e){super(k.shared,e)}}class _ extends P{constructor(e){super(j.shared,e)}}class z extends P{constructor(e){super(M.shared,e)}}class T extends P{constructor(e){super(w.shared,e)}}class D extends P{constructor(e){super(O.shared,e)}}class $ extends P{constructor(e,t){super(t,e)}}class H extends ${constructor(e){super(e,new x(j.shared))}}class q{get identifier(){return this.rawMetadata.identifier}get addeddate(){return null!=this.rawMetadata.addeddate?new L(this.rawMetadata.addeddate):void 0}get audio_codec(){return null!=this.rawMetadata.audio_codec?new _(this.rawMetadata.audio_codec):void 0}get audio_sample_rate(){return null!=this.rawMetadata.audio_sample_rate?new I(this.rawMetadata.audio_sample_rate):void 0}get avg_rating(){return null!=this.rawMetadata.avg_rating?new I(this.rawMetadata.avg_rating):void 0}get collection(){return null!=this.rawMetadata.collection?new _(this.rawMetadata.collection):void 0}get collections_raw(){return null!=this.rawMetadata.collections_raw?new _(this.rawMetadata.collections_raw):void 0}get collection_size(){return null!=this.rawMetadata.collection_size?new T(this.rawMetadata.collection_size):void 0}get contact(){return null!=this.rawMetadata.contact?new _(this.rawMetadata.contact):void 0}get contributor(){return null!=this.rawMetadata.contributor?new _(this.rawMetadata.contributor):void 0}get coverage(){return null!=this.rawMetadata.coverage?new _(this.rawMetadata.coverage):void 0}get creator(){return null!=this.rawMetadata.creator?new _(this.rawMetadata.creator):void 0}get creator_alt_script(){return null!=this.rawMetadata["creator-alt-script"]?new _(this.rawMetadata["creator-alt-script"]):void 0}get credits(){return null!=this.rawMetadata.credits?new _(this.rawMetadata.credits):void 0}get collection_layout(){return null!=this.rawMetadata.collection_layout?new _(this.rawMetadata.collection_layout):void 0}get date(){return null!=this.rawMetadata.date?new L(this.rawMetadata.date):void 0}get description(){return null!=this.rawMetadata.description?new _(this.rawMetadata.description):void 0}get downloads(){return null!=this.rawMetadata.downloads?new I(this.rawMetadata.downloads):void 0}get duration(){return null!=this.rawMetadata.duration?new A(this.rawMetadata.duration):void 0}get external_identifier(){return null!=this.rawMetadata["external-identifier"]?new _(this.rawMetadata["external-identifier"]):void 0}get external_link(){return null!=this.rawMetadata["external-link"]?new _(this.rawMetadata["external-link"]):void 0}get files_count(){return null!=this.rawMetadata.files_count?new I(this.rawMetadata.files_count):void 0}get indexdate(){return null!=this.rawMetadata.indexdate?new L(this.rawMetadata.indexdate):void 0}get isbn(){return null!=this.rawMetadata.isbn?new _(this.rawMetadata.isbn):void 0}get issue(){return null!=this.rawMetadata.issue?new _(this.rawMetadata.issue):void 0}get item_count(){return null!=this.rawMetadata.item_count?new I(this.rawMetadata.item_count):void 0}get item_size(){return null!=this.rawMetadata.item_size?new T(this.rawMetadata.item_size):void 0}get language(){return null!=this.rawMetadata.language?new _(this.rawMetadata.language):void 0}get length(){return null!=this.rawMetadata.length?new A(this.rawMetadata.length):void 0}get licenseurl(){return null!=this.rawMetadata.licenseurl?new _(this.rawMetadata.licenseurl):void 0}get lineage(){return null!=this.rawMetadata.lineage?new _(this.rawMetadata.lineage):void 0}get month(){return null!=this.rawMetadata.month?new I(this.rawMetadata.month):void 0}get mediatype(){return null!=this.rawMetadata.mediatype?new D(this.rawMetadata.mediatype):void 0}get noindex(){return null!=this.rawMetadata.noindex?new E(this.rawMetadata.noindex):void 0}get notes(){return null!=this.rawMetadata.notes?new _(this.rawMetadata.notes):void 0}get num_favorites(){return null!=this.rawMetadata.num_favorites?new I(this.rawMetadata.num_favorites):void 0}get num_reviews(){return null!=this.rawMetadata.num_reviews?new I(this.rawMetadata.num_reviews):void 0}get openlibrary_edition(){return null!=this.rawMetadata.openlibrary_edition?new _(this.rawMetadata.openlibrary_edition):void 0}get openlibrary_work(){return null!=this.rawMetadata.openlibrary_work?new _(this.rawMetadata.openlibrary_work):void 0}get page_progression(){return null!=this.rawMetadata.page_progression?new z(this.rawMetadata.page_progression):void 0}get paginated(){return null!=this.rawMetadata.paginated?new E(this.rawMetadata.paginated):void 0}get partner(){return null!=this.rawMetadata.partner?new _(this.rawMetadata.partner):void 0}get post_text(){return null!=this.rawMetadata.post_text?new _(this.rawMetadata.post_text):void 0}get ppi(){return null!=this.rawMetadata.ppi?new I(this.rawMetadata.ppi):void 0}get publicdate(){return null!=this.rawMetadata.publicdate?new L(this.rawMetadata.publicdate):void 0}get publisher(){return null!=this.rawMetadata.publisher?new _(this.rawMetadata.publisher):void 0}get reviewdate(){return null!=this.rawMetadata.reviewdate?new L(this.rawMetadata.reviewdate):void 0}get rights(){return null!=this.rawMetadata.rights?new _(this.rawMetadata.rights):void 0}get rights_holder(){var e;const t=null!==(e=this.rawMetadata["rights-holder"])&&void 0!==e?e:this.rawMetadata.rights_holder;return null!=t?new _(t):void 0}get runtime(){return null!=this.rawMetadata.runtime?new A(this.rawMetadata.runtime):void 0}get scanner(){return null!=this.rawMetadata.scanner?new _(this.rawMetadata.scanner):void 0}get segments(){return null!=this.rawMetadata.segments?new _(this.rawMetadata.segments):void 0}get shotlist(){return null!=this.rawMetadata.shotlist?new _(this.rawMetadata.shotlist):void 0}get source(){return null!=this.rawMetadata.source?new _(this.rawMetadata.source):void 0}get sponsor(){return null!=this.rawMetadata.sponsor?new _(this.rawMetadata.sponsor):void 0}get start_localtime(){return null!=this.rawMetadata.start_localtime?new L(this.rawMetadata.start_localtime):void 0}get start_time(){return null!=this.rawMetadata.start_time?new L(this.rawMetadata.start_time):void 0}get stop_time(){return null!=this.rawMetadata.stop_time?new L(this.rawMetadata.stop_time):void 0}get subject(){return null!=this.rawMetadata.subject?new H(this.rawMetadata.subject):void 0}get taper(){return null!=this.rawMetadata.taper?new _(this.rawMetadata.taper):void 0}get title(){return null!=this.rawMetadata.title?new _(this.rawMetadata.title):void 0}get title_alt_script(){return null!=this.rawMetadata["title-alt-script"]?new _(this.rawMetadata["title-alt-script"]):void 0}get transferer(){return null!=this.rawMetadata.transferer?new _(this.rawMetadata.transferer):void 0}get track(){return null!=this.rawMetadata.track?new I(this.rawMetadata.track):void 0}get type(){return null!=this.rawMetadata.type?new _(this.rawMetadata.type):void 0}get uploader(){return null!=this.rawMetadata.uploader?new _(this.rawMetadata.uploader):void 0}get utc_offset(){return null!=this.rawMetadata.utc_offset?new I(this.rawMetadata.utc_offset):void 0}get venue(){return null!=this.rawMetadata.venue?new _(this.rawMetadata.venue):void 0}get volume(){return null!=this.rawMetadata.volume?new _(this.rawMetadata.volume):void 0}get week(){return null!=this.rawMetadata.week?new I(this.rawMetadata.week):void 0}get year(){return null!=this.rawMetadata.year?new I(this.rawMetadata.year):void 0}constructor(e={}){this.rawMetadata=e}}o([v()],q.prototype,"addeddate",null),o([v()],q.prototype,"audio_codec",null),o([v()],q.prototype,"audio_sample_rate",null),o([v()],q.prototype,"avg_rating",null),o([v()],q.prototype,"collection",null),o([v()],q.prototype,"collections_raw",null),o([v()],q.prototype,"collection_size",null),o([v()],q.prototype,"contact",null),o([v()],q.prototype,"contributor",null),o([v()],q.prototype,"coverage",null),o([v()],q.prototype,"creator",null),o([v()],q.prototype,"creator_alt_script",null),o([v()],q.prototype,"credits",null),o([v()],q.prototype,"collection_layout",null),o([v()],q.prototype,"date",null),o([v()],q.prototype,"description",null),o([v()],q.prototype,"downloads",null),o([v()],q.prototype,"duration",null),o([v()],q.prototype,"external_identifier",null),o([v()],q.prototype,"external_link",null),o([v()],q.prototype,"files_count",null),o([v()],q.prototype,"indexdate",null),o([v()],q.prototype,"isbn",null),o([v()],q.prototype,"issue",null),o([v()],q.prototype,"item_count",null),o([v()],q.prototype,"item_size",null),o([v()],q.prototype,"language",null),o([v()],q.prototype,"length",null),o([v()],q.prototype,"licenseurl",null),o([v()],q.prototype,"lineage",null),o([v()],q.prototype,"month",null),o([v()],q.prototype,"mediatype",null),o([v()],q.prototype,"noindex",null),o([v()],q.prototype,"notes",null),o([v()],q.prototype,"num_favorites",null),o([v()],q.prototype,"num_reviews",null),o([v()],q.prototype,"openlibrary_edition",null),o([v()],q.prototype,"openlibrary_work",null),o([v()],q.prototype,"page_progression",null),o([v()],q.prototype,"paginated",null),o([v()],q.prototype,"partner",null),o([v()],q.prototype,"post_text",null),o([v()],q.prototype,"ppi",null),o([v()],q.prototype,"publicdate",null),o([v()],q.prototype,"publisher",null),o([v()],q.prototype,"reviewdate",null),o([v()],q.prototype,"rights",null),o([v()],q.prototype,"rights_holder",null),o([v()],q.prototype,"runtime",null),o([v()],q.prototype,"scanner",null),o([v()],q.prototype,"segments",null),o([v()],q.prototype,"shotlist",null),o([v()],q.prototype,"source",null),o([v()],q.prototype,"sponsor",null),o([v()],q.prototype,"start_localtime",null),o([v()],q.prototype,"start_time",null),o([v()],q.prototype,"stop_time",null),o([v()],q.prototype,"subject",null),o([v()],q.prototype,"taper",null),o([v()],q.prototype,"title",null),o([v()],q.prototype,"title_alt_script",null),o([v()],q.prototype,"transferer",null),o([v()],q.prototype,"track",null),o([v()],q.prototype,"type",null),o([v()],q.prototype,"uploader",null),o([v()],q.prototype,"utc_offset",null),o([v()],q.prototype,"venue",null),o([v()],q.prototype,"volume",null),o([v()],q.prototype,"week",null),o([v()],q.prototype,"year",null);class R{get reviewbody(){return this.rawValue.reviewbody}get reviewtitle(){return this.rawValue.reviewtitle}get reviewer(){return this.rawValue.reviewer}get reviewer_itemname(){return this.rawValue.reviewer_itemname}get reviewdate(){return null!=this.rawValue.reviewdate?S.shared.parseValue(this.rawValue.reviewdate):void 0}get createdate(){return null!=this.rawValue.createdate?S.shared.parseValue(this.rawValue.createdate):void 0}get stars(){return null!=this.rawValue.stars?k.shared.parseValue(this.rawValue.stars):void 0}constructor(e={}){this.rawValue=e}}o([v()],R.prototype,"reviewdate",null),o([v()],R.prototype,"createdate",null),o([v()],R.prototype,"stars",null);class F{constructor(e){var t,n;this.rawResponse=e,this.created=e.created,this.d1=e.d1,this.d2=e.d2,this.dir=e.dir,this.files=null===(t=e.files)||void 0===t?void 0:t.map(e=>new B(e)),this.files_count=e.files_count,this.item_last_updated=e.item_last_updated,this.item_size=e.item_size,this.metadata=new q(e.metadata),this.server=e.server,this.uniq=e.uniq,this.workable_servers=e.workable_servers,this.speech_vs_music_asr=e.speech_vs_music_asr,this.reviews=null===(n=e.reviews)||void 0===n?void 0:n.map(e=>new R(e))}}var Z;!function(e){e.networkError="MetadataService.NetworkError",e.itemNotFound="MetadataService.ItemNotFound",e.decodingError="MetadataService.DecodingError",e.searchEngineError="MetadataService.SearchEngineError"}(Z||(Z={}));class W extends Error{constructor(e,t,n){super(t),this.name=e,this.type=e,this.details=n}}class N{constructor(e){this.backend=e}async fetchMetadata(e){var t;const n=await this.backend.fetchMetadata(e);return n.error?n:void 0===(null===(t=n.success)||void 0===t?void 0:t.metadata)?{error:new W(Z.itemNotFound)}:{success:new F(n.success)}}async fetchMetadataValue(e,t){var n;const r=await this.backend.fetchMetadata(e,t);return r.error?r:void 0===(null===(n=r.success)||void 0===n?void 0:n.result)?{error:new W(Z.itemNotFound)}:{success:r.success.result}}}N.default=new N(new class{constructor(e){var t;if(this.baseUrl=null!==(t=null==e?void 0:e.baseUrl)&&void 0!==t?t:"archive.org",void 0!==(null==e?void 0:e.includeCredentials)?this.includeCredentials=e.includeCredentials:this.includeCredentials=null!==window.location.href.match(/^https?:\/\/.*archive\.org(:[0-9]+)?/),void 0!==(null==e?void 0:e.scope))this.requestScope=e.scope;else{const e=new URL(window.location.href).searchParams.get("scope");e&&(this.requestScope=e)}}async fetchMetadata(e,t){const n=t?`/${t}`:"",r=`https://${this.baseUrl}/metadata/${e}${n}`;return this.fetchUrl(r,{requestOptions:{credentials:"omit"}})}async fetchUrl(e,t){var n;const r=new URL(e);let o;this.requestScope&&r.searchParams.set("scope",this.requestScope);try{const e=null!==(n=null==t?void 0:t.requestOptions)&&void 0!==n?n:{credentials:this.includeCredentials?"include":"same-origin"};o=await fetch(r.href,e)}catch(e){const t=e instanceof Error?e.message:"string"==typeof e?e:"Unknown error";return this.getErrorResult(Z.networkError,t)}try{const e=await o.json(),t=e.error;if(t){const n=e.forensics;return this.getErrorResult(Z.searchEngineError,t,n)}return{success:e}}catch(e){const t=e instanceof Error?e.message:"string"==typeof e?e:"Unknown error";return this.getErrorResult(Z.decodingError,t)}}getErrorResult(e,t,n){return{error:new W(e,t,n)}}});var V=r.qy`
137
137
  <svg
138
138
  viewBox="0 0 40 40"
139
139
  xmlns="http://www.w3.org/2000/svg"
@@ -143,7 +143,7 @@
143
143
  <desc id="ellipsesDescID">An illustration of text ellipses.</desc>
144
144
  <path class="fill-color" d="m10.5 17.5c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5c-1.38071187 0-2.5-1.1192881-2.5-2.5s1.11928813-2.5 2.5-2.5zm9.5 0c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5-2.5-1.1192881-2.5-2.5 1.1192881-2.5 2.5-2.5zm9.5 0c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5-2.5-1.1192881-2.5-2.5 1.1192881-2.5 2.5-2.5z" fill-rule="evenodd"/>
145
145
  </svg>
146
- `;class I extends r.WF{static get styles(){return r.AH`
146
+ `;class U extends r.WF{static get styles(){return r.AH`
147
147
  :host {
148
148
  width: var(--iconWidth, 'auto');
149
149
  height: var(--iconHeight, 'auto');
@@ -156,7 +156,7 @@
156
156
  .stroke-color {
157
157
  stroke: var(--iconStrokeColor);
158
158
  }
159
- `}render(){return A}}customElements.define("ia-icon-ellipses",I);const T=r.AH`42px`,z=r.AH`var(--menuWidth, 320px)`,D=r.AH`var(--animationTiming, 200ms)`;var _=r.AH`
159
+ `}render(){return V}}customElements.define("ia-icon-ellipses",U);const G=r.AH`42px`,J=r.AH`var(--menuWidth, 320px)`,Y=r.AH`var(--animationTiming, 200ms)`;var X=r.AH`
160
160
  .main {
161
161
  overflow: hidden;
162
162
  width: 100%;
@@ -164,7 +164,7 @@
164
164
  }
165
165
 
166
166
  .animate {
167
- transition: transform ${D} ease-out;
167
+ transition: transform ${Y} ease-out;
168
168
  }
169
169
 
170
170
  .menu {
@@ -172,17 +172,13 @@
172
172
  top: 0;
173
173
  left: 0;
174
174
  bottom: 0;
175
- width: ${z};
175
+ width: ${J};
176
176
  padding: 0.5rem 0.5rem 0 0;
177
177
  box-sizing: border-box;
178
178
  font-size: 1.4rem;
179
179
  color: var(--primaryTextColor);
180
180
  background: var(--menuSliderBg);
181
- transform: translateX(calc(${z} * -1));
182
- }
183
-
184
- .menu > button.close {
185
- right: 0.7rem;
181
+ transform: translateX(calc(${J} * -1));
186
182
  }
187
183
 
188
184
  button {
@@ -224,11 +220,13 @@
224
220
  position: absolute;
225
221
  }
226
222
  button.close {
227
- right: 0.5rem;
228
- }
229
-
230
- button.close * {
231
- float: right;
223
+ min-width: 38px;
224
+ min-height: 38px;
225
+ display: flex;
226
+ justify-content: center;
227
+ align-items: center;
228
+ right: 0;
229
+ top: 0;
232
230
  }
233
231
 
234
232
  .content {
@@ -236,10 +234,10 @@
236
234
  top: 0;
237
235
  right: 0;
238
236
  bottom: 0;
239
- left: ${T};
237
+ left: ${G};
240
238
  z-index: 1;
241
- transform: translateX(calc(${z} * -1));
242
- transition: transform ${D} ease-out;
239
+ transform: translateX(calc(${J} * -1));
240
+ transition: transform ${Y} ease-out;
243
241
  background: var(--activeButtonBg);
244
242
  border-right: 0.2rem solid;
245
243
  border-color: var(--subpanelRightBorderColor);
@@ -266,7 +264,7 @@
266
264
  overflow: auto;
267
265
  overscroll-behavior: contain;
268
266
  }
269
- `,$=r.qy`
267
+ `,Q=r.qy`
270
268
  <svg
271
269
  viewBox="0 0 18 18"
272
270
  xmlns="http://www.w3.org/2000/svg"
@@ -276,7 +274,7 @@
276
274
  <desc id="collapseSidebarDescID">A circle with a left pointing chevron</desc>
277
275
  <path d="m9 0c4.9705627 0 9 4.02943725 9 9 0 4.9705627-4.0294373 9-9 9-4.97056275 0-9-4.0294373-9-9 0-4.97056275 4.02943725-9 9-9zm1.6976167 5.28352881c-.365258-.3556459-.9328083-.37581056-1.32099801-.06558269l-.09308988.0844372-3 3.08108108-.08194436.09533317c-.27484337.36339327-.26799482.87009349.01656959 1.22592581l.084491.09308363 3 2.91891889.09533796.0818904c.3633964.2746544.8699472.2677153 1.2256839-.0167901l.093059-.0844712.0818904-.095338c.2746544-.3633964.2677153-.8699472-.0167901-1.2256839l-.0844712-.093059-2.283355-2.2222741 2.3024712-2.36338332.0819252-.09530804c.2997677-.39632298.2644782-.96313393-.1007797-1.31877983z" fill-rule="evenodd" class="fill-color" />
278
276
  </svg>
279
- `;class H extends r.WF{static get styles(){return r.AH`
277
+ `;class K extends r.WF{static get styles(){return r.AH`
280
278
  :host {
281
279
  width: var(--iconWidth, 'auto');
282
280
  height: var(--iconHeight, 'auto');
@@ -289,12 +287,17 @@
289
287
  .stroke-color {
290
288
  stroke: var(--iconStrokeColor);
291
289
  }
292
- `}render(){return $}}customElements.define("ia-icon-collapse-sidebar",H);var q=r.AH`
290
+ `}render(){return Q}}customElements.define("ia-icon-collapse-sidebar",K);var ee=r.AH`
293
291
  a {
294
292
  display: inline-block;
295
293
  text-decoration: none;
296
294
  }
297
295
 
296
+ button.menu-item {
297
+ -webkit-appearance: none;
298
+ appearance: none;
299
+ }
300
+
298
301
  .menu-item {
299
302
  display: inline-flex;
300
303
  width: 100%;
@@ -307,12 +310,12 @@
307
310
  align-items: center;
308
311
  border: none;
309
312
  cursor: pointer;
313
+ transition: background-color 0.2s;
314
+ border-radius: 6px;
310
315
  }
311
316
 
312
- button.menu-item {
313
- -webkit-appearance: none;
314
- appearance: none;
315
- border-radius: 0;
317
+ .menu-item:hover {
318
+ background-color: rgba(255, 255, 255, 0.1);
316
319
  }
317
320
 
318
321
  .label {
@@ -349,6 +352,11 @@
349
352
  justify-content: center;
350
353
  }
351
354
 
355
+ .menu-item > .icon > * {
356
+ /* Prevent tooltip containing icon literal description */
357
+ pointer-events: none;
358
+ }
359
+
352
360
  .menu-item.selected .icon {
353
361
  background-color: var(--activeButtonBg);
354
362
  border-radius: 1rem 0 0 1rem;
@@ -361,8 +369,13 @@
361
369
  .icon.active .fill-color {
362
370
  fill: #fff;
363
371
  }
364
- `;let R=class extends r.WF{constructor(){super(...arguments),this.icon="",this.href="",this.label="",this.menuDetails="",this.buttonId="",this.selected=!1,this.followable=!1}static get styles(){return q}onClick(e){e.preventDefault(),this.dispatchMenuTypeSelectedEvent()}dispatchMenuTypeSelectedEvent(){this.dispatchEvent(new CustomEvent("menuTypeSelected",{bubbles:!0,composed:!0,detail:{id:this.buttonId}}))}get buttonClass(){return this.selected?"selected":""}get iconClass(){return this.selected?"active":""}get menuItem(){return r.qy`
365
- <span class="icon ${this.iconClass}"> ${this.icon} </span>
372
+ `;let te=class extends r.WF{constructor(){super(...arguments),this.icon="",this.href="",this.label="",this.menuDetails="",this.buttonId="",this.selected=!1,this.followable=!1}static get styles(){return ee}onClick(e){e.preventDefault(),this.dispatchMenuTypeSelectedEvent()}dispatchMenuTypeSelectedEvent(){this.dispatchEvent(new CustomEvent("menuTypeSelected",{bubbles:!0,composed:!0,detail:{id:this.buttonId}}))}get buttonClass(){return this.selected?"selected":""}get iconClass(){return this.selected?"active":""}get menuItem(){return r.qy`
373
+ <span
374
+ class="icon ${this.iconClass}"
375
+ aria-hidden="true"
376
+ title="${this.label}"
377
+ >${this.icon}</span
378
+ >
366
379
  <span class="label">${this.label}</span>
367
380
  <span class="menu-details">${this.menuDetails}</span>
368
381
  `}get linkButton(){return r.qy`
@@ -376,17 +389,17 @@
376
389
  <button class="menu-item ${this.buttonClass}" @click=${this.onClick}>
377
390
  ${this.menuItem}
378
391
  </button>
379
- `}render(){return this.href?this.linkButton:this.clickButton}};o([(0,s.MZ)({type:String})],R.prototype,"icon",void 0),o([(0,s.MZ)({type:String})],R.prototype,"href",void 0),o([(0,s.MZ)({type:String})],R.prototype,"label",void 0),o([(0,s.MZ)({type:String})],R.prototype,"menuDetails",void 0),o([(0,s.MZ)({type:String})],R.prototype,"buttonId",void 0),o([(0,s.MZ)({type:Boolean})],R.prototype,"selected",void 0),o([(0,s.MZ)({type:Boolean})],R.prototype,"followable",void 0),R=o([(0,s.EM)("menu-button")],R);const F={closeDrawer:"menuSliderClosed"};let Z=class extends r.WF{constructor(){super(...arguments),this.menus=[],this.open=!1,this.manuallyHandleClose=!1,this.selectedMenu="",this.selectedMenuAction=r.s6,this.animateMenuOpen=!1}static get styles(){return _}updated(){const{actionButton:e}=this.selectedMenuDetails||{};e!==this.selectedMenuAction&&(this.selectedMenuAction=e||r.s6)}setSelectedMenu({detail:e}){const{id:t}=e;this.selectedMenu=this.selectedMenu===t?"":t;const{actionButton:n}=this.selectedMenuDetails||{};this.selectedMenuAction=n||r.s6}closeMenu(){this.manuallyHandleClose||(this.open=!1);const{closeDrawer:e}=F,t=new CustomEvent(e,{detail:this.selectedMenuDetails});this.dispatchEvent(t)}get selectedMenuDetails(){return this.menus.find(e=>e.id===this.selectedMenu)}get selectedMenuComponent(){const e=this.selectedMenuDetails;return e&&(null==e?void 0:e.component)?e.component:r.qy``}get sliderDetailsClass(){return`${this.animateMenuOpen?"animate":""} ${this.open?"open":""}`}get selectedMenuClass(){return this.selectedMenu?"open":""}get menuItems(){return this.menus.map(e=>r.qy`
392
+ `}render(){return this.href?this.linkButton:this.clickButton}};te.shadowRootOptions={...r.WF.shadowRootOptions,delegatesFocus:!0},o([(0,i.MZ)({type:Object})],te.prototype,"icon",void 0),o([(0,i.MZ)({type:String})],te.prototype,"href",void 0),o([(0,i.MZ)({type:String})],te.prototype,"label",void 0),o([(0,i.MZ)({type:Object})],te.prototype,"menuDetails",void 0),o([(0,i.MZ)({type:String})],te.prototype,"buttonId",void 0),o([(0,i.MZ)({type:Boolean})],te.prototype,"selected",void 0),o([(0,i.MZ)({type:Boolean})],te.prototype,"followable",void 0),te=o([(0,i.EM)("menu-button")],te);const ne={closeDrawer:"menuSliderClosed"};let re=class extends r.WF{constructor(){super(...arguments),this.menus=[],this.open=!1,this.manuallyHandleClose=!1,this.selectedMenu="",this.selectedMenuAction=r.s6,this.animateMenuOpen=!1}static get styles(){return X}updated(){var e;const t=(null===(e=this.selectedMenuDetails)||void 0===e?void 0:e.actionButton)||r.s6;t!==this.selectedMenuAction&&(this.selectedMenuAction=t)}setSelectedMenu({detail:e}){var t;const{id:n}=e;this.selectedMenu=this.selectedMenu===n?"":n,this.selectedMenuAction=(null===(t=this.selectedMenuDetails)||void 0===t?void 0:t.actionButton)||r.s6,this.updateComplete.then(()=>{var e;null===(e=this.contentCloseButton)||void 0===e||e.focus()})}closeMenu(){this.manuallyHandleClose||(this.open=!1);const{closeDrawer:e}=ne,t=new CustomEvent(e,{detail:this.selectedMenuDetails});this.dispatchEvent(t)}closePanel(){const e=this.selectedMenu;this.selectedMenu="",this.selectedMenuAction=r.s6,e&&this.updateComplete.then(()=>{const t=this.menus.findIndex(t=>t.id===e);if(-1!==t){const e=this.menuList.querySelector(`li:nth-child(${t+1}) menu-button`);null==e||e.focus()}})}handleKeyDown(e){"Escape"===e.key&&(e.preventDefault(),this.selectedMenu?this.closePanel():this.closeMenu())}get selectedMenuDetails(){return this.menus.find(e=>e.id===this.selectedMenu)}get sliderDetailsClass(){return`${this.animateMenuOpen?"animate":""} ${this.open?"open":""}`}get selectedMenuClass(){return this.selectedMenu?"open":""}get menuItems(){return this.menus.map(e=>r.qy`
380
393
  <li>
381
394
  <menu-button
382
395
  @menuTypeSelected=${this.setSelectedMenu}
383
396
  .icon=${e.icon}
384
397
  .label=${e.label}
385
- .menuDetails=${e.menuDetails}
398
+ .menuDetails=${e.menuDetails||""}
386
399
  .buttonId=${e.id}
387
400
  .selected=${e.id===this.selectedMenu}
388
- .followable=${e.followable}
389
- .href=${e.href}
401
+ .followable=${e.followable||!1}
402
+ .href=${e.href||""}
390
403
  ></menu-button>
391
404
  </li>
392
405
  `)}get renderMenuHeader(){const{label:e="",menuDetails:t=""}=this.selectedMenuDetails||{},n=this.selectedMenuAction?"with-secondary-action":"",o=this.selectedMenuAction?r.qy`<span class="custom-action">${this.selectedMenuAction}</span>`:r.s6;return r.qy`
@@ -395,18 +408,27 @@
395
408
  <h3>${e}</h3>
396
409
  <span class="extra-details">${t}</span>
397
410
  </div>
398
- ${o} ${this.closeButton}
411
+ ${o}
412
+ <button
413
+ class="close"
414
+ aria-label="Close this menu"
415
+ title="Close this menu"
416
+ @click=${this.closePanel}
417
+ >
418
+ <ia-icon-collapse-sidebar></ia-icon-collapse-sidebar>
419
+ </button>
399
420
  </header>
400
421
  `}get closeButton(){return r.qy`
401
422
  <button
402
423
  class="close"
403
424
  aria-label="Close this menu"
425
+ title="Close this menu"
404
426
  @click=${this.closeMenu}
405
427
  >
406
428
  <ia-icon-collapse-sidebar></ia-icon-collapse-sidebar>
407
429
  </button>
408
- `}render(){return r.qy`
409
- <div class="main">
430
+ `}render(){var e;return r.qy`
431
+ <div class="main" @keydown=${this.handleKeyDown}>
410
432
  <div class="menu ${this.sliderDetailsClass}">
411
433
  ${this.closeButton}
412
434
  <ul class="menu-list">
@@ -418,12 +440,14 @@
418
440
  >
419
441
  ${this.renderMenuHeader}
420
442
  <section>
421
- <div class="selected-menu">${this.selectedMenuComponent}</div>
443
+ <div class="selected-menu">
444
+ ${(null===(e=this.selectedMenuDetails)||void 0===e?void 0:e.component)||r.s6}
445
+ </div>
422
446
  </section>
423
447
  </div>
424
448
  </div>
425
449
  </div>
426
- `}};o([(0,s.MZ)({type:Array})],Z.prototype,"menus",void 0),o([(0,s.MZ)({type:Boolean})],Z.prototype,"open",void 0),o([(0,s.MZ)({type:Boolean})],Z.prototype,"manuallyHandleClose",void 0),o([(0,s.MZ)({type:String})],Z.prototype,"selectedMenu",void 0),o([(0,s.MZ)({type:Object})],Z.prototype,"selectedMenuAction",void 0),o([(0,s.MZ)({type:Boolean})],Z.prototype,"animateMenuOpen",void 0),Z=o([(0,s.EM)("ia-menu-slider")],Z);let W=class extends r.WF{constructor(){super(...arguments),this.loaderMessage=""}get bookIconSvg(){return r.JW`
450
+ `}};o([(0,i.MZ)({type:Array})],re.prototype,"menus",void 0),o([(0,i.MZ)({type:Boolean})],re.prototype,"open",void 0),o([(0,i.MZ)({type:Boolean})],re.prototype,"manuallyHandleClose",void 0),o([(0,i.MZ)({type:String})],re.prototype,"selectedMenu",void 0),o([(0,i.MZ)({type:Object})],re.prototype,"selectedMenuAction",void 0),o([(0,i.MZ)({type:Boolean})],re.prototype,"animateMenuOpen",void 0),o([(0,i.P)(".content.open button.close")],re.prototype,"contentCloseButton",void 0),o([(0,i.P)(".menu-list")],re.prototype,"menuList",void 0),re=o([(0,i.EM)("ia-menu-slider")],re);let oe=class extends r.WF{constructor(){super(...arguments),this.loaderMessage=""}get bookIconSvg(){return r.JW`
427
451
  <g class="bookIcon" transform="matrix(1 0 0 -1 28 67.362264)">
428
452
  <path d="m44.71698 31.6981124v-29.99320678s-18.0956599.30735848-18.6322637-.7171698c-.0633962-.12226414-1.890566-.59207545-2.9745282-.59207545-1.3228302 0-3.5122641 0-4.1286791.74547168-.9707547 1.17452827-18.82811278.71660375-18.82811278.71660375v30.040754l1.83849052.7867924.29094339-28.48188608s15.94981097.15339622 17.09094297-1.10716978c.8145283-.90056602 4.997547-.91641507 5.3450942-.3526415.9611321 1.55716977 14.7101883 1.31716978 17.6077354 1.45981128l.3266038 28.22830118z"/>
429
453
  <path d="m40.1129424 33.5957539h-12.8337733c-1.8690565 0-3.1098112-.7545283-3.9299999-1.6279245v-26.70452764l1.2362264-.00792453c.4584906.72962262 3.0922641 1.39415091 3.0922641 1.39415091h10.1298111s1.0381131.01754717 1.5141509.47377357c.5643396.54056602.7913207 1.36981129.7913207 1.36981129z"/>
@@ -491,7 +515,7 @@
491
515
  transform: rotate(-360deg);
492
516
  }
493
517
  }
494
- `}};o([(0,s.MZ)({type:String})],W.prototype,"loaderMessage",void 0),W=o([(0,s.EM)("ia-itemnav-loader")],W);let N=class extends r.WF{constructor(){super(...arguments),this.identifier=""}emitLoaded(){this.dispatchEvent(new CustomEvent("loadingStateUpdated",{detail:{loaded:!0}}))}updated(e){e.has("identifier")&&this.emitLoaded()}get downloadUrl(){return`/download/${this.identifier}`}render(){return r.qy`
518
+ `}};o([(0,i.MZ)({type:String})],oe.prototype,"loaderMessage",void 0),oe=o([(0,i.EM)("ia-itemnav-loader")],oe);let ie=class extends r.WF{constructor(){super(...arguments),this.identifier=""}emitLoaded(){this.dispatchEvent(new CustomEvent("loadingStateUpdated",{detail:{loaded:!0}}))}updated(e){e.has("identifier")&&this.emitLoaded()}get downloadUrl(){return`/download/${this.identifier}`}render(){return r.qy`
495
519
  <section>
496
520
  <h2>THERE IS NO PREVIEW AVAILABLE FOR THIS ITEM</h2>
497
521
  <p>
@@ -535,7 +559,7 @@
535
559
  user-select: none;
536
560
  text-decoration: none;
537
561
  }
538
- `}};o([(0,s.MZ)({type:String})],N.prototype,"identifier",void 0),N=o([(0,s.EM)("ia-no-theater-available")],N);let U=class extends r.WF{constructor(){super(...arguments),this.viewAvailable=!0,this.baseHost="archive.org",this.signedIn=!1,this.menuContents=[],this.menuShortcuts=[],this.viewportInFullscreen=null,this.menuOpened=!1,this.loaded=!1,this.openMenuState="shift"}disconnectedCallback(){this.removeResizeObserver()}updated(e){if(e.has("sharedObserver")){const t=e.get("sharedObserver");null==t||t.removeObserver(this.resizeObserverConfig),this.setResizeObserver()}}handleResize(e){const{width:t}=e.contentRect;this.openMenuState=t<=600?"overlay":"shift"}setResizeObserver(){var e,t;null===(e=this.sharedObserver)||void 0===e||e.addObserver(this.resizeObserverConfig),null===(t=this.sharedObserver)||void 0===t||t.addObserver({target:this.headerSlot,handler:{handleResize:({contentRect:e})=>{e.height&&this.requestUpdate()}}})}removeResizeObserver(){var e;null===(e=this.sharedObserver)||void 0===e||e.removeObserver(this.resizeObserverConfig)}get resizeObserverConfig(){return{handler:this,target:this.frame}}get loaderTitle(){return this.viewportInFullscreen?"Internet Archive":""}get loadingArea(){return r.qy`
562
+ `}};o([(0,i.MZ)({type:String})],ie.prototype,"identifier",void 0),ie=o([(0,i.EM)("ia-no-theater-available")],ie);let ae=class extends r.WF{constructor(){super(...arguments),this.viewAvailable=!0,this.baseHost="archive.org",this.signedIn=!1,this.menuContents=[],this.menuShortcuts=[],this.viewportInFullscreen=null,this.menuOpened=!1,this.loaded=!1,this.openMenuState="shift"}disconnectedCallback(){super.disconnectedCallback(),this.removeResizeObserver()}updated(e){if(e.has("sharedObserver")){const t=e.get("sharedObserver");null==t||t.removeObserver(this.resizeObserverConfig),this.setResizeObserver()}}handleResize(e){const{width:t}=e.contentRect;this.openMenuState=t<=600?"overlay":"shift"}setResizeObserver(){var e,t;null===(e=this.sharedObserver)||void 0===e||e.addObserver(this.resizeObserverConfig),null===(t=this.sharedObserver)||void 0===t||t.addObserver({target:this.headerSlot,handler:{handleResize:({contentRect:e})=>{e.height&&this.requestUpdate()}}})}removeResizeObserver(){var e;null===(e=this.sharedObserver)||void 0===e||e.removeObserver(this.resizeObserverConfig)}get resizeObserverConfig(){return{handler:this,target:this.frame}}get loaderTitle(){return this.viewportInFullscreen?"Internet Archive":""}get loadingArea(){return r.qy`
539
563
  <div class="loading-area">
540
564
  <div class="loading-view">
541
565
  <ia-itemnav-loader
@@ -568,22 +592,21 @@
568
592
  @slotchange=${e=>this.slotChange(e,"main")}
569
593
  ></slot>
570
594
  </div>
571
- `}loadingStateUpdated(e){const{loaded:t}=e.detail;this.loaded=null!=t&&t}manageViewportFullscreen(e){const t=!!e.detail.isFullScreen;this.viewportInFullscreen=t||null;const n=new CustomEvent("fullscreenToggled",{detail:e.detail});this.dispatchEvent(n)}get shouldRenderMenu(){var e;return!!(null===(e=this.menuContents)||void 0===e?void 0:e.length)}toggleMenu(){this.menuOpened=!this.menuOpened}closeMenu(){this.menuOpened=!1}setOpenMenu(e){const{id:t}=e.detail;this.openMenu=t!==this.openMenu?t:void 0}setMenuContents(e){const t=[...e.detail];this.menuContents=t}setMenuShortcuts(e){this.menuShortcuts=[...e.detail]}manageSideMenuEvents(e){const{menuId:t,action:n}=e.detail;t&&("open"===n?this.openShortcut(t):"toggle"===n&&(this.openMenu=t,this.toggleMenu()))}get menuToggleButton(){return r.qy`
595
+ `}loadingStateUpdated(e){const{loaded:t}=e.detail;this.loaded=null!=t&&t}manageViewportFullscreen(e){const t=!!e.detail.isFullScreen;this.viewportInFullscreen=t||null;const n=new CustomEvent("fullscreenToggled",{detail:e.detail});this.dispatchEvent(n)}get shouldRenderMenu(){var e;return!!(null===(e=this.menuContents)||void 0===e?void 0:e.length)}toggleMenu(e=void 0){this.menuOpened=void 0!==e?e:!this.menuOpened,this.menuOpened?this.updateComplete.then(()=>{var e,t;const n=null===(t=null===(e=this.menuSlider)||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector("button.close");null==n||n.focus()}):this.updateComplete.then(()=>{var e;null===(e=this.toggleMenuButton)||void 0===e||e.focus()})}closeMenu(){this.toggleMenu(!1)}setOpenMenu(e){const{id:t}=e.detail;this.openMenu=t!==this.openMenu?t:void 0}setMenuContents(e){const t=[...e.detail];this.menuContents=t}setMenuShortcuts(e){this.menuShortcuts=[...e.detail]}manageSideMenuEvents(e){const{menuId:t,action:n}=e.detail;t&&("open"===n?this.openShortcut(t):"toggle"===n&&(this.openMenu=t,this.toggleMenu()))}get menuToggleButton(){return r.qy`
572
596
  <button
573
597
  class="toggle-menu"
574
598
  @click=${this.toggleMenu}
575
599
  title="Toggle theater side panels"
600
+ aria-label="Toggle theater side panels"
576
601
  >
577
- <div>
578
- <ia-icon-ellipses
579
- style="width: var(--iconWidth); height: var(--iconHeight);"
580
- ></ia-icon-ellipses>
581
- </div>
602
+ <ia-icon-ellipses aria-hidden="true"></ia-icon-ellipses>
582
603
  </button>
583
- `}get selectedMenuId(){return this.openMenu||""}get renderSideMenu(){const e=this.menuOpened?"":"hidden";return r.qy`
604
+ `}get selectedMenuId(){return this.openMenu||""}get renderSideMenu(){return r.qy`
584
605
  <nav>
585
- <div class="minimized">${this.shortcuts} ${this.menuToggleButton}</div>
586
- <div id="menu" class=${e}>
606
+ <div class="minimized ${m({hidden:this.menuOpened})}">
607
+ ${this.shortcuts} ${this.menuToggleButton}
608
+ </div>
609
+ <div id="menu" class=${m({hidden:!this.menuOpened})}>
587
610
  <ia-menu-slider
588
611
  .menus=${this.menuContents}
589
612
  .selectedMenu=${this.selectedMenuId}
@@ -594,8 +617,13 @@
594
617
  ></ia-menu-slider>
595
618
  </div>
596
619
  </nav>
597
- `}openShortcut(e=""){this.openMenu=e,this.menuOpened=!0}get shortcuts(){const e=this.menuShortcuts.map(({icon:e,id:t})=>"fullscreen"===t?r.qy`${e}`:r.qy`
598
- <button class="shortcut ${t}" @click="${()=>this.openShortcut(t)}">
620
+ `}openShortcut(e=""){this.openMenu=e,this.menuOpened=!0}get shortcuts(){const e=this.menuShortcuts.map(({icon:e,id:t,label:n})=>"fullscreen"===t?r.qy`${e}`:r.qy`
621
+ <button
622
+ class="shortcut ${t}"
623
+ @click="${()=>this.openShortcut(t)}"
624
+ title=${n}
625
+ aria-label=${n}
626
+ >
599
627
  ${e}
600
628
  </button>
601
629
  `);return r.qy`<div class="shortcuts">${e}</div>`}get menuClass(){var e,t;const n=(null===(e=this.menuContents)||void 0===e?void 0:e.length)||(null===(t=this.menuShortcuts)||void 0===t?void 0:t.length);return`${this.menuOpened&&n?"open":""} ${this.viewportInFullscreen?"fullscreen":""} ${this.openMenuState}`}static get styles(){const e=r.AH`var(--menuWidth, 320px)`,t=r.AH`var(--animationTiming, 200ms)`,n=r.AH`transform ${t} ease-out`,o=r.AH`var(--theaterMenuMargin, 42px)`,i=r.AH`var(--theaterBgColor, #000)`;return r.AH`
@@ -702,6 +730,11 @@
702
730
  height: ${o};
703
731
  }
704
732
 
733
+ nav .minimized button > * {
734
+ /** Prevent the icon's SVG description from stealing tooltip message */
735
+ pointer-events: none;
736
+ }
737
+
705
738
  nav .minimized button.toggle-menu > * {
706
739
  border: 2px solid var(--iconStrokeColor);
707
740
  border-radius: var(--iconWidth);
@@ -757,7 +790,7 @@
757
790
  margin-left: ${e};
758
791
  transition: ${n};
759
792
  }
760
- `}};o([(0,s.MZ)({type:Object,converter:e=>e&&"string"==typeof e?new B(JSON.parse(atob(e))):e})],U.prototype,"item",void 0),o([(0,s.MZ)({type:Boolean,reflect:!0})],U.prototype,"viewAvailable",void 0),o([(0,s.MZ)({type:String})],U.prototype,"baseHost",void 0),o([(0,s.MZ)({type:Boolean})],U.prototype,"signedIn",void 0),o([(0,s.MZ)({type:Array})],U.prototype,"menuContents",void 0),o([(0,s.MZ)({type:Array})],U.prototype,"menuShortcuts",void 0),o([(0,s.MZ)({type:Boolean,reflect:!0,attribute:!0})],U.prototype,"viewportInFullscreen",void 0),o([(0,s.MZ)({type:Boolean,reflect:!0})],U.prototype,"menuOpened",void 0),o([(0,s.MZ)({type:String,reflect:!0})],U.prototype,"openMenu",void 0),o([(0,s.MZ)({attribute:!1})],U.prototype,"modal",void 0),o([(0,s.MZ)({attribute:!1})],U.prototype,"sharedObserver",void 0),o([(0,s.MZ)({type:Boolean,reflect:!0,attribute:!0})],U.prototype,"loaded",void 0),o([(0,s.wk)()],U.prototype,"openMenuState",void 0),o([(0,s.P)("#frame")],U.prototype,"frame",void 0),o([(0,s.P)('slot[name="header"]')],U.prototype,"headerSlot",void 0),o([(0,s.P)('slot[name="main"]')],U.prototype,"mainSlot",void 0),U=o([(0,s.EM)("iaux-item-navigator")],U);var V=r.qy`
793
+ `}};o([(0,i.MZ)({type:Object,converter:e=>e&&"string"==typeof e?new F(JSON.parse(atob(e))):e})],ae.prototype,"item",void 0),o([(0,i.MZ)({type:Boolean,reflect:!0})],ae.prototype,"viewAvailable",void 0),o([(0,i.MZ)({type:String})],ae.prototype,"baseHost",void 0),o([(0,i.MZ)({type:Boolean})],ae.prototype,"signedIn",void 0),o([(0,i.MZ)({type:Array})],ae.prototype,"menuContents",void 0),o([(0,i.MZ)({type:Array})],ae.prototype,"menuShortcuts",void 0),o([(0,i.MZ)({type:Boolean,reflect:!0,attribute:!0})],ae.prototype,"viewportInFullscreen",void 0),o([(0,i.MZ)({type:Boolean,reflect:!0})],ae.prototype,"menuOpened",void 0),o([(0,i.MZ)({type:String,reflect:!0})],ae.prototype,"openMenu",void 0),o([(0,i.MZ)({attribute:!1})],ae.prototype,"modal",void 0),o([(0,i.MZ)({attribute:!1})],ae.prototype,"sharedObserver",void 0),o([(0,i.MZ)({type:Boolean,reflect:!0,attribute:!0})],ae.prototype,"loaded",void 0),o([(0,i.wk)()],ae.prototype,"openMenuState",void 0),o([(0,i.P)("#frame")],ae.prototype,"frame",void 0),o([(0,i.P)('slot[name="header"]')],ae.prototype,"headerSlot",void 0),o([(0,i.P)('slot[name="main"]')],ae.prototype,"mainSlot",void 0),o([(0,i.P)("ia-menu-slider")],ae.prototype,"menuSlider",void 0),o([(0,i.P)("button.toggle-menu")],ae.prototype,"toggleMenuButton",void 0),ae=o([(0,i.EM)("iaux-item-navigator")],ae);var se=r.qy`
761
794
  <svg
762
795
  viewBox="0 0 100 100"
763
796
  xmlns="http://www.w3.org/2000/svg"
@@ -769,7 +802,7 @@
769
802
  <path d="M70.6784759,10 L70.6784759,21.3240186 C64.5020053,21.66334 58.9104278,22.5826126 53.9037433,24.0818363 C48.8970588,25.5810601 44.8495989,27.4085163 41.7613636,29.5642049 C38.6731283,31.7198935 35.9982175,34.0552229 33.736631,36.5701929 C31.4750446,39.085163 29.8217469,41.5657574 28.776738,44.011976 C27.7317291,46.4581947 26.9173351,48.6848525 26.3335561,50.6919494 C25.7497772,52.6990464 25.4088681,54.3324462 25.3108289,55.592149 L25.2372995,57.4085163 C29.0296346,54.1661122 33.1751337,51.5524507 37.6737968,49.5675316 C42.1724599,47.5826126 46.2934492,46.3118208 50.0367647,45.7551564 C53.7800802,45.1984919 57.2571301,44.8713684 60.4679144,44.7737858 C63.6786988,44.6762031 66.1831551,44.7726769 67.9812834,45.0632069 L70.6784759,45.499002 L70.6784759,57.4051896 L100,33.3765802 L70.6784759,10 Z M76.4438503,62.4883566 L82.8609626,57.1157685 C82.9099822,57.0669772 82.9946524,57.0303837 83.1149733,57.005988 C83.2352941,56.9815924 83.4536542,56.9571967 83.7700535,56.9328011 C84.0864528,56.9084054 84.3905971,56.9449989 84.6824866,57.0425815 C84.9743761,57.1401641 85.217246,57.2854291 85.4110963,57.4783766 C85.6049465,57.671324 85.7263815,57.8409847 85.7754011,57.9873586 L85.8489305,58.2035928 L85.8489305,90 L0,90 L0,17.910845 L43.1784759,17.910845 C43.2765152,17.9596363 43.410205,18.0317143 43.5795455,18.1270792 C43.7488859,18.222444 43.9438503,18.4519849 44.1644385,18.8157019 C44.3850267,19.1794189 44.469697,19.5542249 44.4184492,19.9401198 C44.4184492,20.2794411 44.3092692,20.582169 44.0909091,20.8483034 C43.872549,21.1144378 43.6664439,21.3206919 43.4725936,21.4670659 L43.1818182,21.6134398 C40.557041,23.06609 38.2954545,24.396762 36.3970588,25.6054558 L30.7820856,29.8170326 L11.5274064,29.8170326 L11.5274064,78.1669993 L74.1811497,78.1669993 L74.1811497,65.5355955 C74.1811497,65.1009093 74.3995098,64.6407186 74.8362299,64.1550233 L76.4438503,62.4883566 Z" id="Shape"></path>
770
803
  </g>
771
804
  </svg>
772
- `;class G extends r.WF{static get styles(){return r.AH`
805
+ `;class le extends r.WF{static get styles(){return r.AH`
773
806
  :host {
774
807
  width: var(--iconWidth, 'auto');
775
808
  height: var(--iconHeight, 'auto');
@@ -782,13 +815,13 @@
782
815
  .stroke-color {
783
816
  stroke: var(--iconStrokeColor);
784
817
  }
785
- `}render(){return V}}customElements.define("ia-icon-share",G);var J=r.qy`
818
+ `}render(){return se}}customElements.define("ia-icon-share",le);var ce=r.qy`
786
819
  <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="twitterTitleID twitterDescID">
787
820
  <title id="twitterTitleID">Twitter icon</title>
788
821
  <desc id="twitterDescID">The Twitter logo, a cartoon bird</desc>
789
822
  <path d="m31.5297453 8.76273313c-.3135031.40766104-.7447036.83083673-1.2936015 1.26952707-.5488979.4386904-.9169698.7837578-1.1042157 1.0352022.1562166 2.319709-.1417719 4.5297454-.8939653 6.6301092-.7521935 2.1003638-1.8023754 3.9182538-3.1505457 5.45367-1.3481704 1.5354162-2.9627648 2.8284828-4.8437835 3.8791996-1.8810186 1.0507169-3.8321207 1.7483416-5.8533062 2.092874s-4.1215493.2894286-6.30109136-.1653114c-2.17954205-.45474-4.2092874-1.3401455-6.08923604-2.6562165 2.72737.4697196 5.67408517-.2514445 8.8401455-2.1634924-3.0719024-.7521935-4.88979241-2.2881447-5.45367-4.6078537 1.12882516.0631287 1.86550396.0631287 2.21003638 0-2.91568586-1.2850417-4.38904344-3.3693558-4.42007276-6.2529424.21934517.0310293.53284828.1487267.94050931.3530922s.78375775.3060133 1.12829017.3049433c-.81532206-.7211641-1.41076396-1.9045581-1.7863257-3.5501819-.37556173-1.64562376-.17173122-3.17355015.61149155-4.58377912 1.81789001 1.88101862 3.6908838 3.36989086 5.61898138 4.46661672 1.92809757 1.0967259 4.22426707 1.7547614 6.88850847 1.9741066-.2503745-1.1908838-.1722662-2.32719882.2343248-3.40894502.4065911-1.0817462 1.0416221-1.93612241 1.9050931-2.56312861.863471-.62700621 1.8114702-1.0817462 2.8439975-1.36421999 1.0325272-.28247378 2.0827091-.27444896 3.1505456.02407447s1.9767815.87042585 2.726835 1.71570726c1.3791997-.37663172 2.6802911-.87845068 3.9032742-1.50545688-.0310293.37663171-.1407019.74470361-.3290178 1.1042157-.1883158.35951209-.3530922.62593623-.4943291.79927242s-.3841216.4317355-.728654.77519795c-.3445324.34346244-.5638776.57832227-.6580355.70457949.2193452-.09415792.6895998-.23539482 1.410764-.42371067.7211641-.18831586 1.2069334-.39214638 1.4573079-.61149155 0 .44350524-.1567516.86668093-.4702547 1.27434196z" class="fill-color" />
790
823
  </svg>
791
- `;class Y extends r.WF{static get styles(){return r.AH`
824
+ `;class ue extends r.WF{static get styles(){return r.AH`
792
825
  :host {
793
826
  width: var(--iconWidth, 'auto');
794
827
  height: var(--iconHeight, 'auto');
@@ -801,13 +834,13 @@
801
834
  .stroke-color {
802
835
  stroke: var(--iconStrokeColor);
803
836
  }
804
- `}render(){return J}}customElements.define("ia-icon-twitter",Y);var X=r.qy`
837
+ `}render(){return ce}}customElements.define("ia-icon-twitter",ue);var de=r.qy`
805
838
  <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="facebookTitleID facebookDescID">
806
839
  <title id="facebookTitleID">Facebook icon</title>
807
840
  <desc id="facebookDescID">A lowercase f</desc>
808
841
  <path d="m30.91057 19.2442068.2670004-5.3339402h-5.7329237c-.0890001-3.4962895.25183-5.42243459 1.0224903-5.77843514.3560005-.17800028.8004955-.28925046 1.333485-.33375053s1.0442346-.0520853 1.5337353-.02275571c.4895008.02932959 1.045246.01466479 1.6672356-.04399439.0890001-1.59997977.1335002-3.24445961.1335002-4.93343953-2.1633102-.20732987-3.6742898-.28115953-4.5329389-.22148898-2.8146294.17800028-4.7847688 1.25965538-5.9104183 3.2449653-.1780003.3256596-.3261653.68873971-.444495 1.08924034-.1183298.40050062-.2144095.76358074-.2882391 1.08924034-.0738297.32565959-.125915.7848194-.1562559 1.37747942-.030341.59266002-.052591 1.04474028-.0667501 1.35624078-.0141592.3115005-.0217444.8449956-.0227558 1.6004854v1.5777298h-3.8229605v5.3339401h3.8669549v14.622824h5.8224296c0-.3560006-.0146648-1.6819003-.0439944-3.9776994-.0293296-2.295799-.0515796-4.2957737-.0667501-5.9999241s-.0075853-3.2525506.0227557-4.6452005h5.4219289z" class="fill-color" />
809
842
  </svg>
810
- `;class Q extends r.WF{static get styles(){return r.AH`
843
+ `;class he extends r.WF{static get styles(){return r.AH`
811
844
  :host {
812
845
  width: var(--iconWidth, 'auto');
813
846
  height: var(--iconHeight, 'auto');
@@ -820,13 +853,13 @@
820
853
  .stroke-color {
821
854
  stroke: var(--iconStrokeColor);
822
855
  }
823
- `}render(){return X}}customElements.define("ia-icon-facebook",Q);var K=r.qy`
856
+ `}render(){return de}}customElements.define("ia-icon-facebook",he);var pe=r.qy`
824
857
  <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="tumblrTitleID tumblrDescID">
825
858
  <title id="tumblrTitleID">Tumblr icon</title>
826
859
  <desc id="tumblrDescID">A lowercase letter t</desc>
827
860
  <path d="m8.50321407 8.54544475v5.32088575c.15641786.0310693.6819176.0310693 1.57649923 0 .8945816-.0310693 1.3574071.0160703 1.3884764.1414189.0942792 1.5695354.1333837 3.2253149.1173133 4.9673385-.0160703 1.7420236-.0316049 3.3426283-.0466039 4.8018141s.2046288 2.824628.6588835 4.0963267c.4542546 1.2716986 1.1999178 2.2209194 2.2369897 2.8476622 1.2556283.784232 2.9896167 1.207953 5.2019653 1.271163 2.2123485.0632099 4.1659648-.2506972 5.8608487-.9417213-.0310693-.3449764-.0230341-1.4045467.0241055-3.1787109.0471397-1.7741643-.0080351-2.75499-.1655244-2.9424772-3.5472571 1.0360005-5.697467.6904885-6.4506298-1.0365361-.7220934-1.6638147-.8635123-4.9909084-.4242566-9.981281v-.046604h6.7318605v-5.32088568h-6.7318605v-6.54383772h-4.0497228c-.2828378 1.28669763-.6122795 2.35376743-.9883252 3.20120941-.3760457.84744199-.98029 1.60060471-1.812733 2.25948817-.832443.65888347-1.87594303 1.01993018-3.1305 1.08314014z" class="fill-color" />
828
861
  </svg>
829
- `;class ee extends r.WF{static get styles(){return r.AH`
862
+ `;class fe extends r.WF{static get styles(){return r.AH`
830
863
  :host {
831
864
  width: var(--iconWidth, 'auto');
832
865
  height: var(--iconHeight, 'auto');
@@ -839,13 +872,13 @@
839
872
  .stroke-color {
840
873
  stroke: var(--iconStrokeColor);
841
874
  }
842
- `}render(){return K}}customElements.define("ia-icon-tumblr",ee);var te=r.qy`
875
+ `}render(){return pe}}customElements.define("ia-icon-tumblr",fe);var me=r.qy`
843
876
  <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="pinterestTitleID pinterestDescID">
844
877
  <title id="pinterestTitleID">Pinterest icon</title>
845
878
  <desc id="pinterestDescID">A stylized letter p</desc>
846
879
  <path d="m11.9051049 30.5873434.653491-1.0742755.4207845-.839975c.2805229-.591861.5371377-1.2533214.7698443-1.9843813.2327065-.7310599.4659444-1.6029125.6997135-2.6155579.2337692-1.0126455.4128151-1.752206.5371377-2.2186817.0308151.030815.0775689.0855382.1402615.1641697.0626927.0786314.1094465.1333547.1402615.1641697.1243227.1870153.2178304.311338.280523.372968 1.1210293.964829 2.3817888 1.4631823 3.7822785 1.4950599 1.4939973 0 2.8790795-.3426843 4.1552465-1.0280529 2.1166733-1.1826593 3.6733633-3.1128487 4.6700699-5.7905679.4048457-1.1518444.6848374-2.5996192.8399751-4.3433245.1243226-1.587505-.0781002-3.0974411-.6072685-4.5298084-.903199-2.36638128-2.5528653-4.20306294-4.948999-5.51004497-1.276167-.65349101-2.5990879-1.05833667-3.9687625-1.21453696-1.525875-.21783034-3.1293188-.17107651-4.8103315.14026149-2.7701643.52916833-5.02709913 1.743174-6.77080442 3.64201699-1.99235065 2.14748836-2.98852598 4.62225355-2.98852598 7.42429545 0 2.9571797.9494215 5.0584455 2.84826449 6.3037975l.83997504.4207845c.12432268 0 .22526845.0154075.3028373.0462225s.1551377.0074381.23270656-.0701308c.07756885-.0775688.13229208-.1243226.16416969-.1402614s.07066204-.0860696.11635328-.2103923c.04569124-.1243226.07703756-.2098609.09403895-.2566147.01700139-.0467539.04834771-.1476996.09403895-.3028373s.06906816-.2486454.07013074-.280523l.14026149-.5132295c.06269263-.311338.09403895-.5291684.09403895-.653491-.03081502-.1243227-.12432268-.2799917-.28052297-.467007-.15620029-.1870154-.23376915-.2959305-.23270656-.3267455-.62267599-.8096914-.9494215-1.7904592-.98023652-2.9423035-.03081502-1.55669.28052297-2.9731185.93401399-4.24928547 1.18265932-2.45882635 3.17501002-3.93741618 5.97705192-4.43576949 1.6183201-.311338 3.1356943-.25661476 4.5521228.16416969 1.4164285.42078446 2.5135496 1.09765239 3.2913633 2.03060379.8405063 1.02752164 1.3229208 2.28828114 1.4472435 3.78227848.1243227 1.4004897-.0313463 2.9725872-.467007 4.7162925-.3740306 1.3696746-.9186065 2.5528653-1.6337275 3.5495719-.9967066 1.245352-2.0863896 1.8834355-3.269049 1.9142505-1.7118277.0626926-2.7547568-.6375522-3.1287874-2.1007345-.0935077-.4664757 0-1.2134744.2805229-2.240996.7469987-2.5842117 1.1359055-3.9384788 1.1667206-4.0628015.1870153-1.0275216.2024228-1.7904591.0462225-2.2888124-.1870153-.65349104-.5759222-1.15928246-1.1667205-1.51737429-.5907984-.35809182-1.2756357-.39687625-2.054512-.11635327-1.1826594.43566067-1.9610044 1.40048968-2.335035 2.89448706-.311338 1.306982-.2491767 2.6299028.186484 3.9687625 0 .0626926.0313463.1402615.094039.2327065.0626926.0924451.0940389.1700139.0940389.2327066 0 .0935076-.0313463.2491766-.0940389.467007-.0626927.2178303-.094039.3580918-.094039.4207844-.0935076.4356607-.3038999 1.3308903-.6311767 2.6856887-.3272768 1.3547985-.5838915 2.3897582-.7698443 3.1048793-.7778136 3.2068876-1.12049796 5.5881451-1.02805289 7.1437725l.37296809 2.7558194c.653491-.591861 1.2294131-1.2299445 1.7277664-1.9142505z" class="fill-color" />
847
880
  </svg>
848
- `;class ne extends r.WF{static get styles(){return r.AH`
881
+ `;class ve extends r.WF{static get styles(){return r.AH`
849
882
  :host {
850
883
  width: var(--iconWidth, 'auto');
851
884
  height: var(--iconHeight, 'auto');
@@ -858,13 +891,13 @@
858
891
  .stroke-color {
859
892
  stroke: var(--iconStrokeColor);
860
893
  }
861
- `}render(){return te}}customElements.define("ia-icon-pinterest",ne);var re=r.qy`
894
+ `}render(){return me}}customElements.define("ia-icon-pinterest",ve);var be=r.qy`
862
895
  <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="emailTitleID emailDescID">
863
896
  <title id="emailTitleID">Email icon</title>
864
897
  <desc id="emailDescID">An illustration of an envelope</desc>
865
898
  <path d="m32 7.04156803v19.91686397c0 .5752421-.4763773 1.041568-1.0640184 1.041568h-27.87196316c-.58764116 0-1.06401844-.4663259-1.06401844-1.041568v-19.91686397c0-.57524214.47637728-1.04156803 1.06401844-1.04156803h27.87196316c.5876411 0 1.0640184.46632589 1.0640184 1.04156803zm-26.25039901 1.19676167 10.04327011 10.1323738c.5135662.4194048.8817166.6291071 1.1044511.6291071.1198794 0 .2695514-.0503424.4490158-.1510273.1794644-.100685.3291364-.2013699.4490158-.3020548l.1798191-.1510273 10.1198794-10.15841306zm16.77212271 9.7303286 6.8831353 6.7889404v-13.5778809zm-17.92871075-6.6379131v13.350819l6.78098955-6.6629107zm22.09008685 14.2059464-5.9074304-5.8588202-.9757049.9551179-.3594018.3295984c-.0342324.0304241-.0665646.0587822-.0969964.0850743l-.1597867.1329606c-.0684912.0540844-.1198794.0895749-.1541644.1064714-.6674943.3687151-1.3523675.5530727-2.0546196.5530727-.65047 0-1.3782586-.218035-2.1833659-.6541048l-.6682036-.4520405-1.0278418-1.0311524-5.95850326 5.832781z" class="fill-color" />
866
899
  </svg>
867
- `;class oe extends r.WF{static get styles(){return r.AH`
900
+ `;class ye extends r.WF{static get styles(){return r.AH`
868
901
  :host {
869
902
  width: var(--iconWidth, 'auto');
870
903
  height: var(--iconHeight, 'auto');
@@ -877,13 +910,13 @@
877
910
  .stroke-color {
878
911
  stroke: var(--iconStrokeColor);
879
912
  }
880
- `}render(){return re}}customElements.define("ia-icon-email",oe);var ie=r.qy`
913
+ `}render(){return be}}customElements.define("ia-icon-email",ye);var ge=r.qy`
881
914
  <svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="linkTitleID linkDescID">
882
915
  <title id="linkTitleID">Link icon</title>
883
916
  <desc id="linkDescID">Two chain links linked together</desc>
884
917
  <path d="m7.80511706 12.3659763c1.2669254-2.2579539 4.09819784-2.9949938 6.41200864-1.7733458l.2295791.12871 1.6067188.9559859 3.5467013-6.31849361c1.2682451-2.26030597 4.104098-2.99652769 6.4192376-1.76952182l.2223501.12488594 3.2168204 1.91103915c2.2770002 1.3527136 3.1866331 4.21502324 2.0564431 6.51290984l-.1198433.2278304-5.2002499 9.2680474c-1.2669254 2.2579539-4.0981978 2.9949938-6.4120086 1.7733458l-.2295791-.12871-1.6096554-.9558482-3.5437647 6.3183559c-1.2682451 2.260306-4.104098 2.9965277-6.41923761 1.7695218l-.22235013-.1248859-3.21682032-1.9110392c-2.27700024-1.3527136-3.18663314-4.2150232-2.05644312-6.5129098l.11984332-.2278304zm13.93955474-5.73311741-3.563271 6.35055051c1.889633 1.4530595 2.5776248 4.0429866 1.5410255 6.156875l-.1223014.2328355-.4183304.7430134 1.6096554.9558483c1.1431442.6791157 2.5155496.3977368 3.1667361-.5628389l.0921501-.1491451 5.2002498-9.2680474c.5752467-1.0252226.2110342-2.4011579-.8559335-3.14755806l-.1742742-.11247814-3.2168203-1.91103915c-1.1402863-.67741793-2.5086889-.39913772-3.1618387.55564729zm-11.79500786 7.00714351-5.20024982 9.2680474c-.57524673 1.0252226-.21103426 2.4011579.85593348 3.1475581l.17427416.1124781 3.21682032 1.9110392c1.14028632.6774179 2.50868892.3991377 3.16183872-.5556473l.0970474-.1563368 3.5622708-6.3513198c-1.8888875-1.4532134-2.5764504-4.042623-1.5400057-6.1561456l.1222818-.2327956.4153938-.7428758-1.6067188-.9559859c-1.1431442-.6791157-2.5155496-.3977368-3.1667361.5628389zm6.97653866 1.5796652-.3817806.6812386c-.5117123.9119895-.2800268 2.1014993.528439 2.8785267l.382717-.6803391c.5119098-.9123415.2798478-2.1024176-.5293754-2.8794262z" class="fill-color" />
885
918
  </svg>
886
- `;class ae extends r.WF{static get styles(){return r.AH`
919
+ `;class ke extends r.WF{static get styles(){return r.AH`
887
920
  :host {
888
921
  width: var(--iconWidth, 'auto');
889
922
  height: var(--iconHeight, 'auto');
@@ -896,22 +929,22 @@
896
929
  .stroke-color {
897
930
  stroke: var(--iconStrokeColor);
898
931
  }
899
- `}render(){return ie}}customElements.define("ia-icon-link",ae);const se=e=>{const t=e.currentTarget,n=t.querySelector("textarea"),r=t.querySelector("small");n.select(),document.execCommand("copy"),n.blur(),r.classList.add("visible"),clearTimeout(r.timeout),r.timeout=setTimeout(()=>r.classList.remove("visible"),4e3)},le=r.qy`<ia-icon-share
932
+ `}render(){return ge}}customElements.define("ia-icon-link",ke);const we=e=>{const t=e.currentTarget,n=t.querySelector("textarea"),r=t.querySelector("small");n.select(),document.execCommand("copy"),n.blur(),r.classList.add("visible"),clearTimeout(r.timeout),r.timeout=setTimeout(()=>r.classList.remove("visible"),4e3)},Se=r.qy`<ia-icon-share
900
933
  style="width: var(--iconWidth); height: var(--iconHeight);"
901
- ></ia-icon-share>`;let ce=class extends r.WF{constructor(){super(...arguments),this.baseHost="archive.org",this.creator="",this.description="",this.embedOptionsVisible=!1,this.identifier="",this.sharingOptions=[],this.type="",this.renderHeader=!1,this.fileSubPrefix=""}updated(e){e.has("sharingOptions")&&!this.sharingOptions.length&&this.loadProviders()}loadProviders(){let e=`https://${this.baseHost}/details/${this.identifier}`;this.fileSubPrefix&&(e+=`/${this.fileSubPrefix}`);const t=[this.description,this.creator,"Free Download, Borrow, and Streaming","Internet Archive"].filter(Boolean).join(" : ");this.sharingOptions=[{name:"Twitter",icon:r.qy`<ia-icon-twitter></ia-icon-twitter>`,url:`https://twitter.com/intent/tweet?${new URLSearchParams({url:e,text:t,via:"internetarchive"})}`},{name:"Facebook",icon:r.qy`<ia-icon-facebook></ia-icon-facebook>`,url:`https://www.facebook.com/sharer/sharer.php?${new URLSearchParams({u:e})}`},{name:"Tumblr",icon:r.qy`<ia-icon-tumblr></ia-icon-tumblr>`,url:`https://www.tumblr.com/widgets/share/tool/preview?${new URLSearchParams({posttype:"link",canonicalUrl:e,title:t})}`},{name:"Pinterest",icon:r.qy`<ia-icon-pinterest></ia-icon-pinterest>`,url:`http://www.pinterest.com/pin/create/button/?${new URLSearchParams({url:e,description:t})}`},{name:"Email",icon:r.qy`<ia-icon-email></ia-icon-email>`,url:`mailto:?${new URLSearchParams({subject:t,body:e})}`}]}get iframeEmbed(){return`<iframe\n src="https://${this.baseHost}/embed/${this.identifier}"\n width="560" height="384" frameborder="0"\n webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen\n ></iframe>`}get bbcodeEmbed(){return`[archiveorg ${this.identifier} width=560 height=384 frameborder=0 webkitallowfullscreen=true mozallowfullscreen=true]`}get helpURL(){return`https://${this.baseHost}/help/audio.php?identifier=${this.identifier}`}get header(){const e=r.qy`<header><h3>Share this ${this.type}</h3></header>`;return this.renderHeader?e:r.s6}render(){return r.qy`
934
+ ></ia-icon-share>`;let Ce=class extends r.WF{constructor(){super(...arguments),this.baseHost="archive.org",this.creator="",this.description="",this.embedOptionsVisible=!1,this.identifier="",this.sharingOptions=[],this.type="",this.renderHeader=!1,this.fileSubPrefix=""}updated(e){e.has("sharingOptions")&&!this.sharingOptions.length&&this.loadProviders()}loadProviders(){let e=`https://${this.baseHost}/details/${this.identifier}`;this.fileSubPrefix&&(e+=`/${this.fileSubPrefix}`);const t=[this.description,this.creator,"Free Download, Borrow, and Streaming","Internet Archive"].filter(Boolean).join(" : ");this.sharingOptions=[{name:"Twitter",icon:r.qy`<ia-icon-twitter aria-hidden="true"></ia-icon-twitter>`,url:`https://twitter.com/intent/tweet?${new URLSearchParams({url:e,text:t,via:"internetarchive"})}`},{name:"Facebook",icon:r.qy`<ia-icon-facebook aria-hidden="true"></ia-icon-facebook>`,url:`https://www.facebook.com/sharer/sharer.php?${new URLSearchParams({u:e})}`},{name:"Tumblr",icon:r.qy`<ia-icon-tumblr aria-hidden="true"></ia-icon-tumblr>`,url:`https://www.tumblr.com/widgets/share/tool/preview?${new URLSearchParams({posttype:"link",canonicalUrl:e,title:t})}`},{name:"Pinterest",icon:r.qy`<ia-icon-pinterest aria-hidden="true"></ia-icon-pinterest>`,url:`http://www.pinterest.com/pin/create/button/?${new URLSearchParams({url:e,description:t})}`},{name:"Email",icon:r.qy`<ia-icon-email aria-hidden="true"></ia-icon-email>`,url:`mailto:?${new URLSearchParams({subject:t,body:e})}`}]}get iframeEmbed(){return`<iframe\n src="https://${this.baseHost}/embed/${this.identifier}"\n width="560" height="384" frameborder="0"\n webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen\n ></iframe>`}get bbcodeEmbed(){return`[archiveorg ${this.identifier} width=560 height=384 frameborder=0 webkitallowfullscreen=true mozallowfullscreen=true]`}get helpURL(){return`https://${this.baseHost}/help/audio.php?identifier=${this.identifier}`}get header(){const e=r.qy`<header><h3>Share this ${this.type}</h3></header>`;return this.renderHeader?e:r.s6}render(){return r.qy`
902
935
  ${this.header}
903
- <main>
936
+ <div>
904
937
  ${this.sharingOptions.map(e=>r.qy` <a class="share-option" href="${e.url}" target="_blank">
905
938
  ${e.icon} ${e.name}
906
939
  </a>`)}
907
940
  <details>
908
941
  <summary class="share-option">
909
- <ia-icon-link></ia-icon-link>
942
+ <ia-icon-link aria-hidden="true"></ia-icon-link>
910
943
  Get an embeddable link
911
944
  </summary>
912
945
  <div class="embed">
913
946
  <h4>Embed</h4>
914
- <div class="code" @click=${se}>
947
+ <div class="code" @click=${we}>
915
948
  <textarea readonly>${this.iframeEmbed}</textarea>
916
949
  <small>Copied to clipboard</small>
917
950
  </div>
@@ -919,7 +952,7 @@
919
952
  Embed for wordpress.com hosted blogs and archive.org item
920
953
  &lt;description&gt; tags
921
954
  </h4>
922
- <div class="code" @click=${se}>
955
+ <div class="code" @click=${we}>
923
956
  <textarea readonly>${this.bbcodeEmbed}</textarea>
924
957
  <small>Copied to clipboard</small>
925
958
  </div>
@@ -931,7 +964,7 @@
931
964
  </p>
932
965
  </div>
933
966
  </details>
934
- </main>
967
+ </div>
935
968
  `}get providerIcon(){return r.qy`<ia-icon-share
936
969
  style="width: var(--iconWidth); height: var(--iconHeight);"
937
970
  ></ia-icon-share>`}static get styles(){return r.AH`
@@ -958,7 +991,7 @@
958
991
  font-size: 1.4rem;
959
992
  }
960
993
 
961
- main {
994
+ :host > div {
962
995
  padding: 1rem 0;
963
996
  }
964
997
 
@@ -969,6 +1002,12 @@
969
1002
  text-decoration: none;
970
1003
  color: var(--shareLinkColor);
971
1004
  cursor: pointer;
1005
+ transition: background-color 0.2s;
1006
+ border-radius: 6px;
1007
+ }
1008
+
1009
+ .share-option:hover {
1010
+ background-color: rgba(255, 255, 255, 0.05);
972
1011
  }
973
1012
 
974
1013
  .share-option > * {
@@ -1039,7 +1078,7 @@
1039
1078
  small.visible {
1040
1079
  opacity: 1;
1041
1080
  }
1042
- `}};o([(0,s.MZ)({type:String})],ce.prototype,"baseHost",void 0),o([(0,s.MZ)({type:String})],ce.prototype,"creator",void 0),o([(0,s.MZ)({type:String})],ce.prototype,"description",void 0),o([(0,s.MZ)({type:Boolean})],ce.prototype,"embedOptionsVisible",void 0),o([(0,s.MZ)({type:String})],ce.prototype,"identifier",void 0),o([(0,s.MZ)({type:Array})],ce.prototype,"sharingOptions",void 0),o([(0,s.MZ)({type:String})],ce.prototype,"type",void 0),o([(0,s.MZ)({type:Boolean})],ce.prototype,"renderHeader",void 0),o([(0,s.MZ)({type:String})],ce.prototype,"fileSubPrefix",void 0),ce=o([(0,s.EM)("iaux-in-share-panel")],ce),n(6033);var ue=n(6681),de=n(1091),he=ue.ge.I,pe=function(){return document.createComment("")},fe=function(e,t,n){var r,o=e._$AA.parentNode,i=void 0===t?e._$AB:t._$AA;if(void 0===n){var a=o.insertBefore(pe(),i),s=o.insertBefore(pe(),i);n=new he(a,s,e,e.options)}else{var l,c=n._$AB.nextSibling,u=n._$AM,d=u!==e;if(d&&(null===(r=n._$AQ)||void 0===r||r.call(n,e),n._$AM=e,void 0!==n._$AP&&(l=e._$AU)!==u._$AU&&n._$AP(l)),c!==i||d)for(var h=n._$AA;h!==c;){var p=h.nextSibling;o.insertBefore(h,i),h=p}}return n},me=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return e._$AI(t,n),e},ve={},be=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ve;return e._$AH=t},ye=function(e){var t;null===(t=e._$AP)||void 0===t||t.call(e,!1,!0);for(var n=e._$AA,r=e._$AB.nextSibling;n!==r;){var o=n.nextSibling;n.remove(),n=o}};function ge(e){return ge="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},ge(e)}function ke(e,t){if(e){if("string"==typeof e)return we(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)?we(e,t):void 0}}function we(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 Se(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,Ce(r.key),r)}}function Ce(e){var t=function(e){if("object"!=ge(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ge(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ge(t)?t:t+""}function Oe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Oe=function(){return!!e})()}function xe(e){return xe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xe(e)}function je(e,t){return je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},je(e,t)}var Be=function(e,t,n){for(var r=new Map,o=t;o<=n;o++)r.set(e[o],o);return r},Pe=(0,de.u$)(function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t,n){return t=xe(t),function(e,t){if(t&&("object"==ge(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,Oe()?Reflect.construct(t,n||[],xe(e).constructor):t.apply(e,n))}(this,t,[e]),e.type!==de.OA.CHILD)throw Error("repeat() can only be used in text expressions");return n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&je(e,t)}(t,e),function(e,t){return t&&Se(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"ct",value:function(e,t,n){var r;void 0===n?n=t:void 0!==t&&(r=t);var o,i=[],a=[],s=0,l=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=ke(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw o}}}}(e);try{for(l.s();!(o=l.n()).done;){var c=o.value;i[s]=r?r(c,s):s,a[s]=n(c,s),s++}}catch(e){l.e(e)}finally{l.f()}return{values:a,keys:i}}},{key:"render",value:function(e,t,n){return this.ct(e,t,n).values}},{key:"update",value:function(e,t){var n,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||ke(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,3),o=r[0],i=r[1],a=r[2],s=function(e){return e._$AH}(e),l=this.ct(o,i,a),c=l.values,u=l.keys;if(!Array.isArray(s))return this.ut=u,c;for(var d,h,p=null!==(n=this.ut)&&void 0!==n?n:this.ut=[],f=[],m=0,v=s.length-1,b=0,y=c.length-1;m<=v&&b<=y;)if(null===s[m])m++;else if(null===s[v])v--;else if(p[m]===u[b])f[b]=me(s[m],c[b]),m++,b++;else if(p[v]===u[y])f[y]=me(s[v],c[y]),v--,y--;else if(p[m]===u[y])f[y]=me(s[m],c[y]),fe(e,f[y+1],s[m]),m++,y--;else if(p[v]===u[b])f[b]=me(s[v],c[b]),fe(e,s[m],s[v]),v--,b++;else if(void 0===d&&(d=Be(u,b,y),h=Be(p,m,v)),d.has(p[m]))if(d.has(p[v])){var g=h.get(u[b]),k=void 0!==g?s[g]:null;if(null===k){var w=fe(e,s[m]);me(w,c[b]),f[b]=w}else f[b]=me(k,c[b]),fe(e,s[m],k),s[g]=null;b++}else ye(s[v]),v--;else ye(s[m]),m++;for(;b<=y;){var S=fe(e,f[y+1]);me(S,c[b]),f[b++]=S}for(;m<=v;){var C=s[m++];null!==C&&ye(C)}return this.ut=u,be(e,f),ue.c0}}])}(de.WL));const Me=r.qy`
1081
+ `}};o([(0,i.MZ)({type:String})],Ce.prototype,"baseHost",void 0),o([(0,i.MZ)({type:String})],Ce.prototype,"creator",void 0),o([(0,i.MZ)({type:String})],Ce.prototype,"description",void 0),o([(0,i.MZ)({type:Boolean})],Ce.prototype,"embedOptionsVisible",void 0),o([(0,i.MZ)({type:String})],Ce.prototype,"identifier",void 0),o([(0,i.MZ)({type:Array})],Ce.prototype,"sharingOptions",void 0),o([(0,i.MZ)({type:String})],Ce.prototype,"type",void 0),o([(0,i.MZ)({type:Boolean})],Ce.prototype,"renderHeader",void 0),o([(0,i.MZ)({type:String})],Ce.prototype,"fileSubPrefix",void 0),Ce=o([(0,i.EM)("iaux-in-share-panel")],Ce),n(6033);var Oe=a.ge.I,xe=function(){return document.createComment("")},Me=function(e,t,n){var r,o=e._$AA.parentNode,i=void 0===t?e._$AB:t._$AA;if(void 0===n){var a=o.insertBefore(xe(),i),s=o.insertBefore(xe(),i);n=new Oe(a,s,e,e.options)}else{var l,c=n._$AB.nextSibling,u=n._$AM,d=u!==e;if(d&&(null===(r=n._$AQ)||void 0===r||r.call(n,e),n._$AM=e,void 0!==n._$AP&&(l=e._$AU)!==u._$AU&&n._$AP(l)),c!==i||d)for(var h=n._$AA;h!==c;){var p=h.nextSibling;o.insertBefore(h,i),h=p}}return n},je=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return e._$AI(t,n),e},Be={},Pe=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Be;return e._$AH=t},Ee=function(e){var t;null===(t=e._$AP)||void 0===t||t.call(e,!1,!0);for(var n=e._$AA,r=e._$AB.nextSibling;n!==r;){var o=n.nextSibling;n.remove(),n=o}};function Le(e){return Le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Le(e)}function Ae(e,t){if(e){if("string"==typeof e)return Ie(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)?Ie(e,t):void 0}}function Ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function _e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,ze(r.key),r)}}function ze(e){var t=function(e){if("object"!=Le(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Le(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Le(t)?t:t+""}function Te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Te=function(){return!!e})()}function De(e){return De=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},De(e)}function $e(e,t){return $e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$e(e,t)}var He=function(e,t,n){for(var r=new Map,o=t;o<=n;o++)r.set(e[o],o);return r},qe=(0,s.u$)(function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t,n){return t=De(t),function(e,t){if(t&&("object"==Le(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Te()?Reflect.construct(t,n||[],De(e).constructor):t.apply(e,n))}(this,t,[e]),e.type!==s.OA.CHILD)throw Error("repeat() can only be used in text expressions");return n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$e(e,t)}(t,e),function(e,t){return t&&_e(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"ct",value:function(e,t,n){var r;void 0===n?n=t:void 0!==t&&(r=t);var o,i=[],a=[],s=0,l=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ae(e))){t&&(e=t);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,i=!0,a=!1;return{s:function(){t=t.call(e)},n:function(){var e=t.next();return i=e.done,e},e:function(e){a=!0,o=e},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw o}}}}(e);try{for(l.s();!(o=l.n()).done;){var c=o.value;i[s]=r?r(c,s):s,a[s]=n(c,s),s++}}catch(e){l.e(e)}finally{l.f()}return{values:a,keys:i}}},{key:"render",value:function(e,t,n){return this.ct(e,t,n).values}},{key:"update",value:function(e,t){var n,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||Ae(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,3),o=r[0],i=r[1],s=r[2],l=function(e){return e._$AH}(e),c=this.ct(o,i,s),u=c.values,d=c.keys;if(!Array.isArray(l))return this.ut=d,u;for(var h,p,f=null!==(n=this.ut)&&void 0!==n?n:this.ut=[],m=[],v=0,b=l.length-1,y=0,g=u.length-1;v<=b&&y<=g;)if(null===l[v])v++;else if(null===l[b])b--;else if(f[v]===d[y])m[y]=je(l[v],u[y]),v++,y++;else if(f[b]===d[g])m[g]=je(l[b],u[g]),b--,g--;else if(f[v]===d[g])m[g]=je(l[v],u[g]),Me(e,m[g+1],l[v]),v++,g--;else if(f[b]===d[y])m[y]=je(l[b],u[y]),Me(e,l[v],l[b]),b--,y++;else if(void 0===h&&(h=He(d,y,g),p=He(f,v,b)),h.has(f[v]))if(h.has(f[b])){var k=p.get(d[y]),w=void 0!==k?l[k]:null;if(null===w){var S=Me(e,l[v]);je(S,u[y]),m[y]=S}else m[y]=je(w,u[y]),Me(e,l[v],w),l[k]=null;y++}else Ee(l[b]),b--;else Ee(l[v]),v++;for(;y<=g;){var C=Me(e,m[g+1]);je(C,u[y]),m[y++]=C}for(;v<=b;){var O=l[v++];null!==O&&Ee(O)}return this.ut=d,Pe(e,m),a.c0}}])}(s.WL));const Re=r.qy`
1043
1082
  <svg
1044
1083
  name="sort-asc"
1045
1084
  height="18"
@@ -1068,7 +1107,7 @@
1068
1107
  />
1069
1108
  </g>
1070
1109
  </svg>
1071
- `,Ee=r.qy`
1110
+ `,Fe=r.qy`
1072
1111
  <svg
1073
1112
  name="sort-desc"
1074
1113
  height="18"
@@ -1096,7 +1135,7 @@
1096
1135
  />
1097
1136
  </g>
1098
1137
  </svg>
1099
- `,Le=r.qy`
1138
+ `,Ze=r.qy`
1100
1139
  <svg
1101
1140
  name="sort-neutral"
1102
1141
  height="18"
@@ -1116,7 +1155,7 @@
1116
1155
  <circle cx="13" cy="9" r="2" />
1117
1156
  </g>
1118
1157
  </svg>
1119
- `,Ae=r.qy`
1158
+ `,We=r.qy`
1120
1159
  <svg
1121
1160
  height="24"
1122
1161
  viewBox="0 0 24 24"
@@ -1132,13 +1171,13 @@
1132
1171
  />
1133
1172
  </g>
1134
1173
  </svg>
1135
- `;let Ie=class extends r.WF{constructor(){super(...arguments),this.fileListRaw=[],this.fileListSorted=[],this.sortOrderBy="default"}render(){return r.qy`<div class="sort-multi-file-list">${this.sortButton}</div>`}get sortButton(){return{default:r.qy`
1174
+ `;let Ne=class extends r.WF{constructor(){super(...arguments),this.fileListRaw=[],this.fileListSorted=[],this.sortOrderBy="default"}render(){return r.qy`<div class="sort-multi-file-list">${this.sortButton}</div>`}get sortButton(){return{default:r.qy`
1136
1175
  <button
1137
1176
  class="sort-by neutral-icon"
1138
1177
  aria-label="Sort volumes in initial order"
1139
1178
  @click=${()=>this.sortVolumes("title_asc")}
1140
1179
  >
1141
- ${Le}
1180
+ ${Ze}
1142
1181
  </button>
1143
1182
  `,title_asc:r.qy`
1144
1183
  <button
@@ -1146,7 +1185,7 @@
1146
1185
  aria-label="Sort volumes in ascending order"
1147
1186
  @click=${()=>this.sortVolumes("title_desc")}
1148
1187
  >
1149
- ${Me}
1188
+ ${Re}
1150
1189
  </button>
1151
1190
  `,title_desc:r.qy`
1152
1191
  <button
@@ -1154,7 +1193,7 @@
1154
1193
  aria-label="Sort volumes in descending order"
1155
1194
  @click=${()=>this.sortVolumes("default")}
1156
1195
  >
1157
- ${Ee}
1196
+ ${Fe}
1158
1197
  </button>
1159
1198
  `}[this.sortOrderBy]}sortVolumes(e){this.sortOrderBy=e;let t=[];t=this.fileListRaw.sort((t,n)=>"title_asc"===e?t.title.localeCompare(n.title):"title_desc"===e?n.title.localeCompare(t.title):t.orig_sort-n.orig_sort),this.dispatchEvent(new CustomEvent("fileListSorted",{detail:{sortType:e,sortedFiles:t},bubbles:!0,composed:!0})),this.fileListSorted=t}static get styles(){return r.AH`
1160
1199
  button.sort-by {
@@ -1164,7 +1203,7 @@
1164
1203
  --iconWidth: var(--menuSliderHeaderIconWidth);
1165
1204
  --iconHeight: var(--menuSliderHeaderIconHeight);
1166
1205
  }
1167
- `}};o([(0,s.MZ)({type:Array})],Ie.prototype,"fileListRaw",void 0),o([(0,s.MZ)({type:Array})],Ie.prototype,"fileListSorted",void 0),o([(0,s.MZ)({type:String,reflect:!0})],Ie.prototype,"sortOrderBy",void 0),Ie=o([(0,s.EM)("iaux-in-sort-files-button")],Ie);let Te=class extends r.WF{constructor(){super(...arguments),this.baseHost="archive.org",this.sortOrderBy="default",this.subPrefix="",this.fileList=[],this.addSortToUrl=!1}firstUpdated(){const e=this.shadowRoot.querySelector(".content.active");setTimeout(()=>{(null==e?void 0:e.scrollIntoViewIfNeeded)?null==e||e.scrollIntoViewIfNeeded(!0):null==e||e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},350)}volumeItemWithImageTitle(e){const t=this.fileUrl(e);return r.qy`
1206
+ `}};o([(0,i.MZ)({type:Array})],Ne.prototype,"fileListRaw",void 0),o([(0,i.MZ)({type:Array})],Ne.prototype,"fileListSorted",void 0),o([(0,i.MZ)({type:String,reflect:!0})],Ne.prototype,"sortOrderBy",void 0),Ne=o([(0,i.EM)("iaux-in-sort-files-button")],Ne);let Ve=class extends r.WF{constructor(){super(...arguments),this.baseHost="archive.org",this.sortOrderBy="default",this.subPrefix="",this.fileList=[],this.addSortToUrl=!1}firstUpdated(){const e=this.shadowRoot.querySelector(".content.active");setTimeout(()=>{(null==e?void 0:e.scrollIntoViewIfNeeded)?null==e||e.scrollIntoViewIfNeeded(!0):null==e||e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},350)}volumeItemWithImageTitle(e){const t=this.fileUrl(e);return r.qy`
1168
1207
  <li class="content active">
1169
1208
  <div class="separator"></div>
1170
1209
  <a class="container" href="${t}">
@@ -1190,7 +1229,7 @@
1190
1229
  </a>
1191
1230
  </div>
1192
1231
  </li>
1193
- `}get fileListTemplate(){const e=Pe(this.fileList,e=>null==e?void 0:e.file_prefix,this.fileLi.bind(this));return r.qy`
1232
+ `}get fileListTemplate(){const e=qe(this.fileList,e=>null==e?void 0:e.file_prefix,this.fileLi.bind(this));return r.qy`
1194
1233
  <ul>
1195
1234
  ${e}
1196
1235
  <div class="separator"></div>
@@ -1304,7 +1343,7 @@
1304
1343
  width: 1px;
1305
1344
  overflow: hidden;
1306
1345
  }
1307
- `}};o([(0,s.MZ)({type:String})],Te.prototype,"baseHost",void 0),o([(0,s.MZ)({type:String})],Te.prototype,"sortOrderBy",void 0),o([(0,s.MZ)({type:String})],Te.prototype,"subPrefix",void 0),o([(0,s.MZ)({type:Array})],Te.prototype,"fileList",void 0),o([(0,s.MZ)({type:Boolean,reflect:!0})],Te.prototype,"addSortToUrl",void 0),Te=o([(0,s.EM)("iaux-in-viewable-files-panel")],Te),n(3851),n(1278),n(3500),n(8706),n(2008),n(113),n(2062),n(9085),n(5506),n(9432),n(1761),n(5746);class ze{constructor(e){var t,n,r,o,i,a,s;this.title=null==e?void 0:e.title,this.subtitle=null==e?void 0:e.subtitle,this.headline=null==e?void 0:e.headline,this.message=null==e?void 0:e.message,this.headerColor=null!==(t=null==e?void 0:e.headerColor)&&void 0!==t?t:"#55A183",this.bodyColor=null!==(n=null==e?void 0:e.bodyColor)&&void 0!==n?n:"#f5f5f7",this.showProcessingIndicator=null!==(r=null==e?void 0:e.showProcessingIndicator)&&void 0!==r&&r,this.processingImageMode=null!==(o=null==e?void 0:e.processingImageMode)&&void 0!==o?o:"complete",this.showCloseButton=null===(i=null==e?void 0:e.showCloseButton)||void 0===i||i,this.showHeaderLogo=null===(a=null==e?void 0:e.showHeaderLogo)||void 0===a||a,this.closeOnBackdropClick=null===(s=null==e?void 0:e.closeOnBackdropClick)||void 0===s||s}}n(4360);var De=r.qy`
1346
+ `}};o([(0,i.MZ)({type:String})],Ve.prototype,"baseHost",void 0),o([(0,i.MZ)({type:String})],Ve.prototype,"sortOrderBy",void 0),o([(0,i.MZ)({type:String})],Ve.prototype,"subPrefix",void 0),o([(0,i.MZ)({type:Array})],Ve.prototype,"fileList",void 0),o([(0,i.MZ)({type:Boolean,reflect:!0})],Ve.prototype,"addSortToUrl",void 0),Ve=o([(0,i.EM)("iaux-in-viewable-files-panel")],Ve),n(3851),n(1278),n(8706),n(113),n(2062),n(9085),n(5506),n(1761),n(5746);class Ue{constructor(e){var t,n,r,o,i,a,s;this.title=null==e?void 0:e.title,this.subtitle=null==e?void 0:e.subtitle,this.headline=null==e?void 0:e.headline,this.message=null==e?void 0:e.message,this.headerColor=null!==(t=null==e?void 0:e.headerColor)&&void 0!==t?t:"#55A183",this.bodyColor=null!==(n=null==e?void 0:e.bodyColor)&&void 0!==n?n:"#f5f5f7",this.showProcessingIndicator=null!==(r=null==e?void 0:e.showProcessingIndicator)&&void 0!==r&&r,this.processingImageMode=null!==(o=null==e?void 0:e.processingImageMode)&&void 0!==o?o:"complete",this.showCloseButton=null===(i=null==e?void 0:e.showCloseButton)||void 0===i||i,this.showHeaderLogo=null===(a=null==e?void 0:e.showHeaderLogo)||void 0===a||a,this.closeOnBackdropClick=null===(s=null==e?void 0:e.closeOnBackdropClick)||void 0===s||s}}n(4360);var Ge=r.qy`
1308
1347
  <svg
1309
1348
  viewBox="0 0 40 40"
1310
1349
  version="1.1"
@@ -1315,7 +1354,7 @@
1315
1354
  <desc id="closeDescID">A line drawing of an X</desc>
1316
1355
  <path d="m29.1923882 10.8076118c.5857864.5857865.5857864 1.535534 0 2.1213204l-7.0711162 7.0703398 7.0711162 7.0717958c.5857864.5857864.5857864 1.5355339 0 2.1213204-.5857865.5857864-1.535534.5857864-2.1213204 0l-7.0717958-7.0711162-7.0703398 7.0711162c-.5857864.5857864-1.5355339.5857864-2.1213204 0-.5857864-.5857865-.5857864-1.535534 0-2.1213204l7.0706602-7.0717958-7.0706602-7.0703398c-.5857864-.5857864-.5857864-1.5355339 0-2.1213204.5857865-.5857864 1.535534-.5857864 2.1213204 0l7.0703398 7.0706602 7.0717958-7.0706602c.5857864-.5857864 1.5355339-.5857864 2.1213204 0z" class="fill-color" fill-rule="evenodd"/>
1317
1356
  </svg>
1318
- `,_e=r.qy`
1357
+ `,Je=r.qy`
1319
1358
  <svg
1320
1359
  class="ia-logo"
1321
1360
  viewBox="0 0 27 30"
@@ -1334,12 +1373,12 @@
1334
1373
  </g>
1335
1374
  </g>
1336
1375
  </svg>
1337
- `;let $e=class extends r.WF{constructor(){super(...arguments),this.config=new ze}render(){return r.qy`
1376
+ `;let Ye=class extends r.WF{constructor(){super(...arguments),this.config=new Ue}render(){return r.qy`
1338
1377
  <div class="modal-wrapper">
1339
1378
  <div class="modal-container">
1340
1379
  <header style="background-color: ${this.config.headerColor}">
1341
1380
  ${this.config.showCloseButton?this.closeButtonTemplate:""}
1342
- ${this.config.showHeaderLogo?r.qy`<div class="logo-icon">${_e}</div>`:r.s6}
1381
+ ${this.config.showHeaderLogo?r.qy`<div class="logo-icon">${Je}</div>`:r.s6}
1343
1382
  ${this.config.title?r.qy`<h1 class="title">${this.config.title}</h1>`:""}
1344
1383
  ${this.config.subtitle?r.qy`<h2 class="subtitle">${this.config.subtitle}</h2>`:""}
1345
1384
  </header>
@@ -1372,7 +1411,7 @@
1372
1411
  tabindex="0"
1373
1412
  @click=${this.handleCloseButton}
1374
1413
  >
1375
- ${De}
1414
+ ${Ge}
1376
1415
  </button>
1377
1416
  `}static get styles(){const e=r.AH`var(--modalLogoSize, 6.5rem)`,t=r.AH`var(--processingImageSize, 7.5rem)`,n=r.AH`var(--modalCornerRadius, 1rem)`,o=r.AH`var(--modalBorder, 2px solid black)`,i=r.AH`var(--modalBottomMargin, 2.5rem)`,a=r.AH`var(--modalTopMargin, 5rem)`,s=r.AH`var(--modalHeaderBottomPadding, 0.5em)`,l=r.AH`var(--modalBottomPadding, 2rem)`,c=r.AH`var(--modalScrollOffset, 5px)`,u=r.AH`var(--modalTitleFontSize, 1.8rem)`,d=r.AH`var(--modalSubtitleFontSize, 1.4rem)`,h=r.AH`var(--modalHeadlineFontSize, 1.6rem)`,p=r.AH`var(--modalMessageFontSize, 1.4rem)`,f=r.AH`var(--modalTitleLineHeight, normal)`,m=r.AH`var(--modalSubtitleLineHeight, normal)`,v=r.AH`var(--modalHeadlineLineHeight, normal)`,b=r.AH`var(--modalMessageLineHeight, normal)`;return r.AH`
1378
1417
  .processing-logo {
@@ -1524,7 +1563,7 @@
1524
1563
  clip: rect(0, 0, 0, 0);
1525
1564
  border: 0;
1526
1565
  }
1527
- `}};var He;o([(0,s.MZ)({type:Object})],$e.prototype,"config",void 0),$e=o([(0,s.EM)("modal-template")],$e),function(e){e.Open="open",e.Closed="closed"}(He||(He={}));class qe{constructor(e){this.windowResizeThrottler=function(e,t,n){var r,o=n||{},i=o.noTrailing,a=void 0!==i&&i,s=o.noLeading,l=void 0!==s&&s,c=o.debounceMode,u=void 0===c?void 0:c,d=!1,h=0;function p(){r&&clearTimeout(r)}function f(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var s=this,c=Date.now()-h;function f(){h=Date.now(),t.apply(s,o)}function m(){r=void 0}d||(l||!u||r||f(),p(),void 0===u&&c>e?l?(h=Date.now(),a||(r=setTimeout(u?m:f,e))):f():!0!==a&&(r=setTimeout(u?m:f,void 0===u?e-c:e)))}return f.cancel=function(e){var t=(e||{}).upcomingOnly,n=void 0!==t&&t;p(),d=!n},f}(100,this.updateModalContainerHeight,{noLeading:!1,noTrailing:!1}).bind(this),this.modalManager=e}handleModeChange(e){switch(e){case He.Open:this.startResizeListener(),this.stopDocumentScroll();break;case He.Closed:this.stopResizeListener(),this.resumeDocumentScroll()}}updateModalContainerHeight(){this.modalManager.style.setProperty("--containerHeight",`${window.innerHeight}px`)}stopDocumentScroll(){document.body.classList.add("modal-manager-open")}resumeDocumentScroll(){document.body.classList.remove("modal-manager-open")}startResizeListener(){window.addEventListener("resize",this.windowResizeThrottler)}stopResizeListener(){window.removeEventListener("resize",this.windowResizeThrottler)}}let Re=class extends r.WF{constructor(){super(...arguments),this.mode=He.Closed,this.hostBridge=new qe(this),this.closeOnBackdropClick=!0}render(){return r.qy`
1566
+ `}};var Xe;o([(0,i.MZ)({type:Object})],Ye.prototype,"config",void 0),Ye=o([(0,i.EM)("modal-template")],Ye),function(e){e.Open="open",e.Closed="closed"}(Xe||(Xe={}));class Qe{constructor(e){this.windowResizeThrottler=function(e,t,n){var r,o=n||{},i=o.noTrailing,a=void 0!==i&&i,s=o.noLeading,l=void 0!==s&&s,c=o.debounceMode,u=void 0===c?void 0:c,d=!1,h=0;function p(){r&&clearTimeout(r)}function f(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];var s=this,c=Date.now()-h;function f(){h=Date.now(),t.apply(s,o)}function m(){r=void 0}d||(l||!u||r||f(),p(),void 0===u&&c>e?l?(h=Date.now(),a||(r=setTimeout(u?m:f,e))):f():!0!==a&&(r=setTimeout(u?m:f,void 0===u?e-c:e)))}return f.cancel=function(e){var t=(e||{}).upcomingOnly,n=void 0!==t&&t;p(),d=!n},f}(100,this.updateModalContainerHeight,{noLeading:!1,noTrailing:!1}).bind(this),this.modalManager=e}handleModeChange(e){switch(e){case Xe.Open:this.startResizeListener(),this.stopDocumentScroll();break;case Xe.Closed:this.stopResizeListener(),this.resumeDocumentScroll()}}updateModalContainerHeight(){this.modalManager.style.setProperty("--containerHeight",`${window.innerHeight}px`)}stopDocumentScroll(){document.body.classList.add("modal-manager-open")}resumeDocumentScroll(){document.body.classList.remove("modal-manager-open")}startResizeListener(){window.addEventListener("resize",this.windowResizeThrottler)}stopResizeListener(){window.removeEventListener("resize",this.windowResizeThrottler)}}let Ke=class extends r.WF{constructor(){super(...arguments),this.mode=Xe.Closed,this.hostBridge=new Qe(this),this.closeOnBackdropClick=!0}render(){return r.qy`
1528
1567
  <div class="container">
1529
1568
  <div class="backdrop" @click=${this.backdropClicked}></div>
1530
1569
  <modal-template
@@ -1534,7 +1573,7 @@
1534
1573
  ${this.customModalContent}
1535
1574
  </modal-template>
1536
1575
  </div>
1537
- `}getMode(){return this.mode}closeModal(){this.mode=He.Closed}callUserClosedModalCallback(){const e=this.userClosedModalCallback;this.userClosedModalCallback=void 0,e&&e()}showModal(e){return t=this,n=void 0,o=function*(){this.closeOnBackdropClick=e.config.closeOnBackdropClick,this.userClosedModalCallback=e.userClosedModalCallback,this.modalTemplate.config=e.config,this.customModalContent=e.customModalContent,this.mode=He.Open,yield this.modalTemplate.updateComplete,this.modalTemplate.focus()},new((r=void 0)||(r=Promise))(function(e,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o.throw(e))}catch(e){i(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(e){e(n)})).then(a,s)}l((o=o.apply(t,n||[])).next())});var t,n,r,o}updated(e){e.has("mode")&&this.handleModeChange()}backdropClicked(){this.closeOnBackdropClick&&(this.closeModal(),this.callUserClosedModalCallback())}handleModeChange(){this.hostBridge.handleModeChange(this.mode),this.emitModeChangeEvent()}emitModeChangeEvent(){const e=new CustomEvent("modeChanged",{detail:{mode:this.mode}});this.dispatchEvent(e)}closeButtonPressed(){this.closeModal(),this.callUserClosedModalCallback()}static get styles(){const e=r.AH`var(--modalBackdropColor, rgba(10, 10, 10, 0.9))`,t=r.AH`var(--modalBackdropZindex, 1000)`,n=r.AH`var(--modalWidth, 32rem)`,o=r.AH`var(--modalMaxWidth, 95%)`,i=r.AH`var(--modalZindex, 2000)`;return r.AH`
1576
+ `}getMode(){return this.mode}closeModal(){this.mode=Xe.Closed}callUserClosedModalCallback(){const e=this.userClosedModalCallback;this.userClosedModalCallback=void 0,e&&e()}showModal(e){return t=this,n=void 0,o=function*(){this.closeOnBackdropClick=e.config.closeOnBackdropClick,this.userClosedModalCallback=e.userClosedModalCallback,this.modalTemplate.config=e.config,this.customModalContent=e.customModalContent,this.mode=Xe.Open,yield this.modalTemplate.updateComplete,this.modalTemplate.focus()},new((r=void 0)||(r=Promise))(function(e,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o.throw(e))}catch(e){i(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r(function(e){e(n)})).then(a,s)}l((o=o.apply(t,n||[])).next())});var t,n,r,o}updated(e){e.has("mode")&&this.handleModeChange()}backdropClicked(){this.closeOnBackdropClick&&(this.closeModal(),this.callUserClosedModalCallback())}handleModeChange(){this.hostBridge.handleModeChange(this.mode),this.emitModeChangeEvent()}emitModeChangeEvent(){const e=new CustomEvent("modeChanged",{detail:{mode:this.mode}});this.dispatchEvent(e)}closeButtonPressed(){this.closeModal(),this.callUserClosedModalCallback()}static get styles(){const e=r.AH`var(--modalBackdropColor, rgba(10, 10, 10, 0.9))`,t=r.AH`var(--modalBackdropZindex, 1000)`,n=r.AH`var(--modalWidth, 32rem)`,o=r.AH`var(--modalMaxWidth, 95%)`,i=r.AH`var(--modalZindex, 2000)`;return r.AH`
1538
1577
  .container {
1539
1578
  width: 100%;
1540
1579
  height: 100%;
@@ -1560,7 +1599,7 @@
1560
1599
  width: ${n};
1561
1600
  max-width: ${o};
1562
1601
  }
1563
- `}};o([(0,s.MZ)({type:String,reflect:!0})],Re.prototype,"mode",void 0),o([(0,s.MZ)({type:Object})],Re.prototype,"customModalContent",void 0),o([(0,s.MZ)({type:Object})],Re.prototype,"hostBridge",void 0),o([(0,s.P)("modal-template")],Re.prototype,"modalTemplate",void 0),Re=o([(0,s.EM)("modal-manager")],Re);var Fe=r.qy`
1602
+ `}};o([(0,i.MZ)({type:String,reflect:!0})],Ke.prototype,"mode",void 0),o([(0,i.MZ)({type:Object})],Ke.prototype,"customModalContent",void 0),o([(0,i.MZ)({type:Object})],Ke.prototype,"hostBridge",void 0),o([(0,i.P)("modal-template")],Ke.prototype,"modalTemplate",void 0),Ke=o([(0,i.EM)("modal-manager")],Ke);var et=r.qy`
1564
1603
  <svg
1565
1604
  viewBox="0 0 100 100"
1566
1605
  xmlns="http://www.w3.org/2000/svg"
@@ -1573,7 +1612,7 @@
1573
1612
  fill="none"
1574
1613
  d="m17.0555551 41.3194459c0-12.7430552 10.3541664-23.1027772 23.0847216-23.1027772 12.7166664 0 23.0777773 10.359722 23.0777773 23.1027772 0 12.7361108-10.3611109 23.0986106-23.0777773 23.0986106-12.7305552 0-23.0847216-10.3624998-23.0847216-23.0986106zm-17.24305512 0c0 22.2916661 18.04583292 40.3472213 40.32777672 40.3472213 8.9208332 0 17.145833-2.9319449 23.8194439-7.8527776l24.1513883 24.0777771c1.2125 1.1402778 2.8430555 1.8430556 4.6374999 1.8430556 3.7444443 0 6.7805554-3.0361111 6.7805554-6.7791665 0-2.0652778-.9222222-3.9069444-2.3736111-5.1499999l-23.718055-23.7458328c4.4152777-6.4791665 7.0152776-14.3055552 7.0152776-22.7402772 0-22.2791661-18.0458328-40.34861006-40.312499-40.34861006-22.2819438 0-40.32777672 18.06944396-40.32777672 40.34861006z" />
1575
1614
  </svg>
1576
- `;class Ze extends r.WF{static get styles(){return r.AH`
1615
+ `;class tt extends r.WF{static get styles(){return r.AH`
1577
1616
  :host {
1578
1617
  width: var(--iconWidth, 'auto');
1579
1618
  height: var(--iconHeight, 'auto');
@@ -1586,7 +1625,7 @@
1586
1625
  .stroke-color {
1587
1626
  stroke: var(--iconStrokeColor);
1588
1627
  }
1589
- `}render(){return Fe}}function We(e){return We="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},We(e)}function Ne(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,Ue(r.key),r)}}function Ue(e){var t=function(e){if("object"!=We(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=We(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==We(t)?t:t+""}function Ve(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ve=function(){return!!e})()}function Ge(e){return Ge=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ge(e)}function Je(e,t){return Je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Je(e,t)}customElements.define("ia-icon-search",Ze);var Ye=function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=Ge(t),function(e,t){if(t&&("object"==We(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,Ve()?Reflect.construct(t,n||[],Ge(e).constructor):t.apply(e,n))}(this,t,[e])).et=ue.s6,e.type!==de.OA.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Je(e,t)}(t,e),function(e,t){return t&&Ne(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(e){if(e===ue.s6||null==e)return this.ft=void 0,this.et=e;if(e===ue.c0)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;var t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}])}(de.WL);Ye.directiveName="unsafeHTML",Ye.resultType=1;var Xe,Qe,Ke,et,tt,nt,rt,ot,it,at,st,lt,ct,ut,dt,ht,pt,ft,mt=(0,de.u$)(Ye),vt=(0,r.AH)(Xe||(Ke=["data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEwIiB2aWV3Qm94PSIwIDAgMTMgMTAiIHdpZHRoPSIxMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNC4zMzMzMzMzMyAxMC00LjMzMzMzMzMzLTQuMTY2NjY2NjcgMS43MzMzMzMzMy0xLjY2NjY2NjY2IDIuNiAyLjUgNi45MzMzMzMzNy02LjY2NjY2NjY3IDEuNzMzMzMzMyAxLjY2NjY2NjY3eiIgZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+"],et||(et=Ke.slice(0)),Xe=Object.freeze(Object.defineProperties(Ke,{raw:{value:Object.freeze(et)}})))),bt=(0,r.AH)(Qe||(Qe=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNDAgNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgYXJpYS1sYWJlbGxlZGJ5PSJjbG9zZVRpdGxlSUQgY2xvc2VEZXNjSUQiPjxwYXRoIGQ9Ik0yOS4xOTIgMTAuODA4YTEuNSAxLjUgMCAwMTAgMi4xMkwyMi4xMjIgMjBsNy4wNyA3LjA3MmExLjUgMS41IDAgMDEtMi4xMiAyLjEyMWwtNy4wNzMtNy4wNy03LjA3IDcuMDdhMS41IDEuNSAwIDAxLTIuMTIxLTIuMTJsNy4wNy03LjA3My03LjA3LTcuMDdhMS41IDEuNSAwIDAxMi4xMi0yLjEyMUwyMCAxNy44NzhsNy4wNzItNy4wN2ExLjUgMS41IDAgMDEyLjEyMSAweiIgY2xhc3M9ImZpbGwtY29sb3IiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg=="]))),yt=(0,r.AH)(tt||(tt=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n .ia-button {\n min-height: 3rem;\n border: none;\n outline: none;\n cursor: pointer;\n color: var(--primaryTextColor);\n line-height: normal;\n border-radius: .4rem;\n text-align: center;\n vertical-align: middle;\n font-size: 1.4rem;\n font-family: inherit;\n display: inline-block;\n padding: .6rem 1.2rem;\n border: 1px solid transparent;\n\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n }\n\n .ia-button.link,\n .ia-button.external {\n min-height: unset;\n text-decoration: none;\n }\n\n .ia-button:disabled,\n .ia-button.disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .ia-button.transparent {\n background-color: transparent;\n }\n \n .ia-button.slim {\n padding: 0;\n }\n\n .ia-button.primary {\n background-color: var(--primaryCTAFill);\n border-color: var(--primaryCTABorder);\n }\n\n .ia-button.cancel {\n background-color: var(--primaryErrorCTAFill);\n border-color: var(--primaryErrorCTABorder);\n }\n\n .ia-button.external {\n background: var(--secondaryCTAFill);\n border-color: var(--secondaryCTABorder);\n }\n"]))),gt=n(4535);function kt(e){return kt="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},kt(e)}function wt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function St(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,Ct(r.key),r)}}function Ct(e){var t=function(e){if("object"!=kt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=kt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==kt(t)?t:t+""}function Ot(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ot=function(){return!!e})()}function xt(e){return xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xt(e)}function jt(e,t){return jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jt(e,t)}var Bt,Pt,Mt,Et,Lt=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=xt(t),function(e,t){if(t&&("object"==kt(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,Ot()?Reflect.construct(t,n||[],xt(e).constructor):t.apply(e,n))}(this,t)).results=[],e.query="",e.queryInProgress=!1,e.renderHeader=!1,e.renderSearchAllFiles=!1,e.errorMessage="",e.bindBookReaderListeners(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jt(e,t)}(t,e),function(e,t,n){return t&&St(e.prototype,t),n&&St(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"updated",value:function(){this.focusOnInputIfNecessary()}},{key:"bindBookReaderListeners",value:function(){document.addEventListener("BookReader:SearchCallback",this.setResults.bind(this))}},{key:"focusOnInputIfNecessary",value:function(){this.results.length||this.shadowRoot.querySelector("input[type='search']").focus()}},{key:"setResults",value:function(e){var t=e.detail;this.results=t.results}},{key:"setQuery",value:function(e){this.query=e.currentTarget.value,this.query||this.cancelSearch()}},{key:"performSearch",value:function(e){e.preventDefault();var t=e.currentTarget.querySelector('input[type="search"]');t&&t.value&&this.dispatchEvent(new CustomEvent("bookSearchInitiated",{bubbles:!0,composed:!0,detail:{query:this.query}}))}},{key:"selectResult",value:function(e){this.dispatchEvent(new CustomEvent("resultSelected",{bubbles:!0,composed:!0,detail:{match:e}})),this.dispatchEvent(new CustomEvent("closeMenu",{bubbles:!0,composed:!0}))}},{key:"cancelSearch",value:function(){this.queryInProgress=!1,this.dispatchSearchCanceled()}},{key:"dispatchSearchCanceled",value:function(){this.dispatchEvent(new Event("bookSearchCanceled"))}},{key:"resultsCount",get:function(){var e=this.results.length;return e?"".concat(e," result").concat(e>1?"s":""):r.s6}},{key:"headerSection",get:function(){var e=(0,r.qy)(nt||(nt=wt(["<header>\n <h3>Search inside</h3>\n ","\n </header>"])),this.resultsCount?(0,r.qy)(rt||(rt=wt(["(",")"])),this.resultsCount):r.s6);return this.renderHeader?e:r.s6}},{key:"searchMultipleControls",get:function(){var e=(0,r.qy)(ot||(ot=wt(['\n <input name="all_files" id="all_files" type="checkbox" />\n <label class="checkbox" for="all_files">Search all files</label>\n '])));return this.renderSearchAllFiles?e:r.s6}},{key:"loadingIndicator",get:function(){return(0,r.qy)(it||(it=wt(['\n <div class="loading">\n <ia-activity-indicator mode="processing" aria-hidden="true" role="presentation"></ia-activity-indicator>\n <p>Searching</p>\n <button class="ia-button external cancel-search" @click=',">Cancel</button>\n </div>\n "])),this.cancelSearch)}},{key:"resultsSet",get:function(){var e=this;return(0,r.qy)(at||(at=wt(['\n <nav aria-label="Search results">\n <div>\n ','\n <a\n href="#"\n class="skip-link"\n @click=','\n >Skip to last result</a>\n </div>\n <ul class="results">\n ','\n </ul>\n <a\n href="#"\n class="skip-link"\n @click=',"\n >Skip to first result</a>\n </nav>\n "])),this.resultsCount,function(t){t.preventDefault(),e.shadowRoot.querySelector(".results li:last-child .result-item").focus()},this.results.map(function(t){return(0,r.qy)(st||(st=wt(['\n <li>\n <button class="result-item" @click=','>\n <span class="page-num">Page ',"</span> — <span lang=",">","</span>\n </button>\n </li>\n "])),e.selectResult.bind(e,t),t.displayPageNumber,(0,gt.J)(t.lang),mt(t.html))}),function(t){t.preventDefault(),e.shadowRoot.querySelector(".results li:first-child .result-item").focus()})}},{key:"setErrorMessage",get:function(){return(0,r.qy)(lt||(lt=wt(['\n <p class="error-message">',"</p>\n "])),this.errorMessage)}},{key:"render",value:function(){var e=!(this.queryInProgress||this.errorMessage||this.queryInProgress||this.results.length);return(0,r.qy)(ct||(ct=wt(["\n ",'\n <form action="" method="get" @submit=',">\n ",'\n <input\n type="search"\n name="query"\n id="br-search-input"\n @keyup=',"\n @search=","\n .value=",'\n />\n <label class="search-cta ','" for="br-search-input">\n Please enter text to search for\n </label>\n </form>\n <div class="results-container" aria-live="polite">\n ',"\n ","\n ","\n </div>\n "])),this.headerSection,this.performSearch,this.searchMultipleControls,this.setQuery,this.setQuery,this.query,e?"":"sr-only",this.queryInProgress?this.loadingIndicator:r.s6,this.errorMessage?this.setErrorMessage:r.s6,this.results.length?this.resultsSet:r.s6)}}],[{key:"properties",get:function(){return{results:{type:Array},query:{type:String},queryInProgress:{type:Boolean},renderHeader:{type:Boolean},renderSearchAllFiles:{type:Boolean},errorMessage:{type:String}}}},{key:"styles",get:function(){var e=(0,r.AH)(ut||(ut=wt(["var(--searchResultText, #adaedc)"]))),t=(0,r.AH)(dt||(dt=wt(["var(--searchResultBg, #272958)"]))),n=(0,r.AH)(ht||(ht=wt(["var(--searchResultBorder, #adaedc)"]))),o=(0,r.AH)(pt||(pt=wt(["(--tertiaryBGColor, #333)"]))),i=(0,r.AH)(ft||(ft=wt(["\n :host {\n display: block;\n height: 100%;\n padding: 1.5rem 1rem 2rem 0;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\n }\n\n .skip-link {\n position: absolute;\n left: -9999px;\n }\n .skip-link:focus {\n position: static;\n left: auto;\n }\n\n mark {\n padding: 0 .2rem;\n color: ",";\n background: ",";\n border: 1px solid ",';\n border-radius: 2px;\n }\n\n h3 {\n padding: 0;\n margin: 0 1rem 0 0;\n font-size: 2rem;\n }\n\n header {\n display: flex;\n align-items: center;\n padding: 0 2rem 0 0;\n }\n header p {\n padding: 0;\n margin: 0;\n font-size: 1.2rem;\n font-weight: bold;\n font-style: italic;\n }\n\n form {\n padding: 0 0 1rem 0;\n }\n\n [type="checkbox"] {\n display: none;\n }\n\n label {\n display: block;\n text-align: center;\n }\n\n label.checkbox {\n padding-bottom: .5rem;\n font-size: 1.6rem;\n line-height: 150%;\n vertical-align: middle;\n }\n\n label.checkbox:after {\n display: inline-block;\n width: 14px;\n height: 14px;\n margin-left: .7rem;\n content: "";\n border-radius: 2px;\n }\n :checked + label.checkbox:after {\n background-image: url(\'','\');\n }\n\n label.checkbox[for="all_files"]:after {\n background: ',' 50% 50% no-repeat;\n border: 1px solid var(--primaryTextColor);\n }\n\n [type="search"] {\n color: var(--primaryTextColor);\n border: 1px solid var(--primaryTextColor);\n -webkit-appearance: textfield;\n width: 100%;\n height: 3rem;\n padding: 0 1.5rem;\n box-sizing: border-box;\n font: normal 1.6rem "Helvetica qNeue", Helvetica, Arial, sans-serif;\n border-radius: 1.5rem;\n background: transparent;\n }\n [type="search"]:focus {\n outline: none;\n }\n [type="search"]::-webkit-search-cancel-button {\n width: 18px;\n height: 18px;\n -webkit-appearance: none;\n appearance: none;\n -webkit-mask: url(\'',"') 0 0 no-repeat;\n mask: url('","') 0 0 no-repeat;\n -webkit-mask-size: 100%;\n mask-size: 100%;\n background: #fff;\n }\n\n .page-num {\n font-weight: bold;\n padding-bottom: 0;\n }\n\n .search-cta {\n padding: 10px 0;\n text-align: center;\n font-style: italic;\n }\n\n .results-container {\n padding-bottom: 2rem;\n }\n\n ul {\n padding: 0 0 2rem 0;\n margin: 0;\n list-style: none;\n }\n\n .result-item {\n cursor: pointer;\n margin-top: 8px;\n font-size: 12px;\n padding: 5px;\n border-radius: 4px;\n display: block;\n width: 100%;\n /* Reset button styles */\n background: none;\n border: none;\n text-align: left;\n font-family: inherit;\n transition: background-color 0.2s;\n }\n\n .result-item:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n .loading {\n text-align: center;\n }\n\n .loading p {\n padding: 0 0 1rem 0;\n margin: 0;\n font-size: 1.2rem;\n }\n\n ia-activity-indicator {\n display: block;\n width: 40px;\n height: 40px;\n margin: 0 auto;\n }\n\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0 0 0 0) !important;\n white-space: nowrap !important;\n border: 0 !important;\n }\n "])),e,t,n,vt,o,bt,bt);return[yt,i]}}])}(r.WF);function At(e){return At="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},At(e)}function It(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Tt(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,zt(r.key),r)}}function zt(e){var t=function(e){if("object"!=At(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=At(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==At(t)?t:t+""}customElements.define("ia-book-search-results",Lt);var Dt,_t,$t,Ht,qt,Rt,Ft,Zt,Wt,Nt,Ut,Vt={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},Gt=function(){return function(e,t){return t&&Tt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=t.onProviderChange,o=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onBookSearchInitiated=this.onBookSearchInitiated.bind(this),this.onSearchStarted=this.onSearchStarted.bind(this),this.onSearchRequestError=this.onSearchRequestError.bind(this),this.onSearchResultsClicked=this.onSearchResultsClicked.bind(this),this.onSearchResultsChange=this.onSearchResultsChange.bind(this),this.onSearchResultsCleared=this.onSearchResultsCleared.bind(this),this.searchCanceledInMenu=this.searchCanceledInMenu.bind(this),this.bindEventListeners=this.bindEventListeners.bind(this),this.getMenuDetails=this.getMenuDetails.bind(this),this.getComponent=this.getComponent.bind(this),this.updateMenu=this.updateMenu.bind(this),this.onProviderChange=n,this.bookreader=o,this.icon=(0,r.qy)(Bt||(Bt=It(['<ia-icon-search style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-search>']))),this.label="Search inside",this.menuDetails=this.getMenuDetails(),this.id="search",this.component=this.getComponent(),this.bindEventListeners()},[{key:"getMenuDetails",value:function(){var e=Vt,t=e.resultsCount,n=e.query;if(e.queryInProgress||!n)return r.s6;var o=1===t?"result":"results";return(0,r.qy)(Pt||(Pt=It(["("," ",")"])),t,o)}},{key:"bindEventListeners",value:function(){var e=this;window.addEventListener("BookReader:SearchStarted",this.onSearchStarted),window.addEventListener("BookReader:SearchCallback",this.onSearchResultsChange),window.addEventListener("BookReader:SearchCallbackEmpty",function(t){e.onSearchRequestError(t,"noResults")}),window.addEventListener("BookReader:SearchCallbackNotIndexed",function(t){e.onSearchRequestError(t,"notIndexed")}),window.addEventListener("BookReader:SearchCallbackError",function(t){e.onSearchRequestError(t)}),window.addEventListener("BookReader:SearchResultsCleared",function(){e.onSearchResultsCleared()}),window.addEventListener("BookReader:SearchCanceled",function(t){e.onSearchCanceled(t)})}},{key:"onSearchCanceled",value:function(){Vt={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},this.updateMenu({searchCanceled:!0}),this.bookreader.urlPlugin&&this.updateSearchInUrl()}},{key:"onSearchStarted",value:function(e){var t=e.detail.props,n=t.term,r=void 0===n?"":n,o=t.instance;o&&(this.bookreader=o),Vt.query=r,Vt.results=[],Vt.resultsCount=0,Vt.queryInProgress=!0,Vt.errorMessage="",this.updateMenu()}},{key:"onBookSearchInitiated",value:function(e){var t=e.detail;Vt.query=t.query,this.bookreader.search(Vt.query)}},{key:"onSearchRequestError",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",o=e.detail.props,i=o.instance,a=o.results;i&&(this.bookreader=i);var s={noResults:"0 results",notIndexed:"This book hasn't been indexed for searching yet. We've just started indexing it,\n so search should be available soon. Please try again later. Thanks!",default:"Sorry, there was an error with your search. Please try again."},l=null!==(t=s[n])&&void 0!==t?t:s.default;Vt.query=(null==a?void 0:a.q)||"",Vt.results=[],Vt.resultsCount=0,Vt.queryInProgress=!1,Vt.errorMessage=(0,r.qy)(Mt||(Mt=It(['<p class="error">',"</p>"])),l),this.updateMenu()}},{key:"onSearchResultsChange",value:function(e){var t=e.detail.props,n=void 0===t?{}:t,r=n.instance,o=void 0===r?null:r,i=n.results,a=void 0===i?[]:i;o&&(this.bookreader=o);var s=a.matches||[],l=s.length,c=a.q;Vt={results:s,resultsCount:l,query:c,queryInProgress:!1,errorMessage:""},this.updateMenu()}},{key:"searchCanceledInMenu",value:function(){this.bookreader.plugins.search.cancelSearchRequest()}},{key:"onSearchResultsCleared",value:function(){Vt={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},this.updateMenu({openMenu:!1}),this.bookreader.plugins.search.searchView.clearSearchFieldAndResults(!1),this.bookreader.urlPlugin&&this.updateSearchInUrl()}},{key:"updateSearchInUrl",value:function(){this.bookreader.urlPlugin&&(this.bookreader.urlPlugin.pullFromAddressBar(),Vt.query?this.bookreader.urlPlugin.setUrlParam("q",Vt.query):this.bookreader.urlPlugin.removeUrlParam("q"))}},{key:"updateMenu",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.menuDetails=this.getMenuDetails(),this.component=this.getComponent(),this.onProviderChange(this.bookreader,e)}},{key:"getComponent",value:function(){var e=Vt,t=e.query,n=e.results,o=e.queryInProgress,i=e.errorMessage;return(0,r.qy)(Et||(Et=It(["\n <ia-book-search-results\n .query=","\n .results=","\n .errorMessage=","\n ?queryInProgress=","\n ?renderSearchAllFiles=","\n @resultSelected=","\n @bookSearchInitiated=","\n @bookSearchResultsCleared=","\n @bookSearchCanceled=","\n ></ia-book-search-results>\n "])),t,n,i,o,!1,this.onSearchResultsClicked,this.onBookSearchInitiated,this.onSearchResultsCleared,this.searchCanceledInMenu)}},{key:"onSearchResultsClicked",value:function(e){var t=e.detail;this.bookreader.plugins.search.jumpToMatch(t.match.matchIndex)}}])}(),Jt=(n(2712),r.qy`
1628
+ `}render(){return et}}function nt(e){return nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nt(e)}function rt(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,ot(r.key),r)}}function ot(e){var t=function(e){if("object"!=nt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=nt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==nt(t)?t:t+""}function it(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(it=function(){return!!e})()}function at(e){return at=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},at(e)}function st(e,t){return st=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},st(e,t)}customElements.define("ia-icon-search",tt);var lt=function(e){function t(e){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=at(t),function(e,t){if(t&&("object"==nt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,it()?Reflect.construct(t,n||[],at(e).constructor):t.apply(e,n))}(this,t,[e])).et=a.s6,e.type!==s.OA.CHILD)throw Error(n.constructor.directiveName+"() can only be used in child bindings");return n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&st(e,t)}(t,e),function(e,t){return t&&rt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(e){if(e===a.s6||null==e)return this.ft=void 0,this.et=e;if(e===a.c0)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.et)return this.ft;this.et=e;var t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}])}(s.WL);lt.directiveName="unsafeHTML",lt.resultType=1;var ct,ut,dt,ht,pt,ft,mt,vt,bt,yt,gt,kt,wt,St,Ct,Ot,xt,Mt,jt=(0,s.u$)(lt),Bt=(0,r.AH)(ct||(dt=["data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEwIiB2aWV3Qm94PSIwIDAgMTMgMTAiIHdpZHRoPSIxMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNC4zMzMzMzMzMyAxMC00LjMzMzMzMzMzLTQuMTY2NjY2NjcgMS43MzMzMzMzMy0xLjY2NjY2NjY2IDIuNiAyLjUgNi45MzMzMzMzNy02LjY2NjY2NjY3IDEuNzMzMzMzMyAxLjY2NjY2NjY3eiIgZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+"],ht||(ht=dt.slice(0)),ct=Object.freeze(Object.defineProperties(dt,{raw:{value:Object.freeze(ht)}})))),Pt=(0,r.AH)(ut||(ut=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNDAgNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgYXJpYS1sYWJlbGxlZGJ5PSJjbG9zZVRpdGxlSUQgY2xvc2VEZXNjSUQiPjxwYXRoIGQ9Ik0yOS4xOTIgMTAuODA4YTEuNSAxLjUgMCAwMTAgMi4xMkwyMi4xMjIgMjBsNy4wNyA3LjA3MmExLjUgMS41IDAgMDEtMi4xMiAyLjEyMWwtNy4wNzMtNy4wNy03LjA3IDcuMDdhMS41IDEuNSAwIDAxLTIuMTIxLTIuMTJsNy4wNy03LjA3My03LjA3LTcuMDdhMS41IDEuNSAwIDAxMi4xMi0yLjEyMUwyMCAxNy44NzhsNy4wNzItNy4wN2ExLjUgMS41IDAgMDEyLjEyMSAweiIgY2xhc3M9ImZpbGwtY29sb3IiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg=="]))),Et=(0,r.AH)(pt||(pt=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n .ia-button {\n min-height: 3rem;\n border: none;\n cursor: pointer;\n color: var(--primaryTextColor);\n line-height: normal;\n border-radius: .4rem;\n text-align: center;\n vertical-align: middle;\n font-size: 1.4rem;\n font-family: inherit;\n display: inline-block;\n padding: .6rem 1.2rem;\n border: 1px solid transparent;\n\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n -o-user-select: none;\n user-select: none;\n }\n\n .ia-button.link,\n .ia-button.external {\n min-height: unset;\n text-decoration: none;\n }\n\n .ia-button:disabled,\n .ia-button.disabled {\n cursor: not-allowed;\n opacity: 0.5;\n }\n\n .ia-button.transparent {\n background-color: transparent;\n }\n \n .ia-button.slim {\n padding: 0;\n }\n\n .ia-button.primary {\n background-color: var(--primaryCTAFill);\n border-color: var(--primaryCTABorder);\n }\n\n .ia-button.cancel {\n background-color: var(--primaryErrorCTAFill);\n border-color: var(--primaryErrorCTABorder);\n }\n\n .ia-button.external {\n background: var(--secondaryCTAFill);\n border-color: var(--secondaryCTABorder);\n }\n"]))),Lt=n(4535);function At(e){return At="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},At(e)}function It(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function _t(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,zt(r.key),r)}}function zt(e){var t=function(e){if("object"!=At(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=At(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==At(t)?t:t+""}function Tt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Tt=function(){return!!e})()}function Dt(e){return Dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dt(e)}function $t(e,t){return $t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$t(e,t)}var Ht,qt,Rt,Ft,Zt=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Dt(t),function(e,t){if(t&&("object"==At(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,Tt()?Reflect.construct(t,n||[],Dt(e).constructor):t.apply(e,n))}(this,t)).results=[],e.query="",e.queryInProgress=!1,e.renderHeader=!1,e.renderSearchAllFiles=!1,e.errorMessage="",e.bindBookReaderListeners(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$t(e,t)}(t,e),function(e,t,n){return t&&_t(e.prototype,t),n&&_t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"updated",value:function(){this.focusOnInputIfNecessary()}},{key:"bindBookReaderListeners",value:function(){document.addEventListener("BookReader:SearchCallback",this.setResults.bind(this))}},{key:"focusOnInputIfNecessary",value:function(){this.results.length||this.shadowRoot.querySelector("input[type='search']").focus()}},{key:"setResults",value:function(e){var t=e.detail;this.results=t.results}},{key:"setQuery",value:function(e){this.query=e.currentTarget.value,this.query||this.cancelSearch()}},{key:"performSearch",value:function(e){e.preventDefault();var t=e.currentTarget.querySelector('input[type="search"]');t&&t.value&&this.dispatchEvent(new CustomEvent("bookSearchInitiated",{bubbles:!0,composed:!0,detail:{query:this.query}}))}},{key:"selectResult",value:function(e){this.dispatchEvent(new CustomEvent("resultSelected",{bubbles:!0,composed:!0,detail:{match:e}})),this.dispatchEvent(new CustomEvent("closeMenu",{bubbles:!0,composed:!0}))}},{key:"cancelSearch",value:function(){this.queryInProgress=!1,this.dispatchSearchCanceled()}},{key:"dispatchSearchCanceled",value:function(){this.dispatchEvent(new Event("bookSearchCanceled"))}},{key:"resultsCount",get:function(){var e=this.results.length;return e?"".concat(e," result").concat(e>1?"s":""):r.s6}},{key:"headerSection",get:function(){var e=(0,r.qy)(ft||(ft=It(["<header>\n <h3>Search inside</h3>\n ","\n </header>"])),this.resultsCount?(0,r.qy)(mt||(mt=It(["(",")"])),this.resultsCount):r.s6);return this.renderHeader?e:r.s6}},{key:"searchMultipleControls",get:function(){var e=(0,r.qy)(vt||(vt=It(['\n <input name="all_files" id="all_files" type="checkbox" />\n <label class="checkbox" for="all_files">Search all files</label>\n '])));return this.renderSearchAllFiles?e:r.s6}},{key:"loadingIndicator",get:function(){return(0,r.qy)(bt||(bt=It(['\n <div class="loading">\n <ia-activity-indicator mode="processing" aria-hidden="true" role="presentation"></ia-activity-indicator>\n <p>Searching</p>\n <button class="ia-button external cancel-search" @click=',">Cancel</button>\n </div>\n "])),this.cancelSearch)}},{key:"resultsSet",get:function(){var e=this;return(0,r.qy)(yt||(yt=It(['\n <nav aria-label="Search results">\n <div>\n ','\n <a\n href="#"\n class="skip-link"\n @click=','\n >Skip to last result</a>\n </div>\n <ul class="results">\n ','\n </ul>\n <a\n href="#"\n class="skip-link"\n @click=',"\n >Skip to first result</a>\n </nav>\n "])),this.resultsCount,function(t){t.preventDefault(),e.shadowRoot.querySelector(".results li:last-child .result-item").focus()},this.results.map(function(t){return(0,r.qy)(gt||(gt=It(['\n <li>\n <button class="result-item" @click=','>\n <span class="page-num">Page ',"</span> — <span lang=",">","</span>\n </button>\n </li>\n "])),e.selectResult.bind(e,t),t.displayPageNumber,(0,Lt.J)(t.lang),jt(t.html))}),function(t){t.preventDefault(),e.shadowRoot.querySelector(".results li:first-child .result-item").focus()})}},{key:"setErrorMessage",get:function(){return(0,r.qy)(kt||(kt=It(['\n <p class="error-message">',"</p>\n "])),this.errorMessage)}},{key:"render",value:function(){var e=!(this.queryInProgress||this.errorMessage||this.queryInProgress||this.results.length);return(0,r.qy)(wt||(wt=It(["\n ",'\n <form action="" method="get" @submit=',">\n ",'\n <input\n type="search"\n name="query"\n id="br-search-input"\n @keyup=',"\n @search=","\n .value=",'\n />\n <label class="search-cta ','" for="br-search-input">\n Please enter text to search for\n </label>\n </form>\n <div class="results-container" aria-live="polite">\n ',"\n ","\n ","\n </div>\n "])),this.headerSection,this.performSearch,this.searchMultipleControls,this.setQuery,this.setQuery,this.query,e?"":"sr-only",this.queryInProgress?this.loadingIndicator:r.s6,this.errorMessage?this.setErrorMessage:r.s6,this.results.length?this.resultsSet:r.s6)}}],[{key:"properties",get:function(){return{results:{type:Array},query:{type:String},queryInProgress:{type:Boolean},renderHeader:{type:Boolean},renderSearchAllFiles:{type:Boolean},errorMessage:{type:String}}}},{key:"styles",get:function(){var e=(0,r.AH)(St||(St=It(["var(--searchResultText, #adaedc)"]))),t=(0,r.AH)(Ct||(Ct=It(["var(--searchResultBg, #272958)"]))),n=(0,r.AH)(Ot||(Ot=It(["var(--searchResultBorder, #adaedc)"]))),o=(0,r.AH)(xt||(xt=It(["(--tertiaryBGColor, #333)"]))),i=(0,r.AH)(Mt||(Mt=It(["\n :host {\n display: block;\n height: 100%;\n padding: 1.5rem 1rem 2rem 0;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\n }\n\n .skip-link {\n position: absolute;\n left: -9999px;\n }\n .skip-link:focus {\n position: static;\n left: auto;\n }\n\n mark {\n padding: 0 .2rem;\n color: ",";\n background: ",";\n border: 1px solid ",';\n border-radius: 2px;\n }\n\n h3 {\n padding: 0;\n margin: 0 1rem 0 0;\n font-size: 2rem;\n }\n\n header {\n display: flex;\n align-items: center;\n padding: 0 2rem 0 0;\n }\n header p {\n padding: 0;\n margin: 0;\n font-size: 1.2rem;\n font-weight: bold;\n font-style: italic;\n }\n\n form {\n padding: 0 0 1rem 0;\n }\n\n [type="checkbox"] {\n display: none;\n }\n\n label {\n display: block;\n text-align: center;\n }\n\n label.checkbox {\n padding-bottom: .5rem;\n font-size: 1.6rem;\n line-height: 150%;\n vertical-align: middle;\n }\n\n label.checkbox:after {\n display: inline-block;\n width: 14px;\n height: 14px;\n margin-left: .7rem;\n content: "";\n border-radius: 2px;\n }\n :checked + label.checkbox:after {\n background-image: url(\'','\');\n }\n\n label.checkbox[for="all_files"]:after {\n background: ',' 50% 50% no-repeat;\n border: 1px solid var(--primaryTextColor);\n }\n\n [type="search"] {\n color: var(--primaryTextColor);\n border: 1px solid var(--primaryTextColor);\n -webkit-appearance: textfield;\n width: 100%;\n height: 3rem;\n padding: 0 1.5rem;\n box-sizing: border-box;\n font: normal 1.6rem "Helvetica qNeue", Helvetica, Arial, sans-serif;\n border-radius: 1.5rem;\n background: transparent;\n }\n [type="search"]:focus {\n outline: none;\n }\n [type="search"]::-webkit-search-cancel-button {\n width: 18px;\n height: 18px;\n -webkit-appearance: none;\n appearance: none;\n -webkit-mask: url(\'',"') 0 0 no-repeat;\n mask: url('","') 0 0 no-repeat;\n -webkit-mask-size: 100%;\n mask-size: 100%;\n background: #fff;\n }\n\n .page-num {\n font-weight: bold;\n padding-bottom: 0;\n }\n\n .search-cta {\n padding: 10px 0;\n text-align: center;\n font-style: italic;\n }\n\n .results-container {\n padding-bottom: 2rem;\n }\n\n ul {\n padding: 0 0 2rem 0;\n margin: 0;\n list-style: none;\n }\n\n .result-item {\n cursor: pointer;\n margin-top: 8px;\n font-size: 12px;\n padding: 5px;\n border-radius: 4px;\n display: block;\n width: 100%;\n /* Reset button styles */\n background: none;\n border: none;\n text-align: left;\n font-family: inherit;\n transition: background-color 0.2s;\n }\n\n .result-item:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n .loading {\n text-align: center;\n }\n\n .loading p {\n padding: 0 0 1rem 0;\n margin: 0;\n font-size: 1.2rem;\n }\n\n ia-activity-indicator {\n display: block;\n width: 40px;\n height: 40px;\n margin: 0 auto;\n }\n\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0 0 0 0) !important;\n white-space: nowrap !important;\n border: 0 !important;\n }\n "])),e,t,n,Bt,o,Pt,Pt);return[Et,i]}}])}(r.WF);function Wt(e){return Wt="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},Wt(e)}function Nt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Vt(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,Ut(r.key),r)}}function Ut(e){var t=function(e){if("object"!=Wt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Wt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Wt(t)?t:t+""}customElements.define("ia-book-search-results",Zt);var Gt,Jt,Yt,Xt,Qt,Kt,en,tn,nn,rn,on,an={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},sn=function(){return function(e,t){return t&&Vt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=t.onProviderChange,o=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onBookSearchInitiated=this.onBookSearchInitiated.bind(this),this.onSearchStarted=this.onSearchStarted.bind(this),this.onSearchRequestError=this.onSearchRequestError.bind(this),this.onSearchResultsClicked=this.onSearchResultsClicked.bind(this),this.onSearchResultsChange=this.onSearchResultsChange.bind(this),this.onSearchResultsCleared=this.onSearchResultsCleared.bind(this),this.searchCanceledInMenu=this.searchCanceledInMenu.bind(this),this.bindEventListeners=this.bindEventListeners.bind(this),this.getMenuDetails=this.getMenuDetails.bind(this),this.getComponent=this.getComponent.bind(this),this.updateMenu=this.updateMenu.bind(this),this.onProviderChange=n,this.bookreader=o,this.icon=(0,r.qy)(Ht||(Ht=Nt(['\n <ia-icon-search\n aria-hidden="true" role="presentation"\n style="width: var(--iconWidth); height: var(--iconHeight);"\n ></ia-icon-search>']))),this.label="Search inside",this.menuDetails=this.getMenuDetails(),this.id="search",this.component=this.getComponent(),this.bindEventListeners()},[{key:"getMenuDetails",value:function(){var e=an,t=e.resultsCount,n=e.query;if(e.queryInProgress||!n)return r.s6;var o=1===t?"result":"results";return(0,r.qy)(qt||(qt=Nt(["("," ",")"])),t,o)}},{key:"bindEventListeners",value:function(){var e=this;window.addEventListener("BookReader:SearchStarted",this.onSearchStarted),window.addEventListener("BookReader:SearchCallback",this.onSearchResultsChange),window.addEventListener("BookReader:SearchCallbackEmpty",function(t){e.onSearchRequestError(t,"noResults")}),window.addEventListener("BookReader:SearchCallbackNotIndexed",function(t){e.onSearchRequestError(t,"notIndexed")}),window.addEventListener("BookReader:SearchCallbackError",function(t){e.onSearchRequestError(t)}),window.addEventListener("BookReader:SearchResultsCleared",function(){e.onSearchResultsCleared()}),window.addEventListener("BookReader:SearchCanceled",function(t){e.onSearchCanceled(t)})}},{key:"onSearchCanceled",value:function(){an={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},this.updateMenu({searchCanceled:!0}),this.bookreader.urlPlugin&&this.updateSearchInUrl()}},{key:"onSearchStarted",value:function(e){var t=e.detail.props,n=t.term,r=void 0===n?"":n,o=t.instance;o&&(this.bookreader=o),an.query=r,an.results=[],an.resultsCount=0,an.queryInProgress=!0,an.errorMessage="",this.updateMenu()}},{key:"onBookSearchInitiated",value:function(e){var t=e.detail;an.query=t.query,this.bookreader.search(an.query)}},{key:"onSearchRequestError",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",o=e.detail.props,i=o.instance,a=o.results;i&&(this.bookreader=i);var s={noResults:"0 results",notIndexed:"This book hasn't been indexed for searching yet. We've just started indexing it,\n so search should be available soon. Please try again later. Thanks!",default:"Sorry, there was an error with your search. Please try again."},l=null!==(t=s[n])&&void 0!==t?t:s.default;an.query=(null==a?void 0:a.q)||"",an.results=[],an.resultsCount=0,an.queryInProgress=!1,an.errorMessage=(0,r.qy)(Rt||(Rt=Nt(['<p class="error">',"</p>"])),l),this.updateMenu()}},{key:"onSearchResultsChange",value:function(e){var t=e.detail.props,n=void 0===t?{}:t,r=n.instance,o=void 0===r?null:r,i=n.results,a=void 0===i?[]:i;o&&(this.bookreader=o);var s=a.matches||[],l=s.length,c=a.q;an={results:s,resultsCount:l,query:c,queryInProgress:!1,errorMessage:""},this.updateMenu()}},{key:"searchCanceledInMenu",value:function(){this.bookreader.plugins.search.cancelSearchRequest()}},{key:"onSearchResultsCleared",value:function(){an={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},this.updateMenu({openMenu:!1}),this.bookreader.plugins.search.searchView.clearSearchFieldAndResults(!1),this.bookreader.urlPlugin&&this.updateSearchInUrl()}},{key:"updateSearchInUrl",value:function(){this.bookreader.urlPlugin&&(this.bookreader.urlPlugin.pullFromAddressBar(),an.query?this.bookreader.urlPlugin.setUrlParam("q",an.query):this.bookreader.urlPlugin.removeUrlParam("q"))}},{key:"updateMenu",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.menuDetails=this.getMenuDetails(),this.component=this.getComponent(),this.onProviderChange(this.bookreader,e)}},{key:"getComponent",value:function(){var e=an,t=e.query,n=e.results,o=e.queryInProgress,i=e.errorMessage;return(0,r.qy)(Ft||(Ft=Nt(["\n <ia-book-search-results\n .query=","\n .results=","\n .errorMessage=","\n ?queryInProgress=","\n ?renderSearchAllFiles=","\n @resultSelected=","\n @bookSearchInitiated=","\n @bookSearchResultsCleared=","\n @bookSearchCanceled=","\n ></ia-book-search-results>\n "])),t,n,i,o,!1,this.onSearchResultsClicked,this.onBookSearchInitiated,this.onSearchResultsCleared,this.searchCanceledInMenu)}},{key:"onSearchResultsClicked",value:function(e){var t=e.detail;this.bookreader.plugins.search.jumpToMatch(t.match.matchIndex)}}])}(),ln=(n(2712),r.qy`
1590
1629
  <svg
1591
1630
  viewBox="0 0 100 100"
1592
1631
  xmlns="http://www.w3.org/2000/svg"
@@ -1599,7 +1638,7 @@
1599
1638
  <path d="m50 80 33.3333333-43.3333333h-20v-36.6666667h-26.6666666v36.6666667h-20zm50 20v-13.3333333h-100v13.3333333z"/>
1600
1639
  </g>
1601
1640
  </svg>
1602
- `);class Yt extends r.WF{static get styles(){return r.AH`
1641
+ `);class cn extends r.WF{static get styles(){return r.AH`
1603
1642
  :host {
1604
1643
  width: var(--iconWidth, 'auto');
1605
1644
  height: var(--iconHeight, 'auto');
@@ -1612,7 +1651,7 @@
1612
1651
  .stroke-color {
1613
1652
  stroke: var(--iconStrokeColor);
1614
1653
  }
1615
- `}render(){return Jt}}function Xt(e){return Xt="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},Xt(e)}function Qt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Kt(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,en(r.key),r)}}function en(e){var t=function(e){if("object"!=Xt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Xt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xt(t)?t:t+""}function tn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(tn=function(){return!!e})()}function nn(e){return nn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},nn(e)}function rn(e,t){return rn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rn(e,t)}customElements.define("ia-icon-dl",Yt);var on,an,sn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=nn(t),function(e,t){if(t&&("object"==Xt(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,tn()?Reflect.construct(t,n||[],nn(e).constructor):t.apply(e,n))}(this,t)).downloads=[],e.expiration=0,e.renderHeader=!1,e.isBookProtected=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rn(e,t)}(t,e),function(e,t,n){return t&&Kt(e.prototype,t),n&&Kt(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"formatsCount",get:function(){var e=this.downloads.length;return e?(0,r.qy)(Dt||(Dt=Qt(["<p>"," format","</p>"])),e,e>1?"s":""):(0,r.qy)(_t||(_t=Qt([""])))}},{key:"loanExpiryMessage",get:function(){return this.expiration?(0,r.qy)($t||($t=Qt(["<h2>These files will expire in "," days.</h2>"])),this.expiration):(0,r.qy)(Ht||(Ht=Qt([""])))}},{key:"renderDownloadOptions",value:function(){return this.downloads.map(function(e){return(0,r.qy)(qt||(qt=Qt(['\n <li>\n <a class="ia-button link primary" href="','">Get ',"</a>\n ","\n </li>\n "])),e.url,e.type,e.note?(0,r.qy)(Rt||(Rt=Qt(["<p>","</p>"])),e.note):(0,r.qy)(Ft||(Ft=Qt([""]))))})}},{key:"hasLCPOption",get:function(){var e=/^(LCP)/g;return this.downloads.some(function(t){var n;return null===(n=t.type)||void 0===n?void 0:n.match(e)})}},{key:"header",get:function(){return this.renderHeader?(0,r.qy)(Zt||(Zt=Qt(["\n <header>\n <h3>Downloadable files</h3>\n ","\n </header>\n "])),this.formatsCount):r.s6}},{key:"installLCPSoftwareMsg",get:function(){return(0,r.qy)(Wt||(Wt=Qt(['\n <p>For LCP downloads, make sure you have LCP software such as <a href="https://thorium.edrlab.org/" rel="noopener noreferrer nofollow" target="_blank">Thorium (desktop)</a>, <a href="https://apps.apple.com/us/app/cantook-by-aldiko/id1476410111" rel="noopener noreferrer nofollow" target="_blank">Cantook (iOS)</a> or <a href="https://play.google.com/store/apps/details?id=com.aldiko.android" rel="noopener noreferrer nofollow" target="_blank">Cantook (Android)</a> installed on your device.</p>\n '])))}},{key:"render",value:function(){return(0,r.qy)(Nt||(Nt=Qt(["\n ","\n ","\n <ul>","</ul>\n ","\n "])),this.header,this.loanExpiryMessage,this.renderDownloadOptions(),this.hasLCPOption?this.installLCPSoftwareMsg:r.s6)}}],[{key:"properties",get:function(){return{downloads:{type:Array},expiration:{type:Number},renderHeader:{type:Boolean},isBookProtected:{type:Boolean}}}},{key:"styles",get:function(){var e=(0,r.AH)(Ut||(Ut=Qt(["\n :host {\n display: block;\n height: 100%;\n padding: 1.5rem 0;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\n }\n\n a.close ia-icon {\n --iconWidth: 18px;\n --iconHeight: 18px;\n }\n a.close {\n justify-self: end;\n }\n\n header {\n display: flex;\n align-items: center;\n padding: 0 2rem;\n }\n header p {\n padding: 0;\n margin: 0;\n font-size: 1.2rem;\n font-weight: bold;\n font-style: italic;\n }\n header div {\n display: flex;\n align-items: baseline;\n } \n\n h2 {\n font-size: 1.6rem;\n }\n\n h3 {\n padding: 0;\n margin: 0 1rem 0 0;\n font-size: 1.4rem;\n }\n\n ul {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n p {\n margin: .3rem 0 0 0;\n }\n\n li,\n ul + p {\n padding-bottom: 1.2rem;\n font-size: 1.2rem;\n line-height: 140%;\n }\n "])));return[yt,e]}}])}(r.WF);function ln(e){return ln="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},ln(e)}function cn(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 un(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function dn(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,hn(r.key),r)}}function hn(e){var t=function(e){if("object"!=ln(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ln(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ln(t)?t:t+""}customElements.define("ia-book-downloads",sn);var pn={pdf:{type:"Encrypted Adobe PDF",url:"#",note:"PDF files contain high quality images of pages."},lcppdf:{type:"Get LCP PDF",url:"#",note:"PDF files contain high quality images of pages."},lcpepub:{type:"Get LCP ePub",url:"#",note:"ePub files are smaller in size, but may contain errors."},epub:{type:"Encrypted Adobe ePub",url:"#",note:"ePub files are smaller in size, but may contain errors."}},fn={pdf:"PDF",epub:"ePub",lcppdf:"LCP PDF",lcpepub:"LCP ePub"},mn=function(){return function(e,t){return t&&dn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n,o=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.icon=(0,r.qy)(on||(on=un(['<ia-icon-dl style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-dl>']))),this.label="Downloadable files",this.menuDetails="",this.downloads=[],this.id="downloads",this.component="",this.isBookProtected=(null==o||null===(n=o.options)||void 0===n?void 0:n.isProtected)||!1},[{key:"update",value:function(e){this.computeAvailableTypes(e),this.component=this.menu,this.component.isBookProtected=this.isBookProtected;var t=1===this.downloads.length?"":"s";this.menuDetails="(".concat(this.downloads.length," format").concat(t,")")}},{key:"computeAvailableTypes",value:function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(function(t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cn(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)?cn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),r=n[0],o=void 0===r?"":r,i=n[1],a=void 0===i?"":i,s=o.toLowerCase(),l=pn[s]||null;if(l){var c=e.isBookProtected?pn[s].type:fn[s],u=Object.assign({},l,{url:a,type:c});t.push(u)}return t},[]);this.downloads=t}},{key:"menu",get:function(){return(0,r.qy)(an||(an=un(["<ia-book-downloads .downloads=","></ia-book-downloads>"])),this.downloads)}}])}(),vn=(n(8598),r.qy`
1654
+ `}render(){return ln}}function un(e){return un="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},un(e)}function dn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function hn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,pn(r.key),r)}}function pn(e){var t=function(e){if("object"!=un(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=un(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==un(t)?t:t+""}function fn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(fn=function(){return!!e})()}function mn(e){return mn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mn(e)}function vn(e,t){return vn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vn(e,t)}customElements.define("ia-icon-dl",cn);var bn,yn,gn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=mn(t),function(e,t){if(t&&("object"==un(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,fn()?Reflect.construct(t,n||[],mn(e).constructor):t.apply(e,n))}(this,t)).downloads=[],e.expiration=0,e.renderHeader=!1,e.isBookProtected=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vn(e,t)}(t,e),function(e,t,n){return t&&hn(e.prototype,t),n&&hn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"formatsCount",get:function(){var e=this.downloads.length;return e?(0,r.qy)(Gt||(Gt=dn(["<p>"," format","</p>"])),e,e>1?"s":""):(0,r.qy)(Jt||(Jt=dn([""])))}},{key:"loanExpiryMessage",get:function(){return this.expiration?(0,r.qy)(Yt||(Yt=dn(["<h2>These files will expire in "," days.</h2>"])),this.expiration):(0,r.qy)(Xt||(Xt=dn([""])))}},{key:"renderDownloadOptions",value:function(){return this.downloads.map(function(e){return(0,r.qy)(Qt||(Qt=dn(['\n <li>\n <a class="ia-button link primary" href="','">Get ',"</a>\n ","\n </li>\n "])),e.url,e.type,e.note?(0,r.qy)(Kt||(Kt=dn(["<p>","</p>"])),e.note):(0,r.qy)(en||(en=dn([""]))))})}},{key:"hasLCPOption",get:function(){var e=/^(LCP)/g;return this.downloads.some(function(t){var n;return null===(n=t.type)||void 0===n?void 0:n.match(e)})}},{key:"header",get:function(){return this.renderHeader?(0,r.qy)(tn||(tn=dn(["\n <header>\n <h3>Downloadable files</h3>\n ","\n </header>\n "])),this.formatsCount):r.s6}},{key:"installLCPSoftwareMsg",get:function(){return(0,r.qy)(nn||(nn=dn(['\n <p>For LCP downloads, make sure you have LCP software such as <a href="https://thorium.edrlab.org/" rel="noopener noreferrer nofollow" target="_blank">Thorium (desktop)</a>, <a href="https://apps.apple.com/us/app/cantook-by-aldiko/id1476410111" rel="noopener noreferrer nofollow" target="_blank">Cantook (iOS)</a> or <a href="https://play.google.com/store/apps/details?id=com.aldiko.android" rel="noopener noreferrer nofollow" target="_blank">Cantook (Android)</a> installed on your device.</p>\n '])))}},{key:"render",value:function(){return(0,r.qy)(rn||(rn=dn(["\n ","\n ","\n <ul>","</ul>\n ","\n "])),this.header,this.loanExpiryMessage,this.renderDownloadOptions(),this.hasLCPOption?this.installLCPSoftwareMsg:r.s6)}}],[{key:"properties",get:function(){return{downloads:{type:Array},expiration:{type:Number},renderHeader:{type:Boolean},isBookProtected:{type:Boolean}}}},{key:"styles",get:function(){var e=(0,r.AH)(on||(on=dn(["\n :host {\n display: block;\n height: 100%;\n padding: 1.5rem 0;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\n }\n\n a.close ia-icon {\n --iconWidth: 18px;\n --iconHeight: 18px;\n }\n a.close {\n justify-self: end;\n }\n\n header {\n display: flex;\n align-items: center;\n padding: 0 2rem;\n }\n header p {\n padding: 0;\n margin: 0;\n font-size: 1.2rem;\n font-weight: bold;\n font-style: italic;\n }\n header div {\n display: flex;\n align-items: baseline;\n } \n\n h2 {\n font-size: 1.6rem;\n }\n\n h3 {\n padding: 0;\n margin: 0 1rem 0 0;\n font-size: 1.4rem;\n }\n\n ul {\n padding: 0;\n margin: 0;\n list-style: none;\n }\n\n p {\n margin: .3rem 0 0 0;\n }\n\n li,\n ul + p {\n padding-bottom: 1.2rem;\n font-size: 1.2rem;\n line-height: 140%;\n }\n "])));return[Et,e]}}])}(r.WF);function kn(e){return kn="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},kn(e)}function wn(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 Sn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Cn(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,On(r.key),r)}}function On(e){var t=function(e){if("object"!=kn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=kn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==kn(t)?t:t+""}customElements.define("ia-book-downloads",gn);var xn={pdf:{type:"Encrypted Adobe PDF",url:"#",note:"PDF files contain high quality images of pages."},lcppdf:{type:"Get LCP PDF",url:"#",note:"PDF files contain high quality images of pages."},lcpepub:{type:"Get LCP ePub",url:"#",note:"ePub files are smaller in size, but may contain errors."},epub:{type:"Encrypted Adobe ePub",url:"#",note:"ePub files are smaller in size, but may contain errors."}},Mn={pdf:"PDF",epub:"ePub",lcppdf:"LCP PDF",lcpepub:"LCP ePub"},jn=function(){return function(e,t){return t&&Cn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n,o=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.icon=(0,r.qy)(bn||(bn=Sn(['<ia-icon-dl aria-hidden="true" role="presentation" style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-dl>']))),this.label="Downloadable files",this.menuDetails="",this.downloads=[],this.id="downloads",this.component="",this.isBookProtected=(null==o||null===(n=o.options)||void 0===n?void 0:n.isProtected)||!1},[{key:"update",value:function(e){this.computeAvailableTypes(e),this.component=this.menu,this.component.isBookProtected=this.isBookProtected;var t=1===this.downloads.length?"":"s";this.menuDetails="(".concat(this.downloads.length," format").concat(t,")")}},{key:"computeAvailableTypes",value:function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(function(t){var n=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wn(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)?wn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),r=n[0],o=void 0===r?"":r,i=n[1],a=void 0===i?"":i,s=o.toLowerCase(),l=xn[s]||null;if(l){var c=e.isBookProtected?xn[s].type:Mn[s],u=Object.assign({},l,{url:a,type:c});t.push(u)}return t},[]);this.downloads=t}},{key:"menu",get:function(){return(0,r.qy)(yn||(yn=Sn(["<ia-book-downloads .downloads=","></ia-book-downloads>"])),this.downloads)}}])}(),Bn=r.qy`
1616
1655
  <svg
1617
1656
  viewBox="0 0 24 24"
1618
1657
  xmlns="http://www.w3.org/2000/svg"
@@ -1622,7 +1661,7 @@
1622
1661
  <desc id="visualAdjustmentDescID">A circle with its left hemisphere filled</desc>
1623
1662
  <path class="fill-color" d="m12 0c6.627417 0 12 5.372583 12 12s-5.372583 12-12 12-12-5.372583-12-12 5.372583-12 12-12zm0 2v20l.2664041-.0034797c5.399703-.1412166 9.7335959-4.562751 9.7335959-9.9965203 0-5.5228475-4.4771525-10-10-10z" fill-rule="evenodd" />
1624
1663
  </svg>
1625
- `);class bn extends r.WF{static get styles(){return r.AH`
1664
+ `;class Pn extends r.WF{static get styles(){return r.AH`
1626
1665
  :host {
1627
1666
  width: var(--iconWidth, 'auto');
1628
1667
  height: var(--iconHeight, 'auto');
@@ -1635,7 +1674,7 @@
1635
1674
  .stroke-color {
1636
1675
  stroke: var(--iconStrokeColor);
1637
1676
  }
1638
- `}render(){return vn}}function yn(e){return yn="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},yn(e)}function gn(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 kn(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,wn(r.key),r)}}function wn(e){var t=function(e){if("object"!=yn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=yn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yn(t)?t:t+""}function Sn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Sn=function(){return!!e})()}function Cn(e){return Cn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Cn(e)}function On(e,t){return On=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},On(e,t)}customElements.define("ia-icon-visual-adjustment",bn),n(1415),n(744);var xn=(0,de.u$)(function(e){function t(e){var n,r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),n=function(e,t,n){return t=Cn(t),function(e,t){if(t&&("object"==yn(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,Sn()?Reflect.construct(t,n||[],Cn(e).constructor):t.apply(e,n))}(this,t,[e]),e.type!==de.OA.ATTRIBUTE||"class"!==e.name||(null===(r=e.strings)||void 0===r?void 0:r.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");return n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&On(e,t)}(t,e),function(e,t){return t&&kn(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(e){return" "+Object.keys(e).filter(function(t){return e[t]}).join(" ")+" "}},{key:"update",value:function(e,t){var n,r,o=this,i=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gn(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)?gn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,1)[0];if(void 0===this.it){for(var a in this.it=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(function(e){return""!==e}))),i)i[a]&&!(null===(n=this.nt)||void 0===n?void 0:n.has(a))&&this.it.add(a);return this.render(i)}var s=e.element.classList;for(var l in this.it.forEach(function(e){e in i||(s.remove(e),o.it.delete(e))}),i){var c=!!i[l];c===this.it.has(l)||(null===(r=this.nt)||void 0===r?void 0:r.has(l))||(c?(s.add(l),this.it.add(l)):(s.remove(l),this.it.delete(l)))}return ue.c0}}])}(de.WL)),jn=r.qy`
1677
+ `}render(){return Bn}}customElements.define("ia-icon-visual-adjustment",Pn);var En=r.qy`
1639
1678
  <svg
1640
1679
  viewBox="0 0 100 100"
1641
1680
  xmlns="http://www.w3.org/2000/svg"
@@ -1651,7 +1690,7 @@
1651
1690
  <path d="m2.3239824 87.3815869 25.8938394-23.8143095c-4.5929593-6.6937643-6.889439-14.1059452-6.889439-22.2365428 0-7.1360431 1.7567382-13.7186647 5.2702146-19.7478649 3.5134763-6.0292002 8.2852035-10.8003118 14.3151815-14.31333499 6.029978-3.51302314 12.6134488-5.26953471 19.7504125-5.26953471s13.7204346 1.75651157 19.7504126 5.26953471c6.029978 3.51302319 10.8017051 8.28413479 14.3151815 14.31333499 3.5134763 6.0292002 5.2702145 12.6118218 5.2702145 19.7478649s-1.7567382 13.7324143-5.2702145 19.7891137c-3.5134764 6.0566994-8.2852035 10.8415607-14.3151815 14.3545838-6.029978 3.5130232-12.6134489 5.2695347-19.7504126 5.2695347-8.5762743 0-16.3217363-2.5723212-23.2363861-7.7169637l-26.3063807 24.2302349c-1.27200216 1.1618413-2.76631826 1.742762-4.48294825 1.742762-1.826641 0-3.38971397-.6496687-4.68921892-1.949006s-1.94925743-2.8622087-1.94925743-4.688614c0-1.9364022.7746608-3.5955208 2.3239824-4.9773557zm58.3436469-19.9162976c7.1919692 0 13.3331041-2.5585716 18.4234048-7.6757149s7.635451-11.2712357 7.635451-18.4622772-2.5451503-13.3313843-7.635451-18.4210284-11.2314356-7.6344661-18.4234048-7.6344661-13.3331042 2.544822-18.4234049 7.6344661-7.635451 11.2299869-7.635451 18.4210284 2.5451503 13.3451339 7.635451 18.4622772 11.2314357 7.6757149 18.4234049 7.6757149zm-14.9374313-21.3256316h31.2878163v-9.5422233h-31.2878163z"/>
1652
1691
  </g>
1653
1692
  </svg>
1654
- `;class Bn extends r.WF{static get styles(){return r.AH`
1693
+ `;class Ln extends r.WF{static get styles(){return r.AH`
1655
1694
  :host {
1656
1695
  width: var(--iconWidth, 'auto');
1657
1696
  height: var(--iconHeight, 'auto');
@@ -1664,7 +1703,7 @@
1664
1703
  .stroke-color {
1665
1704
  stroke: var(--iconStrokeColor);
1666
1705
  }
1667
- `}render(){return jn}}customElements.define("ia-icon-magnify-minus",Bn);var Pn,Mn,En,Ln,An,In,Tn,zn=r.qy`
1706
+ `}render(){return En}}customElements.define("ia-icon-magnify-minus",Ln);var An,In,_n,zn,Tn,Dn,$n,Hn=r.qy`
1668
1707
  <svg
1669
1708
  viewBox="0 0 100 100"
1670
1709
  xmlns="http://www.w3.org/2000/svg"
@@ -1680,7 +1719,7 @@
1680
1719
  <path d="m2.40305276 87.4017263 25.81133064-23.7730295c-4.5356618-6.5723551-6.8034928-14.000283-6.8034928-22.2837838 0-7.1236734 1.7429868-13.6948847 5.2289603-19.7136338 3.4859736-6.0187491 8.2577006-10.7953163 14.3151813-14.32970144 6.0574806-3.53438517 12.6547027-5.30157776 19.7916662-5.30157776 10.8429591 0 20.0964884 3.85236545 27.760588 11.5570964 7.6640996 7.7047309 11.4950036 16.9684802 11.4927136 27.791248 0 10.8799585-3.8309059 20.1574336-11.4927136 27.8324254-7.6618077 7.6749917-16.915337 11.5124876-27.760588 11.5124876-8.6312796 0-16.431747-2.5678624-23.4014021-7.7035871l-26.1413636 24.188234c-1.21699671 1.2147305-2.73881553 1.8220957-4.56545649 1.8220957s-3.3897139-.6485425-4.68921882-1.9456276c-1.29950493-1.297085-1.94925739-2.8572473-1.94925739-4.6804867 0-1.8781426.80216353-3.5343852 2.4064906-4.9687279zm58.34020784-19.878343c7.1369635 0 13.264347-2.5678623 18.3821503-7.7035871 5.1178034-5.1357247 7.676705-11.2928753 7.676705-18.4714518s-2.5589016-13.3082755-7.676705-18.3890972c-5.1178033-5.0808217-11.2451868-7.6212325-18.3821503-7.6212325-7.2469746 0-13.4156121 2.5404108-18.5059127 7.6212325s-7.6354509 11.2105207-7.6354509 18.3890972 2.5589016 13.3357271 7.676705 18.4714518c5.1178033 5.1357248 11.2726895 7.7035871 18.4646586 7.7035871zm-13.3594607-21.8685793h10.206958v10.1879511h7.2194718v-10.1879511h10.206958v-7.206028h-10.206958v-10.187951h-7.2194718v10.187951h-10.206958z"/>
1681
1720
  </g>
1682
1721
  </svg>
1683
- `;class Dn extends r.WF{static get styles(){return r.AH`
1722
+ `;class qn extends r.WF{static get styles(){return r.AH`
1684
1723
  :host {
1685
1724
  width: var(--iconWidth, 'auto');
1686
1725
  height: var(--iconHeight, 'auto');
@@ -1693,9 +1732,9 @@
1693
1732
  .stroke-color {
1694
1733
  stroke: var(--iconStrokeColor);
1695
1734
  }
1696
- `}render(){return zn}}function _n(e){return _n="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},_n(e)}function $n(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Hn(e){return function(e){if(Array.isArray(e))return qn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return qn(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)?qn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function qn(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 Rn(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,Fn(r.key),r)}}function Fn(e){var t=function(e){if("object"!=_n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_n(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_n(t)?t:t+""}function Zn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Zn=function(){return!!e})()}function Wn(e){return Wn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wn(e)}function Nn(e,t){return Nn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Nn(e,t)}customElements.define("ia-icon-magnify-plus",Dn);var Un,Vn,Gn=function(e){return"visualAdjustment".concat(e)},Jn={optionChange:Gn("OptionChanged"),zoomIn:Gn("ZoomIn"),zoomOut:Gn("ZoomOut")},Yn=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Wn(t),function(e,t){if(t&&("object"==_n(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,Zn()?Reflect.construct(t,n||[],Wn(e).constructor):t.apply(e,n))}(this,t)).activeCount=0,e.options=[],e.renderHeader=!1,e.showZoomControls=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Nn(e,t)}(t,e),function(e,t,n){return t&&Rn(e.prototype,t),n&&Rn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"firstUpdated",value:function(){this.activeCount=this.activeOptions.length,this.emitOptionChangedEvent()}},{key:"activeOptions",get:function(){return this.options.reduce(function(e,t){return t.active?[].concat(Hn(e),[t.id]):e},[])}},{key:"prepareEventDetails",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{options:this.options,activeCount:this.activeCount,changedOptionId:e}}},{key:"emitOptionChangedEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.prepareEventDetails(e);this.dispatchEvent(new CustomEvent(Jn.optionChange,{bubbles:!0,composed:!0,detail:t}))}},{key:"emitZoomIn",value:function(){this.dispatchEvent(new CustomEvent(Jn.zoomIn))}},{key:"emitZoomOut",value:function(){this.dispatchEvent(new CustomEvent(Jn.zoomOut))}},{key:"changeActiveStateFor",value:function(e){var t=Hn(this.options),n=t.find(function(t){return t.id===e});if(n.active=!n.active,this.options=t,this.activeCount=this.activeOptions.length,this.emitOptionChangedEvent(n.id),n.active&&void 0!==n.value){var r=this.shadowRoot.querySelector('input[name="'.concat(n.id,'_range"]'));requestAnimationFrame(function(){null==r||r.focus()})}}},{key:"setRangeValue",value:function(e,t){var n=Hn(this.options);n.find(function(t){return t.id===e}).value=t,this.options=Hn(n)}},{key:"rangeSlider",value:function(e){var t=this;return(0,r.qy)(Pn||(Pn=$n(["\n <label class=",'>\n <span class="sr-only">','</span>\n <input\n type="range"\n name="','_range"\n min=',"\n max=","\n step=","\n .value=","\n aria-valuetext=","\n @input=","\n @change=",'\n />\n <span aria-hidden="true">',"%</span>\n </label>\n "])),"range".concat(e.active?" visible":""),e.name,e.id,e.min||0,e.max||100,e.step||1,e.value,"".concat(e.value,"%"),function(n){return t.setRangeValue(e.id,n.target.value)},function(){return t.emitOptionChangedEvent()},e.value)}},{key:"adjustmentCheckbox",value:function(e){var t=this;return(0,r.qy)(Mn||(Mn=$n(['\n <div\n class="adjustment-option ','">\n <label class="checkbox-label">\n ','\n <input\n type="checkbox"\n @change=',"\n ?checked=","\n />\n </label>\n ","\n </div>\n "])),xn({active:e.active,"has-range":void 0!==e.value}),e.name,function(){return t.changeActiveStateFor(e.id)},e.active,void 0!==e.value?this.rangeSlider(e):r.s6)}},{key:"headerSection",get:function(){var e=this.activeCount?(0,r.qy)(En||(En=$n(["<p>("," active)</p>"])),this.activeCount):r.s6,t=(0,r.qy)(Ln||(Ln=$n(["<header>\n <h3>Visual adjustments</h3>\n ","\n </header>"])),e);return this.renderHeader?t:r.s6}},{key:"zoomControls",get:function(){return(0,r.qy)(An||(An=$n(['\n <h4>Adjust zoom</h4>\n <button class="zoom_out" @click=',' title="Zoom out" aria-label="Zoom out">\n <ia-icon-magnify-minus aria-hidden="true" role="presentation"></ia-icon-magnify-minus>\n </button>\n <button class="zoom_in" @click=',' title="Zoom in" aria-label="Zoom in">\n <ia-icon-magnify-plus aria-hidden="true" role="presentation"></ia-icon-magnify-plus>\n </button>\n '])),this.emitZoomOut,this.emitZoomIn)}},{key:"render",value:function(){return(0,r.qy)(In||(In=$n(["\n ","\n ","\n ","\n "])),this.headerSection,Pe(this.options,function(e){return e.id},this.adjustmentCheckbox.bind(this)),this.showZoomControls?this.zoomControls:r.s6)}}],[{key:"properties",get:function(){return{activeCount:{type:Number},options:{type:Array},renderHeader:{type:Boolean},showZoomControls:{type:Boolean}}}},{key:"styles",get:function(){return(0,r.AH)(Tn||(Tn=$n(['\n :host {\n display: block;\n height: 100%;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\n padding: 10px 10px 0 0;\n }\n\n header {\n display: flex;\n align-items: baseline;\n }\n\n h3 {\n padding: 0;\n margin: 0 1rem 0 0;\n font-size: 1.6rem;\n }\n\n header p {\n padding: 0;\n margin: 0;\n font-size: 1.2rem;\n font-weight: bold;\n font-style: italic;\n }\n\n .adjustment-option {\n border: 2px solid transparent;\n border-radius: 4px;\n margin-bottom: 4px;\n }\n .adjustment-option.has-range.active {\n border: 2px solid rgba(255, 255, 255, 0.2);\n }\n\n .checkbox-label {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 1.4rem;\n font-weight: bold;\n cursor: pointer;\n padding: 6px 8px;\n transition: background-color 0.2s;\n border-radius: inherit;\n }\n .checkbox-label:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n .adjustment-option.has-range.active > .checkbox-label {\n border-radius: 4px 4px 0 0;\n }\n\n [type="checkbox"] {\n transform: scale(1.5);\n }\n\n .range {\n display: none;\n padding: 10px;\n align-items: center;\n gap: 10px;\n }\n .range.visible {\n display: flex;\n }\n .range input[type="range"] {\n flex: 1;\n }\n\n h4 {\n padding: 1rem 0;\n margin: 0;\n font-size: 1.4rem;\n }\n\n button {\n -webkit-appearance: none;\n appearance: none;\n border: none;\n background: transparent;\n cursor: pointer;\n --iconFillColor: var(--primaryTextColor);\n --iconStrokeColor: var(--primaryTextColor);\n height: 4rem;\n width: 4rem;\n transition: background-color 0.2s;\n border-radius: 4px;\n }\n\n button:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0 0 0 0) !important;\n white-space: nowrap !important;\n border: 0 !important;\n }\n'])))}}])}(r.WF);function Xn(e){return Xn="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},Xn(e)}function Qn(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 Kn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function er(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,tr(r.key),r)}}function tr(e){var t=function(e){if("object"!=Xn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Xn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xn(t)?t:t+""}customElements.define("ia-book-visual-adjustments",Yn);var nr,rr,or=[{id:"brightness",name:"Adjust brightness",active:!1,min:0,max:200,step:1,value:120},{id:"contrast",name:"Adjust contrast",active:!1,min:0,max:200,step:1,value:120},{id:"invert",name:"Invert colors (dark mode)",active:!1},{id:"grayscale",name:"Convert to grayscale",active:!1}],ir=function(){return function(e,t){return t&&er(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.onProviderChange,o=t.bookreader;this.onProviderChange=n,this.bookContainer=o.refs.$brContainer,this.bookreader=o,this.onAdjustmentChange=this.onAdjustmentChange.bind(this),this.optionUpdateComplete=this.optionUpdateComplete.bind(this),this.updateOptionsCount=this.updateOptionsCount.bind(this),this.onZoomIn=this.onZoomIn.bind(this),this.onZoomOut=this.onZoomOut.bind(this),this.activeCount=0,this.icon=(0,r.qy)(Un||(Un=Kn(['<ia-icon-visual-adjustment style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-visual-adjustment>']))),this.label="Visual Adjustments",this.menuDetails=this.updateOptionsCount(),this.id="visualAdjustments",this.component=(0,r.qy)(Vn||(Vn=Kn(["\n <ia-book-visual-adjustments\n .options=","\n @visualAdjustmentOptionChanged=","\n @visualAdjustmentZoomIn=","\n @visualAdjustmentZoomOut=","\n ></ia-book-visual-adjustments>\n "])),or,this.onAdjustmentChange,this.onZoomIn,this.onZoomOut)},[{key:"onZoomIn",value:function(){this.bookreader.zoom(1)}},{key:"onZoomOut",value:function(){this.bookreader.zoom(-1)}},{key:"onAdjustmentChange",value:function(e){var t=e.detail,n={brightness:function(e){return"brightness(".concat(e,"%)")},contrast:function(e){return"contrast(".concat(e,"%)")},grayscale:function(){return"grayscale(100%)"},invert:function(){return"invert(100%)"}},r=t.options.reduce(function(e,t){var r="".concat(t.active?n[t.id](t.value):"");return r?[].concat(function(e){return function(e){if(Array.isArray(e))return Qn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Qn(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)?Qn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e),[r]):e},[]).join(" ");this.bookContainer.css("filter",r),this.optionUpdateComplete(e)}},{key:"optionUpdateComplete",value:function(e){this.activeCount=e.detail.activeCount,this.updateOptionsCount(e),this.onProviderChange()}},{key:"updateOptionsCount",value:function(){this.menuDetails="(".concat(this.activeCount," active)")}}])}();function ar(e){return ar="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},ar(e)}function sr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function lr(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,cr(r.key),r)}}function cr(e){var t=function(e){if("object"!=ar(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ar(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ar(t)?t:t+""}function ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ur=function(){return!!e})()}function dr(e){return dr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dr(e)}function hr(e,t){return hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},hr(e,t)}var pr,fr,mr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=dr(t),function(e,t){if(t&&("object"==ar(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ur()?Reflect.construct(t,n||[],dr(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hr(e,t)}(t,e),function(e,t,n){return t&&lr(e.prototype,t),n&&lr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(){var e=this;return(0,r.qy)(nr||(nr=sr(['\n <div>\n <button class="delete" @click=',">Delete</button>\n <button @click=",">Cancel</button>\n </div>\n "])),function(){return e.deleteAction({detail:{id:"".concat(e.pageID)}})},function(){return e.cancelAction()})}}],[{key:"styles",get:function(){return(0,r.AH)(rr||(rr=sr(['\n div {\n display: flex;\n justify-content: center;\n padding-top: 2rem;\n }\n\n button {\n appearance: none;\n padding: 0.5rem 1rem;\n margin: 0 .5rem;\n box-sizing: border-box;\n font: 1.3rem "Helvetica Neue", Helvetica, Arial, sans-serif;\n color: var(--primaryTextColor);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n background: var(--primaryCTAFill);\n }\n\n .delete {\n background: var(--primaryErrorCTAFill);\n }\n '])))}},{key:"properties",get:function(){return{cancelAction:{type:Function},deleteAction:{type:Function},pageID:{type:String}}}}])}(r.WF);function vr(e){return vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vr(e)}function br(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function yr(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,gr(r.key),r)}}function gr(e){var t=function(e){if("object"!=vr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vr(t)?t:t+""}function kr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(kr=function(){return!!e})()}function wr(e){return wr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},wr(e)}function Sr(e,t){return Sr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Sr(e,t)}customElements.define("delete-modal-actions",mr);var Cr,Or=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=wr(t),function(e,t){if(t&&("object"==vr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,kr()?Reflect.construct(t,n||[],wr(e).constructor):t.apply(e,n))}(this,t)).state="hollow",e.side=void 0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sr(e,t)}(t,e),function(e,t,n){return t&&yr(e.prototype,t),n&&yr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"handleClick",value:function(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("bookmarkButtonClicked"))}},{key:"title",get:function(){return"".concat("hollow"===this.state?"Add":"Remove"," bookmark")}},{key:"render",value:function(){var e=this.side||"right";return(0,r.qy)(pr||(pr=br(["\n <button title="," @click="," class=",">\n <icon-bookmark state=","></icon-bookmark>\n </button>\n "])),this.title,this.handleClick,e,this.state)}}],[{key:"styles",get:function(){return(0,r.AH)(fr||(fr=br(["\n button {\n -webkit-appearance: none;\n appearance: none;\n outline: 0;\n border: none;\n padding: 0;\n height: 4rem;\n width: 4rem;\n background: transparent;\n cursor: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 0 16 24' width='16'%3E%3Cg fill='%23333' fill-rule='evenodd'%3E%3Cpath d='m15 0c.5522847 0 1 .44771525 1 1v23l-8-5.4545455-8 5.4545455v-23c0-.55228475.44771525-1 1-1zm-2 2h-10c-.51283584 0-.93550716.38604019-.99327227.88337887l-.00672773.11662113v18l6-4.3181818 6 4.3181818v-18c0-.51283584-.3860402-.93550716-.8833789-.99327227z'/%3E%3Cpath d='m8.75 6v2.25h2.25v1.5h-2.25v2.25h-1.5v-2.25h-2.25v-1.5h2.25v-2.25z' fill-rule='nonzero'/%3E%3C/g%3E%3C/svg%3E\"), pointer;\n position: relative;\n }\n button > * {\n display: block;\n position: absolute;\n top: 0.2rem;\n }\n button.left > * {\n left: 0.2rem;\n }\n\n button.right > * {\n right: 0.2rem;\n }\n "])))}},{key:"properties",get:function(){return{side:{type:String},state:{type:String}}}}])}(r.WF);function xr(e){return xr="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},xr(e)}function jr(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,Br(r.key),r)}}function Br(e){var t=function(e){if("object"!=xr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=xr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xr(t)?t:t+""}function Pr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Pr=function(){return!!e})()}function Mr(e){return Mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Mr(e)}function Er(e,t){return Er=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Er(e,t)}customElements.define("bookmark-button",Or),n(4423),n(739),n(8940),n(3362),n(1699),n(5440);var Lr,Ar,Ir,Tr,zr,Dr,_r,$r,Hr,qr=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Mr(t),function(e,t){if(t&&("object"==xr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Pr()?Reflect.construct(t,n||[],Mr(e).constructor):t.apply(e,n))}(this,t)).url="https://archive.org/account/login",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Er(e,t)}(t,e),function(e,t,n){return t&&jr(e.prototype,t),n&&jr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(){return(0,r.qy)(Cr||(Cr=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <p>A free account is required to save and access bookmarks.</p>\n <a class="ia-button link primary" href="','">Log in</a>\n '])),this.url)}}],[{key:"properties",get:function(){return{url:{type:String}}}},{key:"styles",get:function(){return yt}}])}(r.WF);function Rr(e){return Rr="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},Rr(e)}function Fr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Zr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zr(Object(n),!0).forEach(function(t){Nr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Nr(e,t,n){return(t=Xr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ur(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return Vr(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,s=0,l=e,h.n=n,a}};function p(n,r){for(s=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],p=h.p,f=i[2];n>3?(o=f===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(s=0,h.v=r,h.n=i[1]):p<f&&(o=n<3||i[0]>r||r>f)&&(i[4]=n,i[5]=r,h.n=f,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,f),s=u,l=f;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=h.n<0)?l:n.call(r,h))!==a)break}catch(t){i=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Vr(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Vr(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,Vr(d,"constructor",c),Vr(c,"constructor",l),l.displayName="GeneratorFunction",Vr(c,o,"GeneratorFunction"),Vr(d),Vr(d,o,"Generator"),Vr(d,r,function(){return this}),Vr(d,"toString",function(){return"[object Generator]"}),(Ur=function(){return{w:i,m:h}})()}function Vr(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Vr=function(e,t,n,r){function i(t,n){Vr(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))},Vr(e,t,n,r)}function Gr(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function Jr(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){Gr(i,r,o,a,s,"next",e)}function s(e){Gr(i,r,o,a,s,"throw",e)}a(void 0)})}}function Yr(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,Xr(r.key),r)}}function Xr(e){var t=function(e){if("object"!=Rr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Rr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rr(t)?t:t+""}function Qr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Qr=function(){return!!e})()}function Kr(e){return Kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Kr(e)}function eo(e,t){return eo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eo(e,t)}customElements.define("bookmarks-login",qr);var to,no={endpoint:"/services/bookmarks.php",headers:{"Content-Type":"application/json"},delete:function(e){return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier,"&page_num=").concat(e),{credentials:"same-origin",method:"DELETE",headers:this.headers})},get:function(e){return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier,"&page_num=").concat(e),{credentials:"same-origin",method:"GET",headers:this.headers})},getAll:function(){return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier),{credentials:"same-origin",method:"GET",headers:this.headers})},post:function(e){return this.sendBookmarkData(e,"POST")},put:function(e){return this.sendBookmarkData(e,"POST")},sendBookmarkData:function(e,t){var n={note:e.note,color:e.color};return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier,"&page_num=").concat(e.id),{credentials:"same-origin",method:t,headers:this.headers,body:JSON.stringify({notes:n})})}},ro=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Kr(t),function(e,t){if(t&&("object"==Rr(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,Qr()?Reflect.construct(t,n||[],Kr(e).constructor):t.apply(e,n))}(this,t)).bookmarks=[],e.bookreader={},e.editedBookmark={},e.modal=void 0,e.loginOptions={loginClicked:function(){},loginUrl:""},e.displayMode="bookmarks",e.bookmarkColors=[{id:0,className:"red"},{id:1,className:"blue"},{id:2,className:"green"}],e.defaultColor=e.bookmarkColors[0],e.api=no,e.deleteModalConfig=new ze({title:"Delete Bookmark",headline:"This bookmark contains a note. Deleting it will permanently delete the note. Are you sure?",headerColor:"#194880"}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eo(e,t)}(t,e),function(e,t,n){return t&&Yr(e.prototype,t),n&&Yr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"updated",value:function(e){e.has("displayMode")&&this.updateDisplay(),this.emitBookmarksChanged()}},{key:"setup",value:function(){this.api.identifier=this.getIdentifier(),"login"!==this.displayMode&&(this.fetchUserBookmarks(),this.setBREventListeners())}},{key:"getIdentifier",value:function(){return this.bookreader.bookId!==this.bookreader.subPrefix?"".concat(this.bookreader.bookId,"/").concat(this.bookreader.subPrefix):this.bookreader.bookId}},{key:"updateDisplay",value:function(){"bookmarks"===this.displayMode&&this.fetchUserBookmarks()}},{key:"fetchUserBookmarks",value:(o=Jr(Ur().m(function e(){return Ur().w(function(e){for(;;)switch(e.n){case 0:if(this.api.identifier){e.n=1;break}return e.a(2);case 1:return e.n=2,this.fetchBookmarks();case 2:this.initializeBookmarks();case 3:return e.a(2)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"setBREventListeners",value:function(){var e=this;["3PageViewSelected"].forEach(function(t){window.addEventListener("BookReader:".concat(t),function(t){setTimeout(function(){e.renderBookmarkButtons()},100)})}),["pageChanged","1PageViewSelected","2PageViewSelected"].forEach(function(t){window.addEventListener("BookReader:".concat(t),function(t){setTimeout(function(){e.renderBookmarkButtons(),e.markActiveBookmark()},100)})}),["zoomOut","zoomIn","resize"].forEach(function(t){window.addEventListener("BookReader:".concat(t),function(){e.renderBookmarkButtons()})})}},{key:"initializeBookmarks",value:function(){this.renderBookmarkButtons(),this.markActiveBookmark(!0),this.emitBookmarksChanged()}},{key:"formatBookmark",value:function(e){var n=e.leafNum,r=void 0===n?"":n,o=e.notes,i=void 0===o?{}:o,a=i.note,s=void 0===a?"":a,l=i.color,c={note:s,color:this.getBookmarkColor(l)?l:this.defaultColor.id},u=t.formatPage(this.bookreader.book.getPageNum(r)),d=this.bookreader.book.getPageURI("".concat(r).replace(/\D/g,""),32);return Wr(Wr({},c),{},{id:r,leafNum:r,page:u,thumbnail:d})}},{key:"fetchBookmarks",value:(n=Jr(Ur().m(function e(){var t,n,r,o,i,a,s,l,c,u,d=this;return Ur().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.api.getAll().then(function(e){return e.text()});case 1:t=e.v;try{n=JSON.parse(t)}catch(e){n={error:e.message}}return o=(r=n).success,i=r.error,a=void 0===i?"Something happened while fetching bookmarks.":i,s=r.value,l=void 0===s?[]:s,o||null===(c=console)||void 0===c||c.warn("Error fetching bookmarks",a),u={},Object.keys(l).forEach(function(e){var t=l[e],n=parseInt(e,10),r=d.formatBookmark(Wr(Wr({},t),{},{leafNum:n}));u[e]=r}),this.bookmarks=u,e.a(2,u)}},e,this)})),function(){return n.apply(this,arguments)})},{key:"emitBookmarksChanged",value:function(){this.dispatchEvent(new CustomEvent("bookmarksChanged",{bubbles:!0,composed:!0,detail:{bookmarks:this.bookmarks}}))}},{key:"emitBookmarkButtonClicked",value:function(){this.dispatchEvent(new CustomEvent("bookmarkButtonClicked",{bubbles:!0,composed:!0,detail:{editedBookmark:this.editedBookmark}}))}},{key:"bookmarkButtonClicked",value:function(e){this.getBookmark(e)?this.confirmDeletion(e):this.createBookmark(e)}},{key:"renderBookmarkButtons",value:function(){var e=this;this.bookreader.$(".BRpagecontainer").not(".BRemptypage").get().forEach(function(t){var n=t.querySelector(".bookmark-button");n&&n.remove();var o=+t.classList.value.match(/pagediv\d+/)[0].replace(/\D/g,""),i=e.getBookmark(o),a=i?"filled":"hollow";if(e.bookreader.book.getPage(o).isViewable){var s=document.createElement("div");["mousedown","mouseup"].forEach(function(e){s.addEventListener(e,function(e){return e.stopPropagation()})}),s.classList.add("bookmark-button",a),i&&s.classList.add(e.getBookmarkColor(i.color));var l="L"===t.getAttribute("data-side")&&e.bookreader.mode===e.bookreader.constMode2up?"left":"right";(0,r.XX)((0,r.qy)(Lr||(Lr=Fr(["\n <bookmark-button\n @bookmarkButtonClicked=","\n state=","\n side=","\n ></bookmark-button>"])),function(){return e.bookmarkButtonClicked(o)},a,l),s),t.appendChild(s)}})}},{key:"markActiveBookmark",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.bookreader,n=t.mode,r=t.constMode2up,o=t.constModeThumb,i=this.bookreader.currentIndex();if(n!==o){if(n===r&&this.bookreader.displayedIndices.includes(+this.activeBookmarkID))return;this.bookmarks[i]?this.activeBookmarkID=i:this.activeBookmarkID=""}else{var a=this.bookmarks[i];e&&a&&(this.activeBookmarkID=i)}}},{key:"bookmarkEdited",value:function(e){var t=e.detail,n=t.bookmark.id===this.editedBookmark.id;this.editedBookmark=n?{}:t.bookmark}},{key:"getBookmark",value:function(e){return this.bookmarks[e]}},{key:"getBookmarkColor",value:function(e){var t;return null===(t=this.bookmarkColors.find(function(t){return t.id===e}))||void 0===t?void 0:t.className}},{key:"addBookmark",value:function(){var e=this.bookreader.currentIndex();if(this.bookreader.mode===this.bookreader.constMode2up){var t=this.bookreader.displayedIndices;e=t[t.length-1]}this.createBookmark(e)}},{key:"createBookmark",value:function(e){var t=this.getBookmark(e);if(t)return this.bookmarkEdited({detail:{bookmark:t}}),void this.emitBookmarkButtonClicked();this.editedBookmark=this.formatBookmark({leafNum:e}),this.api.post(this.editedBookmark),this.bookmarks[e]=this.editedBookmark,this.activeBookmarkID=e,this.disableAddBookmarkButton=!0,this.renderBookmarkButtons(),this.emitBookmarkButtonClicked()}},{key:"bookmarkSelected",value:function(e){var t=e.detail.bookmark.leafNum;this.bookreader.jumpToPage("".concat(this.bookreader.book.getPageNum("".concat(t).replace(/\D/g,"")))),this.activeBookmarkID=t}},{key:"saveBookmark",value:function(e){var t=e.detail,n=this.bookmarks[t.bookmark.id];Object.assign(n,t.bookmark),this.api.put(n),this.editedBookmark={},this.renderBookmarkButtons()}},{key:"confirmDeletion",value:function(e){this.getBookmark(e).note?this.displayDeletionModal(e):this.deleteBookmark({detail:{id:"".concat(e)}})}},{key:"displayDeletionModal",value:function(e){var t=this,n=(0,r.qy)(Ar||(Ar=Fr(["\n <delete-modal-actions\n .deleteAction=","\n .cancelAction=","\n .pageID=","\n ></delete-modal-actions>\n "])),function(){return t.deleteBookmark({detail:{id:"".concat(e)}})},function(){return t.modal.closeModal()},e);this.modal.showModal({config:this.deleteModalConfig,customModalContent:n})}},{key:"deleteBookmark",value:function(e){var t=e.detail,n=t.id,r=this.bookmarks;delete r[n],this.bookmarks=Wr({},r),this.api.delete(t.id),this.editedBookmark={},this.modal.closeModal(),this.renderBookmarkButtons()}},{key:"shouldEnableAddBookmarkButton",get:function(){var e=this.bookreader.mode===this.bookreader.constMode2up?this.bookreader.displayedIndices[this.bookreader.displayedIndices.length-1]:this.bookreader.currentIndex();return!!this.getBookmark(e)}},{key:"allowAddingBookmark",get:function(){return this.bookreader.mode!==this.bookreader.constModeThumb}},{key:"addBookmarkButton",get:function(){return(0,r.qy)(Ir||(Ir=Fr(['\n <button\n class="ia-button primary"\n tabindex="-1"\n ?disabled=',"\n @click=",">\n Add bookmark\n </button>\n "])),this.shouldEnableAddBookmarkButton,this.addBookmark)}},{key:"bookmarksList",get:function(){return(0,r.qy)(Tr||(Tr=Fr(["\n <ia-bookmarks-list\n @bookmarkEdited=","\n @bookmarkSelected=","\n @saveBookmark=","\n @deleteBookmark=","\n .editedBookmark=","\n .bookmarks=","\n .activeBookmarkID=","\n .bookmarkColors=","\n .defaultBookmarkColor=",">\n </ia-bookmarks-list>\n "])),this.bookmarkEdited,this.bookmarkSelected,this.saveBookmark,this.deleteBookmark,this.editedBookmark,Wr({},this.bookmarks),this.activeBookmarkID,this.bookmarkColors,this.defaultColor)}},{key:"bookmarkHelperMessage",get:function(){return(0,r.qy)(zr||(zr=Fr(["<p>Please use 1up or 2up view modes to add bookmark.</p>"])))}},{key:"render",value:function(){var e=this,t=(0,r.qy)(Dr||(Dr=Fr(["\n ","\n ","\n "])),this.bookmarksList,this.allowAddingBookmark?this.addBookmarkButton:this.bookmarkHelperMessage);return(0,r.qy)(_r||(_r=Fr(['\n <section class="bookmarks">\n ',"\n </section>\n "])),"login"===this.displayMode?(0,r.qy)($r||($r=Fr(["<bookmarks-login\n @click=","\n .url=","></bookmarks-login>"])),function(){return e.loginOptions.loginClicked()},this.loginOptions.loginUrl):t)}}],[{key:"properties",get:function(){return{activeBookmarkID:{type:String},bookmarks:{type:Array},bookreader:{type:Object},displayMode:{type:String},editedBookmark:{type:Object},deleteModalConfig:{type:Object},modal:{attribute:!1},loginOptions:{type:Object,attribute:!1}}}},{key:"styles",get:function(){var e=(0,r.AH)(Hr||(Hr=Fr(["\n .bookmarks {\n height: 100%;\n overflow: hidden;\n padding-bottom: 20px;\n }\n\n .list ia-bookmark-edit {\n display: none;\n }\n\n .edit ia-bookmarks-list {\n display: none;\n }\n "])));return[yt,e]}},{key:"formatPage",value:function(e){return isNaN(+e)?"(".concat(e.replace(/\D/g,""),")"):e}}]);var n,o}(r.WF);customElements.define("ia-bookmarks",ro);var oo,io,ao,so,lo,co=(0,r.AH)(to||(to=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n .blue {\n --iconFillColor: var(--blueBookmarkColor, #0023f5);\n }\n\n .red {\n --iconFillColor: var(--redBookmarkColor, #eb3223);\n }\n\n .green {\n --iconFillColor: var(--greenBookmarkColor, #75ef4c);\n }\n"])));function uo(e){return uo="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},uo(e)}function ho(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function po(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,fo(r.key),r)}}function fo(e){var t=function(e){if("object"!=uo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=uo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==uo(t)?t:t+""}function mo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(mo=function(){return!!e})()}function vo(e){return vo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vo(e)}function bo(e,t){return bo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bo(e,t)}var yo=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=vo(t),function(e,t){if(t&&("object"==uo(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,mo()?Reflect.construct(t,n||[],vo(e).constructor):t.apply(e,n))}(this,t)).bookmark={},e.bookmarkColors=[],e.renderHeader=!1,e.showBookmark=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bo(e,t)}(t,e),function(e,t,n){return t&&po(e.prototype,t),n&&po(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"emitSaveEvent",value:function(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("saveBookmark",{detail:{bookmark:this.bookmark}}))}},{key:"emitDeleteEvent",value:function(){this.dispatchEvent(new CustomEvent("deleteBookmark",{detail:{id:this.bookmark.id}}))}},{key:"emitColorChangedEvent",value:function(e){this.dispatchEvent(new CustomEvent("bookmarkColorChanged",{detail:{bookmarkId:this.bookmark.id,colorId:e}}))}},{key:"changeColorTo",value:function(e){this.bookmark.color=e,this.emitColorChangedEvent(e)}},{key:"updateNote",value:function(e){this.bookmark.note=e.currentTarget.value}},{key:"bookmarkColor",value:function(e){var t=this;return(0,r.qy)(oo||(oo=ho(['\n <li>\n <input type="radio" name="color" id="color_','" .value='," @change="," ?checked=",'>\n <label for="color_','">\n <icon-bookmark class=',"></icon-bookmark>\n </label>\n </li>\n "])),e.id,e.id,function(){return t.changeColorTo(e.id)},this.bookmark.color===e.id,e.id,e.className)}},{key:"bookmarkTemplate",get:function(){return(0,r.qy)(io||(io=ho(['\n <div class="bookmark">\n <img src='," />\n <h4>Page ","</h4>\n </div>\n "])),this.bookmark.thumbnail,this.bookmark.page)}},{key:"render",value:function(){return(0,r.qy)(ao||(ao=ho(["\n ","\n ",'\n <form action="" method="put" @submit=','>\n <fieldset>\n <label for="note">Note <small>(optional)</small></label>\n <textarea rows="4" cols="80" name="note" id="note" @change=',">",'</textarea>\n <label for="color">Bookmark color</label>\n <ul>\n ','\n </ul>\n <div class="actions">\n <button type="button" class="ia-button cancel" @click=','>Delete</button>\n <input class="ia-button" type="submit" value="Save">\n </div>\n </fieldset>\n </form>\n '])),this.renderHeader?t.headerSection:r.s6,this.showBookmark?this.bookmarkTemplate:r.s6,this.emitSaveEvent,this.updateNote,this.bookmark.note,Pe(this.bookmarkColors,function(e){return e.id},this.bookmarkColor.bind(this)),this.emitDeleteEvent)}}],[{key:"properties",get:function(){return{bookmark:{type:Object},bookmarkColors:{type:Array},renderHeader:{type:Boolean},showBookmark:{type:Boolean}}}},{key:"headerSection",get:function(){return(0,r.qy)(so||(so=ho(["<header>\n <h3>Edit Bookmark</h3>\n </header>"])))}},{key:"styles",get:function(){var e=(0,r.AH)(lo||(lo=ho(['\n :host {\n display: block;\n padding: 0 1rem 2rem 1rem;\n color: var(--primaryTextColor);\n }\n\n small {\n font-style: italic;\n }\n\n .bookmark {\n display: grid;\n grid-template-columns: 37px 1fr;\n grid-gap: 0 1rem;\n align-items: center;\n }\n\n h4 {\n margin: 0;\n font-size: 1.4rem;\n }\n\n fieldset {\n padding: 2rem 0 0 0;\n border: none;\n }\n\n label {\n display: block;\n font-weight: bold;\n }\n\n p {\n padding: 0;\n margin: .5rem 0;\n font-size: 1.2rem;\n line-height: 120%;\n }\n\n textarea {\n width: 100%;\n margin-bottom: 2rem;\n box-sizing: border-box;\n font: normal 1.4rem "Helvetica Neue", Helvetica, Arial, sans-serif;\n resize: vertical;\n }\n\n ul {\n display: grid;\n grid-template-columns: repeat(3, auto);\n grid-gap: 0 2rem;\n justify-content: start;\n padding: 1rem 0 0 0;\n margin: 0 0 2rem 0;\n list-style: none;\n }\n\n li input {\n display: none;\n }\n\n li label {\n display: block;\n min-width: 50px;\n padding-top: .4rem;\n text-align: center;\n border: 1px solid transparent;\n border-radius: 4px;\n cursor: pointer;\n }\n\n li input:checked + label {\n border-color: var(--primaryTextColor);\n }\n\n input[type="submit"] {\n background: var(--primaryCTAFill);\n border-color: var(--primaryCTABorder);\n }\n\n button {\n background: var(--primaryErrorCTAFill);\n border-color: var(--primaryErrorCTABorder);\n }\n\n .button {\n -webkit-appearance: none;\n appearance: none;\n padding: .5rem 1rem;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .actions {\n display: grid;\n grid-template-columns: auto auto;\n grid-gap: 0 1rem;\n justify-items: stretch;\n }\n '])));return[yt,co,e]}}])}(r.WF);customElements.define("ia-bookmark-edit",yo),n(6910);var go,ko,wo,So,Co,Oo,xo,jo,Bo=r.qy`
1735
+ `}render(){return Hn}}function Rn(e){return Rn="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},Rn(e)}function Fn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Zn(e){return function(e){if(Array.isArray(e))return Wn(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Wn(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)?Wn(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wn(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 Nn(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,Vn(r.key),r)}}function Vn(e){var t=function(e){if("object"!=Rn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Rn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rn(t)?t:t+""}function Un(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Un=function(){return!!e})()}function Gn(e){return Gn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gn(e)}function Jn(e,t){return Jn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jn(e,t)}customElements.define("ia-icon-magnify-plus",qn);var Yn,Xn,Qn=function(e){return"visualAdjustment".concat(e)},Kn={optionChange:Qn("OptionChanged"),zoomIn:Qn("ZoomIn"),zoomOut:Qn("ZoomOut")},er=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Gn(t),function(e,t){if(t&&("object"==Rn(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,Un()?Reflect.construct(t,n||[],Gn(e).constructor):t.apply(e,n))}(this,t)).activeCount=0,e.options=[],e.renderHeader=!1,e.showZoomControls=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jn(e,t)}(t,e),function(e,t,n){return t&&Nn(e.prototype,t),n&&Nn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"firstUpdated",value:function(){this.activeCount=this.activeOptions.length,this.emitOptionChangedEvent()}},{key:"activeOptions",get:function(){return this.options.reduce(function(e,t){return t.active?[].concat(Zn(e),[t.id]):e},[])}},{key:"prepareEventDetails",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return{options:this.options,activeCount:this.activeCount,changedOptionId:e}}},{key:"emitOptionChangedEvent",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=this.prepareEventDetails(e);this.dispatchEvent(new CustomEvent(Kn.optionChange,{bubbles:!0,composed:!0,detail:t}))}},{key:"emitZoomIn",value:function(){this.dispatchEvent(new CustomEvent(Kn.zoomIn))}},{key:"emitZoomOut",value:function(){this.dispatchEvent(new CustomEvent(Kn.zoomOut))}},{key:"changeActiveStateFor",value:function(e){var t=Zn(this.options),n=t.find(function(t){return t.id===e});if(n.active=!n.active,this.options=t,this.activeCount=this.activeOptions.length,this.emitOptionChangedEvent(n.id),n.active&&void 0!==n.value){var r=this.shadowRoot.querySelector('input[name="'.concat(n.id,'_range"]'));requestAnimationFrame(function(){null==r||r.focus()})}}},{key:"setRangeValue",value:function(e,t){var n=Zn(this.options);n.find(function(t){return t.id===e}).value=t,this.options=Zn(n)}},{key:"rangeSlider",value:function(e){var t=this;return(0,r.qy)(An||(An=Fn(["\n <label class=",'>\n <span class="sr-only">','</span>\n <input\n type="range"\n name="','_range"\n min=',"\n max=","\n step=","\n .value=","\n aria-valuetext=","\n @input=","\n @change=",'\n />\n <span aria-hidden="true">',"%</span>\n </label>\n "])),"range".concat(e.active?" visible":""),e.name,e.id,e.min||0,e.max||100,e.step||1,e.value,"".concat(e.value,"%"),function(n){return t.setRangeValue(e.id,n.target.value)},function(){return t.emitOptionChangedEvent()},e.value)}},{key:"adjustmentCheckbox",value:function(e){var t=this;return(0,r.qy)(In||(In=Fn(['\n <div\n class="adjustment-option ','">\n <label class="checkbox-label">\n ','\n <input\n type="checkbox"\n @change=',"\n ?checked=","\n />\n </label>\n ","\n </div>\n "])),m({active:e.active,"has-range":void 0!==e.value}),e.name,function(){return t.changeActiveStateFor(e.id)},e.active,void 0!==e.value?this.rangeSlider(e):r.s6)}},{key:"headerSection",get:function(){var e=this.activeCount?(0,r.qy)(_n||(_n=Fn(["<p>("," active)</p>"])),this.activeCount):r.s6,t=(0,r.qy)(zn||(zn=Fn(["<header>\n <h3>Visual adjustments</h3>\n ","\n </header>"])),e);return this.renderHeader?t:r.s6}},{key:"zoomControls",get:function(){return(0,r.qy)(Tn||(Tn=Fn(['\n <h4>Adjust zoom</h4>\n <button class="zoom_out" @click=',' title="Zoom out" aria-label="Zoom out">\n <ia-icon-magnify-minus aria-hidden="true" role="presentation"></ia-icon-magnify-minus>\n </button>\n <button class="zoom_in" @click=',' title="Zoom in" aria-label="Zoom in">\n <ia-icon-magnify-plus aria-hidden="true" role="presentation"></ia-icon-magnify-plus>\n </button>\n '])),this.emitZoomOut,this.emitZoomIn)}},{key:"render",value:function(){return(0,r.qy)(Dn||(Dn=Fn(["\n ","\n ","\n ","\n "])),this.headerSection,qe(this.options,function(e){return e.id},this.adjustmentCheckbox.bind(this)),this.showZoomControls?this.zoomControls:r.s6)}}],[{key:"properties",get:function(){return{activeCount:{type:Number},options:{type:Array},renderHeader:{type:Boolean},showZoomControls:{type:Boolean}}}},{key:"styles",get:function(){return(0,r.AH)($n||($n=Fn(['\n :host {\n display: block;\n height: 100%;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\n padding: 10px 10px 0 0;\n }\n\n header {\n display: flex;\n align-items: baseline;\n }\n\n h3 {\n padding: 0;\n margin: 0 1rem 0 0;\n font-size: 1.6rem;\n }\n\n header p {\n padding: 0;\n margin: 0;\n font-size: 1.2rem;\n font-weight: bold;\n font-style: italic;\n }\n\n .adjustment-option {\n border: 2px solid transparent;\n border-radius: 4px;\n margin-bottom: 4px;\n }\n .adjustment-option.has-range.active {\n border: 2px solid rgba(255, 255, 255, 0.2);\n }\n\n .checkbox-label {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-size: 1.4rem;\n font-weight: bold;\n cursor: pointer;\n padding: 6px 8px;\n transition: background-color 0.2s;\n border-radius: inherit;\n }\n .checkbox-label:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n .adjustment-option.has-range.active > .checkbox-label {\n border-radius: 4px 4px 0 0;\n }\n\n [type="checkbox"] {\n transform: scale(1.5);\n }\n\n .range {\n display: none;\n padding: 10px;\n align-items: center;\n gap: 10px;\n }\n .range.visible {\n display: flex;\n }\n .range input[type="range"] {\n flex: 1;\n }\n\n h4 {\n padding: 1rem 0;\n margin: 0;\n font-size: 1.4rem;\n }\n\n button {\n -webkit-appearance: none;\n appearance: none;\n border: none;\n background: transparent;\n cursor: pointer;\n --iconFillColor: var(--primaryTextColor);\n --iconStrokeColor: var(--primaryTextColor);\n height: 4rem;\n width: 4rem;\n transition: background-color 0.2s;\n border-radius: 4px;\n }\n\n button:hover {\n background-color: rgba(255, 255, 255, 0.1);\n }\n\n .sr-only {\n position: absolute !important;\n width: 1px !important;\n height: 1px !important;\n padding: 0 !important;\n margin: -1px !important;\n overflow: hidden !important;\n clip: rect(0 0 0 0) !important;\n white-space: nowrap !important;\n border: 0 !important;\n }\n'])))}}])}(r.WF);function tr(e){return tr="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},tr(e)}function nr(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 rr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function or(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,ir(r.key),r)}}function ir(e){var t=function(e){if("object"!=tr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=tr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tr(t)?t:t+""}customElements.define("ia-book-visual-adjustments",er);var ar,sr,lr=[{id:"brightness",name:"Adjust brightness",active:!1,min:0,max:200,step:1,value:120},{id:"contrast",name:"Adjust contrast",active:!1,min:0,max:200,step:1,value:120},{id:"invert",name:"Invert colors (dark mode)",active:!1},{id:"grayscale",name:"Convert to grayscale",active:!1}],cr=function(){return function(e,t){return t&&or(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.onProviderChange,o=t.bookreader;this.onProviderChange=n,this.bookContainer=o.refs.$brContainer,this.bookreader=o,this.onAdjustmentChange=this.onAdjustmentChange.bind(this),this.optionUpdateComplete=this.optionUpdateComplete.bind(this),this.updateOptionsCount=this.updateOptionsCount.bind(this),this.onZoomIn=this.onZoomIn.bind(this),this.onZoomOut=this.onZoomOut.bind(this),this.activeCount=0,this.icon=(0,r.qy)(Yn||(Yn=rr(['<ia-icon-visual-adjustment aria-hidden="true" role="presentation" style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-visual-adjustment>']))),this.label="Visual Adjustments",this.menuDetails=this.updateOptionsCount(),this.id="visualAdjustments",this.component=(0,r.qy)(Xn||(Xn=rr(["\n <ia-book-visual-adjustments\n .options=","\n @visualAdjustmentOptionChanged=","\n @visualAdjustmentZoomIn=","\n @visualAdjustmentZoomOut=","\n ></ia-book-visual-adjustments>\n "])),lr,this.onAdjustmentChange,this.onZoomIn,this.onZoomOut)},[{key:"onZoomIn",value:function(){this.bookreader.zoom(1)}},{key:"onZoomOut",value:function(){this.bookreader.zoom(-1)}},{key:"onAdjustmentChange",value:function(e){var t=e.detail,n={brightness:function(e){return"brightness(".concat(e,"%)")},contrast:function(e){return"contrast(".concat(e,"%)")},grayscale:function(){return"grayscale(100%)"},invert:function(){return"invert(100%)"}},r=t.options.reduce(function(e,t){var r="".concat(t.active?n[t.id](t.value):"");return r?[].concat(function(e){return function(e){if(Array.isArray(e))return nr(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return nr(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)?nr(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(e),[r]):e},[]).join(" ");this.bookContainer.css("filter",r),this.optionUpdateComplete(e)}},{key:"optionUpdateComplete",value:function(e){this.activeCount=e.detail.activeCount,this.updateOptionsCount(e),this.onProviderChange()}},{key:"updateOptionsCount",value:function(){this.menuDetails="(".concat(this.activeCount," active)")}}])}();function ur(e){return ur="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},ur(e)}function dr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function hr(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,pr(r.key),r)}}function pr(e){var t=function(e){if("object"!=ur(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ur(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ur(t)?t:t+""}function fr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(fr=function(){return!!e})()}function mr(e){return mr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},mr(e)}function vr(e,t){return vr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},vr(e,t)}var br,yr,gr=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=mr(t),function(e,t){if(t&&("object"==ur(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,fr()?Reflect.construct(t,n||[],mr(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vr(e,t)}(t,e),function(e,t,n){return t&&hr(e.prototype,t),n&&hr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(){var e=this;return(0,r.qy)(ar||(ar=dr(['\n <div>\n <button class="delete" @click=',">Delete</button>\n <button @click=",">Cancel</button>\n </div>\n "])),function(){return e.deleteAction({detail:{id:"".concat(e.pageID)}})},function(){return e.cancelAction()})}}],[{key:"styles",get:function(){return(0,r.AH)(sr||(sr=dr(['\n div {\n display: flex;\n justify-content: center;\n padding-top: 2rem;\n }\n\n button {\n appearance: none;\n padding: 0.5rem 1rem;\n margin: 0 .5rem;\n box-sizing: border-box;\n font: 1.3rem "Helvetica Neue", Helvetica, Arial, sans-serif;\n color: var(--primaryTextColor);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n background: var(--primaryCTAFill);\n }\n\n .delete {\n background: var(--primaryErrorCTAFill);\n }\n '])))}},{key:"properties",get:function(){return{cancelAction:{type:Function},deleteAction:{type:Function},pageID:{type:String}}}}])}(r.WF);function kr(e){return kr="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},kr(e)}function wr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Sr(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,Cr(r.key),r)}}function Cr(e){var t=function(e){if("object"!=kr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=kr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==kr(t)?t:t+""}function Or(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Or=function(){return!!e})()}function xr(e){return xr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},xr(e)}function Mr(e,t){return Mr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mr(e,t)}customElements.define("delete-modal-actions",gr);var jr,Br=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=xr(t),function(e,t){if(t&&("object"==kr(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,Or()?Reflect.construct(t,n||[],xr(e).constructor):t.apply(e,n))}(this,t)).state="hollow",e.side=void 0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Mr(e,t)}(t,e),function(e,t,n){return t&&Sr(e.prototype,t),n&&Sr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"handleClick",value:function(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("bookmarkButtonClicked"))}},{key:"title",get:function(){return"".concat("hollow"===this.state?"Add":"Remove"," bookmark")}},{key:"render",value:function(){var e=this.side||"right";return(0,r.qy)(br||(br=wr(["\n <button title="," @click="," class=",">\n <icon-bookmark state=","></icon-bookmark>\n </button>\n "])),this.title,this.handleClick,e,this.state)}}],[{key:"styles",get:function(){return(0,r.AH)(yr||(yr=wr(["\n button {\n -webkit-appearance: none;\n appearance: none;\n outline: 0;\n border: none;\n padding: 0;\n height: 4rem;\n width: 4rem;\n background: transparent;\n cursor: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24' viewBox='0 0 16 24' width='16'%3E%3Cg fill='%23333' fill-rule='evenodd'%3E%3Cpath d='m15 0c.5522847 0 1 .44771525 1 1v23l-8-5.4545455-8 5.4545455v-23c0-.55228475.44771525-1 1-1zm-2 2h-10c-.51283584 0-.93550716.38604019-.99327227.88337887l-.00672773.11662113v18l6-4.3181818 6 4.3181818v-18c0-.51283584-.3860402-.93550716-.8833789-.99327227z'/%3E%3Cpath d='m8.75 6v2.25h2.25v1.5h-2.25v2.25h-1.5v-2.25h-2.25v-1.5h2.25v-2.25z' fill-rule='nonzero'/%3E%3C/g%3E%3C/svg%3E\"), pointer;\n position: relative;\n }\n button > * {\n display: block;\n position: absolute;\n top: 0.2rem;\n }\n button.left > * {\n left: 0.2rem;\n }\n\n button.right > * {\n right: 0.2rem;\n }\n "])))}},{key:"properties",get:function(){return{side:{type:String},state:{type:String}}}}])}(r.WF);function Pr(e){return Pr="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},Pr(e)}function Er(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,Lr(r.key),r)}}function Lr(e){var t=function(e){if("object"!=Pr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Pr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pr(t)?t:t+""}function Ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ar=function(){return!!e})()}function Ir(e){return Ir=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ir(e)}function _r(e,t){return _r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_r(e,t)}customElements.define("bookmark-button",Br),n(4423),n(739),n(8940),n(3362),n(1699),n(5440);var zr,Tr,Dr,$r,Hr,qr,Rr,Fr,Zr,Wr=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Ir(t),function(e,t){if(t&&("object"==Pr(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,Ar()?Reflect.construct(t,n||[],Ir(e).constructor):t.apply(e,n))}(this,t)).url="https://archive.org/account/login",e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_r(e,t)}(t,e),function(e,t,n){return t&&Er(e.prototype,t),n&&Er(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(){return(0,r.qy)(jr||(jr=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <p>A free account is required to save and access bookmarks.</p>\n <a class="ia-button link primary" href="','">Log in</a>\n '])),this.url)}}],[{key:"properties",get:function(){return{url:{type:String}}}},{key:"styles",get:function(){return Et}}])}(r.WF);function Nr(e){return Nr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nr(e)}function Vr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ur(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ur(Object(n),!0).forEach(function(t){Jr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ur(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Jr(e,t,n){return(t=to(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yr(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return Xr(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,s=0,l=e,h.n=n,a}};function p(n,r){for(s=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],p=h.p,f=i[2];n>3?(o=f===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(s=0,h.v=r,h.n=i[1]):p<f&&(o=n<3||i[0]>r||r>f)&&(i[4]=n,i[5]=r,h.n=f,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,f),s=u,l=f;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=h.n<0)?l:n.call(r,h))!==a)break}catch(t){i=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(Xr(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,Xr(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,Xr(d,"constructor",c),Xr(c,"constructor",l),l.displayName="GeneratorFunction",Xr(c,o,"GeneratorFunction"),Xr(d),Xr(d,o,"Generator"),Xr(d,r,function(){return this}),Xr(d,"toString",function(){return"[object Generator]"}),(Yr=function(){return{w:i,m:h}})()}function Xr(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Xr=function(e,t,n,r){function i(t,n){Xr(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))},Xr(e,t,n,r)}function Qr(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function Kr(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){Qr(i,r,o,a,s,"next",e)}function s(e){Qr(i,r,o,a,s,"throw",e)}a(void 0)})}}function eo(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,to(r.key),r)}}function to(e){var t=function(e){if("object"!=Nr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Nr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Nr(t)?t:t+""}function no(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(no=function(){return!!e})()}function ro(e){return ro=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ro(e)}function oo(e,t){return oo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},oo(e,t)}customElements.define("bookmarks-login",Wr);var io,ao={endpoint:"/services/bookmarks.php",headers:{"Content-Type":"application/json"},delete:function(e){return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier,"&page_num=").concat(e),{credentials:"same-origin",method:"DELETE",headers:this.headers})},get:function(e){return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier,"&page_num=").concat(e),{credentials:"same-origin",method:"GET",headers:this.headers})},getAll:function(){return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier),{credentials:"same-origin",method:"GET",headers:this.headers})},post:function(e){return this.sendBookmarkData(e,"POST")},put:function(e){return this.sendBookmarkData(e,"POST")},sendBookmarkData:function(e,t){var n={note:e.note,color:e.color};return fetch("".concat(this.endpoint,"?identifier=").concat(this.identifier,"&page_num=").concat(e.id),{credentials:"same-origin",method:t,headers:this.headers,body:JSON.stringify({notes:n})})}},so=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=ro(t),function(e,t){if(t&&("object"==Nr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,no()?Reflect.construct(t,n||[],ro(e).constructor):t.apply(e,n))}(this,t)).bookmarks=[],e.bookreader={},e.editedBookmark={},e.modal=void 0,e.loginOptions={loginClicked:function(){},loginUrl:""},e.displayMode="bookmarks",e.bookmarkColors=[{id:0,className:"red"},{id:1,className:"blue"},{id:2,className:"green"}],e.defaultColor=e.bookmarkColors[0],e.api=ao,e.deleteModalConfig=new Ue({title:"Delete Bookmark",headline:"This bookmark contains a note. Deleting it will permanently delete the note. Are you sure?",headerColor:"#194880"}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&oo(e,t)}(t,e),function(e,t,n){return t&&eo(e.prototype,t),n&&eo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"updated",value:function(e){e.has("displayMode")&&this.updateDisplay(),this.emitBookmarksChanged()}},{key:"setup",value:function(){this.api.identifier=this.getIdentifier(),"login"!==this.displayMode&&(this.fetchUserBookmarks(),this.setBREventListeners())}},{key:"getIdentifier",value:function(){return this.bookreader.bookId!==this.bookreader.subPrefix?"".concat(this.bookreader.bookId,"/").concat(this.bookreader.subPrefix):this.bookreader.bookId}},{key:"updateDisplay",value:function(){"bookmarks"===this.displayMode&&this.fetchUserBookmarks()}},{key:"fetchUserBookmarks",value:(o=Kr(Yr().m(function e(){return Yr().w(function(e){for(;;)switch(e.n){case 0:if(this.api.identifier){e.n=1;break}return e.a(2);case 1:return e.n=2,this.fetchBookmarks();case 2:this.initializeBookmarks();case 3:return e.a(2)}},e,this)})),function(){return o.apply(this,arguments)})},{key:"setBREventListeners",value:function(){var e=this;["3PageViewSelected"].forEach(function(t){window.addEventListener("BookReader:".concat(t),function(t){setTimeout(function(){e.renderBookmarkButtons()},100)})}),["pageChanged","1PageViewSelected","2PageViewSelected"].forEach(function(t){window.addEventListener("BookReader:".concat(t),function(t){setTimeout(function(){e.renderBookmarkButtons(),e.markActiveBookmark()},100)})}),["zoomOut","zoomIn","resize"].forEach(function(t){window.addEventListener("BookReader:".concat(t),function(){e.renderBookmarkButtons()})})}},{key:"initializeBookmarks",value:function(){this.renderBookmarkButtons(),this.markActiveBookmark(!0),this.emitBookmarksChanged()}},{key:"formatBookmark",value:function(e){var n=e.leafNum,r=void 0===n?"":n,o=e.notes,i=void 0===o?{}:o,a=i.note,s=void 0===a?"":a,l=i.color,c={note:s,color:this.getBookmarkColor(l)?l:this.defaultColor.id},u=t.formatPage(this.bookreader.book.getPageNum(r)),d=this.bookreader.book.getPageURI("".concat(r).replace(/\D/g,""),32);return Gr(Gr({},c),{},{id:r,leafNum:r,page:u,thumbnail:d})}},{key:"fetchBookmarks",value:(n=Kr(Yr().m(function e(){var t,n,r,o,i,a,s,l,c,u,d=this;return Yr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.api.getAll().then(function(e){return e.text()});case 1:t=e.v;try{n=JSON.parse(t)}catch(e){n={error:e.message}}return o=(r=n).success,i=r.error,a=void 0===i?"Something happened while fetching bookmarks.":i,s=r.value,l=void 0===s?[]:s,o||null===(c=console)||void 0===c||c.warn("Error fetching bookmarks",a),u={},Object.keys(l).forEach(function(e){var t=l[e],n=parseInt(e,10),r=d.formatBookmark(Gr(Gr({},t),{},{leafNum:n}));u[e]=r}),this.bookmarks=u,e.a(2,u)}},e,this)})),function(){return n.apply(this,arguments)})},{key:"emitBookmarksChanged",value:function(){this.dispatchEvent(new CustomEvent("bookmarksChanged",{bubbles:!0,composed:!0,detail:{bookmarks:this.bookmarks}}))}},{key:"emitBookmarkButtonClicked",value:function(){this.dispatchEvent(new CustomEvent("bookmarkButtonClicked",{bubbles:!0,composed:!0,detail:{editedBookmark:this.editedBookmark}}))}},{key:"bookmarkButtonClicked",value:function(e){this.getBookmark(e)?this.confirmDeletion(e):this.createBookmark(e)}},{key:"renderBookmarkButtons",value:function(){var e=this;this.bookreader.$(".BRpagecontainer").not(".BRemptypage").get().forEach(function(t){var n=t.querySelector(".bookmark-button");n&&n.remove();var o=+t.classList.value.match(/pagediv\d+/)[0].replace(/\D/g,""),i=e.getBookmark(o),a=i?"filled":"hollow";if(e.bookreader.book.getPage(o).isViewable){var s=document.createElement("div");["mousedown","mouseup"].forEach(function(e){s.addEventListener(e,function(e){return e.stopPropagation()})}),s.classList.add("bookmark-button",a),i&&s.classList.add(e.getBookmarkColor(i.color));var l="L"===t.getAttribute("data-side")&&e.bookreader.mode===e.bookreader.constMode2up?"left":"right";(0,r.XX)((0,r.qy)(zr||(zr=Vr(["\n <bookmark-button\n @bookmarkButtonClicked=","\n state=","\n side=","\n ></bookmark-button>"])),function(){return e.bookmarkButtonClicked(o)},a,l),s),t.appendChild(s)}})}},{key:"markActiveBookmark",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.bookreader,n=t.mode,r=t.constMode2up,o=t.constModeThumb,i=this.bookreader.currentIndex();if(n!==o){if(n===r&&this.bookreader.displayedIndices.includes(+this.activeBookmarkID))return;this.bookmarks[i]?this.activeBookmarkID=i:this.activeBookmarkID=""}else{var a=this.bookmarks[i];e&&a&&(this.activeBookmarkID=i)}}},{key:"bookmarkEdited",value:function(e){var t=e.detail,n=t.bookmark.id===this.editedBookmark.id;this.editedBookmark=n?{}:t.bookmark}},{key:"getBookmark",value:function(e){return this.bookmarks[e]}},{key:"getBookmarkColor",value:function(e){var t;return null===(t=this.bookmarkColors.find(function(t){return t.id===e}))||void 0===t?void 0:t.className}},{key:"addBookmark",value:function(){var e=this.bookreader.currentIndex();if(this.bookreader.mode===this.bookreader.constMode2up){var t=this.bookreader.displayedIndices;e=t[t.length-1]}this.createBookmark(e)}},{key:"createBookmark",value:function(e){var t=this.getBookmark(e);if(t)return this.bookmarkEdited({detail:{bookmark:t}}),void this.emitBookmarkButtonClicked();this.editedBookmark=this.formatBookmark({leafNum:e}),this.api.post(this.editedBookmark),this.bookmarks[e]=this.editedBookmark,this.activeBookmarkID=e,this.disableAddBookmarkButton=!0,this.renderBookmarkButtons(),this.emitBookmarkButtonClicked()}},{key:"bookmarkSelected",value:function(e){var t=e.detail.bookmark.leafNum;this.bookreader.jumpToPage("".concat(this.bookreader.book.getPageNum("".concat(t).replace(/\D/g,"")))),this.activeBookmarkID=t}},{key:"saveBookmark",value:function(e){var t=e.detail,n=this.bookmarks[t.bookmark.id];Object.assign(n,t.bookmark),this.api.put(n),this.editedBookmark={},this.renderBookmarkButtons()}},{key:"confirmDeletion",value:function(e){this.getBookmark(e).note?this.displayDeletionModal(e):this.deleteBookmark({detail:{id:"".concat(e)}})}},{key:"displayDeletionModal",value:function(e){var t=this,n=(0,r.qy)(Tr||(Tr=Vr(["\n <delete-modal-actions\n .deleteAction=","\n .cancelAction=","\n .pageID=","\n ></delete-modal-actions>\n "])),function(){return t.deleteBookmark({detail:{id:"".concat(e)}})},function(){return t.modal.closeModal()},e);this.modal.showModal({config:this.deleteModalConfig,customModalContent:n})}},{key:"deleteBookmark",value:function(e){var t=e.detail,n=t.id,r=this.bookmarks;delete r[n],this.bookmarks=Gr({},r),this.api.delete(t.id),this.editedBookmark={},this.modal.closeModal(),this.renderBookmarkButtons()}},{key:"shouldEnableAddBookmarkButton",get:function(){var e=this.bookreader.mode===this.bookreader.constMode2up?this.bookreader.displayedIndices[this.bookreader.displayedIndices.length-1]:this.bookreader.currentIndex();return!!this.getBookmark(e)}},{key:"allowAddingBookmark",get:function(){return this.bookreader.mode!==this.bookreader.constModeThumb}},{key:"addBookmarkButton",get:function(){return(0,r.qy)(Dr||(Dr=Vr(['\n <button\n class="ia-button primary"\n tabindex="-1"\n ?disabled=',"\n @click=",">\n Add bookmark\n </button>\n "])),this.shouldEnableAddBookmarkButton,this.addBookmark)}},{key:"bookmarksList",get:function(){return(0,r.qy)($r||($r=Vr(["\n <ia-bookmarks-list\n @bookmarkEdited=","\n @bookmarkSelected=","\n @saveBookmark=","\n @deleteBookmark=","\n .editedBookmark=","\n .bookmarks=","\n .activeBookmarkID=","\n .bookmarkColors=","\n .defaultBookmarkColor=",">\n </ia-bookmarks-list>\n "])),this.bookmarkEdited,this.bookmarkSelected,this.saveBookmark,this.deleteBookmark,this.editedBookmark,Gr({},this.bookmarks),this.activeBookmarkID,this.bookmarkColors,this.defaultColor)}},{key:"bookmarkHelperMessage",get:function(){return(0,r.qy)(Hr||(Hr=Vr(["<p>Please use 1up or 2up view modes to add bookmark.</p>"])))}},{key:"render",value:function(){var e=this,t=(0,r.qy)(qr||(qr=Vr(["\n ","\n ","\n "])),this.bookmarksList,this.allowAddingBookmark?this.addBookmarkButton:this.bookmarkHelperMessage);return(0,r.qy)(Rr||(Rr=Vr(['\n <section class="bookmarks">\n ',"\n </section>\n "])),"login"===this.displayMode?(0,r.qy)(Fr||(Fr=Vr(["<bookmarks-login\n @click=","\n .url=","></bookmarks-login>"])),function(){return e.loginOptions.loginClicked()},this.loginOptions.loginUrl):t)}}],[{key:"properties",get:function(){return{activeBookmarkID:{type:String},bookmarks:{type:Array},bookreader:{type:Object},displayMode:{type:String},editedBookmark:{type:Object},deleteModalConfig:{type:Object},modal:{attribute:!1},loginOptions:{type:Object,attribute:!1}}}},{key:"styles",get:function(){var e=(0,r.AH)(Zr||(Zr=Vr(["\n .bookmarks {\n height: 100%;\n overflow: hidden;\n padding-bottom: 20px;\n }\n\n .list ia-bookmark-edit {\n display: none;\n }\n\n .edit ia-bookmarks-list {\n display: none;\n }\n "])));return[Et,e]}},{key:"formatPage",value:function(e){return isNaN(+e)?"(".concat(e.replace(/\D/g,""),")"):e}}]);var n,o}(r.WF);customElements.define("ia-bookmarks",so);var lo,co,uo,ho,po,fo=(0,r.AH)(io||(io=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n .blue {\n --iconFillColor: var(--blueBookmarkColor, #0023f5);\n }\n\n .red {\n --iconFillColor: var(--redBookmarkColor, #eb3223);\n }\n\n .green {\n --iconFillColor: var(--greenBookmarkColor, #75ef4c);\n }\n"])));function mo(e){return mo="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},mo(e)}function vo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function bo(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,yo(r.key),r)}}function yo(e){var t=function(e){if("object"!=mo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mo(t)?t:t+""}function go(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(go=function(){return!!e})()}function ko(e){return ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ko(e)}function wo(e,t){return wo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wo(e,t)}var So=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=ko(t),function(e,t){if(t&&("object"==mo(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,go()?Reflect.construct(t,n||[],ko(e).constructor):t.apply(e,n))}(this,t)).bookmark={},e.bookmarkColors=[],e.renderHeader=!1,e.showBookmark=!0,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wo(e,t)}(t,e),function(e,t,n){return t&&bo(e.prototype,t),n&&bo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"emitSaveEvent",value:function(e){e.preventDefault(),this.dispatchEvent(new CustomEvent("saveBookmark",{detail:{bookmark:this.bookmark}}))}},{key:"emitDeleteEvent",value:function(){this.dispatchEvent(new CustomEvent("deleteBookmark",{detail:{id:this.bookmark.id}}))}},{key:"emitColorChangedEvent",value:function(e){this.dispatchEvent(new CustomEvent("bookmarkColorChanged",{detail:{bookmarkId:this.bookmark.id,colorId:e}}))}},{key:"changeColorTo",value:function(e){this.bookmark.color=e,this.emitColorChangedEvent(e)}},{key:"updateNote",value:function(e){this.bookmark.note=e.currentTarget.value}},{key:"bookmarkColor",value:function(e){var t=this;return(0,r.qy)(lo||(lo=vo(['\n <li>\n <input type="radio" name="color" id="color_','" .value='," @change="," ?checked=",'>\n <label for="color_','">\n <icon-bookmark class=',"></icon-bookmark>\n </label>\n </li>\n "])),e.id,e.id,function(){return t.changeColorTo(e.id)},this.bookmark.color===e.id,e.id,e.className)}},{key:"bookmarkTemplate",get:function(){return(0,r.qy)(co||(co=vo(['\n <div class="bookmark">\n <img src='," />\n <h4>Page ","</h4>\n </div>\n "])),this.bookmark.thumbnail,this.bookmark.page)}},{key:"render",value:function(){return(0,r.qy)(uo||(uo=vo(["\n ","\n ",'\n <form action="" method="put" @submit=','>\n <fieldset>\n <label for="note">Note <small>(optional)</small></label>\n <textarea rows="4" cols="80" name="note" id="note" @change=',">",'</textarea>\n <label for="color">Bookmark color</label>\n <ul>\n ','\n </ul>\n <div class="actions">\n <button type="button" class="ia-button cancel" @click=','>Delete</button>\n <input class="ia-button" type="submit" value="Save">\n </div>\n </fieldset>\n </form>\n '])),this.renderHeader?t.headerSection:r.s6,this.showBookmark?this.bookmarkTemplate:r.s6,this.emitSaveEvent,this.updateNote,this.bookmark.note,qe(this.bookmarkColors,function(e){return e.id},this.bookmarkColor.bind(this)),this.emitDeleteEvent)}}],[{key:"properties",get:function(){return{bookmark:{type:Object},bookmarkColors:{type:Array},renderHeader:{type:Boolean},showBookmark:{type:Boolean}}}},{key:"headerSection",get:function(){return(0,r.qy)(ho||(ho=vo(["<header>\n <h3>Edit Bookmark</h3>\n </header>"])))}},{key:"styles",get:function(){var e=(0,r.AH)(po||(po=vo(['\n :host {\n display: block;\n padding: 0 1rem 2rem 1rem;\n color: var(--primaryTextColor);\n }\n\n small {\n font-style: italic;\n }\n\n .bookmark {\n display: grid;\n grid-template-columns: 37px 1fr;\n grid-gap: 0 1rem;\n align-items: center;\n }\n\n h4 {\n margin: 0;\n font-size: 1.4rem;\n }\n\n fieldset {\n padding: 2rem 0 0 0;\n border: none;\n }\n\n label {\n display: block;\n font-weight: bold;\n }\n\n p {\n padding: 0;\n margin: .5rem 0;\n font-size: 1.2rem;\n line-height: 120%;\n }\n\n textarea {\n width: 100%;\n margin-bottom: 2rem;\n box-sizing: border-box;\n font: normal 1.4rem "Helvetica Neue", Helvetica, Arial, sans-serif;\n resize: vertical;\n }\n\n ul {\n display: grid;\n grid-template-columns: repeat(3, auto);\n grid-gap: 0 2rem;\n justify-content: start;\n padding: 1rem 0 0 0;\n margin: 0 0 2rem 0;\n list-style: none;\n }\n\n li input {\n display: none;\n }\n\n li label {\n display: block;\n min-width: 50px;\n padding-top: .4rem;\n text-align: center;\n border: 1px solid transparent;\n border-radius: 4px;\n cursor: pointer;\n }\n\n li input:checked + label {\n border-color: var(--primaryTextColor);\n }\n\n input[type="submit"] {\n background: var(--primaryCTAFill);\n border-color: var(--primaryCTABorder);\n }\n\n button {\n background: var(--primaryErrorCTAFill);\n border-color: var(--primaryErrorCTABorder);\n }\n\n .button {\n -webkit-appearance: none;\n appearance: none;\n padding: .5rem 1rem;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .actions {\n display: grid;\n grid-template-columns: auto auto;\n grid-gap: 0 1rem;\n justify-items: stretch;\n }\n '])));return[Et,fo,e]}}])}(r.WF);customElements.define("ia-bookmark-edit",So),n(6910);var Co,Oo,xo,Mo,jo,Bo,Po,Eo,Lo=r.qy`
1697
1736
  <svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg" aria-labelledby="editPencilTitleID editPencilDescID"><title id="editPencilTitleID">Pencil icon</title><desc id="editPencilDescID">An illustration of a pencil, used to represent an edit action</desc><path class="fill-color" d="m15.6111048 9.3708338-9.52237183 9.5222966-5.14363353 1.0897111c-.42296707.0896082-.83849202-.1806298-.92810097-.6035935-.02266463-.1069795-.02266463-.2175207 0-.3245001l1.08971974-5.1435929 9.52237189-9.52229656zm-10.89310224 5.9110366-2.78094924-.5403869-.67567462 3.166657.83033407.8303275 3.16668096-.6756703zm14.82724244-12.05935921c.6114418.61143705.6055516 1.6086709-.0131615 2.22737904l-2.2405581 2.24054036-4.9820147-4.98197536 2.2405581-2.24054036c.618713-.61870814 1.6159506-.62460252 2.2273925-.01316547z" fill-rule="evenodd"/></svg>
1698
- `;class Po extends r.WF{static get styles(){return r.AH`
1737
+ `;class Ao extends r.WF{static get styles(){return r.AH`
1699
1738
  :host {
1700
1739
  width: var(--iconWidth, 'auto');
1701
1740
  height: var(--iconHeight, 'auto');
@@ -1708,7 +1747,7 @@
1708
1747
  .stroke-color {
1709
1748
  stroke: var(--iconStrokeColor);
1710
1749
  }
1711
- `}render(){return Bo}}function Mo(e){return Mo="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},Mo(e)}function Eo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Lo(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,Ao(r.key),r)}}function Ao(e){var t=function(e){if("object"!=Mo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Mo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mo(t)?t:t+""}function Io(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Io=function(){return!!e})()}function To(e){return To=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},To(e)}function zo(e,t){return zo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},zo(e,t)}customElements.define("ia-icon-edit-pencil",Po);var Do,_o=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=To(t),function(e,t){if(t&&("object"==Mo(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,Io()?Reflect.construct(t,n||[],To(e).constructor):t.apply(e,n))}(this,t)).activeBookmarkID=void 0,e.bookmarkColors=[],e.defaultBookmarkColor={},e.bookmarks={},e.editedBookmark={},e.renderHeader=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&zo(e,t)}(t,e),function(e,t,n){return t&&Lo(e.prototype,t),n&&Lo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"emitEditEvent",value:function(e,t){this.dispatchEvent(new CustomEvent("bookmarkEdited",{detail:{bookmark:t}}))}},{key:"emitSelectedEvent",value:function(e){this.activeBookmarkID=e.id,this.dispatchEvent(new CustomEvent("bookmarkSelected",{detail:{bookmark:e}}))}},{key:"emitSaveBookmark",value:function(e){this.dispatchEvent(new CustomEvent("saveBookmark",{detail:{bookmark:e}}))}},{key:"emitDeleteBookmark",value:function(e){this.dispatchEvent(new CustomEvent("deleteBookmark",{detail:{id:e}}))}},{key:"emitBookmarkColorChanged",value:function(e){var t=e.detail,n=t.bookmarkId,r=t.colorId;this.dispatchEvent(new CustomEvent("bookmarkColorChanged",{detail:{bookmarkId:n,colorId:r}}))}},{key:"emitAddBookmark",value:function(){this.dispatchEvent(new CustomEvent("addBookmark"))}},{key:"editBookmark",value:function(e,t){this.emitEditEvent(e,t),this.editedBookmark=this.editedBookmark===t?{}:t}},{key:"saveBookmark",value:function(e){var t=e.detail.bookmark;this.editedBookmark={},this.emitSaveBookmark(t)}},{key:"deleteBookmark",value:function(e){var t=e.detail.id;this.editedBookmark={},this.emitDeleteBookmark(t)}},{key:"bookmarkColorInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.bookmarkColors.find(function(t){return(null==t?void 0:t.id)===e})}},{key:"bookmarkItem",value:function(e){var t=this,n=this.editedBookmark.id===e.id,o=this.bookmarkColorInfo(e.color).className,i=e.id===this.activeBookmarkID?"active":"";return(0,r.qy)(go||(go=Eo(["\n <li\n @click=",'\n tabindex="0"\n data-pageIndex=','\n >\n <div class="separator"></div>\n <div class="content ','">\n <button\n class="edit"\n @click=','\n title="Edit this bookmark"\n >\n <ia-icon-edit-pencil></ia-icon-edit-pencil>\n </button>\n <h4>\n <icon-bookmark class=',"></icon-bookmark>\n <span> Page ","</span>\n </h4>\n ","\n ","\n </div>\n </li>\n "])),function(){return t.emitSelectedEvent(e)},e.id,i,function(n){return t.editBookmark(n,e)},o,e.page,!n&&e.note?(0,r.qy)(ko||(ko=Eo(["<p>","</p>"])),e.note):r.s6,n?this.editBookmarkComponent:r.s6)}},{key:"editBookmarkComponent",get:function(){return(0,r.qy)(wo||(wo=Eo(["\n <ia-bookmark-edit\n .bookmark=","\n .bookmarkColors=","\n .defaultBookmarkColor=","\n .showBookmark=","\n @saveBookmark=","\n @deleteBookmark=","\n @bookmarkColorChanged=","\n ></ia-bookmark-edit>\n "])),this.editedBookmark,this.bookmarkColors,this.defaultBookmarkColor,!1,this.saveBookmark,this.deleteBookmark,this.emitBookmarkColorChanged)}},{key:"sortBookmarks",value:function(){var e=this;return Object.keys(this.bookmarks).sort(function(e,t){return+e>+t?1:+e<+t?-1:0}).map(function(t){return e.bookmarks[t]})}},{key:"bookmarksCount",get:function(){var e=this.bookmarks.length;return(0,r.qy)(So||(So=Eo(["<small>(",")</small>"])),e)}},{key:"headerSection",get:function(){return(0,r.qy)(Co||(Co=Eo(["<header>\n <h3>\n Bookmarks\n ","\n </h3>\n </header>"])),this.bookmarks.length?this.bookmarksCount:r.s6)}},{key:"bookmarkslist",get:function(){var e=this.sortBookmarks(),t=Pe(e,function(e){return null==e?void 0:e.id},this.bookmarkItem.bind(this));return(0,r.qy)(Oo||(Oo=Eo(["\n <ul>\n ",'\n <div class="separator"></div>\n </ul>\n '])),t)}},{key:"render",value:function(){return(0,r.qy)(xo||(xo=Eo(["\n ","\n ","\n "])),this.renderHeader?this.headerSection:r.s6,Object.keys(this.bookmarks).length?this.bookmarkslist:r.s6)}}],[{key:"properties",get:function(){return{activeBookmarkID:{type:Number},bookmarkColors:{type:Array},defaultBookmarkColor:{type:Object},bookmarks:{type:Object},editedBookmark:{type:Object},renderHeader:{type:Boolean}}}},{key:"styles",get:function(){return[(0,r.AH)(jo||(jo=Eo(["\n :host {\n display: block;\n overflow-y: auto;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n margin-bottom: 2rem;\n --activeBorderWidth: 2px;\n }\n\n icon-bookmark {\n width: 16px;\n height: 24px;\n }\n\n .separator {\n background-color: var(--secondaryBGColor);\n width: 98%;\n margin: 1px auto;\n height: 1px;\n }\n\n small {\n font-style: italic;\n }\n\n h4 {\n margin: 0;\n font-size: 1.4rem;\n }\n h4 * {\n display: inline-block;\n }\n h4 icon-bookmark {\n vertical-align: bottom;\n }\n h4 span {\n vertical-align: top;\n padding-top: 1%;\n }\n\n p {\n padding: 0;\n margin: 5px 0 0 0;\n width: 98%;\n overflow-wrap: break-word;\n }\n\n ia-bookmark-edit {\n margin: 5px 5px 3px 6px;\n }\n\n ul {\n padding: 0;\n list-style: none;\n margin: var(--activeBorderWidth) 0.5rem 1rem 0;\n }\n ul > li:first-child .separator {\n display: none;\n }\n li {\n cursor: pointer;\n outline: none;\n position: relative;\n }\n li .content {\n padding: 2px 0 4px 2px;\n border: var(--activeBorderWidth) solid transparent;\n padding: .2rem 0 .4rem .2rem;\n }\n li .content.active {\n border: var(--activeBorderWidth) solid #538bc5;\n }\n li button.edit {\n padding: 5px 2px 0 0;\n background: transparent;\n cursor: pointer;\n height: 40px;\n width: 40px;\n position: absolute;\n right: 2px;\n top: 2px;\n text-align: right;\n -webkit-appearance: none;\n appearance: none;\n outline: none;\n box-sizing: border-box;\n border: none;\n }\n li button.edit > * {\n display: block;\n height: 100%;\n width: 100%;\n }\n "]))),co]}}])}(r.WF);customElements.define("ia-bookmarks-list",_o);class $o extends r.WF{static get styles(){return r.AH`
1750
+ `}render(){return Lo}}function Io(e){return Io="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},Io(e)}function _o(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function zo(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,To(r.key),r)}}function To(e){var t=function(e){if("object"!=Io(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Io(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Io(t)?t:t+""}function Do(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Do=function(){return!!e})()}function $o(e){return $o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$o(e)}function Ho(e,t){return Ho=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ho(e,t)}customElements.define("ia-icon-edit-pencil",Ao);var qo,Ro=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=$o(t),function(e,t){if(t&&("object"==Io(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,Do()?Reflect.construct(t,n||[],$o(e).constructor):t.apply(e,n))}(this,t)).activeBookmarkID=void 0,e.bookmarkColors=[],e.defaultBookmarkColor={},e.bookmarks={},e.editedBookmark={},e.renderHeader=!1,e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ho(e,t)}(t,e),function(e,t,n){return t&&zo(e.prototype,t),n&&zo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"emitEditEvent",value:function(e,t){this.dispatchEvent(new CustomEvent("bookmarkEdited",{detail:{bookmark:t}}))}},{key:"emitSelectedEvent",value:function(e){this.activeBookmarkID=e.id,this.dispatchEvent(new CustomEvent("bookmarkSelected",{detail:{bookmark:e}}))}},{key:"emitSaveBookmark",value:function(e){this.dispatchEvent(new CustomEvent("saveBookmark",{detail:{bookmark:e}}))}},{key:"emitDeleteBookmark",value:function(e){this.dispatchEvent(new CustomEvent("deleteBookmark",{detail:{id:e}}))}},{key:"emitBookmarkColorChanged",value:function(e){var t=e.detail,n=t.bookmarkId,r=t.colorId;this.dispatchEvent(new CustomEvent("bookmarkColorChanged",{detail:{bookmarkId:n,colorId:r}}))}},{key:"emitAddBookmark",value:function(){this.dispatchEvent(new CustomEvent("addBookmark"))}},{key:"editBookmark",value:function(e,t){this.emitEditEvent(e,t),this.editedBookmark=this.editedBookmark===t?{}:t}},{key:"saveBookmark",value:function(e){var t=e.detail.bookmark;this.editedBookmark={},this.emitSaveBookmark(t)}},{key:"deleteBookmark",value:function(e){var t=e.detail.id;this.editedBookmark={},this.emitDeleteBookmark(t)}},{key:"bookmarkColorInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.bookmarkColors.find(function(t){return(null==t?void 0:t.id)===e})}},{key:"bookmarkItem",value:function(e){var t=this,n=this.editedBookmark.id===e.id,o=this.bookmarkColorInfo(e.color).className,i=e.id===this.activeBookmarkID?"active":"";return(0,r.qy)(Co||(Co=_o(["\n <li\n @click=",'\n tabindex="0"\n data-pageIndex=','\n >\n <div class="separator"></div>\n <div class="content ','">\n <button\n class="edit"\n @click=','\n title="Edit this bookmark"\n >\n <ia-icon-edit-pencil></ia-icon-edit-pencil>\n </button>\n <h4>\n <icon-bookmark class=',"></icon-bookmark>\n <span> Page ","</span>\n </h4>\n ","\n ","\n </div>\n </li>\n "])),function(){return t.emitSelectedEvent(e)},e.id,i,function(n){return t.editBookmark(n,e)},o,e.page,!n&&e.note?(0,r.qy)(Oo||(Oo=_o(["<p>","</p>"])),e.note):r.s6,n?this.editBookmarkComponent:r.s6)}},{key:"editBookmarkComponent",get:function(){return(0,r.qy)(xo||(xo=_o(["\n <ia-bookmark-edit\n .bookmark=","\n .bookmarkColors=","\n .defaultBookmarkColor=","\n .showBookmark=","\n @saveBookmark=","\n @deleteBookmark=","\n @bookmarkColorChanged=","\n ></ia-bookmark-edit>\n "])),this.editedBookmark,this.bookmarkColors,this.defaultBookmarkColor,!1,this.saveBookmark,this.deleteBookmark,this.emitBookmarkColorChanged)}},{key:"sortBookmarks",value:function(){var e=this;return Object.keys(this.bookmarks).sort(function(e,t){return+e>+t?1:+e<+t?-1:0}).map(function(t){return e.bookmarks[t]})}},{key:"bookmarksCount",get:function(){var e=this.bookmarks.length;return(0,r.qy)(Mo||(Mo=_o(["<small>(",")</small>"])),e)}},{key:"headerSection",get:function(){return(0,r.qy)(jo||(jo=_o(["<header>\n <h3>\n Bookmarks\n ","\n </h3>\n </header>"])),this.bookmarks.length?this.bookmarksCount:r.s6)}},{key:"bookmarkslist",get:function(){var e=this.sortBookmarks(),t=qe(e,function(e){return null==e?void 0:e.id},this.bookmarkItem.bind(this));return(0,r.qy)(Bo||(Bo=_o(["\n <ul>\n ",'\n <div class="separator"></div>\n </ul>\n '])),t)}},{key:"render",value:function(){return(0,r.qy)(Po||(Po=_o(["\n ","\n ","\n "])),this.renderHeader?this.headerSection:r.s6,Object.keys(this.bookmarks).length?this.bookmarkslist:r.s6)}}],[{key:"properties",get:function(){return{activeBookmarkID:{type:Number},bookmarkColors:{type:Array},defaultBookmarkColor:{type:Object},bookmarks:{type:Object},editedBookmark:{type:Object},renderHeader:{type:Boolean}}}},{key:"styles",get:function(){return[(0,r.AH)(Eo||(Eo=_o(["\n :host {\n display: block;\n overflow-y: auto;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n margin-bottom: 2rem;\n --activeBorderWidth: 2px;\n }\n\n icon-bookmark {\n width: 16px;\n height: 24px;\n }\n\n .separator {\n background-color: var(--secondaryBGColor);\n width: 98%;\n margin: 1px auto;\n height: 1px;\n }\n\n small {\n font-style: italic;\n }\n\n h4 {\n margin: 0;\n font-size: 1.4rem;\n }\n h4 * {\n display: inline-block;\n }\n h4 icon-bookmark {\n vertical-align: bottom;\n }\n h4 span {\n vertical-align: top;\n padding-top: 1%;\n }\n\n p {\n padding: 0;\n margin: 5px 0 0 0;\n width: 98%;\n overflow-wrap: break-word;\n }\n\n ia-bookmark-edit {\n margin: 5px 5px 3px 6px;\n }\n\n ul {\n padding: 0;\n list-style: none;\n margin: var(--activeBorderWidth) 0.5rem 1rem 0;\n }\n ul > li:first-child .separator {\n display: none;\n }\n li {\n cursor: pointer;\n outline: none;\n position: relative;\n }\n li .content {\n padding: 2px 0 4px 2px;\n border: var(--activeBorderWidth) solid transparent;\n padding: .2rem 0 .4rem .2rem;\n }\n li .content.active {\n border: var(--activeBorderWidth) solid #538bc5;\n }\n li button.edit {\n padding: 5px 2px 0 0;\n background: transparent;\n cursor: pointer;\n height: 40px;\n width: 40px;\n position: absolute;\n right: 2px;\n top: 2px;\n text-align: right;\n -webkit-appearance: none;\n appearance: none;\n outline: none;\n box-sizing: border-box;\n border: none;\n }\n li button.edit > * {\n display: block;\n height: 100%;\n width: 100%;\n }\n "]))),fo]}}])}(r.WF);customElements.define("ia-bookmarks-list",Ro);class Fo extends r.WF{static get styles(){return r.AH`
1712
1751
  :host {
1713
1752
  width: var(--iconWidth, 'auto');
1714
1753
  height: var(--iconHeight, 'auto');
@@ -1778,5 +1817,5 @@
1778
1817
  </g>
1779
1818
  </svg>
1780
1819
  </div>
1781
- `}}function Ho(e){return Ho="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},Ho(e)}function qo(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,Ro(r.key),r)}}function Ro(e){var t=function(e){if("object"!=Ho(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ho(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ho(t)?t:t+""}window.customElements.define("icon-bookmark",$o);var Fo,Zo,Wo=function(){return function(e,t){return t&&qo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.baseHost,o=t.signedIn,i=t.bookreader,a=t.modal,s=t.onProviderChange,l="referer=".concat(encodeURIComponent(location.href)),c="https://".concat(n,"/account/login?").concat(l);this.component=document.createElement("ia-bookmarks"),this.component.bookreader=i,this.component.displayMode=o?"bookmarks":"login",this.component.modal=a,this.component.loginOptions={loginClicked:this.bookmarksLoginClicked,loginUrl:c},this.bindEvents(),this.icon=(0,r.qy)(Do||(Do=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['<icon-bookmark state="hollow" style="--iconWidth: 16px; --iconHeight: 24px;"></icon-bookmark>']))),this.label="Bookmarks",this.id="bookmarks",this.onProviderChange=s,this.component.setup(),this.updateMenu(this.component.bookmarks.length)},[{key:"updateMenu",value:function(e){this.menuDetails="(".concat(e,")")}},{key:"bindEvents",value:function(){this.component.addEventListener("bookmarksChanged",this.bookmarksChanged.bind(this))}},{key:"bookmarksChanged",value:function(e){var t=e.detail,n=Object.keys(t.bookmarks).length;this.updateMenu(n),this.onProviderChange(t.bookmarks,t.showSidePanel)}},{key:"bookmarksLoginClicked",value:function(){var e;null===(e=window.archive_analytics)||void 0===e||e.send_event_no_sampling("BookReader","BookmarksLogin",window.location.path)}}])}();function No(e){return No="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},No(e)}function Uo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Vo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Jo(r.key),r)}}function Go(e,t,n){return t&&Vo(e.prototype,t),n&&Vo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jo(e){var t=function(e){if("object"!=No(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=No(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==No(t)?t:t+""}var Yo,Xo=Go(function e(t){var n=t.item,o=t.baseHost,i=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var a=null==n?void 0:n.metadata,s=a.identifier,l=a.creator,c=a.title,u=Array.isArray(l)?l[0]:l,d=i.subPrefix||"";this.icon=(0,r.qy)(Fo||(Fo=Uo(["",""])),le),this.label="Share this book",this.id="share",this.component=(0,r.qy)(Zo||(Zo=Uo(["<iaux-in-share-panel\n .identifier=","\n .type=","\n .creator=","\n .description=","\n .baseHost=","\n .fileSubPrefix=","\n ></iaux-in-share-panel>"])),s,"book",u,c,o,d)});function Qo(e){return Qo="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},Qo(e)}function Ko(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return ei(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,s=0,l=e,h.n=n,a}};function p(n,r){for(s=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],p=h.p,f=i[2];n>3?(o=f===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(s=0,h.v=r,h.n=i[1]):p<f&&(o=n<3||i[0]>r||r>f)&&(i[4]=n,i[5]=r,h.n=f,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,f),s=u,l=f;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=h.n<0)?l:n.call(r,h))!==a)break}catch(t){i=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(ei(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,ei(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,ei(d,"constructor",c),ei(c,"constructor",l),l.displayName="GeneratorFunction",ei(c,o,"GeneratorFunction"),ei(d),ei(d,o,"Generator"),ei(d,r,function(){return this}),ei(d,"toString",function(){return"[object Generator]"}),(Ko=function(){return{w:i,m:h}})()}function ei(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ei=function(e,t,n,r){function i(t,n){ei(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))},ei(e,t,n,r)}function ti(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function ni(e){return function(e){if(Array.isArray(e))return ri(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return ri(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)?ri(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ri(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 oi(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,ii(r.key),r)}}function ii(e){var t=function(e){if("object"!=Qo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Qo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qo(t)?t:t+""}var ai,si,li,ci,ui,di,hi,pi="default",fi=function(){return function(e,t){return t&&oi(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=this,o=t.baseHost,i=t.bookreader,a=t.onProviderChange;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bookreader=i,this.onProviderChange=a,this.baseHost=o;var s=i.options.multipleBooksList.by_subprefix;if(this.viewableFiles=Object.keys(s).map(function(e){return s[e]}),this.volumeCount=Object.keys(s).length,this.id="volumes",this.label="Viewable files (".concat(this.volumeCount,")"),this.icon=(0,r.qy)(Yo||(Yo=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["",""])),Ae),this.sortOrderBy=pi,this.component=document.createElement("iaux-in-viewable-files-panel"),this.component.addSortToUrl=!0,this.component.subPrefix=i.options.subPrefix||"",this.component.baseHost=o,this.component.fileList=ni(this.viewableFiles),this.sortFilesComponent=document.createElement("iaux-in-sort-files-button"),this.sortFilesComponent.fileListRaw=this.viewableFiles,this.sortFilesComponent.addEventListener("fileListSorted",function(e){return n.handleFileListSorted(e)}),this.actionButton=this.sortFilesComponent,this.bookreader.urlPlugin){this.bookreader.urlPlugin.pullFromAddressBar();var l=this.bookreader.urlPlugin.getUrlParam("sort");"title_asc"!==l&&"title_desc"!==l||(this.sortOrderBy=l)}this.sortFilesComponent.sortVolumes(this.sortOrderBy),this.onProviderChange(this.bookreader)},[{key:"handleFileListSorted",value:(e=Ko().m(function e(t){var n,r,o;return Ko().w(function(e){for(;;)switch(e.n){case 0:return n=t.detail,r=n.sortType,o=n.sortedFiles,this.viewableFiles=o,this.sortOrderBy=r,this.component.fileList=ni(this.viewableFiles),e.n=1,this.component.updateComplete;case 1:this.bookreader.urlPlugin&&(this.bookreader.urlPlugin.pullFromAddressBar(),this.sortOrderBy!==pi?this.bookreader.urlPlugin.setUrlParam("sort",this.sortOrderBy):this.bookreader.urlPlugin.removeUrlParam("sort")),this.onProviderChange(this.bookreader),this.multipleFilesClicked(this.sortOrderBy);case 2:return e.a(2)}},e,this)}),t=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ti(i,r,o,a,s,"next",e)}function s(e){ti(i,r,o,a,s,"throw",e)}a(void 0)})},function(e){return t.apply(this,arguments)})},{key:"multipleFilesClicked",value:function(e){var t;null===(t=window.archive_analytics)||void 0===t||t.send_event("BookReader","VolumesSort|".concat(e),window.location.path)}}]);var e,t}(),mi=(0,r.JW)(ai||(ai=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <svg class="ia-logo" width="27" height="30" viewBox="0 0 27 30" xmlns="http://www.w3.org/2000/svg" aria-labelledby="logoTitleID logoDescID">\n <title id="logoTitleID">Internet Archive logo</title>\n <desc id="logoDescID">A line drawing of the Internet Archive headquarters building façade.</desc>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <mask id="mask-2" fill="white">\n <path d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z" id="path-1"></path>\n </mask>\n <use fill="#FFFFFF" xlink:href="#path-1"></use>\n <g mask="url(#mask-2)" fill="#FFFFFF">\n <path d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z" id="swatch"></path>\n </g>\n </g>\n </svg>\n']))),vi=n(8004);function bi(e){return bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bi(e)}function yi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return gi(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)?gi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gi(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 ki(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function wi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Si(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wi(Object(n),!0).forEach(function(t){Ci(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ci(e,t,n){return(t=xi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Oi(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,xi(r.key),r)}}function xi(e){var t=function(e){if("object"!=bi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bi(t)?t:t+""}function ji(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ji=function(){return!!e})()}function Bi(e){return Bi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bi(e)}function Pi(e,t){return Pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pi(e,t)}var Mi,Ei,Li="updateSideMenu",Ai=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Bi(t),function(e,t){if(t&&("object"==bi(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,ji()?Reflect.construct(t,n||[],Bi(e).constructor):t.apply(e,n))}(this,t)).itemMD=void 0,e.loaded=!1,e.bookReaderCannotLoad=!1,e.bookReaderLoaded=!1,e.bookreader=null,e.bookIsRestricted=!1,e.downloadableTypes=[],e.isAdmin=!1,e.lendingInitialized=!1,e.lendingStatus={},e.menuProviders={bookmarks:null,search:null,downloads:null,visualAdjustments:null,share:null,volumes:null},e.menuShortcuts=[],e.signedIn=!1,e.modal=void 0,e.sharedObserver=void 0,e.fullscreenBranding=mi,e.sharedObserverHandler=void 0,e.brWidth=0,e.brHeight=0,e.shortcutOrder=["fullscreen","volumes","chapters","search","translate","bookmarks","downloads","visualAdjustments","share","experiments"],e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pi(e,t)}(t,e),function(e,t,n){return t&&Oi(e.prototype,t),n&&Oi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"disconnectedCallback",value:function(){this.sharedObserver.removeObserver({target:this.mainBRContainer,handler:this.sharedObserverHandler})}},{key:"firstUpdated",value:function(){this.bindEventListeners(),this.emitPostInit(),this.loaded=!0}},{key:"updated",value:function(e){this.bookreader&&this.itemMD&&this.bookReaderLoaded&&((e.has("loaded")&&this.loaded||e.has("itemMD")||e.has("bookreader")||e.has("signedIn")||e.has("isAdmin")||e.has("modal"))&&this.initializeBookSubmenus(),e.has("sharedObserver")&&this.bookreader&&(this.loadSharedObserver(),this.initializeBookSubmenus()),e.has("downloadableTypes")&&this.initializeBookSubmenus())}},{key:"emitPostInit",value:function(){var e;this.dispatchEvent(new CustomEvent("BrBookNav:".concat("PostInit"),{detail:{brSelector:null===(e=this.bookreader)||void 0===e?void 0:e.el},bubbles:!0,composed:!0}))}},{key:"baseProviderConfig",get:function(){return{baseHost:this.baseHost,modal:this.modal,sharedObserver:this.sharedObserver,bookreader:this.bookreader,item:this.itemMD,signedIn:this.signedIn,isAdmin:this.isAdmin,onProviderChange:function(){}}}},{key:"isWideEnoughToOpenMenu",get:function(){return this.brWidth>=640}},{key:"initializeBookSubmenus",value:function(){var e,t=this,n={visualAdjustments:new ir(Si(Si({},this.baseProviderConfig),{},{onProviderChange:function(){t.updateMenuContents()}}))};this.baseProviderConfig.item&&(n.share=new Xo(this.baseProviderConfig)),this.shouldShowDownloadsMenu()&&(n.downloads=new mn(this.baseProviderConfig)),null!==(e=this.bookreader.options.plugins)&&void 0!==e&&null!==(e=e.search)&&void 0!==e&&e.enabled&&(n.search=new Gt(Si(Si({},this.baseProviderConfig),{},{onProviderChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e&&(t.bookreader=e),t.updateMenuContents(),!1!==n.openMenu&&(!t.isWideEnoughToOpenMenu||null!=n&&n.searchCanceled||setTimeout(function(){t.updateSideMenu("search","open")},0))}}))),this.bookreader.options.enableBookmarks&&(n.bookmarks=new Wo(Si(Si({},this.baseProviderConfig),{},{onProviderChange:function(e){var n=Object.keys(e).length?"add":"remove";t["".concat(n,"MenuShortcut")]("bookmarks"),t.updateMenuContents()}}))),this.bookreader.options.enableMultipleBooks&&(n.volumes=new fi(Si(Si({},this.baseProviderConfig),{},{onProviderChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&(t.bookreader=e),t.updateMenuContents(),t.isWideEnoughToOpenMenu&&setTimeout(function(){t.updateSideMenu("volumes","open")})}}))),Object.assign(this.menuProviders,n),this.addMenuShortcut("search"),this.addMenuShortcut("volumes"),this.updateMenuContents()}},{key:"mainBRContainer",get:function(){var e;return document.querySelector(null===(e=this.bookreader)||void 0===e?void 0:e.el)}},{key:"addFullscreenShortcut",value:function(){var e={icon:this.fullscreenShortcut,id:"fullscreen"};this.menuShortcuts.push(e),this.sortMenuShortcuts(),this.emitMenuShortcutsUpdated()}},{key:"deleteFullscreenShortcut",value:function(){var e=this.menuShortcuts.filter(function(e){return"fullscreen"!==e.id});this.menuShortcuts=e,this.sortMenuShortcuts(),this.emitMenuShortcutsUpdated()}},{key:"closeFullscreen",value:function(){this.bookreader.exitFullScreen()}},{key:"fullscreenShortcut",get:function(){var e=this;return(0,r.qy)(si||(si=ki(["\n <button\n @click=",'\n title="Exit fullscreen view"\n >',"</button>\n "])),function(){return e.closeFullscreen()},this.fullscreenBranding)}},{key:"updateSideMenu",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(e){var t=new CustomEvent(Li,{detail:{menuId:e,action:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"open"}});this.dispatchEvent(t)}}},{key:"updateMenuContents",value:function(){var e,t=this,n=(0,vi.sortBy)(Object.entries(this.menuProviders).filter(function(e){var t=yi(e,2);return t[0],!!t[1]}).filter(function(e){var n=yi(e,2),r=n[0];return n[1],"downloads"!==r||t.shouldShowDownloadsMenu()}),function(e){var n=yi(e,2),r=n[0],o=(n[1],t.shortcutOrder.indexOf(r));return-1===o?t.shortcutOrder.length:o}).map(function(e){var t=yi(e,2);return t[0],t[1]});this.shouldShowDownloadsMenu()&&(null===(e=this.menuProviders.downloads)||void 0===e||e.update(this.downloadableTypes));var r=new CustomEvent("menuUpdated",{detail:n});this.dispatchEvent(r)}},{key:"shouldShowDownloadsMenu",value:function(){if(!this.downloadableTypes.length)return!1;if(!1===this.bookIsRestricted)return!0;if(this.isAdmin)return!0;var e=this.lendingStatus.user_loan_record,t=void 0===e?{}:e;return!Array.isArray(t)&&t.type&&"SESSION_LOAN"!==t.type}},{key:"addMenuShortcut",value:function(e){this.menuShortcuts.find(function(t){return t.id===e})||this.menuProviders[e]&&(this.menuShortcuts.push(this.menuProviders[e]),this.sortMenuShortcuts(),this.emitMenuShortcutsUpdated())}},{key:"removeMenuShortcut",value:function(e){this.menuShortcuts=this.menuShortcuts.filter(function(t){return t.id!==e}),this.emitMenuShortcutsUpdated()}},{key:"sortMenuShortcuts",value:function(){var e=this;this.menuShortcuts=(0,vi.sortBy)(this.menuShortcuts,function(t){var n=e.shortcutOrder.indexOf(t.id);return-1===n?e.shortcutOrder.length:n})}},{key:"emitMenuShortcutsUpdated",value:function(){var e=new CustomEvent("menuShortcutsUpdated",{detail:this.menuShortcuts});this.dispatchEvent(e)}},{key:"emitLoadingStatusUpdate",value:function(e){var t=new CustomEvent("loadingStateUpdated",{detail:{loaded:e}});this.dispatchEvent(t)}},{key:"bindEventListeners",value:function(){var e=this;window.addEventListener("BookReader:PostInit",function(t){e.bookreader=t.detail.props,e.bookreader.shell=e,e.bookReaderLoaded=!0,e.bookReaderCannotLoad=!1,e.emitLoadingStatusUpdate(!0),e.loadSharedObserver(),setTimeout(function(){e.bookreader.resize()},0)}),window.addEventListener("BookReader:fullscreenToggled",function(t){var n=t.detail.props,r=void 0===n?null:n;r&&(e.bookreader=r),e.manageFullScreenBehavior()},{passive:!0}),window.addEventListener("BookReader:ToggleSearchMenu",function(t){e.dispatchEvent(new CustomEvent(Li,{detail:{menuId:"search",action:"toggle"}}))}),window.addEventListener("LendingFlow:PostInit",function(t){var n=t.detail,r=n.downloadTypesAvailable,o=n.lendingStatus,i=n.isAdmin,a=n.previewType;e.lendingInitialized=!0,e.downloadableTypes=r,e.lendingStatus=o,e.isAdmin=i,e.bookReaderCannotLoad="singlePagePreview"===a,e.emitLoadingStatusUpdate(!0)}),window.addEventListener("BRJSIA:PostInit",function(t){var n=t.detail,r=n.isRestricted,o=n.downloadURLs;e.bookReaderLoaded=!0,e.downloadableTypes=o,e.bookIsRestricted=r}),window.addEventListener("contextmenu",function(t){return e.manageContextMenuVisibility(t)},{capture:!0})}},{key:"manageContextMenuVisibility",value:function(e){var t,n;if(null===(t=window.archive_analytics)||void 0===t||t.send_event("BookReader","contextmenu-".concat(this.bookIsRestricted?"restricted":"unrestricted"),null===(n=e.target)||void 0===n||null===(n=n.classList)||void 0===n?void 0:n.value),this.bookIsRestricted&&e.target.classList.value.match(/BRscreen|BRpageimage/g))return e.preventDefault(),!1}},{key:"loadSharedObserver",value:function(){var e;this.sharedObserverHandler={handleResize:this.handleResize.bind(this)},null===(e=this.sharedObserver)||void 0===e||e.addObserver({target:this.mainBRContainer,handler:this.sharedObserverHandler})}},{key:"handleResize",value:function(e){var t=e.contentRect,n=e.target,r=this.brWidth,o=this.brHeight,i=this.bookreader.animating;n===this.mainBRContainer&&(this.brWidth=t.width,this.brHeight=t.height),!r&&this.brWidth&&this.initializeBookSubmenus();var a,s=r!==this.brWidth,l=o!==this.brHeight;i||!s&&!l||null===(a=this.bookreader)||void 0===a||a.resize()}},{key:"manageFullScreenBehavior",value:function(){this.emitFullScreenState(),this.bookreader.options.enableFSLogoShortcut&&(this.bookreader.isFullscreen()?this.addFullscreenShortcut():this.deleteFullscreenShortcut())}},{key:"emitFullScreenState",value:function(){var e=this.bookreader.isFullscreen(),t=new CustomEvent("ViewportInFullScreen",{detail:{isFullScreen:e}});this.dispatchEvent(t)}},{key:"itemImage",get:function(){var e,t=null===(e=this.itemMD)||void 0===e?void 0:e.metadata.identifier,n="https://".concat(this.baseHost,"/services/img/").concat(t);return(0,r.qy)(li||(li=ki(['<img class="cover-img" src=',' alt="cover image for ','">'])),n,t)}},{key:"placeholder",get:function(){return(0,r.qy)(ci||(ci=ki(['<div class="placeholder">',"</div>"])),this.itemImage)}},{key:"render",value:function(){return(0,r.qy)(ui||(ui=ki(['<div id="book-navigator__root">\n ',"\n ","\n </div>\n "])),this.bookReaderCannotLoad?this.placeholder:r.s6,this.bookReaderCannotLoad?r.s6:(0,r.qy)(di||(di=ki(['<slot name="main"></slot>']))))}}],[{key:"properties",get:function(){return{itemMD:{type:Object},bookReaderLoaded:{type:Boolean},bookreader:{type:Object},bookIsRestricted:{type:Boolean},downloadableTypes:{type:Array},isAdmin:{type:Boolean},lendingInitialized:{type:Boolean},lendingStatus:{type:Object},menuProviders:{type:Object},menuShortcuts:{type:Array},signedIn:{type:Boolean},loaded:{type:Boolean},sharedObserver:{type:Object,attribute:!1},modal:{type:Object,attribute:!1},fullscreenBranding:{type:Object}}}},{key:"styles",get:function(){return(0,r.AH)(hi||(hi=ki(["\n :host,\n #book-navigator__root,\n slot,\n slot > * {\n display: block;\n height: inherit;\n width: inherit;\n }\n .placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin: 5%;\n }\n .cover-img {\n max-height: 300px;\n }\n "])))}}])}(r.WF);customElements.define("book-navigator",Ai);class Ii{constructor(){this.resizeObserver=new ResizeObserver(e=>{window.requestAnimationFrame(()=>{for(const t of e){const e=this.resizeHandlers.get(t.target);null==e||e.forEach(e=>{e.handleResize(t)})}})}),this.resizeHandlers=new Map}shutdown(){this.resizeHandlers.forEach((e,t)=>{this.resizeObserver.unobserve(t)}),this.resizeHandlers.clear()}addObserver(e){var t;const n=null!==(t=this.resizeHandlers.get(e.target))&&void 0!==t?t:new Set;n.add(e.handler),this.resizeHandlers.set(e.target,n),this.resizeObserver.observe(e.target,e.options)}removeObserver(e){const t=this.resizeHandlers.get(e.target);t&&(t.delete(e.handler),0===t.size&&(this.resizeObserver.unobserve(e.target),this.resizeHandlers.delete(e.target)))}}function Ti(e){return Ti="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},Ti(e)}function zi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Di(e){return function(e){if(Array.isArray(e))return _i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return _i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_i(e,t):void 0}}(e)||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 _i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function $i(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Hi(r.key),r)}}function Hi(e){var t=function(e){if("object"!=Ti(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ti(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ti(t)?t:t+""}function qi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(qi=function(){return!!e})()}function Ri(e){return Ri=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ri(e)}function Fi(e,t){return Fi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fi(e,t)}var Zi=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Ri(t),function(e,t){if(t&&("object"==Ti(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,qi()?Reflect.construct(t,n||[],Ri(e).constructor):t.apply(e,n))}(this,t)).item=void 0,e.bookreader=void 0,e.baseHost="archive.org",e.fullscreen=!1,e.signedIn=!1,e.modal=void 0,e.sharedObserver=void 0,e.loaded=!1,e.menuShortcuts=[],e.menuContents=[],e.openMenuName="",e}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&&Fi(e,t)}(t,e),function(e,t,n){return t&&$i(e.prototype,t),n&&$i(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"updated",value:function(){this.modal||this.setModalManager(),this.sharedObserver||(this.sharedObserver=new Ii)}},{key:"itemNav",get:function(){return this.shadowRoot.querySelector("iaux-item-navigator")}},{key:"setModalManager",value:function(){var e=document.querySelector("modal-manager");e||(e=document.createElement("modal-manager"),document.body.appendChild(e)),this.modal=e}},{key:"manageFullscreen",value:function(e){var t=!!e.detail.isFullScreen;this.fullscreen=t,this.dispatchEvent(new CustomEvent("fullscreenStateUpdated",{detail:{fullscreen:t}}))}},{key:"loadingStateUpdated",value:function(e){var t=e.detail.loaded;this.loaded=t||null,this.dispatchEvent(new CustomEvent("loadingStateUpdated",{detail:{loaded:t}}))}},{key:"setMenuShortcuts",value:function(e){this.menuShortcuts=Di(e.detail)}},{key:"setMenuContents",value:function(e){var t=Di(e.detail);this.menuContents=t}},{key:"manageSideMenuEvents",value:function(e){var t,n=e.detail,r=n.menuId,o=n.action;if(r)if(this.openMenuName=r,"open"===o)null===(t=this.itemNav)||void 0===t||t.openShortcut(r);else if("toggle"===o){var i;null===(i=this.itemNav)||void 0===i||i.toggleMenu()}}},{key:"render",value:function(){return(0,r.qy)(Mi||(Mi=zi(['\n <div class="main-component">\n <iaux-item-navigator\n ?viewportInFullscreen=',"\n .basehost=","\n .item=","\n .modal=","\n .loaded=","\n .sharedObserver=","\n ?signedIn=","\n .menuShortcuts=","\n .menuContents=","\n .openMenu=",'\n >\n <div slot="header">\n <slot name="header"></slot>\n </div>\n <div slot="main">\n <book-navigator\n .modal=',"\n .baseHost=","\n .itemMD=","\n ?signedIn=","\n ?sideMenuOpen=","\n .sharedObserver=","\n @ViewportInFullScreen=","\n @loadingStateUpdated=","\n @updateSideMenu=","\n @menuUpdated=","\n @menuShortcutsUpdated=",'\n >\n <div slot="main">\n <slot name="main"></slot>\n </div>\n </book-navigator>\n </div>\n </iaux-item-navigator>\n </div>\n '])),this.fullscreen,this.baseHost,this.item,this.modal,this.loaded,this.sharedObserver,this.signedIn,this.menuShortcuts,this.menuContents,this.openMenuName,this.modal,this.baseHost,this.item,this.signedIn,this.menuOpened,this.sharedObserver,this.manageFullscreen,this.loadingStateUpdated,this.manageSideMenuEvents,this.setMenuContents,this.setMenuShortcuts)}}],[{key:"properties",get:function(){return{item:{type:Object},baseHost:{type:String},signedIn:{type:Boolean},fullscreen:{type:Boolean,reflect:!0,attribute:!0},sharedObserver:{type:Object,attribute:!1},modal:{type:Object,attribute:!1},loaded:{type:Boolean},menuShortcuts:{type:Array},menuContents:{type:Array}}}},{key:"styles",get:function(){return(0,r.AH)(Ei||(Ei=zi(['\n :host {\n display: block;\n --primaryBGColor: var(--black, #000);\n --secondaryBGColor: #222;\n --tertiaryBGColor: #333;\n --primaryTextColor: var(--white, #fff);\n --primaryCTAFill: #194880;\n --primaryCTABorder: #c5d1df;\n --secondaryCTAFill: #333;\n --secondaryCTABorder: #999;\n --primaryErrorCTAFill: #e51c26;\n --primaryErrorCTABorder: #f8c6c8;\n background-color: var(--primaryBGColor);\n position: relative;\n }\n\n :host([fullscreen]),\n iaux-item-navigator[viewportinfullscreen] {\n position: fixed;\n inset: 0;\n height: 100%;\n min-height: unset;\n }\n\n .main-component {\n height: 100%;\n width: 100%;\n min-height: inherit;\n }\n\n div[slot="header"],\n div[slot="main"] {\n display: flex;\n width: 100%;\n }\n\n slot {\n display: block;\n flex: 1;\n }\n\n iaux-item-navigator {\n min-height: var(--br-height, inherit);\n height: var(--br-height, inherit);\n display: block;\n width: 100%;\n color: var(--primaryTextColor);\n --menuButtonLabelDisplay: block;\n --menuWidth: 320px;\n --menuSliderBg: var(--secondaryBGColor);\n --activeButtonBg: var(--tertiaryBGColor);\n --subpanelRightBorderColor: var(--secondaryCTABorder);\n --animationTiming: 100ms;\n --iconFillColor: var(--primaryTextColor);\n --iconStrokeColor: var(--primaryTextColor);\n --menuSliderHeaderIconHeight: 2rem;\n --menuSliderHeaderIconWidth: 2rem;\n --iconWidth: 2.4rem;\n --iconHeight: 2.4rem;\n --shareLinkColor: var(--primaryTextColor);\n --shareIconBorder: var(--primaryTextColor);\n --shareIconBg: var(--secondaryBGColor);\n --activityIndicatorLoadingDotColor: var(--primaryTextColor);\n --activityIndicatorLoadingRingColor: var(--primaryTextColor);\n }\n '])))}}])}(r.WF);window.customElements.define("ia-bookreader",Zi)}},function(e){e(e.s=4805)}]);
1820
+ `}}function Zo(e){return Zo="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},Zo(e)}function Wo(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,No(r.key),r)}}function No(e){var t=function(e){if("object"!=Zo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Zo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Zo(t)?t:t+""}window.customElements.define("icon-bookmark",Fo);var Vo,Uo,Go=function(){return function(e,t){return t&&Wo(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.baseHost,o=t.signedIn,i=t.bookreader,a=t.modal,s=t.onProviderChange,l="referer=".concat(encodeURIComponent(location.href)),c="https://".concat(n,"/account/login?").concat(l);this.component=document.createElement("ia-bookmarks"),this.component.bookreader=i,this.component.displayMode=o?"bookmarks":"login",this.component.modal=a,this.component.loginOptions={loginClicked:this.bookmarksLoginClicked,loginUrl:c},this.bindEvents(),this.icon=(0,r.qy)(qo||(qo=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['<icon-bookmark aria-hidden="true" role="presentation" state="hollow" style="--iconWidth: 16px; --iconHeight: 24px;"></icon-bookmark>']))),this.label="Bookmarks",this.id="bookmarks",this.onProviderChange=s,this.component.setup(),this.updateMenu(this.component.bookmarks.length)},[{key:"updateMenu",value:function(e){this.menuDetails="(".concat(e,")")}},{key:"bindEvents",value:function(){this.component.addEventListener("bookmarksChanged",this.bookmarksChanged.bind(this))}},{key:"bookmarksChanged",value:function(e){var t=e.detail,n=Object.keys(t.bookmarks).length;this.updateMenu(n),this.onProviderChange(t.bookmarks,t.showSidePanel)}},{key:"bookmarksLoginClicked",value:function(){var e;null===(e=window.archive_analytics)||void 0===e||e.send_event_no_sampling("BookReader","BookmarksLogin",window.location.path)}}])}();function Jo(e){return Jo="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},Jo(e)}function Yo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Xo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ko(r.key),r)}}function Qo(e,t,n){return t&&Xo(e.prototype,t),n&&Xo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ko(e){var t=function(e){if("object"!=Jo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Jo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Jo(t)?t:t+""}var ei,ti=Qo(function e(t){var n=t.item,o=t.baseHost,i=t.bookreader;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var a=null==n?void 0:n.metadata,s=a.identifier,l=a.creator,c=a.title,u=Array.isArray(l)?l[0]:l,d=i.subPrefix||"";this.icon=(0,r.qy)(Vo||(Vo=Yo(["",""])),Se),this.label="Share this book",this.id="share",this.component=(0,r.qy)(Uo||(Uo=Yo(["<iaux-in-share-panel\n .identifier=","\n .type=","\n .creator=","\n .description=","\n .baseHost=","\n .fileSubPrefix=","\n ></iaux-in-share-panel>"])),s,"book",u,c,o,d)});function ni(e){return ni="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},ni(e)}function ri(){var e,t,n="function"==typeof Symbol?Symbol:{},r=n.iterator||"@@iterator",o=n.toStringTag||"@@toStringTag";function i(n,r,o,i){var l=r&&r.prototype instanceof s?r:s,c=Object.create(l.prototype);return oi(c,"_invoke",function(n,r,o){var i,s,l,c=0,u=o||[],d=!1,h={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return i=t,s=0,l=e,h.n=n,a}};function p(n,r){for(s=n,l=r,t=0;!d&&c&&!o&&t<u.length;t++){var o,i=u[t],p=h.p,f=i[2];n>3?(o=f===r)&&(l=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=p&&((o=n<2&&p<i[1])?(s=0,h.v=r,h.n=i[1]):p<f&&(o=n<3||i[0]>r||r>f)&&(i[4]=n,i[5]=r,h.n=f,s=0))}if(o||n>1)return a;throw d=!0,r}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&p(u,f),s=u,l=f;(t=s<2?e:l)||!d;){i||(s?s<3?(s>1&&(h.n=-1),p(s,l)):h.n=l:h.v=l);try{if(c=2,i){if(s||(o="next"),t=i[o]){if(!(t=t.call(i,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=i.return)&&t.call(i),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);i=e}else if((t=(d=h.n<0)?l:n.call(r,h))!==a)break}catch(t){i=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(n,o,i),!0),c}var a={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][r]?t(t([][r]())):(oi(t={},r,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function h(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,oi(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,oi(d,"constructor",c),oi(c,"constructor",l),l.displayName="GeneratorFunction",oi(c,o,"GeneratorFunction"),oi(d),oi(d,o,"Generator"),oi(d,r,function(){return this}),oi(d,"toString",function(){return"[object Generator]"}),(ri=function(){return{w:i,m:h}})()}function oi(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}oi=function(e,t,n,r){function i(t,n){oi(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))},oi(e,t,n,r)}function ii(e,t,n,r,o,i,a){try{var s=e[i](a),l=s.value}catch(e){return void n(e)}s.done?t(l):Promise.resolve(l).then(r,o)}function ai(e){return function(e){if(Array.isArray(e))return si(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return si(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)?si(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function si(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 li(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,ci(r.key),r)}}function ci(e){var t=function(e){if("object"!=ni(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ni(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ni(t)?t:t+""}var ui,di,hi,pi,fi,mi,vi,bi="default",yi=function(){return function(e,t){return t&&li(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(function e(t){var n=this,o=t.baseHost,i=t.bookreader,a=t.onProviderChange;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.bookreader=i,this.onProviderChange=a,this.baseHost=o;var s=i.options.multipleBooksList.by_subprefix;if(this.viewableFiles=Object.keys(s).map(function(e){return s[e]}),this.volumeCount=Object.keys(s).length,this.id="volumes",this.label="Viewable files (".concat(this.volumeCount,")"),this.icon=(0,r.qy)(ei||(ei=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["",""])),We),this.sortOrderBy=bi,this.component=document.createElement("iaux-in-viewable-files-panel"),this.component.addSortToUrl=!0,this.component.subPrefix=i.options.subPrefix||"",this.component.baseHost=o,this.component.fileList=ai(this.viewableFiles),this.sortFilesComponent=document.createElement("iaux-in-sort-files-button"),this.sortFilesComponent.fileListRaw=this.viewableFiles,this.sortFilesComponent.addEventListener("fileListSorted",function(e){return n.handleFileListSorted(e)}),this.actionButton=this.sortFilesComponent,this.bookreader.urlPlugin){this.bookreader.urlPlugin.pullFromAddressBar();var l=this.bookreader.urlPlugin.getUrlParam("sort");"title_asc"!==l&&"title_desc"!==l||(this.sortOrderBy=l)}this.sortFilesComponent.sortVolumes(this.sortOrderBy),this.onProviderChange(this.bookreader)},[{key:"handleFileListSorted",value:(e=ri().m(function e(t){var n,r,o;return ri().w(function(e){for(;;)switch(e.n){case 0:return n=t.detail,r=n.sortType,o=n.sortedFiles,this.viewableFiles=o,this.sortOrderBy=r,this.component.fileList=ai(this.viewableFiles),e.n=1,this.component.updateComplete;case 1:this.bookreader.urlPlugin&&(this.bookreader.urlPlugin.pullFromAddressBar(),this.sortOrderBy!==bi?this.bookreader.urlPlugin.setUrlParam("sort",this.sortOrderBy):this.bookreader.urlPlugin.removeUrlParam("sort")),this.onProviderChange(this.bookreader),this.multipleFilesClicked(this.sortOrderBy);case 2:return e.a(2)}},e,this)}),t=function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ii(i,r,o,a,s,"next",e)}function s(e){ii(i,r,o,a,s,"throw",e)}a(void 0)})},function(e){return t.apply(this,arguments)})},{key:"multipleFilesClicked",value:function(e){var t;null===(t=window.archive_analytics)||void 0===t||t.send_event("BookReader","VolumesSort|".concat(e),window.location.path)}}]);var e,t}(),gi=(0,r.JW)(ui||(ui=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <svg class="ia-logo" width="27" height="30" viewBox="0 0 27 30" xmlns="http://www.w3.org/2000/svg" aria-labelledby="logoTitleID logoDescID">\n <title id="logoTitleID">Internet Archive logo</title>\n <desc id="logoDescID">A line drawing of the Internet Archive headquarters building façade.</desc>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <mask id="mask-2" fill="white">\n <path d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z" id="path-1"></path>\n </mask>\n <use fill="#FFFFFF" xlink:href="#path-1"></use>\n <g mask="url(#mask-2)" fill="#FFFFFF">\n <path d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z" id="swatch"></path>\n </g>\n </g>\n </svg>\n']))),ki=n(8004);function wi(e){return wi="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},wi(e)}function Si(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,s=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ci(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ci(e,t):void 0}}(e,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 Ci(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Oi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function xi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Mi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?xi(Object(n),!0).forEach(function(t){ji(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ji(e,t,n){return(t=Pi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bi(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,Pi(r.key),r)}}function Pi(e){var t=function(e){if("object"!=wi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=wi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==wi(t)?t:t+""}function Ei(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ei=function(){return!!e})()}function Li(e){return Li=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Li(e)}function Ai(e,t){return Ai=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ai(e,t)}var Ii,_i,zi="updateSideMenu",Ti=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Li(t),function(e,t){if(t&&("object"==wi(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,Ei()?Reflect.construct(t,n||[],Li(e).constructor):t.apply(e,n))}(this,t)).itemMD=void 0,e.loaded=!1,e.bookReaderCannotLoad=!1,e.bookReaderLoaded=!1,e.bookreader=null,e.bookIsRestricted=!1,e.downloadableTypes=[],e.isAdmin=!1,e.lendingInitialized=!1,e.lendingStatus={},e.menuProviders={bookmarks:null,search:null,downloads:null,visualAdjustments:null,share:null,volumes:null},e.menuShortcuts=[],e.signedIn=!1,e.modal=void 0,e.sharedObserver=void 0,e.fullscreenBranding=gi,e.sharedObserverHandler=void 0,e.brWidth=0,e.brHeight=0,e.shortcutOrder=["fullscreen","volumes","chapters","search","translate","bookmarks","downloads","visualAdjustments","share","experiments"],e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ai(e,t)}(t,e),function(e,t,n){return t&&Bi(e.prototype,t),n&&Bi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"disconnectedCallback",value:function(){this.sharedObserver.removeObserver({target:this.mainBRContainer,handler:this.sharedObserverHandler})}},{key:"firstUpdated",value:function(){this.bindEventListeners(),this.emitPostInit(),this.loaded=!0}},{key:"updated",value:function(e){this.bookreader&&this.itemMD&&this.bookReaderLoaded&&((e.has("loaded")&&this.loaded||e.has("itemMD")||e.has("bookreader")||e.has("signedIn")||e.has("isAdmin")||e.has("modal"))&&this.initializeBookSubmenus(),e.has("sharedObserver")&&this.bookreader&&(this.loadSharedObserver(),this.initializeBookSubmenus()),e.has("downloadableTypes")&&this.initializeBookSubmenus())}},{key:"emitPostInit",value:function(){var e;this.dispatchEvent(new CustomEvent("BrBookNav:".concat("PostInit"),{detail:{brSelector:null===(e=this.bookreader)||void 0===e?void 0:e.el},bubbles:!0,composed:!0}))}},{key:"baseProviderConfig",get:function(){return{baseHost:this.baseHost,modal:this.modal,sharedObserver:this.sharedObserver,bookreader:this.bookreader,item:this.itemMD,signedIn:this.signedIn,isAdmin:this.isAdmin,onProviderChange:function(){}}}},{key:"isWideEnoughToOpenMenu",get:function(){return this.brWidth>=640}},{key:"initializeBookSubmenus",value:function(){var e,t=this,n={visualAdjustments:new cr(Mi(Mi({},this.baseProviderConfig),{},{onProviderChange:function(){t.updateMenuContents()}}))};this.baseProviderConfig.item&&(n.share=new ti(this.baseProviderConfig)),this.shouldShowDownloadsMenu()&&(n.downloads=new jn(this.baseProviderConfig)),null!==(e=this.bookreader.options.plugins)&&void 0!==e&&null!==(e=e.search)&&void 0!==e&&e.enabled&&(n.search=new sn(Mi(Mi({},this.baseProviderConfig),{},{onProviderChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e&&(t.bookreader=e),t.updateMenuContents(),!1!==n.openMenu&&(!t.isWideEnoughToOpenMenu||null!=n&&n.searchCanceled||setTimeout(function(){t.updateSideMenu("search","open")},0))}}))),this.bookreader.options.enableBookmarks&&(n.bookmarks=new Go(Mi(Mi({},this.baseProviderConfig),{},{onProviderChange:function(e){var n=Object.keys(e).length?"add":"remove";t["".concat(n,"MenuShortcut")]("bookmarks"),t.updateMenuContents()}}))),this.bookreader.options.enableMultipleBooks&&(n.volumes=new yi(Mi(Mi({},this.baseProviderConfig),{},{onProviderChange:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;e&&(t.bookreader=e),t.updateMenuContents(),t.isWideEnoughToOpenMenu&&setTimeout(function(){t.updateSideMenu("volumes","open")})}}))),Object.assign(this.menuProviders,n),this.addMenuShortcut("search"),this.addMenuShortcut("volumes"),this.updateMenuContents()}},{key:"mainBRContainer",get:function(){var e;return document.querySelector(null===(e=this.bookreader)||void 0===e?void 0:e.el)}},{key:"addFullscreenShortcut",value:function(){var e={icon:this.fullscreenShortcut,id:"fullscreen"};this.menuShortcuts.push(e),this.sortMenuShortcuts(),this.emitMenuShortcutsUpdated()}},{key:"deleteFullscreenShortcut",value:function(){var e=this.menuShortcuts.filter(function(e){return"fullscreen"!==e.id});this.menuShortcuts=e,this.sortMenuShortcuts(),this.emitMenuShortcutsUpdated()}},{key:"closeFullscreen",value:function(){this.bookreader.exitFullScreen()}},{key:"fullscreenShortcut",get:function(){var e=this;return(0,r.qy)(di||(di=Oi(["\n <button\n @click=",'\n title="Exit fullscreen view"\n >',"</button>\n "])),function(){return e.closeFullscreen()},this.fullscreenBranding)}},{key:"updateSideMenu",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(e){var t=new CustomEvent(zi,{detail:{menuId:e,action:arguments.length>1&&void 0!==arguments[1]?arguments[1]:"open"}});this.dispatchEvent(t)}}},{key:"updateMenuContents",value:function(){var e,t=this,n=(0,ki.sortBy)(Object.entries(this.menuProviders).filter(function(e){var t=Si(e,2);return t[0],!!t[1]}).filter(function(e){var n=Si(e,2),r=n[0];return n[1],"downloads"!==r||t.shouldShowDownloadsMenu()}),function(e){var n=Si(e,2),r=n[0],o=(n[1],t.shortcutOrder.indexOf(r));return-1===o?t.shortcutOrder.length:o}).map(function(e){var t=Si(e,2);return t[0],t[1]});this.shouldShowDownloadsMenu()&&(null===(e=this.menuProviders.downloads)||void 0===e||e.update(this.downloadableTypes));var r=new CustomEvent("menuUpdated",{detail:n});this.dispatchEvent(r)}},{key:"shouldShowDownloadsMenu",value:function(){if(!this.downloadableTypes.length)return!1;if(!1===this.bookIsRestricted)return!0;if(this.isAdmin)return!0;var e=this.lendingStatus.user_loan_record,t=void 0===e?{}:e;return!Array.isArray(t)&&t.type&&"SESSION_LOAN"!==t.type}},{key:"addMenuShortcut",value:function(e){this.menuShortcuts.find(function(t){return t.id===e})||this.menuProviders[e]&&(this.menuShortcuts.push(this.menuProviders[e]),this.sortMenuShortcuts(),this.emitMenuShortcutsUpdated())}},{key:"removeMenuShortcut",value:function(e){this.menuShortcuts=this.menuShortcuts.filter(function(t){return t.id!==e}),this.emitMenuShortcutsUpdated()}},{key:"sortMenuShortcuts",value:function(){var e=this;this.menuShortcuts=(0,ki.sortBy)(this.menuShortcuts,function(t){var n=e.shortcutOrder.indexOf(t.id);return-1===n?e.shortcutOrder.length:n})}},{key:"emitMenuShortcutsUpdated",value:function(){var e=new CustomEvent("menuShortcutsUpdated",{detail:this.menuShortcuts});this.dispatchEvent(e)}},{key:"emitLoadingStatusUpdate",value:function(e){var t=new CustomEvent("loadingStateUpdated",{detail:{loaded:e}});this.dispatchEvent(t)}},{key:"bindEventListeners",value:function(){var e=this;window.addEventListener("BookReader:PostInit",function(t){e.bookreader=t.detail.props,e.bookreader.shell=e,e.bookReaderLoaded=!0,e.bookReaderCannotLoad=!1,e.emitLoadingStatusUpdate(!0),e.loadSharedObserver(),setTimeout(function(){e.bookreader.resize()},0)}),window.addEventListener("BookReader:fullscreenToggled",function(t){var n=t.detail.props,r=void 0===n?null:n;r&&(e.bookreader=r),e.manageFullScreenBehavior()},{passive:!0}),window.addEventListener("BookReader:ToggleSearchMenu",function(t){e.dispatchEvent(new CustomEvent(zi,{detail:{menuId:"search",action:"toggle"}}))}),window.addEventListener("LendingFlow:PostInit",function(t){var n=t.detail,r=n.downloadTypesAvailable,o=n.lendingStatus,i=n.isAdmin,a=n.previewType;e.lendingInitialized=!0,e.downloadableTypes=r,e.lendingStatus=o,e.isAdmin=i,e.bookReaderCannotLoad="singlePagePreview"===a,e.emitLoadingStatusUpdate(!0)}),window.addEventListener("BRJSIA:PostInit",function(t){var n=t.detail,r=n.isRestricted,o=n.downloadURLs;e.bookReaderLoaded=!0,e.downloadableTypes=o,e.bookIsRestricted=r}),window.addEventListener("contextmenu",function(t){return e.manageContextMenuVisibility(t)},{capture:!0})}},{key:"manageContextMenuVisibility",value:function(e){var t,n;if(null===(t=window.archive_analytics)||void 0===t||t.send_event("BookReader","contextmenu-".concat(this.bookIsRestricted?"restricted":"unrestricted"),null===(n=e.target)||void 0===n||null===(n=n.classList)||void 0===n?void 0:n.value),this.bookIsRestricted&&e.target.classList.value.match(/BRscreen|BRpageimage/g))return e.preventDefault(),!1}},{key:"loadSharedObserver",value:function(){var e;this.sharedObserverHandler={handleResize:this.handleResize.bind(this)},null===(e=this.sharedObserver)||void 0===e||e.addObserver({target:this.mainBRContainer,handler:this.sharedObserverHandler})}},{key:"handleResize",value:function(e){var t=e.contentRect,n=e.target,r=this.brWidth,o=this.brHeight,i=this.bookreader.animating;n===this.mainBRContainer&&(this.brWidth=t.width,this.brHeight=t.height),!r&&this.brWidth&&this.initializeBookSubmenus();var a,s=r!==this.brWidth,l=o!==this.brHeight;i||!s&&!l||null===(a=this.bookreader)||void 0===a||a.resize()}},{key:"manageFullScreenBehavior",value:function(){this.emitFullScreenState(),this.bookreader.options.enableFSLogoShortcut&&(this.bookreader.isFullscreen()?this.addFullscreenShortcut():this.deleteFullscreenShortcut())}},{key:"emitFullScreenState",value:function(){var e=this.bookreader.isFullscreen(),t=new CustomEvent("ViewportInFullScreen",{detail:{isFullScreen:e}});this.dispatchEvent(t)}},{key:"itemImage",get:function(){var e,t=null===(e=this.itemMD)||void 0===e?void 0:e.metadata.identifier,n="https://".concat(this.baseHost,"/services/img/").concat(t);return(0,r.qy)(hi||(hi=Oi(['<img class="cover-img" src=',' alt="cover image for ','">'])),n,t)}},{key:"placeholder",get:function(){return(0,r.qy)(pi||(pi=Oi(['<div class="placeholder">',"</div>"])),this.itemImage)}},{key:"render",value:function(){return(0,r.qy)(fi||(fi=Oi(['<div id="book-navigator__root">\n ',"\n ","\n </div>\n "])),this.bookReaderCannotLoad?this.placeholder:r.s6,this.bookReaderCannotLoad?r.s6:(0,r.qy)(mi||(mi=Oi(['<slot name="main"></slot>']))))}}],[{key:"properties",get:function(){return{itemMD:{type:Object},bookReaderLoaded:{type:Boolean},bookreader:{type:Object},bookIsRestricted:{type:Boolean},downloadableTypes:{type:Array},isAdmin:{type:Boolean},lendingInitialized:{type:Boolean},lendingStatus:{type:Object},menuProviders:{type:Object},menuShortcuts:{type:Array},signedIn:{type:Boolean},loaded:{type:Boolean},sharedObserver:{type:Object,attribute:!1},modal:{type:Object,attribute:!1},fullscreenBranding:{type:Object}}}},{key:"styles",get:function(){return(0,r.AH)(vi||(vi=Oi(["\n :host,\n #book-navigator__root,\n slot,\n slot > * {\n display: block;\n height: inherit;\n width: inherit;\n }\n .placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin: 5%;\n }\n .cover-img {\n max-height: 300px;\n }\n "])))}}])}(r.WF);customElements.define("book-navigator",Ti);class Di{constructor(){this.resizeObserver=new ResizeObserver(e=>{window.requestAnimationFrame(()=>{for(const t of e){const e=this.resizeHandlers.get(t.target);null==e||e.forEach(e=>{e.handleResize(t)})}})}),this.resizeHandlers=new Map}shutdown(){this.resizeHandlers.forEach((e,t)=>{this.resizeObserver.unobserve(t)}),this.resizeHandlers.clear()}addObserver(e){var t;const n=null!==(t=this.resizeHandlers.get(e.target))&&void 0!==t?t:new Set;n.add(e.handler),this.resizeHandlers.set(e.target,n),this.resizeObserver.observe(e.target,e.options)}removeObserver(e){const t=this.resizeHandlers.get(e.target);t&&(t.delete(e.handler),0===t.size&&(this.resizeObserver.unobserve(e.target),this.resizeHandlers.delete(e.target)))}}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 Hi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function qi(e){return function(e){if(Array.isArray(e))return Ri(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Ri(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)?Ri(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ri(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 Fi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Zi(r.key),r)}}function Zi(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+""}function Wi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Wi=function(){return!!e})()}function Ni(e){return Ni=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ni(e)}function Vi(e,t){return Vi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vi(e,t)}var Ui=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Ni(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,Wi()?Reflect.construct(t,n||[],Ni(e).constructor):t.apply(e,n))}(this,t)).item=void 0,e.bookreader=void 0,e.baseHost="archive.org",e.fullscreen=!1,e.signedIn=!1,e.modal=void 0,e.sharedObserver=void 0,e.loaded=!1,e.menuShortcuts=[],e.menuContents=[],e.openMenuName="",e}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&&Vi(e,t)}(t,e),function(e,t,n){return t&&Fi(e.prototype,t),n&&Fi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"updated",value:function(){this.modal||this.setModalManager(),this.sharedObserver||(this.sharedObserver=new Di)}},{key:"itemNav",get:function(){return this.shadowRoot.querySelector("iaux-item-navigator")}},{key:"setModalManager",value:function(){var e=document.querySelector("modal-manager");e||(e=document.createElement("modal-manager"),document.body.appendChild(e)),this.modal=e}},{key:"manageFullscreen",value:function(e){var t=!!e.detail.isFullScreen;this.fullscreen=t,this.dispatchEvent(new CustomEvent("fullscreenStateUpdated",{detail:{fullscreen:t}}))}},{key:"loadingStateUpdated",value:function(e){var t=e.detail.loaded;this.loaded=t||null,this.dispatchEvent(new CustomEvent("loadingStateUpdated",{detail:{loaded:t}}))}},{key:"setMenuShortcuts",value:function(e){this.menuShortcuts=qi(e.detail)}},{key:"setMenuContents",value:function(e){var t=qi(e.detail);this.menuContents=t}},{key:"manageSideMenuEvents",value:function(e){var t,n=e.detail,r=n.menuId,o=n.action;if(r)if(this.openMenuName=r,"open"===o)null===(t=this.itemNav)||void 0===t||t.openShortcut(r);else if("toggle"===o){var i;null===(i=this.itemNav)||void 0===i||i.toggleMenu()}}},{key:"render",value:function(){return(0,r.qy)(Ii||(Ii=Hi(['\n <div class="main-component">\n <iaux-item-navigator\n ?viewportInFullscreen=',"\n .basehost=","\n .item=","\n .modal=","\n .loaded=","\n .sharedObserver=","\n ?signedIn=","\n .menuShortcuts=","\n .menuContents=","\n .openMenu=",'\n >\n <div slot="header">\n <slot name="header"></slot>\n </div>\n <div slot="main">\n <book-navigator\n .modal=',"\n .baseHost=","\n .itemMD=","\n ?signedIn=","\n ?sideMenuOpen=","\n .sharedObserver=","\n @ViewportInFullScreen=","\n @loadingStateUpdated=","\n @updateSideMenu=","\n @menuUpdated=","\n @menuShortcutsUpdated=",'\n >\n <div slot="main">\n <slot name="main"></slot>\n </div>\n </book-navigator>\n </div>\n </iaux-item-navigator>\n </div>\n '])),this.fullscreen,this.baseHost,this.item,this.modal,this.loaded,this.sharedObserver,this.signedIn,this.menuShortcuts,this.menuContents,this.openMenuName,this.modal,this.baseHost,this.item,this.signedIn,this.menuOpened,this.sharedObserver,this.manageFullscreen,this.loadingStateUpdated,this.manageSideMenuEvents,this.setMenuContents,this.setMenuShortcuts)}}],[{key:"properties",get:function(){return{item:{type:Object},baseHost:{type:String},signedIn:{type:Boolean},fullscreen:{type:Boolean,reflect:!0,attribute:!0},sharedObserver:{type:Object,attribute:!1},modal:{type:Object,attribute:!1},loaded:{type:Boolean},menuShortcuts:{type:Array},menuContents:{type:Array}}}},{key:"styles",get:function(){return(0,r.AH)(_i||(_i=Hi(['\n :host {\n display: block;\n --primaryBGColor: var(--black, #000);\n --secondaryBGColor: #222;\n --tertiaryBGColor: #333;\n --primaryTextColor: var(--white, #fff);\n --primaryCTAFill: #194880;\n --primaryCTABorder: #c5d1df;\n --secondaryCTAFill: #333;\n --secondaryCTABorder: #999;\n --primaryErrorCTAFill: #e51c26;\n --primaryErrorCTABorder: #f8c6c8;\n background-color: var(--primaryBGColor);\n position: relative;\n }\n\n :host([fullscreen]),\n iaux-item-navigator[viewportinfullscreen] {\n position: fixed;\n inset: 0;\n height: 100%;\n min-height: unset;\n }\n\n .main-component {\n height: 100%;\n width: 100%;\n min-height: inherit;\n }\n\n div[slot="header"],\n div[slot="main"] {\n display: flex;\n width: 100%;\n }\n\n slot {\n display: block;\n flex: 1;\n }\n\n iaux-item-navigator {\n min-height: var(--br-height, inherit);\n height: var(--br-height, inherit);\n display: block;\n width: 100%;\n color: var(--primaryTextColor);\n --menuButtonLabelDisplay: block;\n --menuWidth: 320px;\n --menuSliderBg: var(--secondaryBGColor);\n --activeButtonBg: var(--tertiaryBGColor);\n --subpanelRightBorderColor: var(--secondaryCTABorder);\n --animationTiming: 100ms;\n --iconFillColor: var(--primaryTextColor);\n --iconStrokeColor: var(--primaryTextColor);\n --menuSliderHeaderIconHeight: 2rem;\n --menuSliderHeaderIconWidth: 2rem;\n --iconWidth: 2.4rem;\n --iconHeight: 2.4rem;\n --shareLinkColor: var(--primaryTextColor);\n --shareIconBorder: var(--primaryTextColor);\n --shareIconBg: var(--secondaryBGColor);\n --activityIndicatorLoadingDotColor: var(--primaryTextColor);\n --activityIndicatorLoadingRingColor: var(--primaryTextColor);\n }\n '])))}}])}(r.WF);window.customElements.define("ia-bookreader",Ui)}},function(e){e(e.s=8134)}]);
1782
1821
  //# sourceMappingURL=ia-bookreader-bundle.js.map