(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-da605408"],{"0beb":function(t,e,o){"use strict";o.r(e);var i=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"book-detail"},[o("detail-title",{ref:"title",attrs:{showShelf:!0},on:{back:t.back}}),o("scroll",{ref:"scroll",staticClass:"content-wrapper",attrs:{top:42,bottom:52},on:{onScroll:t.onScroll}},[o("book-info",{attrs:{cover:t.cover,title:t.title,author:t.author,desc:t.desc}}),o("div",{staticClass:"book-detail-content-wrapper"},[o("div",{staticClass:"book-detail-content-title"},[t._v(t._s(t.$t("detail.copyright")))]),o("div",{staticClass:"book-detail-content-list-wrapper"},[o("div",{staticClass:"book-detail-content-row"},[o("div",{staticClass:"book-detail-content-label"},[t._v(t._s(t.$t("detail.publisher")))]),o("div",{staticClass:"book-detail-content-text"},[t._v(t._s(t.publisher))])]),o("div",{staticClass:"book-detail-content-row"},[o("div",{staticClass:"book-detail-content-label"},[t._v(t._s(t.$t("detail.category")))]),o("div",{staticClass:"book-detail-content-text"},[t._v(t._s(t.categoryText))])]),o("div",{staticClass:"book-detail-content-row"},[o("div",{staticClass:"book-detail-content-label"},[t._v(t._s(t.$t("detail.lang")))]),o("div",{staticClass:"book-detail-content-text"},[t._v(t._s(t.lang))])]),o("div",{staticClass:"book-detail-content-row"},[o("div",{staticClass:"book-detail-content-label"},[t._v(t._s(t.$t("detail.ISBN")))]),o("div",{staticClass:"book-detail-content-text"},[t._v(t._s(t.isbn))])])])]),o("div",{staticClass:"book-detail-content-wrapper"},[o("div",{staticClass:"book-detail-content-title"},[t._v(t._s(t.$t("detail.navigation")))]),o("div",{staticClass:"book-detail-content-list-wrapper"},[this.navigation?t._e():o("div",{staticClass:"loading-text-wrapper"},[o("span",{staticClass:"loading-text"},[t._v(t._s(t.$t("detail.loading")))])]),o("div",{staticClass:"book-detail-content-item-wrapper"},t._l(t.flatNavigation,(function(e,i){return o("div",{key:i,staticClass:"book-detail-content-item",on:{click:function(o){return t.read(e)}}},[e.label?o("div",{staticClass:"book-detail-content-navigation-text",class:{"is-sub":e.deep>1},style:t.itemStyle(e)},[t._v(t._s(e.label)+"\n ")]):t._e()])})),0)])]),o("div",{staticClass:"book-detail-content-wrapper"},[o("div",{staticClass:"book-detail-content-title"},[t._v(t._s(t.$t("detail.trial")))]),o("div",{staticClass:"book-detail-content-list-wrapper"},[this.displayed?t._e():o("div",{staticClass:"loading-text-wrapper"},[o("span",{staticClass:"loading-text"},[t._v(t._s(t.$t("detail.loading")))])])]),o("div",{directives:[{name:"show",rawName:"v-show",value:this.displayed,expression:"this.displayed"}],ref:"preview",attrs:{id:"preview"}})])],1),o("div",{staticClass:"bottom-wrapper"},[o("div",{staticClass:"bottom-btn",on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.readBook()}}},[t._v(t._s(t.$t("detail.read")))]),o("div",{staticClass:"bottom-btn",on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.trialListening()}}},[t._v(t._s(t.$t("detail.listen")))]),o("div",{staticClass:"bottom-btn",on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.addOrRemoveShelf()}}},[t.inBookShelf?o("span",{staticClass:"icon-check"}):t._e(),t._v("\n "+t._s(t.inBookShelf?t.$t("detail.isAddedToShelf"):t.$t("detail.addOrRemoveShelf"))+"\n ")])]),o("toast",{ref:"toast",attrs:{text:t.toastText}})],1)},a=[],n=o("c893"),r=n["a"],s=(o("bea6"),o("2877")),c=Object(s["a"])(r,i,a,!1,null,"d7224684",null);e["default"]=c.exports},2909:function(t,e,o){"use strict";function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,i=new Array(e);ok;)p(v[k++]);u.constructor=l,l.prototype=u,o("2aba")(i,"RegExp",l)}o("7a56")("RegExp")},5147:function(t,e,o){var i=o("2b4c")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(o){try{return e[i]=!1,!"/./"[t](e)}catch(a){}}return!0}},"7a56":function(t,e,o){"use strict";var i=o("7726"),a=o("86cc"),n=o("9e1e"),r=o("2b4c")("species");t.exports=function(t){var e=i[t];n&&e&&!e[r]&&a.f(e,r,{configurable:!0,get:function(){return this}})}},"990f":function(t,e,o){},aae3:function(t,e,o){var i=o("d3f4"),a=o("2d95"),n=o("2b4c")("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[n])?!!e:"RegExp"==a(t))}},bea6:function(t,e,o){"use strict";o("990f")},c893:function(t,e,o){"use strict";(function(t){o("f559"),o("a481"),o("3b2b"),o("ac6a");var i=o("2909"),a=o("4785"),n=o("7da0"),r=o("4e1b"),s=o("ad72"),c=o("5de6"),l=o("b067"),d=o("fa7d"),u=o("101f"),f=o("e8ec"),h=o("a211");t.ePub=h["a"],e["a"]={components:{DetailTitle:a["a"],Scroll:r["a"],BookInfo:n["a"],Toast:s["a"]},computed:{desc:function(){return this.description?this.description.substring(0,100):""},flatNavigation:function(){return this.navigation?Array.prototype.concat.apply([],Array.prototype.concat.apply([],this.doFlatNavigation(this.navigation.toc))):[]},lang:function(){return this.metadata?this.metadata.language:"-"},isbn:function(){return this.metadata?this.metadata.identifier:"-"},publisher:function(){return this.metadata?this.metadata.publisher:"-"},title:function(){return this.metadata?this.metadata.title:""},author:function(){return this.metadata?this.metadata.creator:""},inBookShelf:function(){var t=this;if(this.bookItem&&this.bookShelf){var e=function t(e){var o;return(o=[]).concat.apply(o,Object(i["a"])(e.map((function(e){return e.itemList?[e].concat(Object(i["a"])(t(e.itemList))):e}))))}(this.bookShelf).filter((function(t){return 1===t.type})),o=e.filter((function(e){return e.fileName===t.bookItem.fileName}));return o&&o.length>0}return!1}},data:function(){return{bookShelf:null,bookItem:null,book:null,metadata:null,trialRead:null,cover:null,navigation:null,displayed:!1,audio:null,randomLocation:null,description:null,toastText:"",trialText:null,categoryText:null,opf:null}},methods:{addOrRemoveShelf:function(){this.inBookShelf?Object(c["k"])(this.bookItem):Object(c["c"])(this.bookItem),this.bookShelf=Object(f["f"])("bookShelf")},showToast:function(t){this.toastText=t,this.$refs.toast.show()},readBook:function(){var t=this;Object(u["b"])(this.bookItem.fileName,(function(e,o){!e&&o instanceof Blob?t.$router.push({path:"/ebook/".concat(t.bookItem.fileName)}):t.$router.push({path:"/ebook/".concat(t.bookItem.fileName),query:{opf:t.opf}})}))},trialListening:function(){var t=this;Object(u["b"])(this.bookItem.fileName,(function(e,o){!e&&o instanceof Blob?t.$router.push({path:"/book-store/book-speaking",query:{fileName:t.bookItem.fileName}}):t.$router.push({path:"/book-store/book-speaking",query:{fileName:t.bookItem.fileName,opf:t.opf}})}))},read:function(t){var e=this;Object(u["b"])(this.bookItem.fileName,(function(o,i){!o&&i instanceof Blob?e.$router.push({path:"/ebook/".concat(e.bookItem.fileName),query:{navigation:t.href}}):e.$router.push({path:"/ebook/".concat(e.bookItem.fileName),query:{navigation:t.href,opf:e.opf}})}))},itemStyle:function(t){return{marginLeft:(t.deep-1)*Object(d["c"])(20)+"rem"}},doFlatNavigation:function(t){var e=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=[];return t.forEach((function(t){t.deep=o,i.push(t),t.subitems&&t.subitems.length>0&&i.push(e.doFlatNavigation(t.subitems,o+1))})),i},initBook:function(){var t=this;this.bookItem&&Object(u["b"])(this.bookItem.fileName,(function(e,o){e?t.downloadBook():o?t.parseBook(o):t.downloadBook()}))},downloadBook:function(){var t="".concat("http://47.99.166.157/epub","/").concat(this.bookItem.categoryText,"/").concat(this.bookItem.fileName,"/OEBPS/package.opf");this.parseBook(t)},parseBook:function(t){var e=this;this.book=new h["a"](t),this.book.loaded.metadata.then((function(t){e.metadata=t})),this.book.loaded.navigation.then((function(t){e.navigation=t,e.navigation.toc&&e.navigation.toc.length>1&&e.display(e.navigation.toc[1].href).then((function(t){e.$refs.scroll&&e.$refs.scroll.refresh(),e.displayed=!0;var o=new RegExp("<.+?>","g"),i=t.output.replace(o,"").replace(/\s\s/g,"");e.description=i}))}))},findBookFromList:function(t){var e=this;Object(l["c"])().then((function(o){if(200===o.status){var i=o.data.data.filter((function(e){return e.fileName===t}));i&&i.length>0&&(e.bookItem=i[0],console.log(e.bookItem),e.initBook())}}))},init:function(){var t=this,e=this.$route.query.fileName;this.categoryText=this.$route.query.category,e&&Object(l["a"])({fileName:e}).then((function(o){if(200===o.status&&0===o.data.error_code&&o.data.data){var i=o.data.data;t.bookItem=i,t.cover=t.bookItem.cover;var a=i.rootFile;a.startsWith("/")&&(a=a.substring(1,a.length)),t.opf="".concat("http://47.99.166.157/epub2","/").concat(e,"/").concat(a),t.parseBook(t.opf)}else t.showToast(o.data.msg)})),this.bookShelf=Object(f["f"])("bookShelf")},back:function(){this.$router.go(-1)},display:function(t){if(this.$refs.preview)return this.rendition||(this.rendition=this.book.renderTo("preview",{width:window.innerWidth>640?640:window.innerWidth,height:window.innerHeight,method:"default"})),t?this.rendition.display(t):this.rendition.display()},onScroll:function(t){t>Object(d["d"])(42)?this.$refs.title.showShadow():this.$refs.title.hideShadow()}},mounted:function(){this.init()}}}).call(this,o("c8ba"))},d2c8:function(t,e,o){var i=o("aae3"),a=o("be13");t.exports=function(t,e,o){if(i(e))throw TypeError("String#"+o+" doesn't accept regex!");return String(a(t))}},f559:function(t,e,o){"use strict";var i=o("5ca1"),a=o("9def"),n=o("d2c8"),r="startsWith",s=""[r];i(i.P+i.F*o("5147")(r),"String",{startsWith:function(t){var e=n(this,t,r),o=a(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),i=String(t);return s?s.call(e,i,o):e.slice(o,o+i.length)===i}})}}]);