@internetarchive/bookreader 5.0.0-63 → 5.0.0-64
Sign up to get free protection for your applications and to get access to all the features.
- package/.github/workflows/node.js.yml +1 -0
- package/BookReader/BookReader.css +45 -58
- package/BookReader/BookReader.js +1 -1
- package/BookReader/BookReader.js.LICENSE.txt +2 -0
- package/BookReader/BookReader.js.map +1 -1
- package/BookReader/ia-bookreader-bundle.js +95 -95
- package/BookReader/ia-bookreader-bundle.js.LICENSE.txt +2 -0
- package/BookReader/ia-bookreader-bundle.js.map +1 -1
- package/BookReader/icons/1up.svg +1 -1
- package/BookReader/icons/2up.svg +1 -1
- package/BookReader/icons/advance.svg +1 -1
- package/BookReader/icons/chevron-right.svg +1 -1
- package/BookReader/icons/close-circle-dark.svg +1 -1
- package/BookReader/icons/close-circle.svg +1 -1
- package/BookReader/icons/fullscreen.svg +1 -1
- package/BookReader/icons/fullscreen_exit.svg +1 -1
- package/BookReader/icons/hamburger.svg +1 -1
- package/BookReader/icons/left-arrow.svg +1 -1
- package/BookReader/icons/magnify-minus.svg +1 -1
- package/BookReader/icons/magnify-plus.svg +1 -1
- package/BookReader/icons/magnify.svg +1 -1
- package/BookReader/icons/pause.svg +1 -1
- package/BookReader/icons/play.svg +1 -1
- package/BookReader/icons/playback-speed.svg +1 -1
- package/BookReader/icons/read-aloud.svg +1 -1
- package/BookReader/icons/review.svg +1 -1
- package/BookReader/icons/thumbnails.svg +1 -1
- package/BookReader/icons/voice.svg +1 -1
- package/BookReader/icons/volume-full.svg +1 -1
- package/BookReader/images/BRicons.svg +3 -3
- package/BookReader/images/books_graphic.svg +1 -1
- package/BookReader/images/icon_book.svg +1 -1
- package/BookReader/images/icon_bookmark.svg +1 -1
- package/BookReader/images/icon_gear.svg +1 -1
- package/BookReader/images/icon_hamburger.svg +1 -1
- package/BookReader/images/icon_home.svg +1 -1
- package/BookReader/images/icon_info.svg +1 -1
- package/BookReader/images/icon_one_page.svg +1 -1
- package/BookReader/images/icon_pause.svg +1 -1
- package/BookReader/images/icon_play.svg +1 -1
- package/BookReader/images/icon_search_button.svg +1 -1
- package/BookReader/images/icon_share.svg +1 -1
- package/BookReader/images/icon_skip-ahead.svg +1 -1
- package/BookReader/images/icon_skip-back.svg +1 -1
- package/BookReader/images/icon_speaker.svg +1 -1
- package/BookReader/images/icon_speaker_open.svg +1 -1
- package/BookReader/images/icon_thumbnails.svg +1 -1
- package/BookReader/images/icon_toc.svg +1 -1
- package/BookReader/images/icon_two_pages.svg +1 -1
- package/BookReader/images/marker_chap-off.svg +1 -1
- package/BookReader/images/marker_chap-on.svg +1 -1
- package/BookReader/images/marker_srch-on.svg +1 -1
- package/BookReader/jquery-3.js +1 -1
- 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 +2 -1
- package/BookReader/plugins/plugin.chapters.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.chapters.js.map +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 +2 -1
- package/BookReader/plugins/plugin.search.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.search.js.map +1 -1
- package/BookReader/plugins/plugin.text_selection.js +2 -1
- package/BookReader/plugins/plugin.text_selection.js.LICENSE.txt +1 -0
- package/BookReader/plugins/plugin.text_selection.js.map +1 -1
- package/BookReader/plugins/plugin.tts.js +1 -1
- package/BookReader/plugins/plugin.tts.js.LICENSE.txt +2 -0
- 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 +1 -1
- package/BookReader/webcomponents-bundle.js.map +1 -1
- package/CHANGELOG.md +5 -0
- package/babel.config.js +5 -4
- package/netlify.toml +4 -0
- package/package.json +15 -15
- package/src/BookNavigator/search/search-results.js +1 -7
- package/src/BookReader/utils.js +10 -0
- package/src/css/_BRnav.scss +2 -2
- package/src/css/_BRsearch.scss +38 -10
- package/src/plugins/search/plugin.search.js +14 -21
- package/src/plugins/search/utils.js +43 -0
- package/src/plugins/search/view.js +11 -24
- package/tests/e2e/helpers/desktopSearch.js +3 -3
- package/tests/jest/BookNavigator/search/search-results.test.js +6 -1
- package/tests/jest/BookReader/utils.test.js +12 -0
- package/tests/jest/plugins/search/plugin.search.test.js +2 -39
- package/tests/jest/plugins/search/plugin.search.view.test.js +5 -0
- package/tests/jest/plugins/search/utils.js +25 -0
- package/tests/jest/plugins/search/utils.test.js +29 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugins/plugin.autoplay.js","mappings":"mKAYuCA,E,oBAPvCC,EAAOC,OAAOC,WAAWC,eAAgB,CACvCC,sBAAsB,IAMxBF,WAAWG,UAAUC,OAAkBP,EAQpCG,WAAWG,UAAUC,MAPf,SAAUC,GACfR,EAAOS,KAAKC,KAAMF,GAElBE,KAAKC,MAAY,EACjBD,KAAKE,UAAY,KACjBF,KAAKG,UAAY,
|
1
|
+
{"version":3,"file":"plugins/plugin.autoplay.js","mappings":"mKAYuCA,E,oBAPvCC,EAAOC,OAAOC,WAAWC,eAAgB,CACvCC,sBAAsB,IAMxBF,WAAWG,UAAUC,OAAkBP,EAQpCG,WAAWG,UAAUC,MAPf,SAAUC,GACfR,EAAOS,KAAKC,KAAMF,GAElBE,KAAKC,MAAY,EACjBD,KAAKE,UAAY,KACjBF,KAAKG,UAAY,GACnB,GAMFV,WAAWG,UAAUQ,KAAQ,SAASd,GACpC,OAAO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C,IAAIf,EAAKgB,QAAQC,cAAejB,EAAKgB,QAAQE,gBAAkBlB,EAAKmB,KAAKC,cAAgB,EAChGpB,EAAKqB,KAAK,CAAEZ,aAAa,IAEzBT,EAAKQ,KAAK,CAAEC,aAAa,IAE7B,GAAG5B,KAAKG,YAERH,KAAKS,UAzCuC,CA2ChD,EAKAhB,WAAWG,UAAUa,SAAW,WACzBT,KAAKF,QAAQH,sBAEd,MAAQK,KAAKE,YACfuC,cAAczC,KAAKE,WACnBF,KAAKoB,UAAY,OACjBpB,KAAKa,EAAE,UAAUgB,OACjB7B,KAAKa,EAAE,SAASiB,OAChB9B,KAAKE,UAAY,KAErB,C","sources":["webpack://@internetarchive/bookreader/./src/plugins/plugin.autoplay.js"],"sourcesContent":["/*global BookReader */\n\n/**\n * Plugin which adds an autoplay feature. Useful for kiosk situations.\n */\njQuery.extend(BookReader.defaultOptions, {\n enableAutoPlayPlugin: true\n});\n\n/**\n * @override BookReader.setup\n */\nBookReader.prototype.setup = (function(super_) {\n return function (options) {\n super_.call(this, options);\n\n this.auto = false;\n this.autoTimer = null;\n this.flipDelay = 5000;\n };\n})(BookReader.prototype.setup);\n\n/**\n * @override BookReader.init\n */\nBookReader.prototype.init = (function(super_) {\n return function (options) {\n super_.call(this, options);\n\n if (!this.options.enableAutoPlayPlugin) return;\n this.bind(BookReader.eventNames.stop, () => this.autoStop());\n };\n})(BookReader.prototype.init);\n\n/**\n * @override BookReader.bindNavigationHandlers\n */\nBookReader.prototype.bindNavigationHandlers = (function(super_) {\n return function() {\n super_.call(this);\n\n if (!this.options.enableAutoPlayPlugin) return;\n\n // Note the mobile plugin attaches itself to body, so we need to select outside\n const jIcons = this.$('.BRicon').add('.BRmobileMenu .BRicon');\n\n jIcons.filter('.play').click(() => {\n this.autoToggle();\n return false;\n });\n\n jIcons.filter('.pause').click(() => {\n this.autoToggle();\n return false;\n });\n };\n})(BookReader.prototype.bindNavigationHandlers);\n\n/**\n * Starts autoplay mode\n * @param {object} overrides\n * @param {number} overrides.flipSpeed\n * @param {number} overrides.flipDelay\n */\nBookReader.prototype.autoToggle = function(overrides) {\n if (!this.options.enableAutoPlayPlugin) return;\n\n const options = $.extend({\n flipSpeed: this.flipSpeed,\n flipDelay: this.flipDelay\n }, overrides);\n\n this.flipSpeed = typeof options.flipSpeed === \"number\" ? options.flipSpeed : this.flipSpeed;\n this.flipDelay = typeof options.flipDelay === \"number\" ? options.flipDelay : this.flipDelay;\n this.trigger(BookReader.eventNames.stop);\n\n let bComingFrom1up = false;\n if (this.constMode2up != this.mode) {\n bComingFrom1up = true;\n this.switchMode(this.constMode2up);\n }\n\n if (null == this.autoTimer) {\n // $$$ Draw events currently cause layout problems when they occur during animation.\n // There is a specific problem when changing from 1-up immediately to autoplay in RTL so\n // we workaround for now by not triggering immediate animation in that case.\n // See https://bugs.launchpad.net/gnubook/+bug/328327\n if (('rl' == this.pageProgression) && bComingFrom1up) {\n // don't flip immediately -- wait until timer fires\n } else {\n // flip immediately\n this.next({ triggerStop: false });\n }\n\n this.$('.play').hide();\n this.$('.pause').show();\n this.autoTimer = setInterval(() => {\n if (this.animating) return;\n\n if (Math.max(this.twoPage.currentIndexL, this.twoPage.currentIndexR) >= this.book.getNumLeafs() - 1) {\n this.prev({ triggerStop: false }); // $$$ really what we want?\n } else {\n this.next({ triggerStop: false });\n }\n }, this.flipDelay);\n } else {\n this.autoStop();\n }\n};\n\n/**\n * Stop autoplay mode, allowing animations to finish\n */\nBookReader.prototype.autoStop = function() {\n if (!this.options.enableAutoPlayPlugin) return;\n\n if (null != this.autoTimer) {\n clearInterval(this.autoTimer);\n this.flipSpeed = 'fast';\n this.$('.pause').hide();\n this.$('.play').show();\n this.autoTimer = null;\n }\n};\n"],"names":["super_","jQuery","extend","BookReader","defaultOptions","enableAutoPlayPlugin","prototype","setup","options","call","this","auto","autoTimer","flipDelay","init","_this","bind","eventNames","stop","autoStop","bindNavigationHandlers","_this2","jIcons","$","add","filter","click","autoToggle","overrides","_this3","flipSpeed","trigger","bComingFrom1up","constMode2up","mode","switchMode","pageProgression","next","triggerStop","hide","show","setInterval","animating","Math","max","twoPage","currentIndexL","currentIndexR","book","getNumLeafs","prev","clearInterval"],"sourceRoot":""}
|
@@ -1,2 +1,3 @@
|
|
1
|
-
|
1
|
+
/*! For license information please see plugin.chapters.js.LICENSE.txt */
|
2
|
+
"use strict";(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[529],{8586:function(t,e,n){n(1058),n(9600),n(7327),n(1539),n(2222),n(9826),n(5069),n(4553),n(8674),n(2526),n(1817),n(2165),n(6992),n(8783),n(3948),n(2443),n(3680),n(3706),n(2703),n(489),n(4747),n(8309),n(7042);var r,o=n(5311),a=n(5311);function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}function c(){c=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function h(t,e,n,o){var a=e&&e.prototype instanceof d?e:d,i=Object.create(a.prototype),c=new L(o||[]);return r(i,"_invoke",{value:C(t,n,c)}),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var f={};function d(){}function v(){}function y(){}var g={};l(g,a,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(E([])));b&&b!==e&&n.call(b,a)&&(g=b);var w=y.prototype=d.prototype=Object.create(g);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function o(r,a,c,s){var u=p(t[r],t,a);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==i(h)&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){o("next",t,c,s)}),(function(t){o("throw",t,c,s)})):e.resolve(h).then((function(t){l.value=t,c(l)}),(function(t){return o("throw",t,c,s)}))}s(u.arg)}var a;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return a=a?a.then(r,r):r()}})}function C(t,e,n){var r="suspendedStart";return function(o,a){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw a;return{value:void 0,done:!0}}for(n.method=o,n.arg=a;;){var i=n.delegate;if(i){var c=R(i,n);if(c){if(c===f)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=p(t,e,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===f)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}function R(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,R(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=p(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var a=o.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function B(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function E(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:O}}function O(){return{value:void 0,done:!0}}return v.prototype=y,r(w,"constructor",{value:y,configurable:!0}),r(y,"constructor",{value:v,configurable:!0}),v.displayName=l(y,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},x(k.prototype),l(k.prototype,s,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new k(h(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(w),l(w,u,"Generator"),l(w,a,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=E,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(B),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return i.type="throw",i.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),s=n.call(a,"finallyLoc");if(c&&s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),B(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;B(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:E(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function s(t,e,n,r,o,a,i){try{var c=t[a](i),s=c.value}catch(t){return void n(t)}c.done?e(s):Promise.resolve(s).then(r,o)}function u(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function i(t){s(a,r,o,i,c,"next",t)}function c(t){s(a,r,o,i,c,"throw",t)}i(void 0)}))}}o.extend(BookReader.defaultOptions,{olHost:"https://openlibrary.org",enableChaptersPlugin:!0,bookId:""}),BookReader.prototype.setup=(r=BookReader.prototype.setup,function(t){r.call(this,t),this.olHost=t.olHost,this.enableChaptersPlugin=t.enableChaptersPlugin,this.bookId=t.bookId}),BookReader.prototype.init=function(t){return function(){var e=this;t.call(this),this.enableChaptersPlugin&&"embed"!==this.ui&&this.getOpenLibraryRecord(),this.enableMobileNav&&(this.bind(BookReader.eventNames.mobileNavOpen,(function(){e.updateTOCState(e.firstIndex,e._tocEntries),a("table-contents-list").parent().hasClass("mm-opened")&&e.updateTOCState(e.firstIndex,e._tocEntries)})),a(".BRmobileMenu__tableContents").on("click",(function(){e.updateTOCState(e.firstIndex,e._tocEntries)})))}}(BookReader.prototype.init),BookReader.prototype.addChapter=function(t,e,n){var r=this,o=BookReader.util.cssPercentage(n,this.book.getNumLeafs()-1),i=function(t){r.jumpToIndex(a(t.delegateTarget).data("pageIndex")),a(".current-chapter").removeClass("current-chapter"),a(t.delegateTarget).addClass("current-chapter")},c="".concat(t," | "),s="".concat("Page"," ").concat(e),u=a("<li></li>").append(a("<span class='BRTOCElementTitle'></span>").text(c)).append(a("<span class='BRTOCElementPage'></span>").text(s));u.addClass("BRtable-contents-el").appendTo(this.$(".table-contents-list")).data({pageIndex:n}),null!=n&&(a("<div></div>").append(a("<div />").text(c+s)).addClass("BRchapter").css({left:o}).appendTo(this.$(".BRnavline")).data({pageIndex:n}).on("mouseenter",(function(t){var e=t.currentTarget,n=e.querySelector("div"),o=n.getBoundingClientRect(),i=e.getBoundingClientRect(),c=2*parseInt(getComputedStyle(n).paddingLeft);o.x-c<0&&n.style.setProperty("transform","translateX(-".concat(i.left-c,"px)")),r.$(".BRsearch,.BRchapter").removeClass("front"),a(t.target).addClass("front")})).on("mouseleave",(function(t){return a(t.target).removeClass("front")})).on("click",i),u.bind("click",i).addClass("chapter-clickable").attr("data-event-click-tracking","BRTOCPanel|GoToChapter"))},BookReader.prototype.removeChapters=function(){this.$(".BRnavpos .BRchapter").remove()},BookReader.prototype.updateTOC=function(t){this.removeChapters(),this.enableMobileNav&&t.length>0&&this.$(".BRmobileMenu__tableContents").show();for(var e=0;e<t.length;e++)this.addChapterFromEntry(t[e]);this._tocEntries=t,a(".table-contents-list").children().each((function(e,n){t[e].mobileHTML=n}))},BookReader.prototype.addChapterFromEntry=function(t){t.pageIndex=this.book.getPageIndex(t.pagenum);var e=[t.label,t.title].filter((function(t){return t})).join(" ");this.addChapter(e,t.pagenum,t.pageIndex),this.$(".BRchapter, .BRsearch").each((function(t,e){var n=a(e);n.on("mouseenter",(function(){return n.addClass("front")})).on("mouseleave",(function(){return n.removeClass("front")}))}))},BookReader.prototype.getOpenLibraryRecord=u(c().mark((function t(){var e,n,r,o,i=this;return c().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e="".concat(this.olHost,"/query.json?type=/type/edition&*="),n="".concat(e,"&ocaid=").concat(this.bookId),r=function(t){t&&t.table_of_contents&&i.updateTOC(t.table_of_contents)},t.next=5,a.ajax({url:n,dataType:"jsonp"});case 5:if((o=t.sent)&&o.length){t.next=10;break}return t.next=9,a.ajax({url:"".concat(e,"&source_records=ia:").concat(this.bookId),dataType:"jsonp"});case 9:o=t.sent;case 10:o&&o.length>0&&r(o[0]);case 11:case"end":return t.stop()}}),t,this)}))),BookReader.prototype.buildMobileDrawerElement=function(t){return function(){var e=t.call(this);return this.enableMobileNav&&this.options.enableChaptersPlugin&&e.find(".BRmobileMenu__moreInfoRow").after(a('\n <li class="BRmobileMenu__tableContents" data-event-click-tracking="BRSidebar|TOCPanel">\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_toc.svg" alt="toc-icon"/>\n </span>\n Table of Contents\n </span>\n <div>\n <ol class="table-contents-list">\n </ol>\n </div>\n </li>')).hide()),e}}(BookReader.prototype.buildMobileDrawerElement),BookReader.prototype.updateTOCState=function(t,e){if(e){a(".current-chapter").removeClass("current-chapter");var n=e.filter((function(t){return null!=t.pageIndex})).reverse(),r=n[n.findIndex((function(e){return e.pageIndex<=t}))];null!=r&&a(r.mobileHTML).addClass("current-chapter")}}}},function(t){t(t.s=8586)}]);
|
2
3
|
//# sourceMappingURL=plugin.chapters.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugins/plugin.chapters.js","mappings":"mOAawCA,E,gVAPxCC,EAAOC,OAAOC,WAAWC,eAAgB,CACvCC,OAAQ,0BACRC,sBAAsB,EACtBC,OAAQ,KAIVJ,WAAWK,UAAUC,OAAmBT,EAQrCG,WAAWK,UAAUC,MAPf,SAAUC,GACfV,EAAOW,KAAKC,KAAMF,GAElBE,KAAKP,OAASK,EAAQL,OACtBO,KAAKN,qBAAuBI,EAAQJ,qBACpCM,KAAKL,OAASG,EAAQH,SAK1BJ,WAAWK,UAAUK,KAAQ,SAASb,GACpC,OAAO,WAAW,WAChBA,EAAOW,KAAKC,MACRA,KAAKN,sBAAoC,UAAZM,KAAKE,IACpCF,KAAKG,uBAEHH,KAAKI,kBACPJ,KAAKK,KAAKd,WAAWe,WAAWC,eAC9B,WACE,EAAKC,eAAe,EAAKC,WAAY,EAAKC,aACtCC,EAAE,uBAAuBC,SAASC,SAAS,cAC7C,EAAKL,eAAe,EAAKC,WAAY,EAAKC,gBAIhDC,EAAE,gCAAgCG,GAAG,SAAS,WAC5C,EAAKN,eAAe,EAAKC,WAAY,EAAKC,kBAhBrB,CAoB1BnB,WAAWK,UAAUK,MASxBV,WAAWK,UAAUmB,WAAa,SAASC,EAAcC,EAAYC,GAAW,WAExEC,EAAiB5B,WAAW6B,KAAKC,cAAcH,EAAWlB,KAAKsB,KAAKC,cAAgB,GACpFC,EAAgB,SAACC,GACrB,EAAKC,YAAYf,EAAEc,EAAME,gBAAgBC,KAAK,cAC9CjB,EAAE,oBAAo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BC,MAAM1E,EAAE,2NAAD,OAIHX,KAAKsF,cAJF,mPAYpCC,QAELb,GAlBsC,CAoB9CnF,WAAWK,UAAUuF,0BAQxB5F,WAAWK,UAAUY,eAAiB,SAASgF,EAAW7B,GAExD,GAAKA,EAAL,CACAhD,EAAE,oBAAoBkB,YAAY,mBAClC,IAAM4D,EAAoB9B,EAAWa,QAAO,SAACN,GAAD,OAAwB7B,MAAhB6B,EAAGhD,aAAwBwE,UACzEC,EAAcF,EAAkBA,EAAkBG,WACtD,SAAC1B,GAAD,OAAQA,EAAGhD,WAAasE,MACPnD,MAAfsD,GACFhF,EAAEgF,EAAYxB,YAAYrC,SAAS,uB","sources":["webpack://@internetarchive/bookreader/./src/plugins/plugin.chapters.js"],"sourcesContent":["/* global BookReader */\n/**\n * Plugin for chapter markers in BookReader. Fetches from openlibrary.org\n * Could be forked, or extended to alter behavior\n */\n\njQuery.extend(BookReader.defaultOptions, {\n olHost: 'https://openlibrary.org',\n enableChaptersPlugin: true,\n bookId: '',\n});\n\n/** @override Extend the constructor to add search properties */\nBookReader.prototype.setup = (function (super_) {\n return function (options) {\n super_.call(this, options);\n\n this.olHost = options.olHost;\n this.enableChaptersPlugin = options.enableChaptersPlugin;\n this.bookId = options.bookId;\n };\n})(BookReader.prototype.setup);\n\n/** @override Extend to call Open Library for TOC */\nBookReader.prototype.init = (function(super_) {\n return function() {\n super_.call(this);\n if (this.enableChaptersPlugin && this.ui !== 'embed') {\n this.getOpenLibraryRecord();\n }\n if (this.enableMobileNav) {\n this.bind(BookReader.eventNames.mobileNavOpen,\n () => {\n this.updateTOCState(this.firstIndex, this._tocEntries);\n if ($('table-contents-list').parent().hasClass('mm-opened')) {\n this.updateTOCState(this.firstIndex, this._tocEntries);\n }\n }\n );\n $(\".BRmobileMenu__tableContents\").on(\"click\", () => {\n this.updateTOCState(this.firstIndex, this._tocEntries);\n });\n }\n };\n})(BookReader.prototype.init);\n\n/**\n * Adds chapter marker to navigation scrubber\n *\n * @param {string} chapterTitle\n * @param {string} pageNumber\n * @param {number} pageIndex\n */\nBookReader.prototype.addChapter = function(chapterTitle, pageNumber, pageIndex) {\n const uiStringPage = 'Page'; // i18n\n const percentThrough = BookReader.util.cssPercentage(pageIndex, this.book.getNumLeafs() - 1);\n const jumpToChapter = (event) => {\n this.jumpToIndex($(event.delegateTarget).data('pageIndex'));\n $('.current-chapter').removeClass('current-chapter');\n $(event.delegateTarget).addClass('current-chapter');\n };\n const title = `${chapterTitle} | `;\n const pageStr = `${uiStringPage} ${pageNumber}`;\n\n //adding items to mobile table of contents\n const mobileChapter = $(`<li></li>`).append($(`<span class='BRTOCElementTitle'></span>`).text(title))\n .append($(`<span class='BRTOCElementPage'></span>`).text(pageStr));\n mobileChapter.addClass('BRtable-contents-el')\n .appendTo(this.$('.table-contents-list'))\n .data({ pageIndex });\n\n //adds .BRchapters to the slider only if pageIndex exists\n if (pageIndex != undefined) {\n $(`<div></div>`)\n .append($('<div />').text(title + pageStr))\n .addClass('BRchapter')\n .css({ left: percentThrough })\n .appendTo(this.$('.BRnavline'))\n .data({ pageIndex })\n .on(\"mouseenter\", event => {\n // remove hover effect from other markers then turn on just for this\n const marker = event.currentTarget;\n const tooltip = marker.querySelector('div');\n const tooltipOffset = tooltip.getBoundingClientRect();\n const targetOffset = marker.getBoundingClientRect();\n const boxSizeAdjust = parseInt(getComputedStyle(tooltip).paddingLeft) * 2;\n if (tooltipOffset.x - boxSizeAdjust < 0) {\n tooltip.style.setProperty('transform', `translateX(-${targetOffset.left - boxSizeAdjust}px)`);\n }\n this.$('.BRsearch,.BRchapter').removeClass('front');\n $(event.target).addClass('front');\n })\n .on(\"mouseleave\", event => $(event.target).removeClass('front'))\n .on('click', jumpToChapter);\n\n //adding clickable properties to mobile chapters\n mobileChapter.bind('click', jumpToChapter)\n .addClass('chapter-clickable')\n .attr(\"data-event-click-tracking\",\"BRTOCPanel|GoToChapter\");\n }\n\n};\n\n/*\n * Remove all chapters.\n */\nBookReader.prototype.removeChapters = function() {\n this.$('.BRnavpos .BRchapter').remove();\n};\n\n/**\n * Update the table of contents based on array of TOC entries.\n * @param {TocEntry[]} tocEntries\n */\nBookReader.prototype.updateTOC = function(tocEntries) {\n this.removeChapters();\n if (this.enableMobileNav && tocEntries.length > 0) {\n this.$(\".BRmobileMenu__tableContents\").show();\n }\n for (let i = 0; i < tocEntries.length; i++) {\n this.addChapterFromEntry(tocEntries[i]);\n }\n this._tocEntries = tocEntries;\n $('.table-contents-list').children().each((i, el) => {\n tocEntries[i].mobileHTML = el;\n });\n};\n\n/**\n * @typedef {Object} TocEntry\n * Table of contents entry as defined -- format is defined by Open Library\n * @property {string} pagenum\n * @property {number} level\n * @property {string} label\n * @property {{type: '/type/toc_item'}} type\n * @property {string} title\n * @property {HTMLElement} mobileHTML\n * @property {number} pageIndex\n\n *\n * @example {\n * \"pagenum\": \"17\",\n * \"level\": 1,\n * \"label\": \"CHAPTER I\",\n * \"type\": {\"key\": \"/type/toc_item\"},\n * \"title\": \"THE COUNTRY AND THE MISSION\"\n * }\n */\n\n/**\n * @param {TocEntry} tocEntryObject\n */\nBookReader.prototype.addChapterFromEntry = function(tocEntryObject) {\n tocEntryObject.pageIndex = this.book.getPageIndex(tocEntryObject['pagenum']);\n //creates a string with non-void tocEntryObject.label and tocEntryObject.title\n const chapterStr = [tocEntryObject.label, tocEntryObject.title]\n .filter(x => x)\n .join(' ');\n this.addChapter(chapterStr, tocEntryObject['pagenum'], tocEntryObject.pageIndex);\n this.$('.BRchapter, .BRsearch').each((i, el) => {\n const $el = $(el);\n $el\n .on(\"mouseenter\", () => $el.addClass('front'))\n .on(\"mouseleave\", () => $el.removeClass('front'));\n });\n};\n\n/**\n * getOpenLibraryRecord\n *\n * The bookreader is designed to call openlibrary API and constructs the\n * \"Return book\" button using the response.\n *\n * This makes a call to OL API and calls the given callback function with the\n * response from the API.\n */\nBookReader.prototype.getOpenLibraryRecord = async function () {\n // Try looking up by ocaid first, then by source_record\n const baseURL = `${this.olHost}/query.json?type=/type/edition&*=`;\n const fetchUrlByBookId = `${baseURL}&ocaid=${this.bookId}`;\n\n /*\n * Update Chapter markers based on received record from Open Library.\n * Notes that Open Library record is used for extra metadata, and also for lending\n */\n const setUpChapterMarkers = (olObject) => {\n if (olObject && olObject.table_of_contents) {\n // XXX check here that TOC is valid\n this.updateTOC(olObject.table_of_contents);\n }\n };\n\n let data = await $.ajax({ url: fetchUrlByBookId, dataType: 'jsonp' });\n\n if (!data || !data.length) {\n // try sourceid\n data = await $.ajax({ url: `${baseURL}&source_records=ia:${this.bookId}`, dataType: 'jsonp' });\n }\n\n if (data && data.length > 0) {\n setUpChapterMarkers(data[0]);\n }\n};\n\n// Extend buildMobileDrawerElement with table of contents list\nBookReader.prototype.buildMobileDrawerElement = (function (super_) {\n return function () {\n const $el = super_.call(this);\n if (this.enableMobileNav && this.options.enableChaptersPlugin) {\n $el.find('.BRmobileMenu__moreInfoRow').after($(`\n <li class=\"BRmobileMenu__tableContents\" data-event-click-tracking=\"BRSidebar|TOCPanel\">\n <span>\n <span class=\"DrawerIconWrapper\">\n <img class=\"DrawerIcon\" src=\"${this.imagesBaseURL}icon_toc.svg\" alt=\"toc-icon\"/>\n </span>\n Table of Contents\n </span>\n <div>\n <ol class=\"table-contents-list\">\n </ol>\n </div>\n </li>`).hide());\n }\n return $el;\n };\n})(BookReader.prototype.buildMobileDrawerElement);\n\n/**\n * highlights the current chapter based on current page\n * @private\n * @param {TocEntry[]} tocEntries\n * @param {number} tocEntries\n */\nBookReader.prototype.updateTOCState = function(currIndex, tocEntries) {\n //this function won't have any effects if called before OpenLibrary request is finished\n if (!tocEntries) {return;}\n $('.current-chapter').removeClass('current-chapter');\n const tocEntriesIndexed = tocEntries.filter((el) => el.pageIndex != undefined).reverse();\n const currChapter = tocEntriesIndexed[tocEntriesIndexed.findIndex(\n (el) => el.pageIndex <= currIndex)];\n if (currChapter != undefined) {\n $(currChapter.mobileHTML).addClass('current-chapter');\n }\n};\n"],"names":["super_","jQuery","extend","BookReader","defaultOptions","olHost","enableChaptersPlugin","bookId","prototype","setup","options","call","this","init","ui","getOpenLibraryRecord","enableMobileNav","bind","eventNames","mobileNavOpen","updateTOCState","firstIndex","_tocEntries","$","parent","hasClass","on","addChapter","chapterTitle","pageNumber","pageIndex","percentThrough","util","cssPercentage","book","getNumLeafs","jumpToChapter","event","jumpToIndex","delegateTarget","data","removeClass","addClass","title","pageStr","mobileChapter","append","text","appendTo","undefined","css","left","marker","currentTarget","tooltip","querySelector","tooltipOffset","getBoundingClientRect","targetOffset","boxSizeAdjust","parseInt","getComputedStyle","paddingLeft","x","style","setProperty","target","attr","removeChapters","remove","updateTOC","tocEntries","length","show","i","addChapterFromEntry","children","each","el","mobileHTML","tocEntryObject","getPageIndex","chapterStr","label","filter","join","$el","baseURL","fetchUrlByBookId","setUpChapterMarkers","olObject","table_of_contents","ajax","url","dataType","buildMobileDrawerElement","find","after","imagesBaseURL","hide","currIndex","tocEntriesIndexed","reverse","currChapter","findIndex"],"sourceRoot":""}
|
1
|
+
{"version":3,"file":"plugins/plugin.chapters.js","mappings":";0UAawCA,yQAZxCC,EAAA,kBAAAC,CAAA,MAAAA,EAAA,GAAAC,EAAAC,OAAAC,UAAAC,EAAAH,EAAAI,eAAAC,EAAAJ,OAAAI,gBAAA,SAAAC,EAAAC,EAAAC,GAAAF,EAAAC,GAAAC,EAAAC,KAAA,EAAAC,EAAA,mBAAAC,OAAAA,OAAA,GAAAC,EAAAF,EAAAG,UAAA,aAAAC,EAAAJ,EAAAK,eAAA,kBAAAC,EAAAN,EAAAO,aAAA,yBAAAC,EAAAZ,EAAAC,EAAAE,GAAA,OAAAR,OAAAI,eAAAC,EAAAC,EAAA,CAAAE,MAAAA,EAAAU,YAAA,EAAAC,cAAA,EAAAC,UAAA,IAAAf,EAAAC,EAAA,KAAAW,EAAA,aAAAI,GAAAJ,EAAA,SAAAZ,EAAAC,EAAAE,GAAA,OAAAH,EAAAC,GAAAE,CAAA,WAAAc,EAAAC,EAAAC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AAYA,EAASC,mBAEvBH,EAAKnB,UAAUqB,EAASC,kBAE5B,EAACF,EAAA1J,KAAA,EAEgBsF,EAAEuE,KAAK,CAAEC,IAAKP,EAAkBQ,SAAU,UAAU,OAA7D,IAAJvD,EAAIkD,EAAAnK,OAEMiH,EAAKvF,OAAM,CAAAyI,EAAA1J,KAAA,gBAAA0J,EAAA1J,KAAA,EAEVsF,EAAEuE,KAAK,CAAEC,IAAK,GAAFlD,OAAK0C,EAAO,uBAAA1C,OAAsBlC,KAAKH,QAAUwF,SAAU,UAAU,OAA9FvD,EAAIkD,EAAAnK,KAAA,QAGFiH,GAAQA,EAAKvF,OAAS,GACxBuI,EAAoBhD,EAAK,IAC1B,yBAAAkD,EAAAhH,OAAA,GAAA2G,EAAA,UAIHlF,WAAWpJ,UAAUiP,yBAA4B,SAAUtP,GACzD,OAAO,WACL,IAAM0O,EAAM1O,EAAO0C,KAAKsH,MAgBxB,OAfIA,KAAKK,iBAAmBL,KAAKD,QAAQH,sBACvC8E,EAAIa,KAAK,8BAA8BC,MAAM5E,EAAE,2NAADsB,OAIHlC,KAAKyF,cAAa,mPAQnDC,QAELhB,CACT,CACF,CApBiD,CAoB9CjF,WAAWpJ,UAAUiP,0BAQxB7F,WAAWpJ,UAAUoK,eAAiB,SAASkF,EAAW9B,GAExD,GAAKA,EAAL,CACAjD,EAAE,oBAAoBmB,YAAY,mBAClC,IAAM6D,EAAoB/B,EAAWW,QAAO,SAACN,GAAE,OAAqB1J,MAAhB0J,EAAG/C,SAAsB,IAAEzD,UACzEmI,EAAcD,EAAkBA,EAAkBE,WACtD,SAAC5B,GAAE,OAAKA,EAAG/C,WAAawE,CAAS,KAChBnL,MAAfqL,GACFjF,EAAEiF,EAAY1B,YAAYnC,SAAS,kBANZ,CAQ3B","sources":["webpack://@internetarchive/bookreader/./src/plugins/plugin.chapters.js"],"sourcesContent":["/* global BookReader */\n/**\n * Plugin for chapter markers in BookReader. Fetches from openlibrary.org\n * Could be forked, or extended to alter behavior\n */\n\njQuery.extend(BookReader.defaultOptions, {\n olHost: 'https://openlibrary.org',\n enableChaptersPlugin: true,\n bookId: '',\n});\n\n/** @override Extend the constructor to add search properties */\nBookReader.prototype.setup = (function (super_) {\n return function (options) {\n super_.call(this, options);\n\n this.olHost = options.olHost;\n this.enableChaptersPlugin = options.enableChaptersPlugin;\n this.bookId = options.bookId;\n };\n})(BookReader.prototype.setup);\n\n/** @override Extend to call Open Library for TOC */\nBookReader.prototype.init = (function(super_) {\n return function() {\n super_.call(this);\n if (this.enableChaptersPlugin && this.ui !== 'embed') {\n this.getOpenLibraryRecord();\n }\n if (this.enableMobileNav) {\n this.bind(BookReader.eventNames.mobileNavOpen,\n () => {\n this.updateTOCState(this.firstIndex, this._tocEntries);\n if ($('table-contents-list').parent().hasClass('mm-opened')) {\n this.updateTOCState(this.firstIndex, this._tocEntries);\n }\n }\n );\n $(\".BRmobileMenu__tableContents\").on(\"click\", () => {\n this.updateTOCState(this.firstIndex, this._tocEntries);\n });\n }\n };\n})(BookReader.prototype.init);\n\n/**\n * Adds chapter marker to navigation scrubber\n *\n * @param {string} chapterTitle\n * @param {string} pageNumber\n * @param {number} pageIndex\n */\nBookReader.prototype.addChapter = function(chapterTitle, pageNumber, pageIndex) {\n const uiStringPage = 'Page'; // i18n\n const percentThrough = BookReader.util.cssPercentage(pageIndex, this.book.getNumLeafs() - 1);\n const jumpToChapter = (event) => {\n this.jumpToIndex($(event.delegateTarget).data('pageIndex'));\n $('.current-chapter').removeClass('current-chapter');\n $(event.delegateTarget).addClass('current-chapter');\n };\n const title = `${chapterTitle} | `;\n const pageStr = `${uiStringPage} ${pageNumber}`;\n\n //adding items to mobile table of contents\n const mobileChapter = $(`<li></li>`).append($(`<span class='BRTOCElementTitle'></span>`).text(title))\n .append($(`<span class='BRTOCElementPage'></span>`).text(pageStr));\n mobileChapter.addClass('BRtable-contents-el')\n .appendTo(this.$('.table-contents-list'))\n .data({ pageIndex });\n\n //adds .BRchapters to the slider only if pageIndex exists\n if (pageIndex != undefined) {\n $(`<div></div>`)\n .append($('<div />').text(title + pageStr))\n .addClass('BRchapter')\n .css({ left: percentThrough })\n .appendTo(this.$('.BRnavline'))\n .data({ pageIndex })\n .on(\"mouseenter\", event => {\n // remove hover effect from other markers then turn on just for this\n const marker = event.currentTarget;\n const tooltip = marker.querySelector('div');\n const tooltipOffset = tooltip.getBoundingClientRect();\n const targetOffset = marker.getBoundingClientRect();\n const boxSizeAdjust = parseInt(getComputedStyle(tooltip).paddingLeft) * 2;\n if (tooltipOffset.x - boxSizeAdjust < 0) {\n tooltip.style.setProperty('transform', `translateX(-${targetOffset.left - boxSizeAdjust}px)`);\n }\n this.$('.BRsearch,.BRchapter').removeClass('front');\n $(event.target).addClass('front');\n })\n .on(\"mouseleave\", event => $(event.target).removeClass('front'))\n .on('click', jumpToChapter);\n\n //adding clickable properties to mobile chapters\n mobileChapter.bind('click', jumpToChapter)\n .addClass('chapter-clickable')\n .attr(\"data-event-click-tracking\",\"BRTOCPanel|GoToChapter\");\n }\n\n};\n\n/*\n * Remove all chapters.\n */\nBookReader.prototype.removeChapters = function() {\n this.$('.BRnavpos .BRchapter').remove();\n};\n\n/**\n * Update the table of contents based on array of TOC entries.\n * @param {TocEntry[]} tocEntries\n */\nBookReader.prototype.updateTOC = function(tocEntries) {\n this.removeChapters();\n if (this.enableMobileNav && tocEntries.length > 0) {\n this.$(\".BRmobileMenu__tableContents\").show();\n }\n for (let i = 0; i < tocEntries.length; i++) {\n this.addChapterFromEntry(tocEntries[i]);\n }\n this._tocEntries = tocEntries;\n $('.table-contents-list').children().each((i, el) => {\n tocEntries[i].mobileHTML = el;\n });\n};\n\n/**\n * @typedef {Object} TocEntry\n * Table of contents entry as defined -- format is defined by Open Library\n * @property {string} pagenum\n * @property {number} level\n * @property {string} label\n * @property {{type: '/type/toc_item'}} type\n * @property {string} title\n * @property {HTMLElement} mobileHTML\n * @property {number} pageIndex\n\n *\n * @example {\n * \"pagenum\": \"17\",\n * \"level\": 1,\n * \"label\": \"CHAPTER I\",\n * \"type\": {\"key\": \"/type/toc_item\"},\n * \"title\": \"THE COUNTRY AND THE MISSION\"\n * }\n */\n\n/**\n * @param {TocEntry} tocEntryObject\n */\nBookReader.prototype.addChapterFromEntry = function(tocEntryObject) {\n tocEntryObject.pageIndex = this.book.getPageIndex(tocEntryObject['pagenum']);\n //creates a string with non-void tocEntryObject.label and tocEntryObject.title\n const chapterStr = [tocEntryObject.label, tocEntryObject.title]\n .filter(x => x)\n .join(' ');\n this.addChapter(chapterStr, tocEntryObject['pagenum'], tocEntryObject.pageIndex);\n this.$('.BRchapter, .BRsearch').each((i, el) => {\n const $el = $(el);\n $el\n .on(\"mouseenter\", () => $el.addClass('front'))\n .on(\"mouseleave\", () => $el.removeClass('front'));\n });\n};\n\n/**\n * getOpenLibraryRecord\n *\n * The bookreader is designed to call openlibrary API and constructs the\n * \"Return book\" button using the response.\n *\n * This makes a call to OL API and calls the given callback function with the\n * response from the API.\n */\nBookReader.prototype.getOpenLibraryRecord = async function () {\n // Try looking up by ocaid first, then by source_record\n const baseURL = `${this.olHost}/query.json?type=/type/edition&*=`;\n const fetchUrlByBookId = `${baseURL}&ocaid=${this.bookId}`;\n\n /*\n * Update Chapter markers based on received record from Open Library.\n * Notes that Open Library record is used for extra metadata, and also for lending\n */\n const setUpChapterMarkers = (olObject) => {\n if (olObject && olObject.table_of_contents) {\n // XXX check here that TOC is valid\n this.updateTOC(olObject.table_of_contents);\n }\n };\n\n let data = await $.ajax({ url: fetchUrlByBookId, dataType: 'jsonp' });\n\n if (!data || !data.length) {\n // try sourceid\n data = await $.ajax({ url: `${baseURL}&source_records=ia:${this.bookId}`, dataType: 'jsonp' });\n }\n\n if (data && data.length > 0) {\n setUpChapterMarkers(data[0]);\n }\n};\n\n// Extend buildMobileDrawerElement with table of contents list\nBookReader.prototype.buildMobileDrawerElement = (function (super_) {\n return function () {\n const $el = super_.call(this);\n if (this.enableMobileNav && this.options.enableChaptersPlugin) {\n $el.find('.BRmobileMenu__moreInfoRow').after($(`\n <li class=\"BRmobileMenu__tableContents\" data-event-click-tracking=\"BRSidebar|TOCPanel\">\n <span>\n <span class=\"DrawerIconWrapper\">\n <img class=\"DrawerIcon\" src=\"${this.imagesBaseURL}icon_toc.svg\" alt=\"toc-icon\"/>\n </span>\n Table of Contents\n </span>\n <div>\n <ol class=\"table-contents-list\">\n </ol>\n </div>\n </li>`).hide());\n }\n return $el;\n };\n})(BookReader.prototype.buildMobileDrawerElement);\n\n/**\n * highlights the current chapter based on current page\n * @private\n * @param {TocEntry[]} tocEntries\n * @param {number} tocEntries\n */\nBookReader.prototype.updateTOCState = function(currIndex, tocEntries) {\n //this function won't have any effects if called before OpenLibrary request is finished\n if (!tocEntries) {return;}\n $('.current-chapter').removeClass('current-chapter');\n const tocEntriesIndexed = tocEntries.filter((el) => el.pageIndex != undefined).reverse();\n const currChapter = tocEntriesIndexed[tocEntriesIndexed.findIndex(\n (el) => el.pageIndex <= currIndex)];\n if (currChapter != undefined) {\n $(currChapter.mobileHTML).addClass('current-chapter');\n }\n};\n"],"names":["super_","_regeneratorRuntime","exports","Op","Object","prototype","hasOwn","hasOwnProperty","defineProperty","obj","key","desc","value","$Symbol","Symbol","iteratorSymbol","iterator","asyncIteratorSymbol","asyncIterator","toStringTagSymbol","toStringTag","define","enumerable","configurable","writable","err","wrap","innerFn","outerFn","self","tryLocsList","protoGenerator","Generator","generator","create","context","Context","makeInvokeMethod","tryCatch","fn","arg","type","call","ContinueSentinel","GeneratorFunction","GeneratorFunctionPrototype","IteratorPrototype","getProto","getPrototypeOf","NativeIteratorPrototype","values","Gp","defineIteratorMethods","forEach","method","_invoke","AsyncIterator","PromiseImpl","invoke","resolve","reject","record","result","_typeof","__await","then","unwrapped","error","previousPromise","callInvokeWithMethodAndArg","state","Error","undefined","done","delegate","delegateResult","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","methodName","return","TypeError","info","resultName","next","nextLoc","pushTryEntry","locs","entry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","iterable","iteratorMethod","isNaN","length","i","doneResult","displayName","isGeneratorFunction","genFun","ctor","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","iter","keys","val","object","reverse","pop","skipTempReset","prev","charAt","slice","stop","rootRecord","rval","exception","handle","loc","caught","hasCatch","hasFinally","finallyEntry","complete","finish","catch","thrown","delegateYield","asyncGeneratorStep","gen","_next","_throw","_asyncToGenerator","args","arguments","apply","jQuery","extend","BookReader","defaultOptions","olHost","enableChaptersPlugin","bookId","setup","options","this","init","_this","ui","getOpenLibraryRecord","enableMobileNav","bind","eventNames","mobileNavOpen","updateTOCState","firstIndex","_tocEntries","$","parent","hasClass","on","addChapter","chapterTitle","pageNumber","pageIndex","_this2","percentThrough","util","cssPercentage","book","getNumLeafs","jumpToChapter","event","jumpToIndex","delegateTarget","data","removeClass","addClass","title","concat","pageStr","mobileChapter","append","text","appendTo","css","left","marker","currentTarget","tooltip","querySelector","tooltipOffset","getBoundingClientRect","targetOffset","boxSizeAdjust","parseInt","getComputedStyle","paddingLeft","x","style","setProperty","target","attr","removeChapters","remove","updateTOC","tocEntries","show","addChapterFromEntry","children","each","el","mobileHTML","tocEntryObject","getPageIndex","chapterStr","label","filter","join","$el","_callee","baseURL","fetchUrlByBookId","setUpChapterMarkers","_this3","_context","olObject","table_of_contents","ajax","url","dataType","buildMobileDrawerElement","find","after","imagesBaseURL","hide","currIndex","tocEntriesIndexed","currChapter","findIndex"],"sourceRoot":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugins/plugin.iframe.js","mappings":"+IAMA,IAEuCA,EAFjCC,EAA+B,2BAErCC,WAAWC,UAAUC,MAAkBJ,EAKpCE,WAAWC,UAAUC,KAJf,WACLJ,EAAOK,KAAKC,MAcT,SAA+BC,GAA4B,IAAxBC,
|
1
|
+
{"version":3,"file":"plugins/plugin.iframe.js","mappings":"+IAMA,IAEuCA,EAFjCC,EAA+B,2BAErCC,WAAWC,UAAUC,MAAkBJ,EAKpCE,WAAWC,UAAUC,KAJf,WACLJ,EAAOK,KAAKC,MAcT,SAA+BC,GAA4B,IAAxBC,EAAMC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAGG,OAAOJ,OAEnDA,IAILD,EAAGM,KAAKX,WAAWY,WAAWC,gBAAgB,WAC5C,IAAMC,EAAWT,EAAGU,mBAAmBV,EAAGW,qBAE1CV,EAAOW,YACL,CAAEC,KAAMnB,EAA8Be,SAAAA,GACtC,IAEJ,IAEAJ,OAAOS,iBAAiB,WAAW,SAAAC,GAE5BA,EAAMC,MAAQD,EAAMC,KAAKH,OAASnB,GAIvCM,EAAGiB,iBAAiBjB,EAAGkB,mBAAmBH,EAAMC,KAAKP,UACvD,IACF,CApCIU,CAAsBpB,KACxB,E","sources":["webpack://@internetarchive/bookreader/./src/plugins/plugin.iframe.js"],"sourcesContent":["/* global BookReader */\n/**\n * Plugin for two-way communication between a BookReader in an IFrame and the\n * parent web page\n */\n\nconst MESSAGE_TYPE_FRAGMENT_CHANGE = 'bookReaderFragmentChange';\n\nBookReader.prototype.init = (function (super_) {\n return function () {\n super_.call(this);\n _attachEventListeners(this);\n };\n})(BookReader.prototype.init);\n\n/**\n * @private\n * Using window.postMessage() and event listeners, the plugin notifies the\n * parent window when pages change, and the parent window can also\n * explicitly request a page change by sending its own message.\n *\n * @param {BookReader} br\n * @param {Window?} [parent]\n */\nexport function _attachEventListeners(br, parent = window.parent) {\n // Not embedded, abort\n if (!parent) {\n return;\n }\n\n br.bind(BookReader.eventNames.fragmentChange, () => {\n const fragment = br.fragmentFromParams(br.paramsFromCurrent());\n\n parent.postMessage(\n { type: MESSAGE_TYPE_FRAGMENT_CHANGE, fragment },\n '*'\n );\n });\n\n window.addEventListener('message', event => {\n // Not a recognized message type, abort\n if (!event.data || event.data.type !== MESSAGE_TYPE_FRAGMENT_CHANGE) {\n return;\n }\n\n br.updateFromParams(br.paramsFromFragment(event.data.fragment));\n });\n}\n"],"names":["super_","MESSAGE_TYPE_FRAGMENT_CHANGE","BookReader","prototype","init","call","this","br","parent","arguments","length","undefined","window","bind","eventNames","fragmentChange","fragment","fragmentFromParams","paramsFromCurrent","postMessage","type","addEventListener","event","data","updateFromParams","paramsFromFragment","_attachEventListeners"],"sourceRoot":""}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[111],{2878:function(e,n,t){"use strict";t(9826),t(1539),t(2222),t(7327);var s,a=t(5685),i=(t(866),t(2026),t(3609)),o=t(3609),r=[{filter:"grayscale(100%)",label:"Grayscale"},{filter:"brightness(120%)",label:"High brightness"},{filter:"invert(100%)",label:"Inverted (dark mode)"},{filter:"contrast(120%)",label:"High contrast"}];i.extend(BookReader.defaultOptions,{enableMobileNav:!0,mobileNavTitle:"Internet Archive",mobileNavFullscreenOnly:!1}),BookReader.prototype.setup=(s=BookReader.prototype.setup,function(e){s.call(this,e),this.enableMobileNav=e.enableMobileNav,this.mobileNavTitle=e.mobileNavTitle,this.mobileNavFullscreenOnly=e.mobileNavFullscreenOnly,this.refs.$mmenu=null}),BookReader.prototype.initToolbar=function(e){return function(n,t){var s,i=this;if(this.enableMobileNav){var r=this.buildMobileDrawerElement();this.refs.$br.append(r),this.buildInfoDiv(this.$(".BRmobileInfo")),this.buildShareDiv(this.$(".BRmobileShare")),(s=r).mmenu({navbars:[{position:"top"}],navbar:{add:!0,title:this.mobileNavTitle,titleLink:"panel"},extensions:["panelshadow"]},{offCanvas:{wrapPageIfNeeded:!1,zposition:"next",pageSelector:this.el}});var c=s.find(".BRpageviewValue");s.data("mmenu").bind("opened",(function(){c.length&&c.val(window.location.href)})),r.find(".BRcheckbox-filters").on("click",(function(){return l(r,i)})),r.find(".DrawerLayoutButton.one_page_mode").on("click",(function(){return i.switchMode(i.constMode1up)})),r.find(".DrawerLayoutButton.two_page_mode").on("click",(function(){return i.switchMode(i.constMode2up)})),r.find(".DrawerLayoutButton.thumbnail_mode").on("click",(function(){return i.switchMode(i.constModeThumb)})),this.mobileNavFullscreenOnly?o(document.body).addClass("BRbodyMobileNavEnabledFullscreen"):o(document.body).addClass("BRbodyMobileNavEnabled"),this.refs.$mmenu=s}if(e.apply(this,arguments),this.enableMobileNav){this.$(".BRmobileHamburger").click((function(){s.data("mmenu").getInstance().vars.opened?s.data("mmenu").close():(s.data("mmenu").open(),i.trigger("mobileNavOpen"))}));var d=function(e){var n=o(window).width();s.data("mmenu").getInstance().vars.opened&&n>=800&&s.data("mmenu").close()};window.addEventListener("resize",a.debounce(d,900))}}}(BookReader.prototype.initToolbar),BookReader.prototype.buildToolbarElement=function(e){return function(){var n=e.call(this);if(this.enableMobileNav){var t=BookReader.util.escapeHTML(this.bookTitle),s='\n <span class="BRmobileHamburgerWrapper">\n <button class="BRmobileHamburger"></button>\n <span class="BRtoolbarMobileTitle" title="'.concat(t,'">').concat(t,"</span>\n </span>\n ");n.addClass("responsive").prepend(o(s))}return n}}(BookReader.prototype.buildToolbarElement),BookReader.prototype.buildMobileDrawerElement=function(){var e="";this.enableExperimentalControls&&(e='\n <p class="DrawerSettingsTitle">Visual Adjustment</p>\n <div class="BRcheckbox-group-filters">\n ',r.forEach((function(n,t){var s='\n <input type="checkbox" class="BRcheckbox-filters" id="filter'.concat(t,'">\n <label for="filter').concat(t,'" class="BRcheckbox-label-filters">').concat(n.label,"</label><br>\n \n ");e=e.concat(s)})),e=e.concat("</div>"));var n='\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat("".concat(this.imagesBaseURL,"icon_gear.svg"),'" alt="settings-icon"/>\n </span>\n Settings\n </span>\n <div class=DrawerSettingsWrapper>\n <div class="DrawerSettingsLayoutWrapper">\n <button class="DrawerLayoutButton one_page_mode">\n <img src="',this.imagesBaseURL,'icon_one_page.svg" alt="Single Page"/>\n <br>\n One Page\n </button>\n <button class="DrawerLayoutButton two_page_mode TwoPagesButton">\n <img src="').concat(this.imagesBaseURL,'icon_two_pages.svg" alt="Two Pages"/>\n <br>\n Two Pages\n </button>\n <button class="DrawerLayoutButton thumbnail_mode">\n <img src="').concat(this.imagesBaseURL,'icon_thumbnails.svg" alt="Thumbnails"/>\n <br>\n Thumbnails\n </button>\n </div>\n <br>\n <div class="DrawerSettingsTitle">Zoom</div>\n <button class=\'BRicon zoom_out\'></button>\n <button class=\'BRicon zoom_in\'></button>\n <br style="clear:both"><br><br>\n ').concat(e,"\n </div>\n "),t='\n <span>\n <span class="DrawerIconWrapper ">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_info.svg" alt="info-icon"/>\n </span>\n About This Book\n </span>\n <div class="BRmobileInfo"></div>\n '),s='\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_share.svg" alt="info-share"/>\n </span>\n Share This Book\n </span>\n <div class="BRmobileShare"></div>\n '),a='\n <nav id="BRmobileMenu" class="BRmobileMenu">\n <ul>\n <li class="BRmobileMenu__settings">'.concat(n,'</li>\n <li class="BRmobileMenu__moreInfoRow">').concat(t,'</li>\n <li class="BRmobileMenu__share">').concat(s,"</li>\n </ul>\n </nav>\n ");return o(a)},BookReader.prototype.$=function(e){return function(n){var t=e.call(this,n);return this.refs.$mmenu&&(t=t.add(this.refs.$mmenu.find(n))),t}}(BookReader.prototype.$);var l=function(e,n){var t="";o(".BRcheckbox-filters").each((function(e,s){n.refs.$br.removeClass("filter-applied"),o(s).is(":checked")&&(n.refs.$br.addClass(o(s).attr("filter-applied")),t+=r[e].filter)}));var s=o("#filtersStyle")[0]||document.createElement("style");s.id="filtersStyle",s.innerHTML=".BRpagecontainer img {\n filter: ".concat(t,";\n -webkit-filter: ").concat(t,";}"),document.body.appendChild(s)}},2026:function(e,n,t){var s,a,i,o,r=t(3609);o="navbars",(s=r)[i="mmenu"].addons[o]={setup:function(){var e=this,n=this.opts[o],t=this.conf[o];if(s[i].glbl,void 0!==n){n instanceof Array||(n=[n]);var r={};for(var l in s.each(n,(function(l){var c=n[l];"boolean"==typeof c&&c&&(c={}),"object"!=typeof c&&(c={}),void 0===c.content&&(c.content=["prev","title"]),c.content instanceof Array||(c.content=[c.content]);var d=(c=s.extend(!0,{},e.opts.navbar,c)).position,p=c.height;"number"!=typeof p&&(p=1),p=Math.min(4,Math.max(1,p)),"bottom"!=d&&(d="top"),r[d]||(r[d]=0),r[d]++;var h=s("<div />").addClass(a.navbar+" "+a.navbar+"-"+d+" "+a.navbar+"-"+d+"-"+r[d]+" "+a.navbar+"-size-"+p);r[d]+=p-1;for(var u=0,f=0,v=c.content.length;v>f;f++){var m=s[i].addons[o][c.content[f]]||!1;m?u+=m.call(e,h,c,t):((m=c.content[f])instanceof s||(m=s(c.content[f])),h.append(m))}(u+=Math.ceil(h.children().not("."+a.btn).length/p))>1&&h.addClass(a.navbar+"-content-"+u),h.children("."+a.btn).length&&h.addClass(a.hasbtns),h.prependTo(e.$menu)})),r)e.$menu.addClass(a.hasnavbar+"-"+l+"-"+r[l])}},add:function(){a=s[i]._c,s[i]._d,s[i]._e,a.add("close hasbtns")},clickAnchor:function(e,n){}},s[i].configuration[o]={breadcrumbSeparator:"/"},s[i].configuration.classNames[o]={},function(e){var n="mmenu";e[n].addons.navbars.breadcrumbs=function(t,s,a){var i=e[n]._c,o=e[n]._d;i.add("breadcrumbs separator");var r=e('<span class="'+i.breadcrumbs+'" />').appendTo(t);this.bind("init",(function(n){n.removeClass(i.hasnavbar).each((function(){for(var n=[],t=e(this),s=e('<span class="'+i.breadcrumbs+'"></span>'),r=e(this).children().first(),l=!0;r&&r.length;){r.is("."+i.panel)||(r=r.closest("."+i.panel));var c=r.children("."+i.navbar).children("."+i.title).text();n.unshift(l?"<span>"+c+"</span>":'<a href="#'+r.attr("id")+'">'+c+"</a>"),l=!1,r=r.data(o.parent)}s.append(n.join('<span class="'+i.separator+'">'+a.breadcrumbSeparator+"</span>")).appendTo(t.children("."+i.navbar))}))}));var l=function(){r.html(this.$pnls.children("."+i.current).children("."+i.navbar).children("."+i.breadcrumbs).html())};return this.bind("openPanel",l),this.bind("init",l),0}}(r),function(e){var n="mmenu";e[n].addons.navbars.close=function(t,s){var a=e[n]._c,i=e[n].glbl,o=e('<a class="'+a.close+" "+a.btn+'" href="#" />').appendTo(t),r=function(e){o.attr("href","#"+e.attr("id"))};return r.call(this,i.$page),this.bind("setPage",r),-1}}(r),function(e){var n="mmenu",t="navbars";e[n].addons[t].next=function(s,a){var i,o,r=e[n]._c,l=e('<a class="'+r.next+" "+r.btn+'" href="#" />').appendTo(s),c=function(e){var n=(e=e||this.$pnls.children("."+r.current)).find("."+this.conf.classNames[t].panelNext);i=n.attr("href"),o=n.html(),l[i?"attr":"removeAttr"]("href",i),l[i||o?"removeClass":"addClass"](r.hidden),l.html(o)};return this.bind("openPanel",c),this.bind("init",(function(){c.call(this)})),-1},e[n].configuration.classNames[t].panelNext="Next"}(r),function(e){var n="mmenu",t="navbars";e[n].addons[t].prev=function(s,a){var i=e[n]._c,o=e('<a class="'+i.prev+" "+i.btn+'" href="#" />').appendTo(s);this.bind("init",(function(e){e.removeClass(i.hasnavbar).children("."+i.navbar).addClass(i.hidden)}));var r,l,c=function(e){if(!(e=e||this.$pnls.children("."+i.current)).hasClass(i.vertical)){var n=e.find("."+this.conf.classNames[t].panelPrev);n.length||(n=e.children("."+i.navbar).children("."+i.prev)),r=n.attr("href"),l=n.html(),o[r?"attr":"removeAttr"]("href",r),o[r||l?"removeClass":"addClass"](i.hidden),o.html(l)}};return this.bind("openPanel",c),this.bind("init",(function(){c.call(this)})),-1},e[n].configuration.classNames[t].panelPrev="Prev"}(r),function(e){var n="mmenu";e[n].addons.navbars.searchfield=function(t,s){var a=e[n]._c,i=e('<div class="'+a.search+'" />').appendTo(t);return"object"!=typeof this.opts.searchfield&&(this.opts.searchfield={}),this.opts.searchfield.add=!0,this.opts.searchfield.addTo=i,0}}(r),function(e){var n="mmenu",t="navbars";e[n].addons[t].title=function(s,a){var i,o,r=e[n]._c,l=e('<a class="'+r.title+'" />').appendTo(s),c=function(e){if(!(e=e||this.$pnls.children("."+r.current)).hasClass(r.vertical)){var n=e.find("."+this.conf.classNames[t].panelTitle);n.length||(n=e.children("."+r.navbar).children("."+r.title)),i=n.attr("href"),o=n.html()||a.title,l[i?"attr":"removeAttr"]("href",i),l[i||o?"removeClass":"addClass"](r.hidden),l.html(o)}};return this.bind("openPanel",c),this.bind("init",(function(e){c.call(this)})),0},e[n].configuration.classNames[t].panelTitle="Title"}(r)},866:function(e,n,t){var s,a,i,o,r,l,c,d=t(3609);!function(e){function n(){e[o].glbl||(i={$wndw:e(window),$docu:e(document),$html:e("html"),$body:e("body")},t={},s={},a={},e.each([t,s,a],(function(e,n){n.add=function(e){for(var t=0,s=(e=e.split(" ")).length;s>t;t++)n[e[t]]=n.mm(e[t])}})),t.mm=function(e){return"mm-"+e},t.add("wrapper menu panels panel nopanel current highest opened subopened navbar hasnavbar title btn prev next listview nolistview inset vertical selected divider spacer hidden fullsubopen"),t.umm=function(e){return"mm-"==e.slice(0,3)&&(e=e.slice(3)),e},s.mm=function(e){return"mm-"+e},s.add("parent sub"),a.mm=function(e){return e+".mm"},a.add("transitionend webkitTransitionEnd click scroll keydown mousedown mouseup touchstart touchmove touchend orientationchange"),e[o]._c=t,e[o]._d=s,e[o]._e=a,e[o].glbl=i)}var t,s,a,i,o="mmenu",r="5.6.4";e[o]&&e[o].version>r||(e[o]=function(e,n,t){this.$menu=e,this._api=["bind","init","update","setSelected","getInstance","openPanel","closePanel","closeAllPanels"],this.opts=n,this.conf=t,this.vars={},this.cbck={},"function"==typeof this.___deprecated&&this.___deprecated(),this._initMenu(),this._initAnchors();var s=this.$pnls.children();return this._initAddons(),this.init(s),"function"==typeof this.___debug&&this.___debug(),this},e[o].version=r,e[o].addons={},e[o].uniqueId=0,e[o].defaults={extensions:[],navbar:{add:!0,title:"Menu",titleLink:"panel"},onClick:{setSelected:!0},slidingSubmenus:!0},e[o].configuration={classNames:{divider:"Divider",inset:"Inset",panel:"Panel",selected:"Selected",spacer:"Spacer",vertical:"Vertical"},clone:!1,openingInterval:25,panelNodetype:"ul, ol, div",transitionDuration:400},e[o].prototype={init:function(e){e=e.not("."+t.nopanel),e=this._initPanels(e),this.trigger("init",e),this.trigger("update")},update:function(){this.trigger("update")},setSelected:function(e){this.$menu.find("."+t.listview).children().removeClass(t.selected),e.addClass(t.selected),this.trigger("setSelected",e)},openPanel:function(n){var s=n.parent(),a=this;if(s.hasClass(t.vertical)){var i=s.parents("."+t.subopened);if(i.length)return void this.openPanel(i.first());s.addClass(t.opened),this.trigger("openPanel",n),this.trigger("openingPanel",n),this.trigger("openedPanel",n)}else{if(n.hasClass(t.current))return;var r=this.$pnls.children("."+t.panel),l=r.filter("."+t.current);r.removeClass(t.highest).removeClass(t.current).not(n).not(l).not("."+t.vertical).addClass(t.hidden),e[o].support.csstransitions||l.addClass(t.hidden),n.hasClass(t.opened)?n.nextAll("."+t.opened).addClass(t.highest).removeClass(t.opened).removeClass(t.subopened):(n.addClass(t.highest),l.addClass(t.subopened)),n.removeClass(t.hidden).addClass(t.current),a.trigger("openPanel",n),setTimeout((function(){n.removeClass(t.subopened).addClass(t.opened),a.trigger("openingPanel",n),a.__transitionend(n,(function(){a.trigger("openedPanel",n)}),a.conf.transitionDuration)}),this.conf.openingInterval)}},closePanel:function(e){var n=e.parent();n.hasClass(t.vertical)&&(n.removeClass(t.opened),this.trigger("closePanel",e),this.trigger("closingPanel",e),this.trigger("closedPanel",e))},closeAllPanels:function(){this.$menu.find("."+t.listview).children().removeClass(t.selected).filter("."+t.vertical).removeClass(t.opened);var e=this.$pnls.children("."+t.panel).first();this.$pnls.children("."+t.panel).not(e).removeClass(t.subopened).removeClass(t.opened).removeClass(t.current).removeClass(t.highest).addClass(t.hidden),this.openPanel(e)},togglePanel:function(e){var n=e.parent();n.hasClass(t.vertical)&&this[n.hasClass(t.opened)?"closePanel":"openPanel"](e)},getInstance:function(){return this},bind:function(e,n){this.cbck[e]=this.cbck[e]||[],this.cbck[e].push(n)},trigger:function(){var e=this,n=Array.prototype.slice.call(arguments),t=n.shift();if(this.cbck[t])for(var s=0,a=this.cbck[t].length;a>s;s++)this.cbck[t][s].apply(e,n)},_initMenu:function(){this.$menu.attr("id",this.$menu.attr("id")||this.__getUniqueId()),this.conf.clone&&(this.$menu=this.$menu.clone(!0),this.$menu.add(this.$menu.find("[id]")).filter("[id]").each((function(){e(this).attr("id",t.mm(e(this).attr("id")))}))),this.$menu.contents().each((function(){3==e(this)[0].nodeType&&e(this).remove()})),this.$pnls=e('<div class="'+t.panels+'" />').append(this.$menu.children(this.conf.panelNodetype)).prependTo(this.$menu),this.$menu.parent().addClass(t.wrapper);var n=[t.menu];this.opts.slidingSubmenus||n.push(t.vertical),this.opts.extensions=this.opts.extensions.length?"mm-"+this.opts.extensions.join(" mm-"):"",this.opts.extensions&&n.push(this.opts.extensions),this.$menu.addClass(n.join(" "))},_initPanels:function(n){var a=this,i=this.__findAddBack(n,"ul, ol");this.__refactorClass(i,this.conf.classNames.inset,"inset").addClass(t.nolistview+" "+t.nopanel),i.not("."+t.nolistview).addClass(t.listview);var o=this.__findAddBack(n,"."+t.listview).children();this.__refactorClass(o,this.conf.classNames.selected,"selected"),this.__refactorClass(o,this.conf.classNames.divider,"divider"),this.__refactorClass(o,this.conf.classNames.spacer,"spacer"),this.__refactorClass(this.__findAddBack(n,"."+this.conf.classNames.panel),this.conf.classNames.panel,"panel");var r=e(),l=n.add(n.find("."+t.panel)).add(this.__findAddBack(n,"."+t.listview).children().children(this.conf.panelNodetype)).not("."+t.nopanel);this.__refactorClass(l,this.conf.classNames.vertical,"vertical"),this.opts.slidingSubmenus||l.addClass(t.vertical),l.each((function(){var n=e(this),s=n;n.is("ul, ol")?(n.wrap('<div class="'+t.panel+'" />'),s=n.parent()):s.addClass(t.panel);var i=n.attr("id");n.removeAttr("id"),s.attr("id",i||a.__getUniqueId()),n.hasClass(t.vertical)&&(n.removeClass(a.conf.classNames.vertical),s.add(s.parent()).addClass(t.vertical)),r=r.add(s)}));var c=e("."+t.panel,this.$menu);r.each((function(n){var i,o,r=e(this),l=r.parent(),c=l.children("a, span").first();if(l.is("."+t.panels)||(l.data(s.sub,r),r.data(s.parent,l)),l.children("."+t.next).length||l.parent().is("."+t.listview)&&(i=r.attr("id"),o=e('<a class="'+t.next+'" href="#'+i+'" data-target="#'+i+'" />').insertBefore(c),c.is("span")&&o.addClass(t.fullsubopen)),!r.children("."+t.navbar).length&&!l.hasClass(t.vertical)){l.parent().is("."+t.listview)?l=l.closest("."+t.panel):(c=l.closest("."+t.panel).find('a[href="#'+r.attr("id")+'"]').first(),l=c.closest("."+t.panel));var d=!1,p=e('<div class="'+t.navbar+'" />');if(a.opts.navbar.add&&r.addClass(t.hasnavbar),l.length){switch(i=l.attr("id"),a.opts.navbar.titleLink){case"anchor":d=c.attr("href");break;case"panel":case"parent":d="#"+i;break;default:d=!1}p.append('<a class="'+t.btn+" "+t.prev+'" href="#'+i+'" data-target="#'+i+'" />').append(e('<a class="'+t.title+'"'+(d?' href="'+d+'"':"")+" />").text(c.text())).prependTo(r)}else a.opts.navbar.title&&p.append('<a class="'+t.title+'">'+a.opts.navbar.title+"</a>").prependTo(r)}}));var d=this.__findAddBack(n,"."+t.listview).children("."+t.selected).removeClass(t.selected).last().addClass(t.selected);d.add(d.parentsUntil("."+t.menu,"li")).filter("."+t.vertical).addClass(t.opened).end().each((function(){e(this).parentsUntil("."+t.menu,"."+t.panel).not("."+t.vertical).first().addClass(t.opened).parentsUntil("."+t.menu,"."+t.panel).not("."+t.vertical).first().addClass(t.opened).addClass(t.subopened)})),d.children("."+t.panel).not("."+t.vertical).addClass(t.opened).parentsUntil("."+t.menu,"."+t.panel).not("."+t.vertical).first().addClass(t.opened).addClass(t.subopened);var p=c.filter("."+t.opened);return p.length||(p=r.first()),p.addClass(t.opened).last().addClass(t.current),r.not("."+t.vertical).not(p.last()).addClass(t.hidden).end().filter((function(){return!e(this).parent().hasClass(t.panels)})).appendTo(this.$pnls),r},_initAnchors:function(){var n=this;i.$body.on(a.click+"-oncanvas","a[href]",(function(s){var a=e(this),i=!1,r=n.$menu.find(a).length;for(var l in e[o].addons)if(e[o].addons[l].clickAnchor.call(n,a,r)){i=!0;break}var c=a.attr("href");if(!i&&r&&c.length>1&&"#"==c.slice(0,1))try{var d=e(c,n.$menu);d.is("."+t.panel)&&(i=!0,n[a.parent().hasClass(t.vertical)?"togglePanel":"openPanel"](d))}catch(e){}if(i&&s.preventDefault(),!i&&r&&a.is("."+t.listview+" > li > a")&&!a.is('[rel="external"]')&&!a.is('[target="_blank"]')){n.__valueOrFn(n.opts.onClick.setSelected,a)&&n.setSelected(e(s.target).parent());var p=n.__valueOrFn(n.opts.onClick.preventDefault,a,"#"==c.slice(0,1));p&&s.preventDefault(),n.__valueOrFn(n.opts.onClick.close,a,p)&&n.close()}}))},_initAddons:function(){var n;for(n in e[o].addons)e[o].addons[n].add.call(this),e[o].addons[n].add=function(){};for(n in e[o].addons)e[o].addons[n].setup.call(this)},_getOriginalMenuId:function(){var e=this.$menu.attr("id");return e&&e.length&&this.conf.clone&&(e=t.umm(e)),e},__api:function(){var n=this,t={};return e.each(this._api,(function(e){var s=this;t[s]=function(){var e=n[s].apply(n,arguments);return void 0===e?t:e}})),t},__valueOrFn:function(e,n,t){return"function"==typeof e?e.call(n[0]):void 0===e&&void 0!==t?t:e},__refactorClass:function(e,n,s){return e.filter("."+n).removeClass(n).addClass(t[s])},__findAddBack:function(e,n){return e.find(n).add(e.filter(n))},__filterListItems:function(e){return e.not("."+t.divider).not("."+t.hidden)},__transitionend:function(e,n,t){var s=!1,i=function(){s||n.call(e[0]),s=!0};e.one(a.transitionend,i),e.one(a.webkitTransitionEnd,i),setTimeout(i,1.1*t)},__getUniqueId:function(){return t.mm(e[o].uniqueId++)}},e.fn[o]=function(t,s){return n(),t=e.extend(!0,{},e[o].defaults,t),s=e.extend(!0,{},e[o].configuration,s),this.each((function(){var n=e(this);if(!n.data(o)){var a=new e[o](n,t,s);a.$menu.data(o,a.__api())}}))},e[o].support={touch:"ontouchstart"in window||navigator.msMaxTouchPoints||!1,csstransitions:function(){if("undefined"!=typeof Modernizr&&void 0!==Modernizr.csstransitions)return Modernizr.csstransitions;var e=(document.body||document.documentElement).style,n="transition";if("string"==typeof e[n])return!0;var t=["Moz","webkit","Webkit","Khtml","O","ms"];n=n.charAt(0).toUpperCase()+n.substr(1);for(var s=0;s<t.length;s++)if("string"==typeof e[t[s]+n])return!0;return!1}()})}(d),c="offCanvas",(s=d)[l="mmenu"].addons[c]={setup:function(){if(this.opts[c]){var e=this.opts[c],n=this.conf[c];r=s[l].glbl,this._api=s.merge(this._api,["open","close","setPage"]),("top"==e.position||"bottom"==e.position)&&(e.zposition="front"),"string"!=typeof n.pageSelector&&(n.pageSelector="> "+n.pageNodetype),r.$allMenus=(r.$allMenus||s()).add(this.$menu),this.vars.opened=!1;var t=[a.offcanvas];"left"!=e.position&&t.push(a.mm(e.position)),"back"!=e.zposition&&t.push(a.mm(e.zposition)),this.$menu.addClass(t.join(" ")).parent().removeClass(a.wrapper),this.setPage(r.$page),this._initBlocker(),this["_initWindow_"+c](),this.$menu[n.menuInjectMethod+"To"](n.menuWrapperSelector);var i=window.location.hash;if(i){var o=this._getOriginalMenuId();o&&o==i.slice(1)&&this.open()}}},add:function(){a=s[l]._c,i=s[l]._d,o=s[l]._e,a.add("offcanvas slideout blocking modal background opening blocker page"),i.add("style"),o.add("resize")},clickAnchor:function(e,n){if(!this.opts[c])return!1;var t=this._getOriginalMenuId();return t&&e.is('[href="#'+t+'"]')?(this.open(),!0):r.$page?!(!(t=r.$page.first().attr("id"))||!e.is('[href="#'+t+'"]')||(this.close(),0)):void 0}},s[l].defaults[c]={position:"left",zposition:"back",blockUI:!0,moveBackground:!0},s[l].configuration[c]={pageNodetype:"div",pageSelector:null,noPageSelector:[],wrapPageIfNeeded:!0,menuWrapperSelector:"body",menuInjectMethod:"prepend"},s[l].prototype.open=function(){if(!this.vars.opened){var e=this;this._openSetup(),setTimeout((function(){e._openFinish()}),this.conf.openingInterval),this.trigger("open")}},s[l].prototype._openSetup=function(){var e=this,n=this.opts[c];this.closeAllOthers(),r.$page.each((function(){s(this).data(i.style,s(this).attr("style")||"")})),r.$wndw.trigger(o.resize+"-"+c,[!0]);var t=[a.opened];n.blockUI&&t.push(a.blocking),"modal"==n.blockUI&&t.push(a.modal),n.moveBackground&&t.push(a.background),"left"!=n.position&&t.push(a.mm(this.opts[c].position)),"back"!=n.zposition&&t.push(a.mm(this.opts[c].zposition)),this.opts.extensions&&t.push(this.opts.extensions),r.$html.addClass(t.join(" ")),setTimeout((function(){e.vars.opened=!0}),this.conf.openingInterval),this.$menu.addClass(a.current+" "+a.opened)},s[l].prototype._openFinish=function(){var e=this;this.__transitionend(r.$page.first(),(function(){e.trigger("opened")}),this.conf.transitionDuration),r.$html.addClass(a.opening),this.trigger("opening")},s[l].prototype.close=function(){if(this.vars.opened){var e=this;this.__transitionend(r.$page.first(),(function(){e.$menu.removeClass(a.current).removeClass(a.opened),r.$html.removeClass(a.opened).removeClass(a.blocking).removeClass(a.modal).removeClass(a.background).removeClass(a.mm(e.opts[c].position)).removeClass(a.mm(e.opts[c].zposition)),e.opts.extensions&&r.$html.removeClass(e.opts.extensions),r.$page.each((function(){s(this).attr("style",s(this).data(i.style))})),e.vars.opened=!1,e.trigger("closed")}),this.conf.transitionDuration),r.$html.removeClass(a.opening),this.trigger("close"),this.trigger("closing")}},s[l].prototype.closeAllOthers=function(){r.$allMenus.not(this.$menu).each((function(){var e=s(this).data(l);e&&e.close&&e.close()}))},s[l].prototype.setPage=function(e){var n=this,t=this.conf[c];e&&e.length||(e=r.$body.find(t.pageSelector),t.noPageSelector.length&&(e=e.not(t.noPageSelector.join(", "))),e.length>1&&t.wrapPageIfNeeded&&(e=e.wrapAll("<"+this.conf[c].pageNodetype+" />").parent())),e.each((function(){s(this).attr("id",s(this).attr("id")||n.__getUniqueId())})),e.addClass(a.page+" "+a.slideout),r.$page=e,this.trigger("setPage",e)},s[l].prototype["_initWindow_"+c]=function(){r.$wndw.off(o.keydown+"-"+c).on(o.keydown+"-"+c,(function(e){return r.$html.hasClass(a.opened)&&9==e.keyCode?(e.preventDefault(),!1):void 0}));var e=0;r.$wndw.off(o.resize+"-"+c).on(o.resize+"-"+c,(function(n,t){if(1==r.$page.length&&(t||r.$html.hasClass(a.opened))){var s=r.$wndw.height();(t||s!=e)&&(e=s,r.$page.css("minHeight",s))}}))},s[l].prototype._initBlocker=function(){var e=this;this.opts[c].blockUI&&(r.$blck||(r.$blck=s('<div id="'+a.blocker+'" class="'+a.slideout+'" />')),r.$blck.appendTo(r.$body).off(o.touchstart+"-"+c+" "+o.touchmove+"-"+c).on(o.touchstart+"-"+c+" "+o.touchmove+"-"+c,(function(e){e.preventDefault(),e.stopPropagation(),r.$blck.trigger(o.mousedown+"-"+c)})).off(o.mousedown+"-"+c).on(o.mousedown+"-"+c,(function(n){n.preventDefault(),r.$html.hasClass(a.modal)||(e.closeAllOthers(),e.close())})))},function(e){var n,t,s,a="mmenu",i="scrollBugFix";e[a].addons[i]={setup:function(){var o=this,r=this.opts[i];if(this.conf[i],s=e[a].glbl,e[a].support.touch&&this.opts.offCanvas&&this.opts.offCanvas.blockUI&&("boolean"==typeof r&&(r={fix:r}),"object"!=typeof r&&(r={}),(r=this.opts[i]=e.extend(!0,{},e[a].defaults[i],r)).fix)){var l=this.$menu.attr("id"),c=!1;this.bind("opening",(function(){this.$pnls.children("."+n.current).scrollTop(0)})),s.$docu.on(t.touchmove,(function(e){o.vars.opened&&e.preventDefault()})),s.$body.on(t.touchstart,"#"+l+"> ."+n.panels+"> ."+n.current,(function(e){o.vars.opened&&(c||(c=!0,0===e.currentTarget.scrollTop?e.currentTarget.scrollTop=1:e.currentTarget.scrollHeight===e.currentTarget.scrollTop+e.currentTarget.offsetHeight&&(e.currentTarget.scrollTop-=1),c=!1))})).on(t.touchmove,"#"+l+"> ."+n.panels+"> ."+n.current,(function(n){o.vars.opened&&e(this)[0].scrollHeight>e(this).innerHeight()&&n.stopPropagation()})),s.$wndw.on(t.orientationchange,(function(){o.$pnls.children("."+n.current).scrollTop(0).css({"-webkit-overflow-scrolling":"auto"}).css({"-webkit-overflow-scrolling":"touch"})}))}},add:function(){n=e[a]._c,e[a]._d,t=e[a]._e},clickAnchor:function(e,n){}},e[a].defaults[i]={fix:!0}}(d)}},function(e){e(e.s=2878)}]);
|
1
|
+
(self.webpackChunk_internetarchive_bookreader=self.webpackChunk_internetarchive_bookreader||[]).push([[111],{2878:function(e,n,t){"use strict";t(9826),t(1539),t(2222),t(7327);var s,a=t(5685),i=(t(866),t(2026),t(5311)),o=t(5311),r=[{filter:"grayscale(100%)",label:"Grayscale"},{filter:"brightness(120%)",label:"High brightness"},{filter:"invert(100%)",label:"Inverted (dark mode)"},{filter:"contrast(120%)",label:"High contrast"}];i.extend(BookReader.defaultOptions,{enableMobileNav:!0,mobileNavTitle:"Internet Archive",mobileNavFullscreenOnly:!1}),BookReader.prototype.setup=(s=BookReader.prototype.setup,function(e){s.call(this,e),this.enableMobileNav=e.enableMobileNav,this.mobileNavTitle=e.mobileNavTitle,this.mobileNavFullscreenOnly=e.mobileNavFullscreenOnly,this.refs.$mmenu=null}),BookReader.prototype.initToolbar=function(e){return function(n,t){var s,i=this;if(this.enableMobileNav){var r=this.buildMobileDrawerElement();this.refs.$br.append(r),this.buildInfoDiv(this.$(".BRmobileInfo")),this.buildShareDiv(this.$(".BRmobileShare")),(s=r).mmenu({navbars:[{position:"top"}],navbar:{add:!0,title:this.mobileNavTitle,titleLink:"panel"},extensions:["panelshadow"]},{offCanvas:{wrapPageIfNeeded:!1,zposition:"next",pageSelector:this.el}});var c=s.find(".BRpageviewValue");s.data("mmenu").bind("opened",(function(){c.length&&c.val(window.location.href)})),r.find(".BRcheckbox-filters").on("click",(function(){return l(r,i)})),r.find(".DrawerLayoutButton.one_page_mode").on("click",(function(){return i.switchMode(i.constMode1up)})),r.find(".DrawerLayoutButton.two_page_mode").on("click",(function(){return i.switchMode(i.constMode2up)})),r.find(".DrawerLayoutButton.thumbnail_mode").on("click",(function(){return i.switchMode(i.constModeThumb)})),this.mobileNavFullscreenOnly?o(document.body).addClass("BRbodyMobileNavEnabledFullscreen"):o(document.body).addClass("BRbodyMobileNavEnabled"),this.refs.$mmenu=s}e.apply(this,arguments),this.enableMobileNav&&(this.$(".BRmobileHamburger").click((function(){s.data("mmenu").getInstance().vars.opened?s.data("mmenu").close():(s.data("mmenu").open(),i.trigger("mobileNavOpen"))})),window.addEventListener("resize",a.debounce((function(e){var n=o(window).width();s.data("mmenu").getInstance().vars.opened&&n>=800&&s.data("mmenu").close()}),900)))}}(BookReader.prototype.initToolbar),BookReader.prototype.buildToolbarElement=function(e){return function(){var n=e.call(this);if(this.enableMobileNav){var t=BookReader.util.escapeHTML(this.bookTitle),s='\n <span class="BRmobileHamburgerWrapper">\n <button class="BRmobileHamburger"></button>\n <span class="BRtoolbarMobileTitle" title="'.concat(t,'">').concat(t,"</span>\n </span>\n ");n.addClass("responsive").prepend(o(s))}return n}}(BookReader.prototype.buildToolbarElement),BookReader.prototype.buildMobileDrawerElement=function(){var e="";this.enableExperimentalControls&&(e='\n <p class="DrawerSettingsTitle">Visual Adjustment</p>\n <div class="BRcheckbox-group-filters">\n ',r.forEach((function(n,t){var s='\n <input type="checkbox" class="BRcheckbox-filters" id="filter'.concat(t,'">\n <label for="filter').concat(t,'" class="BRcheckbox-label-filters">').concat(n.label,"</label><br>\n \n ");e=e.concat(s)})),e=e.concat("</div>"));var n='\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat("".concat(this.imagesBaseURL,"icon_gear.svg"),'" alt="settings-icon"/>\n </span>\n Settings\n </span>\n <div class=DrawerSettingsWrapper>\n <div class="DrawerSettingsLayoutWrapper">\n <button class="DrawerLayoutButton one_page_mode">\n <img src="',this.imagesBaseURL,'icon_one_page.svg" alt="Single Page"/>\n <br>\n One Page\n </button>\n <button class="DrawerLayoutButton two_page_mode TwoPagesButton">\n <img src="').concat(this.imagesBaseURL,'icon_two_pages.svg" alt="Two Pages"/>\n <br>\n Two Pages\n </button>\n <button class="DrawerLayoutButton thumbnail_mode">\n <img src="').concat(this.imagesBaseURL,'icon_thumbnails.svg" alt="Thumbnails"/>\n <br>\n Thumbnails\n </button>\n </div>\n <br>\n <div class="DrawerSettingsTitle">Zoom</div>\n <button class=\'BRicon zoom_out\'></button>\n <button class=\'BRicon zoom_in\'></button>\n <br style="clear:both"><br><br>\n ').concat(e,"\n </div>\n "),t='\n <span>\n <span class="DrawerIconWrapper ">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_info.svg" alt="info-icon"/>\n </span>\n About This Book\n </span>\n <div class="BRmobileInfo"></div>\n '),s='\n <span>\n <span class="DrawerIconWrapper">\n <img class="DrawerIcon" src="'.concat(this.imagesBaseURL,'icon_share.svg" alt="info-share"/>\n </span>\n Share This Book\n </span>\n <div class="BRmobileShare"></div>\n '),a='\n <nav id="BRmobileMenu" class="BRmobileMenu">\n <ul>\n <li class="BRmobileMenu__settings">'.concat(n,'</li>\n <li class="BRmobileMenu__moreInfoRow">').concat(t,'</li>\n <li class="BRmobileMenu__share">').concat(s,"</li>\n </ul>\n </nav>\n ");return o(a)},BookReader.prototype.$=function(e){return function(n){var t=e.call(this,n);return this.refs.$mmenu&&(t=t.add(this.refs.$mmenu.find(n))),t}}(BookReader.prototype.$);var l=function(e,n){var t="";o(".BRcheckbox-filters").each((function(e,s){n.refs.$br.removeClass("filter-applied"),o(s).is(":checked")&&(n.refs.$br.addClass(o(s).attr("filter-applied")),t+=r[e].filter)}));var s=o("#filtersStyle")[0]||document.createElement("style");s.id="filtersStyle",s.innerHTML=".BRpagecontainer img {\n filter: ".concat(t,";\n -webkit-filter: ").concat(t,";}"),document.body.appendChild(s)}},2026:function(e,n,t){var s,a,i,o,r=t(5311);o="navbars",(s=r)[i="mmenu"].addons[o]={setup:function(){var e=this,n=this.opts[o],t=this.conf[o];if(s[i].glbl,void 0!==n){n instanceof Array||(n=[n]);var r={};for(var l in s.each(n,(function(l){var c=n[l];"boolean"==typeof c&&c&&(c={}),"object"!=typeof c&&(c={}),void 0===c.content&&(c.content=["prev","title"]),c.content instanceof Array||(c.content=[c.content]);var d=(c=s.extend(!0,{},e.opts.navbar,c)).position,p=c.height;"number"!=typeof p&&(p=1),p=Math.min(4,Math.max(1,p)),"bottom"!=d&&(d="top"),r[d]||(r[d]=0),r[d]++;var h=s("<div />").addClass(a.navbar+" "+a.navbar+"-"+d+" "+a.navbar+"-"+d+"-"+r[d]+" "+a.navbar+"-size-"+p);r[d]+=p-1;for(var u=0,f=0,v=c.content.length;v>f;f++){var m=s[i].addons[o][c.content[f]]||!1;m?u+=m.call(e,h,c,t):((m=c.content[f])instanceof s||(m=s(c.content[f])),h.append(m))}(u+=Math.ceil(h.children().not("."+a.btn).length/p))>1&&h.addClass(a.navbar+"-content-"+u),h.children("."+a.btn).length&&h.addClass(a.hasbtns),h.prependTo(e.$menu)})),r)e.$menu.addClass(a.hasnavbar+"-"+l+"-"+r[l])}},add:function(){a=s[i]._c,s[i]._d,s[i]._e,a.add("close hasbtns")},clickAnchor:function(e,n){}},s[i].configuration[o]={breadcrumbSeparator:"/"},s[i].configuration.classNames[o]={},function(e){var n="mmenu";e[n].addons.navbars.breadcrumbs=function(t,s,a){var i=e[n]._c,o=e[n]._d;i.add("breadcrumbs separator");var r=e('<span class="'+i.breadcrumbs+'" />').appendTo(t);this.bind("init",(function(n){n.removeClass(i.hasnavbar).each((function(){for(var n=[],t=e(this),s=e('<span class="'+i.breadcrumbs+'"></span>'),r=e(this).children().first(),l=!0;r&&r.length;){r.is("."+i.panel)||(r=r.closest("."+i.panel));var c=r.children("."+i.navbar).children("."+i.title).text();n.unshift(l?"<span>"+c+"</span>":'<a href="#'+r.attr("id")+'">'+c+"</a>"),l=!1,r=r.data(o.parent)}s.append(n.join('<span class="'+i.separator+'">'+a.breadcrumbSeparator+"</span>")).appendTo(t.children("."+i.navbar))}))}));var l=function(){r.html(this.$pnls.children("."+i.current).children("."+i.navbar).children("."+i.breadcrumbs).html())};return this.bind("openPanel",l),this.bind("init",l),0}}(r),function(e){var n="mmenu";e[n].addons.navbars.close=function(t,s){var a=e[n]._c,i=e[n].glbl,o=e('<a class="'+a.close+" "+a.btn+'" href="#" />').appendTo(t),r=function(e){o.attr("href","#"+e.attr("id"))};return r.call(this,i.$page),this.bind("setPage",r),-1}}(r),function(e){var n="mmenu",t="navbars";e[n].addons[t].next=function(s,a){var i,o,r=e[n]._c,l=e('<a class="'+r.next+" "+r.btn+'" href="#" />').appendTo(s),c=function(e){var n=(e=e||this.$pnls.children("."+r.current)).find("."+this.conf.classNames[t].panelNext);i=n.attr("href"),o=n.html(),l[i?"attr":"removeAttr"]("href",i),l[i||o?"removeClass":"addClass"](r.hidden),l.html(o)};return this.bind("openPanel",c),this.bind("init",(function(){c.call(this)})),-1},e[n].configuration.classNames[t].panelNext="Next"}(r),function(e){var n="mmenu",t="navbars";e[n].addons[t].prev=function(s,a){var i=e[n]._c,o=e('<a class="'+i.prev+" "+i.btn+'" href="#" />').appendTo(s);this.bind("init",(function(e){e.removeClass(i.hasnavbar).children("."+i.navbar).addClass(i.hidden)}));var r,l,c=function(e){if(!(e=e||this.$pnls.children("."+i.current)).hasClass(i.vertical)){var n=e.find("."+this.conf.classNames[t].panelPrev);n.length||(n=e.children("."+i.navbar).children("."+i.prev)),r=n.attr("href"),l=n.html(),o[r?"attr":"removeAttr"]("href",r),o[r||l?"removeClass":"addClass"](i.hidden),o.html(l)}};return this.bind("openPanel",c),this.bind("init",(function(){c.call(this)})),-1},e[n].configuration.classNames[t].panelPrev="Prev"}(r),function(e){var n="mmenu";e[n].addons.navbars.searchfield=function(t,s){var a=e[n]._c,i=e('<div class="'+a.search+'" />').appendTo(t);return"object"!=typeof this.opts.searchfield&&(this.opts.searchfield={}),this.opts.searchfield.add=!0,this.opts.searchfield.addTo=i,0}}(r),function(e){var n="mmenu",t="navbars";e[n].addons[t].title=function(s,a){var i,o,r=e[n]._c,l=e('<a class="'+r.title+'" />').appendTo(s),c=function(e){if(!(e=e||this.$pnls.children("."+r.current)).hasClass(r.vertical)){var n=e.find("."+this.conf.classNames[t].panelTitle);n.length||(n=e.children("."+r.navbar).children("."+r.title)),i=n.attr("href"),o=n.html()||a.title,l[i?"attr":"removeAttr"]("href",i),l[i||o?"removeClass":"addClass"](r.hidden),l.html(o)}};return this.bind("openPanel",c),this.bind("init",(function(e){c.call(this)})),0},e[n].configuration.classNames[t].panelTitle="Title"}(r)},866:function(e,n,t){var s,a,i,o,r,l,c,d=t(5311);!function(e){function n(){e[o].glbl||(i={$wndw:e(window),$docu:e(document),$html:e("html"),$body:e("body")},t={},s={},a={},e.each([t,s,a],(function(e,n){n.add=function(e){for(var t=0,s=(e=e.split(" ")).length;s>t;t++)n[e[t]]=n.mm(e[t])}})),t.mm=function(e){return"mm-"+e},t.add("wrapper menu panels panel nopanel current highest opened subopened navbar hasnavbar title btn prev next listview nolistview inset vertical selected divider spacer hidden fullsubopen"),t.umm=function(e){return"mm-"==e.slice(0,3)&&(e=e.slice(3)),e},s.mm=function(e){return"mm-"+e},s.add("parent sub"),a.mm=function(e){return e+".mm"},a.add("transitionend webkitTransitionEnd click scroll keydown mousedown mouseup touchstart touchmove touchend orientationchange"),e[o]._c=t,e[o]._d=s,e[o]._e=a,e[o].glbl=i)}var t,s,a,i,o="mmenu",r="5.6.4";e[o]&&e[o].version>r||(e[o]=function(e,n,t){this.$menu=e,this._api=["bind","init","update","setSelected","getInstance","openPanel","closePanel","closeAllPanels"],this.opts=n,this.conf=t,this.vars={},this.cbck={},"function"==typeof this.___deprecated&&this.___deprecated(),this._initMenu(),this._initAnchors();var s=this.$pnls.children();return this._initAddons(),this.init(s),"function"==typeof this.___debug&&this.___debug(),this},e[o].version=r,e[o].addons={},e[o].uniqueId=0,e[o].defaults={extensions:[],navbar:{add:!0,title:"Menu",titleLink:"panel"},onClick:{setSelected:!0},slidingSubmenus:!0},e[o].configuration={classNames:{divider:"Divider",inset:"Inset",panel:"Panel",selected:"Selected",spacer:"Spacer",vertical:"Vertical"},clone:!1,openingInterval:25,panelNodetype:"ul, ol, div",transitionDuration:400},e[o].prototype={init:function(e){e=e.not("."+t.nopanel),e=this._initPanels(e),this.trigger("init",e),this.trigger("update")},update:function(){this.trigger("update")},setSelected:function(e){this.$menu.find("."+t.listview).children().removeClass(t.selected),e.addClass(t.selected),this.trigger("setSelected",e)},openPanel:function(n){var s=n.parent(),a=this;if(s.hasClass(t.vertical)){var i=s.parents("."+t.subopened);if(i.length)return void this.openPanel(i.first());s.addClass(t.opened),this.trigger("openPanel",n),this.trigger("openingPanel",n),this.trigger("openedPanel",n)}else{if(n.hasClass(t.current))return;var r=this.$pnls.children("."+t.panel),l=r.filter("."+t.current);r.removeClass(t.highest).removeClass(t.current).not(n).not(l).not("."+t.vertical).addClass(t.hidden),e[o].support.csstransitions||l.addClass(t.hidden),n.hasClass(t.opened)?n.nextAll("."+t.opened).addClass(t.highest).removeClass(t.opened).removeClass(t.subopened):(n.addClass(t.highest),l.addClass(t.subopened)),n.removeClass(t.hidden).addClass(t.current),a.trigger("openPanel",n),setTimeout((function(){n.removeClass(t.subopened).addClass(t.opened),a.trigger("openingPanel",n),a.__transitionend(n,(function(){a.trigger("openedPanel",n)}),a.conf.transitionDuration)}),this.conf.openingInterval)}},closePanel:function(e){var n=e.parent();n.hasClass(t.vertical)&&(n.removeClass(t.opened),this.trigger("closePanel",e),this.trigger("closingPanel",e),this.trigger("closedPanel",e))},closeAllPanels:function(){this.$menu.find("."+t.listview).children().removeClass(t.selected).filter("."+t.vertical).removeClass(t.opened);var e=this.$pnls.children("."+t.panel).first();this.$pnls.children("."+t.panel).not(e).removeClass(t.subopened).removeClass(t.opened).removeClass(t.current).removeClass(t.highest).addClass(t.hidden),this.openPanel(e)},togglePanel:function(e){var n=e.parent();n.hasClass(t.vertical)&&this[n.hasClass(t.opened)?"closePanel":"openPanel"](e)},getInstance:function(){return this},bind:function(e,n){this.cbck[e]=this.cbck[e]||[],this.cbck[e].push(n)},trigger:function(){var e=Array.prototype.slice.call(arguments),n=e.shift();if(this.cbck[n])for(var t=0,s=this.cbck[n].length;s>t;t++)this.cbck[n][t].apply(this,e)},_initMenu:function(){this.$menu.attr("id",this.$menu.attr("id")||this.__getUniqueId()),this.conf.clone&&(this.$menu=this.$menu.clone(!0),this.$menu.add(this.$menu.find("[id]")).filter("[id]").each((function(){e(this).attr("id",t.mm(e(this).attr("id")))}))),this.$menu.contents().each((function(){3==e(this)[0].nodeType&&e(this).remove()})),this.$pnls=e('<div class="'+t.panels+'" />').append(this.$menu.children(this.conf.panelNodetype)).prependTo(this.$menu),this.$menu.parent().addClass(t.wrapper);var n=[t.menu];this.opts.slidingSubmenus||n.push(t.vertical),this.opts.extensions=this.opts.extensions.length?"mm-"+this.opts.extensions.join(" mm-"):"",this.opts.extensions&&n.push(this.opts.extensions),this.$menu.addClass(n.join(" "))},_initPanels:function(n){var a=this,i=this.__findAddBack(n,"ul, ol");this.__refactorClass(i,this.conf.classNames.inset,"inset").addClass(t.nolistview+" "+t.nopanel),i.not("."+t.nolistview).addClass(t.listview);var o=this.__findAddBack(n,"."+t.listview).children();this.__refactorClass(o,this.conf.classNames.selected,"selected"),this.__refactorClass(o,this.conf.classNames.divider,"divider"),this.__refactorClass(o,this.conf.classNames.spacer,"spacer"),this.__refactorClass(this.__findAddBack(n,"."+this.conf.classNames.panel),this.conf.classNames.panel,"panel");var r=e(),l=n.add(n.find("."+t.panel)).add(this.__findAddBack(n,"."+t.listview).children().children(this.conf.panelNodetype)).not("."+t.nopanel);this.__refactorClass(l,this.conf.classNames.vertical,"vertical"),this.opts.slidingSubmenus||l.addClass(t.vertical),l.each((function(){var n=e(this),s=n;n.is("ul, ol")?(n.wrap('<div class="'+t.panel+'" />'),s=n.parent()):s.addClass(t.panel);var i=n.attr("id");n.removeAttr("id"),s.attr("id",i||a.__getUniqueId()),n.hasClass(t.vertical)&&(n.removeClass(a.conf.classNames.vertical),s.add(s.parent()).addClass(t.vertical)),r=r.add(s)}));var c=e("."+t.panel,this.$menu);r.each((function(n){var i,o,r=e(this),l=r.parent(),c=l.children("a, span").first();if(l.is("."+t.panels)||(l.data(s.sub,r),r.data(s.parent,l)),l.children("."+t.next).length||l.parent().is("."+t.listview)&&(i=r.attr("id"),o=e('<a class="'+t.next+'" href="#'+i+'" data-target="#'+i+'" />').insertBefore(c),c.is("span")&&o.addClass(t.fullsubopen)),!r.children("."+t.navbar).length&&!l.hasClass(t.vertical)){l.parent().is("."+t.listview)?l=l.closest("."+t.panel):(c=l.closest("."+t.panel).find('a[href="#'+r.attr("id")+'"]').first(),l=c.closest("."+t.panel));var d=!1,p=e('<div class="'+t.navbar+'" />');if(a.opts.navbar.add&&r.addClass(t.hasnavbar),l.length){switch(i=l.attr("id"),a.opts.navbar.titleLink){case"anchor":d=c.attr("href");break;case"panel":case"parent":d="#"+i;break;default:d=!1}p.append('<a class="'+t.btn+" "+t.prev+'" href="#'+i+'" data-target="#'+i+'" />').append(e('<a class="'+t.title+'"'+(d?' href="'+d+'"':"")+" />").text(c.text())).prependTo(r)}else a.opts.navbar.title&&p.append('<a class="'+t.title+'">'+a.opts.navbar.title+"</a>").prependTo(r)}}));var d=this.__findAddBack(n,"."+t.listview).children("."+t.selected).removeClass(t.selected).last().addClass(t.selected);d.add(d.parentsUntil("."+t.menu,"li")).filter("."+t.vertical).addClass(t.opened).end().each((function(){e(this).parentsUntil("."+t.menu,"."+t.panel).not("."+t.vertical).first().addClass(t.opened).parentsUntil("."+t.menu,"."+t.panel).not("."+t.vertical).first().addClass(t.opened).addClass(t.subopened)})),d.children("."+t.panel).not("."+t.vertical).addClass(t.opened).parentsUntil("."+t.menu,"."+t.panel).not("."+t.vertical).first().addClass(t.opened).addClass(t.subopened);var p=c.filter("."+t.opened);return p.length||(p=r.first()),p.addClass(t.opened).last().addClass(t.current),r.not("."+t.vertical).not(p.last()).addClass(t.hidden).end().filter((function(){return!e(this).parent().hasClass(t.panels)})).appendTo(this.$pnls),r},_initAnchors:function(){var n=this;i.$body.on(a.click+"-oncanvas","a[href]",(function(s){var a=e(this),i=!1,r=n.$menu.find(a).length;for(var l in e[o].addons)if(e[o].addons[l].clickAnchor.call(n,a,r)){i=!0;break}var c=a.attr("href");if(!i&&r&&c.length>1&&"#"==c.slice(0,1))try{var d=e(c,n.$menu);d.is("."+t.panel)&&(i=!0,n[a.parent().hasClass(t.vertical)?"togglePanel":"openPanel"](d))}catch(e){}if(i&&s.preventDefault(),!i&&r&&a.is("."+t.listview+" > li > a")&&!a.is('[rel="external"]')&&!a.is('[target="_blank"]')){n.__valueOrFn(n.opts.onClick.setSelected,a)&&n.setSelected(e(s.target).parent());var p=n.__valueOrFn(n.opts.onClick.preventDefault,a,"#"==c.slice(0,1));p&&s.preventDefault(),n.__valueOrFn(n.opts.onClick.close,a,p)&&n.close()}}))},_initAddons:function(){var n;for(n in e[o].addons)e[o].addons[n].add.call(this),e[o].addons[n].add=function(){};for(n in e[o].addons)e[o].addons[n].setup.call(this)},_getOriginalMenuId:function(){var e=this.$menu.attr("id");return e&&e.length&&this.conf.clone&&(e=t.umm(e)),e},__api:function(){var n=this,t={};return e.each(this._api,(function(e){var s=this;t[s]=function(){var e=n[s].apply(n,arguments);return void 0===e?t:e}})),t},__valueOrFn:function(e,n,t){return"function"==typeof e?e.call(n[0]):void 0===e&&void 0!==t?t:e},__refactorClass:function(e,n,s){return e.filter("."+n).removeClass(n).addClass(t[s])},__findAddBack:function(e,n){return e.find(n).add(e.filter(n))},__filterListItems:function(e){return e.not("."+t.divider).not("."+t.hidden)},__transitionend:function(e,n,t){var s=!1,i=function(){s||n.call(e[0]),s=!0};e.one(a.transitionend,i),e.one(a.webkitTransitionEnd,i),setTimeout(i,1.1*t)},__getUniqueId:function(){return t.mm(e[o].uniqueId++)}},e.fn[o]=function(t,s){return n(),t=e.extend(!0,{},e[o].defaults,t),s=e.extend(!0,{},e[o].configuration,s),this.each((function(){var n=e(this);if(!n.data(o)){var a=new e[o](n,t,s);a.$menu.data(o,a.__api())}}))},e[o].support={touch:"ontouchstart"in window||navigator.msMaxTouchPoints||!1,csstransitions:function(){if("undefined"!=typeof Modernizr&&void 0!==Modernizr.csstransitions)return Modernizr.csstransitions;var e=(document.body||document.documentElement).style,n="transition";if("string"==typeof e[n])return!0;var t=["Moz","webkit","Webkit","Khtml","O","ms"];n=n.charAt(0).toUpperCase()+n.substr(1);for(var s=0;s<t.length;s++)if("string"==typeof e[t[s]+n])return!0;return!1}()})}(d),c="offCanvas",(s=d)[l="mmenu"].addons[c]={setup:function(){if(this.opts[c]){var e=this.opts[c],n=this.conf[c];r=s[l].glbl,this._api=s.merge(this._api,["open","close","setPage"]),("top"==e.position||"bottom"==e.position)&&(e.zposition="front"),"string"!=typeof n.pageSelector&&(n.pageSelector="> "+n.pageNodetype),r.$allMenus=(r.$allMenus||s()).add(this.$menu),this.vars.opened=!1;var t=[a.offcanvas];"left"!=e.position&&t.push(a.mm(e.position)),"back"!=e.zposition&&t.push(a.mm(e.zposition)),this.$menu.addClass(t.join(" ")).parent().removeClass(a.wrapper),this.setPage(r.$page),this._initBlocker(),this["_initWindow_"+c](),this.$menu[n.menuInjectMethod+"To"](n.menuWrapperSelector);var i=window.location.hash;if(i){var o=this._getOriginalMenuId();o&&o==i.slice(1)&&this.open()}}},add:function(){a=s[l]._c,i=s[l]._d,o=s[l]._e,a.add("offcanvas slideout blocking modal background opening blocker page"),i.add("style"),o.add("resize")},clickAnchor:function(e,n){if(!this.opts[c])return!1;var t=this._getOriginalMenuId();return t&&e.is('[href="#'+t+'"]')?(this.open(),!0):r.$page?!(!(t=r.$page.first().attr("id"))||!e.is('[href="#'+t+'"]')||(this.close(),0)):void 0}},s[l].defaults[c]={position:"left",zposition:"back",blockUI:!0,moveBackground:!0},s[l].configuration[c]={pageNodetype:"div",pageSelector:null,noPageSelector:[],wrapPageIfNeeded:!0,menuWrapperSelector:"body",menuInjectMethod:"prepend"},s[l].prototype.open=function(){if(!this.vars.opened){var e=this;this._openSetup(),setTimeout((function(){e._openFinish()}),this.conf.openingInterval),this.trigger("open")}},s[l].prototype._openSetup=function(){var e=this,n=this.opts[c];this.closeAllOthers(),r.$page.each((function(){s(this).data(i.style,s(this).attr("style")||"")})),r.$wndw.trigger(o.resize+"-"+c,[!0]);var t=[a.opened];n.blockUI&&t.push(a.blocking),"modal"==n.blockUI&&t.push(a.modal),n.moveBackground&&t.push(a.background),"left"!=n.position&&t.push(a.mm(this.opts[c].position)),"back"!=n.zposition&&t.push(a.mm(this.opts[c].zposition)),this.opts.extensions&&t.push(this.opts.extensions),r.$html.addClass(t.join(" ")),setTimeout((function(){e.vars.opened=!0}),this.conf.openingInterval),this.$menu.addClass(a.current+" "+a.opened)},s[l].prototype._openFinish=function(){var e=this;this.__transitionend(r.$page.first(),(function(){e.trigger("opened")}),this.conf.transitionDuration),r.$html.addClass(a.opening),this.trigger("opening")},s[l].prototype.close=function(){if(this.vars.opened){var e=this;this.__transitionend(r.$page.first(),(function(){e.$menu.removeClass(a.current).removeClass(a.opened),r.$html.removeClass(a.opened).removeClass(a.blocking).removeClass(a.modal).removeClass(a.background).removeClass(a.mm(e.opts[c].position)).removeClass(a.mm(e.opts[c].zposition)),e.opts.extensions&&r.$html.removeClass(e.opts.extensions),r.$page.each((function(){s(this).attr("style",s(this).data(i.style))})),e.vars.opened=!1,e.trigger("closed")}),this.conf.transitionDuration),r.$html.removeClass(a.opening),this.trigger("close"),this.trigger("closing")}},s[l].prototype.closeAllOthers=function(){r.$allMenus.not(this.$menu).each((function(){var e=s(this).data(l);e&&e.close&&e.close()}))},s[l].prototype.setPage=function(e){var n=this,t=this.conf[c];e&&e.length||(e=r.$body.find(t.pageSelector),t.noPageSelector.length&&(e=e.not(t.noPageSelector.join(", "))),e.length>1&&t.wrapPageIfNeeded&&(e=e.wrapAll("<"+this.conf[c].pageNodetype+" />").parent())),e.each((function(){s(this).attr("id",s(this).attr("id")||n.__getUniqueId())})),e.addClass(a.page+" "+a.slideout),r.$page=e,this.trigger("setPage",e)},s[l].prototype["_initWindow_"+c]=function(){r.$wndw.off(o.keydown+"-"+c).on(o.keydown+"-"+c,(function(e){return r.$html.hasClass(a.opened)&&9==e.keyCode?(e.preventDefault(),!1):void 0}));var e=0;r.$wndw.off(o.resize+"-"+c).on(o.resize+"-"+c,(function(n,t){if(1==r.$page.length&&(t||r.$html.hasClass(a.opened))){var s=r.$wndw.height();(t||s!=e)&&(e=s,r.$page.css("minHeight",s))}}))},s[l].prototype._initBlocker=function(){var e=this;this.opts[c].blockUI&&(r.$blck||(r.$blck=s('<div id="'+a.blocker+'" class="'+a.slideout+'" />')),r.$blck.appendTo(r.$body).off(o.touchstart+"-"+c+" "+o.touchmove+"-"+c).on(o.touchstart+"-"+c+" "+o.touchmove+"-"+c,(function(e){e.preventDefault(),e.stopPropagation(),r.$blck.trigger(o.mousedown+"-"+c)})).off(o.mousedown+"-"+c).on(o.mousedown+"-"+c,(function(n){n.preventDefault(),r.$html.hasClass(a.modal)||(e.closeAllOthers(),e.close())})))},function(e){var n,t,s,a="mmenu",i="scrollBugFix";e[a].addons[i]={setup:function(){var o=this,r=this.opts[i];if(this.conf[i],s=e[a].glbl,e[a].support.touch&&this.opts.offCanvas&&this.opts.offCanvas.blockUI&&("boolean"==typeof r&&(r={fix:r}),"object"!=typeof r&&(r={}),(r=this.opts[i]=e.extend(!0,{},e[a].defaults[i],r)).fix)){var l=this.$menu.attr("id"),c=!1;this.bind("opening",(function(){this.$pnls.children("."+n.current).scrollTop(0)})),s.$docu.on(t.touchmove,(function(e){o.vars.opened&&e.preventDefault()})),s.$body.on(t.touchstart,"#"+l+"> ."+n.panels+"> ."+n.current,(function(e){o.vars.opened&&(c||(c=!0,0===e.currentTarget.scrollTop?e.currentTarget.scrollTop=1:e.currentTarget.scrollHeight===e.currentTarget.scrollTop+e.currentTarget.offsetHeight&&(e.currentTarget.scrollTop-=1),c=!1))})).on(t.touchmove,"#"+l+"> ."+n.panels+"> ."+n.current,(function(n){o.vars.opened&&e(this)[0].scrollHeight>e(this).innerHeight()&&n.stopPropagation()})),s.$wndw.on(t.orientationchange,(function(){o.$pnls.children("."+n.current).scrollTop(0).css({"-webkit-overflow-scrolling":"auto"}).css({"-webkit-overflow-scrolling":"touch"})}))}},add:function(){n=e[a]._c,e[a]._d,t=e[a]._e},clickAnchor:function(e,n){}},e[a].defaults[i]={fix:!0}}(d)}},function(e){e(e.s=2878)}]);
|
2
2
|
//# sourceMappingURL=plugin.mobile_nav.js.map
|