@internetarchive/bookreader 5.0.0-110 → 5.0.0-111
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.css +59 -0
- package/BookReader/BookReader.js +1 -1
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/ia-bookreader-bundle.js +74 -77
- package/BookReader/ia-bookreader-bundle.js.map +1 -1
- package/BookReader/plugins/plugin.chapters.js +1 -1
- package/BookReader/plugins/plugin.chapters.js.map +1 -1
- package/BookReader/plugins/plugin.experiments.js +1 -1
- package/BookReader/plugins/plugin.experiments.js.map +1 -1
- package/BookReader/plugins/plugin.text_selection.js +23 -1
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.translate.js +25 -3
- package/BookReader/plugins/plugin.translate.js.map +1 -1
- package/BookReader/plugins/plugin.url.js +2 -1
- package/BookReader/plugins/plugin.url.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.url.js.map +1 -1
- package/package.json +2 -1
- package/src/BookReader/Mode2UpLit.js +1 -3
- package/src/BookReader/utils/SelectionObserver.js +9 -1
- package/src/BookReader.js +17 -2
- package/src/css/_TextSelection.scss +59 -0
- package/src/plugins/plugin.chapters.js +8 -3
- package/src/plugins/plugin.experiments.js +21 -3
- package/src/plugins/plugin.text_selection.js +17 -0
- package/src/plugins/url/UrlPlugin.js +23 -3
- package/src/plugins/url/plugin.url.js +63 -7
- package/src/util/TextSelectionManager.js +252 -2
|
@@ -133,7 +133,29 @@
|
|
|
133
133
|
opacity: 0;
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
`}};(0,o.Cg)([(0,a.MZ)({type:String})],s.prototype,"mode",void 0),s=(0,o.Cg)([(0,a.EM)("ia-activity-indicator")],s)},5215:function(e,t,n){function r(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}n.d(t,{Cg:function(){return r}}),Object.create,Object.create},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}},5758: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),o=n(5215),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 x{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}}x.shared=new x;class S{parseValue(e){if("string"==typeof e)return e}}S.shared=new S;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 B{parseValue(e){return String(e)}}B.shared=new B;class j{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?x.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}}(0,o.Cg)([v()],j.prototype,"mtime",null),(0,o.Cg)([v()],j.prototype,"size",null),(0,o.Cg)([v()],j.prototype,"length",null),(0,o.Cg)([v()],j.prototype,"height",null),(0,o.Cg)([v()],j.prototype,"width",null),(0,o.Cg)([v()],j.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}}(0,o.Cg)([v()],P.prototype,"values",null),(0,o.Cg)([v()],P.prototype,"value",null);class E extends P{constructor(e){super(g.shared,e)}}class L extends P{constructor(e){super(C.shared,e)}}class A extends P{constructor(e){super(x.shared,e)}}class _ extends P{constructor(e){super(k.shared,e)}}class T extends P{constructor(e){super(B.shared,e)}}class z extends P{constructor(e){super(M.shared,e)}}class I extends P{constructor(e){super(w.shared,e)}}class $ extends P{constructor(e){super(S.shared,e)}}class H extends P{constructor(e,t){super(t,e)}}class D extends H{constructor(e){super(e,new O(B.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 T(this.rawMetadata.audio_codec):void 0}get audio_sample_rate(){return null!=this.rawMetadata.audio_sample_rate?new _(this.rawMetadata.audio_sample_rate):void 0}get avg_rating(){return null!=this.rawMetadata.avg_rating?new _(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 L(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 _(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 _(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 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 _(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 _(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 _(this.rawMetadata.num_favorites):void 0}get num_reviews(){return null!=this.rawMetadata.num_reviews?new _(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 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 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 _(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 T(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 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 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 D(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 _(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 _(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 _(this.rawMetadata.week):void 0}get year(){return null!=this.rawMetadata.year?new _(this.rawMetadata.year):void 0}constructor(e={}){this.rawMetadata=e}}(0,o.Cg)([v()],q.prototype,"addeddate",null),(0,o.Cg)([v()],q.prototype,"audio_codec",null),(0,o.Cg)([v()],q.prototype,"audio_sample_rate",null),(0,o.Cg)([v()],q.prototype,"avg_rating",null),(0,o.Cg)([v()],q.prototype,"collection",null),(0,o.Cg)([v()],q.prototype,"collections_raw",null),(0,o.Cg)([v()],q.prototype,"collection_size",null),(0,o.Cg)([v()],q.prototype,"contact",null),(0,o.Cg)([v()],q.prototype,"contributor",null),(0,o.Cg)([v()],q.prototype,"coverage",null),(0,o.Cg)([v()],q.prototype,"creator",null),(0,o.Cg)([v()],q.prototype,"creator_alt_script",null),(0,o.Cg)([v()],q.prototype,"credits",null),(0,o.Cg)([v()],q.prototype,"collection_layout",null),(0,o.Cg)([v()],q.prototype,"date",null),(0,o.Cg)([v()],q.prototype,"description",null),(0,o.Cg)([v()],q.prototype,"downloads",null),(0,o.Cg)([v()],q.prototype,"duration",null),(0,o.Cg)([v()],q.prototype,"external_identifier",null),(0,o.Cg)([v()],q.prototype,"external_link",null),(0,o.Cg)([v()],q.prototype,"files_count",null),(0,o.Cg)([v()],q.prototype,"indexdate",null),(0,o.Cg)([v()],q.prototype,"isbn",null),(0,o.Cg)([v()],q.prototype,"issue",null),(0,o.Cg)([v()],q.prototype,"item_count",null),(0,o.Cg)([v()],q.prototype,"item_size",null),(0,o.Cg)([v()],q.prototype,"language",null),(0,o.Cg)([v()],q.prototype,"length",null),(0,o.Cg)([v()],q.prototype,"licenseurl",null),(0,o.Cg)([v()],q.prototype,"lineage",null),(0,o.Cg)([v()],q.prototype,"month",null),(0,o.Cg)([v()],q.prototype,"mediatype",null),(0,o.Cg)([v()],q.prototype,"noindex",null),(0,o.Cg)([v()],q.prototype,"notes",null),(0,o.Cg)([v()],q.prototype,"num_favorites",null),(0,o.Cg)([v()],q.prototype,"num_reviews",null),(0,o.Cg)([v()],q.prototype,"openlibrary_edition",null),(0,o.Cg)([v()],q.prototype,"openlibrary_work",null),(0,o.Cg)([v()],q.prototype,"page_progression",null),(0,o.Cg)([v()],q.prototype,"paginated",null),(0,o.Cg)([v()],q.prototype,"partner",null),(0,o.Cg)([v()],q.prototype,"post_text",null),(0,o.Cg)([v()],q.prototype,"ppi",null),(0,o.Cg)([v()],q.prototype,"publicdate",null),(0,o.Cg)([v()],q.prototype,"publisher",null),(0,o.Cg)([v()],q.prototype,"reviewdate",null),(0,o.Cg)([v()],q.prototype,"rights",null),(0,o.Cg)([v()],q.prototype,"rights_holder",null),(0,o.Cg)([v()],q.prototype,"runtime",null),(0,o.Cg)([v()],q.prototype,"scanner",null),(0,o.Cg)([v()],q.prototype,"segments",null),(0,o.Cg)([v()],q.prototype,"shotlist",null),(0,o.Cg)([v()],q.prototype,"source",null),(0,o.Cg)([v()],q.prototype,"sponsor",null),(0,o.Cg)([v()],q.prototype,"start_localtime",null),(0,o.Cg)([v()],q.prototype,"start_time",null),(0,o.Cg)([v()],q.prototype,"stop_time",null),(0,o.Cg)([v()],q.prototype,"subject",null),(0,o.Cg)([v()],q.prototype,"taper",null),(0,o.Cg)([v()],q.prototype,"title",null),(0,o.Cg)([v()],q.prototype,"title_alt_script",null),(0,o.Cg)([v()],q.prototype,"transferer",null),(0,o.Cg)([v()],q.prototype,"track",null),(0,o.Cg)([v()],q.prototype,"type",null),(0,o.Cg)([v()],q.prototype,"uploader",null),(0,o.Cg)([v()],q.prototype,"utc_offset",null),(0,o.Cg)([v()],q.prototype,"venue",null),(0,o.Cg)([v()],q.prototype,"volume",null),(0,o.Cg)([v()],q.prototype,"week",null),(0,o.Cg)([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?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}}(0,o.Cg)([v()],R.prototype,"reviewdate",null),(0,o.Cg)([v()],R.prototype,"createdate",null),(0,o.Cg)([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 j(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 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 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 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}}}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(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 Z=r.qy`
|
|
136
|
+
`}};(0,o.Cg)([(0,a.MZ)({type:String})],s.prototype,"mode",void 0),s=(0,o.Cg)([(0,a.EM)("ia-activity-indicator")],s)},90:function(e,t,n){var r=n(420),o=r.qy`
|
|
137
|
+
<svg
|
|
138
|
+
viewBox="0 0 100 100"
|
|
139
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
140
|
+
>
|
|
141
|
+
<g class="fill-color">
|
|
142
|
+
<path d="M70.6784759,10 L70.6784759,21.3240186 C64.5020053,21.66334 58.9104278,22.5826126 53.9037433,24.0818363 C48.8970588,25.5810601 44.8495989,27.4085163 41.7613636,29.5642049 C38.6731283,31.7198935 35.9982175,34.0552229 33.736631,36.5701929 C31.4750446,39.085163 29.8217469,41.5657574 28.776738,44.011976 C27.7317291,46.4581947 26.9173351,48.6848525 26.3335561,50.6919494 C25.7497772,52.6990464 25.4088681,54.3324462 25.3108289,55.592149 L25.2372995,57.4085163 C29.0296346,54.1661122 33.1751337,51.5524507 37.6737968,49.5675316 C42.1724599,47.5826126 46.2934492,46.3118208 50.0367647,45.7551564 C53.7800802,45.1984919 57.2571301,44.8713684 60.4679144,44.7737858 C63.6786988,44.6762031 66.1831551,44.7726769 67.9812834,45.0632069 L70.6784759,45.499002 L70.6784759,57.4051896 L100,33.3765802 L70.6784759,10 Z M76.4438503,62.4883566 L82.8609626,57.1157685 C82.9099822,57.0669772 82.9946524,57.0303837 83.1149733,57.005988 C83.2352941,56.9815924 83.4536542,56.9571967 83.7700535,56.9328011 C84.0864528,56.9084054 84.3905971,56.9449989 84.6824866,57.0425815 C84.9743761,57.1401641 85.217246,57.2854291 85.4110963,57.4783766 C85.6049465,57.671324 85.7263815,57.8409847 85.7754011,57.9873586 L85.8489305,58.2035928 L85.8489305,90 L0,90 L0,17.910845 L43.1784759,17.910845 C43.2765152,17.9596363 43.410205,18.0317143 43.5795455,18.1270792 C43.7488859,18.222444 43.9438503,18.4519849 44.1644385,18.8157019 C44.3850267,19.1794189 44.469697,19.5542249 44.4184492,19.9401198 C44.4184492,20.2794411 44.3092692,20.582169 44.0909091,20.8483034 C43.872549,21.1144378 43.6664439,21.3206919 43.4725936,21.4670659 L43.1818182,21.6134398 C40.557041,23.06609 38.2954545,24.396762 36.3970588,25.6054558 L30.7820856,29.8170326 L11.5274064,29.8170326 L11.5274064,78.1669993 L74.1811497,78.1669993 L74.1811497,65.5355955 C74.1811497,65.1009093 74.3995098,64.6407186 74.8362299,64.1550233 L76.4438503,62.4883566 Z" id="Shape"></path>
|
|
143
|
+
</g>
|
|
144
|
+
</svg>
|
|
145
|
+
`;class i extends r.WF{static get styles(){return r.AH`
|
|
146
|
+
:host {
|
|
147
|
+
width: var(--iconWidth, 'auto');
|
|
148
|
+
height: var(--iconHeight, 'auto');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.fill-color {
|
|
152
|
+
fill: var(--iconFillColor);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
.stroke-color {
|
|
156
|
+
stroke: var(--iconStrokeColor);
|
|
157
|
+
}
|
|
158
|
+
`}render(){return o}}customElements.define("ia-icon-share",i)},5215:function(e,t,n){function r(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}n.d(t,{Cg:function(){return r}}),Object.create,Object.create},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}},2250: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),o=n(5215),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 x{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}}x.shared=new x;class S{parseValue(e){if("string"==typeof e)return e}}S.shared=new S;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 B{parseValue(e){return String(e)}}B.shared=new B;class j{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?x.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}}(0,o.Cg)([v()],j.prototype,"mtime",null),(0,o.Cg)([v()],j.prototype,"size",null),(0,o.Cg)([v()],j.prototype,"length",null),(0,o.Cg)([v()],j.prototype,"height",null),(0,o.Cg)([v()],j.prototype,"width",null),(0,o.Cg)([v()],j.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}}(0,o.Cg)([v()],P.prototype,"values",null),(0,o.Cg)([v()],P.prototype,"value",null);class E extends P{constructor(e){super(g.shared,e)}}class L extends P{constructor(e){super(C.shared,e)}}class A extends P{constructor(e){super(x.shared,e)}}class _ extends P{constructor(e){super(k.shared,e)}}class T extends P{constructor(e){super(B.shared,e)}}class z extends P{constructor(e){super(M.shared,e)}}class I extends P{constructor(e){super(w.shared,e)}}class $ extends P{constructor(e){super(S.shared,e)}}class H extends P{constructor(e,t){super(t,e)}}class q extends H{constructor(e){super(e,new O(B.shared))}}class D{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 T(this.rawMetadata.audio_codec):void 0}get audio_sample_rate(){return null!=this.rawMetadata.audio_sample_rate?new _(this.rawMetadata.audio_sample_rate):void 0}get avg_rating(){return null!=this.rawMetadata.avg_rating?new _(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 L(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 _(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 _(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 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 _(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 _(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 _(this.rawMetadata.num_favorites):void 0}get num_reviews(){return null!=this.rawMetadata.num_reviews?new _(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 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 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 _(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 T(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 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 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 q(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 _(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 _(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 _(this.rawMetadata.week):void 0}get year(){return null!=this.rawMetadata.year?new _(this.rawMetadata.year):void 0}constructor(e={}){this.rawMetadata=e}}(0,o.Cg)([v()],D.prototype,"addeddate",null),(0,o.Cg)([v()],D.prototype,"audio_codec",null),(0,o.Cg)([v()],D.prototype,"audio_sample_rate",null),(0,o.Cg)([v()],D.prototype,"avg_rating",null),(0,o.Cg)([v()],D.prototype,"collection",null),(0,o.Cg)([v()],D.prototype,"collections_raw",null),(0,o.Cg)([v()],D.prototype,"collection_size",null),(0,o.Cg)([v()],D.prototype,"contact",null),(0,o.Cg)([v()],D.prototype,"contributor",null),(0,o.Cg)([v()],D.prototype,"coverage",null),(0,o.Cg)([v()],D.prototype,"creator",null),(0,o.Cg)([v()],D.prototype,"creator_alt_script",null),(0,o.Cg)([v()],D.prototype,"credits",null),(0,o.Cg)([v()],D.prototype,"collection_layout",null),(0,o.Cg)([v()],D.prototype,"date",null),(0,o.Cg)([v()],D.prototype,"description",null),(0,o.Cg)([v()],D.prototype,"downloads",null),(0,o.Cg)([v()],D.prototype,"duration",null),(0,o.Cg)([v()],D.prototype,"external_identifier",null),(0,o.Cg)([v()],D.prototype,"external_link",null),(0,o.Cg)([v()],D.prototype,"files_count",null),(0,o.Cg)([v()],D.prototype,"indexdate",null),(0,o.Cg)([v()],D.prototype,"isbn",null),(0,o.Cg)([v()],D.prototype,"issue",null),(0,o.Cg)([v()],D.prototype,"item_count",null),(0,o.Cg)([v()],D.prototype,"item_size",null),(0,o.Cg)([v()],D.prototype,"language",null),(0,o.Cg)([v()],D.prototype,"length",null),(0,o.Cg)([v()],D.prototype,"licenseurl",null),(0,o.Cg)([v()],D.prototype,"lineage",null),(0,o.Cg)([v()],D.prototype,"month",null),(0,o.Cg)([v()],D.prototype,"mediatype",null),(0,o.Cg)([v()],D.prototype,"noindex",null),(0,o.Cg)([v()],D.prototype,"notes",null),(0,o.Cg)([v()],D.prototype,"num_favorites",null),(0,o.Cg)([v()],D.prototype,"num_reviews",null),(0,o.Cg)([v()],D.prototype,"openlibrary_edition",null),(0,o.Cg)([v()],D.prototype,"openlibrary_work",null),(0,o.Cg)([v()],D.prototype,"page_progression",null),(0,o.Cg)([v()],D.prototype,"paginated",null),(0,o.Cg)([v()],D.prototype,"partner",null),(0,o.Cg)([v()],D.prototype,"post_text",null),(0,o.Cg)([v()],D.prototype,"ppi",null),(0,o.Cg)([v()],D.prototype,"publicdate",null),(0,o.Cg)([v()],D.prototype,"publisher",null),(0,o.Cg)([v()],D.prototype,"reviewdate",null),(0,o.Cg)([v()],D.prototype,"rights",null),(0,o.Cg)([v()],D.prototype,"rights_holder",null),(0,o.Cg)([v()],D.prototype,"runtime",null),(0,o.Cg)([v()],D.prototype,"scanner",null),(0,o.Cg)([v()],D.prototype,"segments",null),(0,o.Cg)([v()],D.prototype,"shotlist",null),(0,o.Cg)([v()],D.prototype,"source",null),(0,o.Cg)([v()],D.prototype,"sponsor",null),(0,o.Cg)([v()],D.prototype,"start_localtime",null),(0,o.Cg)([v()],D.prototype,"start_time",null),(0,o.Cg)([v()],D.prototype,"stop_time",null),(0,o.Cg)([v()],D.prototype,"subject",null),(0,o.Cg)([v()],D.prototype,"taper",null),(0,o.Cg)([v()],D.prototype,"title",null),(0,o.Cg)([v()],D.prototype,"title_alt_script",null),(0,o.Cg)([v()],D.prototype,"transferer",null),(0,o.Cg)([v()],D.prototype,"track",null),(0,o.Cg)([v()],D.prototype,"type",null),(0,o.Cg)([v()],D.prototype,"uploader",null),(0,o.Cg)([v()],D.prototype,"utc_offset",null),(0,o.Cg)([v()],D.prototype,"venue",null),(0,o.Cg)([v()],D.prototype,"volume",null),(0,o.Cg)([v()],D.prototype,"week",null),(0,o.Cg)([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}}(0,o.Cg)([v()],R.prototype,"reviewdate",null),(0,o.Cg)([v()],R.prototype,"createdate",null),(0,o.Cg)([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 j(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 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 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}}}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(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 Z=r.qy`
|
|
137
159
|
<svg
|
|
138
160
|
viewBox="0 0 40 40"
|
|
139
161
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -797,38 +819,13 @@
|
|
|
797
819
|
margin-left: ${e};
|
|
798
820
|
transition: ${n};
|
|
799
821
|
}
|
|
800
|
-
`}};(0,o.Cg)([(0,i.MZ)({type:Object,converter:e=>e&&"string"==typeof e?new F(JSON.parse(atob(e))):e})],ae.prototype,"item",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],ae.prototype,"viewAvailable",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],ae.prototype,"baseHost",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],ae.prototype,"signedIn",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],ae.prototype,"menuContents",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],ae.prototype,"menuShortcuts",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0,attribute:!0})],ae.prototype,"viewportInFullscreen",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],ae.prototype,"menuOpened",void 0),(0,o.Cg)([(0,i.MZ)({type:String,reflect:!0})],ae.prototype,"openMenu",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],ae.prototype,"modal",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],ae.prototype,"sharedObserver",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0,attribute:!0})],ae.prototype,"loaded",void 0),(0,o.Cg)([(0,i.wk)()],ae.prototype,"openMenuState",void 0),(0,o.Cg)([(0,i.P)("#frame")],ae.prototype,"frame",void 0),(0,o.Cg)([(0,i.P)('slot[name="header"]')],ae.prototype,"headerSlot",void 0),(0,o.Cg)([(0,i.P)('slot[name="main"]')],ae.prototype,"mainSlot",void 0),(0,o.Cg)([(0,i.P)("ia-menu-slider")],ae.prototype,"menuSlider",void 0),(0,o.Cg)([(0,i.P)("button.toggle-menu")],ae.prototype,"toggleMenuButton",void 0),ae=(0,o.Cg)([(0,i.EM)("iaux-item-navigator")],ae);var se=r.qy`
|
|
801
|
-
<svg
|
|
802
|
-
viewBox="0 0 100 100"
|
|
803
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
804
|
-
aria-labelledby="shareTitleID shareDescID"
|
|
805
|
-
>
|
|
806
|
-
<title id="shareTitleID">Share icon</title>
|
|
807
|
-
<desc id="shareDescID">A square with an arrow arcing out from the center of the square</desc>
|
|
808
|
-
<g class="fill-color">
|
|
809
|
-
<path d="M70.6784759,10 L70.6784759,21.3240186 C64.5020053,21.66334 58.9104278,22.5826126 53.9037433,24.0818363 C48.8970588,25.5810601 44.8495989,27.4085163 41.7613636,29.5642049 C38.6731283,31.7198935 35.9982175,34.0552229 33.736631,36.5701929 C31.4750446,39.085163 29.8217469,41.5657574 28.776738,44.011976 C27.7317291,46.4581947 26.9173351,48.6848525 26.3335561,50.6919494 C25.7497772,52.6990464 25.4088681,54.3324462 25.3108289,55.592149 L25.2372995,57.4085163 C29.0296346,54.1661122 33.1751337,51.5524507 37.6737968,49.5675316 C42.1724599,47.5826126 46.2934492,46.3118208 50.0367647,45.7551564 C53.7800802,45.1984919 57.2571301,44.8713684 60.4679144,44.7737858 C63.6786988,44.6762031 66.1831551,44.7726769 67.9812834,45.0632069 L70.6784759,45.499002 L70.6784759,57.4051896 L100,33.3765802 L70.6784759,10 Z M76.4438503,62.4883566 L82.8609626,57.1157685 C82.9099822,57.0669772 82.9946524,57.0303837 83.1149733,57.005988 C83.2352941,56.9815924 83.4536542,56.9571967 83.7700535,56.9328011 C84.0864528,56.9084054 84.3905971,56.9449989 84.6824866,57.0425815 C84.9743761,57.1401641 85.217246,57.2854291 85.4110963,57.4783766 C85.6049465,57.671324 85.7263815,57.8409847 85.7754011,57.9873586 L85.8489305,58.2035928 L85.8489305,90 L0,90 L0,17.910845 L43.1784759,17.910845 C43.2765152,17.9596363 43.410205,18.0317143 43.5795455,18.1270792 C43.7488859,18.222444 43.9438503,18.4519849 44.1644385,18.8157019 C44.3850267,19.1794189 44.469697,19.5542249 44.4184492,19.9401198 C44.4184492,20.2794411 44.3092692,20.582169 44.0909091,20.8483034 C43.872549,21.1144378 43.6664439,21.3206919 43.4725936,21.4670659 L43.1818182,21.6134398 C40.557041,23.06609 38.2954545,24.396762 36.3970588,25.6054558 L30.7820856,29.8170326 L11.5274064,29.8170326 L11.5274064,78.1669993 L74.1811497,78.1669993 L74.1811497,65.5355955 C74.1811497,65.1009093 74.3995098,64.6407186 74.8362299,64.1550233 L76.4438503,62.4883566 Z" id="Shape"></path>
|
|
810
|
-
</g>
|
|
811
|
-
</svg>
|
|
812
|
-
`;class le extends r.WF{static get styles(){return r.AH`
|
|
813
|
-
:host {
|
|
814
|
-
width: var(--iconWidth, 'auto');
|
|
815
|
-
height: var(--iconHeight, 'auto');
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
.fill-color {
|
|
819
|
-
fill: var(--iconFillColor);
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
.stroke-color {
|
|
823
|
-
stroke: var(--iconStrokeColor);
|
|
824
|
-
}
|
|
825
|
-
`}render(){return se}}customElements.define("ia-icon-share",le);var ce=r.qy`
|
|
822
|
+
`}};(0,o.Cg)([(0,i.MZ)({type:Object,converter:e=>e&&"string"==typeof e?new F(JSON.parse(atob(e))):e})],ae.prototype,"item",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],ae.prototype,"viewAvailable",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],ae.prototype,"baseHost",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],ae.prototype,"signedIn",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],ae.prototype,"menuContents",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],ae.prototype,"menuShortcuts",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0,attribute:!0})],ae.prototype,"viewportInFullscreen",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],ae.prototype,"menuOpened",void 0),(0,o.Cg)([(0,i.MZ)({type:String,reflect:!0})],ae.prototype,"openMenu",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],ae.prototype,"modal",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],ae.prototype,"sharedObserver",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0,attribute:!0})],ae.prototype,"loaded",void 0),(0,o.Cg)([(0,i.wk)()],ae.prototype,"openMenuState",void 0),(0,o.Cg)([(0,i.P)("#frame")],ae.prototype,"frame",void 0),(0,o.Cg)([(0,i.P)('slot[name="header"]')],ae.prototype,"headerSlot",void 0),(0,o.Cg)([(0,i.P)('slot[name="main"]')],ae.prototype,"mainSlot",void 0),(0,o.Cg)([(0,i.P)("ia-menu-slider")],ae.prototype,"menuSlider",void 0),(0,o.Cg)([(0,i.P)("button.toggle-menu")],ae.prototype,"toggleMenuButton",void 0),ae=(0,o.Cg)([(0,i.EM)("iaux-item-navigator")],ae),n(90);var se=r.qy`
|
|
826
823
|
<svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="twitterTitleID twitterDescID">
|
|
827
824
|
<title id="twitterTitleID">Twitter icon</title>
|
|
828
825
|
<desc id="twitterDescID">The Twitter logo, a cartoon bird</desc>
|
|
829
826
|
<path d="m31.5297453 8.76273313c-.3135031.40766104-.7447036.83083673-1.2936015 1.26952707-.5488979.4386904-.9169698.7837578-1.1042157 1.0352022.1562166 2.319709-.1417719 4.5297454-.8939653 6.6301092-.7521935 2.1003638-1.8023754 3.9182538-3.1505457 5.45367-1.3481704 1.5354162-2.9627648 2.8284828-4.8437835 3.8791996-1.8810186 1.0507169-3.8321207 1.7483416-5.8533062 2.092874s-4.1215493.2894286-6.30109136-.1653114c-2.17954205-.45474-4.2092874-1.3401455-6.08923604-2.6562165 2.72737.4697196 5.67408517-.2514445 8.8401455-2.1634924-3.0719024-.7521935-4.88979241-2.2881447-5.45367-4.6078537 1.12882516.0631287 1.86550396.0631287 2.21003638 0-2.91568586-1.2850417-4.38904344-3.3693558-4.42007276-6.2529424.21934517.0310293.53284828.1487267.94050931.3530922s.78375775.3060133 1.12829017.3049433c-.81532206-.7211641-1.41076396-1.9045581-1.7863257-3.5501819-.37556173-1.64562376-.17173122-3.17355015.61149155-4.58377912 1.81789001 1.88101862 3.6908838 3.36989086 5.61898138 4.46661672 1.92809757 1.0967259 4.22426707 1.7547614 6.88850847 1.9741066-.2503745-1.1908838-.1722662-2.32719882.2343248-3.40894502.4065911-1.0817462 1.0416221-1.93612241 1.9050931-2.56312861.863471-.62700621 1.8114702-1.0817462 2.8439975-1.36421999 1.0325272-.28247378 2.0827091-.27444896 3.1505456.02407447s1.9767815.87042585 2.726835 1.71570726c1.3791997-.37663172 2.6802911-.87845068 3.9032742-1.50545688-.0310293.37663171-.1407019.74470361-.3290178 1.1042157-.1883158.35951209-.3530922.62593623-.4943291.79927242s-.3841216.4317355-.728654.77519795c-.3445324.34346244-.5638776.57832227-.6580355.70457949.2193452-.09415792.6895998-.23539482 1.410764-.42371067.7211641-.18831586 1.2069334-.39214638 1.4573079-.61149155 0 .44350524-.1567516.86668093-.4702547 1.27434196z" class="fill-color" />
|
|
830
827
|
</svg>
|
|
831
|
-
`;class
|
|
828
|
+
`;class le extends r.WF{static get styles(){return r.AH`
|
|
832
829
|
:host {
|
|
833
830
|
width: var(--iconWidth, 'auto');
|
|
834
831
|
height: var(--iconHeight, 'auto');
|
|
@@ -841,13 +838,13 @@
|
|
|
841
838
|
.stroke-color {
|
|
842
839
|
stroke: var(--iconStrokeColor);
|
|
843
840
|
}
|
|
844
|
-
`}render(){return
|
|
841
|
+
`}render(){return se}}customElements.define("ia-icon-twitter",le);var ce=r.qy`
|
|
845
842
|
<svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="facebookTitleID facebookDescID">
|
|
846
843
|
<title id="facebookTitleID">Facebook icon</title>
|
|
847
844
|
<desc id="facebookDescID">A lowercase f</desc>
|
|
848
845
|
<path d="m30.91057 19.2442068.2670004-5.3339402h-5.7329237c-.0890001-3.4962895.25183-5.42243459 1.0224903-5.77843514.3560005-.17800028.8004955-.28925046 1.333485-.33375053s1.0442346-.0520853 1.5337353-.02275571c.4895008.02932959 1.045246.01466479 1.6672356-.04399439.0890001-1.59997977.1335002-3.24445961.1335002-4.93343953-2.1633102-.20732987-3.6742898-.28115953-4.5329389-.22148898-2.8146294.17800028-4.7847688 1.25965538-5.9104183 3.2449653-.1780003.3256596-.3261653.68873971-.444495 1.08924034-.1183298.40050062-.2144095.76358074-.2882391 1.08924034-.0738297.32565959-.125915.7848194-.1562559 1.37747942-.030341.59266002-.052591 1.04474028-.0667501 1.35624078-.0141592.3115005-.0217444.8449956-.0227558 1.6004854v1.5777298h-3.8229605v5.3339401h3.8669549v14.622824h5.8224296c0-.3560006-.0146648-1.6819003-.0439944-3.9776994-.0293296-2.295799-.0515796-4.2957737-.0667501-5.9999241s-.0075853-3.2525506.0227557-4.6452005h5.4219289z" class="fill-color" />
|
|
849
846
|
</svg>
|
|
850
|
-
`;class
|
|
847
|
+
`;class ue extends r.WF{static get styles(){return r.AH`
|
|
851
848
|
:host {
|
|
852
849
|
width: var(--iconWidth, 'auto');
|
|
853
850
|
height: var(--iconHeight, 'auto');
|
|
@@ -860,13 +857,13 @@
|
|
|
860
857
|
.stroke-color {
|
|
861
858
|
stroke: var(--iconStrokeColor);
|
|
862
859
|
}
|
|
863
|
-
`}render(){return
|
|
860
|
+
`}render(){return ce}}customElements.define("ia-icon-facebook",ue);var de=r.qy`
|
|
864
861
|
<svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="tumblrTitleID tumblrDescID">
|
|
865
862
|
<title id="tumblrTitleID">Tumblr icon</title>
|
|
866
863
|
<desc id="tumblrDescID">A lowercase letter t</desc>
|
|
867
864
|
<path d="m8.50321407 8.54544475v5.32088575c.15641786.0310693.6819176.0310693 1.57649923 0 .8945816-.0310693 1.3574071.0160703 1.3884764.1414189.0942792 1.5695354.1333837 3.2253149.1173133 4.9673385-.0160703 1.7420236-.0316049 3.3426283-.0466039 4.8018141s.2046288 2.824628.6588835 4.0963267c.4542546 1.2716986 1.1999178 2.2209194 2.2369897 2.8476622 1.2556283.784232 2.9896167 1.207953 5.2019653 1.271163 2.2123485.0632099 4.1659648-.2506972 5.8608487-.9417213-.0310693-.3449764-.0230341-1.4045467.0241055-3.1787109.0471397-1.7741643-.0080351-2.75499-.1655244-2.9424772-3.5472571 1.0360005-5.697467.6904885-6.4506298-1.0365361-.7220934-1.6638147-.8635123-4.9909084-.4242566-9.981281v-.046604h6.7318605v-5.32088568h-6.7318605v-6.54383772h-4.0497228c-.2828378 1.28669763-.6122795 2.35376743-.9883252 3.20120941-.3760457.84744199-.98029 1.60060471-1.812733 2.25948817-.832443.65888347-1.87594303 1.01993018-3.1305 1.08314014z" class="fill-color" />
|
|
868
865
|
</svg>
|
|
869
|
-
`;class
|
|
866
|
+
`;class he extends r.WF{static get styles(){return r.AH`
|
|
870
867
|
:host {
|
|
871
868
|
width: var(--iconWidth, 'auto');
|
|
872
869
|
height: var(--iconHeight, 'auto');
|
|
@@ -879,13 +876,13 @@
|
|
|
879
876
|
.stroke-color {
|
|
880
877
|
stroke: var(--iconStrokeColor);
|
|
881
878
|
}
|
|
882
|
-
`}render(){return
|
|
879
|
+
`}render(){return de}}customElements.define("ia-icon-tumblr",he);var pe=r.qy`
|
|
883
880
|
<svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="pinterestTitleID pinterestDescID">
|
|
884
881
|
<title id="pinterestTitleID">Pinterest icon</title>
|
|
885
882
|
<desc id="pinterestDescID">A stylized letter p</desc>
|
|
886
883
|
<path d="m11.9051049 30.5873434.653491-1.0742755.4207845-.839975c.2805229-.591861.5371377-1.2533214.7698443-1.9843813.2327065-.7310599.4659444-1.6029125.6997135-2.6155579.2337692-1.0126455.4128151-1.752206.5371377-2.2186817.0308151.030815.0775689.0855382.1402615.1641697.0626927.0786314.1094465.1333547.1402615.1641697.1243227.1870153.2178304.311338.280523.372968 1.1210293.964829 2.3817888 1.4631823 3.7822785 1.4950599 1.4939973 0 2.8790795-.3426843 4.1552465-1.0280529 2.1166733-1.1826593 3.6733633-3.1128487 4.6700699-5.7905679.4048457-1.1518444.6848374-2.5996192.8399751-4.3433245.1243226-1.587505-.0781002-3.0974411-.6072685-4.5298084-.903199-2.36638128-2.5528653-4.20306294-4.948999-5.51004497-1.276167-.65349101-2.5990879-1.05833667-3.9687625-1.21453696-1.525875-.21783034-3.1293188-.17107651-4.8103315.14026149-2.7701643.52916833-5.02709913 1.743174-6.77080442 3.64201699-1.99235065 2.14748836-2.98852598 4.62225355-2.98852598 7.42429545 0 2.9571797.9494215 5.0584455 2.84826449 6.3037975l.83997504.4207845c.12432268 0 .22526845.0154075.3028373.0462225s.1551377.0074381.23270656-.0701308c.07756885-.0775688.13229208-.1243226.16416969-.1402614s.07066204-.0860696.11635328-.2103923c.04569124-.1243226.07703756-.2098609.09403895-.2566147.01700139-.0467539.04834771-.1476996.09403895-.3028373s.06906816-.2486454.07013074-.280523l.14026149-.5132295c.06269263-.311338.09403895-.5291684.09403895-.653491-.03081502-.1243227-.12432268-.2799917-.28052297-.467007-.15620029-.1870154-.23376915-.2959305-.23270656-.3267455-.62267599-.8096914-.9494215-1.7904592-.98023652-2.9423035-.03081502-1.55669.28052297-2.9731185.93401399-4.24928547 1.18265932-2.45882635 3.17501002-3.93741618 5.97705192-4.43576949 1.6183201-.311338 3.1356943-.25661476 4.5521228.16416969 1.4164285.42078446 2.5135496 1.09765239 3.2913633 2.03060379.8405063 1.02752164 1.3229208 2.28828114 1.4472435 3.78227848.1243227 1.4004897-.0313463 2.9725872-.467007 4.7162925-.3740306 1.3696746-.9186065 2.5528653-1.6337275 3.5495719-.9967066 1.245352-2.0863896 1.8834355-3.269049 1.9142505-1.7118277.0626926-2.7547568-.6375522-3.1287874-2.1007345-.0935077-.4664757 0-1.2134744.2805229-2.240996.7469987-2.5842117 1.1359055-3.9384788 1.1667206-4.0628015.1870153-1.0275216.2024228-1.7904591.0462225-2.2888124-.1870153-.65349104-.5759222-1.15928246-1.1667205-1.51737429-.5907984-.35809182-1.2756357-.39687625-2.054512-.11635327-1.1826594.43566067-1.9610044 1.40048968-2.335035 2.89448706-.311338 1.306982-.2491767 2.6299028.186484 3.9687625 0 .0626926.0313463.1402615.094039.2327065.0626926.0924451.0940389.1700139.0940389.2327066 0 .0935076-.0313463.2491766-.0940389.467007-.0626927.2178303-.094039.3580918-.094039.4207844-.0935076.4356607-.3038999 1.3308903-.6311767 2.6856887-.3272768 1.3547985-.5838915 2.3897582-.7698443 3.1048793-.7778136 3.2068876-1.12049796 5.5881451-1.02805289 7.1437725l.37296809 2.7558194c.653491-.591861 1.2294131-1.2299445 1.7277664-1.9142505z" class="fill-color" />
|
|
887
884
|
</svg>
|
|
888
|
-
`;class
|
|
885
|
+
`;class fe extends r.WF{static get styles(){return r.AH`
|
|
889
886
|
:host {
|
|
890
887
|
width: var(--iconWidth, 'auto');
|
|
891
888
|
height: var(--iconHeight, 'auto');
|
|
@@ -898,13 +895,13 @@
|
|
|
898
895
|
.stroke-color {
|
|
899
896
|
stroke: var(--iconStrokeColor);
|
|
900
897
|
}
|
|
901
|
-
`}render(){return
|
|
898
|
+
`}render(){return pe}}customElements.define("ia-icon-pinterest",fe);var me=r.qy`
|
|
902
899
|
<svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="emailTitleID emailDescID">
|
|
903
900
|
<title id="emailTitleID">Email icon</title>
|
|
904
901
|
<desc id="emailDescID">An illustration of an envelope</desc>
|
|
905
902
|
<path d="m32 7.04156803v19.91686397c0 .5752421-.4763773 1.041568-1.0640184 1.041568h-27.87196316c-.58764116 0-1.06401844-.4663259-1.06401844-1.041568v-19.91686397c0-.57524214.47637728-1.04156803 1.06401844-1.04156803h27.87196316c.5876411 0 1.0640184.46632589 1.0640184 1.04156803zm-26.25039901 1.19676167 10.04327011 10.1323738c.5135662.4194048.8817166.6291071 1.1044511.6291071.1198794 0 .2695514-.0503424.4490158-.1510273.1794644-.100685.3291364-.2013699.4490158-.3020548l.1798191-.1510273 10.1198794-10.15841306zm16.77212271 9.7303286 6.8831353 6.7889404v-13.5778809zm-17.92871075-6.6379131v13.350819l6.78098955-6.6629107zm22.09008685 14.2059464-5.9074304-5.8588202-.9757049.9551179-.3594018.3295984c-.0342324.0304241-.0665646.0587822-.0969964.0850743l-.1597867.1329606c-.0684912.0540844-.1198794.0895749-.1541644.1064714-.6674943.3687151-1.3523675.5530727-2.0546196.5530727-.65047 0-1.3782586-.218035-2.1833659-.6541048l-.6682036-.4520405-1.0278418-1.0311524-5.95850326 5.832781z" class="fill-color" />
|
|
906
903
|
</svg>
|
|
907
|
-
`;class
|
|
904
|
+
`;class ve extends r.WF{static get styles(){return r.AH`
|
|
908
905
|
:host {
|
|
909
906
|
width: var(--iconWidth, 'auto');
|
|
910
907
|
height: var(--iconHeight, 'auto');
|
|
@@ -917,13 +914,13 @@
|
|
|
917
914
|
.stroke-color {
|
|
918
915
|
stroke: var(--iconStrokeColor);
|
|
919
916
|
}
|
|
920
|
-
`}render(){return
|
|
917
|
+
`}render(){return me}}customElements.define("ia-icon-email",ve);var be=r.qy`
|
|
921
918
|
<svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="linkTitleID linkDescID">
|
|
922
919
|
<title id="linkTitleID">Link icon</title>
|
|
923
920
|
<desc id="linkDescID">Two chain links linked together</desc>
|
|
924
921
|
<path d="m7.80511706 12.3659763c1.2669254-2.2579539 4.09819784-2.9949938 6.41200864-1.7733458l.2295791.12871 1.6067188.9559859 3.5467013-6.31849361c1.2682451-2.26030597 4.104098-2.99652769 6.4192376-1.76952182l.2223501.12488594 3.2168204 1.91103915c2.2770002 1.3527136 3.1866331 4.21502324 2.0564431 6.51290984l-.1198433.2278304-5.2002499 9.2680474c-1.2669254 2.2579539-4.0981978 2.9949938-6.4120086 1.7733458l-.2295791-.12871-1.6096554-.9558482-3.5437647 6.3183559c-1.2682451 2.260306-4.104098 2.9965277-6.41923761 1.7695218l-.22235013-.1248859-3.21682032-1.9110392c-2.27700024-1.3527136-3.18663314-4.2150232-2.05644312-6.5129098l.11984332-.2278304zm13.93955474-5.73311741-3.563271 6.35055051c1.889633 1.4530595 2.5776248 4.0429866 1.5410255 6.156875l-.1223014.2328355-.4183304.7430134 1.6096554.9558483c1.1431442.6791157 2.5155496.3977368 3.1667361-.5628389l.0921501-.1491451 5.2002498-9.2680474c.5752467-1.0252226.2110342-2.4011579-.8559335-3.14755806l-.1742742-.11247814-3.2168203-1.91103915c-1.1402863-.67741793-2.5086889-.39913772-3.1618387.55564729zm-11.79500786 7.00714351-5.20024982 9.2680474c-.57524673 1.0252226-.21103426 2.4011579.85593348 3.1475581l.17427416.1124781 3.21682032 1.9110392c1.14028632.6774179 2.50868892.3991377 3.16183872-.5556473l.0970474-.1563368 3.5622708-6.3513198c-1.8888875-1.4532134-2.5764504-4.042623-1.5400057-6.1561456l.1222818-.2327956.4153938-.7428758-1.6067188-.9559859c-1.1431442-.6791157-2.5155496-.3977368-3.1667361.5628389zm6.97653866 1.5796652-.3817806.6812386c-.5117123.9119895-.2800268 2.1014993.528439 2.8785267l.382717-.6803391c.5119098-.9123415.2798478-2.1024176-.5293754-2.8794262z" class="fill-color" />
|
|
925
922
|
</svg>
|
|
926
|
-
`;class
|
|
923
|
+
`;class ye extends r.WF{static get styles(){return r.AH`
|
|
927
924
|
:host {
|
|
928
925
|
width: var(--iconWidth, 'auto');
|
|
929
926
|
height: var(--iconHeight, 'auto');
|
|
@@ -936,9 +933,9 @@
|
|
|
936
933
|
.stroke-color {
|
|
937
934
|
stroke: var(--iconStrokeColor);
|
|
938
935
|
}
|
|
939
|
-
`}render(){return
|
|
936
|
+
`}render(){return be}}customElements.define("ia-icon-link",ye);const ge=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)},ke=r.qy`<ia-icon-share
|
|
940
937
|
style="width: var(--iconWidth); height: var(--iconHeight);"
|
|
941
|
-
></ia-icon-share>`;let
|
|
938
|
+
></ia-icon-share>`;let we=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
939
|
${this.header}
|
|
943
940
|
<div>
|
|
944
941
|
${this.sharingOptions.map(e=>r.qy` <a class="share-option" href="${e.url}" target="_blank">
|
|
@@ -951,7 +948,7 @@
|
|
|
951
948
|
</summary>
|
|
952
949
|
<div class="embed">
|
|
953
950
|
<h4>Embed</h4>
|
|
954
|
-
<div class="code" @click=${
|
|
951
|
+
<div class="code" @click=${ge}>
|
|
955
952
|
<textarea readonly>${this.iframeEmbed}</textarea>
|
|
956
953
|
<small>Copied to clipboard</small>
|
|
957
954
|
</div>
|
|
@@ -959,7 +956,7 @@
|
|
|
959
956
|
Embed for wordpress.com hosted blogs and archive.org item
|
|
960
957
|
<description> tags
|
|
961
958
|
</h4>
|
|
962
|
-
<div class="code" @click=${
|
|
959
|
+
<div class="code" @click=${ge}>
|
|
963
960
|
<textarea readonly>${this.bbcodeEmbed}</textarea>
|
|
964
961
|
<small>Copied to clipboard</small>
|
|
965
962
|
</div>
|
|
@@ -1085,7 +1082,7 @@
|
|
|
1085
1082
|
small.visible {
|
|
1086
1083
|
opacity: 1;
|
|
1087
1084
|
}
|
|
1088
|
-
`}};(0,o.Cg)([(0,i.MZ)({type:String})],
|
|
1085
|
+
`}};(0,o.Cg)([(0,i.MZ)({type:String})],we.prototype,"baseHost",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],we.prototype,"creator",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],we.prototype,"description",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],we.prototype,"embedOptionsVisible",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],we.prototype,"identifier",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],we.prototype,"sharingOptions",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],we.prototype,"type",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean})],we.prototype,"renderHeader",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],we.prototype,"fileSubPrefix",void 0),we=(0,o.Cg)([(0,i.EM)("iaux-in-share-panel")],we),n(6033);var Ce=a.ge.I,xe=function(){return document.createComment("")},Se=function(e,t,n){var r,o=e._$AA.parentNode,i=void 0===t?e._$AB:t._$AA;if(void 0===n){var a=o.insertBefore(xe(),i),s=o.insertBefore(xe(),i);n=new Ce(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},Oe=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return e._$AI(t,n),e},Me={},Be=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Me;return e._$AH=t},je=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 Pe(e){return Pe="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},Pe(e)}function Ee(e,t){if(e){if("string"==typeof e)return Le(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)?Le(e,t):void 0}}function Le(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 Ae(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,_e(r.key),r)}}function _e(e){var t=function(e){if("object"!=Pe(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Pe(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Pe(t)?t:t+""}function Te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Te=function(){return!!e})()}function ze(e){return ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ze(e)}function Ie(e,t){return Ie=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ie(e,t)}var $e=function(e,t,n){for(var r=new Map,o=t;o<=n;o++)r.set(e[o],o);return r},He=(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=ze(t),function(e,t){if(t&&("object"==Pe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Te()?Reflect.construct(t,n||[],ze(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&&Ie(e,t)}(t,e),function(e,t){return t&&Ae(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=Ee(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)||Ee(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]=Oe(l[v],u[y]),v++,y++;else if(f[b]===d[g])m[g]=Oe(l[b],u[g]),b--,g--;else if(f[v]===d[g])m[g]=Oe(l[v],u[g]),Se(e,m[g+1],l[v]),v++,g--;else if(f[b]===d[y])m[y]=Oe(l[b],u[y]),Se(e,l[v],l[b]),b--,y++;else if(void 0===h&&(h=$e(d,y,g),p=$e(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=Se(e,l[v]);Oe(C,u[y]),m[y]=C}else m[y]=Oe(w,u[y]),Se(e,l[v],w),l[k]=null;y++}else je(l[b]),b--;else je(l[v]),v++;for(;y<=g;){var x=Se(e,m[g+1]);Oe(x,u[y]),m[y++]=x}for(;v<=b;){var S=l[v++];null!==S&&je(S)}return this.ut=d,Be(e,m),a.c0}}])}(s.WL));const qe=r.qy`
|
|
1089
1086
|
<svg
|
|
1090
1087
|
name="sort-asc"
|
|
1091
1088
|
height="18"
|
|
@@ -1114,7 +1111,7 @@
|
|
|
1114
1111
|
/>
|
|
1115
1112
|
</g>
|
|
1116
1113
|
</svg>
|
|
1117
|
-
`,
|
|
1114
|
+
`,De=r.qy`
|
|
1118
1115
|
<svg
|
|
1119
1116
|
name="sort-desc"
|
|
1120
1117
|
height="18"
|
|
@@ -1142,7 +1139,7 @@
|
|
|
1142
1139
|
/>
|
|
1143
1140
|
</g>
|
|
1144
1141
|
</svg>
|
|
1145
|
-
`,
|
|
1142
|
+
`,Re=r.qy`
|
|
1146
1143
|
<svg
|
|
1147
1144
|
name="sort-neutral"
|
|
1148
1145
|
height="18"
|
|
@@ -1162,7 +1159,7 @@
|
|
|
1162
1159
|
<circle cx="13" cy="9" r="2" />
|
|
1163
1160
|
</g>
|
|
1164
1161
|
</svg>
|
|
1165
|
-
`,
|
|
1162
|
+
`,Fe=r.qy`
|
|
1166
1163
|
<svg
|
|
1167
1164
|
height="24"
|
|
1168
1165
|
viewBox="0 0 24 24"
|
|
@@ -1178,13 +1175,13 @@
|
|
|
1178
1175
|
/>
|
|
1179
1176
|
</g>
|
|
1180
1177
|
</svg>
|
|
1181
|
-
`;let
|
|
1178
|
+
`;let We=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
1179
|
<button
|
|
1183
1180
|
class="sort-by neutral-icon"
|
|
1184
1181
|
aria-label="Sort volumes in initial order"
|
|
1185
1182
|
@click=${()=>this.sortVolumes("title_asc")}
|
|
1186
1183
|
>
|
|
1187
|
-
${
|
|
1184
|
+
${Re}
|
|
1188
1185
|
</button>
|
|
1189
1186
|
`,title_asc:r.qy`
|
|
1190
1187
|
<button
|
|
@@ -1192,7 +1189,7 @@
|
|
|
1192
1189
|
aria-label="Sort volumes in ascending order"
|
|
1193
1190
|
@click=${()=>this.sortVolumes("title_desc")}
|
|
1194
1191
|
>
|
|
1195
|
-
${
|
|
1192
|
+
${qe}
|
|
1196
1193
|
</button>
|
|
1197
1194
|
`,title_desc:r.qy`
|
|
1198
1195
|
<button
|
|
@@ -1200,7 +1197,7 @@
|
|
|
1200
1197
|
aria-label="Sort volumes in descending order"
|
|
1201
1198
|
@click=${()=>this.sortVolumes("default")}
|
|
1202
1199
|
>
|
|
1203
|
-
${
|
|
1200
|
+
${De}
|
|
1204
1201
|
</button>
|
|
1205
1202
|
`}[this.sortOrderBy]}sortVolumes(e){this.sortOrderBy=e;let t=[];t=this.fileListRaw.sort((t,n)=>"title_asc"===e?t.title.localeCompare(n.title):"title_desc"===e?n.title.localeCompare(t.title):t.orig_sort-n.orig_sort),this.dispatchEvent(new CustomEvent("fileListSorted",{detail:{sortType:e,sortedFiles:t},bubbles:!0,composed:!0})),this.fileListSorted=t}static get styles(){return r.AH`
|
|
1206
1203
|
button.sort-by {
|
|
@@ -1210,7 +1207,7 @@
|
|
|
1210
1207
|
--iconWidth: var(--menuSliderHeaderIconWidth);
|
|
1211
1208
|
--iconHeight: var(--menuSliderHeaderIconHeight);
|
|
1212
1209
|
}
|
|
1213
|
-
`}};(0,o.Cg)([(0,i.MZ)({type:Array})],
|
|
1210
|
+
`}};(0,o.Cg)([(0,i.MZ)({type:Array})],We.prototype,"fileListRaw",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],We.prototype,"fileListSorted",void 0),(0,o.Cg)([(0,i.MZ)({type:String,reflect:!0})],We.prototype,"sortOrderBy",void 0),We=(0,o.Cg)([(0,i.EM)("iaux-in-sort-files-button")],We);let Ve=class extends r.WF{constructor(){super(...arguments),this.baseHost="archive.org",this.sortOrderBy="default",this.subPrefix="",this.fileList=[],this.addSortToUrl=!1}firstUpdated(){const e=this.shadowRoot.querySelector(".content.active");setTimeout(()=>{(null==e?void 0:e.scrollIntoViewIfNeeded)?null==e||e.scrollIntoViewIfNeeded(!0):null==e||e.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},350)}volumeItemWithImageTitle(e){const t=this.fileUrl(e);return r.qy`
|
|
1214
1211
|
<li class="content active">
|
|
1215
1212
|
<div class="separator"></div>
|
|
1216
1213
|
<a class="container" href="${t}">
|
|
@@ -1236,7 +1233,7 @@
|
|
|
1236
1233
|
</a>
|
|
1237
1234
|
</div>
|
|
1238
1235
|
</li>
|
|
1239
|
-
`}get fileListTemplate(){const e=
|
|
1236
|
+
`}get fileListTemplate(){const e=He(this.fileList,e=>null==e?void 0:e.file_prefix,this.fileLi.bind(this));return r.qy`
|
|
1240
1237
|
<ul>
|
|
1241
1238
|
${e}
|
|
1242
1239
|
<div class="separator"></div>
|
|
@@ -1350,7 +1347,7 @@
|
|
|
1350
1347
|
width: 1px;
|
|
1351
1348
|
overflow: hidden;
|
|
1352
1349
|
}
|
|
1353
|
-
`}};(0,o.Cg)([(0,i.MZ)({type:String})],
|
|
1350
|
+
`}};(0,o.Cg)([(0,i.MZ)({type:String})],Ve.prototype,"baseHost",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],Ve.prototype,"sortOrderBy",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],Ve.prototype,"subPrefix",void 0),(0,o.Cg)([(0,i.MZ)({type:Array})],Ve.prototype,"fileList",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],Ve.prototype,"addSortToUrl",void 0),Ve=(0,o.Cg)([(0,i.EM)("iaux-in-viewable-files-panel")],Ve);class Ne{constructor(e){this.title=e?.title,this.subtitle=e?.subtitle,this.headline=e?.headline,this.message=e?.message,this.headerColor=e?.headerColor??"#55A183",this.bodyColor=e?.bodyColor??"#fbfbfd",this.showProcessingIndicator=e?.showProcessingIndicator??!1,this.processingImageMode=e?.processingImageMode??"complete",this.showCloseButton=e?.showCloseButton??!0,this.showLeftNavButton=e?.showLeftNavButton??!1,this.leftNavButtonText=e?.leftNavButtonText??"",this.showHeaderLogo=e?.showHeaderLogo??!0,this.closeOnBackdropClick=e?.closeOnBackdropClick??!0}}function*Ze(e=document.activeElement){null!=e&&(yield e,"shadowRoot"in e&&e.shadowRoot&&"closed"!==e.shadowRoot.mode&&(yield*Ze(e.shadowRoot.activeElement)))}function Ue(){return[...Ze()].pop()}const Ge=new WeakMap;function Je(e){let t=Ge.get(e);return t||(t=window.getComputedStyle(e,null),Ge.set(e,t)),t}function Xe(e){const t=new WeakMap,n=[];return function r(o){if(o instanceof Element){if(o.hasAttribute("inert")||o.closest("[inert]"))return;if(t.has(o))return;t.set(o,!0),!n.includes(o)&&function(e){const t=e.tagName.toLowerCase(),n=Number(e.getAttribute("tabindex"));return(!e.hasAttribute("tabindex")||!(isNaN(n)||n<=-1))&&!e.hasAttribute("disabled")&&!e.closest("[inert]")&&!("input"===t&&"radio"===e.getAttribute("type")&&!e.hasAttribute("checked"))&&!!function(e){if("checkVisibility"in e&&"function"==typeof e.checkVisibility)return e.checkVisibility({checkOpacity:!1,checkVisibilityCSS:!0});const t=Je(e);return"hidden"!==t.visibility&&"none"!==t.display}(e)&&(!("audio"!==t&&"video"!==t||!e.hasAttribute("controls"))||!!e.hasAttribute("tabindex")||!(!e.hasAttribute("contenteditable")||"false"===e.getAttribute("contenteditable"))||!!["button","input","select","textarea","a","audio","video","summary","iframe"].includes(t)||function(e){const t=Je(e),{overflowY:n,overflowX:r}=t;return"scroll"===n||"scroll"===r||"auto"===n&&"auto"===r&&(e.scrollHeight>e.clientHeight&&"auto"===n||!(!(e.scrollWidth>e.clientWidth)||"auto"!==r))}(e))}(o)&&n.push(o),o instanceof HTMLSlotElement&&function(e,t){return e.getRootNode({composed:!0})?.host!==t}(o,e)&&o.assignedElements({flatten:!0}).forEach(e=>{r(e)}),null!==o.shadowRoot&&"open"===o.shadowRoot.mode&&r(o.shadowRoot)}for(const e of Array.from(o.children))r(e)}(e),n.sort((e,t)=>{const n=Number(e.getAttribute("tabindex"))||0;return(Number(t.getAttribute("tabindex"))||0)-n})}let Ke=[];class Qe{constructor(e){this.isExternalActivated=!1,this.tabDirection="forward",this.currentFocus=null,this.previousFocus=null,this.handleFocusIn=()=>{this.isActive()&&this.checkFocus()},this.handleKeyDown=e=>{if("Tab"!==e.key||this.isExternalActivated)return;if(!this.isActive())return;const t=Ue();if(this.previousFocus=t,this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;e.shiftKey?this.tabDirection="backward":this.tabDirection="forward";const n=Xe(this.element);let r=n.findIndex(e=>e===t);this.previousFocus=this.currentFocus;const o="forward"===this.tabDirection?1:-1;for(;;){r+o>=n.length?r=0:r+o<0?r=n.length-1:r+=o,this.previousFocus=this.currentFocus;const t=n[r];if("backward"===this.tabDirection&&this.previousFocus&&this.possiblyHasTabbableChildren(this.previousFocus))return;if(t&&this.possiblyHasTabbableChildren(t))return;e.preventDefault(),this.currentFocus=t,this.currentFocus?.focus({preventScroll:!1});const i=[...Ze()];if(i.includes(this.currentFocus)||!i.includes(this.previousFocus))break}setTimeout(()=>this.checkFocus())},this.handleKeyUp=()=>{this.tabDirection="forward"},this.element=e,this.elementsWithTabbableControls=["iframe"]}activate(){Ke.push(this.element),document.addEventListener("focusin",this.handleFocusIn),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}deactivate(){Ke=Ke.filter(e=>e!==this.element),this.currentFocus=null,document.removeEventListener("focusin",this.handleFocusIn),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)}isActive(){return Ke[Ke.length-1]===this.element}activateExternal(){this.isExternalActivated=!0}deactivateExternal(){this.isExternalActivated=!1}checkFocus(){if(this.isActive()&&!this.isExternalActivated){const e=Xe(this.element);if(!this.element.matches(":focus-within")){const t=e[0],n=e[e.length-1],r="forward"===this.tabDirection?t:n;"function"==typeof r?.focus&&(this.currentFocus=r,r.focus({preventScroll:!1}))}}}possiblyHasTabbableChildren(e){return this.elementsWithTabbableControls.includes(e.tagName.toLowerCase())||e.hasAttribute("controls")}}n(8248);var Ye=r.qy`
|
|
1354
1351
|
<svg
|
|
1355
1352
|
viewBox="0 0 40 40"
|
|
1356
1353
|
version="1.1"
|
|
@@ -1358,7 +1355,7 @@
|
|
|
1358
1355
|
>
|
|
1359
1356
|
<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"/>
|
|
1360
1357
|
</svg>
|
|
1361
|
-
`;class
|
|
1358
|
+
`;class et extends r.WF{static get styles(){return r.AH`
|
|
1362
1359
|
:host {
|
|
1363
1360
|
width: var(--iconWidth, 'auto');
|
|
1364
1361
|
height: var(--iconHeight, 'auto');
|
|
@@ -1371,7 +1368,7 @@
|
|
|
1371
1368
|
.stroke-color {
|
|
1372
1369
|
stroke: var(--iconStrokeColor);
|
|
1373
1370
|
}
|
|
1374
|
-
`}render(){return
|
|
1371
|
+
`}render(){return Ye}}customElements.define("ia-icon-close",et);var tt=r.qy`
|
|
1375
1372
|
<svg
|
|
1376
1373
|
class="ia-logo"
|
|
1377
1374
|
viewBox="0 0 27 30"
|
|
@@ -1398,7 +1395,7 @@
|
|
|
1398
1395
|
</g>
|
|
1399
1396
|
</g>
|
|
1400
1397
|
</svg>
|
|
1401
|
-
`,
|
|
1398
|
+
`,nt=r.qy`
|
|
1402
1399
|
<svg
|
|
1403
1400
|
viewBox="0 0 100 100"
|
|
1404
1401
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1410,13 +1407,13 @@
|
|
|
1410
1407
|
d="m20.1116715 50.0035012-.1116715-.1085359 43.1159942-46.61088155c2.401537-2.18938917 4.6902018-3.28408375 6.8659943-3.28408375s4.1642651.63837733 5.9654178 1.91513199c1.8011528 1.27675467 3.1520173 2.97248092 4.0525937 5.08717877l-39.4020173 42.99768924 39.4020173 42.9976892c-.9005764 2.1146979-2.2514409 3.8104241-4.0525937 5.0871788-1.8011527 1.2767547-3.7896253 1.915132-5.9654178 1.915132-2.1013449 0-4.3900096-1.0573489-6.8659943-3.1720468l-43.1159942-46.7194174z"
|
|
1411
1408
|
/>
|
|
1412
1409
|
</svg>
|
|
1413
|
-
`;let
|
|
1410
|
+
`;let rt=class extends r.WF{constructor(){super(...arguments),this.config=new Ne}render(){return r.qy`
|
|
1414
1411
|
<div class="modal-wrapper">
|
|
1415
1412
|
<div class="modal-container">
|
|
1416
1413
|
<header style="background-color: ${this.config.headerColor}">
|
|
1417
1414
|
${this.config.showLeftNavButton?this.leftNavButtonTemplate:r.s6}
|
|
1418
1415
|
${this.config.showCloseButton?this.closeButtonTemplate:""}
|
|
1419
|
-
${this.config.showHeaderLogo?r.qy`<div class="logo-icon">${
|
|
1416
|
+
${this.config.showHeaderLogo?r.qy`<div class="logo-icon">${tt}</div>`:r.s6}
|
|
1420
1417
|
${this.config.title?r.qy`<h1 class="title">${this.config.title}</h1>`:""}
|
|
1421
1418
|
${this.config.subtitle?r.qy`<h2 class="subtitle">${this.config.subtitle}</h2>`:""}
|
|
1422
1419
|
</header>
|
|
@@ -1457,7 +1454,7 @@
|
|
|
1457
1454
|
@click=${this.handleLeftNavButtonPressed}
|
|
1458
1455
|
@keydown=${this.handleLeftNavButtonPressed}
|
|
1459
1456
|
>
|
|
1460
|
-
${
|
|
1457
|
+
${nt} ${this.config.leftNavButtonText??""}
|
|
1461
1458
|
</button> `}static get styles(){const e=r.AH`var(--modalLogoSize, 6.5rem)`,t=r.AH`var(--processingImageSize, 7.5rem)`,n=r.AH`var(--modalCornerRadius, 1rem)`,o=r.AH`var(--modalBorder, 2px solid black)`,i=r.AH`var(--modalBottomMargin, 2.5rem)`,a=r.AH`var(--modalTopMargin, 5rem)`,s=r.AH`var(--modalHeaderBottomPadding, 0.5em)`,l=r.AH`var(--modalBottomPadding, 2rem)`,c=r.AH`var(--modalScrollOffset, 5px)`,u=r.AH`var(--modalTitleFontSize, 1.8rem)`,d=r.AH`var(--modalSubtitleFontSize, 1.4rem)`,h=r.AH`var(--modalHeadlineFontSize, 1.6rem)`,p=r.AH`var(--modalMessageFontSize, 1.4rem)`,f=r.AH`var(--modalTitleLineHeight, normal)`,m=r.AH`var(--modalSubtitleLineHeight, normal)`,v=r.AH`var(--modalHeadlineLineHeight, normal)`,b=r.AH`var(--modalMessageLineHeight, normal)`;return r.AH`
|
|
1462
1459
|
.processing-logo {
|
|
1463
1460
|
margin: auto;
|
|
@@ -1632,7 +1629,7 @@
|
|
|
1632
1629
|
clip: rect(0, 0, 0, 0);
|
|
1633
1630
|
border: 0;
|
|
1634
1631
|
}
|
|
1635
|
-
`}};var
|
|
1632
|
+
`}};var ot;(0,o.Cg)([(0,i.MZ)({type:Object})],rt.prototype,"config",void 0),rt=(0,o.Cg)([(0,i.EM)("modal-template")],rt),function(e){e.Open="open",e.Closed="closed"}(ot||(ot={}));class it{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 ot.Open:this.startResizeListener(),this.stopDocumentScroll();break;case ot.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 at=class extends r.WF{constructor(){super(...arguments),this.mode=ot.Closed,this.hostBridge=new it(this),this.modal=new Qe(this),this.closeOnBackdropClick=!0}async firstUpdated(){await new Promise(e=>setTimeout(e,0)),this.closeOnBackdropClick&&this.addEventListener("keydown",e=>{"Escape"===e.key&&this.backdropClicked()})}disconnectedCallback(){super.disconnectedCallback(),this.modal.deactivate()}render(){return r.qy`
|
|
1636
1633
|
<div class="container">
|
|
1637
1634
|
<div class="backdrop" @click=${this.backdropClicked}></div>
|
|
1638
1635
|
<modal-template
|
|
@@ -1643,7 +1640,7 @@
|
|
|
1643
1640
|
${this.customModalContent}
|
|
1644
1641
|
</modal-template>
|
|
1645
1642
|
</div>
|
|
1646
|
-
`}getMode(){return this.mode}closeModal(){this.mode=
|
|
1643
|
+
`}getMode(){return this.mode}closeModal(){this.mode=ot.Closed,this.customModalContent=void 0,this.modalTemplate&&(this.modalTemplate.config=new Ne),this.modal.deactivate(),this.triggeringElement?.focus?.(),this.triggeringElement=void 0}callUserClosedModalCallback(){const e=this.userClosedModalCallback;this.userClosedModalCallback=void 0,e&&e()}callUserPressedLeftNavButtonCallback(){const e=this.userPressedLeftNavButtonCallback;this.userPressedLeftNavButtonCallback=void 0,e&&e()}async showModal(e){this.mode===ot.Closed&&this.captureFocusedElement(),this.closeOnBackdropClick=e.config.closeOnBackdropClick,this.userClosedModalCallback=e.userClosedModalCallback,this.userPressedLeftNavButtonCallback=e.userPressedLeftNavButtonCallback,this.customModalContent=e.customModalContent,this.mode=ot.Open,this.modalTemplate&&(this.modalTemplate.config=e.config,await this.modalTemplate.updateComplete,this.modalTemplate.focus()),this.modal.activate()}captureFocusedElement(){this.triggeringElement=Ue()}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`
|
|
1647
1644
|
.container {
|
|
1648
1645
|
width: 100%;
|
|
1649
1646
|
height: 100%;
|
|
@@ -1669,7 +1666,7 @@
|
|
|
1669
1666
|
width: ${n};
|
|
1670
1667
|
max-width: ${o};
|
|
1671
1668
|
}
|
|
1672
|
-
`}};(0,o.Cg)([(0,i.MZ)({type:String,reflect:!0})],
|
|
1669
|
+
`}};(0,o.Cg)([(0,i.MZ)({type:String,reflect:!0})],at.prototype,"mode",void 0),(0,o.Cg)([(0,i.MZ)({type:Object})],at.prototype,"customModalContent",void 0),(0,o.Cg)([(0,i.MZ)({type:Object})],at.prototype,"hostBridge",void 0),(0,o.Cg)([(0,i.P)("modal-template")],at.prototype,"modalTemplate",void 0),at=(0,o.Cg)([(0,i.EM)("modal-manager")],at);class st{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)))}}var lt=r.qy`
|
|
1673
1670
|
<svg
|
|
1674
1671
|
class="ia-logo"
|
|
1675
1672
|
viewBox="0 0 27 30"
|
|
@@ -1685,7 +1682,7 @@
|
|
|
1685
1682
|
</g>
|
|
1686
1683
|
</g>
|
|
1687
1684
|
</svg>
|
|
1688
|
-
`;class
|
|
1685
|
+
`;class ct extends r.WF{static get styles(){return r.AH`
|
|
1689
1686
|
:host {
|
|
1690
1687
|
width: var(--iconWidth, 'auto');
|
|
1691
1688
|
height: var(--iconHeight, 'auto');
|
|
@@ -1698,7 +1695,7 @@
|
|
|
1698
1695
|
.stroke-color {
|
|
1699
1696
|
stroke: var(--iconStrokeColor);
|
|
1700
1697
|
}
|
|
1701
|
-
`}render(){return
|
|
1698
|
+
`}render(){return lt}}customElements.define("ia-icon-ia-logo",ct);var ut=r.qy`
|
|
1702
1699
|
<svg
|
|
1703
1700
|
viewBox="0 0 100 100"
|
|
1704
1701
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1708,7 +1705,7 @@
|
|
|
1708
1705
|
fill="none"
|
|
1709
1706
|
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" />
|
|
1710
1707
|
</svg>
|
|
1711
|
-
`;class
|
|
1708
|
+
`;class dt extends r.WF{static get styles(){return r.AH`
|
|
1712
1709
|
:host {
|
|
1713
1710
|
width: var(--iconWidth, 'auto');
|
|
1714
1711
|
height: var(--iconHeight, 'auto');
|
|
@@ -1721,7 +1718,7 @@
|
|
|
1721
1718
|
.stroke-color {
|
|
1722
1719
|
stroke: var(--iconStrokeColor);
|
|
1723
1720
|
}
|
|
1724
|
-
`}render(){return ht}}function ft(e){return ft="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},ft(e)}function mt(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,vt(r.key),r)}}function vt(e){var t=function(e){if("object"!=ft(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ft(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ft(t)?t:t+""}function bt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(bt=function(){return!!e})()}function yt(e){return yt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},yt(e)}function gt(e,t){return gt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gt(e,t)}customElements.define("ia-icon-search",pt);var kt=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=yt(t),function(e,t){if(t&&("object"==ft(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,bt()?Reflect.construct(t,n||[],yt(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&>(e,t)}(t,e),function(e,t){return t&&mt(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);kt.directiveName="unsafeHTML",kt.resultType=1;var wt,Ct,xt,St,Ot,Mt,Bt,jt,Pt,Et,Lt,At,_t,Tt,zt,It,$t,Ht,Dt=(0,s.u$)(kt),qt=(0,r.qy)(wt||(xt=['\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'],St||(St=xt.slice(0)),wt=Object.freeze(Object.defineProperties(xt,{raw:{value:Object.freeze(St)}})))),Rt=(0,r.AH)(Ct||(Ct=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"]))),Ft=n(4535),Wt=(0,r.AH)(Ot||(Ot=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 Vt(e){e.prototype&&(e=e.prototype.render());var t=e.strings[0];return(0,r.AH)(["data:image/svg+xml;base64,".concat(btoa(t.replace(/\n/g," ")))])}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 Zt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ut(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,Gt(r.key),r)}}function Gt(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 Jt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Jt=function(){return!!e})()}function Xt(e){return Xt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Xt(e)}function Kt(e,t){return Kt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Kt(e,t)}n(5440);var Qt,Yt,en,tn,nn=Vt(qt),rn=Vt(tt),on=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Xt(t),function(e,t){if(t&&("object"==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,Jt()?Reflect.construct(t,n||[],Xt(e).constructor):t.apply(e,n))}(this,t)).results=[],e.query="",e.queryInProgress=!1,e.renderHeader=!1,e.renderSearchAllFiles=!1,e.errorMessage="",e.bindBookReaderListeners(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kt(e,t)}(t,e),function(e,t,n){return t&&Ut(e.prototype,t),n&&Ut(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)(Mt||(Mt=Zt(["<header>\n <h3>Search inside</h3>\n ","\n </header>"])),this.resultsCount?(0,r.qy)(Bt||(Bt=Zt(["(",")"])),this.resultsCount):r.s6);return this.renderHeader?e:r.s6}},{key:"searchMultipleControls",get:function(){var e=(0,r.qy)(jt||(jt=Zt(['\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)(Pt||(Pt=Zt(['\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)(Et||(Et=Zt(['\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)(Lt||(Lt=Zt(['\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,Ft.J)(t.lang),Dt(t.html))}),function(t){t.preventDefault(),e.shadowRoot.querySelector(".results li:first-child .result-item").focus()})}},{key:"setErrorMessage",get:function(){return(0,r.qy)(At||(At=Zt(['\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)(_t||(_t=Zt(["\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)(Tt||(Tt=Zt(["var(--searchResultText, #adaedc)"]))),t=(0,r.AH)(zt||(zt=Zt(["var(--searchResultBg, #272958)"]))),n=(0,r.AH)(It||(It=Zt(["var(--searchResultBorder, #adaedc)"]))),o=(0,r.AH)($t||($t=Zt(["(--tertiaryBGColor, #333)"]))),i=(0,r.AH)(Ht||(Ht=Zt(["\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,nn,o,rn,rn);return[Wt,Rt,i]}}])}(r.WF);function an(e){return an="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},an(e)}function sn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ln(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,cn(r.key),r)}}function cn(e){var t=function(e){if("object"!=an(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=an(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==an(t)?t:t+""}customElements.define("ia-book-search-results",on);var un,dn,hn,pn,fn,mn,vn,bn,yn,gn,kn,wn={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},Cn=function(){return function(e,t){return t&&ln(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)(Qt||(Qt=sn(['\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=wn,t=e.resultsCount,n=e.query;if(e.queryInProgress||!n)return r.s6;var o=1===t?"result":"results";return(0,r.qy)(Yt||(Yt=sn(["("," ",")"])),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(){wn={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),wn.query=r,wn.results=[],wn.resultsCount=0,wn.queryInProgress=!0,wn.errorMessage="",this.updateMenu()}},{key:"onBookSearchInitiated",value:function(e){var t=e.detail;wn.query=t.query,this.bookreader.search(wn.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;wn.query=(null==a?void 0:a.q)||"",wn.results=[],wn.resultsCount=0,wn.queryInProgress=!1,wn.errorMessage=(0,r.qy)(en||(en=sn(['<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;wn={results:s,resultsCount:l,query:c,queryInProgress:!1,errorMessage:""},this.updateMenu()}},{key:"searchCanceledInMenu",value:function(){this.bookreader.plugins.search.cancelSearchRequest()}},{key:"onSearchResultsCleared",value:function(){wn={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(),wn.query?this.bookreader.urlPlugin.setUrlParam("q",wn.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=wn,t=e.query,n=e.results,o=e.queryInProgress,i=e.errorMessage;return(0,r.qy)(tn||(tn=sn(["\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)}}])}(),xn=(n(2712),r.qy`
|
|
1721
|
+
`}render(){return ut}}function ht(e){return ht="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},ht(e)}function pt(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,ft(r.key),r)}}function ft(e){var t=function(e){if("object"!=ht(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ht(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ht(t)?t:t+""}function mt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(mt=function(){return!!e})()}function vt(e){return vt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},vt(e)}function bt(e,t){return bt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},bt(e,t)}customElements.define("ia-icon-search",dt);var yt=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=vt(t),function(e,t){if(t&&("object"==ht(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,mt()?Reflect.construct(t,n||[],vt(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&&bt(e,t)}(t,e),function(e,t){return t&&pt(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);yt.directiveName="unsafeHTML",yt.resultType=1;var gt,kt,wt,Ct,xt,St,Ot,Mt,Bt,jt,Pt,Et,Lt,At,_t,Tt,zt,It,$t=(0,s.u$)(yt),Ht=(0,r.qy)(gt||(wt=['\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'],Ct||(Ct=wt.slice(0)),gt=Object.freeze(Object.defineProperties(wt,{raw:{value:Object.freeze(Ct)}})))),qt=(0,r.AH)(kt||(kt=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"]))),Dt=n(4535),Rt=(0,r.AH)(xt||(xt=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 Ft(e){e.prototype&&(e=e.prototype.render());var t=e.strings[0];return(0,r.AH)(["data:image/svg+xml;base64,".concat(btoa(t.replace(/\n/g," ")))])}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 Vt(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Nt(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"!=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+""}function Ut(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ut=function(){return!!e})()}function Gt(e){return Gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gt(e)}function Jt(e,t){return Jt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jt(e,t)}n(5440);var Xt,Kt,Qt,Yt,en=Ft(Ht),tn=Ft(Ye),nn=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=Gt(t),function(e,t){if(t&&("object"==Wt(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,Ut()?Reflect.construct(t,n||[],Gt(e).constructor):t.apply(e,n))}(this,t)).results=[],e.query="",e.queryInProgress=!1,e.renderHeader=!1,e.renderSearchAllFiles=!1,e.errorMessage="",e.bindBookReaderListeners(),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Jt(e,t)}(t,e),function(e,t,n){return t&&Nt(e.prototype,t),n&&Nt(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)(St||(St=Vt(["<header>\n <h3>Search inside</h3>\n ","\n </header>"])),this.resultsCount?(0,r.qy)(Ot||(Ot=Vt(["(",")"])),this.resultsCount):r.s6);return this.renderHeader?e:r.s6}},{key:"searchMultipleControls",get:function(){var e=(0,r.qy)(Mt||(Mt=Vt(['\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=Vt(['\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)(jt||(jt=Vt(['\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)(Pt||(Pt=Vt(['\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,Dt.J)(t.lang),$t(t.html))}),function(t){t.preventDefault(),e.shadowRoot.querySelector(".results li:first-child .result-item").focus()})}},{key:"setErrorMessage",get:function(){return(0,r.qy)(Et||(Et=Vt(['\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)(Lt||(Lt=Vt(["\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)(At||(At=Vt(["var(--searchResultText, #adaedc)"]))),t=(0,r.AH)(_t||(_t=Vt(["var(--searchResultBg, #272958)"]))),n=(0,r.AH)(Tt||(Tt=Vt(["var(--searchResultBorder, #adaedc)"]))),o=(0,r.AH)(zt||(zt=Vt(["(--tertiaryBGColor, #333)"]))),i=(0,r.AH)(It||(It=Vt(["\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,en,o,tn,tn);return[Rt,qt,i]}}])}(r.WF);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 on(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function an(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,sn(r.key),r)}}function sn(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+""}customElements.define("ia-book-search-results",nn);var ln,cn,un,dn,hn,pn,fn,mn,vn,bn,yn,gn={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},kn=function(){return function(e,t){return t&&an(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)(Xt||(Xt=on(['\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=gn,t=e.resultsCount,n=e.query;if(e.queryInProgress||!n)return r.s6;var o=1===t?"result":"results";return(0,r.qy)(Kt||(Kt=on(["("," ",")"])),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(){gn={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),gn.query=r,gn.results=[],gn.resultsCount=0,gn.queryInProgress=!0,gn.errorMessage="",this.updateMenu()}},{key:"onBookSearchInitiated",value:function(e){var t=e.detail;gn.query=t.query,this.bookreader.search(gn.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;gn.query=(null==a?void 0:a.q)||"",gn.results=[],gn.resultsCount=0,gn.queryInProgress=!1,gn.errorMessage=(0,r.qy)(Qt||(Qt=on(['<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;gn={results:s,resultsCount:l,query:c,queryInProgress:!1,errorMessage:""},this.updateMenu()}},{key:"searchCanceledInMenu",value:function(){this.bookreader.plugins.search.cancelSearchRequest()}},{key:"onSearchResultsCleared",value:function(){gn={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(),gn.query?this.bookreader.urlPlugin.setUrlParam("q",gn.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=gn,t=e.query,n=e.results,o=e.queryInProgress,i=e.errorMessage;return(0,r.qy)(Yt||(Yt=on(["\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)}}])}(),wn=(n(2712),r.qy`
|
|
1725
1722
|
<svg
|
|
1726
1723
|
viewBox="0 0 100 100"
|
|
1727
1724
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1731,7 +1728,7 @@
|
|
|
1731
1728
|
<path d="m50 80 33.3333333-43.3333333h-20v-36.6666667h-26.6666666v36.6666667h-20zm50 20v-13.3333333h-100v13.3333333z"/>
|
|
1732
1729
|
</g>
|
|
1733
1730
|
</svg>
|
|
1734
|
-
`);class
|
|
1731
|
+
`);class Cn extends r.WF{static get styles(){return r.AH`
|
|
1735
1732
|
:host {
|
|
1736
1733
|
width: var(--iconWidth, 'auto');
|
|
1737
1734
|
height: var(--iconHeight, 'auto');
|
|
@@ -1744,14 +1741,14 @@
|
|
|
1744
1741
|
.stroke-color {
|
|
1745
1742
|
stroke: var(--iconStrokeColor);
|
|
1746
1743
|
}
|
|
1747
|
-
`}render(){return
|
|
1744
|
+
`}render(){return wn}}function xn(e){return xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xn(e)}function Sn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function On(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,Mn(r.key),r)}}function Mn(e){var t=function(e){if("object"!=xn(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=xn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xn(t)?t:t+""}function Bn(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Bn=function(){return!!e})()}function jn(e){return jn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jn(e)}function Pn(e,t){return Pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pn(e,t)}customElements.define("ia-icon-dl",Cn);var En,Ln,An=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=jn(t),function(e,t){if(t&&("object"==xn(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,Bn()?Reflect.construct(t,n||[],jn(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&&Pn(e,t)}(t,e),function(e,t,n){return t&&On(e.prototype,t),n&&On(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"formatsCount",get:function(){var e=this.downloads.length;return e?(0,r.qy)(ln||(ln=Sn(["<p>"," format","</p>"])),e,e>1?"s":""):(0,r.qy)(cn||(cn=Sn([""])))}},{key:"loanExpiryMessage",get:function(){return this.expiration?(0,r.qy)(un||(un=Sn(["<h2>These files will expire in "," days.</h2>"])),this.expiration):(0,r.qy)(dn||(dn=Sn([""])))}},{key:"renderDownloadOptions",value:function(){return this.downloads.map(function(e){return(0,r.qy)(hn||(hn=Sn(['\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)(pn||(pn=Sn(["<p>","</p>"])),e.note):(0,r.qy)(fn||(fn=Sn([""]))))})}},{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)(mn||(mn=Sn(["\n <header>\n <h3>Downloadable files</h3>\n ","\n </header>\n "])),this.formatsCount):r.s6}},{key:"installLCPSoftwareMsg",get:function(){return(0,r.qy)(vn||(vn=Sn(['\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)(bn||(bn=Sn(["\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)(yn||(yn=Sn(["\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[qt,e]}}])}(r.WF);function _n(e){return _n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_n(e)}function Tn(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 zn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function In(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,$n(r.key),r)}}function $n(e){var t=function(e){if("object"!=_n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_n(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_n(t)?t:t+""}customElements.define("ia-book-downloads",An);var Hn={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."}},qn={pdf:"PDF",epub:"ePub",lcppdf:"LCP PDF",lcpepub:"LCP ePub"},Dn=function(){return function(e,t){return t&&In(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)(En||(En=zn(['<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 Tn(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)?Tn(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=Hn[s]||null;if(l){var c=e.isBookProtected?Hn[s].type:qn[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)(Ln||(Ln=zn(["<ia-book-downloads .downloads=","></ia-book-downloads>"])),this.downloads)}}])}(),Rn=r.qy`
|
|
1748
1745
|
<svg
|
|
1749
1746
|
viewBox="0 0 24 24"
|
|
1750
1747
|
xmlns="http://www.w3.org/2000/svg"
|
|
1751
1748
|
>
|
|
1752
1749
|
<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" />
|
|
1753
1750
|
</svg>
|
|
1754
|
-
`;class
|
|
1751
|
+
`;class Fn extends r.WF{static get styles(){return r.AH`
|
|
1755
1752
|
:host {
|
|
1756
1753
|
width: var(--iconWidth, 'auto');
|
|
1757
1754
|
height: var(--iconHeight, 'auto');
|
|
@@ -1764,7 +1761,7 @@
|
|
|
1764
1761
|
.stroke-color {
|
|
1765
1762
|
stroke: var(--iconStrokeColor);
|
|
1766
1763
|
}
|
|
1767
|
-
`}render(){return
|
|
1764
|
+
`}render(){return Rn}}customElements.define("ia-icon-visual-adjustment",Fn);var Wn=r.qy`
|
|
1768
1765
|
<svg
|
|
1769
1766
|
viewBox="0 0 100 100"
|
|
1770
1767
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1777,7 +1774,7 @@
|
|
|
1777
1774
|
<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"/>
|
|
1778
1775
|
</g>
|
|
1779
1776
|
</svg>
|
|
1780
|
-
`;class
|
|
1777
|
+
`;class Vn extends r.WF{static get styles(){return r.AH`
|
|
1781
1778
|
:host {
|
|
1782
1779
|
width: var(--iconWidth, 'auto');
|
|
1783
1780
|
height: var(--iconHeight, 'auto');
|
|
@@ -1790,7 +1787,7 @@
|
|
|
1790
1787
|
.stroke-color {
|
|
1791
1788
|
stroke: var(--iconStrokeColor);
|
|
1792
1789
|
}
|
|
1793
|
-
`}render(){return
|
|
1790
|
+
`}render(){return Wn}}customElements.define("ia-icon-magnify-minus",Vn);var Nn,Zn,Un,Gn,Jn,Xn,Kn,Qn=r.qy`
|
|
1794
1791
|
<svg
|
|
1795
1792
|
viewBox="0 0 100 100"
|
|
1796
1793
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -1803,7 +1800,7 @@
|
|
|
1803
1800
|
<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"/>
|
|
1804
1801
|
</g>
|
|
1805
1802
|
</svg>
|
|
1806
|
-
`;class
|
|
1803
|
+
`;class Yn extends r.WF{static get styles(){return r.AH`
|
|
1807
1804
|
:host {
|
|
1808
1805
|
width: var(--iconWidth, 'auto');
|
|
1809
1806
|
height: var(--iconHeight, 'auto');
|
|
@@ -1816,14 +1813,14 @@
|
|
|
1816
1813
|
.stroke-color {
|
|
1817
1814
|
stroke: var(--iconStrokeColor);
|
|
1818
1815
|
}
|
|
1819
|
-
`}render(){return er}}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 rr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function or(e){return function(e){if(Array.isArray(e))return ir(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 ir(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)?ir(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 ir(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 ar(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,sr(r.key),r)}}function sr(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 lr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(lr=function(){return!!e})()}function cr(e){return cr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},cr(e)}function ur(e,t){return ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ur(e,t)}customElements.define("ia-icon-magnify-plus",tr);var dr,hr,pr=function(e){return"visualAdjustment".concat(e)},fr={optionChange:pr("OptionChanged"),zoomIn:pr("ZoomIn"),zoomOut:pr("ZoomOut")},mr=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=cr(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,lr()?Reflect.construct(t,n||[],cr(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&&ur(e,t)}(t,e),function(e,t,n){return t&&ar(e.prototype,t),n&&ar(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(or(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(fr.optionChange,{bubbles:!0,composed:!0,detail:t}))}},{key:"emitZoomIn",value:function(){this.dispatchEvent(new CustomEvent(fr.zoomIn))}},{key:"emitZoomOut",value:function(){this.dispatchEvent(new CustomEvent(fr.zoomOut))}},{key:"changeActiveStateFor",value:function(e){var t=or(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=or(this.options);n.find(function(t){return t.id===e}).value=t,this.options=or(n)}},{key:"rangeSlider",value:function(e){var t=this;return(0,r.qy)(Un||(Un=rr(["\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)(Gn||(Gn=rr(['\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)(Jn||(Jn=rr(["<p>("," active)</p>"])),this.activeCount):r.s6,t=(0,r.qy)(Xn||(Xn=rr(["<header>\n <h3>Visual adjustments</h3>\n ","\n </header>"])),e);return this.renderHeader?t:r.s6}},{key:"zoomControls",get:function(){return(0,r.qy)(Kn||(Kn=rr(['\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)(Qn||(Qn=rr(["\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(){var e=(0,r.AH)(Yn||(Yn=rr(['\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[Wt,e]}}])}(r.WF);function vr(e){return vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vr(e)}function br(e,t){(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 yr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function gr(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,kr(r.key),r)}}function kr(e){var t=function(e){if("object"!=vr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==vr(t)?t:t+""}customElements.define("ia-book-visual-adjustments",mr);var wr,Cr,xr=[{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}],Sr=function(){return function(e,t){return t&&gr(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)(dr||(dr=yr(['<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)(hr||(hr=yr(["\n <ia-book-visual-adjustments\n .options=","\n @visualAdjustmentOptionChanged=","\n @visualAdjustmentZoomIn=","\n @visualAdjustmentZoomOut=","\n ></ia-book-visual-adjustments>\n "])),xr,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 br(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 br(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)?br(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 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 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,jr(r.key),r)}}function jr(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 Lr(e,t){return Lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Lr(e,t)}var Ar,_r,Tr=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=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,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&&Lr(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)(wr||(wr=Mr(['\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)(Cr||(Cr=Mr(['\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 zr(e){return zr="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},zr(e)}function Ir(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function $r(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,Hr(r.key),r)}}function Hr(e){var t=function(e){if("object"!=zr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=zr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zr(t)?t:t+""}function Dr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Dr=function(){return!!e})()}function qr(e){return qr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},qr(e)}function Rr(e,t){return Rr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Rr(e,t)}customElements.define("delete-modal-actions",Tr);var Fr,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=qr(t),function(e,t){if(t&&("object"==zr(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,Dr()?Reflect.construct(t,n||[],qr(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&&Rr(e,t)}(t,e),function(e,t,n){return t&&$r(e.prototype,t),n&&$r(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)(Ar||(Ar=Ir(["\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)(_r||(_r=Ir(["\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 Vr(e){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vr(e)}function Nr(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,Zr(r.key),r)}}function Zr(e){var t=function(e){if("object"!=Vr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vr(t)?t:t+""}function Ur(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ur=function(){return!!e})()}function Gr(e){return Gr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Gr(e)}function Jr(e,t){return Jr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Jr(e,t)}customElements.define("bookmark-button",Wr),n(4423),n(739),n(8940),n(3362),n(1699);var Xr,Kr,Qr,Yr,eo,to,no,ro,oo,io=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=Gr(t),function(e,t){if(t&&("object"==Vr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Ur()?Reflect.construct(t,n||[],Gr(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&&Jr(e,t)}(t,e),function(e,t,n){return t&&Nr(e.prototype,t),n&&Nr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(){return(0,r.qy)(Fr||(Fr=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 Rt}}])}(r.WF);function ao(e){return ao="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},ao(e)}function so(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function lo(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 co(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lo(Object(n),!0).forEach(function(t){uo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function uo(e,t,n){return(t=bo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ho(){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 po(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]())):(po(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,po(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,po(d,"constructor",c),po(c,"constructor",l),l.displayName="GeneratorFunction",po(c,o,"GeneratorFunction"),po(d),po(d,o,"Generator"),po(d,r,function(){return this}),po(d,"toString",function(){return"[object Generator]"}),(ho=function(){return{w:i,m:h}})()}function po(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}po=function(e,t,n,r){function i(t,n){po(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))},po(e,t,n,r)}function fo(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 mo(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){fo(i,r,o,a,s,"next",e)}function s(e){fo(i,r,o,a,s,"throw",e)}a(void 0)})}}function vo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bo(r.key),r)}}function bo(e){var t=function(e){if("object"!=ao(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ao(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ao(t)?t:t+""}function yo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(yo=function(){return!!e})()}function go(e){return go=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},go(e)}function ko(e,t){return ko=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ko(e,t)}customElements.define("bookmarks-login",io);var wo,Co={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})})}},xo=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=go(t),function(e,t){if(t&&("object"==ao(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,yo()?Reflect.construct(t,n||[],go(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=Co,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&&ko(e,t)}(t,e),function(e,t,n){return t&&vo(e.prototype,t),n&&vo(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=mo(ho().m(function e(){return ho().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 co(co({},c),{},{id:r,leafNum:r,page:u,thumbnail:d})}},{key:"fetchBookmarks",value:(n=mo(ho().m(function e(){var t,n,r,o,i,a,s,l,c,u,d=this;return ho().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(co(co({},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)(Xr||(Xr=so(["\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)(Kr||(Kr=so(["\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=co({},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)(Qr||(Qr=so(['\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)(Yr||(Yr=so(["\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,co({},this.bookmarks),this.activeBookmarkID,this.bookmarkColors,this.defaultColor)}},{key:"bookmarkHelperMessage",get:function(){return(0,r.qy)(eo||(eo=so(["<p>Please use 1up or 2up view modes to add bookmark.</p>"])))}},{key:"render",value:function(){var e=this,t=(0,r.qy)(to||(to=so(["\n ","\n ","\n "])),this.bookmarksList,this.allowAddingBookmark?this.addBookmarkButton:this.bookmarkHelperMessage);return(0,r.qy)(no||(no=so(['\n <section class="bookmarks">\n ',"\n </section>\n "])),"login"===this.displayMode?(0,r.qy)(ro||(ro=so(["<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)(oo||(oo=so(["\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[Rt,e]}},{key:"formatPage",value:function(e){return isNaN(+e)?"(".concat(e.replace(/\D/g,""),")"):e}}]);var n,o}(r.WF);customElements.define("ia-bookmarks",xo);var So,Oo,Mo,Bo,jo,Po=(0,r.AH)(wo||(wo=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 Eo(e){return Eo="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},Eo(e)}function Lo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ao(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,_o(r.key),r)}}function _o(e){var t=function(e){if("object"!=Eo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Eo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Eo(t)?t:t+""}function To(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(To=function(){return!!e})()}function zo(e){return zo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zo(e)}function Io(e,t){return Io=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Io(e,t)}var $o=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=zo(t),function(e,t){if(t&&("object"==Eo(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,To()?Reflect.construct(t,n||[],zo(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&&Io(e,t)}(t,e),function(e,t,n){return t&&Ao(e.prototype,t),n&&Ao(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)(So||(So=Lo(['\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)(Oo||(Oo=Lo(['\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)(Mo||(Mo=Lo(["\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,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)(Bo||(Bo=Lo(["<header>\n <h3>Edit Bookmark</h3>\n </header>"])))}},{key:"styles",get:function(){var e=(0,r.AH)(jo||(jo=Lo(['\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[Rt,Po,e]}}])}(r.WF);customElements.define("ia-bookmark-edit",$o),n(6910);var Ho,Do,qo,Ro,Fo,Wo,Vo,No,Zo=r.qy`
|
|
1816
|
+
`}render(){return Qn}}function er(e){return er="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},er(e)}function tr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function nr(e){return function(e){if(Array.isArray(e))return rr(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 rr(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)?rr(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 rr(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 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"!=er(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=er(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==er(t)?t:t+""}function ar(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ar=function(){return!!e})()}function sr(e){return sr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sr(e)}function lr(e,t){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lr(e,t)}customElements.define("ia-icon-magnify-plus",Yn);var cr,ur,dr=function(e){return"visualAdjustment".concat(e)},hr={optionChange:dr("OptionChanged"),zoomIn:dr("ZoomIn"),zoomOut:dr("ZoomOut")},pr=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=sr(t),function(e,t){if(t&&("object"==er(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||[],sr(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&&lr(e,t)}(t,e),function(e,t,n){return t&&or(e.prototype,t),n&&or(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(nr(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(hr.optionChange,{bubbles:!0,composed:!0,detail:t}))}},{key:"emitZoomIn",value:function(){this.dispatchEvent(new CustomEvent(hr.zoomIn))}},{key:"emitZoomOut",value:function(){this.dispatchEvent(new CustomEvent(hr.zoomOut))}},{key:"changeActiveStateFor",value:function(e){var t=nr(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=nr(this.options);n.find(function(t){return t.id===e}).value=t,this.options=nr(n)}},{key:"rangeSlider",value:function(e){var t=this;return(0,r.qy)(Nn||(Nn=tr(["\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)(Zn||(Zn=tr(['\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)(Un||(Un=tr(["<p>("," active)</p>"])),this.activeCount):r.s6,t=(0,r.qy)(Gn||(Gn=tr(["<header>\n <h3>Visual adjustments</h3>\n ","\n </header>"])),e);return this.renderHeader?t:r.s6}},{key:"zoomControls",get:function(){return(0,r.qy)(Jn||(Jn=tr(['\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)(Xn||(Xn=tr(["\n ","\n ","\n ","\n "])),this.headerSection,He(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)(Kn||(Kn=tr(['\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[Rt,e]}}])}(r.WF);function fr(e){return fr="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},fr(e)}function mr(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 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"!=fr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fr(t)?t:t+""}customElements.define("ia-book-visual-adjustments",pr);var gr,kr,wr=[{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&&br(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)(cr||(cr=vr(['<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)(ur||(ur=vr(["\n <ia-book-visual-adjustments\n .options=","\n @visualAdjustmentOptionChanged=","\n @visualAdjustmentZoomIn=","\n @visualAdjustmentZoomOut=","\n ></ia-book-visual-adjustments>\n "])),wr,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 mr(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 mr(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)?mr(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 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 Sr(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,Mr(r.key),r)}}function Mr(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 Br(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Br=function(){return!!e})()}function jr(e){return jr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},jr(e)}function Pr(e,t){return Pr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pr(e,t)}var Er,Lr,Ar=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=jr(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,Br()?Reflect.construct(t,n||[],jr(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&&Pr(e,t)}(t,e),function(e,t,n){return t&&Or(e.prototype,t),n&&Or(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(){var e=this;return(0,r.qy)(gr||(gr=Sr(['\n <div>\n <button class="delete" @click=',">Delete</button>\n <button @click=",">Cancel</button>\n </div>\n "])),function(){return e.deleteAction({detail:{id:"".concat(e.pageID)}})},function(){return e.cancelAction()})}}],[{key:"styles",get:function(){return(0,r.AH)(kr||(kr=Sr(['\n div {\n display: flex;\n justify-content: center;\n padding-top: 2rem;\n }\n\n button {\n appearance: none;\n padding: 0.5rem 1rem;\n margin: 0 .5rem;\n box-sizing: border-box;\n font: 1.3rem "Helvetica Neue", Helvetica, Arial, sans-serif;\n color: var(--primaryTextColor);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n background: var(--primaryCTAFill);\n }\n\n .delete {\n background: var(--primaryErrorCTAFill);\n }\n '])))}},{key:"properties",get:function(){return{cancelAction:{type:Function},deleteAction:{type:Function},pageID:{type:String}}}}])}(r.WF);function _r(e){return _r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_r(e)}function Tr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function zr(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"!=_r(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_r(t)?t:t+""}function $r(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return($r=function(){return!!e})()}function Hr(e){return Hr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Hr(e)}function qr(e,t){return qr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},qr(e,t)}customElements.define("delete-modal-actions",Ar);var Dr,Rr=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=Hr(t),function(e,t){if(t&&("object"==_r(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||[],Hr(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&&qr(e,t)}(t,e),function(e,t,n){return t&&zr(e.prototype,t),n&&zr(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)(Er||(Er=Tr(["\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)(Lr||(Lr=Tr(["\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 Fr(e){return Fr="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},Fr(e)}function Wr(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,Vr(r.key),r)}}function Vr(e){var t=function(e){if("object"!=Fr(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Fr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fr(t)?t:t+""}function Nr(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Nr=function(){return!!e})()}function Zr(e){return Zr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zr(e)}function Ur(e,t){return Ur=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ur(e,t)}customElements.define("bookmark-button",Rr),n(4423),n(739),n(8940),n(3362),n(1699);var Gr,Jr,Xr,Kr,Qr,Yr,eo,to,no,ro=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Zr(t),function(e,t){if(t&&("object"==Fr(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,Nr()?Reflect.construct(t,n||[],Zr(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&&Ur(e,t)}(t,e),function(e,t,n){return t&&Wr(e.prototype,t),n&&Wr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}(t,[{key:"render",value:function(){return(0,r.qy)(Dr||(Dr=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 qt}}])}(r.WF);function oo(e){return oo="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},oo(e)}function io(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ao(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 so(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ao(Object(n),!0).forEach(function(t){lo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ao(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lo(e,t,n){return(t=mo(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function co(){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 uo(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]())):(uo(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,uo(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,uo(d,"constructor",c),uo(c,"constructor",l),l.displayName="GeneratorFunction",uo(c,o,"GeneratorFunction"),uo(d),uo(d,o,"Generator"),uo(d,r,function(){return this}),uo(d,"toString",function(){return"[object Generator]"}),(co=function(){return{w:i,m:h}})()}function uo(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}uo=function(e,t,n,r){function i(t,n){uo(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))},uo(e,t,n,r)}function ho(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 po(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){ho(i,r,o,a,s,"next",e)}function s(e){ho(i,r,o,a,s,"throw",e)}a(void 0)})}}function fo(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,mo(r.key),r)}}function mo(e){var t=function(e){if("object"!=oo(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=oo(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==oo(t)?t:t+""}function vo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(vo=function(){return!!e})()}function bo(e){return bo=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},bo(e)}function yo(e,t){return yo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},yo(e,t)}customElements.define("bookmarks-login",ro);var go,ko={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})})}},wo=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=bo(t),function(e,t){if(t&&("object"==oo(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,vo()?Reflect.construct(t,n||[],bo(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=ko,e.deleteModalConfig=new Ne({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&&yo(e,t)}(t,e),function(e,t,n){return t&&fo(e.prototype,t),n&&fo(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=po(co().m(function e(){return co().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 so(so({},c),{},{id:r,leafNum:r,page:u,thumbnail:d})}},{key:"fetchBookmarks",value:(n=po(co().m(function e(){var t,n,r,o,i,a,s,l,c,u,d=this;return co().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(so(so({},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)(Gr||(Gr=io(["\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)(Jr||(Jr=io(["\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=so({},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)(Xr||(Xr=io(['\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)(Kr||(Kr=io(["\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,so({},this.bookmarks),this.activeBookmarkID,this.bookmarkColors,this.defaultColor)}},{key:"bookmarkHelperMessage",get:function(){return(0,r.qy)(Qr||(Qr=io(["<p>Please use 1up or 2up view modes to add bookmark.</p>"])))}},{key:"render",value:function(){var e=this,t=(0,r.qy)(Yr||(Yr=io(["\n ","\n ","\n "])),this.bookmarksList,this.allowAddingBookmark?this.addBookmarkButton:this.bookmarkHelperMessage);return(0,r.qy)(eo||(eo=io(['\n <section class="bookmarks">\n ',"\n </section>\n "])),"login"===this.displayMode?(0,r.qy)(to||(to=io(["<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)(no||(no=io(["\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[qt,e]}},{key:"formatPage",value:function(e){return isNaN(+e)?"(".concat(e.replace(/\D/g,""),")"):e}}]);var n,o}(r.WF);customElements.define("ia-bookmarks",wo);var Co,xo,So,Oo,Mo,Bo=(0,r.AH)(go||(go=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 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 Po(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}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,Lo(r.key),r)}}function Lo(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+""}function Ao(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Ao=function(){return!!e})()}function _o(e){return _o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_o(e)}function To(e,t){return To=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},To(e,t)}var zo=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=_o(t),function(e,t){if(t&&("object"==jo(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,Ao()?Reflect.construct(t,n||[],_o(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&&To(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:"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)(Co||(Co=Po(['\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)(xo||(xo=Po(['\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)(So||(So=Po(["\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,He(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)(Oo||(Oo=Po(["<header>\n <h3>Edit Bookmark</h3>\n </header>"])))}},{key:"styles",get:function(){var e=(0,r.AH)(Mo||(Mo=Po(['\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[qt,Bo,e]}}])}(r.WF);customElements.define("ia-bookmark-edit",zo),n(6910);var Io,$o,Ho,qo,Do,Ro,Fo,Wo,Vo=r.qy`
|
|
1820
1817
|
<svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg">
|
|
1821
1818
|
<path
|
|
1822
1819
|
class="fill-color"
|
|
1823
1820
|
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"
|
|
1824
1821
|
fill-rule="evenodd" />
|
|
1825
1822
|
</svg>
|
|
1826
|
-
`;class
|
|
1823
|
+
`;class No extends r.WF{static get styles(){return r.AH`
|
|
1827
1824
|
:host {
|
|
1828
1825
|
width: var(--iconWidth, 'auto');
|
|
1829
1826
|
height: var(--iconHeight, 'auto');
|
|
@@ -1836,7 +1833,7 @@
|
|
|
1836
1833
|
.stroke-color {
|
|
1837
1834
|
stroke: var(--iconStrokeColor);
|
|
1838
1835
|
}
|
|
1839
|
-
`}render(){return
|
|
1836
|
+
`}render(){return Vo}}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 Uo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Go(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Jo(r.key),r)}}function Jo(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+""}function Xo(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Xo=function(){return!!e})()}function Ko(e){return Ko=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Ko(e)}function Qo(e,t){return Qo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Qo(e,t)}customElements.define("ia-icon-edit-pencil",No);var Yo,ei=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"==Zo(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||[],Ko(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&&Qo(e,t)}(t,e),function(e,t,n){return t&&Go(e.prototype,t),n&&Go(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)(Io||(Io=Uo(["\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)($o||($o=Uo(["<p>","</p>"])),e.note):r.s6,n?this.editBookmarkComponent:r.s6)}},{key:"editBookmarkComponent",get:function(){return(0,r.qy)(Ho||(Ho=Uo(["\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)(qo||(qo=Uo(["<small>(",")</small>"])),e)}},{key:"headerSection",get:function(){return(0,r.qy)(Do||(Do=Uo(["<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=He(e,function(e){return null==e?void 0:e.id},this.bookmarkItem.bind(this));return(0,r.qy)(Ro||(Ro=Uo(["\n <ul>\n ",'\n <div class="separator"></div>\n </ul>\n '])),t)}},{key:"render",value:function(){return(0,r.qy)(Fo||(Fo=Uo(["\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)(Wo||(Wo=Uo(["\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 "]))),Bo]}}])}(r.WF);customElements.define("ia-bookmarks-list",ei);class ti extends r.WF{static get styles(){return r.AH`
|
|
1840
1837
|
:host {
|
|
1841
1838
|
width: var(--iconWidth, 'auto');
|
|
1842
1839
|
height: var(--iconHeight, 'auto');
|
|
@@ -1903,5 +1900,5 @@
|
|
|
1903
1900
|
</g>
|
|
1904
1901
|
</svg>
|
|
1905
1902
|
</div>
|
|
1906
|
-
`}}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 ii(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,ai(r.key),r)}}function ai(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+""}window.customElements.define("icon-bookmark",ri);var si,li,ci=function(){return function(e,t){return t&&ii(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)(ti||(ti=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 ui(e){return ui="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},ui(e)}function di(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function hi(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 pi(e,t,n){return t&&hi(e.prototype,t),n&&hi(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function fi(e){var t=function(e){if("object"!=ui(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ui(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ui(t)?t:t+""}var mi,vi=pi(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)(si||(si=di(["",""])),Ce),this.label="Share this book",this.id="share",this.component=(0,r.qy)(li||(li=di(["<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 bi(e){return bi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bi(e)}function yi(){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 gi(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]())):(gi(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,gi(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,gi(d,"constructor",c),gi(c,"constructor",l),l.displayName="GeneratorFunction",gi(c,o,"GeneratorFunction"),gi(d),gi(d,o,"Generator"),gi(d,r,function(){return this}),gi(d,"toString",function(){return"[object Generator]"}),(yi=function(){return{w:i,m:h}})()}function gi(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}gi=function(e,t,n,r){function i(t,n){gi(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))},gi(e,t,n,r)}function ki(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 wi(e){return function(e){if(Array.isArray(e))return Ci(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 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)||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 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 xi(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,Si(r.key),r)}}function Si(e){var t=function(e){if("object"!=bi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=bi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==bi(t)?t:t+""}var Oi,Mi,Bi,ji,Pi,Ei,Li,Ai="default",_i=function(){return function(e,t){return t&&xi(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)(mi||(mi=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["",""])),Ve),this.sortOrderBy=Ai,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=wi(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=yi().m(function e(t){var n,r,o;return yi().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=wi(this.viewableFiles),e.n=1,this.component.updateComplete;case 1:this.bookreader.urlPlugin&&(this.bookreader.urlPlugin.pullFromAddressBar(),this.sortOrderBy!==Ai?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){ki(i,r,o,a,s,"next",e)}function s(e){ki(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}(),Ti=n(8004);function zi(e){return zi="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},zi(e)}function Ii(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 $i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?$i(e,t):void 0}}(e,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 $i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Hi(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 Di(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Hi(Object(n),!0).forEach(function(t){qi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hi(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qi(e,t,n){return(t=Wi(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ri(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}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,Wi(r.key),r)}}function Wi(e){var t=function(e){if("object"!=zi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=zi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==zi(t)?t:t+""}function Vi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Vi=function(){return!!e})()}function Ni(){return Ni="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Zi(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}},Ni.apply(null,arguments)}function Zi(e){return Zi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Zi(e)}function Ui(e,t){return Ui=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ui(e,t)}var Gi=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=Zi(t),function(e,t){if(t&&("object"==zi(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,Vi()?Reflect.construct(t,n||[],Zi(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)(Oi||(Oi=Ri(['<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&&Ui(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:"itemNav",get:function(){return this.shadowRoot.querySelector("iaux-item-navigator")}},{key:"disconnectedCallback",value:function(){!function(e,t,n){var r=Ni(Zi(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 ct),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 Sr(Di(Di({},this.baseProviderConfig),{},{onProviderChange:function(){t.updateMenuContents()}}))};this.baseProviderConfig.item&&(n.share=new vi(this.baseProviderConfig)),this.shouldShowDownloadsMenu()&&(n.downloads=new Fn(this.baseProviderConfig)),null!==(e=this.bookreader.options.plugins)&&void 0!==e&&null!==(e=e.search)&&void 0!==e&&e.enabled&&(n.search=new Cn(Di(Di({},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 ci(Di(Di({},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 _i(Di(Di({},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)(Mi||(Mi=Ri(["\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,Ti.sortBy)(Object.entries(this.menuProviders).filter(function(e){var t=Ii(e,2);return t[0],!!t[1]}).filter(function(e){var n=Ii(e,2),r=n[0];return n[1],"downloads"!==r||t.shouldShowDownloadsMenu()}),function(e){var n=Ii(e,2),r=n[0],o=(n[1],t.shortcutOrder.indexOf(r));return-1===o?t.shortcutOrder.length:o}).map(function(e){var t=Ii(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,Ti.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=Ri(['<img class="cover-img" src=',' alt="cover image for ','">'])),n,t)}},{key:"placeholder",get:function(){return(0,r.qy)(ji||(ji=Ri(['<div class="placeholder">',"</div>"])),this.itemImage)}},{key:"render",value:function(){return(0,r.qy)(Pi||(Pi=Ri(["\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)(Ei||(Ei=Ri(['<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)(Li||(Li=Ri(['\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",Gi)}},function(e){e(e.s=5758)}]);
|
|
1903
|
+
`}}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(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 oi(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+""}window.customElements.define("icon-bookmark",ti);var ii,ai,si=function(){return function(e,t){return t&&ri(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)(Yo||(Yo=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 li(e){return li="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},li(e)}function ci(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ui(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hi(r.key),r)}}function di(e,t,n){return t&&ui(e.prototype,t),n&&ui(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function hi(e){var t=function(e){if("object"!=li(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=li(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==li(t)?t:t+""}var pi,fi=di(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)(ii||(ii=ci(["",""])),ke),this.label="Share this book",this.id="share",this.component=(0,r.qy)(ai||(ai=ci(["<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 mi(e){return mi="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},mi(e)}function vi(){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 bi(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]())):(bi(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,bi(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,bi(d,"constructor",c),bi(c,"constructor",l),l.displayName="GeneratorFunction",bi(c,o,"GeneratorFunction"),bi(d),bi(d,o,"Generator"),bi(d,r,function(){return this}),bi(d,"toString",function(){return"[object Generator]"}),(vi=function(){return{w:i,m:h}})()}function bi(e,t,n,r){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}bi=function(e,t,n,r){function i(t,n){bi(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))},bi(e,t,n,r)}function yi(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 gi(e){return function(e){if(Array.isArray(e))return ki(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 ki(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)?ki(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 ki(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 wi(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"!=mi(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=mi(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==mi(t)?t:t+""}var xi,Si,Oi,Mi,Bi,ji,Pi,Ei="default",Li=function(){return function(e,t){return t&&wi(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)(pi||(pi=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["",""])),Fe),this.sortOrderBy=Ei,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=gi(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=vi().m(function e(t){var n,r,o;return vi().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=gi(this.viewableFiles),e.n=1,this.component.updateComplete;case 1:this.bookreader.urlPlugin&&(this.bookreader.urlPlugin.pullFromAddressBar(),this.sortOrderBy!==Ei?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){yi(i,r,o,a,s,"next",e)}function s(e){yi(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}(),Ai=n(8004);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 Ti(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 zi(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)?zi(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 zi(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 Ii(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 $i(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ii(Object(n),!0).forEach(function(t){Hi(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ii(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Hi(e,t,n){return(t=Ri(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Di(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,Ri(r.key),r)}}function Ri(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 Fi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Fi=function(){return!!e})()}function Wi(){return Wi="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=Vi(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}},Wi.apply(null,arguments)}function Vi(e){return Vi=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Vi(e)}function Ni(e,t){return Ni=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Ni(e,t)}var Zi=function(e){function t(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(e=function(e,t,n){return t=Vi(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,Fi()?Reflect.construct(t,n||[],Vi(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)(xi||(xi=qi(['<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&&Ni(e,t)}(t,e),function(e,t,n){return t&&Di(e.prototype,t),n&&Di(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=Wi(Vi(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 st),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 Cr($i($i({},this.baseProviderConfig),{},{onProviderChange:function(){t.updateMenuContents()}}))};this.baseProviderConfig.item&&(n.share=new fi(this.baseProviderConfig)),this.shouldShowDownloadsMenu()&&(n.downloads=new Dn(this.baseProviderConfig)),null!==(e=this.bookreader.options.plugins)&&void 0!==e&&null!==(e=e.search)&&void 0!==e&&e.enabled&&(n.search=new kn($i($i({},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 si($i($i({},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 Li($i($i({},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)(Si||(Si=qi(["\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,Ai.sortBy)(Object.entries(this.menuProviders).filter(function(e){var t=Ti(e,2);return t[0],!!t[1]}).filter(function(e){var n=Ti(e,2),r=n[0];return n[1],"downloads"!==r||t.shouldShowDownloadsMenu()}),function(e){var n=Ti(e,2),r=n[0],o=(n[1],t.shortcutOrder.indexOf(r));return-1===o?t.shortcutOrder.length:o}).map(function(e){var t=Ti(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,Ai.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)(Oi||(Oi=qi(['<img class="cover-img" src=',' alt="cover image for ','">'])),n,t)}},{key:"placeholder",get:function(){return(0,r.qy)(Mi||(Mi=qi(['<div class="placeholder">',"</div>"])),this.itemImage)}},{key:"render",value:function(){return(0,r.qy)(Bi||(Bi=qi(["\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)(ji||(ji=qi(['<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)(Pi||(Pi=qi(['\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",Zi)}},function(e){e(e.s=2250)}]);
|
|
1907
1904
|
//# sourceMappingURL=ia-bookreader-bundle.js.map
|