@internetarchive/bookreader 5.0.0-106 → 5.0.0-108
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.
- package/BookReader/BookReader.js +1 -1
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/ia-bookreader-bundle.js +54 -60
- package/BookReader/ia-bookreader-bundle.js.map +1 -1
- package/BookReader/plugins/plugin.chapters.js +1 -4
- package/BookReader/plugins/plugin.chapters.js.map +1 -1
- package/package.json +12 -10
- package/src/BookReader.js +1 -1
- package/src/css/icon_checkmark.js +9 -0
- package/src/css/sharedStyles.js +15 -0
- package/src/{BookNavigator → ia-bookreader}/downloads/downloads.js +1 -1
- package/src/ia-bookreader/ia-bookreader.js +513 -71
- package/src/{BookNavigator → ia-bookreader}/viewable-files.js +4 -1
- package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments-provider.js +1 -2
- package/src/{BookNavigator → ia-bookreader}/visual-adjustments/visual-adjustments.js +4 -14
- package/src/{BookNavigator → plugins}/bookmarks/bookmark-button.js +1 -1
- package/src/{BookNavigator → plugins}/bookmarks/bookmark-edit.js +41 -28
- package/src/{BookNavigator → plugins}/bookmarks/bookmarks-list.js +46 -46
- package/src/{BookNavigator → plugins}/bookmarks/bookmarks-loginCTA.js +1 -1
- package/src/{BookNavigator → plugins}/bookmarks/bookmarks-provider.js +1 -1
- package/src/{BookNavigator → plugins}/bookmarks/ia-bookmarks.js +2 -2
- package/src/{BookNavigator → plugins}/search/search-results.js +14 -20
- package/src/util/lit.js +17 -0
- package/src/BookNavigator/assets/ia-logo.js +0 -17
- package/src/BookNavigator/assets/icon_checkmark.js +0 -6
- package/src/BookNavigator/assets/icon_close.js +0 -3
- package/src/BookNavigator/book-navigator.js +0 -620
- /package/src/{BookNavigator/assets → css}/button-base.js +0 -0
- /package/src/{BookNavigator → ia-bookreader}/downloads/downloads-provider.js +0 -0
- /package/src/{BookNavigator → ia-bookreader}/sharing.js +0 -0
- /package/src/{BookNavigator/assets → plugins/bookmarks}/bookmark-colors.js +0 -0
- /package/src/{BookNavigator → plugins/bookmarks}/delete-modal-actions.js +0 -0
- /package/src/{BookNavigator → plugins}/search/search-provider.js +0 -0
|
@@ -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}},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`
|
|
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}},7442: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(3851),n(1278),n(875),n(825),n(888),n(8781),n(7764),n(3500),n(2953),n(8706),n(2008),n(113),n(2062),n(9085),n(5506),n(9432),n(6099),n(7495),n(1761),n(5746);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(8598),n(1415),n(744),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 C{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}}C.shared=new C;class S{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}}S.shared=new S;class x{parseValue(e){if("string"==typeof e)return e}}x.shared=new x;class O{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?S.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 _ extends P{constructor(e){super(C.shared,e)}}class A extends P{constructor(e){super(S.shared,e)}}class z extends P{constructor(e){super(k.shared,e)}}class T extends P{constructor(e){super(j.shared,e)}}class L extends P{constructor(e){super(M.shared,e)}}class I extends P{constructor(e){super(w.shared,e)}}class $ extends P{constructor(e){super(x.shared,e)}}class q extends P{constructor(e,t){super(t,e)}}class H extends q{constructor(e){super(e,new O(j.shared))}}class D{get identifier(){return this.rawMetadata.identifier}get addeddate(){return null!=this.rawMetadata.addeddate?new _(this.rawMetadata.addeddate):void 0}get audio_codec(){return null!=this.rawMetadata.audio_codec?new T(this.rawMetadata.audio_codec):void 0}get audio_sample_rate(){return null!=this.rawMetadata.audio_sample_rate?new z(this.rawMetadata.audio_sample_rate):void 0}get avg_rating(){return null!=this.rawMetadata.avg_rating?new z(this.rawMetadata.avg_rating):void 0}get collection(){return null!=this.rawMetadata.collection?new T(this.rawMetadata.collection):void 0}get collections_raw(){return null!=this.rawMetadata.collections_raw?new T(this.rawMetadata.collections_raw):void 0}get collection_size(){return null!=this.rawMetadata.collection_size?new I(this.rawMetadata.collection_size):void 0}get contact(){return null!=this.rawMetadata.contact?new T(this.rawMetadata.contact):void 0}get contributor(){return null!=this.rawMetadata.contributor?new T(this.rawMetadata.contributor):void 0}get coverage(){return null!=this.rawMetadata.coverage?new T(this.rawMetadata.coverage):void 0}get creator(){return null!=this.rawMetadata.creator?new T(this.rawMetadata.creator):void 0}get creator_alt_script(){return null!=this.rawMetadata["creator-alt-script"]?new T(this.rawMetadata["creator-alt-script"]):void 0}get credits(){return null!=this.rawMetadata.credits?new T(this.rawMetadata.credits):void 0}get collection_layout(){return null!=this.rawMetadata.collection_layout?new T(this.rawMetadata.collection_layout):void 0}get date(){return null!=this.rawMetadata.date?new _(this.rawMetadata.date):void 0}get description(){return null!=this.rawMetadata.description?new T(this.rawMetadata.description):void 0}get downloads(){return null!=this.rawMetadata.downloads?new z(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 T(this.rawMetadata["external-identifier"]):void 0}get external_link(){return null!=this.rawMetadata["external-link"]?new T(this.rawMetadata["external-link"]):void 0}get files_count(){return null!=this.rawMetadata.files_count?new z(this.rawMetadata.files_count):void 0}get indexdate(){return null!=this.rawMetadata.indexdate?new _(this.rawMetadata.indexdate):void 0}get isbn(){return null!=this.rawMetadata.isbn?new T(this.rawMetadata.isbn):void 0}get issue(){return null!=this.rawMetadata.issue?new T(this.rawMetadata.issue):void 0}get item_count(){return null!=this.rawMetadata.item_count?new z(this.rawMetadata.item_count):void 0}get item_size(){return null!=this.rawMetadata.item_size?new I(this.rawMetadata.item_size):void 0}get language(){return null!=this.rawMetadata.language?new T(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 T(this.rawMetadata.licenseurl):void 0}get lineage(){return null!=this.rawMetadata.lineage?new T(this.rawMetadata.lineage):void 0}get month(){return null!=this.rawMetadata.month?new z(this.rawMetadata.month):void 0}get mediatype(){return null!=this.rawMetadata.mediatype?new $(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 T(this.rawMetadata.notes):void 0}get num_favorites(){return null!=this.rawMetadata.num_favorites?new z(this.rawMetadata.num_favorites):void 0}get num_reviews(){return null!=this.rawMetadata.num_reviews?new z(this.rawMetadata.num_reviews):void 0}get openlibrary_edition(){return null!=this.rawMetadata.openlibrary_edition?new T(this.rawMetadata.openlibrary_edition):void 0}get openlibrary_work(){return null!=this.rawMetadata.openlibrary_work?new T(this.rawMetadata.openlibrary_work):void 0}get page_progression(){return null!=this.rawMetadata.page_progression?new L(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 T(this.rawMetadata.partner):void 0}get post_text(){return null!=this.rawMetadata.post_text?new T(this.rawMetadata.post_text):void 0}get ppi(){return null!=this.rawMetadata.ppi?new z(this.rawMetadata.ppi):void 0}get publicdate(){return null!=this.rawMetadata.publicdate?new _(this.rawMetadata.publicdate):void 0}get publisher(){return null!=this.rawMetadata.publisher?new T(this.rawMetadata.publisher):void 0}get reviewdate(){return null!=this.rawMetadata.reviewdate?new _(this.rawMetadata.reviewdate):void 0}get rights(){return null!=this.rawMetadata.rights?new T(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(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 T(this.rawMetadata.scanner):void 0}get segments(){return null!=this.rawMetadata.segments?new T(this.rawMetadata.segments):void 0}get shotlist(){return null!=this.rawMetadata.shotlist?new T(this.rawMetadata.shotlist):void 0}get source(){return null!=this.rawMetadata.source?new T(this.rawMetadata.source):void 0}get sponsor(){return null!=this.rawMetadata.sponsor?new T(this.rawMetadata.sponsor):void 0}get start_localtime(){return null!=this.rawMetadata.start_localtime?new _(this.rawMetadata.start_localtime):void 0}get start_time(){return null!=this.rawMetadata.start_time?new _(this.rawMetadata.start_time):void 0}get stop_time(){return null!=this.rawMetadata.stop_time?new _(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 T(this.rawMetadata.taper):void 0}get title(){return null!=this.rawMetadata.title?new T(this.rawMetadata.title):void 0}get title_alt_script(){return null!=this.rawMetadata["title-alt-script"]?new T(this.rawMetadata["title-alt-script"]):void 0}get transferer(){return null!=this.rawMetadata.transferer?new T(this.rawMetadata.transferer):void 0}get track(){return null!=this.rawMetadata.track?new z(this.rawMetadata.track):void 0}get type(){return null!=this.rawMetadata.type?new T(this.rawMetadata.type):void 0}get uploader(){return null!=this.rawMetadata.uploader?new T(this.rawMetadata.uploader):void 0}get utc_offset(){return null!=this.rawMetadata.utc_offset?new z(this.rawMetadata.utc_offset):void 0}get venue(){return null!=this.rawMetadata.venue?new T(this.rawMetadata.venue):void 0}get volume(){return null!=this.rawMetadata.volume?new T(this.rawMetadata.volume):void 0}get week(){return null!=this.rawMetadata.week?new z(this.rawMetadata.week):void 0}get year(){return null!=this.rawMetadata.year?new z(this.rawMetadata.year):void 0}constructor(e={}){this.rawMetadata=e}}o([v()],D.prototype,"addeddate",null),o([v()],D.prototype,"audio_codec",null),o([v()],D.prototype,"audio_sample_rate",null),o([v()],D.prototype,"avg_rating",null),o([v()],D.prototype,"collection",null),o([v()],D.prototype,"collections_raw",null),o([v()],D.prototype,"collection_size",null),o([v()],D.prototype,"contact",null),o([v()],D.prototype,"contributor",null),o([v()],D.prototype,"coverage",null),o([v()],D.prototype,"creator",null),o([v()],D.prototype,"creator_alt_script",null),o([v()],D.prototype,"credits",null),o([v()],D.prototype,"collection_layout",null),o([v()],D.prototype,"date",null),o([v()],D.prototype,"description",null),o([v()],D.prototype,"downloads",null),o([v()],D.prototype,"duration",null),o([v()],D.prototype,"external_identifier",null),o([v()],D.prototype,"external_link",null),o([v()],D.prototype,"files_count",null),o([v()],D.prototype,"indexdate",null),o([v()],D.prototype,"isbn",null),o([v()],D.prototype,"issue",null),o([v()],D.prototype,"item_count",null),o([v()],D.prototype,"item_size",null),o([v()],D.prototype,"language",null),o([v()],D.prototype,"length",null),o([v()],D.prototype,"licenseurl",null),o([v()],D.prototype,"lineage",null),o([v()],D.prototype,"month",null),o([v()],D.prototype,"mediatype",null),o([v()],D.prototype,"noindex",null),o([v()],D.prototype,"notes",null),o([v()],D.prototype,"num_favorites",null),o([v()],D.prototype,"num_reviews",null),o([v()],D.prototype,"openlibrary_edition",null),o([v()],D.prototype,"openlibrary_work",null),o([v()],D.prototype,"page_progression",null),o([v()],D.prototype,"paginated",null),o([v()],D.prototype,"partner",null),o([v()],D.prototype,"post_text",null),o([v()],D.prototype,"ppi",null),o([v()],D.prototype,"publicdate",null),o([v()],D.prototype,"publisher",null),o([v()],D.prototype,"reviewdate",null),o([v()],D.prototype,"rights",null),o([v()],D.prototype,"rights_holder",null),o([v()],D.prototype,"runtime",null),o([v()],D.prototype,"scanner",null),o([v()],D.prototype,"segments",null),o([v()],D.prototype,"shotlist",null),o([v()],D.prototype,"source",null),o([v()],D.prototype,"sponsor",null),o([v()],D.prototype,"start_localtime",null),o([v()],D.prototype,"start_time",null),o([v()],D.prototype,"stop_time",null),o([v()],D.prototype,"subject",null),o([v()],D.prototype,"taper",null),o([v()],D.prototype,"title",null),o([v()],D.prototype,"title_alt_script",null),o([v()],D.prototype,"transferer",null),o([v()],D.prototype,"track",null),o([v()],D.prototype,"type",null),o([v()],D.prototype,"uploader",null),o([v()],D.prototype,"utc_offset",null),o([v()],D.prototype,"venue",null),o([v()],D.prototype,"volume",null),o([v()],D.prototype,"week",null),o([v()],D.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?C.shared.parseValue(this.rawValue.reviewdate):void 0}get createdate(){return null!=this.rawValue.createdate?C.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 D(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 W;!function(e){e.networkError="MetadataService.NetworkError",e.itemNotFound="MetadataService.ItemNotFound",e.decodingError="MetadataService.DecodingError",e.searchEngineError="MetadataService.SearchEngineError"}(W||(W={}));class V extends Error{constructor(e,t,n){super(t),this.name=e,this.type=e,this.details=n}}class Z{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 V(W.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 V(W.itemNotFound)}:{success:r.success.result}}}Z.default=new Z(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(W.networkError,t)}try{const e=await o.json(),t=e.error;if(t){const n=e.forensics;return this.getErrorResult(W.searchEngineError,t,n)}return{success:e}}catch(e){const t=e instanceof Error?e.message:"string"==typeof e?e:"Unknown error";return this.getErrorResult(W.decodingError,t)}}getErrorResult(e,t,n){return{error:new V(e,t,n)}}});var N=r.qy`
|
|
137
137
|
<svg
|
|
138
138
|
viewBox="0 0 40 40"
|
|
139
139
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
.stroke-color {
|
|
157
157
|
stroke: var(--iconStrokeColor);
|
|
158
158
|
}
|
|
159
|
-
`}render(){return
|
|
159
|
+
`}render(){return N}}customElements.define("ia-icon-ellipses",U);const G=r.AH`42px`,J=r.AH`var(--menuWidth, 320px)`,X=r.AH`var(--animationTiming, 200ms)`;var Q=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 ${
|
|
167
|
+
transition: transform ${X} ease-out;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
170
|
.menu {
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
left: ${G};
|
|
238
238
|
z-index: 1;
|
|
239
239
|
transform: translateX(calc(${J} * -1));
|
|
240
|
-
transition: transform ${
|
|
240
|
+
transition: transform ${X} ease-out;
|
|
241
241
|
background: var(--activeButtonBg);
|
|
242
242
|
border-right: 0.2rem solid;
|
|
243
243
|
border-color: var(--subpanelRightBorderColor);
|
|
@@ -264,7 +264,7 @@
|
|
|
264
264
|
overflow: auto;
|
|
265
265
|
overscroll-behavior: contain;
|
|
266
266
|
}
|
|
267
|
-
`,
|
|
267
|
+
`,K=r.qy`
|
|
268
268
|
<svg
|
|
269
269
|
viewBox="0 0 18 18"
|
|
270
270
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -274,7 +274,7 @@
|
|
|
274
274
|
<desc id="collapseSidebarDescID">A circle with a left pointing chevron</desc>
|
|
275
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" />
|
|
276
276
|
</svg>
|
|
277
|
-
`;class
|
|
277
|
+
`;class Y extends r.WF{static get styles(){return r.AH`
|
|
278
278
|
:host {
|
|
279
279
|
width: var(--iconWidth, 'auto');
|
|
280
280
|
height: var(--iconHeight, 'auto');
|
|
@@ -287,7 +287,7 @@
|
|
|
287
287
|
.stroke-color {
|
|
288
288
|
stroke: var(--iconStrokeColor);
|
|
289
289
|
}
|
|
290
|
-
`}render(){return
|
|
290
|
+
`}render(){return K}}customElements.define("ia-icon-collapse-sidebar",Y);var ee=r.AH`
|
|
291
291
|
a {
|
|
292
292
|
display: inline-block;
|
|
293
293
|
text-decoration: none;
|
|
@@ -394,7 +394,7 @@
|
|
|
394
394
|
>
|
|
395
395
|
${this.menuItem}
|
|
396
396
|
</button>
|
|
397
|
-
`}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
|
|
397
|
+
`}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 Q}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`
|
|
398
398
|
<li>
|
|
399
399
|
<menu-button
|
|
400
400
|
@menuTypeSelected=${this.setSelectedMenu}
|
|
@@ -936,9 +936,9 @@
|
|
|
936
936
|
.stroke-color {
|
|
937
937
|
stroke: var(--iconStrokeColor);
|
|
938
938
|
}
|
|
939
|
-
`}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)},
|
|
939
|
+
`}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)},Ce=r.qy`<ia-icon-share
|
|
940
940
|
style="width: var(--iconWidth); height: var(--iconHeight);"
|
|
941
|
-
></ia-icon-share>`;let
|
|
941
|
+
></ia-icon-share>`;let Se=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`
|
|
942
942
|
${this.header}
|
|
943
943
|
<div>
|
|
944
944
|
${this.sharingOptions.map(e=>r.qy` <a class="share-option" href="${e.url}" target="_blank">
|
|
@@ -1085,7 +1085,7 @@
|
|
|
1085
1085
|
small.visible {
|
|
1086
1086
|
opacity: 1;
|
|
1087
1087
|
}
|
|
1088
|
-
`}};o([(0,i.MZ)({type:String})],
|
|
1088
|
+
`}};o([(0,i.MZ)({type:String})],Se.prototype,"baseHost",void 0),o([(0,i.MZ)({type:String})],Se.prototype,"creator",void 0),o([(0,i.MZ)({type:String})],Se.prototype,"description",void 0),o([(0,i.MZ)({type:Boolean})],Se.prototype,"embedOptionsVisible",void 0),o([(0,i.MZ)({type:String})],Se.prototype,"identifier",void 0),o([(0,i.MZ)({type:Array})],Se.prototype,"sharingOptions",void 0),o([(0,i.MZ)({type:String})],Se.prototype,"type",void 0),o([(0,i.MZ)({type:Boolean})],Se.prototype,"renderHeader",void 0),o([(0,i.MZ)({type:String})],Se.prototype,"fileSubPrefix",void 0),Se=o([(0,i.EM)("iaux-in-share-panel")],Se),n(6033);var xe=a.ge.I,Oe=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(Oe(),i),s=o.insertBefore(Oe(),i);n=new xe(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 _e(e){return _e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_e(e)}function Ae(e,t){if(e){if("string"==typeof e)return ze(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)?ze(e,t):void 0}}function ze(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 Te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Le(r.key),r)}}function Le(e){var t=function(e){if("object"!=_e(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_e(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_e(t)?t:t+""}function Ie(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ie=function(){return!!e})()}function $e(e){return $e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},$e(e)}function qe(e,t){return qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qe(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},De=(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=$e(t),function(e,t){if(t&&("object"==_e(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,Ie()?Reflect.construct(t,n||[],$e(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&&qe(e,t)}(t,e),function(e,t){return t&&Te(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 C=Me(e,l[v]);je(C,u[y]),m[y]=C}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 S=Me(e,m[g+1]);je(S,u[y]),m[y++]=S}for(;v<=b;){var x=l[v++];null!==x&&Ee(x)}return this.ut=d,Pe(e,m),a.c0}}])}(s.WL));const Re=r.qy`
|
|
1089
1089
|
<svg
|
|
1090
1090
|
name="sort-asc"
|
|
1091
1091
|
height="18"
|
|
@@ -1142,7 +1142,7 @@
|
|
|
1142
1142
|
/>
|
|
1143
1143
|
</g>
|
|
1144
1144
|
</svg>
|
|
1145
|
-
`,
|
|
1145
|
+
`,We=r.qy`
|
|
1146
1146
|
<svg
|
|
1147
1147
|
name="sort-neutral"
|
|
1148
1148
|
height="18"
|
|
@@ -1162,7 +1162,7 @@
|
|
|
1162
1162
|
<circle cx="13" cy="9" r="2" />
|
|
1163
1163
|
</g>
|
|
1164
1164
|
</svg>
|
|
1165
|
-
`,
|
|
1165
|
+
`,Ve=r.qy`
|
|
1166
1166
|
<svg
|
|
1167
1167
|
height="24"
|
|
1168
1168
|
viewBox="0 0 24 24"
|
|
@@ -1178,13 +1178,13 @@
|
|
|
1178
1178
|
/>
|
|
1179
1179
|
</g>
|
|
1180
1180
|
</svg>
|
|
1181
|
-
`;let
|
|
1181
|
+
`;let Ze=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`
|
|
1182
1182
|
<button
|
|
1183
1183
|
class="sort-by neutral-icon"
|
|
1184
1184
|
aria-label="Sort volumes in initial order"
|
|
1185
1185
|
@click=${()=>this.sortVolumes("title_asc")}
|
|
1186
1186
|
>
|
|
1187
|
-
${
|
|
1187
|
+
${We}
|
|
1188
1188
|
</button>
|
|
1189
1189
|
`,title_asc:r.qy`
|
|
1190
1190
|
<button
|
|
@@ -1210,7 +1210,7 @@
|
|
|
1210
1210
|
--iconWidth: var(--menuSliderHeaderIconWidth);
|
|
1211
1211
|
--iconHeight: var(--menuSliderHeaderIconHeight);
|
|
1212
1212
|
}
|
|
1213
|
-
`}};o([(0,i.MZ)({type:Array})],
|
|
1213
|
+
`}};o([(0,i.MZ)({type:Array})],Ze.prototype,"fileListRaw",void 0),o([(0,i.MZ)({type:Array})],Ze.prototype,"fileListSorted",void 0),o([(0,i.MZ)({type:String,reflect:!0})],Ze.prototype,"sortOrderBy",void 0),Ze=o([(0,i.EM)("iaux-in-sort-files-button")],Ze);let Ne=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`
|
|
1214
1214
|
<li class="content active">
|
|
1215
1215
|
<div class="separator"></div>
|
|
1216
1216
|
<a class="container" href="${t}">
|
|
@@ -1236,7 +1236,7 @@
|
|
|
1236
1236
|
</a>
|
|
1237
1237
|
</div>
|
|
1238
1238
|
</li>
|
|
1239
|
-
`}get fileListTemplate(){const e=
|
|
1239
|
+
`}get fileListTemplate(){const e=De(this.fileList,e=>null==e?void 0:e.file_prefix,this.fileLi.bind(this));return r.qy`
|
|
1240
1240
|
<ul>
|
|
1241
1241
|
${e}
|
|
1242
1242
|
<div class="separator"></div>
|
|
@@ -1350,15 +1350,12 @@
|
|
|
1350
1350
|
width: 1px;
|
|
1351
1351
|
overflow: hidden;
|
|
1352
1352
|
}
|
|
1353
|
-
`}};o([(0,i.MZ)({type:String})],
|
|
1353
|
+
`}};o([(0,i.MZ)({type:String})],Ne.prototype,"baseHost",void 0),o([(0,i.MZ)({type:String})],Ne.prototype,"sortOrderBy",void 0),o([(0,i.MZ)({type:String})],Ne.prototype,"subPrefix",void 0),o([(0,i.MZ)({type:Array})],Ne.prototype,"fileList",void 0),o([(0,i.MZ)({type:Boolean,reflect:!0})],Ne.prototype,"addSortToUrl",void 0),Ne=o([(0,i.EM)("iaux-in-viewable-files-panel")],Ne);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`
|
|
1354
1354
|
<svg
|
|
1355
1355
|
viewBox="0 0 40 40"
|
|
1356
1356
|
version="1.1"
|
|
1357
1357
|
xmlns="http://www.w3.org/2000/svg"
|
|
1358
|
-
aria-labelledby="closeTitleID closeDescID"
|
|
1359
1358
|
>
|
|
1360
|
-
<title id="closeTitleID">Close icon</title>
|
|
1361
|
-
<desc id="closeDescID">A line drawing of an X</desc>
|
|
1362
1359
|
<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"/>
|
|
1363
1360
|
</svg>
|
|
1364
1361
|
`,Je=r.qy`
|
|
@@ -1366,10 +1363,7 @@
|
|
|
1366
1363
|
class="ia-logo"
|
|
1367
1364
|
viewBox="0 0 27 30"
|
|
1368
1365
|
xmlns="http://www.w3.org/2000/svg"
|
|
1369
|
-
aria-labelledby="logoTitleID logoDescID"
|
|
1370
1366
|
>
|
|
1371
|
-
<title id="logoTitleID">Internet Archive logo</title>
|
|
1372
|
-
<desc id="logoDescID">A line drawing of the Internet Archive headquarters building façade.</desc>
|
|
1373
1367
|
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
1374
1368
|
<mask id="mask-2" class="fill-color">
|
|
1375
1369
|
<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>
|
|
@@ -1380,7 +1374,7 @@
|
|
|
1380
1374
|
</g>
|
|
1381
1375
|
</g>
|
|
1382
1376
|
</svg>
|
|
1383
|
-
`;let
|
|
1377
|
+
`;let Xe=class extends r.WF{constructor(){super(...arguments),this.config=new Ue}render(){return r.qy`
|
|
1384
1378
|
<div class="modal-wrapper">
|
|
1385
1379
|
<div class="modal-container">
|
|
1386
1380
|
<header style="background-color: ${this.config.headerColor}">
|
|
@@ -1570,7 +1564,7 @@
|
|
|
1570
1564
|
clip: rect(0, 0, 0, 0);
|
|
1571
1565
|
border: 0;
|
|
1572
1566
|
}
|
|
1573
|
-
`}};var
|
|
1567
|
+
`}};var Qe;o([(0,i.MZ)({type:Object})],Xe.prototype,"config",void 0),Xe=o([(0,i.EM)("modal-template")],Xe),function(e){e.Open="open",e.Closed="closed"}(Qe||(Qe={}));class Ke{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 Qe.Open:this.startResizeListener(),this.stopDocumentScroll();break;case Qe.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 Ye=class extends r.WF{constructor(){super(...arguments),this.mode=Qe.Closed,this.hostBridge=new Ke(this),this.closeOnBackdropClick=!0}render(){return r.qy`
|
|
1574
1568
|
<div class="container">
|
|
1575
1569
|
<div class="backdrop" @click=${this.backdropClicked}></div>
|
|
1576
1570
|
<modal-template
|
|
@@ -1580,7 +1574,7 @@
|
|
|
1580
1574
|
${this.customModalContent}
|
|
1581
1575
|
</modal-template>
|
|
1582
1576
|
</div>
|
|
1583
|
-
`}getMode(){return this.mode}closeModal(){this.mode=
|
|
1577
|
+
`}getMode(){return this.mode}closeModal(){this.mode=Qe.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=Qe.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`
|
|
1584
1578
|
.container {
|
|
1585
1579
|
width: 100%;
|
|
1586
1580
|
height: 100%;
|
|
@@ -1606,20 +1600,30 @@
|
|
|
1606
1600
|
width: ${n};
|
|
1607
1601
|
max-width: ${o};
|
|
1608
1602
|
}
|
|
1609
|
-
`}};o([(0,i.MZ)({type:String,reflect:!0})],
|
|
1603
|
+
`}};o([(0,i.MZ)({type:String,reflect:!0})],Ye.prototype,"mode",void 0),o([(0,i.MZ)({type:Object})],Ye.prototype,"customModalContent",void 0),o([(0,i.MZ)({type:Object})],Ye.prototype,"hostBridge",void 0),o([(0,i.P)("modal-template")],Ye.prototype,"modalTemplate",void 0),Ye=o([(0,i.EM)("modal-manager")],Ye);class et{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)))}}class tt extends r.WF{static get styles(){return r.AH`
|
|
1604
|
+
:host {
|
|
1605
|
+
width: var(--iconWidth, 'auto');
|
|
1606
|
+
height: var(--iconHeight, 'auto');
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
.fill-color {
|
|
1610
|
+
fill: var(--iconFillColor);
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
.stroke-color {
|
|
1614
|
+
stroke: var(--iconStrokeColor);
|
|
1615
|
+
}
|
|
1616
|
+
`}render(){return Je}}customElements.define("ia-icon-ia-logo",tt);var nt=r.qy`
|
|
1610
1617
|
<svg
|
|
1611
1618
|
viewBox="0 0 100 100"
|
|
1612
1619
|
xmlns="http://www.w3.org/2000/svg"
|
|
1613
|
-
aria-labelledby="searchTitleID searchDescID"
|
|
1614
1620
|
>
|
|
1615
|
-
<title id="searchTitleID">Search icon</title>
|
|
1616
|
-
<desc id="searchDescID">Search for something.</desc>
|
|
1617
1621
|
<path
|
|
1618
1622
|
class="fill-color"
|
|
1619
1623
|
fill="none"
|
|
1620
1624
|
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" />
|
|
1621
1625
|
</svg>
|
|
1622
|
-
`;class
|
|
1626
|
+
`;class rt extends r.WF{static get styles(){return r.AH`
|
|
1623
1627
|
:host {
|
|
1624
1628
|
width: var(--iconWidth, 'auto');
|
|
1625
1629
|
height: var(--iconHeight, 'auto');
|
|
@@ -1632,20 +1636,17 @@
|
|
|
1632
1636
|
.stroke-color {
|
|
1633
1637
|
stroke: var(--iconStrokeColor);
|
|
1634
1638
|
}
|
|
1635
|
-
`}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`
|
|
1639
|
+
`}render(){return nt}}function ot(e){return ot="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},ot(e)}function it(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,at(r.key),r)}}function at(e){var t=function(e){if("object"!=ot(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ot(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ot(t)?t:t+""}function st(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(st=function(){return!!e})()}function lt(e){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lt(e)}function ct(e,t){return ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ct(e,t)}customElements.define("ia-icon-search",rt);var ut=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=lt(t),function(e,t){if(t&&("object"==ot(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,st()?Reflect.construct(t,n||[],lt(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&&ct(e,t)}(t,e),function(e,t){return t&&it(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);ut.directiveName="unsafeHTML",ut.resultType=1;var dt,ht,pt,ft,mt,vt,bt,yt,gt,kt,wt,Ct,St,xt,Ot,Mt,jt,Bt,Pt=(0,s.u$)(ut),Et=(0,r.qy)(dt||(pt=['\n<svg height="10" viewBox="0 0 13 10" width="13" xmlns="http://www.w3.org/2000/svg">\n <path\n d="m4.33333333 10-4.33333333-4.16666667 1.73333333-1.66666666 2.6 2.5 6.93333337-6.66666667 1.7333333 1.66666667z"\n fill="#fff" fill-rule="evenodd" />\n</svg>\n'],ft||(ft=pt.slice(0)),dt=Object.freeze(Object.defineProperties(pt,{raw:{value:Object.freeze(ft)}})))),_t=(0,r.AH)(ht||(ht=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"]))),At=n(4535),zt=(0,r.AH)(mt||(mt=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\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"])));function Tt(e){var t,n=(null===(t=e.prototype)||void 0===t?void 0:t.render())||e.strings[0];return(0,r.AH)(["data:image/svg+xml;base64,".concat(btoa(n.replace(/\n/g," ")))])}function Lt(e){return Lt="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},Lt(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,qt(r.key),r)}}function qt(e){var t=function(e){if("object"!=Lt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Lt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Lt(t)?t:t+""}function Ht(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ht=function(){return!!e})()}function Dt(e){return Dt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dt(e)}function Rt(e,t){return Rt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Rt(e,t)}n(5440);var Ft,Wt,Vt,Zt,Nt=Tt(Et),Ut=Tt(Ge),Gt=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"==Lt(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,Ht()?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&&Rt(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)(vt||(vt=It(["<header>\n <h3>Search inside</h3>\n ","\n </header>"])),this.resultsCount?(0,r.qy)(bt||(bt=It(["(",")"])),this.resultsCount):r.s6);return this.renderHeader?e:r.s6}},{key:"searchMultipleControls",get:function(){var e=(0,r.qy)(yt||(yt=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)(gt||(gt=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)(kt||(kt=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)(wt||(wt=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,At.J)(t.lang),Pt(t.html))}),function(t){t.preventDefault(),e.shadowRoot.querySelector(".results li:first-child .result-item").focus()})}},{key:"setErrorMessage",get:function(){return(0,r.qy)(Ct||(Ct=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)(St||(St=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)(xt||(xt=It(["var(--searchResultText, #adaedc)"]))),t=(0,r.AH)(Ot||(Ot=It(["var(--searchResultBg, #272958)"]))),n=(0,r.AH)(Mt||(Mt=It(["var(--searchResultBorder, #adaedc)"]))),o=(0,r.AH)(jt||(jt=It(["(--tertiaryBGColor, #333)"]))),i=(0,r.AH)(Bt||(Bt=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 10px;\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 margin-right: -5px;\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 "])),e,t,n,Nt,o,Ut,Ut);return[zt,_t,i]}}])}(r.WF);function Jt(e){return Jt="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},Jt(e)}function Xt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Qt(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,Kt(r.key),r)}}function Kt(e){var t=function(e){if("object"!=Jt(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Jt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Jt(t)?t:t+""}customElements.define("ia-book-search-results",Gt);var Yt,en,tn,nn,rn,on,an,sn,ln,cn,un,dn={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},hn=function(){return function(e,t){return t&&Qt(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)(Ft||(Ft=Xt(['\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=dn,t=e.resultsCount,n=e.query;if(e.queryInProgress||!n)return r.s6;var o=1===t?"result":"results";return(0,r.qy)(Wt||(Wt=Xt(["("," ",")"])),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(){dn={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),dn.query=r,dn.results=[],dn.resultsCount=0,dn.queryInProgress=!0,dn.errorMessage="",this.updateMenu()}},{key:"onBookSearchInitiated",value:function(e){var t=e.detail;dn.query=t.query,this.bookreader.search(dn.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;dn.query=(null==a?void 0:a.q)||"",dn.results=[],dn.resultsCount=0,dn.queryInProgress=!1,dn.errorMessage=(0,r.qy)(Vt||(Vt=Xt(['<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;dn={results:s,resultsCount:l,query:c,queryInProgress:!1,errorMessage:""},this.updateMenu()}},{key:"searchCanceledInMenu",value:function(){this.bookreader.plugins.search.cancelSearchRequest()}},{key:"onSearchResultsCleared",value:function(){dn={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(),dn.query?this.bookreader.urlPlugin.setUrlParam("q",dn.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=dn,t=e.query,n=e.results,o=e.queryInProgress,i=e.errorMessage;return(0,r.qy)(Zt||(Zt=Xt(["\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)}}])}(),pn=(n(2712),r.qy`
|
|
1636
1640
|
<svg
|
|
1637
1641
|
viewBox="0 0 100 100"
|
|
1638
1642
|
xmlns="http://www.w3.org/2000/svg"
|
|
1639
|
-
aria-labelledby="downloadTitleID downloadDescID"
|
|
1640
1643
|
>
|
|
1641
|
-
<title id="downloadTitleID">Download icon</title>
|
|
1642
|
-
<desc id="downloadDescID">An arrow pointing downward at an empty document tray</desc>
|
|
1643
1644
|
<g class="fill-color">
|
|
1644
1645
|
|
|
1645
1646
|
<path d="m50 80 33.3333333-43.3333333h-20v-36.6666667h-26.6666666v36.6666667h-20zm50 20v-13.3333333h-100v13.3333333z"/>
|
|
1646
1647
|
</g>
|
|
1647
1648
|
</svg>
|
|
1648
|
-
`);class
|
|
1649
|
+
`);class fn extends r.WF{static get styles(){return r.AH`
|
|
1649
1650
|
:host {
|
|
1650
1651
|
width: var(--iconWidth, 'auto');
|
|
1651
1652
|
height: var(--iconHeight, 'auto');
|
|
@@ -1658,17 +1659,14 @@
|
|
|
1658
1659
|
.stroke-color {
|
|
1659
1660
|
stroke: var(--iconStrokeColor);
|
|
1660
1661
|
}
|
|
1661
|
-
`}render(){return
|
|
1662
|
+
`}render(){return pn}}function mn(e){return mn="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},mn(e)}function vn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function bn(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,yn(r.key),r)}}function yn(e){var t=function(e){if("object"!=mn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mn(t)?t:t+""}function gn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(gn=function(){return!!e})()}function kn(e){return kn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kn(e)}function wn(e,t){return wn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wn(e,t)}customElements.define("ia-icon-dl",fn);var Cn,Sn,xn=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=kn(t),function(e,t){if(t&&("object"==mn(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,gn()?Reflect.construct(t,n||[],kn(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&&wn(e,t)}(t,e),function(e,t,n){return t&&bn(e.prototype,t),n&&bn(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"formatsCount",get:function(){var e=this.downloads.length;return e?(0,r.qy)(Yt||(Yt=vn(["<p>"," format","</p>"])),e,e>1?"s":""):(0,r.qy)(en||(en=vn([""])))}},{key:"loanExpiryMessage",get:function(){return this.expiration?(0,r.qy)(tn||(tn=vn(["<h2>These files will expire in "," days.</h2>"])),this.expiration):(0,r.qy)(nn||(nn=vn([""])))}},{key:"renderDownloadOptions",value:function(){return this.downloads.map(function(e){return(0,r.qy)(rn||(rn=vn(['\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)(on||(on=vn(["<p>","</p>"])),e.note):(0,r.qy)(an||(an=vn([""]))))})}},{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)(sn||(sn=vn(["\n <header>\n <h3>Downloadable files</h3>\n ","\n </header>\n "])),this.formatsCount):r.s6}},{key:"installLCPSoftwareMsg",get:function(){return(0,r.qy)(ln||(ln=vn(['\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)(cn||(cn=vn(["\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)(un||(un=vn(["\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[_t,e]}}])}(r.WF);function On(e){return On="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},On(e)}function Mn(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 jn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Bn(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"!=On(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=On(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==On(t)?t:t+""}customElements.define("ia-book-downloads",xn);var En={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."}},_n={pdf:"PDF",epub:"ePub",lcppdf:"LCP PDF",lcpepub:"LCP ePub"},An=function(){return function(e,t){return t&&Bn(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)(Cn||(Cn=jn(['<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 Mn(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)?Mn(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=En[s]||null;if(l){var c=e.isBookProtected?En[s].type:_n[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)(Sn||(Sn=jn(["<ia-book-downloads .downloads=","></ia-book-downloads>"])),this.downloads)}}])}(),zn=r.qy`
|
|
1662
1663
|
<svg
|
|
1663
1664
|
viewBox="0 0 24 24"
|
|
1664
1665
|
xmlns="http://www.w3.org/2000/svg"
|
|
1665
|
-
aria-labelledby="visualAdjustmentTitleID visualAdjustmentDescID"
|
|
1666
1666
|
>
|
|
1667
|
-
<title id="visualAdjustmentTitleID">Visual adjustment</title>
|
|
1668
|
-
<desc id="visualAdjustmentDescID">A circle with its left hemisphere filled</desc>
|
|
1669
1667
|
<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" />
|
|
1670
1668
|
</svg>
|
|
1671
|
-
`;class
|
|
1669
|
+
`;class Tn extends r.WF{static get styles(){return r.AH`
|
|
1672
1670
|
:host {
|
|
1673
1671
|
width: var(--iconWidth, 'auto');
|
|
1674
1672
|
height: var(--iconHeight, 'auto');
|
|
@@ -1681,14 +1679,11 @@
|
|
|
1681
1679
|
.stroke-color {
|
|
1682
1680
|
stroke: var(--iconStrokeColor);
|
|
1683
1681
|
}
|
|
1684
|
-
`}render(){return
|
|
1682
|
+
`}render(){return zn}}customElements.define("ia-icon-visual-adjustment",Tn);var Ln=r.qy`
|
|
1685
1683
|
<svg
|
|
1686
1684
|
viewBox="0 0 100 100"
|
|
1687
1685
|
xmlns="http://www.w3.org/2000/svg"
|
|
1688
|
-
aria-labelledby="magnify-minusTitleID magnify-minusDescID"
|
|
1689
1686
|
>
|
|
1690
|
-
<title id="magnify-minusTitleID">Zoom out</title>
|
|
1691
|
-
<desc id="magnify-minusDescID">Take a look further.</desc>
|
|
1692
1687
|
<g
|
|
1693
1688
|
class="fill-color"
|
|
1694
1689
|
fill="none"
|
|
@@ -1697,7 +1692,7 @@
|
|
|
1697
1692
|
<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"/>
|
|
1698
1693
|
</g>
|
|
1699
1694
|
</svg>
|
|
1700
|
-
`;class
|
|
1695
|
+
`;class In extends r.WF{static get styles(){return r.AH`
|
|
1701
1696
|
:host {
|
|
1702
1697
|
width: var(--iconWidth, 'auto');
|
|
1703
1698
|
height: var(--iconHeight, 'auto');
|
|
@@ -1710,14 +1705,11 @@
|
|
|
1710
1705
|
.stroke-color {
|
|
1711
1706
|
stroke: var(--iconStrokeColor);
|
|
1712
1707
|
}
|
|
1713
|
-
`}render(){return
|
|
1708
|
+
`}render(){return Ln}}customElements.define("ia-icon-magnify-minus",In);var $n,qn,Hn,Dn,Rn,Fn,Wn,Vn=r.qy`
|
|
1714
1709
|
<svg
|
|
1715
1710
|
viewBox="0 0 100 100"
|
|
1716
1711
|
xmlns="http://www.w3.org/2000/svg"
|
|
1717
|
-
aria-labelledby="magnify-plusTitleID magnify-plusDescID"
|
|
1718
1712
|
>
|
|
1719
|
-
<title id="magnify-plusTitleID">Zoom in</title>
|
|
1720
|
-
<desc id="magnify-plusDescID">Take a look closer.</desc>
|
|
1721
1713
|
<g
|
|
1722
1714
|
class="fill-color"
|
|
1723
1715
|
fill="none"
|
|
@@ -1726,7 +1718,7 @@
|
|
|
1726
1718
|
<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"/>
|
|
1727
1719
|
</g>
|
|
1728
1720
|
</svg>
|
|
1729
|
-
`;class
|
|
1721
|
+
`;class Zn extends r.WF{static get styles(){return r.AH`
|
|
1730
1722
|
:host {
|
|
1731
1723
|
width: var(--iconWidth, 'auto');
|
|
1732
1724
|
height: var(--iconHeight, 'auto');
|
|
@@ -1739,9 +1731,14 @@
|
|
|
1739
1731
|
.stroke-color {
|
|
1740
1732
|
stroke: var(--iconStrokeColor);
|
|
1741
1733
|
}
|
|
1742
|
-
`}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`
|
|
1743
|
-
<svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"
|
|
1744
|
-
|
|
1734
|
+
`}render(){return Vn}}function Nn(e){return Nn="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},Nn(e)}function Un(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Gn(e){return function(e){if(Array.isArray(e))return Jn(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 Jn(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)?Jn(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 Jn(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 Xn(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,Qn(r.key),r)}}function Qn(e){var t=function(e){if("object"!=Nn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Nn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Nn(t)?t:t+""}function Kn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Kn=function(){return!!e})()}function Yn(e){return Yn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Yn(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("ia-icon-magnify-plus",Zn);var tr,nr,rr=function(e){return"visualAdjustment".concat(e)},or={optionChange:rr("OptionChanged"),zoomIn:rr("ZoomIn"),zoomOut:rr("ZoomOut")},ir=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=Yn(t),function(e,t){if(t&&("object"==Nn(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,Kn()?Reflect.construct(t,n||[],Yn(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&&er(e,t)}(t,e),function(e,t,n){return t&&Xn(e.prototype,t),n&&Xn(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(Gn(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(or.optionChange,{bubbles:!0,composed:!0,detail:t}))}},{key:"emitZoomIn",value:function(){this.dispatchEvent(new CustomEvent(or.zoomIn))}},{key:"emitZoomOut",value:function(){this.dispatchEvent(new CustomEvent(or.zoomOut))}},{key:"changeActiveStateFor",value:function(e){var t=Gn(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=Gn(this.options);n.find(function(t){return t.id===e}).value=t,this.options=Gn(n)}},{key:"rangeSlider",value:function(e){var t=this;return(0,r.qy)($n||($n=Un(["\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)(qn||(qn=Un(['\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)(Hn||(Hn=Un(["<p>("," active)</p>"])),this.activeCount):r.s6,t=(0,r.qy)(Dn||(Dn=Un(["<header>\n <h3>Visual adjustments</h3>\n ","\n </header>"])),e);return this.renderHeader?t:r.s6}},{key:"zoomControls",get:function(){return(0,r.qy)(Rn||(Rn=Un(['\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)(Fn||(Fn=Un(["\n ","\n ","\n ","\n "])),this.headerSection,De(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(){var e=(0,r.AH)(Wn||(Wn=Un(['\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 '])));return[zt,e]}}])}(r.WF);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){(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 lr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function cr(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,ur(r.key),r)}}function ur(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+""}customElements.define("ia-book-visual-adjustments",ir);var dr,hr,pr=[{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}],fr=function(){return function(e,t){return t&&cr(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.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)(tr||(tr=lr(['<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)(nr||(nr=lr(["\n <ia-book-visual-adjustments\n .options=","\n @visualAdjustmentOptionChanged=","\n @visualAdjustmentZoomIn=","\n @visualAdjustmentZoomOut=","\n ></ia-book-visual-adjustments>\n "])),pr,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 sr(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 sr(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)?sr(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 mr(e){return mr="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},mr(e)}function vr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function br(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,yr(r.key),r)}}function yr(e){var t=function(e){if("object"!=mr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mr(t)?t:t+""}function gr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(gr=function(){return!!e})()}function kr(e){return kr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kr(e)}function wr(e,t){return wr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},wr(e,t)}var Cr,Sr,xr=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=kr(t),function(e,t){if(t&&("object"==mr(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,gr()?Reflect.construct(t,n||[],kr(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&&wr(e,t)}(t,e),function(e,t,n){return t&&br(e.prototype,t),n&&br(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(){var e=this;return(0,r.qy)(dr||(dr=vr(['\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)(hr||(hr=vr(['\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 Or(e){return Or="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},Or(e)}function Mr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}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"!=Or(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Or(t)?t:t+""}function Pr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Pr=function(){return!!e})()}function Er(e){return Er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Er(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("delete-modal-actions",xr);var Ar,zr=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=Er(t),function(e,t){if(t&&("object"==Or(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||[],Er(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&&_r(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:"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)(Cr||(Cr=Mr(["\n <button title="," @click="," class=",">\n <icon-bookmark state=",' aria-hidden="true"></icon-bookmark>\n </button>\n '])),this.title,this.handleClick,e,this.state)}}],[{key:"styles",get:function(){return(0,r.AH)(Sr||(Sr=Mr(["\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 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 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,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+""}function $r(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($r=function(){return!!e})()}function qr(e){return qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qr(e)}function Hr(e,t){return Hr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Hr(e,t)}customElements.define("bookmark-button",zr),n(4423),n(739),n(8940),n(3362),n(1699);var Dr,Rr,Fr,Wr,Vr,Zr,Nr,Ur,Gr,Jr=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=qr(t),function(e,t){if(t&&("object"==Tr(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,$r()?Reflect.construct(t,n||[],qr(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&&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(){return(0,r.qy)(Ar||(Ar=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 _t}}])}(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 Qr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Kr(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 Yr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kr(Object(n),!0).forEach(function(t){eo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eo(e,t,n){return(t=ao(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function to(){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 no(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]())):(no(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,no(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,no(d,"constructor",c),no(c,"constructor",l),l.displayName="GeneratorFunction",no(c,o,"GeneratorFunction"),no(d),no(d,o,"Generator"),no(d,r,function(){return this}),no(d,"toString",function(){return"[object Generator]"}),(to=function(){return{w:i,m:h}})()}function no(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}no=function(e,t,n,r){function i(t,n){no(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))},no(e,t,n,r)}function ro(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 oo(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ro(i,r,o,a,s,"next",e)}function s(e){ro(i,r,o,a,s,"throw",e)}a(void 0)})}}function io(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"!=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 so(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(so=function(){return!!e})()}function lo(e){return lo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lo(e)}function co(e,t){return co=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},co(e,t)}customElements.define("bookmarks-login",Jr);var uo,ho={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})})}},po=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=lo(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,so()?Reflect.construct(t,n||[],lo(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=ho,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&&co(e,t)}(t,e),function(e,t,n){return t&&io(e.prototype,t),n&&io(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=oo(to().m(function e(){return to().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 Yr(Yr({},c),{},{id:r,leafNum:r,page:u,thumbnail:d})}},{key:"fetchBookmarks",value:(n=oo(to().m(function e(){var t,n,r,o,i,a,s,l,c,u,d=this;return to().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(Yr(Yr({},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)(Dr||(Dr=Qr(["\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)(Rr||(Rr=Qr(["\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=Yr({},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)(Fr||(Fr=Qr(['\n <button\n class="ia-button primary"\n ?disabled=',"\n @click=",">\n Add bookmark\n </button>\n "])),this.shouldEnableAddBookmarkButton,this.addBookmark)}},{key:"bookmarksList",get:function(){return(0,r.qy)(Wr||(Wr=Qr(["\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,Yr({},this.bookmarks),this.activeBookmarkID,this.bookmarkColors,this.defaultColor)}},{key:"bookmarkHelperMessage",get:function(){return(0,r.qy)(Vr||(Vr=Qr(["<p>Please use 1up or 2up view modes to add bookmark.</p>"])))}},{key:"render",value:function(){var e=this,t=(0,r.qy)(Zr||(Zr=Qr(["\n ","\n ","\n "])),this.bookmarksList,this.allowAddingBookmark?this.addBookmarkButton:this.bookmarkHelperMessage);return(0,r.qy)(Nr||(Nr=Qr(['\n <section class="bookmarks">\n ',"\n </section>\n "])),"login"===this.displayMode?(0,r.qy)(Ur||(Ur=Qr(["<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)(Gr||(Gr=Qr(["\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[_t,e]}},{key:"formatPage",value:function(e){return isNaN(+e)?"(".concat(e.replace(/\D/g,""),")"):e}}]);var n,o}(r.WF);customElements.define("ia-bookmarks",po);var fo,mo,vo,bo,yo,go=(0,r.AH)(uo||(uo=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 ko(e){return ko="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},ko(e)}function wo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Co(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,So(r.key),r)}}function So(e){var t=function(e){if("object"!=ko(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ko(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ko(t)?t:t+""}function xo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(xo=function(){return!!e})()}function Oo(e){return Oo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Oo(e)}function Mo(e,t){return Mo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Mo(e,t)}var jo=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=Oo(t),function(e,t){if(t&&("object"==ko(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,xo()?Reflect.construct(t,n||[],Oo(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&&Mo(e,t)}(t,e),function(e,t,n){return t&&Co(e.prototype,t),n&&Co(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)(fo||(fo=wo(['\n <div class="color-option">\n <input type="radio" name="color" id="color_','" .value='," @change="," ?checked=",'>\n <label for="color_','" title=',">\n <icon-bookmark class=",' aria-hidden="true"></icon-bookmark>\n </label>\n </div>\n '])),e.id,e.id,function(){return t.changeColorTo(e.id)},this.bookmark.color===e.id,e.id,e.className,e.className)}},{key:"bookmarkTemplate",get:function(){return(0,r.qy)(mo||(mo=wo(['\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)(vo||(vo=wo(["\n ","\n ",'\n <form action="" method="put" @submit=','>\n <label for="note">Note <small>(optional)</small></label>\n <textarea rows="4" cols="80" name="note" id="note" @change=',">",'</textarea>\n <fieldset>\n <legend>Bookmark color</legend>\n <div class="color-options">\n ','\n </div>\n </fieldset>\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 </form>\n '])),this.renderHeader?t.headerSection:r.s6,this.showBookmark?this.bookmarkTemplate:r.s6,this.emitSaveEvent,this.updateNote,this.bookmark.note,De(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)(bo||(bo=wo(["<header>\n <h3>Edit Bookmark</h3>\n </header>"])))}},{key:"styles",get:function(){var e=(0,r.AH)(yo||(yo=wo(['\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: 0;\n border: none;\n }\n\n label, legend {\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 .color-options {\n display: flex;\n gap: 10px;\n }\n\n .color-option {\n position: relative;\n }\n\n .color-option input {\n position: absolute;\n opacity: 0;\n width: 0;\n height: 0;\n pointer-events: none;\n }\n\n .color-option 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 .color-option input:checked + label {\n border-color: var(--primaryTextColor);\n }\n\n .color-option input:focus + label {\n outline: 2px solid currentColor;\n outline-offset: 2px;\n }\n\n .color-option input:focus:not(:focus-visible) + label {\n outline: none;\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 margin-top: 20px;\n display: grid;\n grid-template-columns: auto auto;\n grid-gap: 0 1rem;\n justify-items: stretch;\n }\n '])));return[_t,go,e]}}])}(r.WF);customElements.define("ia-bookmark-edit",jo),n(6910);var Bo,Po,Eo,_o,Ao,zo,To,Lo,Io=r.qy`
|
|
1735
|
+
<svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg">
|
|
1736
|
+
<path
|
|
1737
|
+
class="fill-color"
|
|
1738
|
+
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"
|
|
1739
|
+
fill-rule="evenodd" />
|
|
1740
|
+
</svg>
|
|
1741
|
+
`;class $o extends r.WF{static get styles(){return r.AH`
|
|
1745
1742
|
:host {
|
|
1746
1743
|
width: var(--iconWidth, 'auto');
|
|
1747
1744
|
height: var(--iconHeight, 'auto');
|
|
@@ -1754,7 +1751,7 @@
|
|
|
1754
1751
|
.stroke-color {
|
|
1755
1752
|
stroke: var(--iconStrokeColor);
|
|
1756
1753
|
}
|
|
1757
|
-
`}render(){return
|
|
1754
|
+
`}render(){return Io}}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 Ho(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Do(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"!=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+""}function Fo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Fo=function(){return!!e})()}function Wo(e){return Wo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Wo(e)}function Vo(e,t){return Vo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Vo(e,t)}customElements.define("ia-icon-edit-pencil",$o);var Zo,No=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=Wo(t),function(e,t){if(t&&("object"==qo(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,Fo()?Reflect.construct(t,n||[],Wo(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&&Vo(e,t)}(t,e),function(e,t,n){return t&&Do(e.prototype,t),n&&Do(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)(Bo||(Bo=Ho(["\n <li data-pageIndex=",'>\n <div class="separator"></div>\n <div class="bookmark-card ','">\n <div class="bookmark-header" @click=',">\n <button>\n <icon-bookmark class=",' aria-label="',' bookmark"></icon-bookmark>\n <span> Page ','</span>\n </button>\n <button\n class="edit"\n @click=','\n title="Edit this bookmark"\n aria-expanded=','\n >\n <ia-icon-edit-pencil aria-hidden="true"></ia-icon-edit-pencil>\n </button>\n </div>\n ',"\n ","\n </div>\n </li>\n "])),e.id,i,function(){return t.emitSelectedEvent(e)},o,o,e.page,function(n){return t.editBookmark(n,e)},n?"true":"false",!n&&e.note?(0,r.qy)(Po||(Po=Ho(["<p>","</p>"])),e.note):r.s6,n?this.editBookmarkComponent:r.s6)}},{key:"editBookmarkComponent",get:function(){return(0,r.qy)(Eo||(Eo=Ho(["\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)(_o||(_o=Ho(["<small>(",")</small>"])),e)}},{key:"headerSection",get:function(){return(0,r.qy)(Ao||(Ao=Ho(["<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=De(e,function(e){return null==e?void 0:e.id},this.bookmarkItem.bind(this));return(0,r.qy)(zo||(zo=Ho(["\n <ul>\n ",'\n <div class="separator"></div>\n </ul>\n '])),t)}},{key:"render",value:function(){return(0,r.qy)(To||(To=Ho(["\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)(Lo||(Lo=Ho(["\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 .bookmark-header {\n display: flex;\n align-items: center;\n margin: 0;\n font-size: 1.4rem;\n font-weight: bold;\n }\n\n .bookmark-header > button:first-child {\n flex: 1;\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 4px;\n }\n\n ia-icon-edit-pencil {\n pointer-events: none;\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 position: relative;\n }\n\n li .bookmark-card {\n border: var(--activeBorderWidth) solid transparent;\n border-radius: 4px;\n }\n\n li .bookmark-card.active {\n border: var(--activeBorderWidth) solid #538bc5;\n }\n\n .bookmark-header button {\n background: transparent;\n cursor: pointer;\n -webkit-appearance: none;\n appearance: none;\n box-sizing: border-box;\n border: none;\n padding: 0;\n text-align: left;\n }\n\n li button.edit {\n height: 34px;\n width: 34px;\n flex-shrink: 0;\n text-align: center;\n }\n "]))),go]}}])}(r.WF);customElements.define("ia-bookmarks-list",No);class Uo extends r.WF{static get styles(){return r.AH`
|
|
1758
1755
|
:host {
|
|
1759
1756
|
width: var(--iconWidth, 'auto');
|
|
1760
1757
|
height: var(--iconHeight, 'auto');
|
|
@@ -1800,10 +1797,7 @@
|
|
|
1800
1797
|
viewBox="0 0 16 24"
|
|
1801
1798
|
width="16"
|
|
1802
1799
|
xmlns="http://www.w3.org/2000/svg"
|
|
1803
|
-
aria-labelledby="bookmarkTitleID bookmarDescID"
|
|
1804
1800
|
>
|
|
1805
|
-
<title id="bookmarkTitleID">Bookmark icon</title>
|
|
1806
|
-
<desc id="bookmarkDescID">An outline of the shape of a bookmark</desc>
|
|
1807
1801
|
<path
|
|
1808
1802
|
id="filled"
|
|
1809
1803
|
d="m1 0h14c.5522847 0 1 .44771525 1 1v23l-8-5.4545455-8 5.4545455v-23c0-.55228475.44771525-1 1-1z"
|
|
@@ -1824,5 +1818,5 @@
|
|
|
1824
1818
|
</g>
|
|
1825
1819
|
</svg>
|
|
1826
1820
|
</div>
|
|
1827
|
-
`}}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)}]);
|
|
1821
|
+
`}}function Go(e){return Go="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},Go(e)}function Jo(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,Xo(r.key),r)}}function Xo(e){var t=function(e){if("object"!=Go(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Go(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Go(t)?t:t+""}window.customElements.define("icon-bookmark",Uo);var Qo,Ko,Yo=function(){return function(e,t){return t&&Jo(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)(Zo||(Zo=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 ei(e){return ei="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},ei(e)}function ti(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ni(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,oi(r.key),r)}}function ri(e,t,n){return t&&ni(e.prototype,t),n&&ni(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function oi(e){var t=function(e){if("object"!=ei(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ei(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ei(t)?t:t+""}var ii,ai=ri(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)(Qo||(Qo=ti(["",""])),Ce),this.label="Share this book",this.id="share",this.component=(0,r.qy)(Ko||(Ko=ti(["<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 si(e){return si="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},si(e)}function li(){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 ci(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]())):(ci(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,ci(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,ci(d,"constructor",c),ci(c,"constructor",l),l.displayName="GeneratorFunction",ci(c,o,"GeneratorFunction"),ci(d),ci(d,o,"Generator"),ci(d,r,function(){return this}),ci(d,"toString",function(){return"[object Generator]"}),(li=function(){return{w:i,m:h}})()}function ci(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}ci=function(e,t,n,r){function i(t,n){ci(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))},ci(e,t,n,r)}function ui(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 di(e){return function(e){if(Array.isArray(e))return hi(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 hi(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)?hi(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 hi(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 pi(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,fi(r.key),r)}}function fi(e){var t=function(e){if("object"!=si(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=si(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==si(t)?t:t+""}var mi,vi,bi,yi,gi,ki,wi,Ci="default",Si=function(){return function(e,t){return t&&pi(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)(ii||(ii=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["",""])),Ve),this.sortOrderBy=Ci,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=di(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=li().m(function e(t){var n,r,o;return li().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=di(this.viewableFiles),e.n=1,this.component.updateComplete;case 1:this.bookreader.urlPlugin&&(this.bookreader.urlPlugin.pullFromAddressBar(),this.sortOrderBy!==Ci?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){ui(i,r,o,a,s,"next",e)}function s(e){ui(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}(),xi=n(8004);function Oi(e){return Oi="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},Oi(e)}function Mi(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 ji(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)?ji(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 ji(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 Bi(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 Pi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Bi(Object(n),!0).forEach(function(t){Ei(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Bi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ei(e,t,n){return(t=zi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _i(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ai(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"!=Oi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Oi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Oi(t)?t:t+""}function Ti(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ti=function(){return!!e})()}function Li(){return Li="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Ii(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},Li.apply(null,arguments)}function Ii(e){return Ii=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ii(e)}function $i(e,t){return $i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$i(e,t)}var qi=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=Ii(t),function(e,t){if(t&&("object"==Oi(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,Ti()?Reflect.construct(t,n||[],Ii(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.bookReaderCannotLoad=!1,e.bookReaderLoaded=!1,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.signedIn=!1,e.fullscreenBranding=(0,r.qy)(mi||(mi=_i(['<ia-icon-ia-logo aria-hidden="true"></ia-icon-ia-logo>']))),e._sharedObserverHandler={handleResize:e.handleResize.bind(e)},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&&$i(e,t)}(t,e),function(e,t,n){return t&&Ai(e.prototype,t),n&&Ai(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"itemNav",get:function(){return this.shadowRoot.querySelector("iaux-item-navigator")}},{key:"disconnectedCallback",value:function(){!function(e,t,n){var r=Li(Ii(e.prototype),"disconnectedCallback",n);return"function"==typeof r?function(e){return r.apply(n,e)}:r}(t,0,this)([]),this.unloadSharedObserver()}},{key:"firstUpdated",value:function(){this.modal||this.setModalManager(),this.sharedObserver||(this.sharedObserver=new et),this._bindEventListeners(),this.loaded=!0}},{key:"updated",value:function(e){this.bookreader&&this.item&&this.bookReaderLoaded&&((e.has("loaded")&&this.loaded||e.has("item")||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:"loadSharedObserver",value:function(){var e;this.unloadSharedObserver(),null===(e=this.sharedObserver)||void 0===e||e.addObserver({target:this.mainBRContainer,handler:this._sharedObserverHandler})}},{key:"unloadSharedObserver",value:function(){var e;null===(e=this.sharedObserver)||void 0===e||e.removeObserver({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.bookreader.options.enableFSLogoShortcut&&(this.fullscreen=this.bookreader.isFullscreen(),this.dispatchEvent(new CustomEvent("fullscreenStateUpdated",{detail:{fullscreen:this.fullscreen}})),this.fullscreen?this.addFullscreenShortcut():this.deleteFullscreenShortcut())}},{key:"setModalManager",value:function(){var e=document.querySelector("modal-manager");e||(e=document.createElement("modal-manager"),document.body.appendChild(e)),this.modal=e}},{key:"initializeBookSubmenus",value:function(){var e,t=this,n={visualAdjustments:new fr(Pi(Pi({},this.baseProviderConfig),{},{onProviderChange:function(){t.updateMenuContents()}}))};this.baseProviderConfig.item&&(n.share=new ai(this.baseProviderConfig)),this.shouldShowDownloadsMenu()&&(n.downloads=new An(this.baseProviderConfig)),null!==(e=this.bookreader.options.plugins)&&void 0!==e&&null!==(e=e.search)&&void 0!==e&&e.enabled&&(n.search=new hn(Pi(Pi({},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 Yo(Pi(Pi({},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 Si(Pi(Pi({},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:"baseProviderConfig",get:function(){return{baseHost:this.baseHost,modal:this.modal,sharedObserver:this.sharedObserver,bookreader:this.bookreader,item:this.item,signedIn:this.signedIn,isAdmin:this.isAdmin,onProviderChange:function(){}}}},{key:"isWideEnoughToOpenMenu",get:function(){return this._brWidth>=640}},{key:"updateSideMenu",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"open";if(t)if(this.openMenuName=t,"open"===n)null===(e=this.itemNav)||void 0===e||e.openShortcut(t);else if("toggle"===n){var r;null===(r=this.itemNav)||void 0===r||r.toggleMenu()}}},{key:"addFullscreenShortcut",value:function(){this.menuShortcuts.push({icon:this.fullscreenShortcut,id:"fullscreen"}),this._sortMenuShortcuts()}},{key:"deleteFullscreenShortcut",value:function(){this.menuShortcuts=this.menuShortcuts.filter(function(e){return"fullscreen"!==e.id}),this._sortMenuShortcuts()}},{key:"fullscreenShortcut",get:function(){var e=this;return(0,r.qy)(vi||(vi=_i(["\n <button\n @click=",'\n title="Exit fullscreen view"\n >',"</button>\n "])),function(){return e.bookreader.exitFullScreen()},this.fullscreenBranding)}},{key:"updateMenuContents",value:function(){var e,t=this,n=(0,xi.sortBy)(Object.entries(this.menuProviders).filter(function(e){var t=Mi(e,2);return t[0],!!t[1]}).filter(function(e){var n=Mi(e,2),r=n[0];return n[1],"downloads"!==r||t.shouldShowDownloadsMenu()}),function(e){var n=Mi(e,2),r=n[0],o=(n[1],t.shortcutOrder.indexOf(r));return-1===o?t.shortcutOrder.length:o}).map(function(e){var t=Mi(e,2);return t[0],t[1]});this.shouldShowDownloadsMenu()&&(null===(e=this.menuProviders.downloads)||void 0===e||e.update(this.downloadableTypes)),this.menuContents=n}},{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())}},{key:"_sortMenuShortcuts",value:function(){var e=this;this.menuShortcuts=(0,xi.sortBy)(this.menuShortcuts,function(t){var n=e.shortcutOrder.indexOf(t.id);return-1===n?e.shortcutOrder.length:n})}},{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.loaded=!0,e.loadSharedObserver(),setTimeout(function(){return e.bookreader.resize()},0)}),window.addEventListener("BookReader:fullscreenToggled",function(t){var n=t.detail.props;n&&(e.bookreader=n),e.manageFullScreenBehavior()},{passive:!0}),window.addEventListener("BookReader:ToggleSearchMenu",function(t){e.updateSideMenu("search","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.loaded=!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,r=e.target;if(null===(t=window.archive_analytics)||void 0===t||t.send_event("BookReader","contextmenu-".concat(this.bookIsRestricted?"restricted":"unrestricted"),null==r||null===(n=r.classList)||void 0===n?void 0:n.value),this.bookIsRestricted&&r.classList.value.match(/BRscreen|BRpageimage/g))return e.preventDefault(),!1}},{key:"itemImage",get:function(){var e,t=null===(e=this.item)||void 0===e?void 0:e.metadata.identifier,n="https://".concat(this.baseHost,"/services/img/").concat(t);return(0,r.qy)(bi||(bi=_i(['<img class="cover-img" src=',' alt="cover image for ','">'])),n,t)}},{key:"placeholder",get:function(){return(0,r.qy)(yi||(yi=_i(['<div class="placeholder">',"</div>"])),this.itemImage)}},{key:"render",value:function(){return(0,r.qy)(gi||(gi=_i(["\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 ',"\n </div>\n </iaux-item-navigator>\n "])),this.fullscreen,this.baseHost,this.item,this.modal,this.loaded,this.sharedObserver,this.signedIn,this.menuShortcuts,this.menuContents,this.openMenuName,this.bookReaderCannotLoad?this.placeholder:(0,r.qy)(ki||(ki=_i(['<slot name="main"></slot>']))))}}],[{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},bookReaderLoaded:{type:Boolean},bookreader:{type:Object},bookIsRestricted:{type:Boolean},downloadableTypes:{type:Array},isAdmin:{type:Boolean},lendingInitialized:{type:Boolean},lendingStatus:{type:Object},menuProviders:{type:Object},fullscreenBranding:{type:Object}}}},{key:"styles",get:function(){return(0,r.AH)(wi||(wi=_i(['\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 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 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\n iaux-item-navigator {\n display: block;\n width: 100%;\n min-height: var(--br-height, inherit);\n height: var(--br-height, 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",qi)}},function(e){e(e.s=7442)}]);
|
|
1828
1822
|
//# sourceMappingURL=ia-bookreader-bundle.js.map
|