@internetarchive/bookreader 5.0.0-4 → 5.0.0-40-a1
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/.eslintrc.js +17 -15
- package/.github/workflows/node.js.yml +75 -4
- package/.github/workflows/npm-publish.yml +2 -16
- package/.testcaferc.js +10 -0
- package/BookReader/BookReader.css +83 -323
- package/BookReader/BookReader.js +1 -1
- package/BookReader/BookReader.js.LICENSE.txt +24 -0
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/ia-bookreader-bundle.js +1623 -0
- package/BookReader/{bookreader-component-bundle.js.LICENSE.txt → ia-bookreader-bundle.js.LICENSE.txt} +14 -10
- package/BookReader/ia-bookreader-bundle.js.map +1 -0
- package/BookReader/icons/close-circle-dark.svg +1 -0
- package/BookReader/icons/magnify-minus.svg +1 -1
- package/BookReader/icons/magnify-plus.svg +1 -1
- package/BookReader/icons/voice.svg +1 -0
- package/BookReader/plugins/plugin.archive_analytics.js +1 -1
- package/BookReader/plugins/plugin.archive_analytics.js.map +1 -1
- package/BookReader/plugins/plugin.autoplay.js +1 -1
- package/BookReader/plugins/plugin.autoplay.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.iframe.js +1 -1
- package/BookReader/plugins/plugin.iframe.js.map +1 -1
- package/BookReader/plugins/plugin.mobile_nav.js +1 -1
- package/BookReader/plugins/plugin.mobile_nav.js.map +1 -1
- package/BookReader/plugins/plugin.resume.js +1 -1
- package/BookReader/plugins/plugin.resume.js.map +1 -1
- package/BookReader/plugins/plugin.search.js +1 -1
- package/BookReader/plugins/plugin.search.js.map +1 -1
- package/BookReader/plugins/plugin.text_selection.js +1 -1
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.tts.js +1 -1
- package/BookReader/plugins/plugin.tts.js.map +1 -1
- package/BookReader/plugins/plugin.url.js +1 -1
- package/BookReader/plugins/plugin.url.js.map +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js +1 -1
- package/BookReader/plugins/plugin.vendor-fullscreen.js.map +1 -1
- package/BookReader/webcomponents-bundle.js +3 -0
- package/BookReader/webcomponents-bundle.js.LICENSE.txt +9 -0
- package/BookReader/webcomponents-bundle.js.map +1 -0
- package/BookReaderDemo/BookReaderDemo.css +14 -1
- package/BookReaderDemo/IADemoBr.js +120 -0
- package/BookReaderDemo/demo-advanced.html +1 -1
- package/BookReaderDemo/demo-autoplay.html +1 -0
- package/BookReaderDemo/demo-embed-iframe-src.html +1 -0
- package/BookReaderDemo/demo-fullscreen-mobile.html +1 -0
- package/BookReaderDemo/demo-fullscreen.html +1 -0
- package/BookReaderDemo/demo-iiif.html +1 -0
- package/BookReaderDemo/demo-internetarchive.html +74 -17
- package/BookReaderDemo/demo-multiple.html +1 -0
- package/BookReaderDemo/demo-preview-pages.html +1 -0
- package/BookReaderDemo/demo-simple.html +1 -0
- package/BookReaderDemo/demo-vendor-fullscreen.html +1 -0
- package/BookReaderDemo/ia-multiple-volumes-manifest.js +170 -0
- package/BookReaderDemo/immersion-1up.html +1 -0
- package/BookReaderDemo/immersion-mode.html +1 -0
- package/BookReaderDemo/toggle_controls.html +1 -0
- package/BookReaderDemo/view_mode.html +1 -0
- package/BookReaderDemo/viewmode-cycle.html +1 -2
- package/CHANGELOG.md +166 -0
- package/README.md +14 -1
- package/babel.config.js +18 -0
- package/codecov.yml +6 -0
- package/index.html +3 -0
- package/jsconfig.json +19 -0
- package/package.json +62 -47
- package/renovate.json +43 -0
- package/src/BookNavigator/assets/bookmark-colors.js +1 -1
- package/src/BookNavigator/assets/button-base.js +9 -2
- package/src/BookNavigator/assets/ia-logo.js +17 -0
- package/src/BookNavigator/assets/icon_checkmark.js +1 -1
- package/src/BookNavigator/assets/icon_close.js +1 -1
- package/src/BookNavigator/assets/icon_sort_asc.js +5 -0
- package/src/BookNavigator/assets/icon_sort_desc.js +5 -0
- package/src/BookNavigator/assets/icon_sort_neutral.js +5 -0
- package/src/BookNavigator/assets/icon_volumes.js +11 -0
- package/src/BookNavigator/book-navigator.js +556 -0
- package/src/BookNavigator/bookmarks/bookmark-button.js +3 -2
- package/src/BookNavigator/bookmarks/bookmark-edit.js +4 -4
- package/src/BookNavigator/bookmarks/bookmarks-list.js +3 -3
- package/src/BookNavigator/bookmarks/bookmarks-loginCTA.js +3 -8
- package/src/BookNavigator/bookmarks/bookmarks-provider.js +23 -12
- package/src/BookNavigator/bookmarks/ia-bookmarks.js +98 -62
- package/src/BookNavigator/delete-modal-actions.js +1 -1
- package/src/BookNavigator/downloads/downloads-provider.js +23 -17
- package/src/BookNavigator/downloads/downloads.js +17 -25
- package/src/BookNavigator/search/a-search-result.js +3 -3
- package/src/BookNavigator/search/search-provider.js +57 -24
- package/src/BookNavigator/search/search-results.js +8 -20
- package/src/BookNavigator/sharing.js +27 -0
- package/src/BookNavigator/visual-adjustments/visual-adjustments-provider.js +11 -13
- package/src/BookNavigator/visual-adjustments/visual-adjustments.js +4 -3
- package/src/BookNavigator/volumes/volumes-provider.js +114 -0
- package/src/BookNavigator/volumes/volumes.js +188 -0
- package/src/BookReader/DebugConsole.js +3 -3
- package/src/BookReader/DragScrollable.js +233 -0
- package/src/BookReader/Mode1Up.js +51 -351
- package/src/BookReader/Mode1UpLit.js +441 -0
- package/src/BookReader/Mode2Up.js +104 -71
- package/src/BookReader/ModeSmoothZoom.js +179 -0
- package/src/BookReader/ModeThumb.js +16 -8
- package/src/BookReader/Navbar/Navbar.js +2 -31
- package/src/BookReader/PageContainer.js +57 -6
- package/src/BookReader/ReduceSet.js +1 -1
- package/src/BookReader/Toolbar/Toolbar.js +7 -7
- package/src/BookReader/options.js +10 -0
- package/src/BookReader/utils/HTMLDimensionsCacher.js +44 -0
- package/src/BookReader/utils/ScrollClassAdder.js +31 -0
- package/src/BookReader/utils.js +68 -13
- package/src/BookReader.js +375 -289
- package/src/assets/icons/close-circle-dark.svg +1 -0
- package/src/assets/icons/magnify-minus.svg +3 -7
- package/src/assets/icons/magnify-plus.svg +3 -7
- package/src/assets/icons/voice.svg +1 -0
- package/src/css/BookReader.scss +0 -12
- package/src/css/_BRComponent.scss +1 -1
- package/src/css/_BRmain.scss +19 -24
- package/src/css/_BRnav.scss +4 -26
- package/src/css/_BRpages.scss +35 -0
- package/src/css/_BRsearch.scss +11 -215
- package/src/css/_TextSelection.scss +14 -17
- package/src/css/_colorbox.scss +2 -2
- package/src/css/_controls.scss +16 -3
- package/src/css/_icons.scss +6 -0
- package/src/ia-bookreader/ia-bookreader.js +224 -0
- package/src/plugins/plugin.chapters.js +26 -33
- package/src/plugins/plugin.mobile_nav.js +11 -10
- package/src/plugins/plugin.resume.js +3 -3
- package/src/plugins/plugin.text_selection.js +26 -39
- package/src/plugins/plugin.vendor-fullscreen.js +4 -4
- package/src/plugins/search/plugin.search.js +106 -107
- package/src/plugins/search/view.js +50 -163
- package/src/plugins/tts/AbstractTTSEngine.js +46 -37
- package/src/plugins/tts/FestivalTTSEngine.js +12 -13
- package/src/plugins/tts/PageChunk.js +15 -21
- package/src/plugins/tts/PageChunkIterator.js +8 -12
- package/src/plugins/tts/WebTTSEngine.js +64 -68
- package/src/plugins/tts/plugin.tts.js +79 -108
- package/src/plugins/url/UrlPlugin.js +184 -0
- package/src/plugins/{plugin.url.js → url/plugin.url.js} +28 -6
- package/tests/e2e/README.md +37 -0
- package/tests/e2e/autoplay.test.js +2 -2
- package/tests/e2e/base.test.js +7 -7
- package/tests/e2e/helpers/base.js +8 -3
- package/tests/e2e/helpers/debug.js +1 -1
- package/tests/e2e/helpers/desktopSearch.js +14 -13
- package/tests/e2e/helpers/mobileSearch.js +3 -3
- package/tests/e2e/helpers/params.js +17 -0
- package/tests/e2e/models/Navigation.js +12 -3
- package/tests/e2e/rightToLeft.test.js +4 -5
- package/tests/e2e/viewmode.test.js +38 -33
- package/tests/{BookReader → jest/BookReader}/BookModel.test.js +3 -3
- package/tests/jest/BookReader/BookReaderPublicFunctions.test.js +176 -0
- package/tests/{BookReader → jest/BookReader}/DebugConsole.test.js +1 -1
- package/tests/{BookReader → jest/BookReader}/ImageCache.test.js +4 -4
- package/tests/jest/BookReader/Mode1UpLit.test.js +88 -0
- package/tests/{BookReader → jest/BookReader}/Mode2Up.test.js +5 -7
- package/tests/jest/BookReader/ModeSmoothZoom.test.js +149 -0
- package/tests/jest/BookReader/ModeThumb.test.js +71 -0
- package/tests/{BookReader → jest/BookReader}/Navbar/Navbar.test.js +7 -7
- package/tests/{BookReader → jest/BookReader}/PageContainer.test.js +79 -6
- package/tests/{BookReader → jest/BookReader}/ReduceSet.test.js +1 -1
- package/tests/{BookReader → jest/BookReader}/Toolbar/Toolbar.test.js +2 -2
- package/tests/jest/BookReader/utils/HTMLDimensionsCacher.test.js +59 -0
- package/tests/jest/BookReader/utils/ScrollClassAdder.test.js +49 -0
- package/tests/{BookReader → jest/BookReader}/utils/classes.test.js +1 -1
- package/tests/jest/BookReader/utils.test.js +136 -0
- package/tests/jest/BookReader.keyboard.test.js +190 -0
- package/tests/{BookReader.options.test.js → jest/BookReader.options.test.js} +9 -1
- package/tests/{BookReader.test.js → jest/BookReader.test.js} +20 -4
- package/tests/{plugins → jest/plugins}/plugin.archive_analytics.test.js +2 -2
- package/tests/{plugins → jest/plugins}/plugin.autoplay.test.js +2 -2
- package/tests/{plugins → jest/plugins}/plugin.chapters.test.js +8 -8
- package/tests/{plugins → jest/plugins}/plugin.iframe.test.js +2 -2
- package/tests/{plugins → jest/plugins}/plugin.mobile_nav.test.js +5 -5
- package/tests/{plugins → jest/plugins}/plugin.resume.test.js +3 -3
- package/tests/{plugins → jest/plugins}/plugin.text_selection.test.js +39 -47
- package/tests/{plugins → jest/plugins}/plugin.vendor-fullscreen.test.js +2 -2
- package/tests/{plugins → jest/plugins}/search/plugin.search.test.js +24 -25
- package/tests/{plugins → jest/plugins}/search/plugin.search.view.test.js +6 -6
- package/tests/{plugins → jest/plugins}/tts/AbstractTTSEngine.test.js +6 -6
- package/tests/{plugins → jest/plugins}/tts/FestivalTTSEngine.test.js +4 -4
- package/tests/{plugins → jest/plugins}/tts/PageChunk.test.js +1 -1
- package/tests/{plugins → jest/plugins}/tts/PageChunkIterator.test.js +3 -3
- package/tests/{plugins → jest/plugins}/tts/WebTTSEngine.test.js +1 -1
- package/tests/{plugins → jest/plugins}/tts/utils.test.js +3 -3
- package/tests/jest/plugins/url/UrlPlugin.test.js +190 -0
- package/tests/{plugins → jest/plugins/url}/plugin.url.test.js +33 -14
- package/tests/{util → jest/util}/browserSniffing.test.js +1 -1
- package/tests/{util → jest/util}/docCookies.test.js +1 -1
- package/tests/{util → jest/util}/strings.test.js +1 -1
- package/tests/{utils.js → jest/utils.js} +38 -0
- package/tests/karma/BookNavigator/book-navigator.test.js +501 -0
- package/tests/karma/BookNavigator/bookmarks/bookmark-button.test.js +44 -0
- package/tests/karma/BookNavigator/bookmarks/bookmark-edit.test.js +1 -3
- package/tests/karma/BookNavigator/bookmarks/bookmarks-list.test.js +3 -4
- package/tests/karma/BookNavigator/bookmarks/ia-bookmarks.test.js +57 -0
- package/tests/karma/BookNavigator/downloads/downloads-provider.test.js +67 -0
- package/tests/karma/BookNavigator/downloads/downloads.test.js +54 -0
- package/tests/karma/BookNavigator/search/search-provider.test.js +123 -0
- package/tests/karma/BookNavigator/{search-results.test.js → search/search-results.test.js} +1 -4
- package/tests/karma/BookNavigator/sharing/sharing-provider.test.js +49 -0
- package/tests/karma/BookNavigator/visual-adjustments.test.js +0 -2
- package/tests/karma/BookNavigator/volumes/volumes-provider.test.js +184 -0
- package/tests/karma/BookNavigator/volumes/volumes.test.js +98 -0
- package/webpack.config.js +10 -4
- package/.babelrc +0 -12
- package/.dependabot/config.yml +0 -6
- package/.testcaferc.json +0 -5
- package/BookReader/bookreader-component-bundle.js +0 -1450
- package/BookReader/bookreader-component-bundle.js.map +0 -1
- package/BookReader/plugins/plugin.menu_toggle.js +0 -2
- package/BookReader/plugins/plugin.menu_toggle.js.map +0 -1
- package/BookReaderDemo/bookreader-template-bundle.js +0 -7178
- package/BookReaderDemo/demo-plugin-menu-toggle.html +0 -34
- package/src/BookNavigator/BookModel.js +0 -14
- package/src/BookNavigator/BookNavigator.js +0 -435
- package/src/BookNavigator/assets/book-loader.js +0 -27
- package/src/BookNavigator/br-fullscreen-mgr.js +0 -83
- package/src/BookReaderComponent/BookReaderComponent.js +0 -112
- package/src/ItemNavigator/ItemNavigator.js +0 -372
- package/src/ItemNavigator/providers/sharing.js +0 -29
- package/src/dragscrollable-br.js +0 -261
- package/src/plugins/menu_toggle/plugin.menu_toggle.js +0 -324
- package/tests/BookReader/BookReaderPublicFunctions.test.js +0 -171
- package/tests/BookReader/Mode1Up.test.js +0 -164
- package/tests/BookReader/utils.test.js +0 -109
- package/tests/plugins/menu_toggle/plugin.menu_toggle.test.js +0 -68
@@ -0,0 +1,1623 @@
|
|
1
|
+
/*! For license information please see ia-bookreader-bundle.js.LICENSE.txt */
|
2
|
+
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[64],{7672:function(e,t,n){"use strict";n(1539),n(2419),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948),n(1038),n(7042),n(8309),n(4916),n(3371),n(489);var r=n(871);function o(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var i,a,s=n(9089);class l{parseValue(e){return("string"!=typeof e||"false"!==e&&"0"!==e)&&Boolean(e)}}l.shared=new l;class c{parseValue(e){if("number"==typeof e)return e;if("boolean"==typeof e)return;const t=parseFloat(e);return Number.isNaN(t)?void 0:t}}c.shared=new c;class u{parseValue(e){return c.shared.parseValue(e)}}u.shared=new u;class d{parseValue(e){return this.parseJSDate(e)||this.parseBracketDate(e)}parseBracketDate(e){if("string"!=typeof e)return;const t=e.match(/\[([0-9]{4})\]/);return!t||t.length<2?void 0:this.parseJSDate(t[1])}parseJSDate(e){if("string"!=typeof e)return;let t=e;t.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}\s{1}[0-9]{2}:[0-9]{2}:[0-9]{2}$/)&&(t=t.replace(" ","T"));const n=Date.parse(t);if(Number.isNaN(n))return;let r=new Date(t);return(t.indexOf("Z")>-1||t.indexOf("+")>-1||t.match(/^[0-9]{4}$/)||t.match(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/)||t.match(/^.*?-[0-9]{2}:[0-9]{2}$/)||t.match(/^.*?-[0-9]{4}$/))&&(r=new Date(r.getTime()+1e3*r.getTimezoneOffset()*60)),r}}d.shared=new d;class h{parseValue(e){if("number"==typeof e)return e;if("boolean"==typeof e)return;const t=e.split(":");let n;return n=1===t.length?this.parseNumberFormat(t[0]):this.parseColonSeparatedFormat(t),n}parseNumberFormat(e){let t=parseFloat(e);return Number.isNaN(t)&&(t=void 0),t}parseColonSeparatedFormat(e){let t=!1;const n=e.map(((n,r)=>{const o=parseFloat(n);if(Number.isNaN(o))return t=!0,0;const i=60**(e.length-1-r);return o*Math.floor(i)})).reduce(((e,t)=>e+t),0);return t?void 0:n}}h.shared=new h;class f{parseValue(e){if("string"==typeof e)return e}}f.shared=new f;class p{parseValue(e){if("string"==typeof e)return e}}p.shared=new p;class m{parseValue(e){return String(e)}}m.shared=new m;class v{constructor(e,t){this.values=[],this.parser=e,this.rawValue=t,this.processRawValue()}get value(){return this.values.length>0?this.values[0]:void 0}processRawValue(){void 0!==this.rawValue&&(Array.isArray(this.rawValue)?this.rawValue.forEach((e=>{this.parseAndPersistValue(e)})):this.parseAndPersistValue(this.rawValue))}parseAndPersistValue(e){const t=this.parser.parseValue(e);void 0!==t&&this.values.push(t)}}class y extends v{constructor(e){super(l.shared,e)}}class b extends v{constructor(e){super(d.shared,e)}}class g extends v{constructor(e){super(h.shared,e)}}class k extends v{constructor(e){super(c.shared,e)}}class w extends v{constructor(e){super(m.shared,e)}}class S extends v{constructor(e){super(u.shared,e)}}class C extends v{constructor(e){super(f.shared,e)}}class O{constructor(e){this.rawMetadata=e,this.identifier=e.identifier,this.addeddate=e.addeddate?new b(e.addeddate):void 0,this.publicdate=e.publicdate?new b(e.publicdate):void 0,this.indexdate=e.indexdate?new b(e.indexdate):void 0,this.audio_codec=e.audio_codec?new w(e.audio_codec):void 0,this.audio_sample_rate=e.audio_sample_rate?new k(e.audio_sample_rate):void 0,this.collection=e.collection?new w(e.collection):void 0,this.collections_raw=e.collections_raw?new w(e.collections_raw):void 0,this.collection_size=e.collection_size?new S(e.collection_size):void 0,this.contributor=e.contributor?new w(e.contributor):void 0,this.coverage=e.coverage?new w(e.coverage):void 0,this.creator=e.creator?new w(e.creator):void 0,this.date=e.date?new b(e.date):void 0,this.description=e.description?new w(e.description):void 0,this.downloads=e.downloads?new k(e.downloads):void 0,this.duration=e.duration?new g(e.duration):void 0,this.files_count=e.files_count?new k(e.files_count):void 0,this.item_count=e.item_count?new k(e.item_count):void 0,this.item_size=e.item_size?new S(e.item_size):void 0,this.language=e.language?new w(e.language):void 0,this.length=e.length?new g(e.length):void 0,this.lineage=e.lineage?new w(e.lineage):void 0,this.mediatype=e.mediatype?new C(e.mediatype):void 0,this.month=e.month?new k(e.month):void 0,this.noindex=e.noindex?new y(e.noindex):void 0,this.notes=e.notes?new w(e.notes):void 0,this.num_favorites=e.num_favorites?new k(e.num_favorites):void 0,this.num_reviews=e.num_reviews?new k(e.num_reviews):void 0,this.runtime=e.runtime?new g(e.runtime):void 0,this.scanner=e.scanner?new w(e.scanner):void 0,this.source=e.source?new w(e.source):void 0,this.start_localtime=e.start_localtime?new b(e.start_localtime):void 0,this.start_time=e.start_time?new b(e.start_time):void 0,this.stop_time=e.stop_time?new b(e.stop_time):void 0,this.subject=e.subject?new w(e.subject):void 0,this.taper=e.taper?new w(e.taper):void 0,this.title=e.title?new w(e.title):void 0,this.track=e.track?new k(e.track):void 0,this.transferer=e.transferer?new w(e.transferer):void 0,this.type=e.type?new w(e.type):void 0,this.uploader=e.uploader?new w(e.uploader):void 0,this.utc_offset=e.utc_offset?new k(e.utc_offset):void 0,this.venue=e.venue?new w(e.venue):void 0,this.week=e.week?new k(e.week):void 0,this.year=e.year?new b(e.year):void 0}}class x{constructor(e){this.name=e.name,this.source=e.source,this.btih=e.btih,this.md5=e.md5,this.format=e.format,this.mtime=e.mtime,this.crc32=e.crc32,this.sha1=e.sha1,this.original=e.original,this.title=e.title,this.length=e.length?h.shared.parseValue(e.length):void 0,this.size=e.size?u.shared.parseValue(e.size):void 0,this.height=e.height?c.shared.parseValue(e.height):void 0,this.width=e.width?c.shared.parseValue(e.width):void 0,this.track=e.track?c.shared.parseValue(e.track):void 0,this.external_identifier=e["external-identifier"],this.creator=e.creator,this.album=e.album}}class _{constructor(e){this.reviewbody=e.reviewbody,this.reviewtitle=e.reviewtitle,this.reviewer=e.reviewer,this.reviewdate=d.shared.parseValue(e.reviewdate),this.createdate=d.shared.parseValue(e.createdate),this.stars=e.stars?parseFloat(e.stars):void 0}}class j{constructor(e){var t,n;this.rawResponse=e,this.created=e.created,this.d1=e.d1,this.d2=e.d2,this.dir=e.dir,this.files=null===(t=e.files)||void 0===t?void 0:t.map((e=>new x(e))),this.files_count=e.files_count,this.item_last_updated=e.item_last_updated,this.item_size=e.item_size,this.metadata=new O(e.metadata),this.server=e.server,this.uniq=e.uniq,this.workable_servers=e.workable_servers,this.speech_vs_music_asr=e.speech_vs_music_asr,this.reviews=null===(n=e.reviews)||void 0===n?void 0:n.map((e=>new _(e)))}}class P{constructor(e){this.numFound=e.numFound,this.start=e.start,this.docs=e.docs.map((e=>new O(e))),this.aggregations=e.aggregations}}class B{constructor(e){this.rawResponse=e,this.responseHeader=e.responseHeader,this.response=new P(e.response)}}!function(e){e.networkError="SearchService.NetworkError",e.itemNotFound="SearchService.ItemNotFound",e.decodingError="SearchService.DecodingError",e.searchEngineError="SearchService.SearchEngineError"}(i||(i={}));class E extends Error{constructor(e,t,n){super(t),this.name=e,this.type=e,this.details=n}}class I{constructor(e){this.searchBackend=e}async search(e){const t=await this.searchBackend.performSearch(e);return t.error?t:{success:new B(t.success)}}async fetchMetadata(e){var t;const n=await this.searchBackend.fetchMetadata(e);return n.error?n:void 0===(null===(t=n.success)||void 0===t?void 0:t.metadata)?{error:new E(i.itemNotFound)}:{success:new j(n.success)}}}I.default=new I(new class{constructor(e="archive.org"){this.baseUrl=e}async performSearch(e){const t=e.asUrlSearchParams.toString(),n=`https://${this.baseUrl}/advancedsearch.php?${t}`;return this.fetchUrl(n)}async fetchMetadata(e){const t=`https://${this.baseUrl}/metadata/${e}`;return this.fetchUrl(t)}async fetchUrl(e){let t;try{t=await fetch(e)}catch(e){const t=e instanceof Error?e.message:e;return this.getErrorResult(i.networkError,t)}try{const e=await t.json(),n=e.error;if(n){const t=e.forensics;return this.getErrorResult(i.searchEngineError,n,t)}return{success:e}}catch(e){const t=e instanceof Error?e.message:e;return this.getErrorResult(i.decodingError,t)}}getErrorResult(e,t,n){return{error:new E(e,t,n)}}}),function(e){e.Asc="asc",e.Desc="desc"}(a||(a={}));var L=n(2385);const M=r.iv`42px`,A=r.iv`var(--menuWidth, 320px)`,T=r.iv`var(--animationTiming, 200ms)`;var z=r.iv`
|
3
|
+
|
4
|
+
.main {
|
5
|
+
overflow: hidden;
|
6
|
+
width: 100%;
|
7
|
+
height: 100%;
|
8
|
+
}
|
9
|
+
|
10
|
+
.animate {
|
11
|
+
transition: transform ${T} ease-out;
|
12
|
+
}
|
13
|
+
|
14
|
+
.menu {
|
15
|
+
position: absolute;
|
16
|
+
top: 0;
|
17
|
+
left: 0;
|
18
|
+
bottom: 0;
|
19
|
+
width: ${A};
|
20
|
+
padding: .5rem .5rem 0 0;
|
21
|
+
box-sizing: border-box;
|
22
|
+
font-size: 1.4rem;
|
23
|
+
color: var(--primaryTextColor);
|
24
|
+
background: var(--menuSliderBg);
|
25
|
+
transform: translateX(calc(${A} * -1));
|
26
|
+
}
|
27
|
+
|
28
|
+
.menu > button.close {
|
29
|
+
right: 0.7rem;
|
30
|
+
}
|
31
|
+
|
32
|
+
button {
|
33
|
+
outline: none;
|
34
|
+
cursor: pointer;
|
35
|
+
}
|
36
|
+
|
37
|
+
header {
|
38
|
+
margin: 0 0 .5rem 0;
|
39
|
+
}
|
40
|
+
|
41
|
+
header * {
|
42
|
+
margin: 0;
|
43
|
+
display: inline-block;
|
44
|
+
}
|
45
|
+
header button {
|
46
|
+
outline: none;
|
47
|
+
cursor: pointer;
|
48
|
+
}
|
49
|
+
|
50
|
+
header.with-secondary-action .details {
|
51
|
+
width: 80%;
|
52
|
+
}
|
53
|
+
|
54
|
+
header .details {
|
55
|
+
font-weight: bold;
|
56
|
+
width: 88%;
|
57
|
+
}
|
58
|
+
|
59
|
+
header .custom-action > *,
|
60
|
+
button.close {
|
61
|
+
padding: 0;
|
62
|
+
background-color: transparent;
|
63
|
+
border: 0;
|
64
|
+
--iconWidth: var(--menuSliderHeaderIconWidth);
|
65
|
+
--iconHeight: var(--menuSliderHeaderIconHeight);
|
66
|
+
}
|
67
|
+
|
68
|
+
header .custom-action,
|
69
|
+
button.close {
|
70
|
+
position: absolute;
|
71
|
+
}
|
72
|
+
button.close {
|
73
|
+
right: .5rem;
|
74
|
+
}
|
75
|
+
|
76
|
+
button.close * {
|
77
|
+
float: right;
|
78
|
+
}
|
79
|
+
|
80
|
+
.content {
|
81
|
+
position: absolute;
|
82
|
+
top: 0;
|
83
|
+
right: 0;
|
84
|
+
bottom: 0;
|
85
|
+
left: ${M};
|
86
|
+
z-index: 1;
|
87
|
+
transform: translateX(calc(${A} * -1));
|
88
|
+
transition: transform ${T} ease-out;
|
89
|
+
background: var(--activeButtonBg);
|
90
|
+
border-right: .2rem solid;
|
91
|
+
border-color: var(--subpanelRightBorderColor);
|
92
|
+
padding: .5rem 0 0 .5rem;
|
93
|
+
}
|
94
|
+
|
95
|
+
.open {
|
96
|
+
transform: translateX(0);
|
97
|
+
}
|
98
|
+
|
99
|
+
.menu-list {
|
100
|
+
padding: 0;
|
101
|
+
margin: 0;
|
102
|
+
list-style: none;
|
103
|
+
background: var(--menuSliderBg);
|
104
|
+
}
|
105
|
+
.menu-list li {
|
106
|
+
margin-bottom: .2rem;
|
107
|
+
}
|
108
|
+
|
109
|
+
.content section {
|
110
|
+
height: 100%;
|
111
|
+
position: relative;
|
112
|
+
width: 100%;
|
113
|
+
}
|
114
|
+
|
115
|
+
.content .selected-menu {
|
116
|
+
overflow: auto;
|
117
|
+
height: inherit;
|
118
|
+
position: relative;
|
119
|
+
}
|
120
|
+
|
121
|
+
.content .selected-menu > * {
|
122
|
+
display: block;
|
123
|
+
padding-bottom: 3rem;
|
124
|
+
position: relative;
|
125
|
+
}
|
126
|
+
`,R=r.dy`
|
127
|
+
<svg
|
128
|
+
viewBox="0 0 18 18"
|
129
|
+
xmlns="http://www.w3.org/2000/svg"
|
130
|
+
aria-labelledby="collapseSidebarTitleID collapseSidebarDescID"
|
131
|
+
>
|
132
|
+
<title id="collapseSidebarTitleID">Collapse sidebar</title>
|
133
|
+
<desc id="collapseSidebarDescID">A circle with a left pointing chevron</desc>
|
134
|
+
<path d="m9 0c4.9705627 0 9 4.02943725 9 9 0 4.9705627-4.0294373 9-9 9-4.97056275 0-9-4.0294373-9-9 0-4.97056275 4.02943725-9 9-9zm1.6976167 5.28352881c-.365258-.3556459-.9328083-.37581056-1.32099801-.06558269l-.09308988.0844372-3 3.08108108-.08194436.09533317c-.27484337.36339327-.26799482.87009349.01656959 1.22592581l.084491.09308363 3 2.91891889.09533796.0818904c.3633964.2746544.8699472.2677153 1.2256839-.0167901l.093059-.0844712.0818904-.095338c.2746544-.3633964.2677153-.8699472-.0167901-1.2256839l-.0844712-.093059-2.283355-2.2222741 2.3024712-2.36338332.0819252-.09530804c.2997677-.39632298.2644782-.96313393-.1007797-1.31877983z" fill-rule="evenodd" class="fill-color" />
|
135
|
+
</svg>
|
136
|
+
`;class D extends r.oi{static get styles(){return r.iv`
|
137
|
+
:host {
|
138
|
+
width: var(--iconWidth, 'auto');
|
139
|
+
height: var(--iconHeight, 'auto');
|
140
|
+
}
|
141
|
+
|
142
|
+
.fill-color {
|
143
|
+
fill: var(--iconFillColor);
|
144
|
+
}
|
145
|
+
|
146
|
+
.stroke-color {
|
147
|
+
stroke: var(--iconStrokeColor);
|
148
|
+
}
|
149
|
+
`}render(){return R}}customElements.define("ia-icon-collapse-sidebar",D);var $=r.iv`
|
150
|
+
a {
|
151
|
+
display: inline-block;
|
152
|
+
text-decoration: none;
|
153
|
+
}
|
154
|
+
|
155
|
+
.menu-item {
|
156
|
+
display: inline-flex;
|
157
|
+
width: 100%;
|
158
|
+
padding: 0;
|
159
|
+
font-size: 1.6rem;
|
160
|
+
text-align: left;
|
161
|
+
background: transparent;
|
162
|
+
-webkit-box-align: center;
|
163
|
+
-ms-flex-align: center;
|
164
|
+
align-items: center;
|
165
|
+
border: none;
|
166
|
+
cursor: pointer;
|
167
|
+
}
|
168
|
+
|
169
|
+
button.menu-item {
|
170
|
+
-webkit-appearance: none;
|
171
|
+
appearance: none;
|
172
|
+
border-radius: 0;
|
173
|
+
}
|
174
|
+
|
175
|
+
.menu-item:focus {
|
176
|
+
outline: none;
|
177
|
+
}
|
178
|
+
|
179
|
+
.label {
|
180
|
+
display: var(--menuButtonLabelDisplay, none);
|
181
|
+
padding: 0;
|
182
|
+
font-weight: 400;
|
183
|
+
color: var(--primaryTextColor);
|
184
|
+
text-align: left;
|
185
|
+
vertical-align: middle;
|
186
|
+
margin-left: 1rem;
|
187
|
+
}
|
188
|
+
|
189
|
+
.menu-details {
|
190
|
+
color: var(--primaryTextColor);
|
191
|
+
display: inline-block;
|
192
|
+
margin-left: .5rem;
|
193
|
+
font-style: italic;
|
194
|
+
font-size: 1.5rem;
|
195
|
+
}
|
196
|
+
|
197
|
+
.menu-item > .icon {
|
198
|
+
position: relative;
|
199
|
+
display: inline-flex;
|
200
|
+
z-index: 2;
|
201
|
+
min-width: 4.2rem;
|
202
|
+
max-width: 4.2rem;
|
203
|
+
height: 4.2rem;
|
204
|
+
vertical-align: middle;
|
205
|
+
-webkit-box-align: center;
|
206
|
+
-ms-flex-align: center;
|
207
|
+
align-items: center;
|
208
|
+
-webkit-box-pack: center;
|
209
|
+
-ms-flex-pack: center;
|
210
|
+
justify-content: center;
|
211
|
+
}
|
212
|
+
|
213
|
+
.menu-item.selected .icon {
|
214
|
+
background-color: var(--activeButtonBg);
|
215
|
+
border-radius: 1rem 0 0 1rem;
|
216
|
+
}
|
217
|
+
|
218
|
+
.icon .fill-color {
|
219
|
+
fill: #999;
|
220
|
+
}
|
221
|
+
|
222
|
+
.icon.active .fill-color {
|
223
|
+
fill: #fff;
|
224
|
+
}
|
225
|
+
`;class N extends r.oi{static get styles(){return $}static get properties(){return{icon:{type:String},href:{type:String},label:{type:String},menuDetails:{type:String},id:{type:String},selected:{type:Boolean},followable:{type:Boolean}}}constructor(){super(),this.icon="",this.href="",this.label="",this.menuDetails="",this.id="",this.selected=!1,this.followable=!1}onClick(e){e.preventDefault(),this.dispatchMenuTypeSelectedEvent()}dispatchMenuTypeSelectedEvent(){this.dispatchEvent(new CustomEvent("menuTypeSelected",{bubbles:!0,composed:!0,detail:{id:this.id}}))}get buttonClass(){return this.selected?"selected":""}get iconClass(){return this.selected?"active":""}get menuItem(){return r.dy`
|
226
|
+
<span class="icon ${this.iconClass}">
|
227
|
+
${this.icon}
|
228
|
+
</span>
|
229
|
+
<span class="label">${this.label}</span>
|
230
|
+
<span class="menu-details">${this.menuDetails}</span>
|
231
|
+
`}get linkButton(){return r.dy`
|
232
|
+
<a
|
233
|
+
href="${this.href}"
|
234
|
+
class="menu-item ${this.buttonClass}"
|
235
|
+
@click=${this.followable?void 0:this.onClick}
|
236
|
+
>${this.menuItem}</a>
|
237
|
+
`}get clickButton(){return r.dy`
|
238
|
+
<button
|
239
|
+
class="menu-item ${this.buttonClass}"
|
240
|
+
@click=${this.onClick}
|
241
|
+
>
|
242
|
+
${this.menuItem}
|
243
|
+
</button>
|
244
|
+
`}render(){return this.href?this.linkButton:this.clickButton}}customElements.define("menu-button",N);const H={closeDrawer:"menuSliderClosed"};class F extends r.oi{static get styles(){return z}static get properties(){return{menus:{type:Array},open:{type:Boolean},manuallyHandleClose:{type:Boolean},selectedMenu:{type:String},selectedMenuAction:{type:Object},animateMenuOpen:{type:Boolean}}}constructor(){super(),this.menus=[],this.open=!1,this.selectedMenu="",this.selectedMenuAction=L.Ld,this.animateMenuOpen=!1,this.manuallyHandleClose=!1}updated(){const{actionButton:e}=this.selectedMenuDetails||{};e!==this.selectedMenuAction&&(this.selectedMenuAction=e||L.Ld)}setSelectedMenu({detail:e}){const{id:t}=e;this.selectedMenu=this.selectedMenu===t?"":t;const{actionButton:n}=this.selectedMenuDetails||{};this.selectedMenuAction=n||L.Ld}closeMenu(){this.manuallyHandleClose||(this.open=!1);const{closeDrawer:e}=H,t=new CustomEvent(e,{detail:this.selectedMenuDetails});this.dispatchEvent(t)}get selectedMenuDetails(){return this.menus.find((e=>e.id===this.selectedMenu))}get selectedMenuComponent(){const e=this.selectedMenuDetails;return e&&e.component?e.component:r.dy``}get sliderDetailsClass(){return`${this.animateMenuOpen?"animate":""} ${this.open?"open":""}`}get selectedMenuClass(){return this.selectedMenu?"open":""}get menuItems(){return this.menus.map((e=>r.dy`
|
245
|
+
<li>
|
246
|
+
<menu-button
|
247
|
+
@menuTypeSelected=${this.setSelectedMenu}
|
248
|
+
.icon=${e.icon}
|
249
|
+
.label=${e.label}
|
250
|
+
.menuDetails=${e.menuDetails}
|
251
|
+
.id=${e.id}
|
252
|
+
.selected=${e.id===this.selectedMenu}
|
253
|
+
.followable=${e.followable}
|
254
|
+
.href=${e.href}
|
255
|
+
></menu-button>
|
256
|
+
</li>
|
257
|
+
`))}get renderMenuHeader(){const{label:e="",menuDetails:t=""}=this.selectedMenuDetails||{},n=this.selectedMenuAction?"with-secondary-action":"",o=this.selectedMenuAction?r.dy`<span class="custom-action">${this.selectedMenuAction}</span>`:L.Ld;return r.dy`
|
258
|
+
<header class="${n}">
|
259
|
+
<div class="details">
|
260
|
+
<h3>${e}</h3>
|
261
|
+
<span class="extra-details">${t}</span>
|
262
|
+
</div>
|
263
|
+
${o}
|
264
|
+
${this.closeButton}
|
265
|
+
</header>
|
266
|
+
`}get closeButton(){return r.dy`
|
267
|
+
<button class="close" aria-label="Close this menu" @click=${this.closeMenu}>
|
268
|
+
<ia-icon-collapse-sidebar></ia-icon-collapse-sidebar>
|
269
|
+
</button>
|
270
|
+
`}render(){return r.dy`
|
271
|
+
<div class="main">
|
272
|
+
<div class="menu ${this.sliderDetailsClass}">
|
273
|
+
${this.closeButton}
|
274
|
+
<ul class="menu-list">
|
275
|
+
${this.menuItems}
|
276
|
+
</ul>
|
277
|
+
<div class="content ${this.selectedMenuClass}" @menuTypeSelected=${this.setSelectedMenu}>
|
278
|
+
${this.renderMenuHeader}
|
279
|
+
<section>
|
280
|
+
<div class="selected-menu">
|
281
|
+
${this.selectedMenuComponent}
|
282
|
+
</div>
|
283
|
+
</section>
|
284
|
+
</div>
|
285
|
+
</div>
|
286
|
+
</div>
|
287
|
+
`}}window.customElements.define("ia-menu-slider",F);var U=r.dy`
|
288
|
+
<svg
|
289
|
+
viewBox="0 0 40 40"
|
290
|
+
xmlns="http://www.w3.org/2000/svg"
|
291
|
+
aria-labelledby="ellipsesTitleID ellipsesDescID"
|
292
|
+
>
|
293
|
+
<title id="ellipsesTitleID">Ellipses icon</title>
|
294
|
+
<desc id="ellipsesDescID">An illustration of text ellipses.</desc>
|
295
|
+
<path class="fill-color" d="m10.5 17.5c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5c-1.38071187 0-2.5-1.1192881-2.5-2.5s1.11928813-2.5 2.5-2.5zm9.5 0c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5-2.5-1.1192881-2.5-2.5 1.1192881-2.5 2.5-2.5zm9.5 0c1.3807119 0 2.5 1.1192881 2.5 2.5s-1.1192881 2.5-2.5 2.5-2.5-1.1192881-2.5-2.5 1.1192881-2.5 2.5-2.5z" fill-rule="evenodd"/>
|
296
|
+
</svg>
|
297
|
+
`;class V extends r.oi{static get styles(){return r.iv`
|
298
|
+
:host {
|
299
|
+
width: var(--iconWidth, 'auto');
|
300
|
+
height: var(--iconHeight, 'auto');
|
301
|
+
}
|
302
|
+
|
303
|
+
.fill-color {
|
304
|
+
fill: var(--iconFillColor);
|
305
|
+
}
|
306
|
+
|
307
|
+
.stroke-color {
|
308
|
+
stroke: var(--iconStrokeColor);
|
309
|
+
}
|
310
|
+
`}render(){return U}}customElements.define("ia-icon-ellipses",V);let q=class extends r.oi{static get properties(){return{title:{type:String}}}get bookIconSvg(){return r.YP`
|
311
|
+
<g class="bookIcon" transform="matrix(1 0 0 -1 28 67.362264)">
|
312
|
+
<path d="m44.71698 31.6981124v-29.99320678s-18.0956599.30735848-18.6322637-.7171698c-.0633962-.12226414-1.890566-.59207545-2.9745282-.59207545-1.3228302 0-3.5122641 0-4.1286791.74547168-.9707547 1.17452827-18.82811278.71660375-18.82811278.71660375v30.040754l1.83849052.7867924.29094339-28.48188608s15.94981097.15339622 17.09094297-1.10716978c.8145283-.90056602 4.997547-.91641507 5.3450942-.3526415.9611321 1.55716977 14.7101883 1.31716978 17.6077354 1.45981128l.3266038 28.22830118z"/>
|
313
|
+
<path d="m40.1129424 33.5957539h-12.8337733c-1.8690565 0-3.1098112-.7545283-3.9299999-1.6279245v-26.70452764l1.2362264-.00792453c.4584906.72962262 3.0922641 1.39415091 3.0922641 1.39415091h10.1298111s1.0381131.01754717 1.5141509.47377357c.5643396.54056602.7913207 1.36981129.7913207 1.36981129z"/>
|
314
|
+
<path d="m17.3354713 33.5957539h-12.8337733v-25.37660316s0-.75283017.49358489-1.14113205c.52867924-.41433961 1.3415094-.42849055 1.3415094-.42849055h10.59905631s2.2075471-.52698112 3.0928301-1.39415091l1.2.00792453v26.74245214c-.8201886.8581132-2.0530188 1.59-3.8932074 1.59"/>
|
315
|
+
</g>
|
316
|
+
`}get icon(){return this.bookIconSvg}get loader(){return r.YP`
|
317
|
+
<svg
|
318
|
+
height="100"
|
319
|
+
viewBox="0 0 100 100"
|
320
|
+
width="100"
|
321
|
+
xmlns="http://www.w3.org/2000/svg"
|
322
|
+
aria-labelledby="item-loading"
|
323
|
+
>
|
324
|
+
<title id="item-loading">Currently loading viewer.</title>
|
325
|
+
<desc>Please wait while we load theater.</desc>
|
326
|
+
<g fill="#333" fill-rule="evenodd" class="book-icon">
|
327
|
+
${this.icon}
|
328
|
+
<path
|
329
|
+
class="ring"
|
330
|
+
d="m17.8618849 11.6970233c18.5864635-15.59603144 45.6875867-15.59603102 64.2740497.000001 1.9271446 1.6170806 2.1785128 4.4902567.5614466 6.4174186-1.6170661 1.9271618-4.4902166 2.1785323-6.4173612.5614517-15.1996922-12.75416882-37.3625282-12.75416916-52.5622206-.000001-15.19969387 12.7541707-19.04823077 34.5805019-9.1273354 51.7641499 9.9208955 17.183646 30.7471499 24.7638499 49.3923323 17.9774983 18.6451823-6.7863521 29.7266014-25.9801026 26.2811129-45.5206248-.436848-2.4775114 1.2174186-4.8400696 3.6949079-5.2769215 2.4774893-.4368518 4.8400264 1.2174296 5.2768744 3.694941 4.2132065 23.8945096-9.3373563 47.3649806-32.137028 55.6634567-22.799672 8.2984758-48.2663986-.9707372-60.39785211-21.9832155-12.1314534-21.012481-7.42539173-47.7021198 11.16107351-63.2981544z"
|
331
|
+
fill-rule="nonzero"
|
332
|
+
/>
|
333
|
+
</g>
|
334
|
+
</svg>
|
335
|
+
`}render(){const e=this.title?r.dy`<h2>${this.title}</h2>`:r.Ld;return r.dy`
|
336
|
+
<div class="place-holder">
|
337
|
+
${e} ${this.loader}
|
338
|
+
<h3>Loading viewer</h3>
|
339
|
+
</div>
|
340
|
+
`}static get styles(){return r.iv`
|
341
|
+
.place-holder {
|
342
|
+
width: 30%;
|
343
|
+
margin: auto;
|
344
|
+
text-align: center;
|
345
|
+
color: var(--primaryTextColor);
|
346
|
+
}
|
347
|
+
|
348
|
+
.place-holder {
|
349
|
+
position: relative;
|
350
|
+
}
|
351
|
+
|
352
|
+
.place-holder svg {
|
353
|
+
display: block;
|
354
|
+
width: 60%;
|
355
|
+
max-width: 100px;
|
356
|
+
height: auto;
|
357
|
+
margin: auto;
|
358
|
+
}
|
359
|
+
|
360
|
+
svg * {
|
361
|
+
fill: var(--primaryTextColor);
|
362
|
+
}
|
363
|
+
|
364
|
+
svg .ring {
|
365
|
+
animation: rotate 1.3s infinite linear;
|
366
|
+
transform-origin: 50px 50px;
|
367
|
+
transform-box: fill-box;
|
368
|
+
display: block; // transform won't work on inline style
|
369
|
+
}
|
370
|
+
|
371
|
+
@keyframes rotate {
|
372
|
+
0% {
|
373
|
+
-moz-transform: rotate(-360deg);
|
374
|
+
-webkit-transform: rotate(-360deg);
|
375
|
+
transform: rotate(-360deg);
|
376
|
+
}
|
377
|
+
}
|
378
|
+
`}};q=o([(0,s.Mo)("ia-itemnav-loader")],q);let W=class extends r.oi{constructor(){super(...arguments),this.identifier=""}emitLoaded(){this.dispatchEvent(new CustomEvent("loadingStateUpdated",{detail:{loaded:!0}}))}updated(e){e.has("identifier")&&this.emitLoaded()}get downloadUrl(){return`/download/${this.identifier}`}render(){return r.dy`
|
379
|
+
<section>
|
380
|
+
<h2>THERE IS NO PREVIEW AVAILABLE FOR THIS ITEM</h2>
|
381
|
+
<p>
|
382
|
+
This item does not appear to have any files that can be experienced on
|
383
|
+
Archive.org. <br />
|
384
|
+
Please download files in this item to interact with them on your
|
385
|
+
computer.
|
386
|
+
</p>
|
387
|
+
<a href=${this.downloadUrl}>Show all files</a>
|
388
|
+
</section>
|
389
|
+
`}static get styles(){return r.iv`
|
390
|
+
:host {
|
391
|
+
color: var(--primaryTextColor, #fff);
|
392
|
+
text-align: center;
|
393
|
+
}
|
394
|
+
section {
|
395
|
+
width: 100%;
|
396
|
+
margin: 5%;
|
397
|
+
padding: 0 5%;
|
398
|
+
}
|
399
|
+
p {
|
400
|
+
font-size: 1.4rem;
|
401
|
+
}
|
402
|
+
a {
|
403
|
+
color: var(--primaryTextColor, #fff);
|
404
|
+
background-color: rgb(25, 72, 128);
|
405
|
+
min-height: 35px;
|
406
|
+
outline: none;
|
407
|
+
cursor: pointer;
|
408
|
+
line-height: normal;
|
409
|
+
border-radius: 0.4rem;
|
410
|
+
text-align: center;
|
411
|
+
vertical-align: middle;
|
412
|
+
font-size: 1.4rem;
|
413
|
+
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
414
|
+
display: inline-block;
|
415
|
+
padding: 0.85rem 1.2rem;
|
416
|
+
border: 1px solid rgb(197, 209, 223);
|
417
|
+
white-space: nowrap;
|
418
|
+
appearance: auto;
|
419
|
+
box-sizing: border-box;
|
420
|
+
user-select: none;
|
421
|
+
text-decoration: none;
|
422
|
+
}
|
423
|
+
`}};o([(0,s.Cb)({type:String})],W.prototype,"identifier",void 0),W=o([(0,s.Mo)("ia-no-theater-available")],W);let Z=class extends r.oi{constructor(){super(...arguments),this.viewAvailable=!0,this.baseHost="archive.org",this.signedIn=!1,this.menuContents=[],this.menuShortcuts=[],this.viewportInFullscreen=null,this.menuOpened=!1,this.loaded=null,this.openMenuState="shift"}disconnectedCallback(){this.removeResizeObserver()}updated(e){if(e.has("sharedObserver")){const t=e.get("sharedObserver");null==t||t.removeObserver(this.resizeObserverConfig),this.setResizeObserver()}}handleResize(e){const{width:t}=e.contentRect;this.openMenuState=t<=600?"overlay":"shift"}setResizeObserver(){var e,t;null===(e=this.sharedObserver)||void 0===e||e.addObserver(this.resizeObserverConfig),null===(t=this.sharedObserver)||void 0===t||t.addObserver({target:this.headerSlot,handler:{handleResize:({contentRect:e})=>{e.height&&this.requestUpdate()}}})}removeResizeObserver(){var e;null===(e=this.sharedObserver)||void 0===e||e.removeObserver(this.resizeObserverConfig)}get resizeObserverConfig(){return{handler:this,target:this.frame}}get loaderTitle(){return this.viewportInFullscreen?"Internet Archive":""}get loadingArea(){return r.dy`
|
424
|
+
<div class="loading-area">
|
425
|
+
<div class="loading-view">
|
426
|
+
<ia-itemnav-loader .title=${this.loaderTitle}></ia-itemnav-loader>
|
427
|
+
</div>
|
428
|
+
</div>
|
429
|
+
`}slotChange(e,t){var n;const r=null===(n=e.target.assignedNodes())||void 0===n?void 0:n[0];this.dispatchEvent(new CustomEvent("slotChange",{detail:{slot:r,type:t}})),this.requestUpdate()}render(){var e,t;const n=this.loaded?"":"hidden",o=(null===(t=null===(e=this.headerSlot)||void 0===e?void 0:e.assignedNodes()[0])||void 0===t?void 0:t.offsetHeight)||0;return r.dy`
|
430
|
+
<div id="frame" class=${this.menuClass}>
|
431
|
+
<slot
|
432
|
+
name="header"
|
433
|
+
style=${`height: ${o}px`}
|
434
|
+
@slotchange=${e=>this.slotChange(e,"header")}
|
435
|
+
></slot>
|
436
|
+
<div class="menu-and-reader">
|
437
|
+
${this.shouldRenderMenu?this.renderSideMenu:r.Ld}
|
438
|
+
<div id="reader" class=${n}>
|
439
|
+
${this.renderViewport}
|
440
|
+
</div>
|
441
|
+
${this.loaded?r.Ld:this.loadingArea}
|
442
|
+
</div>
|
443
|
+
</div>
|
444
|
+
`}get noTheaterView(){var e,t;return r.dy`<ia-no-theater-available
|
445
|
+
.identifier=${null===(t=null===(e=this.item)||void 0===e?void 0:e.metadata)||void 0===t?void 0:t.identifier}
|
446
|
+
@loadingStateUpdated=${this.loadingStateUpdated}
|
447
|
+
></ia-no-theater-available>`}get renderViewport(){if(!this.viewAvailable)return this.noTheaterView;const e=this.loaded?"opacity: 1;":"opacity: 0;";return r.dy`
|
448
|
+
<div slot="main" style=${e}>
|
449
|
+
<slot
|
450
|
+
name="main"
|
451
|
+
@slotchange=${e=>this.slotChange(e,"main")}
|
452
|
+
></slot>
|
453
|
+
</div>
|
454
|
+
`}loadingStateUpdated(e){const{loaded:t}=e.detail;this.loaded=t||null}manageViewportFullscreen(e){const t=!!e.detail.isFullScreen;this.viewportInFullscreen=t||null;const n=new CustomEvent("fullscreenToggled",{detail:e.detail});this.dispatchEvent(n)}get shouldRenderMenu(){var e;return!!(null===(e=this.menuContents)||void 0===e?void 0:e.length)}toggleMenu(){this.menuOpened=!this.menuOpened}closeMenu(){this.menuOpened=!1}setOpenMenu(e){const{id:t}=e.detail;this.openMenu=t!==this.openMenu?t:void 0}setMenuContents(e){const t=[...e.detail];this.menuContents=t}setMenuShortcuts(e){this.menuShortcuts=[...e.detail]}manageSideMenuEvents(e){const{menuId:t,action:n}=e.detail;t&&("open"===n?this.openShortcut(t):"toggle"===n&&(this.openMenu=t,this.toggleMenu()))}get menuToggleButton(){return r.dy`
|
455
|
+
<button
|
456
|
+
class="toggle-menu"
|
457
|
+
@click=${this.toggleMenu}
|
458
|
+
title="Toggle theater side panels"
|
459
|
+
>
|
460
|
+
<div>
|
461
|
+
<ia-icon-ellipses
|
462
|
+
style="width: var(--iconWidth); height: var(--iconHeight);"
|
463
|
+
></ia-icon-ellipses>
|
464
|
+
</div>
|
465
|
+
</button>
|
466
|
+
`}get selectedMenuId(){return this.openMenu||""}get renderSideMenu(){const e=this.menuOpened?"":"hidden";return r.dy`
|
467
|
+
<nav>
|
468
|
+
<div class="minimized">${this.shortcuts} ${this.menuToggleButton}</div>
|
469
|
+
<div id="menu" class=${e}>
|
470
|
+
<ia-menu-slider
|
471
|
+
.menus=${this.menuContents}
|
472
|
+
.selectedMenu=${this.selectedMenuId}
|
473
|
+
@menuTypeSelected=${this.setOpenMenu}
|
474
|
+
@menuSliderClosed=${this.closeMenu}
|
475
|
+
manuallyHandleClose
|
476
|
+
open
|
477
|
+
></ia-menu-slider>
|
478
|
+
</div>
|
479
|
+
</nav>
|
480
|
+
`}openShortcut(e=""){this.openMenu=e,this.menuOpened=!0}get shortcuts(){const e=this.menuShortcuts.map((({icon:e,id:t})=>"fullscreen"===t?r.dy`${e}`:r.dy`
|
481
|
+
<button class="shortcut ${t}" @click="${()=>this.openShortcut(t)}">
|
482
|
+
${e}
|
483
|
+
</button>
|
484
|
+
`));return r.dy`<div class="shortcuts">${e}</div>`}get menuClass(){var e,t;const n=(null===(e=this.menuContents)||void 0===e?void 0:e.length)||(null===(t=this.menuShortcuts)||void 0===t?void 0:t.length);return`${this.menuOpened&&n?"open":""} ${this.viewportInFullscreen?"fullscreen":""} ${this.openMenuState}`}static get styles(){const e=r.iv`var(--menuWidth, 320px)`,t=r.iv`var(--animationTiming, 200ms)`,n=r.iv`transform ${t} ease-out`,o=r.iv`var(--theaterMenuMargin, 42px)`,i=r.iv`var(--theaterBgColor, #000)`;return r.iv`
|
485
|
+
:host,
|
486
|
+
#frame,
|
487
|
+
.menu-and-reader {
|
488
|
+
position: relative;
|
489
|
+
overflow: hidden;
|
490
|
+
display: block;
|
491
|
+
}
|
492
|
+
|
493
|
+
:host,
|
494
|
+
#frame,
|
495
|
+
.loading-area,
|
496
|
+
.loading-view {
|
497
|
+
min-height: inherit;
|
498
|
+
height: inherit;
|
499
|
+
}
|
500
|
+
|
501
|
+
slot {
|
502
|
+
display: block;
|
503
|
+
width: 100%;
|
504
|
+
}
|
505
|
+
|
506
|
+
slot * {
|
507
|
+
display: block;
|
508
|
+
height: inherit;
|
509
|
+
}
|
510
|
+
|
511
|
+
#frame {
|
512
|
+
background-color: ${i};
|
513
|
+
color-scheme: dark;
|
514
|
+
display: flex;
|
515
|
+
flex-direction: column;
|
516
|
+
}
|
517
|
+
|
518
|
+
#frame.fullscreen {
|
519
|
+
position: fixed;
|
520
|
+
top: 0;
|
521
|
+
bottom: 0;
|
522
|
+
left: 0;
|
523
|
+
right: 0;
|
524
|
+
z-index: 9;
|
525
|
+
}
|
526
|
+
|
527
|
+
.loading-view {
|
528
|
+
height: 100%;
|
529
|
+
display: flex;
|
530
|
+
align-items: center;
|
531
|
+
justify-content: center;
|
532
|
+
}
|
533
|
+
|
534
|
+
.loading-area {
|
535
|
+
width: 100%;
|
536
|
+
}
|
537
|
+
|
538
|
+
ia-itemnav-loader {
|
539
|
+
display: block;
|
540
|
+
width: 100%;
|
541
|
+
}
|
542
|
+
|
543
|
+
.hidden {
|
544
|
+
display: none !important;
|
545
|
+
}
|
546
|
+
|
547
|
+
button {
|
548
|
+
cursor: pointer;
|
549
|
+
padding: 0;
|
550
|
+
border: 0;
|
551
|
+
}
|
552
|
+
|
553
|
+
button:focus,
|
554
|
+
button:active {
|
555
|
+
outline: none;
|
556
|
+
}
|
557
|
+
|
558
|
+
.menu-and-reader {
|
559
|
+
position: relative;
|
560
|
+
display: flex;
|
561
|
+
flex: 1;
|
562
|
+
}
|
563
|
+
|
564
|
+
nav button {
|
565
|
+
background: none;
|
566
|
+
}
|
567
|
+
|
568
|
+
nav .minimized {
|
569
|
+
background: rgba(0, 0, 0, 0.7);
|
570
|
+
padding-top: 6px;
|
571
|
+
position: absolute;
|
572
|
+
width: ${o};
|
573
|
+
z-index: 2;
|
574
|
+
left: 0;
|
575
|
+
border-bottom-right-radius: 5%;
|
576
|
+
}
|
577
|
+
|
578
|
+
nav .minimized button {
|
579
|
+
width: var(--iconWidth);
|
580
|
+
height: var(--iconHeight);
|
581
|
+
margin-bottom: 0.2rem;
|
582
|
+
margin: auto;
|
583
|
+
display: inline-flex;
|
584
|
+
vertical-align: middle;
|
585
|
+
-webkit-box-align: center;
|
586
|
+
align-items: center;
|
587
|
+
-webkit-box-pack: center;
|
588
|
+
justify-content: center;
|
589
|
+
width: ${o};
|
590
|
+
height: ${o};
|
591
|
+
}
|
592
|
+
|
593
|
+
nav .minimized button.toggle-menu > * {
|
594
|
+
border: 2px solid var(--iconStrokeColor);
|
595
|
+
border-radius: var(--iconWidth);
|
596
|
+
width: var(--iconWidth);
|
597
|
+
height: var(--iconHeight);
|
598
|
+
margin: auto;
|
599
|
+
}
|
600
|
+
|
601
|
+
ia-icon-ellipses {
|
602
|
+
width: var(--iconWidth);
|
603
|
+
height: var(--iconHeight);
|
604
|
+
}
|
605
|
+
|
606
|
+
#menu {
|
607
|
+
position: absolute;
|
608
|
+
top: 0;
|
609
|
+
bottom: 0;
|
610
|
+
left: 0;
|
611
|
+
z-index: 3;
|
612
|
+
overflow: hidden;
|
613
|
+
transform: translateX(-${e});
|
614
|
+
width: ${e};
|
615
|
+
transform: translateX(calc(${e} * -1));
|
616
|
+
transition: ${n};
|
617
|
+
}
|
618
|
+
|
619
|
+
#reader {
|
620
|
+
position: relative;
|
621
|
+
z-index: 1;
|
622
|
+
transform: translateX(0);
|
623
|
+
width: 100%;
|
624
|
+
display: flex;
|
625
|
+
}
|
626
|
+
|
627
|
+
#reader > * {
|
628
|
+
width: 100%;
|
629
|
+
display: flex;
|
630
|
+
flex: 1;
|
631
|
+
}
|
632
|
+
|
633
|
+
.open.overlay #reader {
|
634
|
+
transition: none;
|
635
|
+
}
|
636
|
+
|
637
|
+
.open #menu {
|
638
|
+
width: ${e};
|
639
|
+
transform: translateX(0);
|
640
|
+
transition: ${n};
|
641
|
+
}
|
642
|
+
|
643
|
+
.open.shift #reader {
|
644
|
+
width: calc(100% - ${e});
|
645
|
+
margin-left: ${e};
|
646
|
+
transition: ${n};
|
647
|
+
}
|
648
|
+
`}};o([(0,s.Cb)({type:Object,converter:e=>e&&"string"==typeof e?new j(JSON.parse(atob(e))):e})],Z.prototype,"item",void 0),o([(0,s.Cb)({type:Boolean})],Z.prototype,"viewAvailable",void 0),o([(0,s.Cb)({type:String})],Z.prototype,"baseHost",void 0),o([(0,s.Cb)({converter:e=>"boolean"==typeof e?e:"true"===e})],Z.prototype,"signedIn",void 0),o([(0,s.Cb)({type:Array})],Z.prototype,"menuContents",void 0),o([(0,s.Cb)({type:Array})],Z.prototype,"menuShortcuts",void 0),o([(0,s.Cb)({type:Boolean,reflect:!0,attribute:!0})],Z.prototype,"viewportInFullscreen",void 0),o([(0,s.Cb)({type:Boolean})],Z.prototype,"menuOpened",void 0),o([(0,s.Cb)({type:String})],Z.prototype,"openMenu",void 0),o([(0,s.Cb)({attribute:!1})],Z.prototype,"modal",void 0),o([(0,s.Cb)({attribute:!1})],Z.prototype,"sharedObserver",void 0),o([(0,s.Cb)({type:Boolean,reflect:!0,attribute:!0})],Z.prototype,"loaded",void 0),o([(0,s.SB)()],Z.prototype,"openMenuState",void 0),o([(0,s.IO)("#frame")],Z.prototype,"frame",void 0),o([(0,s.IO)('slot[name="header"]')],Z.prototype,"headerSlot",void 0),o([(0,s.IO)('slot[name="main"]')],Z.prototype,"mainSlot",void 0),Z=o([(0,s.Mo)("ia-item-navigator")],Z),n(5003),n(4747),n(9337),n(4765),n(7941),n(7327),n(561),n(9826),n(5827),n(2222);class G{constructor(e){var t,n,r,o,i;this.title=null==e?void 0:e.title,this.subtitle=null==e?void 0:e.subtitle,this.headline=null==e?void 0:e.headline,this.message=null==e?void 0:e.message,this.headerColor=null!==(t=null==e?void 0:e.headerColor)&&void 0!==t?t:"#55A183",this.showProcessingIndicator=null!==(n=null==e?void 0:e.showProcessingIndicator)&&void 0!==n&&n,this.processingImageMode=null!==(r=null==e?void 0:e.processingImageMode)&&void 0!==r?r:"complete",this.showCloseButton=null===(o=null==e?void 0:e.showCloseButton)||void 0===o||o,this.closeOnBackdropClick=null===(i=null==e?void 0:e.closeOnBackdropClick)||void 0===i||i}}const J=Object.freeze({processing:"processing",complete:"complete"});class Y extends r.oi{static get properties(){return{mode:{type:String}}}constructor(){super(),this.mode=J.processing}render(){return r.dy`
|
649
|
+
<div class="${this.mode}">
|
650
|
+
<svg
|
651
|
+
viewBox="0 0 120 120"
|
652
|
+
preserveAspectRatio="none"
|
653
|
+
version="1.1"
|
654
|
+
xmlns="http://www.w3.org/2000/svg"
|
655
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
656
|
+
aria-labelledby="indicatorTitle indicatorDescription"
|
657
|
+
>
|
658
|
+
<title id="indicatorTitle">Activity Indicator</title>
|
659
|
+
<desc id="indicatorDescription">
|
660
|
+
A rotating activity indicator with three dots in the middle.
|
661
|
+
</desc>
|
662
|
+
<g
|
663
|
+
id="icons/check-ring---squared"
|
664
|
+
stroke="none"
|
665
|
+
stroke-width="1"
|
666
|
+
fill="none"
|
667
|
+
fill-rule="evenodd"
|
668
|
+
>
|
669
|
+
<path
|
670
|
+
id="completed-ring"
|
671
|
+
class="loaded-indicator"
|
672
|
+
d="M60,10 C70.5816709,10 80.3955961,13.2871104 88.4763646,18.8959201 L78.3502633,29.0214223 C72.9767592,25.8315427 66.7022695,24 60,24 C40.117749,24 24,40.117749 24,60 C24,79.882251 40.117749,96 60,96 C79.882251,96 96,79.882251 96,60 L95.995,59.46 L108.327675,47.128668 C109.350926,50.9806166 109.925886,55.015198 109.993301,59.1731586 L110,60 C110,87.6142375 87.6142375,110 60,110 C32.3857625,110 10,87.6142375 10,60 C10,32.3857625 32.3857625,10 60,10 Z"
|
673
|
+
></path>
|
674
|
+
<polygon
|
675
|
+
id="check"
|
676
|
+
class="loaded-indicator"
|
677
|
+
transform="translate(75.000000, 41.500000) rotate(44.000000) translate(-75.000000, -41.500000) "
|
678
|
+
points="96 85 54 85 54 65 76 64.999 76 -2 96 -2"
|
679
|
+
></polygon>
|
680
|
+
<path
|
681
|
+
id="activity-ring"
|
682
|
+
class="activity-indicator"
|
683
|
+
d="M60,10 C69.8019971,10 78.9452178,12.8205573 86.6623125,17.6943223 L76.4086287,27.9484118 C71.4880919,25.4243078 65.9103784,24 60,24 C40.117749,24 24,40.117749 24,60 C24,79.882251 40.117749,96 60,96 C79.882251,96 96,79.882251 96,60 C96,53.3014663 94.1704984,47.0302355 90.9839104,41.6587228 L101.110332,31.5326452 C106.715332,39.6116982 110,49.4222615 110,60 C110,87.6142375 87.6142375,110 60,110 C32.3857625,110 10,87.6142375 10,60 C10,32.3857625 32.3857625,10 60,10 Z"
|
684
|
+
></path>
|
685
|
+
<g
|
686
|
+
id="activity-dots"
|
687
|
+
class="activity-indicator"
|
688
|
+
transform="translate(40.000000, 55.000000)"
|
689
|
+
>
|
690
|
+
<circle id="left-dot" cx="5" cy="5" r="5"></circle>
|
691
|
+
<circle id="middle-dot" cx="20" cy="5" r="5"></circle>
|
692
|
+
<circle id="right-dot" cx="35" cy="5" r="5"></circle>
|
693
|
+
</g>
|
694
|
+
</g>
|
695
|
+
</svg>
|
696
|
+
</div>
|
697
|
+
`}static get styles(){const e=r.iv`var(--activityIndicatorCheckmarkColor, #31A481)`,t=r.iv`var(--activityIndicatorCompletedRingColor, #31A481)`,n=r.iv`var(--activityIndicatorLoadingRingColor, #333333)`,o=r.iv`var(--activityIndicatorLoadingDotColor, #333333)`;return r.iv`
|
698
|
+
#completed-ring {
|
699
|
+
fill: ${t};
|
700
|
+
}
|
701
|
+
|
702
|
+
#check {
|
703
|
+
fill: ${e};
|
704
|
+
}
|
705
|
+
|
706
|
+
#activity-ring {
|
707
|
+
fill: ${n};
|
708
|
+
}
|
709
|
+
|
710
|
+
#activity-dots {
|
711
|
+
fill: ${o};
|
712
|
+
}
|
713
|
+
|
714
|
+
.activity-indicator {
|
715
|
+
opacity: 0;
|
716
|
+
transition: opacity 0.25s ease-out;
|
717
|
+
}
|
718
|
+
|
719
|
+
.processing .activity-indicator {
|
720
|
+
opacity: 1;
|
721
|
+
}
|
722
|
+
|
723
|
+
.loaded-indicator {
|
724
|
+
opacity: 1;
|
725
|
+
transition: opacity 0.25s ease-out;
|
726
|
+
}
|
727
|
+
|
728
|
+
.processing .loaded-indicator {
|
729
|
+
opacity: 0;
|
730
|
+
}
|
731
|
+
|
732
|
+
.image {
|
733
|
+
border: 1px solid red;
|
734
|
+
display: inline-block;
|
735
|
+
}
|
736
|
+
|
737
|
+
.processing #activity-ring {
|
738
|
+
animation: rotate 1.3s infinite linear;
|
739
|
+
transform-origin: 50px 50px;
|
740
|
+
transform-box: fill-box;
|
741
|
+
}
|
742
|
+
|
743
|
+
.processing #left-dot {
|
744
|
+
opacity: 0;
|
745
|
+
animation: dot 1.3s infinite;
|
746
|
+
animation-delay: 0.2s;
|
747
|
+
}
|
748
|
+
|
749
|
+
.processing #middle-dot {
|
750
|
+
opacity: 0;
|
751
|
+
animation: dot 1.3s infinite;
|
752
|
+
animation-delay: 0.4s;
|
753
|
+
}
|
754
|
+
|
755
|
+
.processing #right-dot {
|
756
|
+
opacity: 0;
|
757
|
+
animation: dot 1.3s infinite;
|
758
|
+
animation-delay: 0.6s;
|
759
|
+
}
|
760
|
+
|
761
|
+
@keyframes rotate {
|
762
|
+
0% {
|
763
|
+
transform: rotate(-360deg);
|
764
|
+
}
|
765
|
+
}
|
766
|
+
|
767
|
+
@keyframes dot {
|
768
|
+
0% {
|
769
|
+
opacity: 0;
|
770
|
+
}
|
771
|
+
25% {
|
772
|
+
opacity: 1;
|
773
|
+
}
|
774
|
+
100% {
|
775
|
+
opacity: 0;
|
776
|
+
}
|
777
|
+
}
|
778
|
+
`}}window.customElements.define("ia-activity-indicator",Y);var X=r.dy`
|
779
|
+
<svg
|
780
|
+
viewBox="0 0 40 40"
|
781
|
+
version="1.1"
|
782
|
+
xmlns="http://www.w3.org/2000/svg"
|
783
|
+
aria-labelledby="closeTitleID closeDescID"
|
784
|
+
>
|
785
|
+
<title id="closeTitleID">Close icon</title>
|
786
|
+
<desc id="closeDescID">A line drawing of an X</desc>
|
787
|
+
<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"/>
|
788
|
+
</svg>
|
789
|
+
`,Q=r.dy`
|
790
|
+
<svg
|
791
|
+
class="ia-logo"
|
792
|
+
viewBox="0 0 27 30"
|
793
|
+
xmlns="http://www.w3.org/2000/svg"
|
794
|
+
aria-labelledby="logoTitleID logoDescID"
|
795
|
+
>
|
796
|
+
<title id="logoTitleID">Internet Archive logo</title>
|
797
|
+
<desc id="logoDescID">A line drawing of the Internet Archive headquarters building façade.</desc>
|
798
|
+
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
799
|
+
<mask id="mask-2" class="fill-color">
|
800
|
+
<path d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z" id="path-1"></path>
|
801
|
+
</mask>
|
802
|
+
<use class="fill-color" xlink:href="#path-1"></use>
|
803
|
+
<g mask="url(#mask-2)" class="fill-color">
|
804
|
+
<path d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z" id="swatch"></path>
|
805
|
+
</g>
|
806
|
+
</g>
|
807
|
+
</svg>
|
808
|
+
`;let K=class extends r.oi{constructor(){super(...arguments),this.config=new G}render(){return r.dy`
|
809
|
+
<div class="modal-wrapper">
|
810
|
+
<div class="modal-container">
|
811
|
+
<header style="background-color: ${this.config.headerColor}">
|
812
|
+
${this.config.showCloseButton?this.closeButtonTemplate:""}
|
813
|
+
<div class="logo-icon">
|
814
|
+
${Q}
|
815
|
+
</div>
|
816
|
+
${this.config.title?r.dy`<h1 class="title">${this.config.title}</h1>`:""}
|
817
|
+
${this.config.subtitle?r.dy`<h2 class="subtitle">${this.config.subtitle}</h2>`:""}
|
818
|
+
</header>
|
819
|
+
<section class="modal-body">
|
820
|
+
<div class="content">
|
821
|
+
<div
|
822
|
+
class="processing-logo ${this.config.showProcessingIndicator?"":"hidden"}"
|
823
|
+
>
|
824
|
+
<ia-activity-indicator
|
825
|
+
.mode=${this.config.processingImageMode}
|
826
|
+
></ia-activity-indicator>
|
827
|
+
</div>
|
828
|
+
|
829
|
+
${this.config.headline?r.dy` <h1 class="headline">${this.config.headline}</h1> `:""}
|
830
|
+
${this.config.message?r.dy` <p class="message">${this.config.message}</p> `:""}
|
831
|
+
|
832
|
+
<div class="slot-container">
|
833
|
+
<slot> </slot>
|
834
|
+
</div>
|
835
|
+
</div>
|
836
|
+
</section>
|
837
|
+
</div>
|
838
|
+
</div>
|
839
|
+
`}handleCloseButton(){const e=new Event("closeButtonPressed");this.dispatchEvent(e)}get closeButtonTemplate(){return r.dy`
|
840
|
+
<button
|
841
|
+
type="button"
|
842
|
+
class="close-button"
|
843
|
+
tabindex="0"
|
844
|
+
@click=${this.handleCloseButton}
|
845
|
+
>
|
846
|
+
${X}
|
847
|
+
</button>
|
848
|
+
`}static get styles(){const e=r.iv`var(--modalLogoSize, 6.5rem)`,t=r.iv`var(--processingImageSize, 7.5rem)`,n=r.iv`var(--modalCornerRadius, 1rem)`,o=r.iv`var(--modalBorder, 2px solid black)`,i=r.iv`var(--modalBottomMargin, 2.5rem)`,a=r.iv`var(--modalTopMargin, 5rem)`,s=r.iv`var(--modalHeaderBottomPadding, 0.5em)`,l=r.iv`var(--modalBottomPadding, 2rem)`,c=r.iv`var(--modalScrollOffset, 5px)`,u=r.iv`var(--modalTitleFontSize, 1.8rem)`,d=r.iv`var(--modalSubtitleFontSize, 1.4rem)`,h=r.iv`var(--modalHeadlineFontSize, 1.6rem)`,f=r.iv`var(--modalMessageFontSize, 1.4rem)`,p=r.iv`var(--modalTitleLineHeight, normal)`,m=r.iv`var(--modalSubtitleLineHeight, normal)`,v=r.iv`var(--modalHeadlineLineHeight, normal)`,y=r.iv`var(--modalMessageLineHeight, normal)`;return r.iv`
|
849
|
+
.processing-logo {
|
850
|
+
margin: auto;
|
851
|
+
width: ${t};
|
852
|
+
height: ${t};
|
853
|
+
}
|
854
|
+
|
855
|
+
.processing-logo.hidden {
|
856
|
+
height: 1rem;
|
857
|
+
}
|
858
|
+
|
859
|
+
.processing-logo.hidden ia-activity-indicator {
|
860
|
+
display: none;
|
861
|
+
}
|
862
|
+
|
863
|
+
.modal-wrapper {
|
864
|
+
outline: none;
|
865
|
+
}
|
866
|
+
|
867
|
+
.modal-container {
|
868
|
+
border-radius: ${n};
|
869
|
+
width: 100%;
|
870
|
+
margin-top: ${a};
|
871
|
+
}
|
872
|
+
|
873
|
+
header {
|
874
|
+
position: relative;
|
875
|
+
background-color: #36a483;
|
876
|
+
color: white;
|
877
|
+
border-radius: calc(${n}) calc(${n}) 0 0;
|
878
|
+
border: ${o};
|
879
|
+
border-bottom: 0;
|
880
|
+
text-align: center;
|
881
|
+
padding-bottom: ${s};
|
882
|
+
}
|
883
|
+
|
884
|
+
.title {
|
885
|
+
margin: 0;
|
886
|
+
padding: 0;
|
887
|
+
font-size: ${u};
|
888
|
+
font-weight: bold;
|
889
|
+
line-height: ${p};
|
890
|
+
}
|
891
|
+
|
892
|
+
.subtitle {
|
893
|
+
margin: 0;
|
894
|
+
padding: 0;
|
895
|
+
font-weight: normal;
|
896
|
+
padding-top: 0;
|
897
|
+
font-size: ${d};
|
898
|
+
line-height: ${m};
|
899
|
+
}
|
900
|
+
|
901
|
+
.modal-body {
|
902
|
+
background-color: #f5f5f7;
|
903
|
+
border-radius: 0 0 calc(${n}) calc(${n});
|
904
|
+
border: ${o};
|
905
|
+
border-top: 0;
|
906
|
+
padding: 0 1rem calc(${l} - ${c}) 1rem;
|
907
|
+
color: #333;
|
908
|
+
margin-bottom: 2.5rem;
|
909
|
+
min-height: 5rem;
|
910
|
+
}
|
911
|
+
|
912
|
+
.content {
|
913
|
+
overflow-y: auto;
|
914
|
+
max-height: calc(100vh - (16.5rem + ${i}));
|
915
|
+
min-height: 5rem;
|
916
|
+
padding: 0 0 calc(${c}) 0;
|
917
|
+
}
|
918
|
+
|
919
|
+
.headline {
|
920
|
+
font-size: ${h};
|
921
|
+
font-weight: bold;
|
922
|
+
text-align: center;
|
923
|
+
line-height: ${v};
|
924
|
+
margin: 0;
|
925
|
+
padding: 0;
|
926
|
+
}
|
927
|
+
|
928
|
+
.message {
|
929
|
+
margin: 1rem 0 0 0;
|
930
|
+
text-align: center;
|
931
|
+
font-size: ${f};
|
932
|
+
line-height: ${y};
|
933
|
+
}
|
934
|
+
|
935
|
+
.logo-icon {
|
936
|
+
border-radius: 100%;
|
937
|
+
border: 3px solid #fff;
|
938
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18),
|
939
|
+
0 2px 2px 0 rgba(0, 0, 0, 0.08);
|
940
|
+
width: ${e};
|
941
|
+
height: ${e};
|
942
|
+
margin: -2.9rem auto 0.5rem auto;
|
943
|
+
background-color: black;
|
944
|
+
display: flex;
|
945
|
+
justify-content: center;
|
946
|
+
align-items: center;
|
947
|
+
}
|
948
|
+
|
949
|
+
.logo-icon svg {
|
950
|
+
width: calc(${e} * 0.65);
|
951
|
+
height: calc(${e} * 0.65);
|
952
|
+
}
|
953
|
+
|
954
|
+
.logo-icon svg .fill-color {
|
955
|
+
fill: white;
|
956
|
+
}
|
957
|
+
|
958
|
+
.logo-icon svg .stroke-color {
|
959
|
+
stroke: red;
|
960
|
+
}
|
961
|
+
|
962
|
+
.close-button {
|
963
|
+
position: absolute;
|
964
|
+
right: 1.2rem;
|
965
|
+
top: 1.2rem;
|
966
|
+
width: 2rem;
|
967
|
+
height: 2rem;
|
968
|
+
border-radius: 100%;
|
969
|
+
border: 0;
|
970
|
+
padding: 0;
|
971
|
+
cursor: pointer;
|
972
|
+
background-color: white;
|
973
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18),
|
974
|
+
0 4px 4px 0 rgba(0, 0, 0, 0.08);
|
975
|
+
}
|
976
|
+
`}};o([(0,s.Cb)({type:Object})],K.prototype,"config",void 0),K=o([(0,s.Mo)("modal-template")],K);var ee,te=n(3774);!function(e){e.Open="open",e.Closed="closed"}(ee||(ee={}));class ne{constructor(e){this.windowResizeThrottler=(0,te.throttle)(100,!1,this.updateModalContainerHeight).bind(this),this.modalManager=e}handleModeChange(e){switch(e){case ee.Open:this.startResizeListener(),this.stopDocumentScroll();break;case ee.Closed:this.stopResizeListener(),this.resumeDocumentScroll()}}updateModalContainerHeight(){this.modalManager.style.setProperty("--containerHeight",`${window.innerHeight}px`)}stopDocumentScroll(){document.body.classList.add("modal-manager-open")}resumeDocumentScroll(){document.body.classList.remove("modal-manager-open")}startResizeListener(){window.addEventListener("resize",this.windowResizeThrottler)}stopResizeListener(){window.removeEventListener("resize",this.windowResizeThrottler)}}let re=class extends r.oi{constructor(){super(...arguments),this.mode=ee.Closed,this.hostBridge=new ne(this),this.closeOnBackdropClick=!0}render(){return r.dy`
|
977
|
+
<div class="container">
|
978
|
+
<div class="backdrop" @click=${this.backdropClicked}></div>
|
979
|
+
<modal-template
|
980
|
+
@closeButtonPressed=${this.closeButtonPressed}
|
981
|
+
tabindex="0"
|
982
|
+
>
|
983
|
+
${this.customModalContent}
|
984
|
+
</modal-template>
|
985
|
+
</div>
|
986
|
+
`}getMode(){return this.mode}closeModal(){this.mode=ee.Closed}callUserClosedModalCallback(){const e=this.userClosedModalCallback;this.userClosedModalCallback=void 0,e&&e()}showModal(e){return t=this,n=void 0,o=function*(){this.closeOnBackdropClick=e.config.closeOnBackdropClick,this.userClosedModalCallback=e.userClosedModalCallback,this.modalTemplate.config=e.config,this.customModalContent=e.customModalContent,this.mode=ee.Open,yield this.modalTemplate.updateComplete,this.modalTemplate.focus()},new((r=void 0)||(r=Promise))((function(e,i){function a(e){try{l(o.next(e))}catch(e){i(e)}}function s(e){try{l(o.throw(e))}catch(e){i(e)}}function l(t){var n;t.done?e(t.value):(n=t.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,s)}l((o=o.apply(t,n||[])).next())}));var t,n,r,o}updated(e){e.has("mode")&&this.handleModeChange()}backdropClicked(){this.closeOnBackdropClick&&(this.closeModal(),this.callUserClosedModalCallback())}handleModeChange(){this.hostBridge.handleModeChange(this.mode),this.emitModeChangeEvent()}emitModeChangeEvent(){const e=new CustomEvent("modeChanged",{detail:{mode:this.mode}});this.dispatchEvent(e)}closeButtonPressed(){this.closeModal(),this.callUserClosedModalCallback()}static get styles(){const e=r.iv`var(--modalBackdropColor, rgba(10, 10, 10, 0.9))`,t=r.iv`var(--modalBackdropZindex, 1000)`,n=r.iv`var(--modalWidth, 32rem)`,o=r.iv`var(--modalMaxWidth, 95%)`,i=r.iv`var(--modalZindex, 2000)`;return r.iv`
|
987
|
+
.container {
|
988
|
+
width: 100%;
|
989
|
+
height: 100%;
|
990
|
+
}
|
991
|
+
|
992
|
+
.backdrop {
|
993
|
+
position: fixed;
|
994
|
+
top: 0;
|
995
|
+
left: 0;
|
996
|
+
background-color: ${e};
|
997
|
+
width: 100%;
|
998
|
+
height: 100%;
|
999
|
+
z-index: ${t};
|
1000
|
+
}
|
1001
|
+
|
1002
|
+
modal-template {
|
1003
|
+
outline: 0;
|
1004
|
+
position: fixed;
|
1005
|
+
top: 0;
|
1006
|
+
left: 50%;
|
1007
|
+
transform: translate(-50%, 0);
|
1008
|
+
z-index: ${i};
|
1009
|
+
width: ${n};
|
1010
|
+
max-width: ${o};
|
1011
|
+
}
|
1012
|
+
`}};o([(0,s.Cb)({type:String,reflect:!0})],re.prototype,"mode",void 0),o([(0,s.Cb)({type:Object})],re.prototype,"customModalContent",void 0),o([(0,s.Cb)({type:Object})],re.prototype,"hostBridge",void 0),o([(0,s.IO)("modal-template")],re.prototype,"modalTemplate",void 0),re=o([(0,s.Mo)("modal-manager")],re),n(4723);var oe=r.dy`
|
1013
|
+
<svg
|
1014
|
+
viewBox="0 0 100 100"
|
1015
|
+
xmlns="http://www.w3.org/2000/svg"
|
1016
|
+
aria-labelledby="searchTitleID searchDescID"
|
1017
|
+
>
|
1018
|
+
<title id="searchTitleID">Search icon</title>
|
1019
|
+
<desc id="searchDescID">Search for something.</desc>
|
1020
|
+
<path
|
1021
|
+
class="fill-color"
|
1022
|
+
fill="none"
|
1023
|
+
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" />
|
1024
|
+
</svg>
|
1025
|
+
`;class ie extends r.oi{static get styles(){return r.iv`
|
1026
|
+
:host {
|
1027
|
+
width: var(--iconWidth, 'auto');
|
1028
|
+
height: var(--iconHeight, 'auto');
|
1029
|
+
}
|
1030
|
+
|
1031
|
+
.fill-color {
|
1032
|
+
fill: var(--iconFillColor);
|
1033
|
+
}
|
1034
|
+
|
1035
|
+
.stroke-color {
|
1036
|
+
stroke: var(--iconStrokeColor);
|
1037
|
+
}
|
1038
|
+
`}render(){return oe}}customElements.define("ia-icon-search",ie),n(1249),n(6644),n(189),n(4819),n(4129),n(1532),n(9600),n(9601);var ae="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,se=function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;t!==n;){var r=t.nextSibling;e.removeChild(t),t=r}};function le(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,r.key,r)}}function ce(e,t,n){return t&&le(e.prototype,t),n&&le(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}n(4603),n(9714),n(3123);var ue="{{lit-".concat(String(Math.random()).slice(2),"}}"),de="\x3c!--".concat(ue,"--\x3e"),he=new RegExp("".concat(ue,"|").concat(de)),fe="$lit$",pe=ce((function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parts=[],this.element=n;for(var r=[],o=[],i=document.createTreeWalker(n.content,133,null,!1),a=0,s=-1,l=0,c=t.strings,u=t.values.length;l<u;){var d=i.nextNode();if(null!==d){if(s++,1===d.nodeType){if(d.hasAttributes()){for(var h=d.attributes,f=h.length,p=0,m=0;m<f;m++)me(h[m].name,fe)&&p++;for(;p-- >0;){var v=c[l],y=be.exec(v)[2],b=y.toLowerCase()+fe,g=d.getAttribute(b);d.removeAttribute(b);var k=g.split(he);this.parts.push({type:"attribute",index:s,name:y,strings:k}),l+=k.length-1}}"TEMPLATE"===d.tagName&&(o.push(d),i.currentNode=d.content)}else if(3===d.nodeType){var w=d.data;if(w.indexOf(ue)>=0){for(var S=d.parentNode,C=w.split(he),O=C.length-1,x=0;x<O;x++){var _=void 0,j=C[x];if(""===j)_=ye();else{var P=be.exec(j);null!==P&&me(P[2],fe)&&(j=j.slice(0,P.index)+P[1]+P[2].slice(0,-fe.length)+P[3]),_=document.createTextNode(j)}S.insertBefore(_,d),this.parts.push({type:"node",index:++s})}""===C[O]?(S.insertBefore(ye(),d),r.push(d)):d.data=C[O],l+=O}}else if(8===d.nodeType)if(d.data===ue){var B=d.parentNode;null!==d.previousSibling&&s!==a||(s++,B.insertBefore(ye(),d)),a=s,this.parts.push({type:"node",index:s}),null===d.nextSibling?d.data="":(r.push(d),s--),l++}else for(var E=-1;-1!==(E=d.data.indexOf(ue,E+1));)this.parts.push({type:"node",index:-1}),l++}else i.currentNode=o.pop()}for(var I=0,L=r;I<L.length;I++){var M=L[I];M.parentNode.removeChild(M)}})),me=function(e,t){var n=e.length-t.length;return n>=0&&e.slice(n)===t},ve=function(e){return-1!==e.index},ye=function(){return document.createComment("")},be=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/,ge=133;function ke(e,t){for(var n=e.element.content,r=e.parts,o=document.createTreeWalker(n,ge,null,!1),i=Se(r),a=r[i],s=-1,l=0,c=[],u=null;o.nextNode();){s++;var d=o.currentNode;for(d.previousSibling===u&&(u=null),t.has(d)&&(c.push(d),null===u&&(u=d)),null!==u&&l++;void 0!==a&&a.index===s;)a.index=null!==u?-1:a.index-l,a=r[i=Se(r,i)]}c.forEach((function(e){return e.parentNode.removeChild(e)}))}var we=function(e){for(var t=11===e.nodeType?0:1,n=document.createTreeWalker(e,ge,null,!1);n.nextNode();)t++;return t},Se=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,n=t+1;n<e.length;n++){var r=e[n];if(ve(r))return n}return-1},Ce=new WeakMap,Oe=function(e){return"function"==typeof e&&Ce.has(e)},xe={},_e={};function je(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Pe(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Pe(e,t){if(e){if("string"==typeof e)return Be(e,t);var n=Object.prototype.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)?Be(e,t):void 0}}function Be(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ee(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,r.key,r)}}var Ie=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.__parts=[],this.template=t,this.processor=n,this.options=r}var t,n;return t=e,(n=[{key:"update",value:function(e){var t,n=0,r=je(this.__parts);try{for(r.s();!(t=r.n()).done;){var o=t.value;void 0!==o&&o.setValue(e[n]),n++}}catch(e){r.e(e)}finally{r.f()}var i,a=je(this.__parts);try{for(a.s();!(i=a.n()).done;){var s=i.value;void 0!==s&&s.commit()}}catch(e){a.e(e)}finally{a.f()}}},{key:"_clone",value:function(){for(var e,t=ae?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),n=[],r=this.template.parts,o=document.createTreeWalker(t,133,null,!1),i=0,a=0,s=o.nextNode();i<r.length;)if(e=r[i],ve(e)){for(;a<e.index;)a++,"TEMPLATE"===s.nodeName&&(n.push(s),o.currentNode=s.content),null===(s=o.nextNode())&&(o.currentNode=n.pop(),s=o.nextNode());if("node"===e.type){var l=this.processor.handleTextExpression(this.options);l.insertAfterNode(s.previousSibling),this.__parts.push(l)}else{var c;(c=this.__parts).push.apply(c,function(e){if(Array.isArray(e))return Be(e)}(u=this.processor.handleAttributeExpressions(s,e.name,e.strings,this.options))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(u)||Pe(u)||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.")}())}i++}else this.__parts.push(void 0),i++;var u;return ae&&(document.adoptNode(t),customElements.upgrade(t)),t}}])&&Ee(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Le(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,r.key,r)}}var Me=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:function(e){return e}}),Ae=" ".concat(ue," "),Te=function(){function e(t,n,r,o){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.strings=t,this.values=n,this.type=r,this.processor=o}return t=e,(n=[{key:"getHTML",value:function(){for(var e=this.strings.length-1,t="",n=!1,r=0;r<e;r++){var o=this.strings[r],i=o.lastIndexOf("\x3c!--");n=(i>-1||n)&&-1===o.indexOf("--\x3e",i+1);var a=be.exec(o);t+=null===a?o+(n?Ae:de):o.substr(0,a.index)+a[1]+a[2]+fe+a[3]+ue}return t+this.strings[e]}},{key:"getTemplateElement",value:function(){var e=document.createElement("template"),t=this.getHTML();return void 0!==Me&&(t=Me.createHTML(t)),e.innerHTML=t,e}}])&&Le(t.prototype,n),r&&Le(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e;var t,n,r}();function ze(){return(ze="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=Re(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}}).apply(this,arguments)}function Re(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Fe(e)););return e}function De(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$e(e,t)}function $e(e,t){return($e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ne(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Fe(e);if(t){var o=Fe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return He(this,n)}}function He(e,t){if(t&&("object"===Ge(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Fe(e){return(Fe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ue(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return Ve(e,t);var n=Object.prototype.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)?Ve(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}function Ve(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function We(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,r.key,r)}}function Ze(e,t,n){return t&&We(e.prototype,t),n&&We(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ge(e){return(Ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Je=function(e){return null===e||!("object"===Ge(e)||"function"==typeof e)},Ye=function(e){return Array.isArray(e)||!(!e||!e[Symbol.iterator])},Xe=function(){function e(t,n,r){qe(this,e),this.dirty=!0,this.element=t,this.name=n,this.strings=r,this.parts=[];for(var o=0;o<r.length-1;o++)this.parts[o]=this._createPart()}return Ze(e,[{key:"_createPart",value:function(){return new Qe(this)}},{key:"_getValue",value:function(){var e=this.strings,t=e.length-1,n=this.parts;if(1===t&&""===e[0]&&""===e[1]){var r=n[0].value;if("symbol"===Ge(r))return String(r);if("string"==typeof r||!Ye(r))return r}for(var o="",i=0;i<t;i++){o+=e[i];var a=n[i];if(void 0!==a){var s=a.value;if(Je(s)||!Ye(s))o+="string"==typeof s?s:String(s);else{var l,c=Ue(s);try{for(c.s();!(l=c.n()).done;){var u=l.value;o+="string"==typeof u?u:String(u)}}catch(e){c.e(e)}finally{c.f()}}}}return o+e[t]}},{key:"commit",value:function(){this.dirty&&(this.dirty=!1,this.element.setAttribute(this.name,this._getValue()))}}]),e}(),Qe=function(){function e(t){qe(this,e),this.value=void 0,this.committer=t}return Ze(e,[{key:"setValue",value:function(e){e===xe||Je(e)&&e===this.value||(this.value=e,Oe(e)||(this.committer.dirty=!0))}},{key:"commit",value:function(){for(;Oe(this.value);){var e=this.value;this.value=xe,e(this)}this.value!==xe&&this.committer.commit()}}]),e}(),Ke=function(){function e(t){qe(this,e),this.value=void 0,this.__pendingValue=void 0,this.options=t}return Ze(e,[{key:"appendInto",value:function(e){this.startNode=e.appendChild(ye()),this.endNode=e.appendChild(ye())}},{key:"insertAfterNode",value:function(e){this.startNode=e,this.endNode=e.nextSibling}},{key:"appendIntoPart",value:function(e){e.__insert(this.startNode=ye()),e.__insert(this.endNode=ye())}},{key:"insertAfterPart",value:function(e){e.__insert(this.startNode=ye()),this.endNode=e.endNode,e.endNode=this.startNode}},{key:"setValue",value:function(e){this.__pendingValue=e}},{key:"commit",value:function(){if(null!==this.startNode.parentNode){for(;Oe(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=xe,e(this)}var t=this.__pendingValue;t!==xe&&(Je(t)?t!==this.value&&this.__commitText(t):t instanceof Te?this.__commitTemplateResult(t):t instanceof Node?this.__commitNode(t):Ye(t)?this.__commitIterable(t):t===_e?(this.value=_e,this.clear()):this.__commitText(t))}}},{key:"__insert",value:function(e){this.endNode.parentNode.insertBefore(e,this.endNode)}},{key:"__commitNode",value:function(e){this.value!==e&&(this.clear(),this.__insert(e),this.value=e)}},{key:"__commitText",value:function(e){var t=this.startNode.nextSibling,n="string"==typeof(e=null==e?"":e)?e:String(e);t===this.endNode.previousSibling&&3===t.nodeType?t.data=n:this.__commitNode(document.createTextNode(n)),this.value=e}},{key:"__commitTemplateResult",value:function(e){var t=this.options.templateFactory(e);if(this.value instanceof Ie&&this.value.template===t)this.value.update(e.values);else{var n=new Ie(t,e.processor,this.options),r=n._clone();n.update(e.values),this.__commitNode(r),this.value=n}}},{key:"__commitIterable",value:function(t){Array.isArray(this.value)||(this.value=[],this.clear());var n,r,o=this.value,i=0,a=Ue(t);try{for(a.s();!(r=a.n()).done;){var s=r.value;void 0===(n=o[i])&&(n=new e(this.options),o.push(n),0===i?n.appendIntoPart(this):n.insertAfterPart(o[i-1])),n.setValue(s),n.commit(),i++}}catch(e){a.e(e)}finally{a.f()}i<o.length&&(o.length=i,this.clear(n&&n.endNode))}},{key:"clear",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.startNode;se(this.startNode.parentNode,e.nextSibling,this.endNode)}}]),e}(),et=function(){function e(t,n,r){if(qe(this,e),this.value=void 0,this.__pendingValue=void 0,2!==r.length||""!==r[0]||""!==r[1])throw new Error("Boolean attributes can only contain a single expression");this.element=t,this.name=n,this.strings=r}return Ze(e,[{key:"setValue",value:function(e){this.__pendingValue=e}},{key:"commit",value:function(){for(;Oe(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=xe,e(this)}if(this.__pendingValue!==xe){var t=!!this.__pendingValue;this.value!==t&&(t?this.element.setAttribute(this.name,""):this.element.removeAttribute(this.name),this.value=t),this.__pendingValue=xe}}}]),e}(),tt=function(e){De(n,e);var t=Ne(n);function n(e,r,o){var i;return qe(this,n),(i=t.call(this,e,r,o)).single=2===o.length&&""===o[0]&&""===o[1],i}return Ze(n,[{key:"_createPart",value:function(){return new nt(this)}},{key:"_getValue",value:function(){return this.single?this.parts[0].value:ze(Fe(n.prototype),"_getValue",this).call(this)}},{key:"commit",value:function(){this.dirty&&(this.dirty=!1,this.element[this.name]=this._getValue())}}]),n}(Xe),nt=function(e){De(n,e);var t=Ne(n);function n(){return qe(this,n),t.apply(this,arguments)}return Ze(n)}(Qe),rt=!1;!function(){try{var e={get capture(){return rt=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}}();var ot=function(){function e(t,n,r){var o=this;qe(this,e),this.value=void 0,this.__pendingValue=void 0,this.element=t,this.eventName=n,this.eventContext=r,this.__boundHandleEvent=function(e){return o.handleEvent(e)}}return Ze(e,[{key:"setValue",value:function(e){this.__pendingValue=e}},{key:"commit",value:function(){for(;Oe(this.__pendingValue);){var e=this.__pendingValue;this.__pendingValue=xe,e(this)}if(this.__pendingValue!==xe){var t=this.__pendingValue,n=this.value,r=null==t||null!=n&&(t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive),o=null!=t&&(null==n||r);r&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),o&&(this.__options=it(t),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=t,this.__pendingValue=xe}}},{key:"handleEvent",value:function(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}]),e}(),it=function(e){return e&&(rt?{capture:e.capture,passive:e.passive,once:e.once}:e.capture)};function at(e){var t=st.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},st.set(e.type,t));var n=t.stringsArray.get(e.strings);if(void 0!==n)return n;var r=e.strings.join(ue);return void 0===(n=t.keyString.get(r))&&(n=new pe(e,e.getTemplateElement()),t.keyString.set(r,n)),t.stringsArray.set(e.strings,n),n}var st=new Map,lt=new WeakMap;function ct(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,r.key,r)}}var ut=new(function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n;return t=e,(n=[{key:"handleAttributeExpressions",value:function(e,t,n,r){var o=t[0];return"."===o?new tt(e,t.slice(1),n).parts:"@"===o?[new ot(e,t.slice(1),r.eventContext)]:"?"===o?[new et(e,t.slice(1),n)]:new Xe(e,t,n).parts}},{key:"handleTextExpression",value:function(e){return new Ke(e)}}])&&ct(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}());"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");var dt=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new Te(e,n,"html",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})(e)}var ft=function(e,t){return"".concat(e,"--").concat(t)},pt=!0;void 0===window.ShadyCSS?pt=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),pt=!1);var mt=function(e){return function(t){var n=ft(t.type,e),r=st.get(n);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},st.set(n,r));var o=r.stringsArray.get(t.strings);if(void 0!==o)return o;var i=t.strings.join(ue);if(void 0===(o=r.keyString.get(i))){var a=t.getTemplateElement();pt&&window.ShadyCSS.prepareTemplateDom(a,e),o=new pe(t,a),r.keyString.set(i,o)}return r.stringsArray.set(t.strings,o),o}},vt=["html","svg"],yt=new Set;function bt(e){return function(e){if(Array.isArray(e))return kt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||gt(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 gt(e,t){if(e){if("string"==typeof e)return kt(e,t);var n=Object.prototype.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)?kt(e,t):void 0}}function kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}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})(e)}function St(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 Ct(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,r.key,r)}}function Ot(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)}function xt(e){var t="function"==typeof Map?new Map:void 0;return(xt=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _t(e,arguments,Bt(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),Pt(r,e)})(e)}function _t(e,t,n){return(_t=jt()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Pt(o,n.prototype),o}).apply(null,arguments)}function jt(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Pt(e,t){return(Pt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Bt(e){return(Bt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}n(5666),n(9653),n(8674),n(6210),window.JSCompiler_renameProperty=function(e,t){return e};var Et={toAttribute:function(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute:function(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},It=function(e,t){return t!==e&&(t==t||e==e)},Lt={attribute:!0,type:String,converter:Et,reflect:!1,hasChanged:It},Mt=function(e){!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&&Pt(e,t)}(c,e);var t,n,r,o,i,a,s,l=(t=c,n=jt(),function(){var e,r=Bt(t);if(n){var o=Bt(this).constructor;e=Reflect.construct(r,arguments,o)}else e=r.apply(this,arguments);return Ot(this,e)});function c(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(e=l.call(this)).initialize(),e}return r=c,i=[{key:"observedAttributes",get:function(){var e=this;this.finalize();var t=[];return this._classProperties.forEach((function(n,r){var o=e._attributeNameForProperty(r,n);void 0!==o&&(e._attributeToPropertyMap.set(o,r),t.push(o))})),t}},{key:"_ensureClassProperties",value:function(){var e=this;if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;var t=Object.getPrototypeOf(this)._classProperties;void 0!==t&&t.forEach((function(t,n){return e._classProperties.set(n,t)}))}}},{key:"createProperty",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Lt;if(this._ensureClassProperties(),this._classProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){var n="symbol"===wt(e)?Symbol():"__".concat(e),r=this.getPropertyDescriptor(e,n,t);void 0!==r&&Object.defineProperty(this.prototype,e,r)}}},{key:"getPropertyDescriptor",value:function(e,t,n){return{get:function(){return this[t]},set:function(r){var o=this[e];this[t]=r,this.requestUpdateInternal(e,o,n)},configurable:!0,enumerable:!0}}},{key:"getPropertyOptions",value:function(e){return this._classProperties&&this._classProperties.get(e)||Lt}},{key:"finalize",value:function(){var e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){var t,n=this.properties,r=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=gt(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}([].concat(bt(Object.getOwnPropertyNames(n)),bt("function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(n):[])));try{for(r.s();!(t=r.n()).done;){var o=t.value;this.createProperty(o,n[o])}}catch(e){r.e(e)}finally{r.f()}}}},{key:"_attributeNameForProperty",value:function(e,t){var n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}},{key:"_valueHasChanged",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:It;return n(e,t)}},{key:"_propertyValueFromAttribute",value:function(e,t){var n=t.type,r=t.converter||Et,o="function"==typeof r?r:r.fromAttribute;return o?o(e,n):e}},{key:"_propertyValueToAttribute",value:function(e,t){if(void 0!==t.reflect){var n=t.type,r=t.converter;return(r&&r.toAttribute||Et.toAttribute)(e,n)}}}],(o=[{key:"initialize",value:function(){var e=this;this._updateState=0,this._updatePromise=new Promise((function(t){return e._enableUpdatingResolver=t})),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}},{key:"_saveInstanceProperties",value:function(){var e=this;this.constructor._classProperties.forEach((function(t,n){if(e.hasOwnProperty(n)){var r=e[n];delete e[n],e._instanceProperties||(e._instanceProperties=new Map),e._instanceProperties.set(n,r)}}))}},{key:"_applyInstanceProperties",value:function(){var e=this;this._instanceProperties.forEach((function(t,n){return e[n]=t})),this._instanceProperties=void 0}},{key:"connectedCallback",value:function(){this.enableUpdating()}},{key:"enableUpdating",value:function(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}},{key:"disconnectedCallback",value:function(){}},{key:"attributeChangedCallback",value:function(e,t,n){t!==n&&this._attributeToProperty(e,n)}},{key:"_propertyToAttribute",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Lt,r=this.constructor,o=r._attributeNameForProperty(e,n);if(void 0!==o){var i=r._propertyValueToAttribute(t,n);if(void 0===i)return;this._updateState=8|this._updateState,null==i?this.removeAttribute(o):this.setAttribute(o,i),this._updateState=-9&this._updateState}}},{key:"_attributeToProperty",value:function(e,t){if(!(8&this._updateState)){var n=this.constructor,r=n._attributeToPropertyMap.get(e);if(void 0!==r){var o=n.getPropertyOptions(r);this._updateState=16|this._updateState,this[r]=n._propertyValueFromAttribute(t,o),this._updateState=-17&this._updateState}}}},{key:"requestUpdateInternal",value:function(e,t,n){var r=!0;if(void 0!==e){var o=this.constructor;n=n||o.getPropertyOptions(e),o._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==n.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):r=!1}!this._hasRequestedUpdate&&r&&(this._updatePromise=this._enqueueUpdate())}},{key:"requestUpdate",value:function(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}},{key:"_enqueueUpdate",value:(a=regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._updateState=4|this._updateState,e.prev=1,e.next=4,this._updatePromise;case 4:e.next=8;break;case 6:e.prev=6,e.t0=e.catch(1);case 8:if(null==(t=this.performUpdate())){e.next=12;break}return e.next=12,t;case 12:return e.abrupt("return",!this._hasRequestedUpdate);case 13:case"end":return e.stop()}}),e,this,[[1,6]])})),s=function(){var e=this,t=arguments;return new Promise((function(n,r){var o=a.apply(e,t);function i(e){St(o,n,r,i,s,"next",e)}function s(e){St(o,n,r,i,s,"throw",e)}i(void 0)}))},function(){return s.apply(this,arguments)})},{key:"_hasRequestedUpdate",get:function(){return 4&this._updateState}},{key:"hasUpdated",get:function(){return 1&this._updateState}},{key:"performUpdate",value:function(){if(this._hasRequestedUpdate){this._instanceProperties&&this._applyInstanceProperties();var e=!1,t=this._changedProperties;try{(e=this.shouldUpdate(t))?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}}},{key:"_markUpdated",value:function(){this._changedProperties=new Map,this._updateState=-5&this._updateState}},{key:"updateComplete",get:function(){return this._getUpdateComplete()}},{key:"_getUpdateComplete",value:function(){return this.getUpdateComplete()}},{key:"getUpdateComplete",value:function(){return this._updatePromise}},{key:"shouldUpdate",value:function(e){return!0}},{key:"update",value:function(e){var t=this;void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((function(e,n){return t._propertyToAttribute(n,t[n],e)})),this._reflectingProperties=void 0),this._markUpdated()}},{key:"updated",value:function(e){}},{key:"firstUpdated",value:function(e){}}])&&Ct(r.prototype,o),i&&Ct(r,i),Object.defineProperty(r,"prototype",{writable:!1}),c}(xt(HTMLElement));Mt.finalized=!0;var At=Element.prototype;function Tt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}At.msMatchesSelector||At.webkitMatchesSelector;var zt=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Rt=Symbol(),Dt=function(){function e(t,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),n!==Rt)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}var t,n;return t=e,(n=[{key:"styleSheet",get:function(){return void 0===this._styleSheet&&(zt?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}},{key:"toString",value:function(){return this.cssText}}])&&Tt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),$t=function(e){if(e instanceof Dt)return e.cssText;if("number"==typeof e)return e;throw new Error("Value passed to 'css' function must be a 'css' function result: ".concat(e,". Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security."))},Nt=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=n.reduce((function(t,n,r){return t+$t(n)+e[r+1]}),e[0]);return new Dt(o,Rt)};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})(e)}function Ft(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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,r.key,r)}}function Vt(){return(Vt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=qt(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}}).apply(this,arguments)}function qt(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Gt(e)););return e}function Wt(e,t){return(Wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zt(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)}function Gt(e){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}(window.litElementVersions||(window.litElementVersions=[])).push("2.5.1");var Jt={},Yt=function(e){!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&&Wt(e,t)}(s,e);var t,n,r,o,i,a=(o=s,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Gt(o);if(i){var n=Gt(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Zt(this,e)});function s(){return Ft(this,s),a.apply(this,arguments)}return t=s,r=[{key:"getStyles",value:function(){return this.styles}},{key:"_getUniqueStyles",value:function(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_styles",this))){var e=this.getStyles();if(Array.isArray(e)){var t=function e(t,n){return t.reduceRight((function(t,n){return Array.isArray(n)?e(n,t):(t.add(n),t)}),n)}(e,new Set),n=[];t.forEach((function(e){return n.unshift(e)})),this._styles=n}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map((function(e){if(e instanceof CSSStyleSheet&&!zt){var t=Array.prototype.slice.call(e.cssRules).reduce((function(e,t){return e+t.cssText}),"");return new Dt(String(t),Rt)}return e}))}}}],(n=[{key:"initialize",value:function(){Vt(Gt(s.prototype),"initialize",this).call(this),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}},{key:"createRenderRoot",value:function(){return this.attachShadow(this.constructor.shadowRootOptions)}},{key:"adoptStyles",value:function(){var e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?zt?this.renderRoot.adoptedStyleSheets=e.map((function(e){return e instanceof CSSStyleSheet?e:e.styleSheet})):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map((function(e){return e.cssText})),this.localName))}},{key:"connectedCallback",value:function(){Vt(Gt(s.prototype),"connectedCallback",this).call(this),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}},{key:"update",value:function(e){var t=this,n=this.render();Vt(Gt(s.prototype),"update",this).call(this,e),n!==Jt&&this.constructor.render(n,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach((function(e){var n=document.createElement("style");n.textContent=e.cssText,t.renderRoot.appendChild(n)})))}},{key:"render",value:function(){return Jt}}])&&Ut(t.prototype,n),r&&Ut(t,r),Object.defineProperty(t,"prototype",{writable:!1}),s}(Mt);Yt.finalized=!0,Yt.render=function(e,t,n){if(!n||"object"!==ht(n)||!n.scopeName)throw new Error("The `scopeName` option is required.");var r=n.scopeName,o=lt.has(t),i=pt&&11===t.nodeType&&!!t.host,a=i&&!yt.has(r),s=a?document.createDocumentFragment():t;if(function(e,t,n){var r=lt.get(t);void 0===r&&(se(t,t.firstChild),lt.set(t,r=new Ke(Object.assign({templateFactory:at},n))),r.appendInto(t)),r.setValue(e),r.commit()}(e,s,Object.assign({templateFactory:mt(r)},n)),a){var l=lt.get(s);lt.delete(s),function(e,t,n){yt.add(e);var r=n?n.element:document.createElement("template"),o=t.querySelectorAll("style"),i=o.length;if(0!==i){for(var a=document.createElement("style"),s=0;s<i;s++){var l=o[s];l.parentNode.removeChild(l),a.textContent+=l.textContent}!function(e){vt.forEach((function(t){var n=st.get(ft(t,e));void 0!==n&&n.keyString.forEach((function(e){var t=e.element.content,n=new Set;Array.from(t.querySelectorAll("style")).forEach((function(e){n.add(e)})),ke(e,n)}))}))}(e);var c=r.content;n?function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=e.element.content,o=e.parts;if(null!=n)for(var i=document.createTreeWalker(r,ge,null,!1),a=Se(o),s=0,l=-1;i.nextNode();)for(l++,i.currentNode===n&&(s=we(t),n.parentNode.insertBefore(t,n));-1!==a&&o[a].index===l;){if(s>0){for(;-1!==a;)o[a].index+=s,a=Se(o,a);return}a=Se(o,a)}else r.appendChild(t)}(n,a,c.firstChild):c.insertBefore(a,c.firstChild),window.ShadyCSS.prepareTemplateStyles(r,e);var u=c.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==u)t.insertBefore(u.cloneNode(!0),t.firstChild);else if(n){c.insertBefore(a,c.firstChild);var d=new Set;d.add(a),ke(n,d)}}else window.ShadyCSS.prepareTemplateStyles(r,e)}(r,s,l.value instanceof Ie?l.value.template:void 0),se(t,t.firstChild),t.appendChild(s),lt.set(t,l)}!o&&i&&window.ShadyCSS.styleElement(t.host)},Yt.shadowRootOptions={mode:"open"};const Xt=Object.freeze({processing:"processing",complete:"complete"});window.customElements.define("ia-activity-indicator",class extends Yt{static get properties(){return{mode:{type:String}}}constructor(){super(),this.mode=Xt.processing}render(){return dt`
|
1039
|
+
<div class="${this.mode}">
|
1040
|
+
<svg
|
1041
|
+
viewBox="0 0 120 120"
|
1042
|
+
preserveAspectRatio="none"
|
1043
|
+
version="1.1"
|
1044
|
+
xmlns="http://www.w3.org/2000/svg"
|
1045
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
1046
|
+
aria-labelledby="indicatorTitle indicatorDescription"
|
1047
|
+
>
|
1048
|
+
<title id="indicatorTitle">Activity Indicator</title>
|
1049
|
+
<desc id="indicatorDescription">
|
1050
|
+
A rotating activity indicator with three dots in the middle.
|
1051
|
+
</desc>
|
1052
|
+
<g
|
1053
|
+
id="icons/check-ring---squared"
|
1054
|
+
stroke="none"
|
1055
|
+
stroke-width="1"
|
1056
|
+
fill="none"
|
1057
|
+
fill-rule="evenodd"
|
1058
|
+
>
|
1059
|
+
<path
|
1060
|
+
id="completed-ring"
|
1061
|
+
class="loaded-indicator"
|
1062
|
+
d="M60,10 C70.5816709,10 80.3955961,13.2871104 88.4763646,18.8959201 L78.3502633,29.0214223 C72.9767592,25.8315427 66.7022695,24 60,24 C40.117749,24 24,40.117749 24,60 C24,79.882251 40.117749,96 60,96 C79.882251,96 96,79.882251 96,60 L95.995,59.46 L108.327675,47.128668 C109.350926,50.9806166 109.925886,55.015198 109.993301,59.1731586 L110,60 C110,87.6142375 87.6142375,110 60,110 C32.3857625,110 10,87.6142375 10,60 C10,32.3857625 32.3857625,10 60,10 Z"
|
1063
|
+
></path>
|
1064
|
+
<polygon
|
1065
|
+
id="check"
|
1066
|
+
class="loaded-indicator"
|
1067
|
+
transform="translate(75.000000, 41.500000) rotate(44.000000) translate(-75.000000, -41.500000) "
|
1068
|
+
points="96 85 54 85 54 65 76 64.999 76 -2 96 -2"
|
1069
|
+
></polygon>
|
1070
|
+
<path
|
1071
|
+
id="activity-ring"
|
1072
|
+
class="activity-indicator"
|
1073
|
+
d="M60,10 C69.8019971,10 78.9452178,12.8205573 86.6623125,17.6943223 L76.4086287,27.9484118 C71.4880919,25.4243078 65.9103784,24 60,24 C40.117749,24 24,40.117749 24,60 C24,79.882251 40.117749,96 60,96 C79.882251,96 96,79.882251 96,60 C96,53.3014663 94.1704984,47.0302355 90.9839104,41.6587228 L101.110332,31.5326452 C106.715332,39.6116982 110,49.4222615 110,60 C110,87.6142375 87.6142375,110 60,110 C32.3857625,110 10,87.6142375 10,60 C10,32.3857625 32.3857625,10 60,10 Z"
|
1074
|
+
></path>
|
1075
|
+
<g
|
1076
|
+
id="activity-dots"
|
1077
|
+
class="activity-indicator"
|
1078
|
+
transform="translate(40.000000, 55.000000)"
|
1079
|
+
>
|
1080
|
+
<circle id="left-dot" cx="5" cy="5" r="5"></circle>
|
1081
|
+
<circle id="middle-dot" cx="20" cy="5" r="5"></circle>
|
1082
|
+
<circle id="right-dot" cx="35" cy="5" r="5"></circle>
|
1083
|
+
</g>
|
1084
|
+
</g>
|
1085
|
+
</svg>
|
1086
|
+
</div>
|
1087
|
+
`}static get styles(){const e=Nt`var(--activityIndicatorCheckmarkColor, #31A481)`,t=Nt`var(--activityIndicatorCompletedRingColor, #31A481)`,n=Nt`var(--activityIndicatorLoadingRingColor, #333333)`,r=Nt`var(--activityIndicatorLoadingDotColor, #333333)`;return Nt`
|
1088
|
+
#completed-ring {
|
1089
|
+
fill: ${t};
|
1090
|
+
}
|
1091
|
+
|
1092
|
+
#check {
|
1093
|
+
fill: ${e};
|
1094
|
+
}
|
1095
|
+
|
1096
|
+
#activity-ring {
|
1097
|
+
fill: ${n};
|
1098
|
+
}
|
1099
|
+
|
1100
|
+
#activity-dots {
|
1101
|
+
fill: ${r};
|
1102
|
+
}
|
1103
|
+
|
1104
|
+
.activity-indicator {
|
1105
|
+
opacity: 0;
|
1106
|
+
transition: opacity 0.25s ease-out;
|
1107
|
+
}
|
1108
|
+
|
1109
|
+
.processing .activity-indicator {
|
1110
|
+
opacity: 1;
|
1111
|
+
}
|
1112
|
+
|
1113
|
+
.loaded-indicator {
|
1114
|
+
opacity: 1;
|
1115
|
+
transition: opacity 0.25s ease-out;
|
1116
|
+
}
|
1117
|
+
|
1118
|
+
.processing .loaded-indicator {
|
1119
|
+
opacity: 0;
|
1120
|
+
}
|
1121
|
+
|
1122
|
+
.image {
|
1123
|
+
border: 1px solid red;
|
1124
|
+
display: inline-block;
|
1125
|
+
}
|
1126
|
+
|
1127
|
+
.processing #activity-ring {
|
1128
|
+
animation: rotate 1.3s infinite linear;
|
1129
|
+
transform-origin: 50px 50px;
|
1130
|
+
transform-box: fill-box;
|
1131
|
+
}
|
1132
|
+
|
1133
|
+
.processing #left-dot {
|
1134
|
+
opacity: 0;
|
1135
|
+
animation: dot 1.3s infinite;
|
1136
|
+
animation-delay: 0.2s;
|
1137
|
+
}
|
1138
|
+
|
1139
|
+
.processing #middle-dot {
|
1140
|
+
opacity: 0;
|
1141
|
+
animation: dot 1.3s infinite;
|
1142
|
+
animation-delay: 0.4s;
|
1143
|
+
}
|
1144
|
+
|
1145
|
+
.processing #right-dot {
|
1146
|
+
opacity: 0;
|
1147
|
+
animation: dot 1.3s infinite;
|
1148
|
+
animation-delay: 0.6s;
|
1149
|
+
}
|
1150
|
+
|
1151
|
+
@keyframes rotate {
|
1152
|
+
0% {
|
1153
|
+
transform: rotate(-360deg);
|
1154
|
+
}
|
1155
|
+
}
|
1156
|
+
|
1157
|
+
@keyframes dot {
|
1158
|
+
0% {
|
1159
|
+
opacity: 0;
|
1160
|
+
}
|
1161
|
+
25% {
|
1162
|
+
opacity: 1;
|
1163
|
+
}
|
1164
|
+
100% {
|
1165
|
+
opacity: 0;
|
1166
|
+
}
|
1167
|
+
}
|
1168
|
+
`}}),n(5306),n(3161);var Qt=n(8150);function Kt(e){return(Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function en(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,r.key,r)}}function tn(e,t){return(tn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nn(e,t){if(t&&("object"===Kt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function rn(e){return(rn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var on=function(e){!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&&tn(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=rn(r);if(o){var n=rn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return nn(this,e)});function a(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(t=i.call(this,e)).it=L.Ld,e.type!==Qt.pX.CHILD)throw Error(t.constructor.directiveName+"() can only be used in child bindings");return nn(t)}return t=a,(n=[{key:"render",value:function(e){if(e===L.Ld||null==e)return this.ft=void 0,this.it=e;if(e===L.Jb)return e;if("string"!=typeof e)throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this.ft;this.it=e;var t=[e];return t.raw=t,this.ft={_$litType$:this.constructor.resultType,strings:t,values:[]}}}])&&en(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(Qt.Xe);on.directiveName="unsafeHTML",on.resultType=1;var an,sn,ln,cn,un=(0,Qt.XM)(on);function dn(e){return(dn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function hn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function pn(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,r.key,r)}}function mn(e,t){return(mn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vn(e,t){if(t&&("object"===dn(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)}function yn(e){return(yn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var bn,gn=function(e){!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&&mn(e,t)}(l,e);var t,n,o,i,a,s=(i=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=yn(i);if(a){var n=yn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return vn(this,e)});function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=s.call(this)).matchRegex=new RegExp("{{{(.+?)}}}","g"),e}return t=l,o=[{key:"properties",get:function(){return{match:{type:Object}}}}],(n=[{key:"createRenderRoot",value:function(){return this}},{key:"highlightedHit",value:function(e){return(0,r.dy)(an||(an=fn(["\n <p>","</p>\n "])),un(e.replace(this.matchRegex,"<mark>$1</mark>")))}},{key:"resultSelected",value:function(){this.dispatchEvent(new CustomEvent("resultSelected",{bubbles:!0,composed:!0,detail:{match:this.match}}))}},{key:"render",value:function(){var e=this.match,t=e.par,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=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return hn(e,t);var n=Object.prototype.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)?hn(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.")}()}(void 0===t?[]:t,1)[0],o=void 0===n?{}:n,i=Number.isInteger(o.page)?(0,r.dy)(sn||(sn=fn(['<p class="page-num">Page -',"-</p>"])),o.page):r.Ld,a=(0,r.dy)(ln||(ln=fn(['<img src="','" />'])),e.cover);return(0,r.dy)(cn||(cn=fn(["\n <li @click=",">\n ","\n <h4>","</h4>\n ","\n ","\n </li>\n "])),this.resultSelected,e.cover?a:r.Ld,e.title||r.Ld,i,this.highlightedHit(e.text))}}])&&pn(t.prototype,n),o&&pn(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.oi);customElements.define("book-search-result",gn);var kn,wn,Sn,Cn,On,xn,_n,jn,Pn,Bn,En,In,Ln,Mn,An,Tn,zn,Rn,Dn,$n=(0,r.iv)(bn||(kn=["data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEwIiB2aWV3Qm94PSIwIDAgMTMgMTAiIHdpZHRoPSIxMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNC4zMzMzMzMzMyAxMC00LjMzMzMzMzMzLTQuMTY2NjY2NjcgMS43MzMzMzMzMy0xLjY2NjY2NjY2IDIuNiAyLjUgNi45MzMzMzMzNy02LjY2NjY2NjY3IDEuNzMzMzMzMyAxLjY2NjY2NjY3eiIgZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIi8+PC9zdmc+"],wn||(wn=kn.slice(0)),bn=Object.freeze(Object.defineProperties(kn,{raw:{value:Object.freeze(wn)}})))),Nn=(0,r.iv)(Sn||(Sn=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgNDAgNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgYXJpYS1sYWJlbGxlZGJ5PSJjbG9zZVRpdGxlSUQgY2xvc2VEZXNjSUQiPjxwYXRoIGQ9Ik0yOS4xOTIgMTAuODA4YTEuNSAxLjUgMCAwMTAgMi4xMkwyMi4xMjIgMjBsNy4wNyA3LjA3MmExLjUgMS41IDAgMDEtMi4xMiAyLjEyMWwtNy4wNzMtNy4wNy03LjA3IDcuMDdhMS41IDEuNSAwIDAxLTIuMTIxLTIuMTJsNy4wNy03LjA3My03LjA3LTcuMDdhMS41IDEuNSAwIDAxMi4xMi0yLjEyMUwyMCAxNy44NzhsNy4wNzItNy4wN2ExLjUgMS41IDAgMDEyLjEyMSAweiIgY2xhc3M9ImZpbGwtY29sb3IiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg=="]))),Hn=(0,r.iv)(Cn||(Cn=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n .ia-button {\n min-height: 3rem;\n border: none;\n outline: none;\n cursor: pointer;\n color: var(--primaryTextColor);\n line-height: normal;\n border-radius: .4rem;\n text-align: center;\n vertical-align: middle;\n font-size: 1.4rem;\n 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"])));function Fn(e){return(Fn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Un(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Vn(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,r.key,r)}}function qn(e,t){return(qn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Wn(e,t){if(t&&("object"===Fn(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)}function Zn(e){return(Zn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Gn,Jn,Yn,Xn,Qn=function(e){!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&&qn(e,t)}(l,e);var t,n,o,i,a,s=(i=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Zn(i);if(a){var n=Zn(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Wn(this,e)});function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=s.call(this)).results=[],e.query="",e.queryInProgress=!1,e.renderHeader=!1,e.renderSearchAllFields=!1,e.displayResultImages=!1,e.errorMessage="",e.bindBookReaderListeners(),e}return t=l,o=[{key:"properties",get:function(){return{results:{type:Array},query:{type:String},queryInProgress:{type:Boolean},renderHeader:{type:Boolean},renderSearchAllFiles:{type:Boolean},displayResultImages:{type:Boolean},errorMessage:{type:String}}}},{key:"styles",get:function(){var e=(0,r.iv)(An||(An=Un(["var(--searchResultText, #adaedc)"]))),t=(0,r.iv)(Tn||(Tn=Un(["var(--searchResultBg, #272958)"]))),n=(0,r.iv)(zn||(zn=Un(["var(--searchResultBorder, #adaedc)"]))),o=(0,r.iv)(Rn||(Rn=Un(["(--tertiaryBGColor, #333)"]))),i=(0,r.iv)(Dn||(Dn=Un(["\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 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 fieldset {\n padding: 0 0 1rem 0;\n border: none;\n }\n\n [type="checkbox"] {\n display: none;\n }\n\n label {\n display: block;\n text-align: center;\n }\n\n label.checkbox {\n padding-bottom: .5rem;\n font-size: 1.6rem;\n line-height: 150%;\n vertical-align: middle;\n }\n\n label.checkbox:after {\n display: inline-block;\n width: 14px;\n height: 14px;\n margin-left: .7rem;\n content: "";\n border-radius: 2px;\n }\n :checked + label.checkbox:after {\n background-image: url(\'','\');\n }\n\n label.checkbox[for="all_files"]:after {\n background: ',' 50% 50% no-repeat;\n border: 1px solid var(--primaryTextColor);\n }\n\n [type="search"] {\n color: var(--primaryTextColor);\n border: 1px solid var(--primaryTextColor);\n -webkit-appearance: textfield;\n width: 100%;\n height: 3rem;\n padding: 0 1.5rem;\n box-sizing: border-box;\n font: normal 1.6rem "Helvetica qNeue", Helvetica, Arial, sans-serif;\n border-radius: 1.5rem;\n background: transparent;\n }\n [type="search"]:focus {\n outline: none;\n }\n [type="search"]::-webkit-search-cancel-button {\n width: 18px;\n height: 18px;\n -webkit-appearance: none;\n appearance: none;\n -webkit-mask: url(\'',"') 0 0 no-repeat;\n mask: url('","') 0 0 no-repeat;\n -webkit-mask-size: 100%;\n mask-size: 100%;\n background: #fff;\n }\n\n p.page-num {\n font-weight: bold;\n padding-bottom: 0;\n }\n\n p.search-cta {\n text-align: center;\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 ul.show-image li {\n display: grid;\n }\n\n li {\n cursor: pointer;\n grid-template-columns: 30px 1fr;\n grid-gap: 0 .5rem;\n }\n\n li img {\n display: block;\n width: 100%;\n }\n\n li h4 {\n grid-column: 2 / 3;\n padding: 0 0 2rem 0;\n margin: 0;\n font-weight: normal;\n }\n\n li p {\n grid-column: 2 / 3;\n padding: 0 0 1.5rem 0;\n margin: 0;\n font-size: 1.2rem;\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,$n,o,Nn,Nn);return[Hn,i]}}],(n=[{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}},{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(){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?(0,r.dy)(On||(On=Un(["<p>("," result",")</p>"])),e,e>1?"s":""):r.Ld}},{key:"headerSection",get:function(){var e=(0,r.dy)(xn||(xn=Un(["<header>\n <h3>Search inside</h3>\n ","\n </header>"])),this.resultsCount);return this.renderHeader?e:r.Ld}},{key:"searchMultipleControls",get:function(){var e=(0,r.dy)(_n||(_n=Un(['\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.Ld}},{key:"loadingIndicator",get:function(){return(0,r.dy)(jn||(jn=Un(['\n <div class="loading">\n <ia-activity-indicator mode="processing"></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,t=this.displayResultImages?"show-image":"";return(0,r.dy)(Pn||(Pn=Un(['\n <ul class="results ','">\n ',"\n </ul>\n "])),t,this.results.map((function(t){return(0,r.dy)(Bn||(Bn=Un(["\n <book-search-result\n .match=","\n @resultSelected=","\n ></book-search-result>\n "])),t,e.selectResult)})))}},{key:"searchForm",get:function(){return(0,r.dy)(En||(En=Un(['\n <form action="" method="get" @submit=',">\n <fieldset>\n ",'\n <input\n type="search"\n name="query"\n alt="Search inside this book."\n @keyup=',"\n .value=","\n />\n </fieldset>\n </form>\n "])),this.performSearch,this.searchMultipleControls,this.setQuery,this.query)}},{key:"setErrorMessage",get:function(){return(0,r.dy)(In||(In=Un(['\n <p class="error-message">',"</p>\n "])),this.errorMessage)}},{key:"searchCTA",get:function(){return(0,r.dy)(Ln||(Ln=Un(['<p class="search-cta"><em>Please enter text to search for</em></p>'])))}},{key:"render",value:function(){var e=!(this.queryInProgress||this.errorMessage||this.queryInProgress||this.results.length);return(0,r.dy)(Mn||(Mn=Un(["\n ","\n ",'\n <div class="results-container">\n ',"\n ","\n ","\n ","\n </div>\n "])),this.headerSection,this.searchForm,this.queryInProgress?this.loadingIndicator:r.Ld,this.errorMessage?this.setErrorMessage:r.Ld,this.results.length?this.resultsSet:r.Ld,e?this.searchCTA:r.Ld)}}])&&Vn(t.prototype,n),o&&Vn(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.oi);function Kn(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function er(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}customElements.define("ia-book-search-results",Qn);var tr,nr,rr,or,ir,ar,sr,lr,cr,ur,dr,hr={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},fr=function(){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.advanceToPage=this.advanceToPage.bind(this),this.updateMenu=this.updateMenu.bind(this),this.onProviderChange=n,this.bookreader=o,this.icon=(0,r.dy)(Gn||(Gn=Kn(['<ia-icon-search style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-search>']))),this.label="Search inside",this.menuDetails=this.getMenuDetails(),this.id="search",this.component=this.getComponent(),this.bindEventListeners()}var t,n;return t=e,(n=[{key:"getMenuDetails",value:function(){var e=hr,t=e.resultsCount,n=e.query;if(e.queryInProgress||!n)return r.Ld;var o=1===t?"result":"results";return(0,r.dy)(Jn||(Jn=Kn(["("," ",")"])),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(){hr={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},this.updateMenu({searchCanceled:!0})}},{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),hr.query=r,hr.results=[],hr.resultsCount=0,hr.queryInProgress=!0,hr.errorMessage="",this.updateMenu()}},{key:"onBookSearchInitiated",value:function(e){var t=e.detail;hr.query=t.query,this.bookreader.search(hr.query)}},{key:"onSearchRequestError",value:function(e){var t,n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default",i=e.detail.props,a=void 0===i?{}:i,s=a.instance,l=void 0===s?null:s;l&&(this.bookreader=l);var c={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."},u=null!==(t=c[o])&&void 0!==t?t:c.default;hr.query=(null==l||null===(n=l.searchResults)||void 0===n?void 0:n.q)||"",hr.results=[],hr.resultsCount=0,hr.queryInProgress=!1,hr.errorMessage=(0,r.dy)(Yn||(Yn=Kn(['<p class="error">',"</p>"])),u),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;hr={results:s,resultsCount:l,query:c,queryInProgress:!1,errorMessage:""},this.updateMenu()}},{key:"searchCanceledInMenu",value:function(){var e;null===(e=this.bookreader)||void 0===e||e.cancelSearchRequest()}},{key:"onSearchResultsCleared",value:function(){var e,t;hr={query:"",results:[],resultsCount:0,queryInProgress:!1,errorMessage:""},this.updateMenu({openMenu:!1}),null===(e=this.bookreader)||void 0===e||null===(t=e.searchView)||void 0===t||t.clearSearchFieldAndResults(!1)}},{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=hr,t=e.query,n=e.results,o=e.queryInProgress,i=e.errorMessage;return(0,r.dy)(Xn||(Xn=Kn(["\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.match.par[0].page;this.advanceToPage(t)}},{key:"advanceToPage",value:function(e){var t=this.bookreader.leafNumToIndex(e);this.bookreader._searchPluginGoToResult(t)}}])&&er(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),pr=r.dy`
|
1169
|
+
<svg
|
1170
|
+
viewBox="0 0 100 100"
|
1171
|
+
xmlns="http://www.w3.org/2000/svg"
|
1172
|
+
aria-labelledby="downloadTitleID downloadDescID"
|
1173
|
+
>
|
1174
|
+
<title id="downloadTitleID">Download icon</title>
|
1175
|
+
<desc id="downloadDescID">An arrow pointing downward at an empty document tray</desc>
|
1176
|
+
<g class="fill-color">
|
1177
|
+
|
1178
|
+
<path d="m50 80 33.3333333-43.3333333h-20v-36.6666667h-26.6666666v36.6666667h-20zm50 20v-13.3333333h-100v13.3333333z"/>
|
1179
|
+
</g>
|
1180
|
+
</svg>
|
1181
|
+
`;class mr extends r.oi{static get styles(){return r.iv`
|
1182
|
+
:host {
|
1183
|
+
width: var(--iconWidth, 'auto');
|
1184
|
+
height: var(--iconHeight, 'auto');
|
1185
|
+
}
|
1186
|
+
|
1187
|
+
.fill-color {
|
1188
|
+
fill: var(--iconFillColor);
|
1189
|
+
}
|
1190
|
+
|
1191
|
+
.stroke-color {
|
1192
|
+
stroke: var(--iconStrokeColor);
|
1193
|
+
}
|
1194
|
+
`}render(){return pr}}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})(e)}function yr(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,r.key,r)}}function gr(e,t){return(gr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function kr(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)}function wr(e){return(wr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}customElements.define("ia-icon-dl",mr);var Sr,Cr,Or=function(e){!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&&gr(e,t)}(l,e);var t,n,o,i,a,s=(i=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=wr(i);if(a){var n=wr(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return kr(this,e)});function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=s.call(this)).downloads=[],e.expiration=0,e.renderHeader=!1,e.isBookProtected=!1,e}return t=l,o=[{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.iv)(dr||(dr=yr(["\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[Hn,e]}}],(n=[{key:"formatsCount",get:function(){var e=this.downloads.length;return e?(0,r.dy)(tr||(tr=yr(["<p>"," format","</p>"])),e,e>1?"s":""):(0,r.dy)(nr||(nr=yr([""])))}},{key:"loanExpiryMessage",get:function(){return this.expiration?(0,r.dy)(rr||(rr=yr(["<h2>These files will expire in "," days.</h2>"])),this.expiration):(0,r.dy)(or||(or=yr([""])))}},{key:"renderDownloadOptions",value:function(){return this.downloads.map((function(e){return(0,r.dy)(ir||(ir=yr(['\n <li>\n <a class="ia-button link primary" href="','">Get ',"</a>\n ","\n </li>\n "])),e.url,e.type,e.note?(0,r.dy)(ar||(ar=yr(["<p>","</p>"])),e.note):(0,r.dy)(sr||(sr=yr([""]))))}))}},{key:"header",get:function(){return this.renderHeader?(0,r.dy)(lr||(lr=yr(["\n <header>\n <h3>Downloadable files</h3>\n ","\n </header>\n "])),this.formatsCount):r.Ld}},{key:"accessProtectedBook",get:function(){return(0,r.dy)(cr||(cr=yr(['\n <p>To access downloaded books, you need Adobe-compliant software on your device. The Internet Archive will administer this loan, but Adobe may also collect some information.</p>\n <a class="ia-button external primary" href="https://www.adobe.com/solutions/ebook/digital-editions/download.html" rel="noopener noreferrer" target="_blank">Install Adobe Digital Editions</a>\n '])))}},{key:"render",value:function(){return(0,r.dy)(ur||(ur=yr(["\n ","\n ","\n <ul>","</ul>\n ","\n "])),this.header,this.loanExpiryMessage,this.renderDownloadOptions(),this.isBookProtected?this.accessProtectedBook:r.Ld)}}])&&br(t.prototype,n),o&&br(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.oi);function xr(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=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return _r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_r(e,t):void 0}}(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 _r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jr(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Pr(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,r.key,r)}}customElements.define("ia-book-downloads",Or);var Br={pdf:{type:"Encrypted Adobe PDF",url:"#",note:"PDF files contain high quality images of pages."},epub:{type:"Encrypted Adobe ePub",url:"#",note:"ePub files are smaller in size, but may contain errors."}},Er={pdf:"PDF",epub:"ePub"},Ir=function(){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.dy)(Sr||(Sr=jr(['<ia-icon-dl style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-dl>']))),this.label="Downloadable files",this.menuDetails="",this.downloads=[],this.id="downloads",this.component="",this.isBookProtected=(null==o||null===(n=o.options)||void 0===n?void 0:n.isProtected)||!1,this.computeAvailableTypes=this.computeAvailableTypes.bind(this),this.update=this.update.bind(this)}var t,n;return t=e,(n=[{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]:[],n=t.reduce((function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=xr(n,2),o=r[0],i=void 0===o?"":o,a=r[1],s=void 0===a?"":a,l=i.toLowerCase(),c=Br[l]||null;if(c){var u=e.isBookProtected?Br[l].type:Er[l],d=Object.assign({},c,{url:s,type:u});t.push(d)}return t}),[]);this.downloads=n}},{key:"menu",get:function(){return(0,r.dy)(Cr||(Cr=jr(["<ia-book-downloads .downloads=","></ia-book-downloads>"])),this.downloads)}}])&&Pr(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Lr=r.dy`
|
1195
|
+
<svg
|
1196
|
+
viewBox="0 0 24 24"
|
1197
|
+
xmlns="http://www.w3.org/2000/svg"
|
1198
|
+
aria-labelledby="visualAdjustmentTitleID visualAdjustmentDescID"
|
1199
|
+
>
|
1200
|
+
<title id="visualAdjustmentTitleID">Visual adjustment</title>
|
1201
|
+
<desc id="visualAdjustmentDescID">A circle with its left hemisphere filled</desc>
|
1202
|
+
<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" />
|
1203
|
+
</svg>
|
1204
|
+
`;class Mr extends r.oi{static get styles(){return r.iv`
|
1205
|
+
:host {
|
1206
|
+
width: var(--iconWidth, 'auto');
|
1207
|
+
height: var(--iconHeight, 'auto');
|
1208
|
+
}
|
1209
|
+
|
1210
|
+
.fill-color {
|
1211
|
+
fill: var(--iconFillColor);
|
1212
|
+
}
|
1213
|
+
|
1214
|
+
.stroke-color {
|
1215
|
+
stroke: var(--iconStrokeColor);
|
1216
|
+
}
|
1217
|
+
`}render(){return Lr}}customElements.define("ia-icon-visual-adjustment",Mr);var Ar=L.Al.H,Tr=function(){return document.createComment("")},zr=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(Tr(),i),s=o.insertBefore(Tr(),i);n=new Ar(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 f=h.nextSibling;o.insertBefore(h,i),h=f}}return n},Rr=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return e._$AI(t,n),e},Dr={},$r=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 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})(e)}function Hr(e,t){if(e){if("string"==typeof e)return Fr(e,t);var n=Object.prototype.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)?Fr(e,t):void 0}}function Fr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ur(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,r.key,r)}}function Vr(e,t){return(Vr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qr(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)}function Wr(e){return(Wr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Zr=function(e,t,n){for(var r=new Map,o=t;o<=n;o++)r.set(e[o],o);return r},Gr=(0,Qt.XM)(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vr(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Wr(r);if(o){var n=Wr(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return qr(this,e)});function a(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),t=i.call(this,e),e.type!==Qt.pX.CHILD)throw Error("repeat() can only be used in text expressions");return qr(t)}return t=a,(n=[{key:"dt",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,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Hr(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(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.dt(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=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||Hr(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,3),o=r[0],i=r[1],a=r[2],s=function(e){return e._$AH}(e),l=this.dt(o,i,a),c=l.values,u=l.keys;if(!Array.isArray(s))return this.ut=u,c;for(var d,h,f=null!==(n=this.ut)&&void 0!==n?n:this.ut=[],p=[],m=0,v=s.length-1,y=0,b=c.length-1;m<=v&&y<=b;)if(null===s[m])m++;else if(null===s[v])v--;else if(f[m]===u[y])p[y]=Rr(s[m],c[y]),m++,y++;else if(f[v]===u[b])p[b]=Rr(s[v],c[b]),v--,b--;else if(f[m]===u[b])p[b]=Rr(s[m],c[b]),zr(e,p[b+1],s[m]),m++,b--;else if(f[v]===u[y])p[y]=Rr(s[v],c[y]),zr(e,s[m],s[v]),v--,y++;else if(void 0===d&&(d=Zr(u,y,b),h=Zr(f,m,v)),d.has(f[m]))if(d.has(f[v])){var g=h.get(u[y]),k=void 0!==g?s[g]:null;if(null===k){var w=zr(e,s[m]);Rr(w,c[y]),p[y]=w}else p[y]=Rr(k,c[y]),zr(e,s[m],k),s[g]=null;y++}else $r(s[v]),v--;else $r(s[m]),m++;for(;y<=b;){var S=zr(e,p[b+1]);Rr(S,c[y]),p[y++]=S}for(;m<=v;){var C=s[m++];null!==C&&$r(C)}return this.ut=u,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Dr;e._$AH=t}(e,p),L.Jb}}])&&Ur(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(Qt.Xe)),Jr=r.dy`
|
1218
|
+
<svg
|
1219
|
+
viewBox="0 0 100 100"
|
1220
|
+
xmlns="http://www.w3.org/2000/svg"
|
1221
|
+
aria-labelledby="magnify-minusTitleID magnify-minusDescID"
|
1222
|
+
>
|
1223
|
+
<title id="magnify-minusTitleID">Zoom out</title>
|
1224
|
+
<desc id="magnify-minusDescID">Take a look further.</desc>
|
1225
|
+
<g
|
1226
|
+
class="fill-color"
|
1227
|
+
fill="none"
|
1228
|
+
fill-rule="nonzero"
|
1229
|
+
>
|
1230
|
+
<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"/>
|
1231
|
+
</g>
|
1232
|
+
</svg>
|
1233
|
+
`;class Yr extends r.oi{static get styles(){return r.iv`
|
1234
|
+
:host {
|
1235
|
+
width: var(--iconWidth, 'auto');
|
1236
|
+
height: var(--iconHeight, 'auto');
|
1237
|
+
}
|
1238
|
+
|
1239
|
+
.fill-color {
|
1240
|
+
fill: var(--iconFillColor);
|
1241
|
+
}
|
1242
|
+
|
1243
|
+
.stroke-color {
|
1244
|
+
stroke: var(--iconStrokeColor);
|
1245
|
+
}
|
1246
|
+
`}render(){return Jr}}customElements.define("ia-icon-magnify-minus",Yr);var Xr,Qr,Kr,eo,to,no,ro,oo=r.dy`
|
1247
|
+
<svg
|
1248
|
+
viewBox="0 0 100 100"
|
1249
|
+
xmlns="http://www.w3.org/2000/svg"
|
1250
|
+
aria-labelledby="magnify-plusTitleID magnify-plusDescID"
|
1251
|
+
>
|
1252
|
+
<title id="magnify-plusTitleID">Zoom in</title>
|
1253
|
+
<desc id="magnify-plusDescID">Take a look closer.</desc>
|
1254
|
+
<g
|
1255
|
+
class="fill-color"
|
1256
|
+
fill="none"
|
1257
|
+
fill-rule="nonzero"
|
1258
|
+
>
|
1259
|
+
<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"/>
|
1260
|
+
</g>
|
1261
|
+
</svg>
|
1262
|
+
`;class io extends r.oi{static get styles(){return r.iv`
|
1263
|
+
:host {
|
1264
|
+
width: var(--iconWidth, 'auto');
|
1265
|
+
height: var(--iconHeight, 'auto');
|
1266
|
+
}
|
1267
|
+
|
1268
|
+
.fill-color {
|
1269
|
+
fill: var(--iconFillColor);
|
1270
|
+
}
|
1271
|
+
|
1272
|
+
.stroke-color {
|
1273
|
+
stroke: var(--iconStrokeColor);
|
1274
|
+
}
|
1275
|
+
`}render(){return oo}}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})(e)}function so(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function lo(e){return function(e){if(Array.isArray(e))return co(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 co(e,t);var n=Object.prototype.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)?co(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 co(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function uo(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,r.key,r)}}function ho(e,t){return(ho=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function fo(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)}function po(e){return(po=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}customElements.define("ia-icon-magnify-plus",io);var mo,vo,yo=function(e){return"visualAdjustment".concat(e)},bo={optionChange:yo("OptionChanged"),zoomIn:yo("ZoomIn"),zoomOut:yo("ZoomOut")},go=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ho(e,t)}(l,e);var t,n,o,i,a,s=(i=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=po(i);if(a){var n=po(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return fo(this,e)});function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=s.call(this)).activeCount=0,e.options=[],e.renderHeader=!1,e.showZoomControls=!0,e}return t=l,o=[{key:"properties",get:function(){return{activeCount:{type:Number},options:{type:Array},renderHeader:{type:Boolean},showZoomControls:{type:Boolean}}}},{key:"styles",get:function(){return(0,r.iv)(ro||(ro=so(['\n :host {\n display: block;\n height: 100%;\n overflow-y: auto;\n font-size: 1.4rem;\n box-sizing: border-box;\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 ul {\n padding: 1rem 2rem 0 0;\n list-style: none;\n margin-top: 0;\n }\n\n [type="checkbox"] {\n display: none;\n }\n\n label {\n display: flex;\n justify-content: space-between;\n align-items: baseline;\n font-size: 1.4rem;\n font-weight: bold;\n line-height: 150%;\n vertical-align: middle;\n }\n\n .icon {\n display: inline-block;\n width: 14px;\n height: 14px;\n margin-left: .7rem;\n border: 1px solid var(--primaryTextColor);\n border-radius: 2px;\n background: var(--activeButtonBg) 50% 50% no-repeat;\n }\n :checked + .icon {\n background-image: url(\'',"');\n }\n\n .range {\n display: none;\n padding-top: .5rem;\n }\n .range.visible {\n display: flex;\n }\n\n .range p {\n margin-left: 1rem;\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 border-radius: 0;\n background: transparent;\n outline: none;\n cursor: pointer;\n --iconFillColor: var(--primaryTextColor);\n --iconStrokeColor: var(--primaryTextColor);\n height: 4rem;\n width: 4rem;\n }\n\n button * {\n display: inline-block;\n }"])),$n)}}],(n=[{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(lo(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(bo.optionChange,{bubbles:!0,composed:!0,detail:t}))}},{key:"emitZoomIn",value:function(){this.dispatchEvent(new CustomEvent(bo.zoomIn))}},{key:"emitZoomOut",value:function(){this.dispatchEvent(new CustomEvent(bo.zoomOut))}},{key:"changeActiveStateFor",value:function(e){var t=lo(this.options),n=t.find((function(t){return t.id===e}));n.active=!n.active,this.options=t,this.activeCount=this.activeOptions.length,this.emitOptionChangedEvent(n.id)}},{key:"setRangeValue",value:function(e,t){var n=lo(this.options);n.find((function(t){return t.id===e})).value=t,this.options=lo(n)}},{key:"rangeSlider",value:function(e){var t=this;return(0,r.dy)(Xr||(Xr=so(["\n <div class=",'>\n <input\n type="range"\n name="','_range"\n min=',"\n max=","\n step=","\n .value=","\n @input=","\n @change=","\n />\n <p>","%</p>\n </div>\n "])),"range".concat(e.active?" visible":""),e.id,e.min||0,e.max||100,e.step||1,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,n="adjustment_".concat(e.id);return(0,r.dy)(Qr||(Qr=so(['<li>\n <label for="','">\n <span class="name">','</span>\n <input\n type="checkbox"\n name="','"\n id="','"\n @change=',"\n ?checked=",'\n />\n <span class="icon"></span>\n </label>\n ',"\n </li>"])),n,e.name,n,n,(function(){return t.changeActiveStateFor(e.id)}),e.active,void 0!==e.value?this.rangeSlider(e):r.Ld)}},{key:"headerSection",get:function(){var e=this.activeCount?(0,r.dy)(Kr||(Kr=so(["<p>("," active)</p>"])),this.activeCount):r.Ld,t=(0,r.dy)(eo||(eo=so(["<header>\n <h3>Visual adjustments</h3>\n ","\n </header>"])),e);return this.renderHeader?t:r.Ld}},{key:"zoomControls",get:function(){return(0,r.dy)(to||(to=so(['\n <h4>Zoom</h4>\n <button class="zoom_out" @click=',' title="zoom out">\n <ia-icon-magnify-minus></ia-icon-magnify-minus>\n </button>\n <button class="zoom_in" @click=',' title="zoom in">\n <ia-icon-magnify-plus></ia-icon-magnify-plus>\n </button>\n '])),this.emitZoomOut,this.emitZoomIn)}},{key:"render",value:function(){return(0,r.dy)(no||(no=so(["\n ","\n <ul>\n ","\n </ul>\n ","\n "])),this.headerSection,Gr(this.options,(function(e){return e.id}),this.adjustmentCheckbox.bind(this)),this.showZoomControls?this.zoomControls:r.Ld)}}])&&uo(t.prototype,n),o&&uo(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.oi);function ko(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function wo(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function So(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,r.key,r)}}customElements.define("ia-book-visual-adjustments",go);var Co,Oo,xo=[{id:"brightness",name:"Adjust brightness",active:!1,min:0,max:150,step:1,value:100},{id:"contrast",name:"Adjust contrast",active:!1,min:0,max:150,step:1,value:100},{id:"invert",name:"Inverted colors (dark mode)",active:!1},{id:"grayscale",name:"Grayscale",active:!1}],_o=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);var n=t.onProviderChange,o=t.bookreader;this.onProviderChange=n,this.bookContainer=o.refs.$brContainer,this.bookreader=o,this.onAdjustmentChange=this.onAdjustmentChange.bind(this),this.optionUpdateComplete=this.optionUpdateComplete.bind(this),this.updateOptionsCount=this.updateOptionsCount.bind(this),this.onZoomIn=this.onZoomIn.bind(this),this.onZoomOut=this.onZoomOut.bind(this),this.activeCount=0,this.icon=(0,r.dy)(mo||(mo=wo(['<ia-icon-visual-adjustment style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-visual-adjustment>']))),this.label="Visual Adjustments",this.menuDetails=this.updateOptionsCount(),this.id="adjustment",this.component=(0,r.dy)(vo||(vo=wo(["\n <ia-book-visual-adjustments\n .options=","\n @visualAdjustmentOptionChanged=","\n @visualAdjustmentZoomIn=","\n @visualAdjustmentZoomOut=","\n ></ia-book-visual-adjustments>\n "])),xo,this.onAdjustmentChange,this.onZoomIn,this.onZoomOut)}var t,n;return t=e,(n=[{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,o="".concat(t.active?n[t.id](t.value):"");return o?[].concat(function(e){if(Array.isArray(e))return ko(e)}(r=e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return ko(e,t);var n=Object.prototype.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)?ko(e,t):void 0}}(r)||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.")}(),[o]):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)")}}])&&So(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();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})(e)}function Po(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Bo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}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,r.key,r)}}function Io(e,t){return(Io=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Lo(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)}function Mo(e){return(Mo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ao,To,zo=function(e){!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)}(l,e);var t,n,o,i,a,s=(i=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Mo(i);if(a){var n=Mo(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Lo(this,e)});function l(){return Bo(this,l),s.apply(this,arguments)}return t=l,o=[{key:"styles",get:function(){return(0,r.iv)(Oo||(Oo=Po(['\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}}}}],(n=[{key:"render",value:function(){var e=this;return(0,r.dy)(Co||(Co=Po(['\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()}))}}])&&Eo(t.prototype,n),o&&Eo(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.oi);function Ro(e){return(Ro="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Do(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function $o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function No(e,t){return(No=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ho(e,t){if(t&&("object"===Ro(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)}function Fo(e){return(Fo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}customElements.define("delete-modal-actions",zo);var Uo,Vo=function(e){!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&&No(e,t)}(l,e);var t,n,o,i,a,s=(i=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Fo(i);if(a){var n=Fo(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ho(this,e)});function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=s.call(this)).state="hollow",e.side=void 0,e}return t=l,o=[{key:"styles",get:function(){return(0,r.iv)(To||(To=Do(["\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}}}}],(n=[{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.dy)(Ao||(Ao=Do(["\n <button title="," @click="," class=",">\n <icon-bookmark state=","></icon-bookmark>\n </button>\n "])),this.title,this.handleClick,e,this.state)}}])&&$o(t.prototype,n),o&&$o(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.oi);function qo(e){return(qo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Wo(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Zo(e,t){return(Zo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Go(e,t){if(t&&("object"===qo(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Jo(e){return(Jo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}customElements.define("bookmark-button",Vo),n(1058),n(6699),n(2023);var Yo,Xo,Qo,Ko,ei,ti,ni,ri,oi,ii=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Zo(e,t)}(l,e);var t,n,o,i,a,s=(i=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Jo(i);if(a){var n=Jo(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Go(this,e)});function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=s.call(this)).url="https://archive.org/account/login",e}return t=l,o=[{key:"properties",get:function(){return{url:{type:String}}}},{key:"styles",get:function(){return Hn}}],(n=[{key:"render",value:function(){return(0,r.dy)(Uo||(Uo=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)}}])&&Wo(t.prototype,n),o&&Wo(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.oi);function ai(e){return(ai="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function si(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function li(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 ci(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?li(Object(n),!0).forEach((function(t){ui(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):li(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ui(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function di(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 hi(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){di(i,r,o,a,s,"next",e)}function s(e){di(i,r,o,a,s,"throw",e)}a(void 0)}))}}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,r.key,r)}}function pi(e,t){return(pi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function mi(e,t){if(t&&("object"===ai(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)}function vi(e){return(vi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}customElements.define("bookmarks-login",ii);var yi,bi={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})})}},gi=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&pi(e,t)}(u,e);var t,n,o,i,a,s,l,c=(s=u,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=vi(s);if(l){var n=vi(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return mi(this,e)});function u(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),(e=c.call(this)).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=bi,e.deleteModalConfig=new G({title:"Delete Bookmark",headline:"This bookmark contains a note. Deleting it will permanently delete the note. Are you sure?",headerColor:"#194880"}),e}return t=u,o=[{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.iv)(oi||(oi=si(["\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[Hn,e]}},{key:"formatPage",value:function(e){return isNaN(+e)?"(".concat(e.replace(/\D/g,""),")"):e}}],(n=[{key:"updated",value:function(e){e.has("displayMode")&&this.updateDisplay(),this.emitBookmarksChanged()}},{key:"setup",value:function(){this.api.identifier=this.bookreader.bookId,"login"!==this.displayMode&&(this.fetchUserBookmarks(),this.setBREventListeners())}},{key:"updateDisplay",value:function(){"bookmarks"===this.displayMode&&this.fetchUserBookmarks()}},{key:"fetchUserBookmarks",value:(a=hi(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.api.identifier){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,this.fetchBookmarks();case 4:this.initializeBookmarks();case 5:case"end":return e.stop()}}),e,this)}))),function(){return a.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 t=e.leafNum,n=void 0===t?"":t,r=e.notes,o=void 0===r?{}:r,i=o.note,a=void 0===i?"":i,s=o.color,l={note:a,color:this.getBookmarkColor(s)?s:this.defaultColor.id},c=u.formatPage(this.bookreader.getPageNum(n)),d=this.bookreader.getPageURI("".concat(n).replace(/\D/g,""),32);return ci(ci({},l),{},{id:n,leafNum:n,page:c,thumbnail:d})}},{key:"fetchBookmarks",value:(i=hi(regeneratorRuntime.mark((function e(){var t,n,r,o,i,a,s,l,c,u,d=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.api.getAll().then((function(e){return e.text()}));case 2:t=e.sent;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(ci(ci({},t),{},{leafNum:n}));u[e]=r})),this.bookmarks=u,e.abrupt("return",u);case 10:case"end":return e.stop()}}),e,this)}))),function(){return i.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._models.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.sY)((0,r.dy)(Yo||(Yo=si(["\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){var a=this.bookreader.displayedIndices,s=a.includes(+this.activeBookmarkID);if(s)return}this.bookmarks[i]?this.activeBookmarkID=i:this.activeBookmarkID=""}else{var l=this.bookmarks[i];e&&l&&(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.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.dy)(Xo||(Xo=si(["\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=ci({},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.dy)(Qo||(Qo=si(['\n <button\n class="ia-button primary"\n tabindex="-1"\n ?disabled=',"\n @click=",">\n Add bookmark\n </button>\n "])),this.shouldEnableAddBookmarkButton,this.addBookmark)}},{key:"bookmarksList",get:function(){return(0,r.dy)(Ko||(Ko=si(["\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,ci({},this.bookmarks),this.activeBookmarkID,this.bookmarkColors,this.defaultColor)}},{key:"bookmarkHelperMessage",get:function(){return(0,r.dy)(ei||(ei=si(["<p>Please use 1up or 2up view modes to add bookmark.</p>"])))}},{key:"render",value:function(){var e=this,t=(0,r.dy)(ti||(ti=si(["\n ","\n ","\n "])),this.bookmarksList,this.allowAddingBookmark?this.addBookmarkButton:this.bookmarkHelperMessage);return(0,r.dy)(ni||(ni=si(['\n <section class="bookmarks">\n ',"\n </section>\n "])),"login"===this.displayMode?(0,r.dy)(ri||(ri=si(["<bookmarks-login\n @click=","\n .url=","></bookmarks-login>"])),(function(){return e.loginOptions.loginClicked()}),this.loginOptions.loginUrl):t)}}])&&fi(t.prototype,n),o&&fi(t,o),Object.defineProperty(t,"prototype",{writable:!1}),u}(r.oi);customElements.define("ia-bookmarks",gi);var ki,wi,Si,Ci,Oi,xi=(0,r.iv)(yi||(yi=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 _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})(e)}function ji(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Pi(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Bi(e,t){return(Bi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ei(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)}function Ii(e){return(Ii=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Li=function(e){!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&&Bi(e,t)}(l,e);var t,n,o,i,a,s=(i=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Ii(i);if(a){var n=Ii(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ei(this,e)});function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=s.call(this)).bookmark={},e.bookmarkColors=[],e.renderHeader=!1,e.showBookmark=!0,e}return t=l,o=[{key:"properties",get:function(){return{bookmark:{type:Object},bookmarkColors:{type:Array},renderHeader:{type:Boolean},showBookmark:{type:Boolean}}}},{key:"headerSection",get:function(){return(0,r.dy)(Ci||(Ci=ji(["<header>\n <h3>Edit Bookmark</h3>\n </header>"])))}},{key:"styles",get:function(){var e=(0,r.iv)(Oi||(Oi=ji(['\n :host {\n display: block;\n padding: 0 1rem 2rem 1rem;\n color: var(--primaryTextColor);\n }\n\n small {\n font-style: italic;\n }\n\n .bookmark {\n display: grid;\n grid-template-columns: 37px 1fr;\n grid-gap: 0 1rem;\n align-items: center;\n }\n\n h4 {\n margin: 0;\n font-size: 1.4rem;\n }\n\n fieldset {\n padding: 2rem 0 0 0;\n border: none;\n }\n\n label {\n display: block;\n font-weight: bold;\n }\n\n p {\n padding: 0;\n margin: .5rem 0;\n font-size: 1.2rem;\n line-height: 120%;\n }\n\n textarea {\n width: 100%;\n margin-bottom: 2rem;\n box-sizing: border-box;\n font: normal 1.4rem "Helvetica Neue", Helvetica, Arial, sans-serif;\n resize: vertical;\n }\n\n ul {\n display: grid;\n grid-template-columns: repeat(3, auto);\n grid-gap: 0 2rem;\n justify-content: start;\n padding: 1rem 0 0 0;\n margin: 0 0 2rem 0;\n list-style: none;\n }\n\n li input {\n display: none;\n }\n\n li label {\n display: block;\n min-width: 50px;\n padding-top: .4rem;\n text-align: center;\n border: 1px solid transparent;\n border-radius: 4px;\n cursor: pointer;\n }\n\n li input:checked + label {\n border-color: var(--primaryTextColor);\n }\n\n input[type="submit"] {\n background: var(--primaryCTAFill);\n border-color: var(--primaryCTABorder);\n }\n\n button {\n background: var(--primaryErrorCTAFill);\n border-color: var(--primaryErrorCTABorder);\n }\n\n .button {\n -webkit-appearance: none;\n appearance: none;\n padding: .5rem 1rem;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n }\n\n .actions {\n display: grid;\n grid-template-columns: auto auto;\n grid-gap: 0 1rem;\n justify-items: stretch;\n }\n '])));return[Hn,xi,e]}}],(n=[{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.dy)(ki||(ki=ji(['\n <li>\n <input type="radio" name="color" id="color_','" .value='," @change="," ?checked=",'>\n <label for="color_','">\n <icon-bookmark class=',"></icon-bookmark>\n </label>\n </li>\n "])),e.id,e.id,(function(){return t.changeColorTo(e.id)}),this.bookmark.color===e.id,e.id,e.className)}},{key:"bookmarkTemplate",get:function(){return(0,r.dy)(wi||(wi=ji(['\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.dy)(Si||(Si=ji(["\n ","\n ",'\n <form action="" method="put" @submit=','>\n <fieldset>\n <label for="note">Note <small>(optional)</small></label>\n <textarea rows="4" cols="80" name="note" id="note" @change=',">",'</textarea>\n <label for="color">Bookmark color</label>\n <ul>\n ','\n </ul>\n <div class="actions">\n <button type="button" class="ia-button cancel" @click=','>Delete</button>\n <input class="ia-button" type="submit" value="Save">\n </div>\n </fieldset>\n </form>\n '])),this.renderHeader?l.headerSection:r.Ld,this.showBookmark?this.bookmarkTemplate:r.Ld,this.emitSaveEvent,this.updateNote,this.bookmark.note,Gr(this.bookmarkColors,(function(e){return e.id}),this.bookmarkColor.bind(this)),this.emitDeleteEvent)}}])&&Pi(t.prototype,n),o&&Pi(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.oi);customElements.define("ia-bookmark-edit",Li),n(2707);var Mi,Ai,Ti,zi,Ri,Di,$i,Ni,Hi=r.dy`
|
1276
|
+
<svg height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg" aria-labelledby="editPencilTitleID editPencilDescID"><title id="editPencilTitleID">Pencil icon</title><desc id="editPencilDescID">An illustration of a pencil, used to represent an edit action</desc><path class="fill-color" d="m15.6111048 9.3708338-9.52237183 9.5222966-5.14363353 1.0897111c-.42296707.0896082-.83849202-.1806298-.92810097-.6035935-.02266463-.1069795-.02266463-.2175207 0-.3245001l1.08971974-5.1435929 9.52237189-9.52229656zm-10.89310224 5.9110366-2.78094924-.5403869-.67567462 3.166657.83033407.8303275 3.16668096-.6756703zm14.82724244-12.05935921c.6114418.61143705.6055516 1.6086709-.0131615 2.22737904l-2.2405581 2.24054036-4.9820147-4.98197536 2.2405581-2.24054036c.618713-.61870814 1.6159506-.62460252 2.2273925-.01316547z" fill-rule="evenodd"/></svg>
|
1277
|
+
`;class Fi extends r.oi{static get styles(){return r.iv`
|
1278
|
+
:host {
|
1279
|
+
width: var(--iconWidth, 'auto');
|
1280
|
+
height: var(--iconHeight, 'auto');
|
1281
|
+
}
|
1282
|
+
|
1283
|
+
.fill-color {
|
1284
|
+
fill: var(--iconFillColor);
|
1285
|
+
}
|
1286
|
+
|
1287
|
+
.stroke-color {
|
1288
|
+
stroke: var(--iconStrokeColor);
|
1289
|
+
}
|
1290
|
+
`}render(){return Hi}}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})(e)}function Vi(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function qi(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,r.key,r)}}function Wi(e,t){return(Wi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zi(e,t){if(t&&("object"===Ui(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)}function Gi(e){return(Gi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}customElements.define("ia-icon-edit-pencil",Fi);var Ji,Yi=function(e){!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&&Wi(e,t)}(l,e);var t,n,o,i,a,s=(i=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Gi(i);if(a){var n=Gi(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Zi(this,e)});function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=s.call(this)).activeBookmarkID=void 0,e.bookmarkColors=[],e.defaultBookmarkColor={},e.bookmarks={},e.editedBookmark={},e.renderHeader=!1,e}return t=l,o=[{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.iv)(Ni||(Ni=Vi(["\n :host {\n display: block;\n overflow-y: auto;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n margin-bottom: 2rem;\n --activeBorderWidth: 2px;\n }\n\n icon-bookmark {\n width: 16px;\n height: 24px;\n }\n\n .separator {\n background-color: var(--secondaryBGColor);\n width: 98%;\n margin: 1px auto;\n height: 1px;\n }\n\n small {\n font-style: italic;\n }\n\n h4 {\n margin: 0;\n font-size: 1.4rem;\n }\n h4 * {\n display: inline-block;\n }\n h4 icon-bookmark {\n vertical-align: bottom;\n }\n h4 span {\n vertical-align: top;\n padding-top: 1%;\n }\n\n p {\n padding: 0;\n margin: 5px 0 0 0;\n width: 98%;\n overflow-wrap: break-word;\n }\n\n ia-bookmark-edit {\n margin: 5px 5px 3px 6px;\n }\n\n ul {\n padding: 0;\n list-style: none;\n margin: var(--activeBorderWidth) 0.5rem 1rem 0;\n }\n ul > li:first-child .separator {\n display: none;\n }\n li {\n cursor: pointer;\n outline: none;\n position: relative;\n }\n li .content {\n padding: 2px 0 4px 2px;\n border: var(--activeBorderWidth) solid transparent;\n padding: .2rem 0 .4rem .2rem;\n }\n li .content.active {\n border: var(--activeBorderWidth) solid #538bc5;\n }\n li button.edit {\n padding: 5px 2px 0 0;\n background: transparent;\n cursor: pointer;\n height: 40px;\n width: 40px;\n position: absolute;\n right: 2px;\n top: 2px;\n text-align: right;\n -webkit-appearance: none;\n appearance: none;\n outline: none;\n box-sizing: border-box;\n border: none;\n }\n li button.edit > * {\n display: block;\n height: 100%;\n width: 100%;\n }\n "]))),xi]}}],(n=[{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.dy)(Mi||(Mi=Vi(["\n <li\n @click=",'\n tabindex="0"\n data-pageIndex=','\n >\n <div class="separator"></div>\n <div class="content ','">\n <button\n class="edit"\n @click=','\n title="Edit this bookmark"\n >\n <ia-icon-edit-pencil></ia-icon-edit-pencil>\n </button>\n <h4>\n <icon-bookmark class=',"></icon-bookmark>\n <span> Page ","</span>\n </h4>\n ","\n ","\n </div>\n </li>\n "])),(function(){return t.emitSelectedEvent(e)}),e.id,i,(function(n){return t.editBookmark(n,e)}),o,e.page,!n&&e.note?(0,r.dy)(Ai||(Ai=Vi(["<p>","</p>"])),e.note):r.Ld,n?this.editBookmarkComponent:r.Ld)}},{key:"editBookmarkComponent",get:function(){return(0,r.dy)(Ti||(Ti=Vi(["\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.dy)(zi||(zi=Vi(["<small>(",")</small>"])),e)}},{key:"headerSection",get:function(){return(0,r.dy)(Ri||(Ri=Vi(["<header>\n <h3>\n Bookmarks\n ","\n </h3>\n </header>"])),this.bookmarks.length?this.bookmarksCount:r.Ld)}},{key:"bookmarkslist",get:function(){var e=this.sortBookmarks(),t=Gr(e,(function(e){return null==e?void 0:e.id}),this.bookmarkItem.bind(this));return(0,r.dy)(Di||(Di=Vi(["\n <ul>\n ",'\n <div class="separator"></div>\n </ul>\n '])),t)}},{key:"render",value:function(){return(0,r.dy)($i||($i=Vi(["\n ","\n ","\n "])),this.renderHeader?this.headerSection:r.Ld,Object.keys(this.bookmarks).length?this.bookmarkslist:r.Ld)}}])&&qi(t.prototype,n),o&&qi(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.oi);customElements.define("ia-bookmarks-list",Yi);class Xi extends r.oi{static get styles(){return r.iv`
|
1291
|
+
:host {
|
1292
|
+
width: var(--iconWidth, 'auto');
|
1293
|
+
height: var(--iconHeight, 'auto');
|
1294
|
+
}
|
1295
|
+
|
1296
|
+
#hollow,
|
1297
|
+
#plus,
|
1298
|
+
#minus {
|
1299
|
+
display: none;
|
1300
|
+
}
|
1301
|
+
|
1302
|
+
.hollow #filled,
|
1303
|
+
.plus #filled,
|
1304
|
+
.minus #filled {
|
1305
|
+
display: none;
|
1306
|
+
}
|
1307
|
+
|
1308
|
+
.hollow #hollow,
|
1309
|
+
.plus #hollow,
|
1310
|
+
.minus #hollow {
|
1311
|
+
display: block;
|
1312
|
+
}
|
1313
|
+
|
1314
|
+
.plus #plus {
|
1315
|
+
display: block;
|
1316
|
+
}
|
1317
|
+
|
1318
|
+
.minus #minus {
|
1319
|
+
display: block;
|
1320
|
+
}
|
1321
|
+
|
1322
|
+
.fill-color {
|
1323
|
+
fill: var(--iconFillColor);
|
1324
|
+
}
|
1325
|
+
|
1326
|
+
.stroke-color {
|
1327
|
+
stroke: var(--iconStrokeColor);
|
1328
|
+
}
|
1329
|
+
`}static get properties(){return{state:{type:String}}}render(){return r.dy`
|
1330
|
+
<div class=${this.state}>
|
1331
|
+
<svg
|
1332
|
+
height="24"
|
1333
|
+
viewBox="0 0 16 24"
|
1334
|
+
width="16"
|
1335
|
+
xmlns="http://www.w3.org/2000/svg"
|
1336
|
+
aria-labelledby="bookmarkTitleID bookmarDescID"
|
1337
|
+
>
|
1338
|
+
<title id="bookmarkTitleID">Bookmark icon</title>
|
1339
|
+
<desc id="bookmarkDescID">An outline of the shape of a bookmark</desc>
|
1340
|
+
<path
|
1341
|
+
id="filled"
|
1342
|
+
d="m1 0h14c.5522847 0 1 .44771525 1 1v23l-8-5.4545455-8 5.4545455v-23c0-.55228475.44771525-1 1-1z"
|
1343
|
+
class="fill-color"
|
1344
|
+
fill-rule="evenodd"
|
1345
|
+
/>
|
1346
|
+
<g class="fill-color" fill-rule="evenodd">
|
1347
|
+
<path
|
1348
|
+
id="hollow"
|
1349
|
+
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"
|
1350
|
+
/>
|
1351
|
+
<path
|
1352
|
+
id="plus"
|
1353
|
+
d="m8.75 6v2.25h2.25v1.5h-2.25v2.25h-1.5v-2.25h-2.25v-1.5h2.25v-2.25z"
|
1354
|
+
fill-rule="nonzero"
|
1355
|
+
/>
|
1356
|
+
<path id="minus" d="m11 8.25v1.5h-6v-1.5z" fill-rule="nonzero" />
|
1357
|
+
</g>
|
1358
|
+
</svg>
|
1359
|
+
</div>
|
1360
|
+
`}}function Qi(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,r.key,r)}}customElements.define("icon-bookmark",Xi);var Ki=function(){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.dy)(Ji||(Ji=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['<icon-bookmark state="hollow" style="--iconWidth: 16px; --iconHeight: 24px;"></icon-bookmark>']))),this.label="Bookmarks",this.id="bookmarks",this.onProviderChange=s,this.component.setup(),this.updateMenu(this.component.bookmarks.length)}var t,n;return t=e,(n=[{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;window.archive_analytics&&(null===(e=window.archive_analytics)||void 0===e||e.send_event_no_sampling("BookReader","BookmarksLogin",window.location.path))}}])&&Qi(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),ea=r.dy`
|
1361
|
+
<svg
|
1362
|
+
viewBox="0 0 100 100"
|
1363
|
+
xmlns="http://www.w3.org/2000/svg"
|
1364
|
+
aria-labelledby="shareTitleID shareDescID"
|
1365
|
+
>
|
1366
|
+
<title id="shareTitleID">Share icon</title>
|
1367
|
+
<desc id="shareDescID">A square with an arrow arcing out from the center of the square</desc>
|
1368
|
+
<g class="fill-color">
|
1369
|
+
<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>
|
1370
|
+
</g>
|
1371
|
+
</svg>
|
1372
|
+
`;class ta extends r.oi{static get styles(){return r.iv`
|
1373
|
+
:host {
|
1374
|
+
width: var(--iconWidth, 'auto');
|
1375
|
+
height: var(--iconHeight, 'auto');
|
1376
|
+
}
|
1377
|
+
|
1378
|
+
.fill-color {
|
1379
|
+
fill: var(--iconFillColor);
|
1380
|
+
}
|
1381
|
+
|
1382
|
+
.stroke-color {
|
1383
|
+
stroke: var(--iconStrokeColor);
|
1384
|
+
}
|
1385
|
+
`}render(){return ea}}function na(e){return(na="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ra(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function oa(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,r.key,r)}}function ia(e,t){return(ia=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function aa(e,t){if(t&&("object"===na(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)}function sa(e){return(sa=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}customElements.define("ia-icon-share",ta);var la=(0,Qt.XM)(function(e){!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&&ia(e,t)}(a,e);var t,n,r,o,i=(r=a,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=sa(r);if(o){var n=sa(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return aa(this,e)});function a(e){var t,n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),t=i.call(this,e),e.type!==Qt.pX.ATTRIBUTE||"class"!==e.name||(null===(n=e.strings)||void 0===n?void 0:n.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.");return aa(t)}return t=a,(n=[{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=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){s=!0,o=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw o}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ra(e,t);var n=Object.prototype.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)?ra(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.et){for(var a in this.et=new Set,void 0!==e.strings&&(this.st=new Set(e.strings.join(" ").split(/\s/).filter((function(e){return""!==e})))),i)i[a]&&!(null===(n=this.st)||void 0===n?void 0:n.has(a))&&this.et.add(a);return this.render(i)}var s=e.element.classList;for(var l in this.et.forEach((function(e){e in i||(s.remove(e),o.et.delete(e))})),i){var c=!!i[l];c===this.et.has(l)||(null===(r=this.st)||void 0===r?void 0:r.has(l))||(c?(s.add(l),this.et.add(l)):(s.remove(l),this.et.delete(l)))}return L.Jb}}])&&oa(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(Qt.Xe)),ca=r.dy`
|
1386
|
+
<svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="linkTitleID linkDescID">
|
1387
|
+
<title id="linkTitleID">Link icon</title>
|
1388
|
+
<desc id="linkDescID">Two chain links linked together</desc>
|
1389
|
+
<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" />
|
1390
|
+
</svg>
|
1391
|
+
`;class ua extends r.oi{static get styles(){return r.iv`
|
1392
|
+
:host {
|
1393
|
+
width: var(--iconWidth, 'auto');
|
1394
|
+
height: var(--iconHeight, 'auto');
|
1395
|
+
}
|
1396
|
+
|
1397
|
+
.fill-color {
|
1398
|
+
fill: var(--iconFillColor);
|
1399
|
+
}
|
1400
|
+
|
1401
|
+
.stroke-color {
|
1402
|
+
stroke: var(--iconStrokeColor);
|
1403
|
+
}
|
1404
|
+
`}render(){return ca}}customElements.define("ia-icon-link",ua);var da=r.iv`
|
1405
|
+
:host {
|
1406
|
+
display: block;
|
1407
|
+
height: 100%;
|
1408
|
+
overflow-y: auto;
|
1409
|
+
font-size: 1.4rem;
|
1410
|
+
box-sizing: border-box;
|
1411
|
+
}
|
1412
|
+
|
1413
|
+
header {
|
1414
|
+
display: flex;
|
1415
|
+
align-items: baseline;
|
1416
|
+
}
|
1417
|
+
|
1418
|
+
h3 {
|
1419
|
+
padding: 0;
|
1420
|
+
margin: 0 1rem 0 0;
|
1421
|
+
font-size: 1.6rem;
|
1422
|
+
}
|
1423
|
+
|
1424
|
+
h4 {
|
1425
|
+
font-size: 1.4rem;
|
1426
|
+
}
|
1427
|
+
|
1428
|
+
ul {
|
1429
|
+
padding: 0 0 2rem 0;
|
1430
|
+
list-style: none;
|
1431
|
+
}
|
1432
|
+
|
1433
|
+
li {
|
1434
|
+
padding: 0 0 1rem 0;
|
1435
|
+
}
|
1436
|
+
|
1437
|
+
li a {
|
1438
|
+
font-size: 1.6rem;
|
1439
|
+
text-decoration: none;
|
1440
|
+
color: var(--shareLinkColor);
|
1441
|
+
}
|
1442
|
+
|
1443
|
+
li a * {
|
1444
|
+
display: inline-block;
|
1445
|
+
padding: .2rem;
|
1446
|
+
margin-right: 1rem;
|
1447
|
+
vertical-align: middle;
|
1448
|
+
border: 1px solid var(--shareIconBorder);
|
1449
|
+
border-radius: 7px;
|
1450
|
+
background: var(--shareIconBg);
|
1451
|
+
}
|
1452
|
+
|
1453
|
+
.embed {
|
1454
|
+
display: none;
|
1455
|
+
}
|
1456
|
+
.embed.visible {
|
1457
|
+
display: block;
|
1458
|
+
width: 95%;
|
1459
|
+
}
|
1460
|
+
|
1461
|
+
.embed a {
|
1462
|
+
color: var(--shareLinkColor);
|
1463
|
+
}
|
1464
|
+
|
1465
|
+
.code {
|
1466
|
+
position: relative;
|
1467
|
+
}
|
1468
|
+
|
1469
|
+
textarea {
|
1470
|
+
display: block;
|
1471
|
+
width: 100%;
|
1472
|
+
height: 120px;
|
1473
|
+
padding: .8rem 1rem;
|
1474
|
+
box-sizing: border-box;
|
1475
|
+
resize: none;
|
1476
|
+
cursor: pointer;
|
1477
|
+
font: normal 1.4rem "Helvetica Neue", Helvetica, Arial, sans-serif;
|
1478
|
+
color: var(--textareaColor, #fff);
|
1479
|
+
background: var(--textareaBg, #151515);
|
1480
|
+
}
|
1481
|
+
|
1482
|
+
small {
|
1483
|
+
position: absolute;
|
1484
|
+
bottom: 0;
|
1485
|
+
left: 0;
|
1486
|
+
height: 3rem;
|
1487
|
+
padding: .5rem 1rem;
|
1488
|
+
box-sizing: border-box;
|
1489
|
+
font: normal 1.2rem/2rem "Helvetica Neue", Helvetica, Arial, sans-serif;
|
1490
|
+
color: var(--textareaBg, #151515);
|
1491
|
+
background: var(--textareaColor, #fff);
|
1492
|
+
opacity: 0;
|
1493
|
+
transition: opacity 300ms linear;
|
1494
|
+
}
|
1495
|
+
small.visible {
|
1496
|
+
opacity: 1;
|
1497
|
+
}
|
1498
|
+
`,ha=r.dy`
|
1499
|
+
<svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="emailTitleID emailDescID">
|
1500
|
+
<title id="emailTitleID">Email icon</title>
|
1501
|
+
<desc id="emailDescID">An illustration of an envelope</desc>
|
1502
|
+
<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" />
|
1503
|
+
</svg>
|
1504
|
+
`;class fa extends r.oi{static get styles(){return r.iv`
|
1505
|
+
:host {
|
1506
|
+
width: var(--iconWidth, 'auto');
|
1507
|
+
height: var(--iconHeight, 'auto');
|
1508
|
+
}
|
1509
|
+
|
1510
|
+
.fill-color {
|
1511
|
+
fill: var(--iconFillColor);
|
1512
|
+
}
|
1513
|
+
|
1514
|
+
.stroke-color {
|
1515
|
+
stroke: var(--iconStrokeColor);
|
1516
|
+
}
|
1517
|
+
`}render(){return ha}}customElements.define("ia-icon-email",fa);var pa=class{constructor(e){this.promoCopy=" : Free Download, Borrow, and Streaming : Internet Archive",Object.assign(this,e)}get encodedDescription(){return this.encodeString(this.description)}get encodedCreator(){return this.encodeString(this.creator)}get encodedPromoCopy(){return this.encodeString(this.promoCopy)}get itemPath(){const e=this.fileSubPrefix?encodeURIComponent(this.fileSubPrefix):"";return e?`${this.identifier}/${e}`:this.identifier}encodeString(e){return encodeURIComponent(e.replace(/\s/g,"+")).replace(/%2B/g,"+")}},ma=class extends pa{constructor(e){super(e),this.name="Email",this.icon=r.dy`<ia-icon-email></ia-icon-email>`,this.class="email"}get url(){return`mailto:?body=https://${this.baseHost}/details/${this.itemPath}&subject=${this.description} : ${this.creator}${this.promoCopy}`}},va=r.dy`
|
1518
|
+
<svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="facebookTitleID facebookDescID">
|
1519
|
+
<title id="facebookTitleID">Facebook icon</title>
|
1520
|
+
<desc id="facebookDescID">A lowercase f</desc>
|
1521
|
+
<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" />
|
1522
|
+
</svg>
|
1523
|
+
`;class ya extends r.oi{static get styles(){return r.iv`
|
1524
|
+
:host {
|
1525
|
+
width: var(--iconWidth, 'auto');
|
1526
|
+
height: var(--iconHeight, 'auto');
|
1527
|
+
}
|
1528
|
+
|
1529
|
+
.fill-color {
|
1530
|
+
fill: var(--iconFillColor);
|
1531
|
+
}
|
1532
|
+
|
1533
|
+
.stroke-color {
|
1534
|
+
stroke: var(--iconStrokeColor);
|
1535
|
+
}
|
1536
|
+
`}render(){return va}}customElements.define("ia-icon-facebook",ya);var ba=class extends pa{constructor(e){super(e),this.name="Facebook",this.icon=r.dy`<ia-icon-facebook></ia-icon-facebook>`,this.class="facebook"}get url(){return`https://www.facebook.com/sharer/sharer.php?u=https://${this.baseHost}/details/${this.itemPath}`}},ga=r.dy`
|
1537
|
+
<svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="pinterestTitleID pinterestDescID">
|
1538
|
+
<title id="pinterestTitleID">Pinterest icon</title>
|
1539
|
+
<desc id="pinterestDescID">A stylized letter p</desc>
|
1540
|
+
<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" />
|
1541
|
+
</svg>
|
1542
|
+
`;class ka extends r.oi{static get styles(){return r.iv`
|
1543
|
+
:host {
|
1544
|
+
width: var(--iconWidth, 'auto');
|
1545
|
+
height: var(--iconHeight, 'auto');
|
1546
|
+
}
|
1547
|
+
|
1548
|
+
.fill-color {
|
1549
|
+
fill: var(--iconFillColor);
|
1550
|
+
}
|
1551
|
+
|
1552
|
+
.stroke-color {
|
1553
|
+
stroke: var(--iconStrokeColor);
|
1554
|
+
}
|
1555
|
+
`}render(){return ga}}customElements.define("ia-icon-pinterest",ka);var wa=class extends pa{constructor(e){super(e),this.name="Pinterest",this.icon=r.dy`<ia-icon-pinterest></ia-icon-pinterest>`,this.class="pinterest"}get url(){return`http://www.pinterest.com/pin/create/button/?url=https://${this.baseHost}/details/${this.itemPath}&description=${this.encodedDescription}+%3A+${this.encodedCreator}${this.encodedPromoCopy}`}},Sa=r.dy`
|
1556
|
+
<svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="tumblrTitleID tumblrDescID">
|
1557
|
+
<title id="tumblrTitleID">Tumblr icon</title>
|
1558
|
+
<desc id="tumblrDescID">A lowercase letter t</desc>
|
1559
|
+
<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" />
|
1560
|
+
</svg>
|
1561
|
+
`;class Ca extends r.oi{static get styles(){return r.iv`
|
1562
|
+
:host {
|
1563
|
+
width: var(--iconWidth, 'auto');
|
1564
|
+
height: var(--iconHeight, 'auto');
|
1565
|
+
}
|
1566
|
+
|
1567
|
+
.fill-color {
|
1568
|
+
fill: var(--iconFillColor);
|
1569
|
+
}
|
1570
|
+
|
1571
|
+
.stroke-color {
|
1572
|
+
stroke: var(--iconStrokeColor);
|
1573
|
+
}
|
1574
|
+
`}render(){return Sa}}customElements.define("ia-icon-tumblr",Ca);var Oa=class extends pa{constructor(e){super(e),this.name="Tumblr",this.icon=r.dy`<ia-icon-tumblr></ia-icon-tumblr>`,this.class="tumblr"}get url(){return`https://www.tumblr.com/share/video?embed=%3Ciframe+width%3D%22640%22+height%3D%22480%22+frameborder%3D%220%22+allowfullscreen+src%3D%22https%3A%2F%2F${this.baseHost}%2Fembed%2F%22+webkitallowfullscreen%3D%22true%22+mozallowfullscreen%3D%22true%22%26gt%3B%26lt%3B%2Fiframe%3E&name=${this.encodedDescription}+%3A+${this.encodedCreator}${this.encodedPromoCopy}`}},xa=r.dy`
|
1575
|
+
<svg viewBox="0 0 34 34" xmlns="http://www.w3.org/2000/svg" aria-labelledby="twitterTitleID twitterDescID">
|
1576
|
+
<title id="twitterTitleID">Twitter icon</title>
|
1577
|
+
<desc id="twitterDescID">The Twitter logo, a cartoon bird</desc>
|
1578
|
+
<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" />
|
1579
|
+
</svg>
|
1580
|
+
`;class _a extends r.oi{static get styles(){return r.iv`
|
1581
|
+
:host {
|
1582
|
+
width: var(--iconWidth, 'auto');
|
1583
|
+
height: var(--iconHeight, 'auto');
|
1584
|
+
}
|
1585
|
+
|
1586
|
+
.fill-color {
|
1587
|
+
fill: var(--iconFillColor);
|
1588
|
+
}
|
1589
|
+
|
1590
|
+
.stroke-color {
|
1591
|
+
stroke: var(--iconStrokeColor);
|
1592
|
+
}
|
1593
|
+
`}render(){return xa}}customElements.define("ia-icon-twitter",_a);var ja=class extends pa{constructor(e){super(e),this.name="Twitter",this.icon=r.dy`<ia-icon-twitter></ia-icon-twitter>`,this.class="twitter"}get url(){return`https://twitter.com/intent/tweet?url=https://${this.baseHost}/details/${this.itemPath}&via=internetarchive&text=${this.encodedDescription}+%3A+${this.encodedCreator}${this.encodedPromoCopy}`}};const Pa=({currentTarget:e})=>{const t=e.querySelector("textarea"),n=e.querySelector("small");t.select(),document.execCommand("copy"),t.blur(),n.classList.add("visible"),clearTimeout(n.timeout),n.timeout=setTimeout((()=>n.classList.remove("visible")),4e3)};class Ba extends r.oi{static get styles(){return da}static get properties(){return{baseHost:{type:String},creator:{type:String},description:{type:String},embedOptionsVisible:{type:Boolean},identifier:{type:String},sharingOptions:{type:Array},type:{type:String},renderHeader:{type:Boolean},fileSubPrefix:{type:String}}}constructor(){super(),this.baseHost="",this.sharingOptions=[],this.fileSubPrefix=""}firstUpdated(){const{baseHost:e,creator:t,description:n,identifier:r,type:o,fileSubPrefix:i}=this,a={baseHost:e,creator:t,description:n,identifier:r,type:o,fileSubPrefix:i};this.sharingOptions=[new ja(a),new ba(a),new Oa(a),new wa(a),new ma(a)]}get sharingItems(){return this.sharingOptions.map((e=>r.dy`<li>
|
1594
|
+
<a class="${e.class}" href="${e.url}" target="_blank">
|
1595
|
+
${e.icon}
|
1596
|
+
${e.name}
|
1597
|
+
</a>
|
1598
|
+
</li>`))}get embedOption(){return r.dy`<li>
|
1599
|
+
<a href="#" @click=${this.toggleEmbedOptions}>
|
1600
|
+
<ia-icon-link></ia-icon-link>
|
1601
|
+
Get an embeddable link
|
1602
|
+
</a>
|
1603
|
+
</li>`}get iframeEmbed(){return r.dy`<iframe src="https://${this.baseHost}/embed/${this.identifier}" width="560" height="384" frameborder="0" webkitallowfullscreen="true" mozallowfullscreen="true" allowfullscreen></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}`}toggleEmbedOptions(e){e.preventDefault(),this.embedOptionsVisible=!this.embedOptionsVisible}get header(){const e=r.dy`<header><h3>Share this ${this.type}</h3></header>`;return this.renderHeader?e:L.Ld}render(){return r.dy`
|
1604
|
+
${this.header}
|
1605
|
+
<ul>
|
1606
|
+
${this.sharingItems}
|
1607
|
+
${this.embedOption}
|
1608
|
+
<div class=${la({visible:this.embedOptionsVisible,embed:!0})}>
|
1609
|
+
<h4>Embed</h4>
|
1610
|
+
<div class="code" @click=${Pa}>
|
1611
|
+
<textarea readonly="readonly">${this.iframeEmbed}</textarea>
|
1612
|
+
<small>Copied to clipboard</small>
|
1613
|
+
</div>
|
1614
|
+
<h4>Embed for wordpress.com hosted blogs and archive.org item <description> tags</h4>
|
1615
|
+
<div class="code" @click=${Pa}>
|
1616
|
+
<textarea readonly="readonly">${this.bbcodeEmbed}</textarea>
|
1617
|
+
<small>Copied to clipboard</small>
|
1618
|
+
</div>
|
1619
|
+
<p>Want more? <a href=${this.helpURL}>Advanced embedding details, examples, and help</a>!</p>
|
1620
|
+
</div>
|
1621
|
+
</ul>
|
1622
|
+
`}}var Ea,Ia;function La(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Ma(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,r.key,r)}}function Aa(e,t,n){return t&&Ma(e.prototype,t),n&&Ma(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}customElements.define("ia-sharing-options",Ba);var Ta,za,Ra,Da,$a,Na,Ha,Fa,Ua,Va=Aa((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.options.subPrefix||"";this.icon=(0,r.dy)(Ea||(Ea=La(['<ia-icon-share style="width: var(--iconWidth); height: var(--iconHeight);"></ia-icon-share>']))),this.label="Share this book",this.id="share",this.component=(0,r.dy)(Ia||(Ia=La(["<ia-sharing-options\n .identifier=","\n .type=","\n .creator=","\n .description=","\n .baseHost=","\n .fileSubPrefix=","\n ></ia-sharing-options>"])),s,"book",u,c,o,d)})),qa=(0,r.dy)(Ta||(Ta=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n<svg name="sort-desc" height="18" viewBox="0 0 18 18" width="18" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z" fill="#fff" fill-rule="nonzero"/><path d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z" fill="#fff" fill-rule="nonzero"/><path d="m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.661538"/></g></svg>\n']))),Wa=(0,r.dy)(za||(za=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n<svg name="sort-asc" height="18" viewBox="0 0 18 18" width="18" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z" fill="#fff" fill-rule="nonzero"/><path d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z" fill="#fff" fill-rule="nonzero"/><path d="m10.3846154 11.0769231 2.7692308 5.5384615 2.7692307-5.5384615m-2.7692307 4.1538461v-13.15384612" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.661538" transform="matrix(1 0 0 -1 0 18.692308)"/></g></svg>\n']))),Za=(0,r.dy)(Ra||(Ra=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n<svg name="sort-neutral" height="18" viewBox="0 0 18 18" width="18" xmlns="http://www.w3.org/2000/svg"><g fill="#fff" fill-rule="evenodd"><path d="m2.32514544 8.30769231.7756949-2.08468003h2.92824822l.75630252 2.08468003h1.01809955l-2.70523594-6.92307693h-1.01809955l-2.69553976 6.92307693zm3.41305753-2.86037492h-2.34647705l1.17323853-3.22883h.01939237z" fill-rule="nonzero"/><path d="m7.1689722 16.6153846v-.7756949h-4.4117647l4.29541047-5.3716871v-.77569491h-5.06140918v.77569491h3.97543633l-4.30510666 5.3716871v.7756949z" fill-rule="nonzero"/><circle cx="13" cy="9" r="2"/></g></svg>\n']))),Ga=(0,r.dy)(Da||(Da=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <svg height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" aria-labelledby="volumesTitleID volumesDescID">\n <title id="volumesTitleID">Volumes icon</title>\n <desc id="volumesDescID">Three books stacked on each other</desc>\n <g fill="#ffffff">\n <path fill="#ffffff" d="m9.83536396 0h10.07241114c.1725502.47117517.3378411.76385809.4958725.87804878.1295523.11419069.3199719.1998337.5712586.25692905.2512868.05709534.4704647.08564301.6575337.08564301h.2806036v15.24362526h-4.3355343v3.8106985h-4.44275v3.7250554h-12.01318261c-.27306495 0-.50313194-.085643-.69020098-.256929-.18706903-.1712861-.30936193-.3425721-.36687867-.5138581l-.06449694-.2785477v-14.2159091c0-.32815965.08627512-.5922949.25882537-.79240577.17255024-.20011086.34510049-.32150776.51765073-.36419068l.25882537-.0640244h3.36472977v-2.54767184c0-.31374722.08627513-.57067627.25882537-.77078714.17255025-.20011086.34510049-.32150776.51765074-.36419068l.25882536-.06402439h3.36472978v-2.56929047c0-.32815964.08627512-.5922949.25882537-.79240576.17255024-.20011087.34510049-.31430156.51765073-.34257207zm10.78355264 15.6294346v-13.53076498c-.2730649-.08536585-.4456152-.16380266-.5176507-.23531042-.1725502-.1424612-.2730649-.27078714-.3015441-.38497783v13.36031043h-9.87808272c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144124-.08962561.006929-.13988296.0640244-.05025735.0570953-.07538603.1427383-.07538603.256929s.02149898.210643.06449694.289357c.04299795.078714.08599591.1322062.12899387.1604767l.06449693.0216187h10.71905571zm-10.2449613-2.4412417h7.98003v-11.60421286h-7.98003zm1.6827837-9.41990022h4.6153002c.1725502 0 .3199718.05349224.4422647.16047672s.1834393.23891353.1834393.39578714c0 .15687362-.0611464.28519956-.1834393.38497783s-.2697145.1496674-.4422647.1496674h-4.6153002c-.1725503 0-.3199719-.04988913-.4422647-.1496674-.1222929-.09977827-.1834394-.22810421-.1834394-.38497783 0-.15687361.0611465-.28880266.1834394-.39578714.1222928-.10698448.2697144-.16047672.4422647-.16047672zm-6.08197737 13.50997782h7.72120467v-.8131929h-3.79610541c-.27306495 0-.49950224-.085643-.67931188-.256929-.17980964-.1712861-.29847284-.3425721-.35598958-.5138581l-.06449694-.2785477v-10.02023282h-2.82530086zm6.77217827-11.36890243h3.2139578c.1295522 0 .240956.05709534.3342113.17128603.0932554.11419069.139883.24972284.139883.40659645 0 .15687362-.0466276.28880267-.139883.39578714-.0932553.10698448-.2046591.16047672-.3342113.16047672h-3.2139578c-.1295523 0-.2373264-.05349224-.3233223-.16047672-.0859959-.10698447-.1289938-.23891352-.1289938-.39578714 0-.15687361.0429979-.29240576.1289938-.40659645s.19377-.17128603.3233223-.17128603zm-11.15043132 15.11557653h7.69942646v-.7491685h-3.79610539c-.25854616 0-.48135376-.0892462-.66842279-.2677384-.18706904-.1784922-.30936193-.3605876-.36687868-.546286l-.06449694-.2569291v-10.04101994h-2.80352266zm14.62237682-4.5606985h-.8191949v2.1410754h-9.89986085s-.04299796.0285477-.12899387.085643c-.08599592.0570954-.12201369.1427384-.10805331.2569291 0 .1141907.01786928.210643.05360784.289357.03573856.0787139.07538603.125.1189424.138858l.06449694.0432373h10.71905575v-2.9542683zm-4.3991936 3.8106985h-.8191949v2.077051h-9.8563045c0 .0144124-.02149898.0144124-.06449694 0-.04299795-.0144125-.08962561.0105321-.13988296.0748337-.05025735.0643015-.07538603.1607538-.07538603.289357 0 .1141906.02149898.2070399.06449694.2785476.04299795.0715078.08599591.1141907.12899387.1280488l.06449693.0216186h10.69811519v-2.8686252z" />\n </g>\n </svg>\n'])));function Ja(e){return(Ja="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ya(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Xa(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,r.key,r)}}function Qa(e,t){return(Qa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ka(e,t){if(t&&("object"===Ja(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)}function es(e){return(es=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ts,ns,rs,os,is=function(e){!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&&Qa(e,t)}(l,e);var t,n,o,i,a,s=(i=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=es(i);if(a){var n=es(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ka(this,e)});function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=s.call(this)).hostUrl="",e.sortOrderBy="",e.subPrefix="",e.viewableFiles=[],e}return t=l,o=[{key:"properties",get:function(){return{subPrefix:{type:String},hostUrl:{type:String},viewableFiles:{type:Array},sortOrderBy:{type:String}}}},{key:"styles",get:function(){return(0,r.iv)(Ua||(Ua=Ya(["\n :host {\n display: block;\n overflow-y: auto;\n box-sizing: border-box;\n color: var(--primaryTextColor);\n margin-top: 14px;\n margin-bottom: 2rem;\n --activeBorderWidth: 2px;\n }\n\n a {\n color: #ffffff;\n text-decoration: none\n }\n\n img {\n width: 35px;\n height: 45px;\n }\n\n ul {\n padding: 0;\n list-style: none;\n margin: var(--activeBorderWidth) 0.5rem 1rem 0;\n }\n\n ul > li:first-child .separator {\n display: none;\n }\n\n li {\n cursor: pointer;\n outline: none;\n position: relative;\n }\n\n li .content {\n padding: 2px 0 4px 2px;\n border: var(--activeBorderWidth) solid transparent;\n padding: .2rem 0 .4rem .2rem;\n }\n \n li .content.active {\n border: var(--activeBorderWidth) solid #538bc5;\n }\n\n small {\n font-style: italic;\n white-space: initial;\n }\n\n .container {\n display: flex;\n align-items: center;\n justify-content: center\n }\n\n .item-title {\n margin-block-start: 0em;\n margin-block-end: 0em;\n font-size: 14px;\n font-weight: bold;\n word-wrap: break-word;\n padding-left: 5px;\n }\n\n .separator {\n background-color: var(--secondaryBGColor);\n width: 98%;\n margin: 1px auto;\n height: 1px;\n }\n\n .text {\n padding-left: 10px;\n }\n\n .icon {\n display: inline-block;\n width: 14px;\n height: 14px;\n margin-left: .7rem;\n border: 1px solid var(--primaryTextColor);\n border-radius: 2px;\n background: var(--activeButtonBg) 50% 50% no-repeat;\n }\n\n "])))}}],(n=[{key:"firstUpdated",value:function(){var e=this.shadowRoot.querySelector(".content.active");setTimeout((function(){null!=e&&e.scrollIntoViewIfNeeded&&(null==e||e.scrollIntoViewIfNeeded(!0))}),350)}},{key:"volumeItemWithImageTitle",value:function(e){var t="default"===this.sortOrderBy?"".concat(this.hostUrl).concat(e.url_path):"".concat(this.hostUrl).concat(e.url_path,"?sort=").concat(this.sortOrderBy);return(0,r.dy)($a||($a=Ya(['\n <li class="content active">\n <div class="separator"></div>\n <a class="container" href="','">\n <div class="image">\n <img src="','">\n </div>\n <div class="text">\n <p class="item-title">',"</p>\n <small>by: ","</small>\n </div>\n </a>\n </li>\n "])),t,e.image,e.title,e.author)}},{key:"volumeItem",value:function(e){var t=this.subPrefix===e.file_subprefix?" active":"",n="default"===this.sortOrderBy?"".concat(this.hostUrl).concat(e.url_path):"".concat(this.hostUrl).concat(e.url_path,"?sort=").concat(this.sortOrderBy);return(0,r.dy)(Na||(Na=Ya(['\n <li>\n <div class="separator"></div>\n <div class="content','">\n <a href="https://','">\n <p class="item-title">',"</p>\n </a>\n </div>\n </li>\n "])),t,n,e.title)}},{key:"volumesList",get:function(){var e=Gr(this.viewableFiles,(function(e){return null==e?void 0:e.file_prefix}),this.volumeItem.bind(this));return(0,r.dy)(Ha||(Ha=Ya(["\n <ul>\n ",'\n <div class="separator"></div> \n </ul>\n '])),e)}},{key:"render",value:function(){return(0,r.dy)(Fa||(Fa=Ya(["\n ","\n "])),this.viewableFiles.length?this.volumesList:r.Ld)}}])&&Xa(t.prototype,n),o&&Xa(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.oi);function as(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ss(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function ls(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,r.key,r)}}customElements.define("viewable-files",is);var cs,us,ds,hs,fs,ps,ms,vs="title_asc",ys="title_desc",bs="default",gs=function(){function e(t){var n=t.baseHost,o=t.bookreader,i=t.onProviderChange;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.onProviderChange=i,this.component=document.createElement("viewable-files");var a=o.options.multipleBooksList.by_subprefix;if(this.viewableFiles=Object.keys(a).map((function(e){return a[e]})),this.volumeCount=Object.keys(a).length,this.bookreader=o,this.component.subPrefix=o.options.subPrefix||"",this.component.hostUrl=n,this.component.viewableFiles=this.viewableFiles,this.id="volumes",this.label="Viewable files (".concat(this.volumeCount,")"),this.icon=(0,r.dy)(ts||(ts=ss(["",""])),Ga),this.sortOrderBy=bs,this.bookreader.urlPlugin){this.bookreader.urlPlugin.pullFromAddressBar();var s=this.bookreader.urlPlugin.getUrlParam("sort");s!==vs&&s!==ys||(this.sortOrderBy=s)}this.sortVolumes(this.sortOrderBy)}var t,n;return t=e,(n=[{key:"sortButton",get:function(){var e=this;return{default:(0,r.dy)(ns||(ns=ss(['\n <button class="sort-by neutral-icon" aria-label="Sort volumes in initial order" @click=',">","</button>\n "])),(function(){return e.sortVolumes("title_asc")}),Za),title_asc:(0,r.dy)(rs||(rs=ss(['\n <button class="sort-by asc-icon" aria-label="Sort volumes in ascending order" @click=',">","</button>\n "])),(function(){return e.sortVolumes("title_desc")}),Wa),title_desc:(0,r.dy)(os||(os=ss(['\n <button class="sort-by desc-icon" aria-label="Sort volumes in descending order" @click=',">","</button>\n "])),(function(){return e.sortVolumes("default")}),qa)}[this.sortOrderBy]}},{key:"sortVolumes",value:function(e){var t,n;t=this.viewableFiles.sort((function(t,n){return e===vs?t.title.localeCompare(n.title):e===ys?n.title.localeCompare(t.title):t.orig_sort-n.orig_sort})),this.sortOrderBy=e,this.component.sortOrderBy=e,this.component.viewableFiles=function(e){if(Array.isArray(e))return as(e)}(n=t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(n)||function(e,t){if(e){if("string"==typeof e)return as(e,t);var n=Object.prototype.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)?as(e,t):void 0}}(n)||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.")}(),this.actionButton=this.sortButton,this.bookreader.urlPlugin&&(this.bookreader.urlPlugin.pullFromAddressBar(),this.sortOrderBy!==bs?this.bookreader.urlPlugin.setUrlParam("sort",e):this.bookreader.urlPlugin.removeUrlParam("sort")),this.onProviderChange(this.bookreader),this.multipleFilesClicked(e)}},{key:"multipleFilesClicked",value:function(e){var t;window.archive_analytics&&(null===(t=window.archive_analytics)||void 0===t||t.send_event_no_sampling("BookReader","VolumesSort|".concat(e),window.location.path))}}])&&ls(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),ks=(0,r.YP)(cs||(cs=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(['\n <svg class="ia-logo" width="27" height="30" viewBox="0 0 27 30" xmlns="http://www.w3.org/2000/svg" aria-labelledby="logoTitleID logoDescID">\n <title id="logoTitleID">Internet Archive logo</title>\n <desc id="logoDescID">A line drawing of the Internet Archive headquarters building façade.</desc>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <mask id="mask-2" fill="white">\n <path d="M26.6666667,28.6046512 L26.6666667,30 L0,30 L0.000283687943,28.6046512 L26.6666667,28.6046512 Z M25.6140351,26.5116279 L25.6140351,28.255814 L1.05263158,28.255814 L1.05263158,26.5116279 L25.6140351,26.5116279 Z M3.62469203,7.6744186 L3.91746909,7.82153285 L4.0639977,10.1739544 L4.21052632,13.9963932 L4.21052632,17.6725617 L4.0639977,22.255044 L4.03962296,25.3421929 L3.62469203,25.4651163 L2.16024641,25.4651163 L1.72094074,25.3421929 L1.55031755,22.255044 L1.40350877,17.6970339 L1.40350877,14.0211467 L1.55031755,10.1739544 L1.68423854,7.80887484 L1.98962322,7.6744186 L3.62469203,7.6744186 Z M24.6774869,7.6744186 L24.9706026,7.82153285 L25.1168803,10.1739544 L25.2631579,13.9963932 L25.2631579,17.6725617 L25.1168803,22.255044 L25.0927809,25.3421929 L24.6774869,25.4651163 L23.2130291,25.4651163 L22.7736357,25.3421929 L22.602418,22.255044 L22.4561404,17.6970339 L22.4561404,14.0211467 L22.602418,10.1739544 L22.7369262,7.80887484 L23.0420916,7.6744186 L24.6774869,7.6744186 Z M9.94042303,7.6744186 L10.2332293,7.82153285 L10.3797725,10.1739544 L10.5263158,13.9963932 L10.5263158,17.6725617 L10.3797725,22.255044 L10.3556756,25.3421929 L9.94042303,25.4651163 L8.47583122,25.4651163 L8.0362015,25.3421929 L7.86556129,22.255044 L7.71929825,17.6970339 L7.71929825,14.0211467 L7.86556129,10.1739544 L8.00005604,7.80887484 L8.30491081,7.6744186 L9.94042303,7.6744186 Z M18.0105985,7.6744186 L18.3034047,7.82153285 L18.449948,10.1739544 L18.5964912,13.9963932 L18.5964912,17.6725617 L18.449948,22.255044 L18.425851,25.3421929 L18.0105985,25.4651163 L16.5460067,25.4651163 L16.1066571,25.3421929 L15.9357367,22.255044 L15.7894737,17.6970339 L15.7894737,14.0211467 L15.9357367,10.1739544 L16.0702315,7.80887484 L16.3753664,7.6744186 L18.0105985,7.6744186 Z M25.6140351,4.53488372 L25.6140351,6.97674419 L1.05263158,6.97674419 L1.05263158,4.53488372 L25.6140351,4.53488372 Z M13.0806755,0 L25.9649123,2.93331338 L25.4484139,3.8372093 L0.771925248,3.8372093 L0,3.1041615 L13.0806755,0 Z" id="path-1"></path>\n </mask>\n <use fill="#FFFFFF" xlink:href="#path-1"></use>\n <g mask="url(#mask-2)" fill="#FFFFFF">\n <path d="M0,0 L26.6666667,0 L26.6666667,30 L0,30 L0,0 Z" id="swatch"></path>\n </g>\n </g>\n </svg>\n'])));function ws(e){return(ws="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ss(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Cs(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 Os(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cs(Object(n),!0).forEach((function(t){xs(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cs(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function xs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function js(e,t){return(js=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ps(e,t){if(t&&("object"===ws(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)}function Bs(e){return(Bs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Es,Is,Ls="updateSideMenu",Ms=function(e){!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&&js(e,t)}(l,e);var t,n,o,i,a,s=(i=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Bs(i);if(a){var n=Bs(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Ps(this,e)});function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=s.call(this)).itemMD=void 0,e.loaded=!1,e.bookReaderCannotLoad=!1,e.bookReaderLoaded=!1,e.bookreader=null,e.bookIsRestricted=!1,e.downloadableTypes=[],e.isAdmin=!1,e.lendingInitialized=!1,e.lendingStatus={},e.menuProviders={},e.menuShortcuts=[],e.signedIn=!1,e.modal=void 0,e.sharedObserver=void 0,e.fullscreenBranding=ks,e.sharedObserverHandler=void 0,e.brWidth=0,e.brHeight=0,e.shortcutOrder=["fullscreen","volumes","search","bookmarks"],e}return t=l,o=[{key:"properties",get:function(){return{itemMD:{type:Object},bookReaderLoaded:{type:Boolean},bookreader:{type:Object},bookIsRestricted:{type:Boolean},downloadableTypes:{type:Array},isAdmin:{type:Boolean},lendingInitialized:{type:Boolean},lendingStatus:{type:Object},menuProviders:{type:Object},menuShortcuts:{type:Array},signedIn:{type:Boolean},loaded:{type:Boolean},sharedObserver:{type:Object,attribute:!1},modal:{type:Object,attribute:!1},fullscreenBranding:{type:Object}}}},{key:"styles",get:function(){return(0,r.iv)(ms||(ms=Ss(["\n :host,\n #book-navigator__root,\n slot,\n slot > * {\n display: block;\n height: inherit;\n width: inherit;\n }\n .placeholder {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n margin: 5%;\n }\n .cover-img {\n max-height: 300px;\n }\n "])))}}],(n=[{key:"disconnectedCallback",value:function(){this.sharedObserver.removeObserver({target:this.mainBRContainer,handler:this.sharedObserverHandler})}},{key:"firstUpdated",value:function(){this.bindEventListeners(),this.emitPostInit(),this.loaded=!0}},{key:"updated",value:function(e){this.bookreader&&this.itemMD&&this.bookReaderLoaded&&((e.has("loaded")&&this.loaded||e.has("itemMD")||e.has("bookreader")||e.has("signedIn")||e.has("isAdmin")||e.has("modal"))&&this.initializeBookSubmenus(),e.has("sharedObserver")&&this.bookreader&&(this.loadSharedObserver(),this.initializeBookSubmenus()))}},{key:"emitPostInit",value:function(){var e;this.dispatchEvent(new CustomEvent("BrBookNav:".concat("PostInit"),{detail:{brSelector:null===(e=this.bookreader)||void 0===e?void 0:e.el},bubbles:!0,composed:!0}))}},{key:"baseProviderConfig",get:function(){return{baseHost:this.baseHost,modal:this.modal,sharedObserver:this.sharedObserver,bookreader:this.bookreader,item:this.itemMD,signedIn:this.signedIn,isAdmin:this.isAdmin,onProviderChange:function(){}}}},{key:"isWideEnoughToOpenMenu",get:function(){return this.brWidth>=640}},{key:"initializeBookSubmenus",value:function(){var e=this,t={downloads:new Ir(this.baseProviderConfig),share:new Va(this.baseProviderConfig),visualAdjustments:new _o(Os(Os({},this.baseProviderConfig),{},{onProviderChange:function(){e.updateMenuContents()}}))};this.bookreader.options.enableSearch&&(t.search=new fr(Os(Os({},this.baseProviderConfig),{},{onProviderChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t&&(e.bookreader=t),e.updateMenuContents(),!1!==n.openMenu&&(!e.isWideEnoughToOpenMenu||null!=n&&n.searchCanceled||setTimeout((function(){e.updateSideMenu("search","open")}),0))}}))),this.bookreader.options.enableBookmarks&&(t.bookmarks=new Ki(Os(Os({},this.baseProviderConfig),{},{onProviderChange:function(t){var n=Object.keys(t).length?"add":"remove";e["".concat(n,"MenuShortcut")]("bookmarks"),e.updateMenuContents()}}))),this.bookreader.options.enableMultipleBooks&&(t.volumes=new gs(Os(Os({},this.baseProviderConfig),{},{onProviderChange:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t&&(e.bookreader=t),e.updateMenuContents(),e.isWideEnoughToOpenMenu&&setTimeout((function(){e.updateSideMenu("volumes","open")}))}}))),this.menuProviders=t,this.addMenuShortcut("search"),this.addMenuShortcut("volumes"),this.updateMenuContents()}},{key:"mainBRContainer",get:function(){var e;return document.querySelector(null===(e=this.bookreader)||void 0===e?void 0:e.el)}},{key:"addFullscreenShortcut",value:function(){var e={icon:this.fullscreenShortcut,id:"fullscreen"};this.menuShortcuts.push(e),this.sortMenuShortcuts(),this.emitMenuShortcutsUpdated()}},{key:"deleteFullscreenShortcut",value:function(){var e=this.menuShortcuts.filter((function(e){return"fullscreen"!==e.id}));this.menuShortcuts=e,this.sortMenuShortcuts(),this.emitMenuShortcutsUpdated()}},{key:"closeFullscreen",value:function(){this.bookreader.exitFullScreen()}},{key:"fullscreenShortcut",get:function(){var e=this;return(0,r.dy)(us||(us=Ss(["\n <button\n @click=",'\n title="Exit fullscreen view"\n >',"</button>\n "])),(function(){return e.closeFullscreen()}),this.fullscreenBranding)}},{key:"updateSideMenu",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"open";if(e){var n=new CustomEvent(Ls,{detail:{menuId:e,action:t}});this.dispatchEvent(n)}}},{key:"updateMenuContents",value:function(){var e=this.menuProviders,t=e.search,n=e.downloads,r=e.visualAdjustments,o=e.share,i=e.bookmarks,a=[e.volumes,t,i,r,o].filter((function(e){return!!e}));this.shouldShowDownloadsMenu()&&(null==n||n.update(this.downloadableTypes),a.splice(1,0,n));var s=new CustomEvent("menuUpdated",{detail:a});this.dispatchEvent(s)}},{key:"shouldShowDownloadsMenu",value:function(){if(!1===this.bookIsRestricted)return!0;if(this.isAdmin)return!0;var e=this.lendingStatus.user_loan_record,t=void 0===e?{}:e;return!Array.isArray(t)&&t.type&&"SESSION_LOAN"!==t.type}},{key:"addMenuShortcut",value:function(e){this.menuShortcuts.find((function(t){return t.id===e}))||this.menuProviders[e]&&(this.menuShortcuts.push(this.menuProviders[e]),this.sortMenuShortcuts(),this.emitMenuShortcutsUpdated())}},{key:"removeMenuShortcut",value:function(e){this.menuShortcuts=this.menuShortcuts.filter((function(t){return t.id!==e})),this.emitMenuShortcutsUpdated()}},{key:"sortMenuShortcuts",value:function(){var e=this;this.menuShortcuts=this.shortcutOrder.reduce((function(t,n){var r=e.menuShortcuts.find((function(e){return e.id===n}));return r&&t.push(r),t}),[])}},{key:"emitMenuShortcutsUpdated",value:function(){var e=new CustomEvent("menuShortcutsUpdated",{detail:this.menuShortcuts});this.dispatchEvent(e)}},{key:"emitLoadingStatusUpdate",value:function(e){var t=new CustomEvent("loadingStateUpdated",{detail:{loaded:e}});this.dispatchEvent(t)}},{key:"bindEventListeners",value:function(){var e=this;window.addEventListener("BookReader:PostInit",(function(t){e.bookreader=t.detail.props,e.bookReaderLoaded=!0,e.bookReaderCannotLoad=!1,e.emitLoadingStatusUpdate(!0),e.loadSharedObserver(),setTimeout((function(){e.bookreader.resize()}),0)})),window.addEventListener("BookReader:fullscreenToggled",(function(t){var n=t.detail.props,r=void 0===n?null:n;r&&(e.bookreader=r),e.manageFullScreenBehavior()}),{passive:!0}),window.addEventListener("BookReader:ToggleSearchMenu",(function(t){e.dispatchEvent(new CustomEvent(Ls,{detail:{menuId:"search",action:"toggle"}}))})),window.addEventListener("LendingFlow:PostInit",(function(t){var n=t.detail,r=n.downloadTypesAvailable,o=n.lendingStatus,i=n.isAdmin,a=n.previewType;e.lendingInitialized=!0,e.downloadableTypes=r,e.lendingStatus=o,e.isAdmin=i,e.bookReaderCannotLoad="singlePagePreview"===a,e.emitLoadingStatusUpdate(!0)})),window.addEventListener("BRJSIA:PostInit",(function(t){var n=t.detail,r=n.isRestricted,o=n.downloadURLs;e.bookReaderLoaded=!0,e.downloadableTypes=o,e.bookIsRestricted=r}))}},{key:"loadSharedObserver",value:function(){var e;this.sharedObserverHandler={handleResize:this.handleResize.bind(this)},null===(e=this.sharedObserver)||void 0===e||e.addObserver({target:this.mainBRContainer,handler:this.sharedObserverHandler})}},{key:"handleResize",value:function(e){var t=e.contentRect,n=e.target,r=this.brWidth,o=this.brHeight,i=this.bookreader.animating;n===this.mainBRContainer&&(this.brWidth=t.width,this.brHeight=t.height),!r&&this.brWidth&&this.initializeBookSubmenus();var a,s=r!==this.brWidth,l=o!==this.brHeight;i||!s&&!l||null===(a=this.bookreader)||void 0===a||a.resize()}},{key:"manageFullScreenBehavior",value:function(){this.emitFullScreenState(),this.bookreader.options.enableFSLogoShortcut&&(this.bookreader.isFullscreen()?this.addFullscreenShortcut():this.deleteFullscreenShortcut())}},{key:"emitFullScreenState",value:function(){var e=this.bookreader.isFullscreen(),t=new CustomEvent("ViewportInFullScreen",{detail:{isFullScreen:e}});this.dispatchEvent(t)}},{key:"itemImage",get:function(){var e,t=null===(e=this.itemMD)||void 0===e?void 0:e.metadata.identifier,n="https://".concat(this.baseHost,"/services/img/").concat(t);return(0,r.dy)(ds||(ds=Ss(['<img class="cover-img" src=',' alt="cover image for ','">'])),n,t)}},{key:"placeholder",get:function(){return(0,r.dy)(hs||(hs=Ss(['<div class="placeholder">',"</div>"])),this.itemImage)}},{key:"render",value:function(){return(0,r.dy)(fs||(fs=Ss(['<div id="book-navigator__root">\n ',"\n ","\n </div>\n "])),this.bookReaderCannotLoad?this.placeholder:r.Ld,this.bookReaderCannotLoad?r.Ld:(0,r.dy)(ps||(ps=Ss(['<slot name="main"></slot>']))))}}])&&_s(t.prototype,n),o&&_s(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.oi);customElements.define("book-navigator",Ms);class As{constructor(){this.resizeObserver=new ResizeObserver((e=>{window.requestAnimationFrame((()=>{for(const t of e){const e=this.resizeHandlers.get(t.target);null==e||e.forEach((e=>{e.handleResize(t)}))}}))})),this.resizeHandlers=new Map}shutdown(){this.resizeHandlers.forEach(((e,t)=>{this.resizeObserver.unobserve(t)})),this.resizeHandlers.clear()}addObserver(e){var t;const n=null!==(t=this.resizeHandlers.get(e.target))&&void 0!==t?t:new Set;n.add(e.handler),this.resizeHandlers.set(e.target,n),this.resizeObserver.observe(e.target,e.options)}removeObserver(e){const t=this.resizeHandlers.get(e.target);t&&(t.delete(e.handler),0===t.size&&(this.resizeObserver.unobserve(e.target),this.resizeHandlers.delete(e.target)))}}function Ts(e){return(Ts="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zs(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function Rs(e){return function(e){if(Array.isArray(e))return Ds(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 Ds(e,t);var n=Object.prototype.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)?Ds(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 Ds(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ns(e,t){return(Ns=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Hs(e,t){if(t&&("object"===Ts(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)}function Fs(e){return(Fs=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Us=function(e){!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&&Ns(e,t)}(l,e);var t,n,o,i,a,s=(i=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Fs(i);if(a){var n=Fs(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return Hs(this,e)});function l(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(e=s.call(this)).item=void 0,e.bookreader=void 0,e.baseHost="https://archive.org",e.fullscreen=!1,e.signedIn=!1,e.modal=void 0,e.sharedObserver=void 0,e.loaded=!1,e.menuShortcuts=[],e.menuContents=[],e.openMenuName="",e}return t=l,o=[{key:"properties",get:function(){return{item:{type:Object},baseHost:{type:String},signedIn:{type:Boolean},fullscreen:{type:Boolean,reflect:!0,attribute:!0},sharedObserver:{type:Object,attribute:!1},modal:{type:Object,attribute:!1},loaded:{type:Boolean},menuShortcuts:{type:Array},menuContents:{type:Array}}}},{key:"styles",get:function(){return(0,r.iv)(Is||(Is=zs(['\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 ia-item-navigator[viewportinfullscreen] {\n position: fixed;\n inset: 0;\n height: 100%;\n min-height: unset;\n }\n\n .main-component {\n height: 100%;\n width: 100%;\n min-height: inherit;\n }\n\n div[slot="header"],\n div[slot="main"] {\n display: flex;\n width: 100%;\n }\n\n slot {\n display: block;\n flex: 1;\n }\n\n ia-item-navigator {\n min-height: var(--br-height, inherit);\n height: var(--br-height, inherit);\n display: block;\n width: 100%;\n color: var(--primaryTextColor);\n --menuButtonLabelDisplay: block;\n --menuWidth: 320px;\n --menuSliderBg: var(--secondaryBGColor);\n --activeButtonBg: var(--tertiaryBGColor);\n --subpanelRightBorderColor: var(--secondaryCTABorder);\n --animationTiming: 100ms;\n --iconFillColor: var(--primaryTextColor);\n --iconStrokeColor: var(--primaryTextColor);\n --menuSliderHeaderIconHeight: 2rem;\n --menuSliderHeaderIconWidth: 2rem;\n --iconWidth: 2.4rem;\n --iconHeight: 2.4rem;\n --shareLinkColor: var(--primaryTextColor);\n --shareIconBorder: var(--primaryTextColor);\n --shareIconBg: var(--secondaryBGColor);\n --activityIndicatorLoadingDotColor: var(--primaryTextColor);\n --activityIndicatorLoadingRingColor: var(--primaryTextColor);\n }\n '])))}}],(n=[{key:"updated",value:function(){this.modal||this.setModalManager(),this.sharedObserver||(this.sharedObserver=new As)}},{key:"itemNav",get:function(){return this.shadowRoot.querySelector("ia-item-navigator")}},{key:"setModalManager",value:function(){var e=document.querySelector("modal-manager");e||(e=document.createElement("modal-manager"),document.body.appendChild(e)),this.modal=e}},{key:"manageFullscreen",value:function(e){var t=!!e.detail.isFullScreen;this.fullscreen=t,this.dispatchEvent(new CustomEvent("fullscreenStateUpdated",{detail:{fullscreen:t}}))}},{key:"loadingStateUpdated",value:function(e){var t=e.detail.loaded;this.loaded=t||null,this.dispatchEvent(new CustomEvent("loadingStateUpdated",{detail:{loaded:t}}))}},{key:"setMenuShortcuts",value:function(e){this.menuShortcuts=Rs(e.detail)}},{key:"setMenuContents",value:function(e){var t=Rs(e.detail);this.menuContents=t}},{key:"manageSideMenuEvents",value:function(e){var t,n=e.detail,r=n.menuId,o=n.action;if(r)if(this.openMenuName=r,"open"===o)null===(t=this.itemNav)||void 0===t||t.openShortcut(r);else if("toggle"===o){var i;null===(i=this.itemNav)||void 0===i||i.toggleMenu()}}},{key:"render",value:function(){return(0,r.dy)(Es||(Es=zs(['\n <div class="main-component">\n <ia-item-navigator\n ?viewportInFullscreen=',"\n .basehost=","\n .item=","\n .modal=","\n .loaded=","\n .sharedObserver=","\n ?signedIn=","\n .menuShortcuts=","\n .menuContents=","\n .openMenu=",'\n >\n <div slot="header">\n <slot name="header"></slot>\n </div>\n <div slot="main">\n <book-navigator\n .modal=',"\n .baseHost=","\n .itemMD=","\n ?signedIn=","\n ?sideMenuOpen=","\n .sharedObserver=","\n @ViewportInFullScreen=","\n @loadingStateUpdated=","\n @updateSideMenu=","\n @menuUpdated=","\n @menuShortcutsUpdated=",'\n >\n <div slot="main">\n <slot name="main"></slot>\n </div>\n </book-navigator>\n </div>\n </ia-item-navigator>\n </div>\n '])),this.fullscreen,this.baseHost,this.item,this.modal,this.loaded,this.sharedObserver,this.signedIn,this.menuShortcuts,this.menuContents,this.openMenuName,this.modal,this.baseHost,this.item,this.signedIn,this.menuOpened,this.sharedObserver,this.manageFullscreen,this.loadingStateUpdated,this.manageSideMenuEvents,this.setMenuContents,this.setMenuShortcuts)}}])&&$s(t.prototype,n),o&&$s(t,o),Object.defineProperty(t,"prototype",{writable:!1}),l}(r.oi);window.customElements.define("ia-bookreader",Us)},8730:function(e,t,n){var r=n(111),o=Math.floor;e.exports=function(e){return!r(e)&&isFinite(e)&&o(e)===e}},6644:function(e,t,n){"use strict";var r=n(2109),o=n(3671).right,i=n(9341),a=n(7392),s=n(5268);r({target:"Array",proto:!0,forced:!i("reduceRight")||!s&&a>79&&a<83},{reduceRight:function(e){return o(this,e,arguments.length,arguments.length>1?arguments[1]:void 0)}})},3161:function(e,t,n){n(2109)({target:"Number",stat:!0},{isInteger:n(8730)})},4723:function(e,t,n){"use strict";var r=n(7007),o=n(9670),i=n(7466),a=n(1340),s=n(4488),l=n(1530),c=n(7651);r("match",(function(e,t,n){return[function(t){var n=s(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](a(n))},function(e){var r=o(this),s=a(e),u=n(t,r,s);if(u.done)return u.value;if(!r.global)return c(r,s);var d=r.unicode;r.lastIndex=0;for(var h,f=[],p=0;null!==(h=c(r,s));){var m=a(h[0]);f[p]=m,""===m&&(r.lastIndex=l(s,i(r.lastIndex),d)),p++}return 0===p?null:f}]}))},3774:function(e,t){!function(e){"use strict";function t(e,t,n,r){var o,i=!1,a=0;function s(){o&&clearTimeout(o)}function l(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=this,h=Date.now()-a;function f(){a=Date.now(),n.apply(d,c)}function p(){o=void 0}i||(r&&!o&&f(),s(),void 0===r&&h>e?f():!0!==t&&(o=setTimeout(r?p:f,void 0===r?e-h:e)))}return"boolean"!=typeof t&&(r=n,n=t,t=void 0),l.cancel=function(){s(),i=!0},l}e.debounce=function(e,n,r){return void 0===r?t(e,n,!1):t(e,r,!1!==n)},e.throttle=t,Object.defineProperty(e,"__esModule",{value:!0})}(t)}},function(e){e(e.s=7672)}]);
|
1623
|
+
//# sourceMappingURL=ia-bookreader-bundle.js.map
|