1 line
22 KiB
JavaScript
1 line
22 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-723bfbd6"],{2621:function(t,e){e.f=Object.getOwnPropertySymbols},2909:function(t,e,i){"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function o(t){if(Array.isArray(t))return n(t)}function a(t){if("undefined"!==typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function s(t,e){if(t){if("string"===typeof t)return n(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?n(t,e):void 0}}function r(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t){return o(t)||a(t)||s(t)||r()}i.d(e,"a",(function(){return c}))},3846:function(t,e,i){i("9e1e")&&"g"!=/./g.flags&&i("86cc").f(RegExp.prototype,"flags",{configurable:!0,get:i("0bfb")})},"3ecc":function(t,e,i){},"456d":function(t,e,i){var n=i("4bf8"),o=i("0d58");i("5eda")("keys",(function(){return function(t){return o(n(t))}}))},4917:function(t,e,i){"use strict";var n=i("cb7c"),o=i("9def"),a=i("0390"),s=i("5f1b");i("214f")("match",1,(function(t,e,i,r){return[function(i){var n=t(this),o=void 0==i?void 0:i[e];return void 0!==o?o.call(i,n):new RegExp(i)[e](String(n))},function(t){var e=r(i,t,this);if(e.done)return e.value;var c=n(t),h=String(this);if(!c.global)return s(c,h);var l=c.unicode;c.lastIndex=0;var f,u=[],d=0;while(null!==(f=s(c,h))){var g=String(f[0]);u[d]=g,""===g&&(c.lastIndex=a(h,o(c.lastIndex),l)),d++}return 0===d?null:u}]}))},5147:function(t,e,i){var n=i("2b4c")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(i){try{return e[n]=!1,!"/./"[t](e)}catch(o){}}return!0}},5158:function(t,e,i){"use strict";i.r(e),i.d(e,"uuid",(function(){return h}));var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"ebook-reader"},[t._m(0),t.showAnnotate&&!t.isMobile?i("div",{staticClass:"mm-annotate-menu",style:{left:t.left+"px",top:t.top+"px"}},[i("span",{staticClass:"mm-annotate-yellow",on:{click:function(e){return e.stopPropagation(),t.highlight("yellow")}}}),i("span",{staticClass:"mm-annotate-red",on:{click:function(e){return e.stopPropagation(),t.highlight("red")}}}),i("span",{staticClass:"mm-annotate-green",on:{click:function(e){return e.stopPropagation(),t.highlight("green")}}}),i("span",{staticClass:"mm-annotate-blue",on:{click:function(e){return e.stopPropagation(),t.highlight("blue")}}}),i("span",{staticClass:"mm-annotate-pink",on:{click:function(e){return e.stopPropagation(),t.highlight("pink")}}}),i("span",{staticClass:"mm-annotate-delete",domProps:{innerHTML:t._s(t.deleteIcon)},on:{click:function(e){return e.stopPropagation(),t.highlight("delete")}}})]):t._e(),t.showAnnotate&&t.isMobile?i("div",{staticClass:"mm-annotate-menu",style:{left:t.left+"px",top:t.top+"px"}},[i("span",{staticClass:"mm-annotate-yellow",on:{touchstart:function(e){return t.highlight("yellow")}}}),i("span",{staticClass:"mm-annotate-red",on:{touchstart:function(e){return t.highlight("red")}}}),i("span",{staticClass:"mm-annotate-green",on:{click:function(e){return t.highlight("green")}}}),i("span",{staticClass:"mm-annotate-blue",on:{touchstart:function(e){return t.highlight("blue")}}}),i("span",{staticClass:"mm-annotate-pink",on:{touchstart:function(e){return t.highlight("pink")}}})]):t._e()])},o=[function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"read-wrapper"},[i("div",{attrs:{id:"read"}})])}],a=(i("4917"),i("2909")),s=(i("5df3"),i("7f7f"),i("ac6a"),i("6b54"),i("ac0d")),r=i("5de6"),c=(i("101f"),i("e8ec"));function h(){function t(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return t()+t()+"-"+t()+"-"+t()}var l={mixins:[s["b"]],data:function(){return{havePaginate:!1,isOnline:!1,annotations:[],currentSection:null,showAnnotate:!1,left:0,top:0,selectedCfiRange:"",selectedText:"",isUpdate:!1,updateId:"",isMobile:!1,clickAnnotate:1,_viewMark:"",epubId:"",deleteIcon:'<svg style="display:block;margin-left:2px;margin-top:2px" fill="#333" t="1638263240663" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2292" width="20" height="20"><path d="M768 384c-19.2 0-32 12.8-32 32l0 377.6c0 25.6-19.2 38.4-38.4 38.4L326.4 832c-25.6 0-38.4-19.2-38.4-38.4L288 416C288 396.8 275.2 384 256 384S224 396.8 224 416l0 377.6c0 57.6 44.8 102.4 102.4 102.4l364.8 0c57.6 0 102.4-44.8 102.4-102.4L793.6 416C800 396.8 787.2 384 768 384z" p-id="2293"></path><path d="M460.8 736l0-320C460.8 396.8 448 384 435.2 384S396.8 396.8 396.8 416l0 320c0 19.2 12.8 32 32 32S460.8 755.2 460.8 736z" p-id="2294"></path><path d="M627.2 736l0-320C627.2 396.8 608 384 588.8 384S563.2 396.8 563.2 416l0 320C563.2 755.2 576 768 588.8 768S627.2 755.2 627.2 736z" p-id="2295"></path><path d="M832 256l-160 0L672 211.2C672 166.4 633.6 128 588.8 128L435.2 128C390.4 128 352 166.4 352 211.2L352 256 192 256C172.8 256 160 268.8 160 288S172.8 320 192 320l640 0c19.2 0 32-12.8 32-32S851.2 256 832 256zM416 211.2C416 198.4 422.4 192 435.2 192l153.6 0c12.8 0 19.2 6.4 19.2 19.2L608 256l-192 0L416 211.2z" p-id="2296"></path></svg>',prevIcon:'<svg style="display:block;margin-top:60px;margin-left:6px" fill="#999" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3166" width="32" height="32"><path d="M772.930954 40.644923L301.575877 512l471.355077 471.355077a23.809313 23.809313 0 0 1-33.671221 33.67122L251.069046 528.83561a23.809313 23.809313 0 0 1 0-33.67122L739.259733 6.973703a23.809313 23.809313 0 0 1 33.671221 33.67122z" p-id="3167"></path></svg>',nextIcon:'<svg style="display:block;margin-top:60px;margin-left:10px" fill="#999" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5429" width="32" height="32"><path d="M251.069046 983.355077l471.355077-471.355077L251.069046 40.644923A23.809313 23.809313 0 0 1 284.740267 6.973703l488.190687 488.190687a23.809313 23.809313 0 0 1 0 33.67122L284.740267 1017.026297A23.809313 23.809313 0 0 1 251.069046 983.355077z" p-id="5430"></path></svg>'}},methods:{move:function(t){var e=0;this.firstOffsetY?(e=t.changedTouches[0].clientY-this.firstOffsetY,this.$store.commit("SET_OFFSETY",e)):this.firstOffsetY=t.changedTouches[0].clientY,t.preventDefault(),t.stopPropagation()},onMouseEnter:function(t){this.mouseMove=1,this.mouseStartTime=t.timeStamp,t.preventDefault(),t.stopPropagation()},onMouseMove:function(t){if(1===this.mouseMove)this.mouseMove=2;else if(2===this.mouseMove){var e=0;this.firstOffsetY?(e=t.clientY-this.firstOffsetY,this.$store.commit("SET_OFFSETY",e)):this.firstOffsetY=t.clientY}t.preventDefault(),t.stopPropagation()},onMouseEnd:function(t){2===this.mouseMove&&(this.$store.dispatch("setOffsetY",0),this.firstOffsetY=0,this.mouseMove=3),this.mouseEndTime=t.timeStamp;var e=this.mouseEndTime-this.mouseStartTime;e<200&&(this.mouseMove=1),t.preventDefault(),t.stopPropagation()},moveEnd:function(t){this.$store.dispatch("setOffsetY",0),this.firstOffsetY=0},onMaskClick:function(t){if(2===this.mouseMove);else if(1===this.mouseMove||4===this.mouseMove){var e=t.offsetX,i=window.innerWidth;e>0&&e<.3*i?this.prevPage():e>0&&e>.7*i?this.nextPage():this.toggleMenuVisible()}this.mouseMove=4},prevPage:function(){this.rendition&&(this.rendition.prev(),this.refreshLocation()),this.hideMenuVisible()},nextPage:function(){this.rendition&&(this.rendition.next(),this.refreshLocation()),this.hideMenuVisible()},addHighLight:function(t,e,i,n){var o=this;this.rendition.annotations.highlight(t,{id:i},(function(){var t=this.getAttribute("data-id");o.updateId=t,o.isUpdate=!0,o.showAnnotate=!0;var i=this.getBoundingClientRect();o.left=i.x;var n=i.height;n<30&&(n=30),o.top=i.y+n+10,o.clickAnnotate=1,window.parent.postMessage({_viewMark:o._viewMark,id:t,annotateType:"epub-highlight",text:e,type:"showMindmapAnnotate"},"*")}),null,{fill:n})},highlight:function(t){var e=this,i=this;if(this.isUpdate){var n,o;if(this.updateId)this.annotations.forEach((function(a,s){a.id==i.updateId&&(o=a.cfiRange,n=s,"delete"!=t&&(t!=a.color&&(e.rendition.annotations.remove(a.cfiRange,"highlight"),e.addHighLight(a.cfiRange,a.text,a.id,t)),a.color=t))})),o&&"delete"==t&&(this.rendition.annotations.remove(o,"highlight"),this.annotations.splice(n,1)),window.parent.postMessage({_viewMark:this._viewMark,annotations:this.annotations,type:"saveAnnotations"},"*");return this.isUpdate=!1,this.updateId="",void(this.showAnnotate=!1)}if(this.selectedCfiRange){var a=h();this.annotations.push({id:a,cfiRange:this.selectedCfiRange,text:this.selectedText,color:t,type:"epub-highlight"}),this.addHighLight(this.selectedCfiRange,this.selectedText,a,t),this.selectedCfiRange="",this.selectedText="",this.showAnnotate=!1,window.parent.postMessage({_viewMark:this._viewMark,annotations:this.annotations,type:"saveAnnotations"},"*")}},removeAnnotations:function(){var t=this;try{this.annotations.forEach((function(e){t.rendition.annotations.remove(e.cfiRange,"highlight")}))}catch(e){console.log(e)}},refreshAnnotations:function(){if(this.rendition){var t=this;this.rendition.views();this.annotations.forEach((function(e){t.rendition.annotations.highlight(e.cfiRange,{id:e.id},(function(){var i=this.getAttribute("data-id");t.updateId=i,t.isUpdate=!0,t.showAnnotate=!0;var n=this.getBoundingClientRect();t.left=n.x;var o=n.height;o<30&&(o=30),t.top=n.y+o+10,t.clickAnnotate=1,window.parent.postMessage({_viewMark:t._viewMark,id:e.id,annotateType:"epub-highlight",text:e.text,type:"showMindmapAnnotate"},"*")}),null,{fill:e.color})}))}},showToAnnotate:function(t){var e=this;this.annotations.length&&this.annotations.forEach((function(i){i.id==t&&e.rendition&&e.rendition.display(i.cfiRange)}))},initGuest:function(){var t=this,e=this,i=null;this.rendition.on("rendered",(function(n,o,a){t.removeAnnotations(),i&&clearTimeout(i),i=setTimeout((function(){t.refreshAnnotations(),e.epubId&&(setTimeout((function(){e.showToAnnotate(id)}),400),e.epubId="")}),600),o.document.addEventListener("click",(function(t){setTimeout((function(){if(e.isUpdate&&1==e.clickAnnotate)e.clickAnnotate++;else{e.isUpdate=!1;var i=o.window.getSelection();if(!i||i.isCollapsed){e.showAnnotate&&(e.showAnnotate=!1);var n=t.pageX,a=window.innerWidth,s=parseInt(n/a);n-=a*s,n>0&&n<.2*a?e.prevPage():n>0&&n>.8*a?e.nextPage():e.toggleMenuVisible()}}}),200)}))})),this.rendition.on("resized",(function(){var e=Object(c["h"])(t.fileName);e?t.display(e):t.display()}))},initTheme:function(){var t=Object(c["j"])(this.fileName);return t||(t=this.themeList[0].name,Object(c["u"])(this.fileName,t)),t},initFontSize:function(){var t=Object(c["d"])(this.fileName);return t||(t=16,Object(c["n"])(this.fileName,t)),t},initFontFamily:function(){var t=Object(c["c"])(this.fileName);return t||(t="Default",Object(c["m"])(this.fileName,t)),t},initRendition:function(){var t=this,e=this;this.rendition=this.book.renderTo("read",{width:window.innerWidth,height:window.innerHeight}),Promise.all([this.setDefaultTheme(this.initTheme()),this.setDefaultFontSize(this.initFontSize()),this.setDefaultFontFamily(this.initFontFamily())]).then((function(){if(t.switchTheme(),t.$route.query.navigation)t.display(t.$route.query.navigation);else{var e=Object(c["h"])(t.fileName);e?t.display(e):t.display()}})),this.rendition.hooks.content.register((function(t){Promise.all([t.addStylesheet("".concat("http://47.99.166.157/book/res","/fonts/daysOne.css")),t.addStylesheet("".concat("http://47.99.166.157/book/res","/fonts/tangerine.css")),t.addStylesheet("".concat("http://47.99.166.157/book/res","/fonts/montserrat.css")),t.addStylesheet("".concat("http://47.99.166.157/book/res","/fonts/cabin.css"))]).then((function(){}))})),this.rendition.on("selected",(function(i,n){t.selectedCfiRange=i,t.selectedText="",t.book.getRange(i).then((function(t){var i="";if(t){var o=t.getBoundingClientRect(),a=n.window.getSelection(),s=a.getRangeAt(0);if(s){o=s.getBoundingClientRect();for(var r=t.cloneContents(),c=0;c<r.children.length;c++)i+=r.children[c].textContent+" ";if(i=i.trim(),i||(i=t.toString()),e.selectedText=i,o){var h=o.x,l=parseInt(h/window.innerWidth),f=h-l*window.innerWidth,u=o.y,d=o.height||30;d<30&&(d=30),e.left=f,e.top=u+d+10,e.showAnnotate=!0}}}else;}))}))},parseBook:function(){var t=this;this.book.loaded.metadata.then((function(e){t.setMetadata(e),Object(c["r"])(t.fileName,e)})),this.isOnline?this.book.coverUrl().then((function(e){t.setCover(e)})):this.book.loaded.cover.then((function(e){t.book.archive.createUrl(e).then((function(e){t.setCover(e)}))})),this.book.loaded.navigation.then((function(e){var i=function t(e){var i;return(i=[]).concat.apply(i,Object(a["a"])(e.map((function(e){return[e].concat(Object(a["a"])(t(e.subitems)))}))))}(e.toc);function n(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=i.filter((function(e){return e.id===t.parent}))[0];return t.parent&&o?n(o,++e):e}i.forEach((function(t){t.level=n(t),t.total=0,t.pagelist=[],t.href.match(/^(.*)\.html$/)?t.idhref=t.href.match(/^(.*)\.html$/)[1]:t.href.match(/^(.*)\.xhtml$/)&&(t.idhref=t.href.match(/^(.*)\.xhtml$/)[1])})),t.setNavigation(i)})),this.book.ready.then((function(){return t.setCurrentBook(t.book),t.book.locations.generate(window.innerWidth/375*750*(Object(c["d"])(t.fileName)/16))})).then((function(e){e.forEach((function(e){var i=e.match(/\[(.*)\]!/)[1];t.navigation.forEach((function(t){t.idhref&&t.idhref.indexOf(i)>=0&&t.pagelist.push(e)}));var n=1;t.navigation.forEach((function(t,e){t.page=0===e?1:n,n+=t.pagelist.length+1}))})),t.setPagelist(e),t.setBookAvailable(!0),t.setIsPaginating(!1),t.refreshLocation()}))},initEpub:function(t){this.book=ePub(t),this.setCurrentBook(this.book),this.setIsPaginating(!0),this.setPaginate(this.$t("book.paginating")),this.initRendition(),this.initGuest(),this.parseBook()},resize:function(){var t=this;if(this.book){this.setCurrentBook(this.book),this.rendition.resize(window.innerWidth,window.innerHeight);var e=this.book.locations.generate(window.innerWidth/375*750*(Object(c["d"])(this.fileName)/16));e.then((function(e){e.forEach((function(e){var i=e.match(/\[(.*)\]!/)[1];t.navigation.forEach((function(t){t.idhref&&t.idhref.indexOf(i)>=0&&t.pagelist.push(e)}));var n=1;t.navigation.forEach((function(t,e){t.page=0===e?1:n,n+=t.pagelist.length+1}))})),t.setPagelist(e),t.setBookAvailable(!0),t.setIsPaginating(!1),t.refreshLocation()}))}}},mounted:function(){var t=this;window.addEventListener("message",(function(e){switch(e.data.type){case"showAnnotate":var i=e.data.id;i&&t.showToAnnotate(i);break;case"openEpub":e.data._viewMark&&(t._viewMark=e.data._viewMark),t.isMobile=e.data.isMobile;var n=e.data.language;"zh-cn"==n?Object(r["n"])(t,"cn"):Object(r["n"])(t,"en");var o=e.data.annotations;t.annotations=o;i=e.data.id;i&&(t.epubId=i),t.setFileName(e.data.basename).then((function(){t.initEpub(e.data.data),t.isOnline=!1}));break}}),!1);var e=null;window.addEventListener("resize",(function(){e&&clearTimeout(e),t.removeAnnotations(),e=setTimeout((function(){t.resize()}),1200)}))}},f=l,u=(i("cbdc"),i("2877")),d=Object(u["a"])(f,n,o,!1,null,"412c4c86",null);e["default"]=d.exports},"5df3":function(t,e,i){"use strict";var n=i("02f4")(!0);i("01f9")(String,"String",(function(t){this._t=String(t),this._i=0}),(function(){var t,e=this._t,i=this._i;return i>=e.length?{value:void 0,done:!0}:(t=n(e,i),this._i+=t.length,{value:t,done:!1})}))},"5eda":function(t,e,i){var n=i("5ca1"),o=i("8378"),a=i("79e5");t.exports=function(t,e){var i=(o.Object||{})[t]||Object[t],s={};s[t]=e(i),n(n.S+n.F*a((function(){i(1)})),"Object",s)}},"6b54":function(t,e,i){"use strict";i("3846");var n=i("cb7c"),o=i("0bfb"),a=i("9e1e"),s="toString",r=/./[s],c=function(t){i("2aba")(RegExp.prototype,s,t,!0)};i("79e5")((function(){return"/a/b"!=r.call({source:"a",flags:"b"})}))?c((function(){var t=n(this);return"/".concat(t.source,"/","flags"in t?t.flags:!a&&t instanceof RegExp?o.call(t):void 0)})):r.name!=s&&c((function(){return r.call(this)}))},"7f7f":function(t,e,i){var n=i("86cc").f,o=Function.prototype,a=/^\s*function ([^ (]*)/,s="name";s in o||i("9e1e")&&n(o,s,{configurable:!0,get:function(){try{return(""+this).match(a)[1]}catch(t){return""}}})},"8e6e":function(t,e,i){var n=i("5ca1"),o=i("990b"),a=i("6821"),s=i("11e9"),r=i("f1ae");n(n.S,"Object",{getOwnPropertyDescriptors:function(t){var e,i,n=a(t),c=s.f,h=o(n),l={},f=0;while(h.length>f)i=c(n,e=h[f++]),void 0!==i&&r(l,e,i);return l}})},"990b":function(t,e,i){var n=i("9093"),o=i("2621"),a=i("cb7c"),s=i("7726").Reflect;t.exports=s&&s.ownKeys||function(t){var e=n.f(a(t)),i=o.f;return i?e.concat(i(t)):e}},aae3:function(t,e,i){var n=i("d3f4"),o=i("2d95"),a=i("2b4c")("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[a])?!!e:"RegExp"==o(t))}},ac0d:function(t,e,i){"use strict";i.d(e,"b",(function(){return l})),i.d(e,"a",(function(){return f}));i("8e6e"),i("456d"),i("a481"),i("f559"),i("7f7f"),i("ac6a");function n(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var o=i("2f62"),a=i("5de6"),s=i("fa7d"),r=i("e8ec");function c(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function h(t){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?c(Object(i),!0).forEach((function(e){n(t,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(i,e))}))}return t}var l={computed:h(h({},Object(o["c"])(["fileName","menuVisible","settingVisible","defaultFontSize","defaultFontFamily","fontFamilyVisible","defaultTheme","bookAvailable","progress","section","isPaginating","currentBook","navigation","cover","metadata","paginate","pagelist","offsetY","isBookmark","speakingIconBottom"])),{},{themeList:function(){return Object(a["o"])(this)},getSectionName:function(){if(this.section){var t=this.currentBook.section(this.section);if(t&&t.href&&this.currentBook&&this.currentBook.navigation){var e=this.navigation[this.section];return e?e.label:""}}}}),data:function(){return{fontSizeList:a["b"],fontFamily:a["a"]}},methods:h(h({},Object(o["b"])(["setFileName","setMenuVisible","setSettingVisible","setDefaultFontSize","setDefaultFontFamily","setFontFamilyVisible","setDefaultTheme","setBookAvailable","setProgress","setSection","setIsPaginating","setCurrentBook","setNavigation","setCover","setMetadata","setPaginate","setPagelist","setOffsetY","setIsBookmark","setSpeakingIconBottom"])),{},{showFontFamilySetting:function(){this.setFontFamilyVisible(!0)},showSetting:function(t){this.setSettingVisible(t)},hideMenuVisible:function(){this.setMenuVisible(!1),this.setSettingVisible(-1),this.setFontFamilyVisible(!1)},toggleMenuVisible:function(){this.menuVisible&&(this.setSettingVisible(-1),this.setFontFamilyVisible(!1)),this.setMenuVisible(!this.menuVisible)},hideFontFamilySetting:function(){this.setFontFamilyVisible(!1)},setGlobalTheme:function(t){switch(Object(s["e"])(),t){case"Default":Object(s["a"])("".concat("http://47.99.166.157/book/res","/theme/theme_default.css"));break;case"Eye":Object(s["a"])("".concat("http://47.99.166.157/book/res","/theme/theme_eye.css"));break;case"Gold":Object(s["a"])("".concat("http://47.99.166.157/book/res","/theme/theme_gold.css"));break;case"Night":Object(s["a"])("".concat("http://47.99.166.157/book/res","/theme/theme_night.css"));break;default:this.setDefaultTheme("Default"),Object(s["a"])("".concat("http://47.99.166.157/book/res","/theme/theme_default.css"));break}},registerTheme:function(){var t=this;this.themeList.forEach((function(e){t.currentBook.rendition.themes.register(e.name,e.style)}))},switchTheme:function(){var t=this,e=this.themeList.filter((function(e){return e.name===t.defaultTheme}))[0];this.defaultFontFamily&&"Default"!==this.defaultFontFamily?e.style.body["font-family"]="".concat(this.defaultFontFamily,"!important"):e.style.body["font-family"]="Times New Roman!important",this.registerTheme(),this.currentBook.rendition.themes.select(this.defaultTheme),this.currentBook.rendition.themes.fontSize(this.defaultFontSize),this.setGlobalTheme(this.defaultTheme)},setFontSize:function(t){var e=this;this.setDefaultFontSize(t).then((function(){e.switchTheme(),r["n"](e.fileName,t)}))},setTheme:function(t){var e=this;this.setDefaultTheme(t).then((function(){e.switchTheme(),r["u"](e.fileName,t)}))},setFontFamily:function(t){var e=this;this.setDefaultFontFamily(t).then((function(){e.switchTheme(),r["m"](e.fileName,t)}))},displaySection:function(t){var e=this,i=this.currentBook.section(this.section);i&&i.href&&this.currentBook.rendition.display(i.href).then((function(){e.refreshLocation(),t&&t()}))},displayProgress:function(){var t=this,e=this.currentBook.locations.cfiFromPercentage(this.progress/100);this.currentBook.rendition.display(e).then((function(){t.refreshLocation()}))},display:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t?this.currentBook.rendition.display(t).then((function(){i&&t.startsWith("epubcfi")&&e.currentBook.getRange(t).then((function(i){e.currentBook.rendition.annotations.highlight(t,{},(function(t){}))})),e.refreshLocation()})):this.currentBook.rendition.display().then((function(){e.refreshLocation()})),this.hideMenuVisible()},refreshLocation:function(){var t=this.currentBook.rendition.currentLocation();if(t.start&&t.start.index){this.setSection(t.start.index);var e=this.currentBook.locations.percentageFromCfi(t.start.cfi);this.setProgress(Math.floor(100*e)),this.pagelist?t.start.location<=0?this.setPaginate(""):this.setPaginate(t.start.location+" / "+this.pagelist.length):this.setPaginate("");var i=t.start.cfi,n=r["b"](this.fileName);n&&n.some((function(t){return t.cfi===i}))?this.setIsBookmark(!0):this.setIsBookmark(!1),r["q"](this.fileName,i)}},getReadTime:function(){return this.$t("book.haveRead").replace("$1",Object(a["i"])(this.fileName))}})},f={methods:{showBookDetail:function(t){Object(a["m"])(this,t)}}}},cbdc:function(t,e,i){"use strict";i("3ecc")},d2c8:function(t,e,i){var n=i("aae3"),o=i("be13");t.exports=function(t,e,i){if(n(e))throw TypeError("String#"+i+" doesn't accept regex!");return String(o(t))}},f1ae:function(t,e,i){"use strict";var n=i("86cc"),o=i("4630");t.exports=function(t,e,i){e in t?n.f(t,e,o(0,i)):t[e]=i}},f559:function(t,e,i){"use strict";var n=i("5ca1"),o=i("9def"),a=i("d2c8"),s="startsWith",r=""[s];n(n.P+n.F*i("5147")(s),"String",{startsWith:function(t){var e=a(this,t,s),i=o(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),n=String(t);return r?r.call(e,n,i):e.slice(i,i+n.length)===n}})}}]); |